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

+6
View File
@@ -107,3 +107,9 @@ Reason: a shared code cannot establish whether Copy moves occur often enough to
RFC 0037's implementation/spec integration is prepared under P6-7; formal RFC status remains Proposed for owner adoption. Spec 10 §2 and spec 15 §10 define one typed related record for each identified E2101/E2104 conflict and E4302 task. Definition lookup retains the selected conflict; loan metadata retains the creating spawn even when a cancelled join replaces its SSA handle. Source mapping is independent, and an absent mapping exposes AIR coordinates without a guessed source position. Primary selection, fields and duplicate suppression are unchanged. There is no enclosing-block inference, conflict enumeration or edit.
The invariant is unchanged acceptance, ownership/loan verification and deterministic interpreter behavior; provenance never participates in liveness or transfer decisions. AIR format 0, syntax, effects/capabilities and diagnostic codes are unchanged. Positive/rejected source/AIR fixtures, repeated cancelled joins, CLI/package mapping and typed serialization tests check the contract. Bundle growth is measured in docs/agent/README.md. This improves factual repair context; no measured repair-cost or MCC claim is made, and RFC 0038 stays deferred pending evidence.
## DD-019 — Unique diagnostic fields preserve the machine envelope
Compatibility review found legacy payload collisions: unsupported AIR narrowing and unknown source capability kinds each emitted a second `kind`, and unlock with a live guard borrow emitted `borrow` twice. Ordinary JSON consumers lost the stable machine kind or one identity. Spec 10 §2 requires unique names and reserves envelope fields. Capability payloads use `capability_kind`; unlock reports the selected `borrow` and its `guard` separately, retaining the borrow seen by former last-key-wins readers. Clients must read the capability payload by its new name; stable diagnostic kinds are restored rather than redefined.
These are diagnostic corrections, not new source/AIR or ownership/concurrency rules. Existing rejection codes, positions, conflict selection, guard/loan state and deterministic execution remain unchanged; valid capabilities and guard programs remain accepted. Pipeline/CLI tests reproduce the three cases, the verifier unit helper checks payload uniqueness across its existing rejection tests, and conformance validates every final mapped diagnostic's fields and serialized JSON. The invariant is an unambiguous machine diagnostic without hidden loss of context. Budget growth is recorded in docs/agent/README.md; no repair candidate or measured MCC benefit is introduced.