fix(validation): inherited-attr edges in identity accessors + filterable/discriminator validation (#56 follow-up)#58
Merged
Conversation
…ble/discriminator validation (#56 follow-up) Addresses the UNSURE items from the #56 audit — own-only reads that break under attr-level (ADR-0029) inheritance, where the codegen counterpart already reads effective: - C# MetaIdentity: Fields/Unique/Generation/References/Enforce switched OwnAttr → Attr. Same ADR-0029 identity edge fixed in TS (#57) — an identity that inherits @fields via node-level extends without restating it now resolves its key (was: empty → no PK). + a regression gate (InheritWithoutRestateGateTests) mirroring the TS pk-resolver gate. - Python validation: validate_discriminator @values and validation_passes @filterable/@db.indexed reads switched attr() → attrs().get() — an inherited enum's members no longer false-reject a discriminator value, and an inherited @filterable field is validated consistently with the (already-effective) codegen. - Java ValidationPhase: @filterable/@db.indexed field reads and the warnFilterableWithoutIndex index-collection identity @fields read switched (.., false) → (.., true). (validateIdentityNode was already FR-024-correct — conditional effective-when-super-present — and is left as-is.) Left own-only deliberately: the validation reference-walk (validate-at-declaration) and the M:N junction identity.reference reads (the junction must declare its references locally). Verified, no regressions: Java metadata 1058, C# conformance 665 + codegen 12 (+1 gate), Python 1207. Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Follow-up to #57 (the #56 codegen fix). Addresses the UNSURE items from the #56 audit — own-only reads in validation and identity accessors that break under attr-level (ADR-0029) inheritance, where the codegen counterpart already reads effective.
Fixes
MetaIdentity—Fields/Unique/Generation/References/EnforceswitchedOwnAttr→Attr. The same ADR-0029 identity edge fixed in TS (GATE (intentionally RED until #56): inherit-without-restate codegen tripwires #57): an identity that inherits@fieldsvia node-levelextendswithout restating it now resolves its key (was: empty → no PK). + a regression gate (InheritWithoutRestateGateTests) mirroring the TS pk-resolver gate.validate_discriminator@valuesandvalidation_passes@filterable/@db.indexedreads switchedattr()→attrs().get(): an inherited enum's members no longer false-reject a discriminator value, and an inherited@filterablefield is validated consistently with the (already-effective) codegen.ValidationPhase—@filterable/@db.indexedfield reads + thewarnFilterableWithoutIndexindex-collection identity@fieldsread switched(…, false)→(…, true).Deliberately left own-only
validateIdentityNode(Java) was already FR-024-correct — it uses effective-when-a-super-is-present conditionally — so it's untouched.identity.referencereads (the junction must declare its references locally) — own-only is correct there.Verified — no regressions
Java metadata 1058 · C# conformance 665 + codegen 12 (+1 new gate) · Python 1207.
Closes the remaining UNSURE items from #56. (TS
migrate-tssource@kindown-only is correct under the "sources are always declared own, never inherited" invariant — left as-is.)🤖 Generated with Claude Code