diag: add stable source reasons and diagnostic incidence reporting

This commit is contained in:
dev committed 2026-10-07 18:52:36 +03:00
1 parent 911982dd1c
commit dbd9763713
21 files changed
+571 -156

No files matched your search

+3 -3
View File
@@ -182,16 +182,16 @@ Updated count after RFC review: **1 concrete RFC candidate** (C5), **1 deferred
RFC 0038 is therefore retained with a recommendation to defer work, preserving formal Proposed status. Its byte offsets and file hash identify an exact edit for a programmatic applicator, but `expected: "[]"` does not identify a unique string replacement. Context plus edit line/column, or an explicitly invoked application command, remain design alternatives rather than adopted fixes. Resume review only after aggregate eligible per-run incidence with a defined denominator, evidence of material repair cost, and validation of the actual application workflow. No arbitrary N% is set from these reports; any owner-selected threshold and minimum sample size must precede a new cohort's evaluation. M/C may only check regression and cannot select or tune the feature. Frozen evaluation inputs remain untouched.
**Independent measurement prerequisite: stable E7006 reasons.** Current frontend E7006 diagnostics do not provide a stable `reason` discriminator. The move rejection in [lower.zig](../../src/frontend/lower.zig) exposes `name`/`type`, but the same rejection site can cover Copy values and other non-linear forms, and E7006 also covers unrelated constructs across frontend stages. Parsing `message` would violate the machine-readable intent of spec 14 §3.5 and cannot supply a reliable Copy-move incidence metric.
**Independent measurement prerequisite: stable E7006 reasons.** At the review baseline, frontend E7006 diagnostics did not provide a stable `reason` discriminator. The move rejection in [lower.zig](../../src/frontend/lower.zig) exposes `name`/`type`, but the same rejection site can cover Copy values and other non-linear forms, and E7006 also covers unrelated constructs across frontend stages. Parsing `message` would violate the machine-readable intent of spec 14 §3.5 and cannot supply a reliable Copy-move incidence metric.
Record a separate diagnostic-schema task, independent of RFC 0038's edits or application workflow, for owner routing to a plan task or RFC. Its proposed completion conditions are:
The review proposed a separate diagnostic-schema task, independent of RFC 0038's edits or application workflow, with these completion conditions:
- Specify stable `reason` values and coverage in spec/reference, distinguishing Copy-move rejection from borrowed/non-Copy moves and other covered invalid constructs. Keep E7006's code/kind and the language's accepted/rejected sets unchanged.
- Emit reasons from explicit frontend error classification, not message parsing or simply assigning one reason to every use of the shared code. Check JSON serialization, original source provenance and positive/negative examples for each specified reason; valid generic Copy transfer remains accepted.
- Keep missing/unclassified reasons explicitly unknown in measurements. Do not relabel historical records or infer their reasons from prose; adding fields to future runs does not recover old data.
- Separately extend evaluation reporting to aggregate affected source runs by `(code, reason)`, alongside existing code counts, with the agreed denominator/cutoff. Merely adding `reason` does not change `_diagnostic_codes`, which currently counts codes only. Both changes must precede the relevant future experiment's freeze.
The reason field improves machine repairability on its own; the reporting follow-up enables the Copy-move branch of 0038's evidence condition. E3101's code-level incidence can already be counted without this prerequisite. No task ID, implementation, new reason name or diagnostic-schema adoption is assigned by this assessment; the owner decides routing and scope.
The reason field improves machine repairability on its own; the reporting follow-up enables the Copy-move branch of 0038's evidence condition. E3101's code-level incidence can already be counted without this prerequisite. The assessment itself assigned no implementation or adoption. Subsequent language work implements the independent schema/reporting increment under [DD-017](decisions.md#dd-017--stable-e7006-reasons-before-repair-frequency-analysis) and [P6-7](../plan/phase-6-source-language.md): every E7006 has a registered reason, and ajieval reports observed occurrences and affected runs with unknown reasons/log availability retained. Code totals are unchanged. The reporting covers the entire recorded transcript; a future cohort must still specify its pre-acceptance cutoff, agent/toolchain strata and missing-data policy. No new experiment, repair-cost evidence or application-usability result is supplied; RFC 0038 remains Proposed with the deferral recommendation.
### C2 — Diagnostic statistics