Repository navigation
refactor(state): retire commitments schema - #122176
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 12, 2026, 5:02 PM ET / 21:02 UTC. ClawSweeper reviewWhat this changesThe PR advances shared SQLite state to schema v7 and removes the retired commitments table and indexes through startup and Doctor migrations. Merge readinessThis is an active, maintainer-owned schema migration with no code-level blocker found. It needs explicit owner confirmation for the irreversible v7 data-retirement decision and green exact-head CI before merge. Priority: P2 Review scores
Verification
How this fits togetherThe shared-state database stores OpenClaw-wide runtime records. Startup and Doctor validate its schema, apply bounded migrations, then make it available to core and native clients. flowchart LR
A[Existing shared SQLite database] --> B[Startup or Doctor]
B --> C[Schema and dependency validation]
C --> D[Commitments retirement]
D --> E[Schema version markers]
E --> F[Core and native clients]
Decision needed
Why: Repository policy requires explicit user discussion and acceptance for SQLite schema-version bumps, and the prior ledger deferred this exact migration decision. Before merge
Agent review detailsSecurityNone. PR surfaceSource +297, Tests +734, Docs +68, Config 0, Generated -34, Other 0. Total +1065 across 38 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Record approval for the v7 destructive migration, then merge only after the exact current head completes required CI successfully while retaining the documented backup-first downgrade path. Do we have a high-confidence way to reproduce the issue? Yes—source-reproducible: focused materialized v5/v6 fixtures cover runtime startup and Doctor migration paths, though this read-only review did not execute them. Is this the best way to solve the issue? Yes, conditionally: removing storage at the shared-state schema owner is the canonical repair, provided a maintainer explicitly approves the irreversible retirement decision. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 79380000e01d. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (20 earlier review cycles; latest 8 shown)
|
d0fb3ee to
ff79c42
Compare
ff79c42 to
7da5efb
Compare
8a8ceda to
918cc84
Compare
|
@clawsweeper re-review All rank-up moves from the latest review are addressed on head
Exact-head CI is green: https://github.com/openclaw/openclaw/actions/runs/31527538577 |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Land-ready evidence for exact head
All prior ClawSweeper rank-up moves are implemented; current-head re-review is in progress at https://github.com/openclaw/clawsweeper/actions/runs/31530291754. Known proof gap: no live operator database was mutated. Both production migration entry paths are exercised against materialized v5/v6 databases, including damaged-schema refusal, preserved shared leases, visible Doctor output, and immediate atomic v7 markers. |
918cc84 to
7a11bce
Compare
7a11bce to
8cfd4b3
Compare
|
Land-ready evidence for exact PR head
The latest ClawSweeper rank-up moves are satisfied: the shared schema-v7 retirement was explicitly maintainer-approved, and exact-head required CI is green. No live operator database was mutated; both production migration entry paths are exercised against materialized historical databases, including supported partial-additive layouts, damaged/dependent-schema refusal, preserved sibling state, visible Doctor output, and atomic v7 markers. Merged as |
What Problem This Solves
The commitments runtime was removed by #121479, while #122143 kept its shared-state table in an explicit retirement ledger pending an approved schema migration. Existing shared databases could therefore retain inert commitment rows and five indexes with no remaining runtime owner.
Why This Change Was Made
Shared-state schema version 7 removes only the retired
commitmentstable and its five canonical indexes. The agent schema remains version 17.Runtime open and Doctor use the same transactional migration. They validate the supported v5/v6 owner and stable-table shape, recognize exact early, partially additive, and final commitments layouts, reject unknown columns/definitions/indexes/triggers, and refuse inbound foreign keys or retained view/trigger/virtual-table dependencies before dropping data. The drop and dependency checks are savepoint-protected, then
PRAGMA user_versionandschema_metaadvance together. Doctor reports the retirement only when it occurred.Direct v5-to-v7 and v6-to-v7 upgrades remain supported. Missing unrelated stable v5/v6 tables are refused and never recreated empty. Shared
state_leases,agent_database_leases, Teams poll/plugin state, ACPX leases, and all per-agent schemas remain untouched. Native clients accept shared schema v7 but do not migrate it.The public database reference records state schema v7 and gives the exact backup-first manual v7-to-v6 procedure, which recreates the v6 commitments table empty before lowering both schema markers.
Recovery rebased the existing PR onto current main and dropped recovery-only Slack, approval, UI, browser, and stale generated-baseline repairs that had already landed independently. The final diff contains only schema v7, necessary native/generated/Doctor/docs surfaces, and focused tests.
User Impact
Operators upgrading to schema v7 stop carrying storage for a fully retired feature. Only inert, unowned commitment rows are discarded. Foreign or dependent schema objects fail closed before any deletion, with the database left at its prior version.
There is no config, protocol, dependency, changelog, package-version, publication, or release change.
Evidence
node --import tsx scripts/generate-kysely-types.mts --verifynode --max-old-space-size=8192 --import tsx scripts/generate-plugin-sdk-api-baseline.ts --checknode scripts/check-native-state-schema-version.mjs(v7)pnpm docs:listpnpm docs:check-mdx(771 files)pnpm format:docs:check(755 files)git diff --checktbx_01kzvm0tay25a1w0qbsrscr0jt, Actions run 31628259237, exit 0. A later actual-conflict rebase changed only generated Plugin SDK hashes; those regenerated hashes passed their check and a separate P2 review.785c39e7e3c49beb4267377c29718d47e25dfdcf.b6548e509aac607530247127a5c98ec49d88b904is onmain.LOC classification against the rebased base:
Known proof gap: no live operator database was mutated. The migration is deterministic SQLite ownership code exercised through both production entry paths against materialized historical databases.