Commit b588175
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
- server/java/metadata
- src/main/java/com/metaobjects
- loader
- util
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
| 6 | + | |
16 | 7 | | |
17 | 8 | | |
0 commit comments