Repository navigation
fix(state): keep retired SQLite schema hashes resolvable across schema edits and generations - #196800
Conversation
Generated SQLite catalog readers crashed reading '.tables' of undefined when the fingerprints map knew a schema hash whose catalog entry the loaded asset no longer contained. In-place update activation produces exactly that pairing: the running process lazily resolves the asset path after the build swap, and any state schema edit retires every derived hash the predecessor chain does not pin, so databases left on an unpinned schema crashed the updater's git-update check. Return undefined instead; every caller already falls back to native schema discovery for unknown hashes.
…essor chain Adding device_pairing_browser_requests to openclaw-state-schema.sql changed the text of every state predecessor and runtime projection, because those derive from the current file. The regenerated catalog pair retired every previously shipped state hash, so databases left on one of them no longer matched a declared schema input: updates from builds that still knew those hashes crashed on the missing catalog before the reader guard, and refuse admission with the guard. Register the lazy-additive edit as predecessor version 40 so the predecessor projections return to their exact prior bytes and the regenerated catalogs cover the shipped hashes again. The lazy table has no user_version of its own; the key only orders the undo chain.
|
🦞👀 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 real behavior proof before merge. What this changesThis PR restores historical SQLite schema catalogs and makes generated readers return undefined for missing catalog entries. Example: An installed 2026.11.1 reader requests state hash 1afe9a93ab5ff5ecdd8a5ef89f60ed9cf1246b4ffb6dd3b31bd782ca5e44ab9d after replacement assets are installed.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Partial Merge readiness⛔ Blocked before merge - 3 items remain Keep this PR open: it addresses a verified catalog compatibility defect, but its new import breaks extracted PR tooling. Priority: P1 Before merge
Findings
Tests
Agent review detailsHow this fits togetherBuild tooling derives SQLite fingerprints and diagnostic catalogs from schema definitions; runtime admission consumes those generated facts when opening, migrating, or inspecting databases. flowchart TD
A[Canonical schema SQL] --> B[Predecessor transforms]
A --> C[Catalog generator]
B --> C
C --> D[Embedded fingerprints]
C --> E[Lazy catalog assets]
D --> F[Runtime schema admission]
E --> F
F --> G[Database inspection and migration]
Technical reviewBest possible solution: Preserve catalogs required by installed readers through the existing generator and predecessor owners, complete the wrapper inventory, and verify activation across asset replacement. Do we have a high-confidence way to reproduce the issue? Source confirms the missing-entry dereference and historical-key retirement; exact-head CI independently demonstrates the introduced wrapper import failure, and no target code was executed during this review. Is this the best way to solve the issue? The existing predecessor chain and generator are appropriate owners, but returning undefined does not guarantee admission recovery because expected-schema inspection requires generated facts. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 6d811790acb4. Provenance checked
TestingProof path: unit tests only. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource +65, Tests +75, Other +7. Total +147 across 12 files. Added test files: 1. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes: No label 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 November 10, 2026, 1:47 PM ET / 18:47 UTC. |
Refreshed onto upstream main cb4cd56. Carries upstream openclaw#196800 (v40, device_pairing_browser_requests) plus the companion v41 transform for workspace_setup_state.bootstrap_deferred, which landed after openclaw#196800 was opened. Both edits must be reversed for a database at our 11.2 layout to stay resolvable, otherwise the in-place activation crashes on 'catalog.tables' of undefined. Catalogs regenerated and verified against our live layout hash.
Refreshed onto upstream main eafa247. Carries upstream openclaw#196800 (v40, device_pairing_browser_requests) plus the companion v41 transform for workspace_setup_state.bootstrap_deferred, which landed after openclaw#196800 was opened. Both edits must be reversed for a database at our 11.2 layout to stay resolvable, otherwise the in-place activation crashes on 'catalog.tables' of undefined. Catalogs regenerated and verified against our live layout hash.
Integrate the tested main baseline and reviewed catalog repair, retaining the original PR history. Preserve the existing loader contract and register the historical module in the wrapper inventory. Co-authored-by: RomneyDa <[email protected]> Co-authored-by: vincentkoc <[email protected]>
Cover required #196800 on the beta release through its retained-loader prerequisite #197095. Cold lazy catalog reads must use the running updater's retained generation instead of the replacement filesystem. Source: 6ff8c86 (#197095) Required scope: 1930535 (#196800) The later device-pairing/bootstrap-deferred edits and v37-v40 history are absent from this v36 branch; preserve its existing historical catalogs rather than importing unrelated schema changes. Regenerate all five loaders and exercise cold reads in installed and sealed assets. Independent local review omitted by explicit release-owner direction. Co-authored-by: RomneyDa <[email protected]> Co-authored-by: vincentkoc <[email protected]>
…a edits and generations (openclaw#196800) * fix(schemas): tolerate retired catalog entries in generated readers Generated SQLite catalog readers crashed reading '.tables' of undefined when the fingerprints map knew a schema hash whose catalog entry the loaded asset no longer contained. In-place update activation produces exactly that pairing: the running process lazily resolves the asset path after the build swap, and any state schema edit retires every derived hash the predecessor chain does not pin, so databases left on an unpinned schema crashed the updater's git-update check. Return undefined instead; every caller already falls back to native schema discovery for unknown hashes. * fix(state): pin the device-pairing browser-request edit in the predecessor chain Adding device_pairing_browser_requests to openclaw-state-schema.sql changed the text of every state predecessor and runtime projection, because those derive from the current file. The regenerated catalog pair retired every previously shipped state hash, so databases left on one of them no longer matched a declared schema input: updates from builds that still knew those hashes crashed on the missing catalog before the reader guard, and refuse admission with the guard. Register the lazy-additive edit as predecessor version 40 so the predecessor projections return to their exact prior bytes and the regenerated catalogs cover the shipped hashes again. The lazy table has no user_version of its own; the key only orders the undo chain. --------- Co-authored-by: Devin-Linux <[email protected]> Co-authored-by: RomneyDa <[email protected]> Co-authored-by: RomneyDa <[email protected]> Co-authored-by: vincentkoc <[email protected]>
Fixes #196798. Preserves and completes @Devin-Linux's original historical-catalog repair.
What Problem This Solves
An installed updater can read replacement SQLite catalog assets using historical fingerprints during an in-place build swap. Missing historical state and runtime-projection hashes can crash the old reader or refuse database admission.
User Impact
Preserves historical catalog inputs needed by installed readers while retaining the current createRequire loader contract. No new setting, database schema version, or permissive unknown-schema fallback is introduced.
Why This Change Was Made
The existing predecessor owner now accounts for both successive unversioned additions (browser requests and bootstrap_deferred). Generation and runtime admission share those historical inputs; all four historical runtime flag combinations are covered. The historical module is included in the PR wrapper inventory. Canonical generated assets are regenerated, not hand-edited.
Head
bbcc84b39462bd1728c6c53ac15b796a5a932649preserves the original PR head as its first parent and integrates tested main baseline4947e40db109a28c1fbdcf692eb431db19d46720. Its complete tree exactly matches that baseline plus the prepared reviewed repair. Conflicts were resolved to that exact validated tree; contributor history is retained. This supersedes the earlier incomplete runtime-projection restoration and generated-reader fallback approach.Evidence
Still outstanding: successful installed-updater activation across the build swap using the unchanged old reader, latest-stable upgrade with settings/data preserved, and full native end-to-end confirmation. The exact-head openclaw/ci-gate has passed; prior focused and independent-review evidence above remains applicable. Focused catalog and packaging checks do not substitute for those native end-to-end gates.