Skip to content

docs: entity-level unique: is described in the in-repo contract (#7228) - #7421

Merged
delchev merged 1 commit into
masterfrom
issue-7228-entity-unique-docs
Sep 17, 2026
Merged

delchev merged 1 commit into
masterfrom
issue-7228-entity-unique-docs

Conversation

@delchev

@delchev delchev commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

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 is intent-assistant-guide.md. .claude/docs/intent-layer.md mentions only the field attribute unique and the schedule's generate.unique:; engine-intent/CLAUDE.md and 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 to immutableWhen: / checks:: UniqueIntent + validateUnique's refusals (a to-many, a subset whose 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), and EdmIntentGenerator.uniqueConstraint's output - the <Entity>_<Member> constraint name, the upperSnake(entity)_upperSnake(member) columns, columnsCsv, the properties twin the modeler re-resolves when it rebuilds the .model, the authored-or-generated message, the synthesized (partition, number) key of a partitioned number:. 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 the PartyCode runtime fixture in IntentEmissionCoverageIT).
  • IntentCrossModelUniqueIT.cleanup - statusCode(greaterThanOrEqualTo(200)) accepts a 404 and a 500, so a teardown that stopped working would stay green. Now both(greaterThanOrEqualTo(200)).and(lessThan(300)), as in the sibling IntentCrossModelFormFieldIT.

Verification

  • mvn -o -pl tests/tests-integrations compile - BUILD SUCCESS (the new both / lessThan imports).
  • mvn -o -pl tests/tests-integrations formatter:validate with the formatter cache wiped first - BUILD SUCCESS.
  • No production code changed, so no generated output moves.

Fixes #7228

🤖 Generated with Claude Code

#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>
@delchev
delchev merged commit 864ebc0 into master Sep 17, 2026
10 checks passed
@delchev
delchev deleted the issue-7228-entity-unique-docs branch September 17, 2026 12:52
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.

docs: entity-level unique: (and its cross-model to-one acceptance from #7116) is described in no CLAUDE.md or intent-layer.md

1 participant