diag: preserve envelope fields and reject JSON key collisions in tests

This commit is contained in:
dev committed 2026-10-07 19:28:36 +03:00
1 parent 8ee0f4c2bf
commit 364eb57bbc
16 files changed
+166 -12

No files matched your search

+2
View File
@@ -51,3 +51,5 @@ Diagnostic JSON is a stable interface. Snapshot tests on the full JSON (not only
`python3 tests/hosted/source_diagnostic_reasons.py` checks stable E7006 categories, generic/package propagation and serialization. From `tools/eval`, `python3 -m unittest discover tests` checks reporting alongside the harness. `ajieval summary` reports observed `(code, reason)` occurrences and affected runs with log coverage; `profile` and `checkpoint` expose per-run pairs. Existing compact code extraction is preserved. Only whole JSON diagnostic lines classify a reason: unparsed or historical records remain unknown; new reason strings are retained. Missing logs are unavailable. These counts cover the recorded command outputs, not a pre-acceptance cutoff or the true frequency of unobserved errors; future cohort methodology must specify those separately.
`python3 tests/hosted/related_locations.py` checks factual E2101/E2104 definitions and E4302 spawns in public AIR/source rejects, exact definition coordinates (including parameters and second split results), independent annotation-map reconstruction, existing source deduplication, generics and explicit packages. Unit tests cover typed JSON/key order, absent related mappings and repeated cancelled-join handle replacement through the lowered-source pipeline. `zig build conformance -- --filter cancel_join --stress 200 --collect-every-step` exercises accepted cancellation counterparts under deterministic schedule seeds and several quanta. These checks add no repair or lifetime inference.
The CLI JSON reader rejects duplicate members instead of silently overwriting them; targeted capability-kind and live-guard cases check the stable machine `kind` and separate payload identities. Pipeline unit tests also parse those records with duplicate fields forbidden. `verifier.expectCodes` checks that all its diagnostics have distinct payload names that do not shadow the envelope (`diag.expectUniqueFields`). The conformance runner validates every final source/AIR diagnostic after lowering and mapping, including frontend-added fields, and parses its serialized JSON with duplicate members forbidden. This adds no production/runtime check.