Repository navigation
perf(sqlite): retain unchanged database proofs across schema updates - #174409
Conversation
Scope clean-close identities to the admitted database family so shared-only schema changes do not trigger agent integrity scans. Keep conservative identity coverage for mixed or unknown facts, and partition delivery recovery startup timings.
|
🦞👀 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 changesThis PR scopes clean-close seal identities to each database family and adds delivery-recovery timing details. Example: A same-version update changes shared-state SQL while a 235,978,752-byte agent database remains unchanged.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep this PR open: it addresses unnecessary database validation still present on current main, and source review found no introduced correctness defect. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherSQLite admission reads clean-close seals, validates their file and schema identity, and publishes reusable validation facts to database consumers; Gateway recovery waits for database preparation before discovering saved deliveries. flowchart TD
A[Clean database close] --> B[Persist validation seal]
B --> C[Startup admission]
C --> D[Check file and family identity]
D --> E[Reuse completed facts]
D --> F[Run ordinary validation]
E --> G[Recover saved deliveries]
F --> G
Technical reviewBest possible solution: Retain family-scoped identities in the existing admission owner and verify the persisted-seal transition preserves existing settings and data. Do we have a high-confidence way to reproduce the issue? Current main directly couples both database families in its schema hash, and the supplied isolated benchmark reports unnecessary agent validation after a shared-only schema edit; this review executed no target code. Is this the best way to solve the issue? The change removes the unwanted dependency at its existing owner, supports custom paths through admitted facts, and preserves conservative handling without adding delivery concurrency or another cache. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 8dd2dc0c0843. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +34, Tests +55, Docs +4. Total +93 across 13 files. Added test files: 0. View PR surface stats
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 16, 2026, 12:43 PM ET / 16:43 UTC. |
* commit 'a4c73619a5c': (29 commits) test: align model and Discord fixtures with runtime owners perf(sessions): reuse startup deletion discovery (#174408) fix(gateway): attribute ephemeral connections in normal logs (#174406) test(telegram): consolidate duplicate coverage (batch d117) (#173112) perf(doctor): avoid redundant backup and transcript reads (#174416) fix(update): avoid redundant reads for closed SQLite generations (#174426) fix(ui): Activity page tabs collapse to a few pixels on desktop (#173856) fix(decisions): skip prefilter for empty tool surfaces (#174269) perf(sqlite): retain unchanged database proofs across schema updates (#174409) refactor(test): remove duplicate export collision checks (#174391) fix: clear unused MCP and identity helper exports (#174421) fix(test): supply SQLite reliability fixture catalog refactor(mattermost): use the guarded transport directly (#174419) refactor(agents): trust prepared provider facts (#174388) fix(control-ui): open submenus immediately on click (#174292) test(anthropic): synchronize the late-send fixture with initialization refactor(ui): scope Plugins page state to Solid owners (#174281) perf(chat): pace board history refreshes and reuse cursors (#174407) perf(sqlite): bound session receipt scope publication (#174395) refactor(openrouter): share key budget test fixtures (#174340) ...
…157433 * commit '2e8bfec53fc1cf06c9e438f42b027a82e04ace9a': (29 commits) test: align model and Discord fixtures with runtime owners perf(sessions): reuse startup deletion discovery (#174408) fix(gateway): attribute ephemeral connections in normal logs (#174406) test(telegram): consolidate duplicate coverage (batch d117) (#173112) perf(doctor): avoid redundant backup and transcript reads (#174416) fix(update): avoid redundant reads for closed SQLite generations (#174426) fix(ui): Activity page tabs collapse to a few pixels on desktop (#173856) fix(decisions): skip prefilter for empty tool surfaces (#174269) perf(sqlite): retain unchanged database proofs across schema updates (#174409) refactor(test): remove duplicate export collision checks (#174391) fix: clear unused MCP and identity helper exports (#174421) fix(test): supply SQLite reliability fixture catalog refactor(mattermost): use the guarded transport directly (#174419) refactor(agents): trust prepared provider facts (#174388) fix(control-ui): open submenus immediately on click (#174292) test(anthropic): synchronize the late-send fixture with initialization refactor(ui): scope Plugins page state to Solid owners (#174281) perf(chat): pace board history refreshes and reuse cursors (#174407) perf(sqlite): bound session receipt scope publication (#174395) refactor(openrouter): share key budget test fixtures (#174340) ...
…/decision-onnx-v2-proof-20261016 * commit '2e8bfec53fc1cf06c9e438f42b027a82e04ace9a': (29 commits) test: align model and Discord fixtures with runtime owners perf(sessions): reuse startup deletion discovery (#174408) fix(gateway): attribute ephemeral connections in normal logs (#174406) test(telegram): consolidate duplicate coverage (batch d117) (#173112) perf(doctor): avoid redundant backup and transcript reads (#174416) fix(update): avoid redundant reads for closed SQLite generations (#174426) fix(ui): Activity page tabs collapse to a few pixels on desktop (#173856) fix(decisions): skip prefilter for empty tool surfaces (#174269) perf(sqlite): retain unchanged database proofs across schema updates (#174409) refactor(test): remove duplicate export collision checks (#174391) fix: clear unused MCP and identity helper exports (#174421) fix(test): supply SQLite reliability fixture catalog refactor(mattermost): use the guarded transport directly (#174419) refactor(agents): trust prepared provider facts (#174388) fix(control-ui): open submenus immediately on click (#174292) test(anthropic): synchronize the late-send fixture with initialization refactor(ui): scope Plugins page state to Solid owners (#174281) perf(chat): pace board history refreshes and reuse cursors (#174407) perf(sqlite): bound session receipt scope publication (#174395) refactor(openrouter): share key budget test fixtures (#174340) ...
…ision-accounting-native * commit '2e8bfec53fc1cf06c9e438f42b027a82e04ace9a': (29 commits) test: align model and Discord fixtures with runtime owners perf(sessions): reuse startup deletion discovery (#174408) fix(gateway): attribute ephemeral connections in normal logs (#174406) test(telegram): consolidate duplicate coverage (batch d117) (#173112) perf(doctor): avoid redundant backup and transcript reads (#174416) fix(update): avoid redundant reads for closed SQLite generations (#174426) fix(ui): Activity page tabs collapse to a few pixels on desktop (#173856) fix(decisions): skip prefilter for empty tool surfaces (#174269) perf(sqlite): retain unchanged database proofs across schema updates (#174409) refactor(test): remove duplicate export collision checks (#174391) fix: clear unused MCP and identity helper exports (#174421) fix(test): supply SQLite reliability fixture catalog refactor(mattermost): use the guarded transport directly (#174419) refactor(agents): trust prepared provider facts (#174388) fix(control-ui): open submenus immediately on click (#174292) test(anthropic): synchronize the late-send fixture with initialization refactor(ui): scope Plugins page state to Solid owners (#174281) perf(chat): pace board history refreshes and reuse cursors (#174407) perf(sqlite): bound session receipt scope publication (#174395) refactor(openrouter): share key budget test fixtures (#174340) ...
…158510 * commit '26cbd409b9753a9318a6dc09f97b2f0b4b776a09': (29 commits) test: align model and Discord fixtures with runtime owners perf(sessions): reuse startup deletion discovery (#174408) fix(gateway): attribute ephemeral connections in normal logs (#174406) test(telegram): consolidate duplicate coverage (batch d117) (#173112) perf(doctor): avoid redundant backup and transcript reads (#174416) fix(update): avoid redundant reads for closed SQLite generations (#174426) fix(ui): Activity page tabs collapse to a few pixels on desktop (#173856) fix(decisions): skip prefilter for empty tool surfaces (#174269) perf(sqlite): retain unchanged database proofs across schema updates (#174409) refactor(test): remove duplicate export collision checks (#174391) fix: clear unused MCP and identity helper exports (#174421) fix(test): supply SQLite reliability fixture catalog refactor(mattermost): use the guarded transport directly (#174419) refactor(agents): trust prepared provider facts (#174388) fix(control-ui): open submenus immediately on click (#174292) test(anthropic): synchronize the late-send fixture with initialization refactor(ui): scope Plugins page state to Solid owners (#174281) perf(chat): pace board history refreshes and reuse cursors (#174407) perf(sqlite): bound session receipt scope publication (#174395) refactor(openrouter): share key budget test fixtures (#174340) ...
…esafe-decision-native * commit '26cbd409b9753a9318a6dc09f97b2f0b4b776a09': (29 commits) test: align model and Discord fixtures with runtime owners perf(sessions): reuse startup deletion discovery (#174408) fix(gateway): attribute ephemeral connections in normal logs (#174406) test(telegram): consolidate duplicate coverage (batch d117) (#173112) perf(doctor): avoid redundant backup and transcript reads (#174416) fix(update): avoid redundant reads for closed SQLite generations (#174426) fix(ui): Activity page tabs collapse to a few pixels on desktop (#173856) fix(decisions): skip prefilter for empty tool surfaces (#174269) perf(sqlite): retain unchanged database proofs across schema updates (#174409) refactor(test): remove duplicate export collision checks (#174391) fix: clear unused MCP and identity helper exports (#174421) fix(test): supply SQLite reliability fixture catalog refactor(mattermost): use the guarded transport directly (#174419) refactor(agents): trust prepared provider facts (#174388) fix(control-ui): open submenus immediately on click (#174292) test(anthropic): synchronize the late-send fixture with initialization refactor(ui): scope Plugins page state to Solid owners (#174281) perf(chat): pace board history refreshes and reuse cursors (#174407) perf(sqlite): bound session receipt scope publication (#174395) refactor(openrouter): share key budget test fixtures (#174340) ...
…/decision-tool-v2-proof-20261016 * commit '26cbd409b9753a9318a6dc09f97b2f0b4b776a09': (29 commits) test: align model and Discord fixtures with runtime owners perf(sessions): reuse startup deletion discovery (#174408) fix(gateway): attribute ephemeral connections in normal logs (#174406) test(telegram): consolidate duplicate coverage (batch d117) (#173112) perf(doctor): avoid redundant backup and transcript reads (#174416) fix(update): avoid redundant reads for closed SQLite generations (#174426) fix(ui): Activity page tabs collapse to a few pixels on desktop (#173856) fix(decisions): skip prefilter for empty tool surfaces (#174269) perf(sqlite): retain unchanged database proofs across schema updates (#174409) refactor(test): remove duplicate export collision checks (#174391) fix: clear unused MCP and identity helper exports (#174421) fix(test): supply SQLite reliability fixture catalog refactor(mattermost): use the guarded transport directly (#174419) refactor(agents): trust prepared provider facts (#174388) fix(control-ui): open submenus immediately on click (#174292) test(anthropic): synchronize the late-send fixture with initialization refactor(ui): scope Plugins page state to Solid owners (#174281) perf(chat): pace board history refreshes and reuse cursors (#174407) perf(sqlite): bound session receipt scope publication (#174395) refactor(openrouter): share key budget test fixtures (#174340) ...
…penclaw#174409) * perf(sqlite): retain unchanged database proofs across schema updates Scope clean-close identities to the admitted database family so shared-only schema changes do not trigger agent integrity scans. Keep conservative identity coverage for mixed or unknown facts, and partition delivery recovery startup timings. * test(sqlite): align restart proof with family-scoped seals
What Problem This Solves
A same-version update that changes only the shared-state schema can delay recovery of saved agent updates by invalidating every unchanged agent database's clean-close proof.
User Impact
Unchanged agent databases keep their integrity proof across shared-state-only schema updates, and unchanged shared-state databases keep theirs across agent-only updates. Old combined-format seals require one ordinary validation before the new identity can be reused. Existing full-verification deadlines, file/journal checks, additive-column admission, and recovery authority checks remain in force.
Why This Change Was Made
A restart reported 55,397.9 ms of delivery recovery, zero retry backoff, and zero blocked-notice work. Its deferred agent admission logged 55,982 ms in the full integrity check. The preceding update changed the canonical shared-state SQL but not the agent schema or application version. The single combined schema hash necessarily invalidated prior agent proofs. Store-target discovery waits for pending database preparation, so this admission delay was charged to delivery recovery. The 5,394 ms foreground database-readiness phase includes the existing five-second wait budget; it is nested inside the state-snapshot phase, not an independent additive delay.
Select the schema identity from completed admitted facts, supporting custom database paths. Known families depend on their own canonical schema; unclassified or mixed facts conservatively depend on both. The admission owner checks the identity before publishing any retained facts. This replaces the unconditional cross-family dependency without a new cache or persistence format.
Add discovery, candidate-entry, pending-history, and replay sub-timings to the startup recovery summary. Discovery and delivery remain serial as before; the candidate query already excludes consumed and irrelevant inputs. The observed bottleneck does not justify extra delivery concurrency. Scope-publication work is separately addressed by #174395, with no overlapping source changes here.
Production delta: +34 lines in five existing modules (+22 for family-specific validation while preserving conservative handling, +12 for the requested timing partition). No new module/export or database schema change.
Evidence
The source-boundary harness waits for readiness with deferInspections:false; it establishes unnecessary validation, not a built-Gateway or end-to-end delivery latency prediction. Production remains unmeasured after this patch. No live Gateway or production state was modified.
CI Follow-up
The first CI run caught a restart E2E caller still using the old seal-reader arguments and two schema test mocks that did not preserve real exports. Both are corrected: the restart assertion checks the returned proof against the agent-family identity for the running artifact version, and the mocks retain live SQL getters while spreading real exports. The three schema tests and changed-file lint/format pass again; the test-only repair received a fresh independent review, clean through P2. The Linux restart-handoff E2E passes on head
632b3821bf7565c82133bece20be6a323263b833in CI run 38932105075: six interrupted turns resume, persisted user turns remain unique, and the successor reuses the seal without another agent integrity verification.Two unrelated guard failures were verified against CI's protected-main parent
bb642e181e130153894a45f141a5368123bcd487: the duplicate-scan coverage guard omitscli-parent-lifetime.mjs, and the mock-export guard reports the existingdarwin-bun-process-censusmock insrc/flows/doctor-plugin-source-captures.test.ts:32. The coverage-only guard fails identically with main's tracked-file index and this branch's index; its source and runtime helpers are identical. A focused invocation of the repository's mock scanner reports the same Doctor mock fingerprint on main and this branch, while the corrected schema test has no closed mocks. Neither guard's source, the omitted root file, nor the Doctor test is changed by this PR.Final exact-head CI is green on
632b3821bf7565c82133bece20be6a323263b833: build, type checks, Node/UI tests, PostgreSQL conformance, baseline ratchets, and security checks passed. Both previously inherited guard failures are green in this run; no inherited-failure exception is needed.