Repository navigation
improve(doctor): reuse metadata snapshots during startup inspection - #149737
Conversation
|
🦞👀 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. |
|
Codex review: needs maintainer review before merge. Reviewed September 17, 2026, 1:33 AM ET / 05:33 UTC (Revision 9). ClawSweeper reviewWhat this changesDoctor’s startup inspection reuses one private database snapshot across asynchronous plugin checks, keeping plugin inventory and discovery policy consistent. Merge readiness✅ Ready for maintainer review The PR remains useful and has no actionable correctness findings. The supplied published-updater evidence resolves the previous compatibility-proof concern; no additional review blocker remains. Priority: P2 Review scores
Verification
How this fits togetherDoctor inspects configuration and installed plugin metadata before Gateway startup and migration planning. Its results identify available plugins and migrations that must remain pending. flowchart TD
A[Gateway startup] --> B[Doctor inspection]
C[Configuration and install records] --> B
D[Shared state database] --> E[Private read snapshot]
E --> B
B --> F[Plugin inventory and discovery policy]
F --> G[Available plugins and pending migrations]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +68, Tests +103. Total +171 across 5 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep inspection on one lifecycle-owned private snapshot while preserving live memo isolation, current admission checks, and existing migration behavior. Do we have a high-confidence way to reproduce the issue? Yes, source establishes how an asynchronous metadata read can escape captured inventory and consume newer policy; the added concurrent-update cases target that mechanism. No tests or product code were executed in this review. Is this the best way to solve the issue? Yes. Extending the existing snapshot owner addresses the asynchronous boundary that the existing synchronous scope cannot cover, without introducing another cache or changing persistent formats. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against fd8543b2767a. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (8 earlier review cycles)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Merged via squash.
|
Related: #124407.
What Problem This Solves
Gateway startup's artifact-preserving Doctor inspection repeatedly copies metadata state and can combine captured plugin inventory with a newer discovery policy after an asynchronous check.
User Impact
Startup inspection reuses one consistent private database snapshot until its checks finish. In six balanced Windows pairs, established-state median readiness improved from 12.746 s to 12.485 s (261 ms, 2.0%), with four of six pairs faster. The shared host was variable; this is a modest observed improvement, not a startup-time guarantee. The sub-five-second goal remains unmet.
Why This Change Was Made
The existing read-snapshot owner now spans the whole inspection, including asynchronous metadata reads. Discovery policy consumes those same private bytes without replacing the live process memo. Prepared facts validate their original snapshot lifetime, cache retirement, and invalidation before reuse.
Ordinary worker-backed reads keep their existing path. Update rehearsal preserves the installed updater's markers, pending migration inputs, and retry-after-package-arrival behavior. No schema, durable-state format, operator configuration, or migration policy changes.
Evidence
baa836b031a26c4915670c082197f4ae9cd91546; tested five-file patch SHA-25675c04a18f0e49ddd7d93aa4b65d00023c91ab4166b1b611ebd8f1ca8f8345975, measured on the earlier candidate; the runtime-alias integration below has separate validation. Distinct fixed install paths, identical dependency lock, synthetic isolated state, normal lifecycle/compile-cache policy, no discarded samples. Filesystem/cache carryover and concurrent host load limit attribution; the single fresh-state difference is not claimed as a speedup.b83ea2ahead.[email protected]updater-to-candidate Docker cell, package integrity, and npm 12 installer acceptance all passed onb83ea2a. The first update dispatch rejected an invalid lane name before building; the corrected dispatch used the catalog-ownedpublished-upgrade-survivorbase lane.937eb5eon base9b73eb1; the complete five-file patch remains byte-identical, and package/build inputs are unchanged from the previous base. Refreshed exact-head CI passed.Current Revision
Head
196aa92f42261b8c75b1e2ed9b986724222e42a2merges main68663e6c648into the reviewed candidate, including the CI planner repair #150581. Main changed none of the five PR files; the complete product patch remains byte-identical to reviewed6d6c32b0and previous head9898225. The earlier runtime-alias conflict was resolved by retaining main's lookup inside the captured metadata scope; fresh P2 review was clean and all 241 tests across nine affected state, plugin, and Doctor files passed.The resolved
6d6c32b0patch SHA-256 isfad411c017387b422dc3712783c6fa32413d6c7df79357f48e20b9bc0c85d068. The paired timings above belong to the earlier build. A new absolute Windows measurement of the installed6d6c32b0package recorded fresh readiness at 37.43 s and four established restarts at 12.73, 9.98, 12.28, and 28.72 s. Every recorded launch passed its first WebSocket status request and graceful shutdown. The next launch was refused when physical memory fell below 4 GiB; final installed hashes matched. This incomplete, heavily loaded-host series proves neither a speedup nor the sub-five-second target.New exact-head CI passed every selected check except
checks-node-changed-extensions-bundle-22, which was canceled at the one-hour job deadline while still emitting passing memory-core and Workboard tests. Its aggregate gate consequently failed. The retained log proved the planner put 185 native database-worker files in one envelope. Repair #150581 limits both each native envelope and each packed job to 20 files, preserving coverage and the broad 40-job plan. It is now included here; fresh exact-head CI passed all selected checks, including the bounded extension jobs. The failed original run remains retained; no CI gate is waived. The previous head's four failures were inherited fixture/import-closure and UI-budget failures, repaired by #150453 and #150491. The complete local changed checks passed on6d6c32b0, including production and test types, lint, unused-export scans, and source guards. Earlier failed attempts remain recorded separately.Refreshed Package Acceptance passed package build, integrity, and npm 12 installer acceptance. Its upgrade-survivor lane failed before installing the candidate: the registry fixture supplied candidate plugin bytes to the published baseline when their version numbers matched. The fixture repair in #150542 passed its focused regression tests and exact-head CI. Its full
2026.9.4replay now boots the genuine published baseline and passes candidate migration rehearsal, Doctor lint, config validation, plugin resolution, and canary startup. It later correctly refuses the candidate Codex plugin: the same published version has different integrity bytes. That failed cell is retained; the integrity policy is unchanged. A separate supported published2026.9.3to the same immutable candidate cell passed the complete updater flow, automatic migration, state survival, Doctor, final Gateway health/readiness/status, and unavailable-plugin-path checks. The installed published updater upgraded Codex, Discord, and WhatsApp from2026.9.3to2026.9.4with no integrity drift. The failure manifest is empty. The fixture repair is now merged asc0cac428(#150542).Compatibility confirmation for the fresh review: this patch changes only the lifetime of a private read snapshot, not the persistent data model or migration policy. The retained run 35178808524 explicitly passes
assert-automatic-migration,doctor,assert-survival,gateway-probes, andgateway-statususing the installed published updater and the exact immutable6d6c32b0package. Its failure manifest and plugin integrity-drift list are empty. The refreshed five-file patch is byte-identical.