Repository navigation
fix(doctor): preserve the live plugin index during read-only checks - #160400
Conversation
|
Codex review: needs maintainer review before merge. Reviewed September 28, 2026, 8:00 PM ET / September 29, 2026, 00:00 UTC (Revision 11). ClawSweeper reviewWhat this changesThe 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 Review scores
Verification
How this fits togetherDoctor 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
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +42, Tests +267, Docs +4, Other +1. Total +314 across 10 files. View PR surface stats
Review metrics
Technical reviewBest 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. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (10 earlier review cycles; latest 8 shown)
|
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
26ebb43 to
16da6a9
Compare
16da6a9 to
00acb9b
Compare
00acb9b to
fbf5879
Compare
f6782af to
eb78bd0
Compare
…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
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 on1eef6b153bfb02e9ec34bf418b1e3d7042f9c51e. All four commits are patch-identical after refreshing onto the upstream Docker-helper assertion repair8799587f34360d9630ed6f49dffc878d3b013e5c. Application sources are byte-identical to product-proof tree4b5354c3dfe5619652290bbf00c9f440f4b6fe91; 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 testfor both Doctor suites: all 3 cases passed, 84 s. The native-admission regression alone passed both default/prepared cases withpnpm test src/commands/doctor-lint.native-admission.test.ts --maxWorkers=1, 45.98 s command wall.node scripts/run-vitest.mjsfor six capture/admission/cache/Doctor/startup sibling suites: passed, 126 s. Four import-boundary suites, includingsrc/infra/fs-safe-import-boundary.test.ts: passed, 6 s.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
4bd105408ccrepaired 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.txtnow lists the module once; no assertions, resolver behavior, or extraction rules changed.Blacksmith Testbox
tbx_01m3mzk2kva4n2xk2dexp472y9, run 36488047638, verified pre-refresh treeb359b9b25500e4758e966a1e8a36eb5202c31666; 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-scopedcheck-changedpassed (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.