Repository navigation
perf(doctor): retain full integrity admission through migrations - #175402
Conversation
Remove the export left unused by manual capture cleanup. Exercise generation refusal and preservation through the retained physical-generation entry point.
Move Doctor and rollback test consumers to the retained physical generation reader after the synchronous helper became private. Keep the existing generation and restoration assertions.
Restore the backup namespace spy and declare the settlement fixtures as SQLite so physical generation reads preserve their no-native-process contract.
|
🦞👀 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: blocked before merge. What this changesPreserve full SQLite verification across Doctor migration phases while preventing quick checks from satisfying full runtime admission. Example: Standalone Doctor migrates an agent database from schema 26 with --full-integrity-check.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 2 items remain Keep this PR open: the maintainer-owned migration fix has clear value, but its new module breaks trusted PR wrapper extraction. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherDoctor admits and backs up existing databases, runs schema migrations under maintenance custody, and publishes verified schema facts for subsequent runtime opens. flowchart TD
A[Doctor command] --> B[Maintenance custody]
B --> C[Source verification and backup]
C --> D[Version migration]
D --> E[Additive schema preparation]
E --> F[Admission publication]
F --> G[Runtime database open]
Technical reviewBest possible solution: Retain the focused admission fix, include its new module in wrapper extraction, and establish upgrade compatibility before landing. Do we have a high-confidence way to reproduce the issue? Source inspection establishes the discarded verification and ungated validation paths on main; exact-head CI independently demonstrates the introduced wrapper failure, without running target code locally. Is this the best way to solve the issue? The existing schema owner is the right place to publish full admission, and moving invalidation before verification preserves explicit inspection without introducing another cache owner. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 604f858653da. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource +41, Tests +310, Docs +24. Total +375 across 22 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
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 17, 2026, 6:21 AM ET / 10:21 UTC. |
…penclaw#175402) Preserve a verified live-source full-integrity receipt through standalone Doctor version and additive migrations, so later same-process admission can reuse it. Publish completed runtime validation only when a real full receipt exists; a quick check never satisfies full-integrity admission. Updater backup checks stay private-image checks and do not become live-source proof. Keep corruption refusals, maintenance authority, finalizer data checks, and rollback behavior. The installed updater runs first under its own version; these are candidate-side changes. Release-note context: avoid redundant full-agent verification after a successful explicit-full standalone Doctor migration.
What Problem This Solves
An explicit full-integrity standalone Doctor upgrade verifies the live agent database before its declared version migration, then discards that verification during the version/additive phases. Later runtime admission in the same Doctor process scans the same database again.
Move invalidation before the version prelude's live-source check and retain the resulting full-verification receipt through that owner's committed version and additive phases. The schema owner publishes admission from the still-open handle. This also fixes inline quick migration publishing completed runtime validation without full-integrity proof: quick checks no longer satisfy runtime's full-check requirement. Separate Doctor invocations continue to inspect current bytes.
Updater full backups check private images, not the live database, and supply no reusable live-source receipt. Their migration and rollback phases are unchanged. The installed updater executes first under its own version; these are candidate-side changes. No schema version, retention, dependency or public API change.
Evidence
Three alternating shared-v3 harness pairs are complete on base
884a96d134f420793d880fbbbae28ef61f671c9dand candidate89cf41ed1c5f168e31ceaa207889a57b17496a7f. The matched explicit-full comparison is also complete on the retained synthetic 43.06 GB agent / 0.557 GB state fixture (native agent28/state26, not stable24/state20). No saving is claimed for default quick-integrity upgrades or separate-process readiness. A newly required full check after inline quick migration is a correctness cost, not an optimization claim.Warmed figures pool 30 turns per side. The touched Doctor migration owners emitted no captured SQL or requests in this runtime harness; it establishes warm non-regression, not Doctor savings. The one-statement/one-request whole-workload median increase is not attributed to this change. Raw warm windows include background maintenance; the attributed turn counts are identical. No wall-time or whole-workload saving is claimed.
The large pair is one busy-host observation. Baseline Doctor time includes a recorded 16.197-second suspension while recovering its orphaned runner; the same surviving baseline was resumed, not replayed. One-minute host load was 52.04→39.79 for baseline and 27.57→34.69 for candidate. The first required live-agent full scan varied from 241.967 to 156.389 seconds; that variation and the capture difference are not credited to this PR. The attributable result is removal of the baseline’s second full scan (34.968 seconds in that arm) and its associated foreign-key check. Same-inode observation confirms the comparison; separate physical recovery images retain their checks. Both arms preserved complete row counts and ordered 100-row payload/origin/head sample hashes, and the retained source DB/WAL metadata stayed unchanged. This is sampled data preservation, not a whole-corpus equality or 44 GB restore claim. The five-minute aim remains unmet.
The shared-read audit found no matching warmed SQL/requests/MAIN in exact-entry facts, actor hydration, entry-cache snapshots, row facts or watermarks on either head. Whole-workload row facts stayed at 3 statements / 2 requests / 0 MAIN per arm; the other four families had no matches. Request IDs were fully attributed. Zero matches do not imply absence of in-memory work.
Removed checks and accepted edges
Proof and size
The focused migration suite passed all 10 cases, including standalone/updater × quick/full admission, retained data, corruption refusal despite earlier proof, and group rollback. Both independent Codex review rounds found no actionable P0–P2 issues. Earlier head
efbc9c9581eb84271e1883dc5488af87e0d4ceafpassed 87 tests across 11 relevant owner files, production types, all other test type shards, lint, source contracts, Madge, both PostgreSQL jobs, and T1/dialect ratchets. Its published-driver × candidate update workflow 39023237985 succeeded, including job117372355902; later changes only integrate main and repair test/tooling coverage.Current head
89cf41ed1c5f168e31ceaa207889a57b17496a7fintegrates main884a96d134fand fixes the two CI defects: the test passes a pathname to the SQLite receipt API, and the PR wrapper inventory includes the extracted admission module. Current-head local type-aware lint, the Doctor type shard, all 10 migration tests, and 22 wrapper/import-closure cases pass. Canonical Knip completed with 17 unused-export findings: the original 16 exactly match completed main CI39021393912/job117363945442; the additional process-respawn constant matches the completed production scan on clean maind00f7932b2757066be00604a3a372e60894813b7. Flagged source and rule inputs were compared; none of these files is changed by this PR. Knip is inherited, not green. Repaired-head CI 39025731368 completed with the aggregateopenclaw/ci-gatepassing on exact head89cf41ed1c5f168e31ceaa207889a57b17496a7f: both PostgreSQL jobs, types, lint, contracts, Madge, ratchets, all 87 owner tests and 19 import-closure tests passed. No failed or running check remained at the final observation. No third review round was added. The prior T1 inventory is 182→182 (compatibility10→10), changed-owner0→0; dialect0/1/11 unchanged and Madge0. Exact-head CI confirms the integrated static gates; the separately run canonical Knip result remains inherited as detailed above.Against integrated main: 7 files, +211/−37; production +59/−29, tests +142/−7, docs +9/−1, wrapper inventory +1. The small shared schema-admission function replaces the inline publication path and serves both migration phases.