Skip to content

intent: a related: register may show the audit columns of an audit: true source (#8062) - #8063

Merged
ThuF merged 1 commit into
masterfrom
issue-8062-related-audit-columns
Oct 22, 2026
Merged

ThuF merged 1 commit into
masterfrom
issue-8062-related-audit-columns

Conversation

@iliyan-velichkov

Copy link
Copy Markdown
Contributor

Cause

IntentParser.validateRelatedShow checked every show: name against the source's authored fields and relations only. The audit columns audit: true adds (CreatedAt, CreatedBy, UpdatedAt, UpdatedBy) were refused:

entity [Customer] related [SupportTicket] show references [CreatedAt] which is not a field or relation of [SupportTicket]

The generator already handled them: EdmIntentGenerator.relatedColumns resolves show: against the source's built properties, which include the audit properties, and the source's /search (what the register reads) returns them.

Change

  • IntentParser.validateRelatedShow: when the source is audit: true, the four audit names are known show: names, matched case-insensitively like every other entry. On a source without audit: true they are still refused, now with a message that names the flag: [CreatedAt] is an audit column, and [SupportTicket] is not audit: true.
  • No generation change. An audit timestamp property carries TIMESTAMP / DATETIME-LOCAL, and ModelParameterProcessor.relatedColumn derives the register's date: true from the type (TIMESTAMP → Date), so the column renders as a date-time. CreatedBy / UpdatedBy (VARCHAR) render as text. Models that show no audit column generate exactly as before.
  • Cross-model registers (model:): the parser never validates their show: names, because the source lives in another model it cannot see. The generator resolves them against the owner model's .model, which carries the audit properties when that source is audited. Nothing to change there.
  • intent-assistant-guide.md: the related rules now say an audit source's four audit columns may be shown.

Verification

  • New parser tests (IntentParserTest): anAuditSourcesCreatedAtAndCreatedByMayBeShown, anAuditColumnOfANonAuditSourceIsRejected (asserts the message), anUnknownShowEntryIsStillRejected (only the unknown name is reported).
  • New EDM test relatedShowCarriesTheAuditColumnsOfAnAuditSource: the register's CreatedAt column is TIMESTAMP / DATETIME-LOCAL, and CreatedBy is VARCHAR / TEXTBOX.
  • New ModelParameterProcessorTest.aRegisterColumnOverAnAuditTimestampRendersAsADate: the audit timestamp column gets date: true, and the audit user column gets no date, number or lookup flag.
  • IntentEmissionCoverageIT (generates, compiles and runs the app) gains a Person → Claim register over the audited Claim with show: [note, CreatedAt, CreatedBy]. It asserts the generated Person.related.js columns (CreatedAt has date: true, CreatedBy is plain text) and that the register's own call, POST ClaimController/search with equals: { Person: 2 }, returns the delegated claim with CreatedAt set and CreatedBy = admin. Green locally on H2.
  • Full engine-intent (1797) and ide-template (310) unit suites green; mvn -T 1C formatter:validate green with the formatter cache wiped.

Not verified locally: the PostgreSQL IT leg, and a browser look at the rendered register.

Fixes #8062

🤖 Generated with Claude Code

…rue source (#8062)

IntentParser.validateRelatedShow accepted only the source's authored
fields and relations, so a register naming CreatedAt / CreatedBy /
UpdatedAt / UpdatedBy was refused although the generator already resolves
those names to the audit properties audit: true adds, and the source's
/search returns them.

The four audit names are now known show: names when the source is
audit: true (case-insensitive, like every show: entry). On a source
without audit: true they stay refused, with a message naming the flag:
"[CreatedAt] is an audit column, and [SupportTicket] is not audit: true".
Generation is unchanged: an audit timestamp carries TIMESTAMP, which the
register column renders as a date (date: true), and an audit user renders
as text. A cross-model register's show: names were never validated by the
parser (the source lives in another model) and still are not.

Verified: engine-intent (1797) and ide-template (310) unit suites,
IntentEmissionCoverageIT (now with a Person -> Claim register over the
audited Claim: the generated column flags and the register's /search
returning CreatedAt / CreatedBy), formatter:validate with the cache wiped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ThuF
ThuF merged commit 87ce293 into master Oct 22, 2026
16 checks passed
@ThuF
ThuF deleted the issue-8062-related-audit-columns branch October 22, 2026 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

intent: a related: register may show the audit columns of an audit: true source (CreatedAt, CreatedBy, …)

2 participants