Repository navigation
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 SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs changes before merge. What this changesThis PR prepares legacy-migration diagnostic facts in Doctor’s existing process and passes them to the physical-inspection worker. Example: Doctor has loaded two enabled migration owners and must inspect a third, disabled owner with retained data.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains Keep this PR open: it removes verified duplicate migration-contract loading, and no introduced correctness defect was found. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherDoctor combines configured database engines, legacy-import facts, and physical store observations into diagnostic findings; the worker continues to discover stores and inspect their schema, connectivity, and custody. flowchart TD
A[Doctor command] --> B[Resolve engine selection]
B --> C[Inspect legacy imports using loaded contracts]
C --> D[Physical inspection worker]
D --> E[Discover and inspect stores]
E --> F[Database diagnostic findings]
Technical reviewBest possible solution: Reuse the existing host-loaded contracts for fresh legacy detection while retaining isolated physical inspection and unresolved-engine handling. Do we have a high-confidence way to reproduce the issue? Current-main source shows legacy contracts loading in a fresh worker, and the submitted production-boundary fixture reports five initializations on the base versus three on the candidate; this review executed no target code. Is this the best way to solve the issue? The patch follows the smallest complete fix: retain the existing inspection owner, carry freshly prepared facts across the worker boundary, and preserve the fallback needed when engine selection fails. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b9d5ac5f7f56. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +24, Tests +90. Total +114 across 2 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 21, 2026, 10:37 PM ET / October 22, 2026, 02:37 UTC. |
What Problem This Solves
Fixes redundant cold plugin migration loading during Doctor's per-store database report, which adds work to Doctor repairs and Gateway test setup.
User Impact
Doctor reuses migration contracts it has already loaded instead of importing them again in its physical-inspection worker. Disabled owners, retained imports, missing or unreadable stores, schema checks, PostgreSQL observations, and read-only custody remain covered. There are no configuration, schema, migration, or operator-action changes.
Why This Change Was Made
The per-store diagnostics introduced in #174912 run legacy migration inspection in a fresh worker namespace. Doctor's existing process can inspect those same contracts under the same artifact-preserving read scope and send the resulting facts to the worker. Physical discovery and store inspection stay in the worker; diagnostic results are not cached.
Found via the daily scheduled Gateway E2E shards (run ids above): 39200506864, 39370388323, and 39544982957.
Evidence
Acceptance rule: remove duplicate contract initialization for already-loaded owners, preserve disabled-owner retained-data detection and fresh inspection results, and keep all store checks and existing test deadlines unchanged. This is a work-count comparison, not a wall-time benchmark: the local host is unqualified for timing claims.
The production-boundary fixture uses three real generated plugin contracts and one retained legacy source. On unchanged base
855b0aa7242e, the retained-data assertions pass but the work-count assertion fails: five contract initializations instead of three. The candidate passes with three total initializations. The fixture preloads two enabled owners, then requires diagnostics to inspect a third, disabled and repair-deferred owner. It also removes the retained source and requires the next inspection to report no pending import without initializing contracts again.The source inventory contains 20 bundled migration owners and four SQLite-only migration detectors across three owners. Discovery already loads its migration entry list once per inspection, not once per store. The waste is the cold reload across the Doctor/inspection-worker boundary. The separate physical worker, per-store snapshots, SQLite image opens, owner/schema validation, and PostgreSQL probes are intentionally retained. The unresolved-engine path remains in the worker so it cannot inherit an unrelated host engine context.
The fixture accounting is host initializations 2 → 3, worker initializations 3 → 0, total 5 → 3. This moves the first disabled-owner load to the host while deleting the two duplicate enabled-owner loads; it does not claim all host work decreased. There is no new cache. The simplification pass retained one inspection owner and the existing physical worker (production delta +37/-13, regression +90 lines).
Owning tests: 17 passed / 1 timed out across
doctor-database-engine-inspection,doctor-database-engine,doctor-database-diagnostics, anddoctor-database-network-storage. The existing diagnostics case atdoctor-database-diagnostics.test.ts:21hit its unchanged 120s deadline, without an assertion mismatch. Its legacy-remedy snapshot, unreadable-root, and missing-agent siblings pass. That timeout is not baseline-attributed and remains an explicit proof gap. No snapshot was updated. The new regression's local test time was 7.367s; CI seconds are pending. It needs real loaded modules and a real worker to detect duplicated initialization.Targeted Doctor typecheck, direct oxlint, oxfmt check,
git diff --check, and the fullpnpm buildpass. Independent Codex review through P2 is scoped-clean.All four requested E2E files ran serially before and after, with fresh isolated HOME/state/config/XDG paths per file:
test/e2e/line-doctor-group-allowlist.built-cli.e2e.test.tstest/scripts/doctor-config-preflight-plugin-index.built-cli.e2e.test.tssrc/commands/doctor.runs-legacy-state-migrations-yes-mode-without.e2e.test.tssrc/commands/doctor.auth-profile-consumers.e2e.test.tsThe two candidate-only local E2E deadline failures remain unattributed; both traces complete Database engines and proceed into later Doctor sections. The auth helper has an unchanged 60s child deadline but omits the spawn error, so exit 141 alone is not conclusive timeout evidence. No auth-reference or LINE assertion drift was established. These runs used the repository-default pinned Bun runtime via a Node v26.5.0 launcher; scheduled CI used Node v24.21.0. The overloaded host cannot establish a timing regression or improvement. Qualified Linux/Node deadline recovery remains open.
Focused proof commands (tests used fresh temporary HOME, state/config, XDG, and Vitest-cache paths):
node scripts/run-vitest.mjs run \ src/commands/doctor-database-engine-inspection.test.ts \ src/commands/doctor-database-engine.test.ts \ src/commands/doctor-database-diagnostics.test.ts \ src/commands/doctor-database-network-storage.test.ts --maxWorkers=1 node scripts/run-tsgo.mjs --project test/tsconfig/tsconfig.core.test.commands-doctor.json node_modules/.bin/oxlint -c .oxlintrc.json src/commands/doctor-database-engine-inspection{,.test}.ts pnpm exec oxfmt --check src/commands/doctor-database-engine-inspection{,.test}.ts git diff --check pnpm buildThe red-on-base selection was the inspection file with
-t 'reuses loaded migration'. E2Es usenode scripts/run-vitest.mjs run --config test/vitest/vitest.e2e.config.ts <file>, one file at a time.A Blacksmith Testbox attempt was interrupted during local source-capsule preparation before upload/allocation; no lease was created, no remote payload ran, and no qualified timings were obtained. Local functional outcomes do not establish CI deadline recovery or a flake. No published-driver upgrade matrix was run; migration policy and stored formats are unchanged. No timeout, retry, assertion, or skip policy changes are included.