Skip to content

Commit b588175

Browse files
dmealingclaude
andcommitted
feat(java): FR-013/014/015 loader validation passes (per-port fan-out)
Ports the three deferred validation passes from the TS reference into the Java loader (ValidationPhase), clearing 9 of the 11 deferred fixtures from the Java conformance ledger. - FR-013 validateFieldReadOnly — ERR_READONLY_ASSIGNED_PRIMARY, ERR_READONLY_DOWNGRADE, WARN_READONLY_VALUE_OBJECT. - FR-014 validateDiscriminator — ERR_DISCRIMINATOR_FIELD_NOT_FOUND, _VALUE_DUPLICATE, _VALUE_MISSING, _VALUE_TYPE_MISMATCH (4-pass). - FR-015 validateSourceParameterRef — ERR_PARAMETER_REF_ON_NON_CALLABLE_KIND (pre-resolution), _UNRESOLVED, _NOT_VALUE_OBJECT, _PASSTHROUGH_TYPE_MISMATCH. Wired into ValidationPhase.run after the FR-016 physical-name pass; each mirrors its TS counterpart's logic + error-code contract (eager-throw, Java idiom). Own-declared field nodes are read via raw own children (getChildren(false)) rather than the merge-folded getMetaFields() view so emitted envelopes carry the authored node's source. WARN_READONLY_VALUE_OBJECT added to ErrorMessageConstants. Two fixtures remain deferred — BOTH manifestations of one pre-existing Java subtype-field-override gap, orthogonal to the validation logic: - error-field-readonly-downgrade: validation fires the correct single ERR_READONLY_DOWNGRADE, but a field that OVERRIDES an inherited field gets a MergedSource (pointing at the base declaration) rather than the subtype's authored json source; Contributor carries no per-contributor jsonPath, so the authored path isn't recoverable post-merge (TS/Python keep the override's plain JsonSource). - field-readonly-upgrade-on-subtype: positive fixture failing on canonical serialization of the same subtype @readonly override (same root cause). Both are recorded honestly in the ledger for the Java field-override provenance/serializer reconciliation. Java metadata conformance + full module suite green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 20e0558 commit b588175

3 files changed

Lines changed: 370 additions & 11 deletions

File tree

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
11
{
22
"language": "java",
3-
"_comment": "FR-013 (@readOnly), FR-014 (TPH discriminator), and FR-015 (@parameterRef) are implemented in the TS reference but the Java port has not yet shipped them. These fixtures are deferred until each per-port fan-out lands.",
3+
"_comment": "FR-013 (@readOnly), FR-014 (TPH discriminator), and FR-015 (@parameterRef) VALIDATION passes shipped in the Java port (ValidationPhase.validateFieldReadOnly / validateDiscriminator / validateSourceParameterRef). 9 of 11 fixtures now pass byte-identically. The two remaining entries are BOTH manifestations of one pre-existing Java subtype-field-override gap (orthogonal to the validation fan-out), deferred until the Java loader's field-override provenance/serializer reconciliation: (1) error-field-readonly-downgrade — the validation fires the correct ERR_READONLY_DOWNGRADE with a single error, but the envelope source for a subtype field that OVERRIDES an inherited field is a MergedSource pointing at the base declaration (children[0]) rather than the subtype's authored json source (children[1]); Java clones+stamps MergedSource on extends-overrides, and Contributor carries no per-contributor jsonPath, so the subtype's authored path is not recoverable post-merge (the TS/Python reference models keep the override's plain JsonSource). (2) field-readonly-upgrade-on-subtype — a positive fixture that fails on canonical serialization of the same subtype @readOnly override (same root cause).",
44
"fixtures": [
5-
"error-field-readonly-assigned-primary",
65
"error-field-readonly-downgrade",
7-
"field-readonly-upgrade-on-subtype",
8-
"error-parameter-ref-unresolved",
9-
"error-parameter-ref-not-value-object",
10-
"error-parameter-ref-on-table-kind",
11-
"error-parameter-ref-passthrough-type-mismatch",
12-
"error-tph-discriminator-field-not-found",
13-
"error-tph-discriminator-value-duplicate",
14-
"error-tph-discriminator-value-missing",
15-
"error-tph-discriminator-value-type-mismatch"
6+
"field-readonly-upgrade-on-subtype"
167
]
178
}

0 commit comments

Comments
 (0)