docs: entity-level unique: is described in the in-repo contract (#7228) - #7421
Merged
Merged
Conversation
#7116 let an entity-level `unique:` key name a cross-model to-one, and the only place the construct was written down at all was `intent-assistant-guide.md` - neither `.claude/docs/intent-layer.md` nor `engine-intent/CLAUDE.md` had ever described the composite business key from #6793/#6796. Both now carry it: the shape, the member rules the parser enforces (an own field or an own to-one; a to-many, a `subset`, a single-name key, a repeated member and a repeated key all refused), what `EdmIntentGenerator.uniqueConstraint` emits (the `<Entity>_<Member>` constraint name, the derived `upperSnake(entity)_upperSnake(member)` columns, the `properties` twin the modeler rebuilds the `.model` from, the authored or generated message), why a cross-model member needs no resolution step - the column name is derived from the names, and the consumer holds the target's id in its own FK column - and that a collision is answered 409 with that message. `IntentCrossModelUniqueIT.cleanup` asserted `greaterThanOrEqualTo(200)` on the unpublish, which accepts a 404 or a 500; it now uses the sibling `IntentCrossModelFormFieldIT`'s `both(greaterThanOrEqualTo(200)).and(lessThan(300))`. Fixes #7228 Co-Authored-By: Claude Opus 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.
The gap
#7116 (#7092) lets an entity-level
unique:key name a cross-model to-one. The only place that rule - or the construct itself, from #6793/#6796 - was written down isintent-assistant-guide.md..claude/docs/intent-layer.mdmentions only the field attributeuniqueand the schedule'sgenerate.unique:;engine-intent/CLAUDE.mdand the module README never described the composite business key at all.The change
Docs, plus one assertion.
.claude/docs/intent-layer.md- a paragraph beside the other entity-level constructs: the shape, the member rules, what is emitted, and why a cross-model member qualifies.components/engine/engine-intent/CLAUDE.md- the module-level bullet, next toimmutableWhen:/checks::UniqueIntent+validateUnique's refusals (a to-many, asubsetwhose column holds a normalized set rather than an identity, a single-name key naming the field attribute it duplicates, a repeated member, a repeated key), andEdmIntentGenerator.uniqueConstraint's output - the<Entity>_<Member>constraint name, theupperSnake(entity)_upperSnake(member)columns,columnsCsv, thepropertiestwin the modeler re-resolves when it rebuilds the.model, the authored-or-generatedmessage, the synthesized(partition, number)key of a partitionednumber:. The cross-model half is stated as the reason it needed no resolution step: the column name is derived from the names, and the consumer stores the target's id in its own FK column - the projection entity is only the read-side copy. Ends with where it is covered (IntentCrossModelUniqueIT, and thePartyCoderuntime fixture inIntentEmissionCoverageIT).IntentCrossModelUniqueIT.cleanup-statusCode(greaterThanOrEqualTo(200))accepts a 404 and a 500, so a teardown that stopped working would stay green. Nowboth(greaterThanOrEqualTo(200)).and(lessThan(300)), as in the siblingIntentCrossModelFormFieldIT.Verification
mvn -o -pl tests/tests-integrations compile- BUILD SUCCESS (the newboth/lessThanimports).mvn -o -pl tests/tests-integrations formatter:validatewith the formatter cache wiped first - BUILD SUCCESS.Fixes #7228
🤖 Generated with Claude Code