Doctor: expose dry-run preview reports#84472
Conversation
|
Codex review: needs maintainer review before merge. Latest ClawSweeper review: 2026-05-22 22:21 UTC / May 22, 2026, 6:21 PM ET. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: not applicable. as a bug reproduction. For review risk, the stack/mergeability issue is reproducible with PR rating Rank-up moves:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. Real behavior proof Risk before merge
Maintainer options:
Next step before merge Security Review detailsBest possible solution: Land this only after the Doctor repair stack is rebased or merged cleanly, maintainers accept the initial preview and SDK contract, and broad Doctor proof confirms preview mode stays non-mutating. Do we have a high-confidence way to reproduce the issue? Not applicable as a bug reproduction. For review risk, the stack/mergeability issue is reproducible with Is this the best way to solve the issue? Unclear until maintainer contract review: the implementation direction is coherent, but the public CLI/SDK schema and stacked branch state need explicit acceptance before merge. Label changes:
Label justifications:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 299ed808347c. |
|
ClawSweeper PR egg ✨ Hatched: 🥚 common Moonlit Diff Drake Hatch commandComment Hatchability rules:
Rarity: 🥚 common. What is this egg doing here?
|
6ca0b39 to
99f3e29
Compare
99f3e29 to
852500f
Compare
c1ac8e1 to
c7aa398
Compare
be63408 to
f81e3ed
Compare
f81e3ed to
6db6bd4
Compare
bb6ca95 to
d1584bc
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Summary
Expose the structured Doctor repair work through top-level dry-run, diff, and JSON preview reporting.
This PR adds the user-facing preview surface for converted Doctor repairs:
openclaw doctor --fix --dry-runplans converted repairs without mutating config or state.openclaw doctor --fix --dry-run --diffincludes concrete file/config diffs when a converted check can describe them.openclaw doctor --fix --dry-run --jsonemits a machine-readable preview report with findings, changes, warnings, effects, diffs, and skipped legacy repair slots.The preview path also disables legacy config/state preflight migrations, so dry-run/diff does not copy legacy config or move legacy state before producing a report.
Contract
The preview report uses the same structured repair pieces returned by converted checks:
findings,changes,warnings,effects,diffs, andskipped.Checks still decide only the repair plan and effects. The runner decides whether to render that plan for human output, diff output, JSON, or a real fix.
Docs
Updated
docs/cli/doctor.mdso the public CLI reference no longer says--jsonis lint-only and now documents dry-run, diff, JSON preview fields, skipped legacy repairs, and therun(ctx)/ctx.repairhealth-check contract.Verification
pnpm docs:listgit diff --checknode scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.core.test.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core-test-84472-preview-docs.tsbuildinfonode scripts/run-vitest.mjs src/flows/doctor-core-checks.test.ts src/flows/doctor-health.test.ts src/flows/doctor-health-contributions.test.ts src/cli/program/register.maintenance.test.tsnode scripts/run-vitest.mjs src/commands/doctor-config-flow.test.tscodex review --base refs/remotes/fork/doctor-cron-audit-structured-repairsReal Behavior Proof
Behavior addressed:
openclaw doctor --fix --dry-run/--diff --jsonnow emits structured preview output for converted repair checks, reports unconverted legacy repair slots as skipped, keeps presentation notes out of JSON, preserves--deepduring OAuth TLS previews, uses dry-run-safe wording for skills repairs, and disables legacy config/state preflight mutations during preview.Real environment tested: WSL source checkout on branch
doctor-dry-run-contribution-guardata2cf3c5bb7142604da5ff35357a106de568f46c5, using an isolated fake home with a legacy.clawdbot/clawdbot.jsonpresent.Exact steps or command run after this patch:
HOME=$PWD/.artifacts/proof-84472-preview/live-final/home OPENCLAW_HOME=$PWD/.artifacts/proof-84472-preview/live-final/openclaw-home OPENCLAW_DISABLE_AUTO_UPDATE=1 CI=1 timeout 180s node --import tsx src/entry.ts doctor --fix --dry-run --diff --json > .artifacts/proof-84472-preview/live-final/diff.json 2> .artifacts/proof-84472-preview/live-final/diff.stderr; then checked whether.artifacts/proof-84472-preview/live-final/home/.openclaw/openclaw.jsonwas created.Evidence after fix: The command exited successfully, stderr was empty, and the JSON report parsed with
ok: false,mode: "dry-run",diff: true,checksRun: 29,checksRepaired: 5,findings: 49,changes: 47,effects: 47,diffs: 1, andskipped: 14. The legacy config copy check reportedlegacy_config_copied=no.Observed result after fix: The preview command produced structured dry-run/diff JSON and did not copy the fake legacy
.clawdbotconfig into.openclaw/openclaw.json.What was not tested: Full cross-platform live Doctor repair scenarios were not run for this draft stack PR; this proof covers the new preview surface and focused Doctor contract tests in WSL.