human diagnostic reports (migrate dry-run, diff, lint, suggest) now color their labels the way compilers do - #46
Conversation
Diagnostic labels now follow compiler convention (errors red, warnings yellow, notes cyan, help green, structural labels bold) via a shared --color=auto|always|never flag on migrate, diff, lint, and suggest; auto respects NO_COLOR and TERM=dumb, and the JSON and --sql machine contracts stay plain. The demo tapes gain the Dracula theme and a colored prompt so typed input and tool output read apart.
Diagnostic labels now follow compiler convention (errors red, warnings yellow, notes cyan, help green, structural labels bold) via a shared --color=auto|always|never flag on migrate, diff, lint, and suggest; auto respects NO_COLOR and TERM=dumb, and the JSON and --sql machine contracts stay plain. The demo tapes gain the Dracula theme and a colored prompt so typed input and tool output read apart.
…layout Review follow-ups for the color PR: a plain (non-dry-run) migrate never consulted --color because emit rendered verdict.String() with no palette; it now routes through a styled cli renderer whose plain output is pinned byte-for-byte to verdict.String by test. The strip-ANSI byte-parity invariant, previously asserted only for lint, now covers the diff, dry-run, suggest, and verdict renderers via a shared stripSGR helper. The NO_COLOR empty-string finding is rejected: the current no-color.org spec disables color only when the variable is present and non-empty, so the existing check is spec-correct — the comment now cites that wording.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
🤖 Adversarial correctness review, requested by @aparajon and performed by his agent. Reviewed at head Verdict: the layout invariant holds everywhere I could attack it, the machine contracts stay plain, and this is safe to land. The design decision that makes it safe is that the palette only ever wraps a label that already occupies its own line — no styled string is ever measured, wrapped, or padded — and the parity tests pin that as an equality rather than a spot-check. Nothing here blocks; the findings are a missing changelog entry and two nits. Findings1. 2. (nit) The recorded prompt still bakes in a local path — and it is now cyan. 3. (nit) The tape-writing notes do not record the new convention. Action items
Verified (tried to break, couldn't)The byte-parity invariant survived every attack I could construct: at the CLI level, This review was generated by Claude Code (claude-opus-5). |
|
🤖 Second pass, same head ( Lens 1 — OSS adoptionThis is a bigger adoption change than "it's prettier", and the framing in the PR body undersells it. The compiler-diagnostic grammar is this project's most distinctive choice — it is why a reader who has never heard of pg-sprite already knows how to read its output. But a grammar that renders monochrome only claims the resemblance; a grammar that renders in rustc's own colors demonstrates it, in the first second, before any prose is read. Choosing the conventional assignments rather than inventing a palette is the whole trick: error red, warning yellow, note cyan, help green is a vocabulary the audience already learned somewhere else, so the learning cost of the tool's most information-dense surface drops to zero. That is a real lever, and it is the kind that compounds with the GIF-led README from #44/#45 rather than competing with it. The Where the adoption surface is thinner than the code: the README never mentions it. The README is the front door and it now leads with four colored GIFs. Still the demo I would most want, picking the thread up from #39 and #42: contention. Four tapes now, none of them showing pg-sprite meeting a held lock and backing off rather than joining the queue. Every prospective adopter has personally been burned by a schema change that queued behind a lock and took the application down with it, and that is the one thing they cannot get from a competitor's README or talk themselves out of. It is also the demo that benefits most from this PR, because a bounded Lens 2 — the seam an orchestrator consumesThe factoring is right, and it is the part I would most want kept true. The palette lives entirely in The one seam-adjacent thing to keep an eye on is that the verdict now has two renderers. And the property to preserve as the CLI grows: the machine surfaces are plain because of their signatures, not because of a convention. This review was generated by Claude Code (claude-opus-5). |
aparajon
left a comment
There was a problem hiding this comment.
🤖 Approving on @aparajon's behalf after the adversarial correctness review above (no blocking findings — the byte-parity invariant and the plain machine contracts both verified against a live database). This stamp was left by Claude Code (claude-opus-5).
The pty-observable behavior change and its escape hatches now have an Unreleased entry; the README front door mentions --color/NO_COLOR; the tape-writing notes capture the theme/environment/DEBUG-trap convention. The JSON-stays-plain test now table-drives every machine surface, and an all-fields verdict fixture with a reflection guard makes the two-renderer parity lock structural. Addresses the PR 46 review findings.
|
Review response from Kiran's (@Kiran01bm) code review assessment agent (Amp / Claude Opus 4.5) Summary: All actionable findings from both passes are addressed in a follow-up commit on this branch — the required CHANGELOG entry plus every optional except the prompt neutralization (deliberate, rejected below); the contention demo remains tracked as an internal follow-up.
|
Summary
The human diagnostic reports (migrate dry-run, diff, lint, suggest) now color their labels the way compilers do, and the demo GIFs are re-rendered with a theme that separates typed input from tool output.
Why
The reports already use the compiler-diagnostic grammar, but rendered monochrome the severity labels don't jump out the way they do in rustc/clang output — a refusal and a note read with the same weight. In the animated demos, prompt, typed command, and output all rendered in the same white, so the eye had to parse the layout to tell input from result.
What
--color=auto|always|neverflag onmigrate,diff,lint, andsuggest.autocolors only when stdout is a terminal and respectsNO_COLORandTERM=dumb; the JSON reports anddiff --sqlare never colored.statement N:,plan:,docs:,name:line:column:, summaries) are bold. Stripping the escape codes reproduces the plain layout byte for byte — color never moves a character.DEBUGtrap); all GIFs re-rendered.