Skip to content

Doctor: add lint --all#96471

Merged
giodl73-repo merged 3 commits into
openclaw:mainfrom
giodl73-repo:doctor-lint-profiles
Jun 26, 2026
Merged

Doctor: add lint --all#96471
giodl73-repo merged 3 commits into
openclaw:mainfrom
giodl73-repo:doctor-lint-profiles

Conversation

@giodl73-repo

@giodl73-repo giodl73-repo commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

  • Doctor now has warning-level checks that are intentionally excluded from the default doctor --lint automation gate because they are deeper or more likely to surface repairable legacy residue.
  • Before this PR, those checks were discoverable only by exact --only <check-id> selectors, which is too hidden for operators who want the complete lint inventory.

Why This Change Was Made

  • Adds openclaw doctor --lint --all.
  • Keeps plain doctor --lint as the existing automation-safe selection.
  • Lets --all include default-disabled checks without changing finding severity, finding schemas, repair behavior, config, or the plugin SDK health contract.
  • Leaves --only <id> as the precise selector for individual checks.
  • Keeps --all lint-only; openclaw doctor --all is rejected like other lint selector flags.

User Impact

  • Existing doctor --lint users keep the same broad-lint behavior.
  • Operators and maintainers can run doctor --lint --all to include opt-in/deep checks such as the config audit scrub check from Doctor: expose config audit scrub findings #84450.
  • This is a CLI/docs contract addition only; no config, plugin, or SDK contract expansion.

Evidence

  • Rebased after Doctor: expose session artifact findings #95976 merged; current PR diff is only the doctor --lint --all slice.
  • Current head 560d59f2f5e18a32d97bca672aa8536f8cc6c045.
  • OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs run src/flows/doctor-lint-flow.test.ts src/commands/doctor-lint.test.ts src/cli/program/register.maintenance.test.ts --reporter=dot - passed, 32 tests / 3 shards.
  • pnpm docs:list - passed.
  • node_modules/.bin/oxfmt --check src/flows/doctor-lint-flow.ts src/flows/doctor-lint-flow.test.ts src/commands/doctor-lint.ts src/commands/doctor-lint.test.ts src/cli/program/register.maintenance.ts src/cli/program/register.maintenance.test.ts docs/cli/doctor.md docs/gateway/doctor.md - passed.
  • node_modules/.bin/oxlint src/flows/doctor-lint-flow.ts src/flows/doctor-lint-flow.test.ts src/commands/doctor-lint.ts src/commands/doctor-lint.test.ts src/cli/program/register.maintenance.ts src/cli/program/register.maintenance.test.ts - passed.
  • node node_modules/@typescript/native-preview/bin/tsgo.js -p tsconfig.core.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core.tsbuildinfo --declaration false --singleThreaded --checkers 1 - passed.
  • node node_modules/@typescript/native-preview/bin/tsgo.js -p test/tsconfig/tsconfig.test.src.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/test-src.tsbuildinfo --declaration false --singleThreaded --checkers 1 - passed.
  • node scripts/plugin-sdk-surface-report.mjs --check - passed.
  • git diff --check origin/main...HEAD - passed.
  • git diff --check - passed.
  • Hosted exact-head CI/Testbox gates passed on 560d59f2f5e18a32d97bca672aa8536f8cc6c045.

Real Behavior Proof

  • Environment: source CLI from this branch, isolated temp OPENCLAW_STATE_DIR and OPENCLAW_CONFIG_PATH, with one seeded logs/config-audit.jsonl record containing a fake pre-redactor argv value. Paths below are redacted.
--- default lint ---
command: node scripts/run-node.mjs doctor --lint --json
exit: 1
checksRun: 25
checksSkipped: 2
configAuditFindingCount: 0
--- all lint ---
command: node scripts/run-node.mjs doctor --lint --json --all
exit: 1
checksRun: 27
checksSkipped: 0
configAuditFindingCount: 1
configAuditFinding: warning core/doctor/config-audit-scrub 1 entry in config-audit.jsonl still contain pre-redactor argv values. path=<TEMP>\state\logs\config-audit.jsonl
  • The non-zero exit in both runs is expected because the isolated minimal config also produces unrelated default-lint warnings. The proof target is the selection behavior: default lint skips the opt-in config-audit check, while --all includes it.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime cli CLI command changes commands Command implementations size: M maintainer Maintainer-authored PR labels Jun 24, 2026
@clawsweeper

clawsweeper Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 26, 2026, 1:24 AM ET / 05:24 UTC.

Summary
The PR adds openclaw doctor --lint --all, threads it through doctor lint selection, and updates focused tests and docs for running default-disabled checks.

PR surface: Source +8, Tests +34, Docs +14. Total +56 across 7 files.

Reproducibility: not applicable. This PR adds a new CLI selector rather than fixing broken existing behavior. Source inspection shows current main only supports default lint plus explicit --only <check-id> selection for default-disabled checks.

Review metrics: 3 noteworthy metrics.

  • CLI selector surface: 1 added. A new doctor lint flag is a public operator contract that can appear in scripts and docs.
  • SDK run option surface: 1 optional field added. DoctorLintRunOptions is exported through the plugin SDK health subpath, so typed consumers can depend on the new option.
  • Default-disabled lint bundle: 2 current checks. The new selector currently includes session-lock and config-audit scrub checks that plain doctor --lint intentionally skips.

Stored data model
Persistent data-model change detected: migration/backfill/repair: docs/gateway/doctor.md, migration/backfill/repair: src/cli/program/register.maintenance.test.ts, migration/backfill/repair: src/commands/doctor-lint.ts, migration/backfill/repair: src/flows/doctor-lint-flow.test.ts, migration/backfill/repair: src/flows/doctor-lint-flow.ts. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Have a maintainer confirm that --all is the intended public doctor lint selector and default-disabled check bundle.

Risk before merge

  • [P1] --all becomes a supported operator-facing doctor lint flag and can be copied into scripts once released.
  • [P1] includeAllChecks is added to a type exported through openclaw/plugin-sdk/health, making this an additive public typed run-option surface.
  • [P1] The selector bundles current and future default-disabled checks; today that includes session-lock state diagnostics and credential-adjacent config-audit scrub diagnostics intentionally excluded from default lint.

Maintainer options:

  1. Accept --all as the public selector
    Merge if maintainers want one supported lint-only flag that runs every registered doctor check, including default-disabled checks.
  2. Keep explicit check selection only
    Pause or close if default-disabled checks should remain reachable only through --only <check-id> until the opt-in policy is narrowed.
  3. Rename or narrow the bundle
    Ask for a renamed flag, allowlist, or documentation change if sensitive or legacy-residue checks should not all share one --all bundle.

Next step before merge

  • The remaining blocker is maintainer acceptance of a new public CLI flag, SDK-visible option, and default-disabled diagnostic bundle under a protected maintainer label.

Security
Cleared: The diff adds no dependency, workflow, install, secret-storage, redaction, or code-execution change; the remaining security-boundary point is maintainer policy acceptance of broader opt-in diagnostics.

Review details

Best possible solution:

Merge only if maintainers accept --all as the public all-check doctor lint contract; otherwise keep explicit --only <check-id> or ask for a narrower opt-in tier.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this PR adds a new CLI selector rather than fixing broken existing behavior. Source inspection shows current main only supports default lint plus explicit --only <check-id> selection for default-disabled checks.

Is this the best way to solve the issue?

Yes, conditional on maintainer acceptance: the implementation uses the existing lint selection path and preserves plain doctor --lint. The safer alternative is to keep explicit --only <check-id> as the only opt-in route or narrow the bundle before release.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 751a6c23f098.

Label changes

Label justifications:

  • P2: This is a normal-priority CLI improvement with limited blast radius but real public contract impact.
  • merge-risk: 🚨 compatibility: The PR adds a supported doctor lint selector and exported run-option field that scripts or plugin-side tooling can depend on after release.
  • merge-risk: 🚨 security-boundary: The selector can expose credential-adjacent config-audit scrub diagnostics that default lint intentionally excludes.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body contains redacted terminal output from the branch showing default lint skips the opt-in config-audit check while --all includes it.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body contains redacted terminal output from the branch showing default lint skips the opt-in config-audit check while --all includes it.
Evidence reviewed

PR surface:

Source +8, Tests +34, Docs +14. Total +56 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 3 9 1 +8
Tests 2 34 0 +34
Docs 2 19 5 +14
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 62 6 +56

What I checked:

  • Current main lacks the selector: Current main registers --lint, --json, --severity-min, --skip, and --only for doctor lint, but no --all flag. (src/cli/program/register.maintenance.ts:31, 751a6c23f098)
  • PR threads the new selector through the existing path: The PR diff adds the Commander --all flag, forwards includeAllChecks, and teaches runDoctorLintChecks to include default-disabled checks when that option is true. (src/cli/program/register.maintenance.ts:42, 560d59f2f5e1)
  • Current main default lint skips opt-in checks: Current main filters default-disabled checks when no explicit onlyIds selector is present, which is the behavior this PR preserves for plain doctor --lint. (src/flows/doctor-lint-flow.ts:40, 751a6c23f098)
  • SDK-visible type surface: DoctorLintRunOptions is exported through openclaw/plugin-sdk/health, so the added optional option is not only an internal CLI detail. (src/plugin-sdk/health.ts:11, 751a6c23f098)
  • Default-disabled checks bundled by --all: Current main has at least two default-disabled doctor lint checks: session locks and config-audit scrub, so --all changes the operator-facing bundle of diagnostics. (src/flows/doctor-core-checks.ts:739, 751a6c23f098)
  • Credential-adjacent diagnostic remains redacted but policy-sensitive: The config-audit scrub health finding reports count, audit path, and a fix hint, not raw argv values; exposing it through a broad selector is still a maintainer security-boundary choice. (src/commands/doctor-config-audit-scrub.ts:37, 751a6c23f098)

Likely related people:

  • giodl73-repo: Live PR/history checks show this author introduced the original doctor lint surface, the default-disabled session-lock/config-audit checks, and the current --all proposal. (role: feature owner and recent area contributor; confidence: high; commits: 9a5f2f61e76f, 704fc3504392, c5f10b5f7c00; files: src/flows/doctor-lint-flow.ts, src/flows/doctor-core-checks.ts, src/flows/doctor-health-contributions.ts)
  • vincentkoc: Current-main blame in this checkout points the doctor lint flow, CLI registration, and default-disabled check lines at commit 497d53d. (role: recent adjacent contributor; confidence: medium; commits: 497d53d821e6; files: src/flows/doctor-lint-flow.ts, src/cli/program/register.maintenance.ts, src/flows/doctor-core-checks.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. labels Jun 24, 2026
@giodl73-repo
giodl73-repo force-pushed the doctor-lint-profiles branch from 094f8df to 7c08804 Compare June 25, 2026 00:19
@giodl73-repo

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Rebased after #84450 merged; current head is 7c0880473050ac16cbb20e2575aaee85da4913ff and the PR diff is now only the lint-profile slice. PR body has fresh focused validation plus redacted source CLI proof showing default lint skips the opt-in config-audit check while --lint-profile full includes it.

@clawsweeper

clawsweeper Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 25, 2026
@giodl73-repo
giodl73-repo force-pushed the doctor-lint-profiles branch from 7c08804 to 4c6f41b Compare June 25, 2026 01:39
@giodl73-repo giodl73-repo changed the title Doctor: add lint profiles Doctor: add lint --all Jun 25, 2026
@giodl73-repo

giodl73-repo commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Updated the public surface from doctor --lint --lint-profile full to the simpler lint-only doctor --lint --all. Current head is 4c6f41b2720f583c2a84a3902467c3b54b598a0b; PR body has fresh focused validation and redacted CLI proof showing default lint skips the opt-in config-audit check while --all includes it.

@clawsweeper

clawsweeper Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@giodl73-repo
giodl73-repo marked this pull request as ready for review June 25, 2026 15:50
@giodl73-repo
giodl73-repo force-pushed the doctor-lint-profiles branch from 4c6f41b to 560d59f Compare June 26, 2026 05:03
@giodl73-repo
giodl73-repo merged commit 4fc504d into openclaw:main Jun 26, 2026
99 checks passed
@giodl73-repo

Copy link
Copy Markdown
Contributor Author

Merged via squash.

@giodl73-repo
giodl73-repo deleted the doctor-lint-profiles branch June 26, 2026 05:26
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jun 26, 2026
* fix(doctor): keep audit scrub lint opt-in

* fix(doctor): keep audit lint defaults internal

* feat(doctor): add lint profiles
QiuYuang pushed a commit to QiuYuang/openclaw that referenced this pull request Jul 1, 2026
* fix(doctor): keep audit scrub lint opt-in

* fix(doctor): keep audit lint defaults internal

* feat(doctor): add lint profiles
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes commands Command implementations docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant