Skip to content

fix(doctor): check the operator state volume during mixed lint - #154829

Closed
roboclaw-bot wants to merge 1 commit into
mainfrom
roboclaw/doctor-state-volume-117415
Closed

roboclaw-bot wants to merge 1 commit into
mainfrom
roboclaw/doctor-state-volume-117415

Conversation

@roboclaw-bot

Copy link
Copy Markdown
Collaborator

Related: #117415

What Problem This Solves

Fixes Doctor lint missing critically low free space when a disk-space check runs alongside a plugin check whose private snapshot is on a healthier volume.

User Impact

The opt-in check measures the operator’s state volume during mixed lint runs. Existing thresholds remain: below 100 MiB is an error; 100 MiB through less than 500 MiB is a warning. Ordinary environment fallback, selection, severity filtering and post-update readiness behavior are unchanged. This fix requires no schema migration or operator action.

Why This Change Was Made

The registered detector forwards the lint context’s existing environment to the existing disk-space owner. Plugin checks retain private-state isolation, and current coverage is preserved.

Evidence

Tested candidate: 99b82f2b4c3a661e3e5cfcf05dc37d16f907dafd
Base: 761725d03f294aaddc399a759a0755d34a0e1ecf
Tree: be44f932acfe01475186e0bd85337f599694f8a3

Signed publication head: 943fa8cf8637ce9d729104c6f39713fa5e22e6d1. Its tree and single parent exactly match the tested candidate; publication changed commit metadata, not source bytes.

Check Result Time
Current mixed-lint and post-plugin snapshot regressions, one worker Exit 0; 2 selected tests passed, 21 outside the filter 33.81s; tests 2.913s / 2.772s
Exact-base/head selected changed aggregate Exit 0; selected types, lint, formatting, config docs, dead-export scans and guards passed 578.76s
One canonical full build, pack and tarball integrity check Exit 0 542.89s; build 487.9s
Published [email protected] → candidate, maintained projects-doctor cell Exit 0; one attempt, original-driver update succeeded without follow-up repair 95.71s runner / 83s scenario
Generated release checks Exit 1: plugin-version and UI fallback-catalog drift 76.05s
Full release integrity/size check Exit 1: unpacked-size budget exceeded; tarball integrity itself passed 78.12s

Release qualification remains red. The frozen candidate needs version alignment for @openclaw/facetime, @openclaw/onnx and @openclaw/typesafe, plus a Control UI fallback-catalog baseline update. Unpacked size was 256,945,332 bytes, above the 246,415,360-byte budget. These inputs are unchanged by this patch. No version/baseline/budget exception or baseline-size comparison was used; successful bug-specific checks are not a release-ready claim.

Regression: disk capacity is injected, but the registered lint/config/snapshot flow is real. It covers critical findings, the exact 100 MiB boundary, filtering, exit status and source SQLite preservation. The earlier reproduction failed before the repair. No live low-disk proof is claimed.

Compatibility: the unmodified published 9.4 driver installed this exact candidate. The harness verified both application payloads and ran installed Doctor twice while preserving project/workspace state and snapshot lifecycle. An ordinary first-hop advisory warning was retained; no zero-warning assertion was added. This is not Gateway startup/restart, health/readiness/RPC or live-disk proof.

Package SHA-256: 583c4395671cb425c268df01ccfb28c77b4575bc9b0da5e1fa250d771a0cee46. Build-info identifies the candidate commit. Testbox carrier/hydration run is not PR exact-head CI.

Main drift: startup-migration changes were inspected, but they are separate from runDoctorLintCli. At inspected main 28dbfcc05f2fceb49fb29a17c7d9a60133b5dde5, the lint route, affected owner and nine direct inputs are unchanged from the tested base. Lint still preserves captured sourceEnv, private plugin state and explicit coreCtx.env; the collector only resolves the path and reads capacity. No contrary call-graph interaction was found. Frozen-candidate compatibility remains valid for that candidate; latest-main runtime execution is unproved. Current exact merge-ref CI must exercise integration, and native drift guards still apply.

Historical evidence and preserved execution failures
  • 220 tests previously passed on 14ad80a1aea9dfac39bca02410d722f444a1027e / base 47f1d6ad8eb67a0e22db2191f9da9a386eb08e5b. This is old-input evidence, not 220 tests rerun on the current candidate. The identical patch’s independent P2 scoped-clean review was reused.
  • The first current-head focused attempt exited 1 in 14.50s before assertions: concurrent preflight JSON files under .openclaw/tmp changed the compiler’s resolution namespace. Moving proof scratch/cache to excluded .artifacts and serializing the same test selection resolved that interference. The failure was retained; no product, assertion, timeout, baseline or cache guard was weakened.
  • The remote controller exited 1 in 1290.38s with both red release phases; the compatibility cell separately exited 0. Automatic artifact collection exited 9, and portal synchronization logged a deadline error. A native directory download recovered receipts and matching package hashes in 58.99s without rerunning proof. The collector’s internal failure cause remains unproven.
  • Transport carrier b0c201051f8b9bec40746e602a9209d3139e3c2d was kept distinct from the actual candidate execution checkout; no carrier relabeling. The task-owned Testbox was stopped after evidence recovery, and all commands joined.

Worked on by

Work sessions


View the OpenClaw team session

Forward the preserved lint context environment to the existing disk-space owner so a private plugin snapshot cannot redirect capacity checks. Preserve thresholds, ordinary environment fallback, opt-in selection, and post-plugin readiness.

Tree-identical signed publication of validated local candidate 99b82f2b4c3a661e3e5cfcf05dc37d16f907dafd. Current focused regressions, selected changed gates, canonical package integrity, and published 2026.9.4-driver Doctor compatibility passed. Broader release metadata and package-size qualification remain red and are documented in the PR.

Related: #117415

Co-authored-by: steipete <[email protected]>
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation commands Command implementations size: S maintainer Maintainer-authored PR labels Sep 21, 2026
@roboclaw-bot
roboclaw-bot marked this pull request as ready for review September 21, 2026 12:36
@clawsweeper

clawsweeper Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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. labels Sep 21, 2026
@clawsweeper

clawsweeper Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 6, 2026, 8:52 PM ET / October 7, 2026, 00:52 UTC (Revision 2).

ClawSweeper review

What this changes

Doctor’s read-only health check uses the operator’s state volume during mixed plugin checks, with regression coverage and documentation for disk thresholds and filtering.

Merge readiness

⛔ Blocked before merge - 3 items remain

The wrong-volume defect remains on current main, and this is a useful, focused repair. No introduced correctness finding was established; the protected maintainer label also precludes automatic closure.

Priority: P2
Reviewed head: 943fa8cf8637ce9d729104c6f39713fa5e22e6d1

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with meaningful boundary regression and installed-update evidence; current-main integration needs refreshing.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The ordinary contributor-proof gate is exempt for this bot/member PR. Captured evidence exercises installed Doctor after a published-driver upgrade; the wrong-volume regression uses injected capacity through the registered lint flow and does not claim live low-disk proof. No stored-data contract changes, so the prior migration blocker is resolved.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The ordinary contributor-proof gate is exempt for this bot/member PR. Captured evidence exercises installed Doctor after a published-driver upgrade; the wrong-volume regression uses injected capacity through the registered lint flow and does not claim live low-disk proof. No stored-data contract changes, so the prior migration blocker is resolved.
Evidence reviewed 9 items Pinned introduced change: The merge-base-to-head delta changes the registered disk detector to forward ctx.env, extends the existing mixed-lint regression, updates its registration assertion, and documents existing thresholds. The checkout is the original PR head, not a synthetic merge.
Production boundary and stored-state compatibility: The lint owner captures sourceEnv before private snapshot setup and supplies it through coreCtx.env. The disk collector resolves a directory and reads filesystem capacity; the patch introduces no schema, persisted-format, migration, configuration, or state-write change. The previous migration-specific blocker is therefore inapplicable.
Meaningful regression coverage: The extended existing fixture exercises the registered CLI/config/snapshot path with path-dependent injected capacity. It checks direct and mixed selection, the exact 100 MiB boundary, severity filtering, exit status, and preservation of source SQLite bytes. It introduces no new production test seam.
Findings None None.
Security None None.

How this fits together

Doctor lint combines core and plugin health checks into findings and an exit status. Plugin inspection uses private state snapshots, while disk capacity must describe the operator’s actual state volume.

flowchart TD
  A[Operator configuration and environment] --> B[Doctor lint]
  B --> C[Private plugin snapshot]
  C --> D[Plugin health checks]
  B --> E[Operator state volume check]
  E --> F[Capacity thresholds]
  D --> G[Filtered findings and exit status]
  F --> G
Loading

Before merge

  • Resolve merge risk (P1) - The validated candidate predates current main’s removal of the collector’s environment parameter and split lint runner; refresh the integration and validate operator-volume selection against those current owners before merge.
  • Complete next step (P2) - Refresh the repair against current main’s collector and split lint runner, then validate mixed-volume selection and published-driver Doctor compatibility on the refreshed candidate.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source 0, Tests +44, Docs +6. Total +50 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 1 2 2 0
Tests 2 45 1 +44
Docs 1 6 0 +6
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 53 3 +50

Review metrics

None.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/flows/doctor-health-contributions-initial.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep one disk-capacity owner that receives the operator’s state location while plugin inspection retains its private snapshot, without restoring unrelated test-only injection hooks.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep one disk-capacity owner that receives the operator’s state location while plugin inspection retains its private snapshot, without restoring unrelated test-only injection hooks.

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

Yes, source establishes the trigger: select disk-space alongside an isolated plugin check while operator state and temporary snapshot storage have different capacity. Current main still reads the private ambient environment; no runtime reproduction was executed during this review.

Is this the best way to solve the issue?

Yes against the pinned base: forwarding the preserved environment reuses the existing owner and preserves isolation. Current main’s changed collector contract requires a focused integration refresh.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 058de57ceb6d.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This repairs false-clean results in an opt-in disk health check during mixed lint runs, with limited workflow impact.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The ordinary contributor-proof gate is exempt for this bot/member PR. Captured evidence exercises installed Doctor after a published-driver upgrade; the wrong-volume regression uses injected capacity through the registered lint flow and does not claim live low-disk proof. No stored-data contract changes, so the prior migration blocker is resolved.

Evidence

What I checked:

  • Pinned introduced change: The merge-base-to-head delta changes the registered disk detector to forward ctx.env, extends the existing mixed-lint regression, updates its registration assertion, and documents existing thresholds. The checkout is the original PR head, not a synthetic merge. (src/flows/doctor-health-contributions-initial.ts:340, 943fa8cf8637)
  • Production boundary and stored-state compatibility: The lint owner captures sourceEnv before private snapshot setup and supplies it through coreCtx.env. The disk collector resolves a directory and reads filesystem capacity; the patch introduces no schema, persisted-format, migration, configuration, or state-write change. The previous migration-specific blocker is therefore inapplicable. (src/commands/doctor-lint.ts:416, 943fa8cf8637)
  • Meaningful regression coverage: The extended existing fixture exercises the registered CLI/config/snapshot path with path-dependent injected capacity. It checks direct and mixed selection, the exact 100 MiB boundary, severity filtering, exit status, and preservation of source SQLite bytes. It introduces no new production test seam. (src/commands/doctor-lint.test.ts:591, 943fa8cf8637)
  • Current-main integration drift: Current main’s disk collector accepts no arguments and resolves process.env. Its split lint runner still scopes ambient state to a private plugin snapshot and only restores source state for selected special checks, excluding disk-space. Thus the central defect remains, but the branch’s new environment argument must be reconciled with the current collector contract. No pinned test merge was available; this is a refresh requirement, not a verified merge-result finding. (src/commands/doctor-disk-space.ts:89, 058de57ceb6d)
  • Current-main collector inspection: The collector reads process.env at line 63 and invokes the shared filesystem-capacity owner at line 67; its public internal entrypoint takes no parameters at line 89. (src/commands/doctor-disk-space.ts:63, 058de57ceb6d)
  • Captured execution and update evidence: The supplied PR body records two focused regressions passing and a published 2026.9.4 updater installing the candidate and running installed Doctor twice while preserving project/workspace state. Candidate tree be44f932acfe01475186e0bd85337f599694f8a3 matches the publication head’s recorded tree. Capacity was injected; no live low-disk run was claimed. Broader release qualification failures were explicitly retained. (943fa8cf8637)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Reconcile environment forwarding with current main’s disk collector and split lint runner, then rerun the mixed-volume regression and published-driver Doctor compatibility cell.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • 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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-21T12:44:17.252Z sha 943fa8c :: blocked before merge. :: none

roboclaw-bot added a commit that referenced this pull request Sep 21, 2026
Replace one-second state polling in the two final-startup exhaustion tests with the existing root-admission completion boundary. Join every final-target recovery promise before retaining the original row, charge, reservation, call-count, fresh-row and distinct-store assertions. Stop and join recovery before fixture teardown, including cancellation before final reconciliation begins.

Keep runtime behavior, schemas, authority, test routing and timeouts unchanged. A temporary controlled 1.5-second startup-admission delay reproduces both original assertions and passes with this fixture repair; diagnostic source was removed and hash-restored before final proof. Focused tests, an eight-file original-plan subset, admission siblings, scoped types/lint/format and independent P2 review pass locally. Node26 proof does not establish the historical hosted Node24 slowdown cause or a full original-shard pass.

Related: #154829

Co-authored-by: steipete <[email protected]>

hippoley commented Oct 7, 2026

Copy link
Copy Markdown

Current-main integration note after checking the split lint runner and disk-space owner:

  • prepareDoctorLintExecution() captures sourceEnv = { ...process.env } before private plugin-state inspection.
  • The current disk-space collector still resolves its state directory from ambient process.env.
  • The initial Doctor contribution still registers disk-space as detect() { return collectDiskSpaceHealthFindings(); }.

That means the central mixed-volume failure is still structurally possible on current main: once a selected plugin check enters a private snapshot/environment, the disk-space check has no explicit path back to the operator/source environment.

A minimal current-main-compatible repair looks narrower than restoring any broad test hook:

  1. Let collectDiskSpaceHealthFindings accept an optional env (or state-dir) input while keeping the no-arg path for ordinary callers.
  2. Change only the registered health contribution to detect(ctx) => collectDiskSpaceHealthFindings({ env: ctx.env }).
  3. Keep plugin inspection isolated; do not mutate ambient process.env.
  4. Refresh the mixed selected-check regression against the split runner and assert the disk probe sees the operator state dir while the plugin check remains on its private snapshot.

One review bookkeeping point also looks stale: the latest ClawSweeper text says the previous migration blocker is resolved and that this patch introduces no schema/persisted-format/state-write change, but the “Before merge” checklist still asks for data-model compatibility proof. Unless there is a separate stored-data delta outside the reviewed patch, that item appears inconsistent with the evidence section.

I’m happy to help reduce this to an exact current-main regression/patch if useful.

hippoley commented Oct 7, 2026

Copy link
Copy Markdown

Follow-up after checking current main more closely: the runner already constructs coreCtx.env from the captured source environment, so this can be fixed without touching the split lint runner or mutating ambient process.env.

I wrote out the exact current-main patch shape here:

https://github.com/hippoley/ClawManager/blob/main/docs/patches/openclaw-154829-current-main.patch

The core change is only:

  • allow collectDiskSpaceHealthFindings({ env });
  • keep no-arg callers unchanged;
  • register disk-space as detect(ctx) => collectDiskSpaceHealthFindings({ env: ctx.env });
  • add an explicit-env unit regression plus the existing mixed-check integration case.

That preserves plugin-state isolation and makes the ownership boundary explicit at the health-check registration point. I have not claimed runtime execution of this patch; this is a source-reviewed proposal against current main.

hippoley commented Oct 7, 2026

Copy link
Copy Markdown

I reduced the current-main refresh to an exact mixed-volume regression:

https://github.com/hippoley/ClawManager/blob/main/docs/evidence/openclaw-154829-exact-mixed-volume-regression.md

It adds two checks on top of the narrow production patch:

  1. a collector unit case proving an explicit source env beats ambient private-snapshot state;
  2. a real selected-check integration case that runs disk-space alongside the existing isolated plugin check and asserts the disk probe sees the operator stateDir while source SQLite bytes remain unchanged.

That directly matches the current review ask: operator-volume selection + mixed plugin isolation on the split lint runner. It also makes the compatibility point explicit: no persisted schema/config/migration owner changes; only the disk-capacity dependency is made explicit at the registered health-check boundary.

Still source-reviewed/not-executed on my side.

@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Closing as superseded.

Superseded by #117415. Doctor passes the retained operator environment into disk-space checks, including mixed lint selection.

This closes the PR without deleting its branch.

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

Labels

commands Command implementations docs Improvements or additions to documentation maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. 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