Repository navigation
fix(cli): make doctor text output use its JSON field names - #6516
Conversation
The doctor text view printed `label` as `check`, left out the stable `id`, and wrote the summary counts as a prose line, so a caller could not grep it by the keys it sees in --json. Each check and the summary now print under their JSON keys.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
Thanks for the focused fix — this restores the documented contract for astryx doctor text output.
- Each check now prints
id,status,label,message, andfixunder the same names as--json(previouslylabelappeared ascheck:and the stableidwas missing), and the summary printspass,warn,fail, andinfounder asummaryheading instead of a prose line, so agents and CI scripts can grep text output by the JSON keys. - The JSON envelope, exit codes, status tokens, and check logic are unchanged, and the patch changeset correctly treats this as a nonbreaking restoration.
- The new regression test ties each text record's keys to its JSON keys and the summary record to
data.summary, and the README Doctor example is updated to match.
One note for readers: callers that matched the old check: label or the prose Summary: sentence should switch to the documented JSON keys. No changes are requested.
[Automated review]
PR Analysis Report
No new or modified components detected. Bundle Size SummaryNo component packages changed. Accessibility AuditStatus: No accessibility violations detected. Visual Regression19 of 420 shot(s) changed. View the report A change here is a question, not a failure: check whether the after is the
Generated by PR Enrichment workflow | View full report |









User impact
astryx doctortext output is the documented projection ofastryx doctor --json, and agents and CI scripts grep it. Three fields did not match their JSON keys:labelascheck:;idwas not printed at all;summarycounts were a prose sentence (Summary: 8 passed, 0 warnings, 0 failures, 4 info), sopass,warn,fail, andinfocould not be matched.A caller that matched
^id:,^label:, or^fail:found nothing. After this change each check printsid,status,label,message, andfix, and the summary printspass,warn,fail, andinfounder asummaryheading.Problem and solution fit
printHumaninclients/cli/commands/doctor.mjsrenamedlabelwith the formatter'slabelsoption, leftidout of the field list, and wrote the summary as a prose line.id, which is the one value a caller can match across releases, was visible only in JSON, so a text reader had to match the human label, which can change.The fix lists the JSON keys as the text fields, removes the rename, and renders the summary with the shared
record()formatter.Expected behavior and authority
docs/architecture/cli-surface.md(authority: current):docs/specs/AST-017/spec.md(authority: current), FR13, decided by DEC-4:Compatibility under AST-017: the
--jsonenvelope, the exit codes, and the status tokens do not change. The text view is restored to the documented contract (FR5), so this is a nonbreaking patch.Smallest restoration
Only
printHumanchanges. The[ok]/[warn]/[fail]/[info]status tokens and the closing sentence stay as they are. Thedoctor integrationleaves are not touched. The example output in the CLI README's Doctor section is updated to match.Evidence
astryx doctorin a project printsstatus: [ok],check: Node.js version,message: ...with noid:line, thenSummary: 8 passed, 0 warnings, 0 failures, 4 info.id: node-version,status: [ok],label: Node.js version,message: ..., then asummaryheading withpass: 8,warn: 0,fail: 0,info: 4.astryx doctor --jsonemits the same envelope; the exit code is still 0 with no failures and 1 when a check fails.doctor — text output mirrors the JSONinclients/cli/commands/doctor.test.mjsruns the command with and without--json, requires each text record's keys to equal that check's JSON keys, and requires the summary record to equaldata.summary. It fails onmain. Each of these mutations also makes it fail: restoring the old printer, re-adding only thelabeltocheckrename, or dropping only the summary record.Scope
Testing