Skip to content

Commit c0fc085

Browse files
dmealingclaude
andcommitted
fix: pre-merge review — Python yaml ledger + spec doc Java section
Two non-blocking review findings from the FR5a fixture-migration review: - Python yaml drift gating was an inline set in test_yaml_conformance.py. Extracted to a sibling yaml-conformance-expected-failures.json ledger file matching the C# / Java pattern. Single source of truth; easier to audit. Drift summary preserved in the ledger's _drifts field. - spec/conformance-tests.md still described the Java conformance runner as "(in progress, H3b)" with a hypothetical path. Java shipped fully green long ago; updated the section to describe the live runner at server/java/metadata/src/test/java/com/metaobjects/conformance/ConformanceTest.java. Python conformance: 94/94 still green. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 3a9999d commit c0fc085

3 files changed

Lines changed: 26 additions & 15 deletions

File tree

server/python/tests/conformance/test_yaml_conformance.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,17 @@ def _discover() -> list[YamlFixture]:
105105

106106
_FIXTURES = _discover()
107107

108-
# FR5a envelope-shape gates — fixtures where Python's emitted source differs from
109-
# TS's (the FR5a reference port) by more than the jsonPath alone. Listed here so
110-
# the YAML conformance suite stays green; per-port reconciliation tracked in the
111-
# FR5a follow-up. Each entry MUST be accompanied by the drift summary.
112-
_FR5A_ENVELOPE_DRIFT_FIXTURES = {
113-
# Python threads source one level deeper, to the offending @attr; TS stops
114-
# at the parent object.entity.
115-
"error-yaml-reserved-as-attr",
116-
}
108+
# FR5a envelope-shape gates — sourced from a sibling ledger file (matching the
109+
# C# / Java pattern). Each entry is a known cross-port drift where Python's
110+
# emitted source field differs from TS's (the FR5a reference port) by more
111+
# than the jsonPath alone. The code-set check still runs; only the full-envelope
112+
# assertion is skipped. Reconcile per the FR5a follow-up.
113+
_LEDGER_PATH = Path(__file__).parent / "yaml-conformance-expected-failures.json"
114+
_FR5A_ENVELOPE_DRIFT_FIXTURES = (
115+
set(json.loads(_LEDGER_PATH.read_text(encoding="utf-8")).get("fixtures", []))
116+
if _LEDGER_PATH.exists()
117+
else set()
118+
)
117119

118120

119121
def _load_yaml_to_canonical(yaml_text: str) -> tuple[str, list[str], list[MetaError], list[str]]:
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"language": "python",
3+
"_comment": "FR5a envelope-shape gate: Python's emitted source field differs from TS (the FR5a reference port) for these YAML fixtures. The code-set check still runs; only the full-envelope assertion is skipped. Each entry MUST be accompanied by the drift summary below. Reconcile per the FR5a follow-up — make Python's error-construction sites emit the same canonical jsonPath TS does.",
4+
"fixtures": [
5+
"error-yaml-reserved-as-attr"
6+
],
7+
"_drifts": {
8+
"error-yaml-reserved-as-attr": "Python threads source one level deeper, to the offending @attr; TS stops at the parent object.entity."
9+
}
10+
}

spec/conformance-tests.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -156,13 +156,12 @@ directory, same canonical output. Auto-discovers fixtures from
156156
produces a different canonical string for any fixture, that's a bug in C#'s Loader or
157157
serializer — not in the fixture.
158158

159-
## Java conformance runner (in progress, H3b)
159+
## Java conformance runner
160160

161-
Same algorithm. H3a (loader-restructure) shipped 2026-05-19; H3b (conformance harness) is
162-
in progress. Will live at `java/<module>/src/test/java/com/metaobjects/ConformanceTest.java`.
163-
Same fixtures, same canonical output. If the Java implementation produces a different
164-
canonical string for any fixture, that's a bug in Java's Loader or serializer — not in the
165-
fixture.
161+
Lives at `server/java/metadata/src/test/java/com/metaobjects/conformance/ConformanceTest.java`
162+
and runs via `mvn -pl metadata test`. Same fixture directory, same canonical output.
163+
If the Java implementation produces a different canonical string for any fixture,
164+
that's a bug in Java's Loader or serializer — not in the fixture.
166165

167166
## Adding a new fixture
168167

0 commit comments

Comments
 (0)