Repository navigation
intent: a related: register may show the audit columns of an audit: true source (#8062) - #8063
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cause
IntentParser.validateRelatedShowchecked everyshow:name against the source's authored fields and relations only. The audit columnsaudit: trueadds (CreatedAt,CreatedBy,UpdatedAt,UpdatedBy) were refused:The generator already handled them:
EdmIntentGenerator.relatedColumnsresolvesshow: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 isaudit: true, the four audit names are knownshow:names, matched case-insensitively like every other entry. On a source withoutaudit: truethey are still refused, now with a message that names the flag:[CreatedAt] is an audit column, and [SupportTicket] is not audit: true.TIMESTAMP/DATETIME-LOCAL, andModelParameterProcessor.relatedColumnderives the register'sdate: truefrom 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.model:): the parser never validates theirshow: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: therelatedrules now say an audit source's four audit columns may be shown.Verification
IntentParserTest):anAuditSourcesCreatedAtAndCreatedByMayBeShown,anAuditColumnOfANonAuditSourceIsRejected(asserts the message),anUnknownShowEntryIsStillRejected(only the unknown name is reported).relatedShowCarriesTheAuditColumnsOfAnAuditSource: the register'sCreatedAtcolumn isTIMESTAMP/DATETIME-LOCAL, andCreatedByisVARCHAR/TEXTBOX.ModelParameterProcessorTest.aRegisterColumnOverAnAuditTimestampRendersAsADate: the audit timestamp column getsdate: true, and the audit user column gets no date, number or lookup flag.IntentEmissionCoverageIT(generates, compiles and runs the app) gains aPerson→Claimregister over the auditedClaimwithshow: [note, CreatedAt, CreatedBy]. It asserts the generatedPerson.related.jscolumns (CreatedAthasdate: true,CreatedByis plain text) and that the register's own call,POST ClaimController/searchwithequals: { Person: 2 }, returns the delegated claim withCreatedAtset andCreatedBy=admin. Green locally on H2.engine-intent(1797) andide-template(310) unit suites green;mvn -T 1C formatter:validategreen 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