Skip to content

fix(cli): os doctor --verbose no longer ends by telling you to run with --verbose - #35377

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-34866-doctor-verbose-hint
Nov 19, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-34866-doctor-verbose-hint

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #34866

repo:objectstack#1 · os-sales · session_01L6bhgTyMahdAdhXSzgy2nt

Clause-②: no
Metadata-protocol: none

维护者速读

  1. 改了什么:os doctor 以警告结束时,只有在没加 --verbose 的情况下才提示“Run with --verbose to see fix suggestions.”;加了 --verbose 的运行不再叫用户再加一次这个参数。
  2. 为什么改:开发者第一次接触 CLI 时,os doctor --verbose 的结尾让人去传一个已经传过的参数,提示本身是错的。
  3. 风险与回滚:只改了总结行的一个打印分支,不改退出码,也不改任何检查结果;撤回本 PR 即恢复原样。
  4. 先看:packages/cli/src/commands/doctor.ts(总结里 hasWarnings 分支的 if (!flags.verbose));packages/cli/src/commands/doctor-deprecation-hint-commands.test.ts(新增的 the warnings summary 两个用例)。
  5. 两分钟验证:pnpm --filter @objectstack/cli exec vitest run --project unit src/commands/doctor-deprecation-hint-commands.test.ts,预期 14 passed。
  6. 需要你做的:无,席位落地。

What changes

  • packages/cli/src/commands/doctor.ts: in the summary's hasWarnings branch, the line "Run with --verbose to see fix suggestions." is printed only when flags.verbose is false. Under --verbose every fix that doctor's warning paths have is already printed above the summary (renderHealthCheckResult prints fix when verbose, the dashboard-widget hint and the deprecation-scan replacement are verbose-gated), so the line pointed at nothing new.
  • Non-verbose output is byte-for-byte unchanged. Exit codes are unchanged.
  • .changeset/34866-doctor-verbose-hint.md: patch, @objectstack/cli.

Tests

  • packages/cli/src/commands/doctor-deprecation-hint-commands.test.ts: a new describe('the warnings summary') inside the existing real-Doctor.run() harness (same warning-bearing tree as the deprecation-scan cases). Both arms first assert the run reached the warnings branch of the summary, then judge the text after that verdict line by the flag it names: without --verbose it names --verbose; with --verbose it does not, and the per-finding replacement is on screen.

Acceptance notes

  • The mechanism assumption "under --verbose the fix suggestions are already printed" holds for every warning path that HAS a fix. Several warning paths have no fix in either mode: missing *.test.ts beside a *.zod.ts, @deprecated usages, circular dependencies, unused objects and orphan views print a bare printWarning. When only those warn, the non-verbose hint still promises fix suggestions that --verbose does not print. Measured through the built binary (node packages/cli/bin/run.js doctor, temp cwd with one packages/spec/src/a.zod.ts and no test): the non-verbose run ends with the hint; the --verbose run adds detail only to the ok environment rows and nothing to the warning. Not changed here (the dispatch scopes this PR to the verbose arm); reported to the seat.

Verification

All readings are against HEAD 081a5101.

Package tests and typecheck
  • pnpm --filter @objectstack/cli exec vitest run --project unit --maxWorkers=2 src/commands/doctor-deprecation-hint-commands.test.ts: Test Files 1 passed (1), Tests 14 passed (14).
  • pnpm --filter @objectstack/cli exec vitest run --project unit --maxWorkers=2 (whole unit tier): Test Files 427 passed, 2 failed (429); Tests 6113 passed, 29 skipped. The 2 failures were test/published-subpath-console.pin.test.ts and test/published-subpath-hook-body.pin.test.ts, both refusing because packages/cli/dist was not built yet. After building the CLI they were re-run: Test Files 2 passed (2), Tests 29 passed (29).
  • The integration tier is left to CI: the diff touches no integration-tier file and no spawn entry.
  • pnpm --filter @objectstack/cli run typecheck: exit 0 (tsc, then check:test-typecheck OK). The test file is in the tsc --noEmit program (--listFilesOnly count 1).
  • Public door: built os doctor in a temp cwd with a warning. Without the flag it ends with the hint. With --verbose it ends at "Environment is functional but has some warnings." with no hint.
Red first: ablation (scripts/ablation-replace.mjs, landed on disk and restored)
  • if (!flags.verbose) { replaced with if (true) {: anchor 1 to 0, blob 5b130dc6 to 3d34462d. Result: 1 failed, 13 passed. Only the case "drops that advice under --verbose" failed.
  • Restored: the blob after restore equals HEAD (5b130dc6) and git diff HEAD is empty.
  • The subject is imported as relative source (./doctor.js), so no dist rebuild was involved.
Gates (derived set, local)
  • node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derived 69 families. Each was run one by one, with the exit code captured before any pipe.
  • 67 exited 0. check:i18n, check:i18n-coverage and check:i18n-walk-parity first exited 3 (no CLI build). They exited 0 on re-run after the build.
  • 2 are NOT MEASURED, both exit 3 PREREQUISITE NOT MET. node scripts/check-plugin-teardown-shape.mjs --self-test needs history that a shallow clone lacks; it is checker-health only. pnpm check:dual-build-cjs-loads needs repo-wide dist. CI's Lint & Repo Gates runs both.
  • --ran reconciliation: "69 derived famil(ies) accounted for, 67 run, 2 NOT-MEASURED (2 DERIVED from a recorded exit 3)".
  • pnpm check:nul-bytes: exit 0. node scripts/pm/overlap-check.mjs: VERDICT clean (merges cleanly onto origin/main).

Generated by Claude Code

The warnings summary told an operator who had passed --verbose to pass it.
Gate the hint on the flag being off; pin both arms on the real command.

Claude-Session: https://claude.ai/code/session_01L6bhgTyMahdAdhXSzgy2nt
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/s documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 19, 2026
@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/cli, touching 1 documentable anchor(s).

9 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/automation/flows.mdx (via os doctor (command, read off packages/cli/src/commands/doctor.ts))
  • content/docs/automation/jobs.mdx (via os doctor (command, read off packages/cli/src/commands/doctor.ts))
  • content/docs/data-modeling/indexing.mdx (via os doctor (command, read off packages/cli/src/commands/doctor.ts))
  • content/docs/deployment/cli.mdx (via os doctor (command, read off packages/cli/src/commands/doctor.ts))
  • content/docs/deployment/environment-variables.mdx (via os doctor (command, read off packages/cli/src/commands/doctor.ts))
  • content/docs/deployment/production-readiness.mdx (via os doctor (command, read off packages/cli/src/commands/doctor.ts))
  • content/docs/protocol/backward-compatibility.mdx (via os doctor (command, read off packages/cli/src/commands/doctor.ts))
  • content/docs/protocol/kernel/config-resolution.mdx (via os doctor (command, read off packages/cli/src/commands/doctor.ts))
  • content/docs/protocol/kernel/http-protocol.mdx (via os doctor (command, read off packages/cli/src/commands/doctor.ts))

⛔ 2 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v16.mdx (via os doctor (command, read off packages/cli/src/commands/doctor.ts))
  • content/docs/releases/v17/17-5.mdx (via os doctor (command, read off packages/cli/src/commands/doctor.ts))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see

Coarse fallback — 40 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 9fea31685408b8ae1c678f696cdada1d3dfb6d51 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 834496aa6d897e4e5b2ecd564dc349c3027dbb75 — the merge of head 84c3ccfadd105a1a323f60a91b50b14af4bf659b into base 9fea31685408b8ae1c678f696cdada1d3dfb6d51, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 834496aa6d897e4e5b2ecd564dc349c3027dbb75 && git checkout 834496aa6d897e4e5b2ecd564dc349c3027dbb75
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 9fea31685408b8ae1c678f696cdada1d3dfb6d51 84c3ccfadd105a1a323f60a91b50b14af4bf659b && git checkout -B drift-repro 9fea31685408b8ae1c678f696cdada1d3dfb6d51 && git merge --no-ff 84c3ccfadd105a1a323f60a91b50b14af4bf659b

node scripts/docs-audit/affected-docs.mjs --json 9fea31685408b8ae1c678f696cdada1d3dfb6d51

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 9fea31685408b8ae1c678f696cdada1d3dfb6d51 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgTyMahdAdhXSzgy2nt

Final green head for L1: 081a5101fb79866c3b0fc9680fb5a3586f1a259f · read 2026-11-19T10:02Z

  • Check-runs on that head: 53, all completed — 37 success, 16 skipped, 0 failed or pending.
  • Diff: +52 / −1 over 3 files (packages/cli/src/commands/doctor.ts, packages/cli/src/commands/doctor-deprecation-hint-commands.test.ts, one changeset). Not a governed surface.
  • Area self-review does not apply: over 50 lines, and the change is code as well as text and tests. L1 goes to thread L1-a.
  • Dev report: os doctor --verbose still ends with "Run with --verbose to see fix suggestions." #34866 comment 7002333905.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgTcFanGhTvqS1V2Q4U

维护者速读

  • 用户能看到什么变化:os doctor --verbose 以警告结束时,不再在最后叫你“加 --verbose 再跑一次”;不加参数的运行输出与原来逐字相同。
  • 为什么做:开发者第一次用 CLI 就看到一句自相矛盾的提示。
  • 出错会怎样:只影响总结里的一行提示;退出码、检查结果都不变。
  • 要你做什么:不需要你做任何事,区域审完自己落地。

席位核对 — ACCEPT (L1-a) · repo:objectstack#1 · head 081a5101fb79866c3b0fc9680fb5a3586f1a259f · 2026-11-19T10:05Z

  • 形态 — draft, base main, 1 commit, 3 files, +52/−1: packages/cli/src/commands/doctor.ts, its existing real-Doctor.run() harness doctor-deprecation-hint-commands.test.ts, one changeset. Merge-base 3819afec. check-governed-merges.mjs --pr 35377: NOT governed, 53 lines ≤ 3000. Clause-②: no, Metadata-protocol: none; no packages/spec/src/**, no governed rule text, no narrowing ⇒ no L2 owed.
  • Fixes vs card os doctor --verbose still ends with "Run with --verbose to see fix suggestions." #34866 — Fixes #34866 is right: the card asks exactly for the hasWarnings hint to respect flags.verbose, and the diff wraps that one console.log in if (!flags.verbose). flags.verbose is the command's own Flags.boolean({ char: 'v' }) (doctor.ts:2252), already in scope in run(). The non-verbose arm is byte-identical; the error and healthy branches are untouched.
  • Changeset — @objectstack/cli patch (package is published: no private), read sentence by sentence against the diff:
    • "always closed with 'Run with --verbose to see fix suggestions.', including on a run that already passed --verbose" — matches the removed unconditional line;
    • "The line is now printed only when --verbose is off" — matches if (!flags.verbose);
    • "a run without the flag reads exactly as before" — matches (same string, same branch).
    • nit, not blocking: "had already printed those suggestions" holds only for warnings that have a fix; see 范围外去向.
  • Pins — new describe('the warnings summary') inside the existing harness (shared-harness rule). Both arms first assert the run reached the warnings verdict line (so an absent hint cannot be a healthy/error run), then judge the tail after it by the flag name: off ⇒ contains --verbose; on ⇒ does not, and the per-finding replacement Use maxLength (camelCase) is on screen. Ablation if (!flags.verbose) { → if (true) { red 1/14, exactly the --verbose arm, restored blob == HEAD 5b130dc6 (os-dev-report 7002333905).
  • 门禁 — 53 check-runs on this head (all from runs started on the single commit): 37 success, 16 skipped, 0 failure. Lint & Repo Gates success, TypeScript Type Check success. Local derived set 69 families: 67 exit 0, 2 NOT MEASURED (exit 3 prerequisite; both run in CI's Lint & Repo Gates, which is green).
  • 接受的偏差 — PR body line 1 is Fixes #34866 with the signature on line 3 (os-dev.md Definition of done; the PR-body guard is green). Commit trailers follow AGENTS.md. A throwaway probe test was created and deleted, never committed.
  • 范围外去向 — the dev's finding (five warning paths — missing tests, @deprecated usages, circular dependencies, unused objects, orphan views — print a bare printWarning with no fix in either mode, so the non-verbose hint promises suggestions that --verbose does not print) is a defect this PR noticed but neither made false nor changed: that arm is byte-identical here. Per the checklist (noticed, not touched ⇒ card, not fix): follow-up card owed, filed by b1-B through issue-create.mjs under the filing gate, dedupe words doctor, verbose, fix suggestions, printWarning, hint, citing os-dev-report 7002333905. Not a REWORK reason.
  • 落地条款 — not governed: b1-B lands this head after this ACCEPT. A new push needs a fresh L1 only if it changes more than a main merge.

Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgTyMahdAdhXSzgy2nt

Landing · 2026-11-19T10:44Z · area b1-B, after L1-a ACCEPT 7005940659 (head 081a5101), carried to 84c3ccfa by a clean origin/main merge only (delta vs main unchanged: 3 files, +52/−1)

Probe Reading
check-governed-merges.mjs --pr 35377 NOT governed · 53 changed lines ≤ 3000
check-runs on 84c3ccfadd105a1a323f60a91b50b14af4bf659b 53 completed: 37 success, 16 skipped, 0 failed · mergeable_state clean

State: ready + auto-merge now; #34866 closes on merge. Follow-up of this PR's out-of-scope finding: #35454.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/s tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

os doctor --verbose still ends with "Run with --verbose to see fix suggestions."

2 participants