Skip to content

Doctor: expose config audit scrub findings#84450

Merged
giodl73-repo merged 4 commits into
openclaw:mainfrom
giodl73-repo:doctor-cron-audit-structured-repairs
Jun 24, 2026
Merged

Doctor: expose config audit scrub findings#84450
giodl73-repo merged 4 commits into
openclaw:mainfrom
giodl73-repo:doctor-cron-audit-structured-repairs

Conversation

@giodl73-repo

@giodl73-repo giodl73-repo commented May 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Exposes historical config-audit scrub needs as structured doctor health findings.
  • Adds dry-run repair effects for rewriting historical config-audit.jsonl argv / execArgv records through the current redactor.
  • Keeps the existing maybeScrubConfigAuditLog path authoritative for real normal doctor / doctor --fix behavior, including the append-race abort guard.
  • Declares the structured check inline on the existing ordered doctor contribution path.
  • Keeps broad doctor --lint compatible by making core/doctor/config-audit-scrub opt-in; operators can still run it explicitly with --only core/doctor/config-audit-scrub.
  • Keeps defaultEnabled as internal runner selection metadata, not part of the public HealthCheck SDK contract.

This is intentionally the config-audit scrub slice from the doctor repair stack. It does not change config audit logging, redaction behavior for new records, or gateway runtime behavior.

Stack

Rebased onto current main after #84366 merged. Current branch head is commit ef2283d04fb61da1b9429e73b7c9a034b3dbb1dc (fix(doctor): remove duplicate lint default guard).

The refreshed diff now relies on the merged internal default-selection runner metadata from #84366 and is limited to the config-audit scrub slice. The latest head also removes the behavior-neutral duplicate default-disabled lint filter flagged during final maintainer review.

Real behavior proof

Behavior or issue addressed:
Historical config-audit.jsonl records that still contain pre-redactor argv / execArgv values are surfaced by structured doctor lint when explicitly selected, scrubbed by doctor --fix, and then disappear from the same lint check after the rewrite. The rewrite keeps the audit log mode at 0600 and preserves already-redacted records. Broad doctor --lint skips this compatibility-sensitive historical residue check by default.

Real environment tested:
WSL2 Ubuntu 24.04 source checkout with isolated temporary OPENCLAW_STATE_DIR, OPENCLAW_CONFIG_PATH, and HOME; synthetic config-audit.jsonl containing one historical unredacted record plus one already-safe record. Tokens in the proof summary below are redacted.

Evidence after fix:
The first explicit lint reported exactly the structured config-audit scrub finding:

{
  "lintBeforeStatus": 1,
  "lintBeforeOk": false,
  "lintBeforeChecksRun": 1,
  "lintBeforeChecksSkipped": 22,
  "lintBeforeFindings": [
    {
      "checkId": "core/doctor/config-audit-scrub",
      "severity": "warning",
      "message": "1 entry in config-audit.jsonl still contain pre-redactor argv values.",
      "fixHint": "Run `openclaw doctor --fix` to rewrite argv/execArgv fields through the current redactor.",
      "pathBasename": "config-audit.jsonl"
    }
  ]
}

The fix pass and after-lint evidence from the same isolated state:

{
  "fixOutputNeedles": {
    "scrubbedOneEntry": true,
    "rotateCredentials": true,
    "doctorComplete": true
  },
  "lintAfterStatus": 0,
  "lintAfterOk": true,
  "lintAfterChecksRun": 1,
  "lintAfterFindings": [],
  "auditModeOctal": "0o600",
  "recordCountAfterFix": 3,
  "plaintextNeedlesRemain": {
    "slackToken": false,
    "openaiKey": false,
    "githubToken": false
  }
}

Observed result after fix:
The explicit lint failed with the expected core/doctor/config-audit-scrub warning. doctor --fix --yes --non-interactive scrubbed one historical config-audit entry and printed the rotate-credentials warning. The second explicit lint passed with no findings. The audit log stayed 0600, and the token-shaped argv and execArgv plaintext needles were gone after the rewrite. The current head keeps this historical residue check out of broad default lint while leaving the explicit --only path and fix behavior available.

What was not tested:
No live Gateway was writing concurrently to the audit log during this proof; the existing append-race abort path remains covered by focused tests. Maintainer acceptance is still needed for the compatibility/security-boundary choice that historical config-audit residue is warning-level when explicitly selected, but skipped by default.

Validation

Current head ef2283d04fb61da1b9429e73b7c9a034b3dbb1dc:

  • OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs run src/commands/doctor-config-audit-scrub.test.ts src/flows/doctor-health-contributions.test.ts src/flows/doctor-lint-flow.test.ts --reporter=dot - 56 tests passed across 2 shards
  • node_modules\.bin\oxlint.CMD src/commands/doctor-config-audit-scrub.test.ts src/commands/doctor-config-audit-scrub.ts src/config/io.audit.ts src/flows/doctor-health-contributions.test.ts src/flows/doctor-health-contributions.ts src/flows/doctor-lint-flow.test.ts src/flows/doctor-lint-flow.ts - passed
  • node_modules\.bin\oxfmt.CMD --check src/commands/doctor-config-audit-scrub.test.ts src/commands/doctor-config-audit-scrub.ts src/config/io.audit.ts src/flows/doctor-health-contributions.test.ts src/flows/doctor-health-contributions.ts src/flows/doctor-lint-flow.test.ts src/flows/doctor-lint-flow.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

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations agents Agent runtime and tooling size: XL maintainer Maintainer-authored PR labels May 20, 2026
@clawsweeper

clawsweeper Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 24, 2026, 12:26 PM ET / 16:26 UTC.

Summary
The PR adds a default-disabled structured Doctor lint finding and dry-run repair effect for historical config-audit scrub residue.

PR surface: Source +74, Tests +72. Total +146 across 5 files.

Reproducibility: yes. for the changed behavior: seed config-audit.jsonl with a pre-redactor token-shaped argv value, run explicit doctor --lint --only core/doctor/config-audit-scrub, then run doctor --fix and repeat lint. I did not rerun it locally because this review is read-only, but the code path and PR proof are concrete.

Review metrics: 2 noteworthy metrics.

  • Doctor lint selection: 1 added, default-disabled. The default-disabled setting is the compatibility guard that keeps broad doctor --lint from newly failing users with historical audit residue.
  • Public HealthCheck SDK fields: 0 added, 0 removed. The final diff keeps defaultEnabled in internal runner metadata instead of expanding the public health-check contract.

Stored data model
Persistent data-model change detected: migration/backfill/repair: src/commands/doctor-config-audit-scrub.test.ts, migration/backfill/repair: src/commands/doctor-config-audit-scrub.ts, migration/backfill/repair: src/flows/doctor-health-contributions.test.ts, migration/backfill/repair: src/flows/doctor-health-contributions.ts, serialized state: src/commands/doctor-config-audit-scrub.test.ts, unknown-data-model-change: src/commands/doctor-config-audit-scrub.test.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: canonical
Canonical: #84450
Summary: This PR is the canonical open item for exposing the existing config-audit scrub as a structured Doctor finding; the original at-rest credential bug is already fixed, and lint-profile work is a stacked discoverability follow-up.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

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:

  • none.

Risk before merge

  • [P1] Maintainers still need to accept that explicit Doctor lint selection can surface credential-adjacent audit residue metadata, including warning text, count, path, and repair effect target, even though log contents are not emitted.
  • [P1] Broad doctor --lint compatibility depends on the new check remaining default-disabled; making it default-selected would newly fail operators who still have historical audit residue.

Maintainer options:

  1. Accept the opt-in Doctor lint boundary (recommended)
    Approve the current default-disabled structured warning model, where only explicit selection reports config-audit residue and real mutation remains in the existing Doctor scrub path.
  2. Hold for lint-profile policy
    Keep this PR waiting if maintainers want discoverability through the stacked lint-profile work before adding this default-disabled check.

Next step before merge

  • [P2] Manual review remains because of the protected maintainer label and the maintainer-owned opt-in credential-adjacent lint decision; no narrow automated repair is indicated.

Security
Cleared: No concrete security or supply-chain defect was found; the diff adds no dependency, script, permission, or credential-content emission and reuses the existing scrubber.

Review details

Best possible solution:

Merge only after maintainer acceptance of the opt-in lint/security boundary, preserving broad-lint compatibility and the existing legacy scrub path as the real mutation path.

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

Yes for the changed behavior: seed config-audit.jsonl with a pre-redactor token-shaped argv value, run explicit doctor --lint --only core/doctor/config-audit-scrub, then run doctor --fix and repeat lint. I did not rerun it locally because this review is read-only, but the code path and PR proof are concrete.

Is this the best way to solve the issue?

Yes, this is the best observed implementation shape: it reuses the authoritative scrubber in dry-run mode, keeps real mutation in the legacy Doctor path, and keeps the warning out of broad lint by default. The remaining question is maintainer acceptance of the opt-in security/compatibility boundary, not a code defect.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 3217165be770.

Label changes

Label justifications:

  • P2: This is a normal-priority Doctor/security-hardening improvement with limited blast radius because the new lint check is explicit opt-in by default.
  • merge-risk: 🚨 compatibility: If the audit-residue warning becomes default-selected later, existing operators with historical residue could see new failing lint behavior.
  • merge-risk: 🚨 security-boundary: The PR exposes credential-adjacent audit residue metadata through structured Doctor output and needs maintainer acceptance of that boundary.
  • 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 includes after-fix WSL2 source-checkout proof showing explicit lint before, doctor --fix, lint after, preserved 0600 mode, and token-shaped plaintext needles removed.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes after-fix WSL2 source-checkout proof showing explicit lint before, doctor --fix, lint after, preserved 0600 mode, and token-shaped plaintext needles removed.
Evidence reviewed

PR surface:

Source +74, Tests +72. Total +146 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 3 76 2 +74
Tests 2 72 0 +72
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 148 2 +146

What I checked:

  • Repository policy applied: Root AGENTS.md was read fully and its deep review plus compatibility/security guidance applied to this Doctor/config-audit PR. (AGENTS.md:30, 3217165be770)
  • Live PR state: Live metadata shows the PR is open, mergeable, non-draft, contributor-authored, labeled maintainer, proof: sufficient, and has compatibility/security-boundary merge-risk labels at head ef2283d. (ef2283d04fb6)
  • Structured check wiring: The PR declares core/doctor/config-audit-scrub as a structured contribution-owned check and keeps it defaultEnabled: false. (src/flows/doctor-health-contributions.ts:1311, ef2283d04fb6)
  • Detection reuses existing scrubber: The new detector calls scrubConfigAuditLog with dryRun: true and maps only the count/path into a health finding and repair effect. (src/commands/doctor-config-audit-scrub.ts:19, ef2283d04fb6)
  • Existing mutation path: Current main already owns the real rewrite in scrubConfigAuditLog, including dry-run behavior and append-race aborts; this PR does not replace that path. (src/config/io.audit.ts:469, 3217165be770)
  • Default-disabled runner contract: Current main skips default-disabled checks during broad lint unless --only selects them, which is the compatibility guard this PR relies on. (src/flows/doctor-lint-flow.ts:40, 3217165be770)

Likely related people:

  • giodl73-repo: Prior merged PRs established the ordered Doctor health contribution model, default-disabled runner metadata, and adjacent structured Doctor checks that this PR extends. (role: recent area contributor; confidence: high; commits: e56fd1dc0466, 67ee0dee00e8, 704fc3504392; files: src/flows/doctor-health-contributions.ts, src/flows/doctor-lint-flow.ts, src/flows/health-check-runner-types.ts)
  • YB0y: Authored the merged historical config-audit scrub implementation reused by this PR's structured lint detector. (role: introduced behavior; confidence: high; commits: 14a9bb98b7f7, b1cb190034d9, 11bd19ec630f; files: src/commands/doctor-config-audit-scrub.ts, src/config/io.audit.ts, src/config/io.audit.test.ts)
  • galiniliev: Assigned to this PR and left a maintainer review on the same Doctor/config-audit surface with no blocking findings. (role: reviewer; confidence: medium; commits: 030fa77f88c2; files: src/commands/doctor-config-audit-scrub.ts, src/config/io.audit.ts, src/flows/doctor-health-contributions.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: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. 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: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. labels May 20, 2026
@clawsweeper

clawsweeper Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat.

Where did the egg go?
  • The egg game starts only after the PR passes the real-behavior proof check.
  • Before that, no creature or rarity is rolled. The treat waits for real proof.
  • This is still just collectible flavor: proof affects review readiness, not creature quality.

@giodl73-repo
giodl73-repo force-pushed the doctor-cron-audit-structured-repairs branch from 9b583fd to 4e84dd1 Compare May 20, 2026 22:56
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels May 20, 2026
@giodl73-repo
giodl73-repo force-pushed the doctor-cron-audit-structured-repairs branch from 4e84dd1 to b1ee397 Compare May 21, 2026 01:06
@giodl73-repo
giodl73-repo force-pushed the doctor-cron-audit-structured-repairs branch 6 times, most recently from c6afcfd to 828c1c8 Compare May 22, 2026 20:40
@giodl73-repo
giodl73-repo force-pushed the doctor-cron-audit-structured-repairs branch from 828c1c8 to 72612ac Compare May 25, 2026 03:28
@openclaw-barnacle openclaw-barnacle Bot removed agents Agent runtime and tooling extensions: policy size: XL labels May 25, 2026
@clawsweeper clawsweeper Bot added 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: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jun 20, 2026
@giodl73-repo
giodl73-repo force-pushed the doctor-cron-audit-structured-repairs branch from acd6c33 to e7ccfb6 Compare June 20, 2026 21:21
@openclaw-barnacle openclaw-barnacle Bot added size: S and removed docs Improvements or additions to documentation scripts Repository scripts size: XL labels Jun 20, 2026
@giodl73-repo

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Updated the #84450 PR body for current head e7ccfb652abe6e46c61ccdf28f023dc594912bf9 and restored the Real behavior proof section to the required structured format. No code changes; this is a body/proof freshness update after the rebase and opt-in lint compatibility fix.

@clawsweeper

clawsweeper Bot commented Jun 21, 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 status: 🔁 re-review loop A fresh ClawSweeper review was explicitly requested after the latest review. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. status: 🔁 re-review loop A fresh ClawSweeper review was explicitly requested after the latest review. labels Jun 21, 2026
@giodl73-repo

Copy link
Copy Markdown
Contributor Author

Rebased #84450 onto current upstream/main and force-with-lease pushed 15f87d0cd749e1e5fe3e980a97d0994e5139936d.

Validation after rebase:

  • $env:OPENCLAW_VITEST_MAX_WORKERS='1'; node scripts\run-vitest.mjs run src\commands\doctor-config-audit-scrub.test.ts src\flows\doctor-health-contributions.test.ts src\flows\doctor-lint-flow.test.ts --reporter=dot - 56 passed across 2 shards
  • changed-file oxlint
  • changed-file oxfmt --check
  • pnpm tsgo:test:src
  • git diff --check

pnpm tsgo:core is currently blocked on rebased upstream/main by untouched src/config/sessions/session-accessor.ts:1545 (sessionStore unused, TS6133), so I left that outside this config-audit doctor PR.

@clawsweeper please re-review current head.

@clawsweeper

clawsweeper Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper assist is taking a look at your question.

I queued a lightweight read-only assist pass. It will post a separate answer comment and will not edit the durable ClawSweeper review comment or trigger close, merge, repair, label, or branch changes.

Request: please re-review current head.

@clawsweeper

clawsweeper Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper assist: Current head is 15f87d0cd749e1e5fe3e980a97d0994e5139936d; a full correctness re-review needs the normal review lane, so use @clawsweeper review.

Evidence:

  • PR: Doctor: expose config audit scrub findings #84450
  • Source request: Doctor: expose config audit scrub findings #84450 (comment)
  • Head force-pushed on 2026-06-22T15:40:17Z to 15f87d0cd749e1e5fe3e980a97d0994e5139936d.
  • Author reports focused validation passed: 56 Vitest tests, changed-file oxlint, changed-file oxfmt --check, pnpm tsgo:test:src, and git diff --check.
  • Author reports pnpm tsgo:core is blocked by untouched upstream src/config/sessions/session-accessor.ts:1545 unused sessionStore / TS6133.
  • Previous ClawSweeper review covered older head e7ccfb652abe88833f5734484fa2ece11d6165eb, not the current head.

Suggested next action: Comment @clawsweeper review on #84450 for a full current-head review.


Source: #84450 (comment)
Assist reasoning: low.

Copy link
Copy Markdown
Contributor Author

@clawsweeper review

Refreshed #84450 after #84340 merged and pushed current head 030fa77f88c2e5552099eb0cba10d9c38074db26.

Change made:

  • Rebased the config-audit scrub structured Doctor slice onto current main.
  • Resolved the ordered contribution test conflict by keeping sandbox, gateway-services, and config-audit structured check ids together.
  • Added fix(doctor): keep audit lint defaults internal so defaultEnabled remains internal runner selection metadata, not part of the public HealthCheck SDK contract.

Validation at current head:

  • Focused config-audit/contribution/lint-flow Vitest: 56 tests passed across 2 shards.
  • Changed-file oxlint passed.
  • Changed-file oxfmt --check passed.
  • Core tsgo passed.
  • Test-source tsgo passed.
  • node scripts/plugin-sdk-surface-report.mjs --check passed.
  • git diff --check passed.

@clawsweeper

clawsweeper Bot commented Jun 23, 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.

@galiniliev galiniliev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This adds a structured doctor lint check for historical config-audit argv scrub work while leaving normal doctor/doctor --fix on the existing legacy scrub path. That matters because the audit log can contain pre-redactor argv/execArgv secrets at rest, but broad lint should not start failing operators by default.

LOC: +193/-10 (9 files)
By: Gio Della-Libera (@giodl73-repo, acct 2025-09-30) | OpenClaw: 185 PRs, 14 issues, 134 commits/12mo | GitHub: 6339 commits, 219 PRs, 29 issues, 17 reviews/12mo

No blocking findings.

Affected surface: core doctor lint/health contribution plumbing and config-audit scrub preview/reporting: src/commands/doctor-config-audit-scrub.ts, src/config/io.audit.ts, src/flows/doctor-health-contributions.ts, src/flows/doctor-lint-flow.ts.
Behavior: explicit doctor --lint --only core/doctor/config-audit-scrub reports historical pre-redactor audit argv residue; broad doctor --lint skips the check by default; doctor --fix remains owned by maybeScrubConfigAuditLog.
Provenance: carried forward by config-audit scrub repair from commit 432b949 / #80777; this PR does not change the redactor or the on-disk rewrite algorithm, only exposes the existing dry-run result as structured health/lint output.

Best-fix verdict: best. The check is declared on the existing ordered doctor contribution, reuses scrubConfigAuditLog(... dryRun: true) and resolveConfigAuditLogPath, and does not create a second repair path for the sensitive rewrite.
Alternatives considered: make the check default-enabled in broad lint (rejected because it turns historical sensitive residue into a new broad lint failure); move the rewrite into structured repair (rejected because runConfigAuditScrubHealth already owns the real doctor/--fix append-race guarded cleanup); duplicate detection outside io.audit (rejected because it would drift from the authoritative redactor).
Code read: src/config/io.audit.ts, src/config/io.audit.test.ts, src/commands/doctor-config-audit-scrub.ts, src/commands/doctor-config-audit-scrub.test.ts, src/flows/doctor-health-contributions.ts, src/flows/doctor-health-contributions.test.ts, src/flows/doctor-lint-flow.ts, src/flows/doctor-lint-flow.test.ts, src/flows/doctor-repair-flow.ts, src/flows/health-check-adapter.ts, src/flows/health-check-runner-types.ts, src/commands/doctor-lint.ts.
Validation: On merge ref 332f3ad: OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs src/commands/doctor-config-audit-scrub.test.ts src/flows/doctor-health-contributions.test.ts src/flows/doctor-lint-flow.test.ts --reporter=dot passed 56 tests across 2 shards; pnpm exec oxfmt --check ... passed; pnpm exec oxlint ... passed; git diff --check origin/main...origin/pr/84450 passed.
Remaining uncertainty: I did not run full pnpm check or live Gateway concurrent append proof; the append-race behavior is unchanged here and covered by existing focused tests in src/config/io.audit.test.ts.

Copy link
Copy Markdown
Contributor Author

@clawsweeper review

Refreshed #84450 after #84366 merged and pushed current head b48b598a989cb470668d77ea90a22091cc682bf3.

Change made:

  • Rebased the config-audit scrub structured Doctor slice onto current main.
  • The shared internal default-selection runner metadata now comes from merged Doctor: expose session lock findings #84366, so this PR's diff is limited to the config-audit scrub slice.
  • Public plugin contract remains unchanged: defaultEnabled stays out of public HealthCheck, and plugin-sdk-surface-report --check passes.

Validation at current head:

  • Focused config-audit/contribution/lint-flow Vitest: 56 tests passed across 2 shards.
  • Changed-file oxlint passed.
  • Changed-file oxfmt --check passed.
  • Core tsgo passed.
  • Test-source tsgo passed.
  • node scripts/plugin-sdk-surface-report.mjs --check passed.
  • git diff --check origin/main...HEAD passed.

@clawsweeper

clawsweeper Bot commented Jun 24, 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

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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

Labels

commands Command implementations 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: S 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.

2 participants