Skip to content

Commit d87690c

Browse files
fix(wire-shape): close stale cross-spec baseline shielding gap
Gate 1 (cross-spec divergence) only iterated currently observed schemas. A baselined divergence that the platform has since reconciled silently lingered in the baseline forever; the same old incompatible shape could be reintroduced and pass the gate because its fingerprint matched a stale entry that should have been deleted. Adds the reverse pass that Gate 2 already does for intra-file duplicates: any baselined cross-spec name that is no longer observed in the current specs fails the run with a pointer at the specific baseline key to delete. Verified locally: - Positive run on clean baseline still exits 0. - Adding a phantom 'PhantomDivergence' entry to baseline.cross_spec_ duplicates causes the validator to exit 1 with a clear "remove from baseline" message naming the stale key.
1 parent e265443 commit d87690c

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

scripts/wire_shape/validate.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,18 @@ def main() -> int:
100100
lines.append(f" baseline: {exp}")
101101
lines.append(f" observed: {obs}")
102102
cross_problems.append("\n".join(lines))
103+
# Reverse pass: a baselined cross-spec divergence that is no longer
104+
# observed must be removed from the baseline. Otherwise the stale
105+
# fingerprint shields a future reintroduction of the same old
106+
# incompatible shape from the gate.
107+
for name in baselined_cross:
108+
if name not in cross_spec:
109+
cross_problems.append(
110+
f" {name}: baselined cross-spec divergence no longer "
111+
f"observed — remove from "
112+
f"baseline.cross_spec_duplicates.{name} so a future "
113+
f"reintroduction of the same shape is caught as new."
114+
)
103115
if cross_problems:
104116
print("Cross-spec schema divergence gate failed:\n", file=sys.stderr)
105117
for p in cross_problems:

0 commit comments

Comments
 (0)