Skip to content

fix(cli): os doctor advises --verbose only when a warning has a fix for it to show - #35626

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

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

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #35454

repo:objectstack#1 · os-sales · session_01L6bhgTyMahdAdhXSzgy2nt

Clause-②: no
Metadata-protocol: none

维护者速读

  1. 用户能看到什么变化:开发者在命令行做项目体检时,如果出现的警告都没有修复建议(例如缺少测试文件),结尾不再叫他打开详细模式重跑一次;有修复建议的警告照旧提示。
  2. 为什么做:上一张修复 doctor 结尾提示的卡留下的另一半,开发者第一次用 CLI 时被引去重跑一次,却什么新内容也看不到。
  3. 出错会怎样:最坏情况是某类有修复建议的警告不再带这句提示,警告本身和退出码都不变;撤回本 PR 即恢复原样。
  4. 要你做什么:无。

What changes

  • packages/cli/src/commands/doctor.ts: a new hasVerboseOnlyFix flag, tracked beside hasWarnings. The summary prints "Run with --verbose to see fix suggestions." only when --verbose is off AND that flag is set. Each warning path was read and classified:
    • sets the flag (a fix that only --verbose prints): an environment HealthCheckResult with status === 'warning' and a fix; a dashboard-widget warning with a non-empty hint; the config-load-failure finding when it carries a fix; any --scan-deprecations hit (its replacement is printed only under --verbose).
    • does not set it, no fix in either mode: missing tests, @deprecated usages, circular dependencies, unused objects, orphan views.
    • does not set it, fix already printed without the flag: the platform-protocol gap (its hint is printed unconditionally) and the isolated-posture unique-scope advisory (its prescription is printed unconditionally).
  • The warnings' own text, the verdict line and exit codes are unchanged. No fix text was added.
  • .changeset/35454-doctor-verbose-hint-fixless.md: patch, @objectstack/cli.

Tests

  • packages/cli/src/commands/doctor-deprecation-hint-commands.test.ts, in the existing describe('the warnings summary'), which uses the real Doctor.run(): a new case writes packages/spec/src/a.zod.ts with no test into the temp cwd and runs plain os doctor. It asserts that the "Missing test" warning fired, that the summary reached its warnings branch, and that the text after the verdict line does not name --verbose.
  • The two existing cases from PR fix(cli): os doctor --verbose no longer ends by telling you to run with --verbose #35377 still cover the fix-bearing side: a --scan-deprecations warning still gets the hint without --verbose and gets none with it.

Acceptance notes

  • Dashboard-widget warnings whose hint is the empty string (@objectstack/lint emits hint: '' on one path) do not count as fix-bearing here, since --verbose would print only a bare arrow for them. That empty arrow line under --verbose is not changed here. Observation only, not reproduced at the public door.
  • Environment rows with status ok also print their fix under --verbose. They are not warnings, so they do not count toward the hint. The behaviour is unchanged.

Verification

Readings are at HEAD d559e09a (the fix commit 1dc43d70 merged with origin/main f981dce3; the merge brought in no package source).

Two-minute check: pnpm --filter @objectstack/cli exec vitest run --project unit src/commands/doctor-deprecation-hint-commands.test.ts. Expected: 15 passed.

Read first: packages/cli/src/commands/doctor.ts, the summary's if (!flags.verbose && hasVerboseOnlyFix) and the four places that set the flag. The risk is a fix-bearing path left unclassified.

Red first, then green
  • At 86ec0951 (the new pin on an unmodified doctor.ts): Tests 1 failed, 14 passed (15). The new case failed with expected '\n Run with --verbose to see fix su…' not to contain '--verbose'.
  • At 1dc43d70: Test Files 1 passed (1), Tests 15 passed (15).
Ablation (scripts/ablation-replace.mjs, landed on disk and restored)
  • Anchor if (!flags.verbose && hasVerboseOnlyFix) { replaced with if (!flags.verbose) {. The anchor went from 1 to 0 and the blob from 975d2c65 to ab86dda8. Result: Tests 1 failed, 14 passed. Only "makes no such advice when the only warnings carry no fix to reveal" failed.
  • Restore: the blob after restore equals HEAD (975d2c65) and git diff HEAD is empty.
  • The test imports the subject as relative source (./doctor.js), so the ablation needed no dist rebuild.
Package tests and typecheck
  • pnpm run typecheck in packages/cli (tsc, then check:test-typecheck) followed by pnpm exec vitest run --project unit --maxWorkers=2, as one locked command: VERDICT command-exit 0. Test Files 431 passed (431), Tests 6163 passed (6163).
  • The integration tier is left to CI: the diff touches no integration-tier file and no spawn entry.
Gates (derived set, local)
  • node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack at d559e09a derived 69 families. Each one was run, with its exit code captured before any pipe.
  • 67 exited 0. 2 are NOT MEASURED, both exit 3 PREREQUISITE NOT MET because they need dist output across the repo: pnpm check:dual-build-cjs-loads (no dist for studio, client-react, connector-slack, ...) and pnpm check:i18n-coverage (the app-showcase config imports an unbuilt connector-slack dist). CI runs both.
  • --ran reconciliation: "69 derived famil(ies) accounted for — 67 run, 2 NOT-MEASURED (2 DERIVED from a recorded exit 3)".
  • node scripts/pm/overlap-check.mjs: VERDICT clean exit 0.

Generated by Claude Code

@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

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 d2bc1ffdc36412da08a7ff40350302b991aeef6f → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 523d7cb4a5f55dca632e69e5a6ff0268030a9df5 — the merge of head d559e09a24d4784119d3ef080f1bfbc9bcc69203 into base d2bc1ffdc36412da08a7ff40350302b991aeef6f, 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 523d7cb4a5f55dca632e69e5a6ff0268030a9df5 && git checkout 523d7cb4a5f55dca632e69e5a6ff0268030a9df5
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin d2bc1ffdc36412da08a7ff40350302b991aeef6f d559e09a24d4784119d3ef080f1bfbc9bcc69203 && git checkout -B drift-repro d2bc1ffdc36412da08a7ff40350302b991aeef6f && git merge --no-ff d559e09a24d4784119d3ef080f1bfbc9bcc69203

node scripts/docs-audit/affected-docs.mjs --json d2bc1ffdc36412da08a7ff40350302b991aeef6f

⚠️ 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 d2bc1ffdc36412da08a7ff40350302b991aeef6f → 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: d559e09a24d4784119d3ef080f1bfbc9bcc69203(2026-11-19T18:53Z)

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgTcFanGhTvqS1V2Q4U

维护者速读

  • 用户能看到什么变化:os doctor 只出警告时,只有当某条警告确实有「加 --verbose 才显示的修复建议」,结尾才提示「用 --verbose 查看修复建议」。缺测试文件、@deprecated 用法、循环依赖、未用对象、孤立视图这几类警告本来就没有修复建议,不再白白让人重跑。
  • 出错会怎样:最坏是某次该提示时没提示,用户少看到一条建议。警告本身和退出码不变。
  • 要你做什么:不需要你做任何事,区域自己落地。

席位核对 — ACCEPT (L1-a) · repo:objectstack#1 · head d559e09a24d4784119d3ef080f1bfbc9bcc69203 · 2026-11-19T18:56Z

  • 形态 — draft, base main, 3 commits (two own, one main merge), 3 files, +44/−3. The main merge (d559e09a, parents 1dc43d70 + f981dce3) has no combined hunk in git diff-tree --cc. check-governed-merges.mjs --pr 35626: NOT governed, 0 of 3 paths. Fixes #35454, Clause-②: no, Metadata-protocol: none, @objectstack/cli patch.
  • The three-way classification holds. I read every hasWarnings = true site on this head (11 sites) against what each prints with and without --verbose.
    • Fix shown only under --verbose, so it sets hasVerboseOnlyFix:
      • Environment results warnings with a fix. renderHealthCheckResult prints fix unasked only for an error.
      • Dashboard-widget warnings with a non-empty hint. The hint line is printed only under flags.verbose.
      • The config-load failure. configLoadFailureCheck returns status: 'warning' with a fix, and it goes through the same renderer.
      • Every --scan-deprecations hit. Its replacement is printed only under --verbose, and all eight DEPRECATED_PATTERNS rows carry a non-empty replacement, so the unconditional set is right.
    • No fix in either mode, so it leaves the flag: missing tests, @deprecated usages, circular dependencies, unused objects and orphan views. Each is a bare printWarning loop. These are the card's five.
    • Fix already printed unasked, so it leaves the flag:
      • The platform-protocol gap prints → ${protocolGap.hint} right after its warning, outside any verbose test.
      • The isolated unique-scope block prints → ${GLOBAL_UNIQUE_ISOLATED_PRESCRIPTION} once after its findings, also unconditionally.
      • A --verbose re-run adds nothing to either, so leaving the flag is right. This is the reading the area asked me to confirm.
  • Card's Done-when
    • New pin: only a "Missing test" warning fires, and the summary tail does not name --verbose. It was red at 86ec0951 and green at 1dc43d70.
    • The fix-bearing half is fix(cli): os doctor --verbose no longer ends by telling you to run with --verbose #35377's existing case, a warning with a fix that keeps the hint, and it stays green.
    • The ablation reverts the gate to if (!flags.verbose): only the new case goes red, and the restore is proven (os-dev-report 7018259967).
    • The CLI unit tier passes 6163/6163 on this head. Two families are NOT MEASURED (exit 3, no repo-wide dist) and are left to CI.
  • nit (accepted): the "fix already printed" class has no pin of its own. A run where only the protocol gap fires would print no hint, by reading. That is the intended outcome, and the line is low-risk.
  • 范围外去向 — an empty widget hint printing a bare → under --verbose is noted in the Acceptance notes, not filed. It is cosmetic and below p2. Nothing is owed.
  • 门禁 — on this head: 37 success, 16 skipped, 0 failure. Mergeable clean.
  • 落地条款 — not governed and no L2 face: b1-B lands this head. 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-19T18:56Z · area b1-B, after L1-a ACCEPT 7018954921 on head d559e09a. This PR has no L2 face.

Probe Reading
check-governed-merges.mjs --pr 35626 NOT governed · 47 changed lines ≤ 3000
check-runs on d559e09a24d4784119d3ef080f1bfbc9bcc69203 53 completed: 37 success, 16 skipped, 0 failed · mergeable_state clean · K = 5 since f981dce3

State: ready + auto-merge now; #35454 closes on merge.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 19, 2026 18:57
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 19, 2026
Merged via the queue into main with commit f6b095a Nov 19, 2026
54 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-35454-doctor-verbose-hint branch November 19, 2026 19:21
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 ends with "Run with --verbose to see fix suggestions." when only warnings that have no fix suggestion fired

2 participants