Repository navigation
intent: a check's when and a visibleWhen resolve a seeded name on any to-one relation (#8057) - #8059
Merged
iliyan-velichkov merged 1 commit intoOct 22, 2026
Conversation
… to-one relation (#8057) #8015 made a seeded name resolve on any to-one relation in a trigger guard and a where condition, but a check's `when` (requiredWhen, forbidWhen) and a field's or a composition child's `visibleWhen` still resolved a name only on the `function: EntityStatus` relation. `type == CLOSE` was refused as "not a value of that type", so a model had to compare the positional seed id, which a seed inserted mid-nomenclature silently retargets. StatusSymbolResolver now rewrites those conditions through one record-scoped pass: the record's own status first, then every other to-one relation against its own target's nomenclature. A forbidWhen/requiredWhen one-hop `Relation.Status` term keeps its hop-aware resolution, and a child's visibleWhen resolves against its master's relations. The relation is matched as the guard validator reads the property (CheckSupport.toOne: case-insensitive, to-one only). #8015's rules are unchanged: equality only, an unknown name or a cross-model target refused naming the site, numeric ids and fields untouched. Decisions and trigger guards keep their exact-name lookup. Verified: RelationSymbolIntentTest (10 new cases, red without the fix) and EdmVisibleWhenTest; the full engine-intent unit suite (1786); the new IntentRelationNameConditionsIT (generated form/panel gates compare the CLOSE seed id, the published controller refuses a CLOSE without a note and a note on an OPEN with the declared messages); IntentForbidWhenVerbsIT, IntentEmissionCoverageIT, IntentEngineIT; formatter:validate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
iliyan-velichkov
deleted the
issue-8057-relation-names-checks-visiblewhen
branch
October 22, 2026 15:16
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
#8015 made a seeded name resolve on any to-one relation in a process
trigger.whenand awherecondition. Two record-scoped sites still resolved a name only on thefunction: EntityStatusrelation: a check'swhen(requiredWhen,forbidWhen) and a field's or a composition child'svisibleWhen. Sotype == CLOSEwas refused with "compares [type], a [integer], with [CLOSE], which is not a value of that type", and a model had to write the positional seed id (type == 2). A seed inserted mid-nomenclature then silently retargets that id.Change
StatusSymbolResolverruns those conditions through one record-scoped pass (rewriteRecordWhen/rewriteRecordTerm):whenand a schedule'swhere#8015'srewriteRelationComparisons;forbidWhen/requiredWhenone-hopRelation.Statusterm keeps its existing hop-aware resolution, and only the record-local terms take the new pass;visibleWhenon a composition child resolves against its master's relations, as its status terms already did.The relation is matched the way the parser's guard validator reads the property (
CheckSupport.toOne: case-insensitive, to-one only), soType == CLOSEresolves too. Decisions and trigger guards keep their exact-name lookup and do not change.#8015's rules are unchanged:
nulltests are left alone.The class Javadoc and
intent-assistant-guide.mdnow list the new sites.Verification
RelationSymbolIntentTest: 10 new cases covering both check kinds in both forms, the typed check term (FK compared with2), case-insensitive naming, a field's and a child'svisibleWhen, an unknown or ordered name at each new site, a cross-model target, and numeric ids/fields left alone. Run against the unfixed resolver, all fail except the numeric-ids control.EdmVisibleWhenTest: the.modelscalar isType == 2.engine-intentunit suite: 1786 green.IntentRelationNameConditionsIT, which generates and publishes the issue's model:x-showcomparesString(form.Type)) === '2';visibleWhen: [{ property: 'Type', equal: true, value: '2' }];IntentForbidWhenVerbsIT,IntentEmissionCoverageIT,IntentEngineIT: green.mvn -T 1C formatter:validatewith the formatter cache wiped: green.Not run: the release-profile Javadoc build. The Javadoc changes are on a package-private class and private methods only. Also not run: the full IT suite or the PostgreSQL leg.
Out of scope, as the issue says: the other record-scoped
whensites (notifications,generates,postings,wait), and the docs-site/spec text.Fixes #8057
🤖 Generated with Claude Code