Skip to content

fix(doctor): preserve the live plugin index during read-only checks - #160400

Merged
steipete merged 4 commits into
mainfrom
deslop/l119-doctor-native-admission
Sep 29, 2026
Merged

steipete merged 4 commits into
mainfrom
deslop/l119-doctor-native-admission

Conversation

@steipete

@steipete steipete commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Read-only Doctor inspections can mutate the live installed-plugin index when native-admission writes settle after Doctor restores the caller's environment. With prepared metadata, private capture receipts escape the inspection and can break later plugin loads.

User Impact

Doctor preserves the live index and subsequent plugin loads. Config keys, schemas, migrations, receipt formats, and registration authority stay unchanged.

Why This Change Was Made

Partition native-admission facts by metadata environment and read-only mode. Pin capture and publication destinations when the view is created, and prevent read-only views from queuing publication. Settlement still covers every view and retirement keeps its existing custody cleanup.

The capture destination uses the same canonical resolver as allocation, including the profile context added by merged #160446. Native bytes therefore remain under the original profile's capture directory after Doctor removes its disposable SQLite snapshot. Merged #160291 separately repairs consumers encountering already-missing captures; this PR prevents inspection receipts from reaching the live index.

Two existing fixtures now provide complete typed metadata snapshots for the real admission path; their behavior assertions remain intact.

Evidence

Published head: eb78bd0c429a3e2235d7b97f4e3e4831107000ed. Final tree: d4056abdd24f130f2f709d5dea97adc1c7e521d6, based on 1eef6b153bfb02e9ec34bf418b1e3d7042f9c51e. All four commits are patch-identical after refreshing onto the upstream Docker-helper assertion repair 8799587f34360d9630ed6f49dffc878d3b013e5c. Application sources are byte-identical to product-proof tree 4b5354c3dfe5619652290bbf00c9f440f4b6fe91; the final correction adds that existing resolver to the trusted PR wrapper's extraction inventory. Open, unmerged, and without auto-merge.

Blacksmith Testbox tbx_01m3mp3y3rzyt8708k4d80241y, run 36468964679:

  • pnpm test for both Doctor suites: all 3 cases passed, 84 s. The native-admission regression alone passed both default/prepared cases with pnpm test src/commands/doctor-lint.native-admission.test.ts --maxWorkers=1, 45.98 s command wall.
  • node scripts/run-vitest.mjs for six capture/admission/cache/Doctor/startup sibling suites: passed, 126 s. Four import-boundary suites, including src/infra/fs-safe-import-boundary.test.ts: passed, 6 s.
  • Full node scripts/check-changed.mjs --base origin/main: passed, 1,727.48 s, including all 26 selected test-type graphs, unused scans, lint, and guards.
  • pnpm build: passed, 427 s. Candidate package creation: passed, 83 s.
  • pnpm test:docker:published-upgrade-survivor: published [email protected] driver against the built candidate, base scenario with manual restart, passed in 408 s. Live model probes were disabled.

Negative controls establish both defects: the original explicit capture pin composed with #160446 reproduced retained-file ENOENT; clean-main production blobs with the final regression still failed the prepared-metadata live-index equality assertion while the default control passed (64.41 s). The fixed regression retains live-index equality, persisted-file existence, later-load, and post-snapshot native-byte assertions.

Independent Codex review of the final four-file integration was scoped-clean through P2. Earlier fixture and admission reviews were completed and adjudicated. An initial changed-check attempt hit an inherited missing scheduler in a Gateway fixture; upstream 4bd105408cc repaired it, and the full final gate above includes that fix. No limit or baseline was raised.

CI 36487658750 on the preceding head was cancelled after two existing extraction-closure assertions exposed the omitted resolver entry. This was an introduced packaging omission, not inherited main debt. The canonical scripts/pr-lib/wrapper-components.txt now lists the module once; no assertions, resolver behavior, or extraction rules changed.

Blacksmith Testbox tbx_01m3mzk2kva4n2xk2dexp472y9, run 36488047638, verified pre-refresh tree b359b9b25500e4758e966a1e8a36eb5202c31666; the reviewed inventory correction is patch-identical. The exact published parent reproduced both missing-module failures. With the one-line inventory fix, all 16 eager/extracted-import closure tests passed (24 s), wrapper source/provisioning siblings passed (19 cases and one existing skip, 128 s), four import-boundary suites passed (8 s), and inventory-scoped check-changed passed (112 s). Both listed leases are stopped/completed. The one-line inventory correction passed fresh Codex review through P2. Current-head CI 36500013879 is attached and in progress; earlier cancelled runs are not represented as green.

An earlier package release check passed integrity but exceeded the unpacked-size budget (369.1 MiB / 320 MiB); its downstream installed-runtime smoke did not run. The final package/updater proof above passed, but the release-budget check was not rerun and full release validation is not claimed. All tests, checks, and builds ran remotely.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation commands Command implementations size: M labels Sep 28, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. 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. labels Sep 28, 2026
@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 28, 2026, 8:00 PM ET / September 29, 2026, 00:00 UTC (Revision 11).

ClawSweeper review

What this changes

The branch separates native-plugin admission state for read-only inspections, pins capture and publication destinations, and adds Doctor regression coverage, documentation, and wrapper inventory updates.

Merge readiness

✅ Ready for maintainer review

Keep open. Current main still allows deferred native-admission work from a read-only Doctor inspection to affect the installed-plugin index. The merged neighboring fixes address capture lifetime and missing captures, but not this distinct problem. No actionable defect remains in the reviewed head.

Priority: P1
Reviewed head: eb78bd0c429a3e2235d7b97f4e3e4831107000ed

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Direct Doctor-path and upgrade evidence support a focused repair, with no concrete correctness or security finding in the reviewed head.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The changed admission owner is exercised through Doctor lint with a managed native-plugin fixture in both metadata modes; the PR records an unchanged persisted index, surviving captured bytes, and a successful later load, alongside a published-driver candidate upgrade. Raw linked job logs were inaccessible to this reviewer, so those observations are attributed to the PR record. The diff changes no stored-index schema or receipt format.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The changed admission owner is exercised through Doctor lint with a managed native-plugin fixture in both metadata modes; the PR records an unchanged persisted index, surviving captured bytes, and a successful later load, alongside a published-driver candidate upgrade. Raw linked job logs were inaccessible to this reviewer, so those observations are attributed to the PR record. The diff changes no stored-index schema or receipt format.
Evidence reviewed 9 items Current-main gap: Current main has one admission state per cache; its read-only guard runs when publication executes, leaving queued publication vulnerable after Doctor restores the caller's environment.
Introduced isolation: The PR keys admission views by read-only mode and metadata environment, captures destinations when a view is created, and settles all views.
Publication boundary: Read-only admission returns before queuing publication; writable publication uses the state directory captured by its admission view.
Findings None None.
Security None None.

How this fits together

Doctor checks plugins against disposable state snapshots. Native admission captures plugin files and can record receipts in the installed-plugin index, which later plugin loads use.

flowchart LR
  A[Doctor check] --> B[Disposable state snapshot]
  B --> C[Plugin metadata view]
  C --> D{Admission mode}
  D -->|Read-only| E[Private captures]
  D -->|Writable| F[Installed plugin index]
  E --> G[Later plugin load]
  F --> G
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +42, Tests +267, Docs +4, Other +1. Total +314 across 10 files.

View PR surface stats
Area Files Added Removed Net
Source 5 54 12 +42
Tests 3 270 3 +267
Docs 1 4 0 +4
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 0 +1
Total 10 329 15 +314

Review metrics

Metric Value Why it matters
Production and test lines production +54/−12; tests +270/−3 The production growth separates admission views; most added lines exercise the Doctor lifetime boundary.
Doctor regression cost 2 scenarios; 45.98 s single-worker command wall reported The PR records the cost of the new real-path test, which exceeds the repository's usual per-file target.

Technical review

Best possible solution:

Keep Doctor's native admissions in their inspection view so later plugin loads use intact captures and the operator's installed index remains unchanged.

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

Yes. Current-main source shows the shared admission state and deferred publication path, and the PR records a negative control through Doctor lint; this read-only review did not execute it.

Is this the best way to solve the issue?

Yes. The branch changes the existing plugin-admission owner and preserves the installed-index format and plugin API, while its regression checks Doctor and a subsequent load.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 682ffe55a9f0.

Labels

Label changes:

No label changes.

Label justifications:

  • P1: A read-only Doctor check can affect the installed-plugin index and break later plugin loads.
  • 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 changed admission owner is exercised through Doctor lint with a managed native-plugin fixture in both metadata modes; the PR records an unchanged persisted index, surviving captured bytes, and a successful later load, alongside a published-driver candidate upgrade. Raw linked job logs were inaccessible to this reviewer, so those observations are attributed to the PR record. The diff changes no stored-index schema or receipt format.
  • proof: sufficient: Contributor real behavior proof is sufficient. The changed admission owner is exercised through Doctor lint with a managed native-plugin fixture in both metadata modes; the PR records an unchanged persisted index, surviving captured bytes, and a successful later load, alongside a published-driver candidate upgrade. Raw linked job logs were inaccessible to this reviewer, so those observations are attributed to the PR record. The diff changes no stored-index schema or receipt format.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Jason (Json): Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vyctor H. Brzezowski: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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 (10 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-28T14:16:16.939Z sha 16da6a9 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-28T16:15:52.190Z sha 16da6a9 :: blocked before merge. :: none
  • reviewed 2026-09-28T17:07:10.417Z sha 00acb9b :: needs maintainer review before merge. :: none
  • reviewed 2026-09-28T17:55:41.526Z sha 00acb9b :: blocked before merge. :: [P1] Pin native captures to Doctor's profile capture owner
  • reviewed 2026-09-28T18:31:34.879Z sha 00acb9b :: blocked before merge. :: [P1] Honor Doctor's profile-owned native capture destination
  • reviewed 2026-09-28T22:21:16.267Z sha fbf5879 :: blocked before merge. :: [P2] Add the capture resolver to the PR wrapper inventory
  • reviewed 2026-09-28T23:26:00.029Z sha f6782af9e00196d0ded6061ec59e22429af9097b :: needs maintainer review before merge. :: none
  • reviewed 2026-09-28T23:41:54.330Z sha f6782af9e00196d0ded6061ec59e22429af9097b :: needs maintainer review before merge. :: none

@steipete
steipete marked this pull request as ready for review September 28, 2026 12:05
@clawsweeper

clawsweeper Bot commented Sep 28, 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.

@steipete
steipete force-pushed the deslop/l119-doctor-native-admission branch from 26ebb43 to 16da6a9 Compare September 28, 2026 14:05
@openclaw-barnacle openclaw-barnacle Bot added the agents Agent runtime and tooling label Sep 28, 2026
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Sep 28, 2026
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Sep 28, 2026
@steipete
steipete force-pushed the deslop/l119-doctor-native-admission branch from 16da6a9 to 00acb9b Compare September 28, 2026 16:53
@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Sep 28, 2026
@steipete
steipete marked this pull request as draft September 28, 2026 17:49
@clawsweeper clawsweeper Bot added merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. proof: sufficient ClawSweeper judged the real behavior proof convincing. labels Sep 28, 2026
@steipete
steipete force-pushed the deslop/l119-doctor-native-admission branch from 00acb9b to fbf5879 Compare September 28, 2026 21:39
@steipete steipete changed the title fix(plugins): keep Doctor native captures out of live state fix(doctor): preserve the live plugin index during read-only checks Sep 28, 2026
@steipete
steipete marked this pull request as ready for review September 28, 2026 21:40
@steipete
steipete marked this pull request as draft September 28, 2026 22:11
@clawsweeper clawsweeper Bot added merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. proof: sufficient ClawSweeper judged the real behavior proof convincing. and removed merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Sep 28, 2026
@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Sep 28, 2026
@steipete
steipete marked this pull request as ready for review September 28, 2026 23:17
@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. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 28, 2026
@steipete
steipete force-pushed the deslop/l119-doctor-native-admission branch from f6782af to eb78bd0 Compare September 28, 2026 23:49
@steipete
steipete enabled auto-merge (squash) September 28, 2026 23:57
@steipete
steipete merged commit 25df9ed into main Sep 29, 2026
367 of 369 checks passed
@steipete
steipete deleted the deslop/l119-doctor-native-admission branch September 29, 2026 00:52
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 29, 2026
…penclaw#160400)

* fix(plugins): keep Doctor native captures out of live state

* test(plugins): use complete metadata snapshot fixtures

* fix(doctor): retain native captures in the profile context

* fix(doctor): include capture resolver in trusted wrapper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling commands Command implementations docs Improvements or additions to documentation P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: M 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