fix(member-fields): treat referenceName as exact identity - #159
Merged
Conversation
2000game
added a commit
that referenced
this pull request
Aug 28, 2026
* fix(member-fields): reconcile rows that carry no referenceName Review follow-up to #159. Making `referenceName` the exact identity left the documented name fallback unreachable and pointed several diagnostics at a remedy that did not work. - A live row with no `referenceName` was matched by name and then rejected by every consumer, so it could be neither updated nor created: the plan went INCOMPLETE and apply aborted the whole run. Only a row carrying a DIFFERENT reference name is a contradiction now (`conflictingReferenceName`). - The actual side reports the declared reference name for such a row, since ct never PATCHes one onto it and diffing it would never converge. - A declared field whose live row has no reference name is no longer reported as a DELETE CANDIDATE; the pass now skips rows a declaration claimed. - Identity-mismatch messages offer the non-destructive fix (declare the live `referenceName`) beside `ct destroy`, and `ct destroy --member-field` resolves the STATE-BOUND row — it previously matched on the local key alone, reported "already absent", dropped the binding and let the next apply POST a duplicate. - A live field that only shares a declaration's display name now warns and creates instead of failing the run; a near-identity (same string up to punctuation/case) is still refused. - A ref into a group that is adopted but declares no `memberFields` states no exact identity, so it keeps matching on the normalised local key. - The duplicate-match error no longer claims no row carries the exact reference name when the matches are the rows that do. Claude-Session: https://claude.ai/code/session_01PNmsG3pmvxQNA9sNmnAvYJ * style: apply prettier to the member-field review fixes Claude-Session: https://claude.ai/code/session_01PNmsG3pmvxQNA9sNmnAvYJ
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.
Summary
referenceNamereferenceNameexactly, preserving punctuation and case (foo-barandfoo_barare distinct)referenceNameon create and during adoptionSafety semantics
referenceNameis identity-bearing because dynamic rulesets address it verbatim. ct-cli therefore never renames it during update. A mismatch blocks apply before writes and directs the operator to the existing explicit member-field destroy/recreate workflow.Tests
stand_bewerbung, API referencestand-bewerbung, ruleset assignmentstand-bewerbungfoo-barversusfoo_barmatching and duplicate-identity validationreferenceNameCloses #158