Repository navigation
refactor: reuse canonical SQL for first-use database setup - #146296
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: blocked before merge. Reviewed September 12, 2026, 4:15 PM ET / 20:15 UTC (Revision 4). ClawSweeper reviewWhat this changesThe PR replaces duplicated database table definitions and SQL-selection logic with a shared helper that reads the canonical definitions while preserving feature-owned installation timing. Warning SQLite table change This PR modifies persisted SQLite tables in Merge readiness⛔ Blocked before merge - 1 item remains This remains useful, review-clean work. The prior generic migration-proof blocker is resolved: source inspection supports the maintainer’s explanation that no material persistence change is introduced. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw stores shared runtime state and per-agent data in SQLite. Feature-specific installers select the required table definitions and execute them when the owning feature first needs storage. flowchart TD
A[Feature first use] --> B[Feature schema installer]
C[Canonical SQL definitions] --> D[Shared SQL selector]
B --> D
D --> E[Existing transaction boundary]
E --> F[SQLite tables and indexes]
E --> G[Existing committed-install cache]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -173. Total -173 across 8 files. View PR surface stats
Review metricsNone. 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. Technical reviewBest possible solution: Keep canonical SQL as the sole definition source while existing feature owners retain installation, transaction, and cache responsibilities. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a refactor, and current-main source confirms the duplicated definitions and selection logic it addresses. Is this the best way to solve the issue? Yes. Reusing the existing SQLite utility removes competing definitions without moving lifecycle decisions or introducing another storage owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ad08bd71ff1b. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
145a653 to
ace9fdc
Compare
|
Maintainer disposition: the generated SQLite compatibility checkbox does not apply to this change. The technical review itself confirms that all six removed DDL literals match the canonical definitions and that there is no material persistence change. Tables, indexes, constraints, first-use installation, transaction boundaries, caches, and repair behavior remain unchanged. The PR body now records the repeated-call/transaction and real SQLite comparison proof, the 197 focused tests, and the fresh 46-cell replay plus 20 QA tests after a byte-identical rebase. The independent QA selector repair in #146323 receives no credit in this PR. No schema migration, updater change, guard weakening, or compatibility exception is introduced. |
|
Merged via squash.
|
…146296) * refactor: reuse canonical SQL for first-use database setup * fix: keep canonical DDL annotations attached to calls
Closes #146293
What Problem This Solves
First-use database setup repeats table definitions already maintained in the canonical SQL files, leaving two places that must agree when those tables change. Several feature owners also repeat the same bounded SQL selection logic.
Why This Change Was Made
Use the existing SQLite schema utility to select canonical table regions, and replace six copied DDL bodies with those regions. Feature owners still decide when to install their tables and when an installation can be cached after commit. Index/trigger ranges, transaction boundaries, errors, and first-use scope remain unchanged.
User Impact
No intended user-visible behavior change. Existing databases, lazy feature activation, upgrades, and rollback keep their current schema and lifecycle contracts. This removes 172 net production code lines (173 physical lines), including the shared selector; tests and tooling are unchanged.
Evidence