Skip to content

BS-30: the terminal output of diagnostics as language-1.2 source (#274) - #456

Closed
humuhumu33 wants to merge 3 commits into
claude/issue-274-diagnosticsfrom
claude/issue-274-cli-output
Closed

humuhumu33 wants to merge 3 commits into
claude/issue-274-diagnosticsfrom
claude/issue-274-cli-output

Conversation

@humuhumu33

Copy link
Copy Markdown
Contributor

Part of #274: the terminal output of diagnostics and the argument pre-scans of the command line (BS-30, cli.rs) as language-1.2 source, with roots humanDiagnostics, wantsJson, and namedCommand of CliOutput. It is the second slice of the driver.

Draft, stacked on #455 (BS-29). CliOutput writes the diagnostic type of BS-29.

Design

humanDiagnostics writes each diagnostic of a failure as the command line writes it to stderr in the human mode: error[CODE]: message, the primary location after an arrow, then its labels, notes, help, and causes one to a line, with the four SGR sequences of the palette around the parts the oracle colors, or none. wantsJson finds --diagnostic-format=json, or --diagnostic-format followed by json, among the arguments after the program, before they are parsed, so that a usage failure is reported in the JSON mode. namedCommand finds the first argument after the program that names one of the ten commands. Each root admits exactly allocation. Parsing the arguments, choosing color for a terminal, and the JSON command result stay in the host.

The oracle. These three are private in cli.rs, so the first commit exposes them unchanged: print_human_diagnostics behind a new doc-hidden public human_diagnostics_text, and wants_json and named_command made public and doc-hidden. cli.rs is outside the compiler-semantics identity, so nothing regenerates for it.

Evidence

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

Leg Runs Agreed
named vectors 32 (11 human, 12 scanned, 9 named), reaching every part of a diagnostic in both modes and both outcomes of the scan all
the 303 negative fixtures' committed diagnostics in both modes and their commands' arguments, and 200 seeded runs of each root, evaluator 817 human, 515 scanned, 512 named all
the same with 1,000 seeded runs of each root, pinned rustc 4,244 all
planted defects, each on its own named vector 15 all detected

Lean verifies the module, and the eligibility report gives each root exactly allocation.

Gates at the head

cargo fmt --check, validate-model (480 IDs), validate-spec-links (480 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_30 stops at the stack-bound step after the differentials above have agreed. The regeneration owes them, with #455's.

🤖 Generated with Claude Code

humuhumu33 and others added 3 commits November 10, 2026 01:17
…nctions

cli.rs's own print_human_diagnostics is reached through the new doc-hidden
public human_diagnostics_text, and wants_json and named_command become public
and doc-hidden, unchanged, so that the bootstrap differential of BS-30 can
call them. cli.rs is outside the compiler-semantics identity.

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

The second slice of the driver as source (#274), on BS-29: the row (register
479 -> 480, 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_30, which holds CliOutput.humanDiagnostics, wantsJson,
and namedCommand to cli::human_diagnostics_text, wants_json, and
named_command on hand-built diagnostics and arguments, on the negative
fixtures' committed diagnostics and commands, and on seeded ones, with 15
planted defects each named by its vector. VERIFICATION.md records the first
run: the evaluator agrees on 817, 515, and 512 runs, rustc on 4,244, and
every plant is detected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bootstrap/src/CliOutput.lex.tex over Diagnostics: humanDiagnostics writes a
failure's diagnostics as the command line writes them to stderr, with the
SGR palette or without; wantsJson and namedCommand scan the arguments after
the program. Lean verifies the module and each root is eligible with
exactly allocation. The entrypoint, the lock, the three export roots, and
the project README follow.

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