Skip to content

BS-29: the canonical diagnostic as language-1.2 source (first slice of the driver, #274) - #455

Closed
humuhumu33 wants to merge 3 commits into
release/v0.4from
claude/issue-274-diagnostics
Closed

humuhumu33 wants to merge 3 commits into
release/v0.4from
claude/issue-274-diagnostics

Conversation

@humuhumu33

Copy link
Copy Markdown
Contributor

Part of #274: the canonical diagnostic and the failure it makes (BS-29, diagnostic.rs and error.rs) as language-1.2 source, with roots diagnosticText, sortDiagnostics, and reportDiagnostics of Diagnostics. It is the first slice of the driver, and it stacks on nothing: the branch is release/v0.4 after #394, and the module imports only the standard library.

Design

diagnosticText writes the canonical JSON of Diagnostic::to_json as to_canonical_string does: members in the order of their keys, strings through the standard library's escapeString, counts in decimal. sortDiagnostics sorts as sort_canonical does, by a byte key whose order is the oracle's tuple order (the path with each nul byte doubled and ended by two nul bytes, the byte start in eight bytes big-endian, the seven bytes of the code, the message), with the stable sortByKey. reportDiagnostics is LexLeanError::from_diagnostics(..).bounded(..): the exit code of the most severe class of the codes, and past the cap the first diagnostics and the LLS8002 diagnostic, whose class then counts. None of the three admits recursion.

Evidence

Measured on the normative host on release/v0.4 at 4318b17b8:

Leg Runs Agreed
named vectors 29 (11 written, 9 sorted, 9 reported), reaching every class of failure and both sides of the cap all
the 306 committed expected diagnostics of the 303 negative fixtures, each first checked to be what the oracle writes written, sorted per fixture and together, reported under four caps all
evaluator, with 200 seeded sets 472 texts, 513 sorts, 1,422 reports all
pinned rustc, with 1,000 seeded sets 4,641 all
planted defects, each on its own named vector 23 all detected

Lean verifies the module, and the eligibility report gives each root exactly allocation and overflow. The first run found one fault of the module, which VERIFICATION.md records: the keyed list was built in reverse before the stable sort, so diagnostics with equal keys came out reversed. A plant now holds it.

Gates at the head

cargo fmt --check, validate-model (479 IDs), validate-spec-links (479 rows), clippy on the workspace with -D warnings, and the 17 RP cases pass.

CI is expected red until the regeneration

The three packages are not committed, so conformance_bs_29 stops at the stack-bound step after the differentials above have agreed. The regeneration owes them, the lock, the bootstrap expected/ records, and the recount of the bootstrap count cases.

🤖 Generated with Claude Code

humuhumu33 and others added 3 commits November 10, 2026 00:45
The first slice of the driver as source (#274): the row (register 478 ->
479, the §31 table, the RP-07 check and its case), the scenario, the §17.23
prose, the CHANGELOG entry, the README's claim, the CI part, and the case,
conformance_bs_29, which holds Diagnostics.diagnosticText, sortDiagnostics,
and reportDiagnostics to Diagnostic::to_json, sort_canonical, and
LexLeanError::from_diagnostics(..).bounded(..) on hand-built diagnostics
that reach every class of failure and both sides of the cap, on the 306
committed expected diagnostics of the negative fixtures, and on seeded
sets, with 23 planted defects each named by its vector. VERIFICATION.md
records the first run: the evaluator agrees on 472 texts, 513 sorts, and
1,422 reports, rustc on 4,641 runs, and every plant is detected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bootstrap/src/Diagnostics.lex.tex: diagnosticText writes the canonical JSON
of a diagnostic with the standard library's escaper; sortDiagnostics sorts
by an order-preserving byte key with the stable sortByKey; reportDiagnostics
gives the failure's exit code and caps the diagnostics with LLS8002. Lean
verifies the module and each root is eligible with exactly allocation and
overflow. The entrypoint, the lock, the three export roots, and the project
README follow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The row's sections cell named §17.21, where the notation is; the
diagnostic is §20.1 and the failure it makes §24.5.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@humuhumu33

Copy link
Copy Markdown
Contributor Author

Landed in #480 (merge aaf845507 on release/v0.4), which carries this change with the BS-25..34 batch, regenerated together and verified by full gate run 43135541484. The branch is kept.

@humuhumu33 humuhumu33 closed this Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant