Doctor: audit lint default selection#100361
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 8, 2026, 5:30 PM ET / 21:30 UTC. Summary PR surface: Source +6, Tests +12, Docs +22. Total +40 across 5 files. Reproducibility: not applicable. this is a PR changing Doctor lint default-selection policy rather than a bug report with a failing current-main reproduction path. The behavior is checkable from PR-head source, adjacent tests, and the PR-body smoke output. Review metrics: 1 noteworthy metric.
Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the documented default lint profile after required checks if maintainers accept the compatibility tradeoff, keeping the four diagnostics available through Do we have a high-confidence way to reproduce the issue? Not applicable: this is a PR changing Doctor lint default-selection policy rather than a bug report with a failing current-main reproduction path. The behavior is checkable from PR-head source, adjacent tests, and the PR-body smoke output. Is this the best way to solve the issue? Yes, with maintainer acceptance of the compatibility tradeoff: using the existing AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b63317d07e8d. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +6, Tests +12, Docs +22. Total +40 across 5 files. View PR surface stats
What I checked:
Likely related people:
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. How this review workflow works
Review history (7 earlier review cycles)
|
3d55fbc to
52a5bda
Compare
|
@clawsweeper re-review Rebased after #100093 landed and updated the PR scope: the parent write-config slice is no longer in the diff. This now also makes |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review Updated after maintainer feedback: removed the broad executable audit test so the PR no longer freezes the full Doctor rule list. The audit table remains in the PR body as review evidence only. Tests now cover only the default behavior changes this PR makes: legacy state, skills readiness, session transcripts, and session snapshots default to explicit-only lint. Public |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review Final scope adjustment: removed the public |
|
🦞🧹 I asked ClawSweeper to review this item again. |
galiniliev
left a comment
There was a problem hiding this comment.
Doctor lint default selection review: this PR narrows default openclaw doctor --lint by marking four advisory/environment-sensitive checks explicit-only while preserving --all, targeted --only, and repair paths. That matters because default lint output is a public automation surface, even though the code change is small.
LOC: +45/-5 (5 files)
By: Gio Della-Libera (@giodl73-repo, acct 2025-09-30) | OpenClaw: 228 PRs, 14 issues, 186 commits/12mo | GitHub: 60 repos, 6723 commits, 279 PRs, 29 issues, 17 reviews/12mo
Findings: No blocking findings.
Bug/behavior: no linked bug; this is a policy/default-profile change for doctor --lint. Current origin/main registers core/doctor/legacy-state, core/doctor/skills-readiness, core/doctor/session-transcripts, and core/doctor/session-snapshots without defaultEnabled: false, so default lint selects them. PR head adds defaultEnabled: false for those checks in src/flows/doctor-core-checks.ts:395, src/flows/doctor-core-checks.ts:843, src/flows/doctor-health-contributions.ts:1760, and src/flows/doctor-health-contributions.ts:1793.
Evidence map: changed surface is Doctor lint selection metadata and docs. Runtime entry point is runDoctorLintChecks, which skips default-disabled checks only when --only is absent and includeAllChecks is false (src/flows/doctor-lint-flow.ts:28). Caller path is the maintenance CLI passing --all through includeAllChecks (src/cli/program/register.maintenance.ts:64, src/commands/doctor-lint.ts:90). Callee/repair path is runDoctorHealthRepairs, which normalizes and runs the provided checks without consulting the lint default profile (src/flows/doctor-repair-flow.ts:41). Sibling default-disabled checks already use the same internal metadata, and adjacent tests cover skip/only/all behavior plus the four newly default-disabled registrations (src/flows/doctor-lint-flow.test.ts, src/flows/doctor-core-checks.test.ts:319, src/flows/doctor-health-contributions.test.ts:1327, src/flows/doctor-health-contributions.test.ts:1471). Docs now describe the default profile, --all, --only, and the separate fix path in docs/gateway/doctor.md:83.
Best-fix verdict: acceptable/best implementation for the stated policy, pending maintainer acceptance of the compatibility tradeoff. The patch uses the existing selector bit at the check registration site, keeps the public HealthCheck contract unchanged, and avoids adding a second hard-coded selector list in the CLI.
Alternatives considered: keeping a CLI-side denylist would duplicate ownership outside the check registrations; making defaultEnabled public SDK surface would broaden plugin/API contract unnecessarily; leaving these four checks default-enabled would preserve current automation output but would not satisfy the PR's stated low-noise default lint goal.
Provenance: N/A for a feature/policy change.
Validation reviewed: PR-head GitHub checks are green/neutral/skipped only (78 success, 1 neutral, 35 skipped). I also ran pnpm docs:list and read docs/AGENTS.md, docs/gateway/doctor.md, the CLI lint wiring, lint/repair runners, changed checks, sibling default-disabled checks, and adjacent tests. I did not rerun the focused Vitest/tsgo commands locally; no remote E2E was needed for this static default-selection change.
Remaining uncertainty: maintainer/product decision only: whether default doctor --lint should stop surfacing these four diagnostics for existing automation unless users opt into --all or --only.
|
Maintainer decision: accepted the default-lint compatibility tradeoff for this audit slice. We are intentionally keeping This addresses the remaining ClawSweeper/Galin policy caveat; no further code change requested for this point. |
Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: wm0018 <[email protected]>
|
Merged as 7d82e5b from source head d5d88a0. Maintainer note: we accepted the default-lint compatibility tradeoff for this audit slice. The four advisory/environment-sensitive checks remain available via Verification before merge: exact-head hosted gates passed for d5d88a0: CI#28976811444 and Workflow Sanity#28976811343. Local broad |
Summary
doctor --lintbar now that all tracked Doctor rule families have structured lint findings.doctor --lint --allor targeted--only:core/doctor/legacy-statecore/doctor/session-transcriptscore/doctor/session-snapshotscore/doctor/skills-readiness--lint, full--lint --all, targeted--only, and whydoctor --fixis a separate repair path rather than "--allplus writes".Default-Lint Bar
Default
doctor --lintshould be safe for automation and routine preflight use. A check belongs in default lint when it is:Gateway config and auth stay in default lint because the public product contract treats the Gateway as required for normal OpenClaw operation; optional channel, account, inventory, live-service, and cleanup diagnostics remain explicit.
A check should be explicit-only when it is primarily advisory, historical cleanup, optional inventory, live-service dependent, account/channel-specific, deployment-sensitive, or repair-oriented. Those checks are still useful, but users should request them with
--allor--only.Why These Four Changed
legacy-state: scans historical migration state and can be broad/support-oriented rather than an active runtime failure.session-transcripts: reports historical transcript cleanup/advisory state; useful for support, too noisy for broad automation.session-snapshots: reports stale cached snapshot paths; useful cleanup signal, not a default preflight blocker.skills-readiness: depends on optional local tool installs, environment, OS, and configured accounts; better as explicit inventory.Non-Goals
doctor --fixrepair behavior.info,warning, orerror).Audit result for review
48 registered Doctor lint checks reviewed for default selection
--lintcore/doctor/gateway-configwarning-errorbroad-safecore/doctor/claude-cliwarningbroad-safecore/doctor/gateway-authwarning-errorbroad-safecore/doctor/command-ownerinfobroad-safecore/doctor/ui-protocol-freshnesswarningbroad-safecore/doctor/codex-session-routeswarningbroad-safecore/doctor/sandbox/registry-fileswarningbroad-safecore/doctor/gateway-services/extrawarningbroad-safecore/doctor/gateway-services/platform-noteswarningbroad-safecore/doctor/securitywarningbroad-safecore/doctor/browserwarningbroad-safecore/doctor/browser-clawd-profile-residuewarningbroad-safecore/doctor/oauth-tlswarningbroad-safecore/doctor/hooks-modelwarningbroad-safecore/doctor/provider-catalog-projectionwarning-errorbroad-safecore/doctor/runtime-tool-schemaswarning-errorbroad-safecore/doctor/bootstrap-sizewarningbroad-safecore/doctor/shell-completionwarningbroad-safecore/doctor/final-config-validationwarning-errorbroad-safecore/doctor/auth-profileswarningexplicit-onlycore/doctor/legacy-statewarningexplicit-onlycore/doctor/legacy-plugin-manifestswarningexplicit-onlycore/doctor/legacy-plugin-dependencieswarningexplicit-onlycore/doctor/stale-plugin-runtime-symlinkswarningexplicit-onlycore/doctor/configured-plugin-installswarningexplicit-onlycore/doctor/plugin-registrywarningexplicit-onlycore/doctor/disk-spacewarningexplicit-onlycore/doctor/state-integritywarningexplicit-onlycore/doctor/session-lockswarningexplicit-onlycore/doctor/session-transcriptsinfoexplicit-onlycore/doctor/session-snapshotsinfoexplicit-onlycore/doctor/config-audit-scrubinfo-warningexplicit-onlycore/doctor/legacy-whatsapp-crontabwarningexplicit-onlycore/doctor/legacy-cron-storewarningexplicit-onlycore/doctor/channel-plugin-blockerswarningexplicit-onlycore/doctor/channel-preview-warningswarningexplicit-onlycore/doctor/tool-result-capwarningexplicit-onlycore/doctor/systemd-lingerwarningexplicit-onlycore/doctor/workspace-statusinfo-warningexplicit-onlycore/doctor/skills-readinesswarningexplicit-onlycore/doctor/heartbeat-templatewarningexplicit-onlycore/doctor/gateway-healthwarning-errorexplicit-onlycore/doctor/whatsapp-responsivenesswarningexplicit-onlycore/doctor/memory-searchwarningexplicit-onlycore/doctor/device-pairingwarningexplicit-onlycore/doctor/gateway-daemonwarningexplicit-onlycore/doctor/write-configwarningexplicit-onlycore/doctor/workspace-suggestionsinfoexplicit-onlyEmpty/default install smoke
Source-level isolated smoke after this change:
doctor --lint --jsonon an absent config/state under tempHOMEruns 19 checks, skips 29, and reports only expected core setup/source-checkout findings:gateway-configandgateway-authbecause Gateway config/auth are required for normal OpenClaw operation, plus source-checkoutui-protocol-freshnesswhen the local checkout needs current UI assets.doctor --lint --json --allremains intentionally not clean on an unconfigured temp install because--allincludes explicit state/live/plugin/account inventory checks such as state integrity, gateway daemon/health, memory search, plugin registry, and skills readiness.This confirms the audit reduced empty-install noise, while preserving
--allas the full explicit audit profile.Validation
node scripts/run-vitest.mjs src/flows/doctor-core-checks.test.ts src/flows/doctor-health-contributions.test.ts --pool forks --maxWorkers 1 --no-fileParallelism --reporter dotcorepack pnpm exec oxfmt --check docs/gateway/doctor.md src/flows/doctor-core-checks.ts src/flows/doctor-core-checks.test.ts src/flows/doctor-health-contributions.ts src/flows/doctor-health-contributions.test.tscorepack pnpm exec oxlint --tsconfig config/tsconfig/oxlint.core.json src/flows/doctor-core-checks.ts src/flows/doctor-core-checks.test.ts src/flows/doctor-health-contributions.ts src/flows/doctor-health-contributions.test.tscorepack pnpm tsgo:corenode scripts/plugin-sdk-surface-report.mjs --checkgit diff --check origin/main...HEAD