diag: add factual related borrow and task locations
This commit is contained in:
1 parent
dbd9763713
commit
8ee0f4c2bf
27 files changed
+659
-18
No files matched your search
@@ -5,7 +5,7 @@ Scope: Diagnostic metadata for E2101, E2104 and E4302; AIR format 0 and `.aji` 0
|
||||
Language version: 0.1\
|
||||
Supersedes: —
|
||||
|
||||
This proposal is ready for owner review. It is not implemented or accepted; the following rule changes enter the specification only on acceptance.
|
||||
Implementation and spec integration are prepared together for owner adoption (P6-7/DD-018). Formal status remains Proposed; this does not record acceptance. The specification is authoritative for the prepared implementation, while this RFC retains its rationale and bounded scope.
|
||||
|
||||
## Motivation
|
||||
|
||||
@@ -23,7 +23,7 @@ An earlier position denotes a syntactic origin, not a claim that it ran before t
|
||||
|
||||
## Normative rule changes
|
||||
|
||||
Proposed addition to spec 10 §2, “Related locations”:
|
||||
Integrated in spec 10 §2, “Related locations”:
|
||||
|
||||
> A diagnostic MAY include `related_locations`, an ordered array of non-binding factual context records. Each record MUST contain `role` and `value`. The identity in `value` uses the existing diagnostic value naming convention. A located record MUST contain `file`, `line` and `col`, using the primary location's conventions. Additional fields MUST NOT change an existing field's meaning.
|
||||
>
|
||||
@@ -31,7 +31,7 @@ Proposed addition to spec 10 §2, “Related locations”:
|
||||
>
|
||||
> The related record MUST describe the same conflict selected for the primary diagnostic. Implementations MUST NOT enumerate other conflicts as part of this extension. The primary position, existing structured fields, error code, diagnostic ordering and duplicate suppression MUST retain their existing meaning and selection behavior.
|
||||
|
||||
Proposed addition to spec 15 §10, “Related source positions”:
|
||||
Integrated in spec 15 §10, “Related source positions”:
|
||||
|
||||
> For a diagnostic from lowered AIR, each related AIR position MUST be mapped independently through the lowering source map, including the source file recorded for imported or specialized code. If mapped, `file`, `line` and `col` MUST denote that source construct, and `air_line`/`air_col` MUST retain its AIR position, as for the primary diagnostic.
|
||||
>
|
||||
@@ -101,7 +101,7 @@ Consumers must tolerate optional metadata and an unmapped related source record.
|
||||
|
||||
## Spec integration
|
||||
|
||||
On acceptance, integrate the rules into:
|
||||
The prepared change integrates the rules into:
|
||||
|
||||
- spec 10 §2: envelope, roles, conditions, identity and serialization contract;
|
||||
- spec 15 §10: independent related-position source mapping and fallback;
|
||||
@@ -112,7 +112,7 @@ On acceptance, integrate the rules into:
|
||||
|
||||
Spec 10 §2 and spec 15 §10 already enter the AIR and source bundles respectively. Keep the necessary schema text there rather than adding the RFC rationale or repeated examples to every bundle page.
|
||||
|
||||
At integration, condense the schema and code-to-role mapping into a few table rows plus the required source-map/determinism invariants. Retain rationale, implementation discussion and test matrices here or in tests rather than expanding normative prose with them.
|
||||
The integration condenses the schema and code-to-role mapping into a few table rows plus the required source-map/determinism invariants. Rationale, implementation discussion and test matrices remain here or in tests rather than expanding normative prose with them.
|
||||
|
||||
## Compatibility and migration
|
||||
|
||||
@@ -129,7 +129,7 @@ Preserve current first-conflict selection and source diagnostic deduplication. D
|
||||
- Repairability: avoids searching for the selected earlier construct; does not promise a unique repair or lower total cost without measurement.
|
||||
- Existing primitives: sufficient for the programs and verifier; the current JSON envelope lacks structured related positions.
|
||||
- New diagnostics: no codes; an additive metadata field on three existing codes.
|
||||
- Bundle budget: proposed normative integration is not included in this draft. Baseline before this RFC, after the floating-point documentation clarification, is AIR 46,300 cl100k tokens; Quick 8,688, other source 64,160, full source 72,848. Implementation MUST measure AIR, Quick and source groups before/after integration. No projected token delta is presented as a measurement.
|
||||
- Bundle budget: measured integration after DD-017 (cl100k): AIR 46,937 → 47,328 (+391); Quick 8,807 → 8,859 (+52), other source 65,799 → 66,195 (+396), full source 74,606 → 75,054 (+448, +0.60%). Necessary schema/source-map rules enter the bundles, not this RFC. Other tokenizer totals and unchanged std size are recorded in docs/agent/README.md.
|
||||
|
||||
This is a diagnostic extension, not a semantic feature with a new source syntax. It still lands through spec, diagnostic API, verifier provenance, source mapping, Quick Reference and AIR/source CLI tests together; interpreter behavior must remain unchanged.
|
||||
|
||||
@@ -159,4 +159,4 @@ No semantic decision is delegated to implementation. The owner must decide adopt
|
||||
|
||||
## Draft validation
|
||||
|
||||
Both `.aji` code blocks were extracted and checked against the current compiler: the valid example returns 2 with fuel 1,000; the negative example rejects with E2101. Its selected `%data_4` definition is AIR line 13, mapping to source line 4, column 5. The JSON addition above is proposed output, not current compiler output. New metadata tests and implementation remain pending.
|
||||
Both `.aji` code blocks were extracted and checked against the baseline compiler: the valid example returns 2 with fuel 1,000; the negative example rejects with E2101. Its selected `%data_4` definition is AIR line 13, mapping to source line 4, column 5. The JSON addition above now matches the implemented metadata contract. The examples also have source/AIR conformance counterparts under `related_locations` and `related_borrow_*`. Validation results for the prepared implementation are recorded under P6-7; formal adoption remains the owner's decision.
|
||||
Reference in new issue
Block a user