Repository navigation
refactor(state): retire unused database mutation scopes - #154776
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 21, 2026, 12:22 PM ET / 16:22 UTC (Revision 3). ClawSweeper reviewWhat this changesRemoves unused asynchronous database mutation scopes and their supporting bookkeeping, while updating tests and documentation for the retained maintenance and snapshot paths. Merge readiness⛔ Blocked before merge - 1 item remains Keep open as useful, maintainer-owned cleanup. Current main still contains the retired path; no blocking defect was found, and the retained published-updater qualification addresses the earlier upgrade-proof concern. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw’s database lifecycle layer coordinates agent and shared-state access during reads, writes, maintenance, and updates. It admits operations under live ownership and retains database handles until their work and cleanup finish. flowchart TD
A[Database operation] --> B[Lifecycle admission]
B --> C{Operation type}
C --> D[Ordinary reads and writes]
C --> E[Maintenance owner]
E --> F[Source exclusion and snapshots]
D --> G[Settlement and cleanup]
F --> G
Before merge
Agent review detailsSecurityNone. PR surfaceSource -387, Tests -552, Docs 0. Total -939 across 32 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep database access with the existing synchronous-write, maintenance, and snapshot owners without retaining an unused parallel mutation lifecycle. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR retires unused internal machinery rather than reporting a user-facing defect; source inspection supports the absence of application callers. Is this the best way to solve the issue? Yes. Removing the unused producer and its dependent paths is a focused simplification, while meaningful maintenance-refusal, excluded-read, and cleanup coverage remains. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d083a215e8f5. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
c2d976e to
98b99a4
Compare
|
Compatibility confirmation for The remaining checklist request is covered by the source and upgrade evidence already recorded in this PR. In The published 2026.9.5 updater qualification passed against preserved candidate This confirms the requested compatibility evidence. The published-updater cell remains historical qualification of the unchanged retirement patch; no fresh-head updater run or transcript-preservation claim is added. |
|
Merged via squash.
|
Related: #150153.
Refreshed-head CI passed. The branch now includes main’s correction for the upstream chat-position-rail test failure. The retirement patch is unchanged; the published 2026.9.5 qualification below remains bound to its preserved pre-rebase candidate.
What Problem This Solves
Database lifecycle code retains an asynchronous file-mutation path that has no production callers, along with its private snapshots and handle bookkeeping.
User Impact
No intended user-visible change. Existing synchronous writes, source exclusion, private inspection, and maintenance refusal remain with their current owners. Schemas, durability, retention, permissions, and public SDK contracts are unchanged.
Why This Change Was Made
Retire the unused mutation producer and its dependent snapshot, lease, and handle paths. Readers and preflight keep the supported source-exclusion and snapshot operations. Fresh native agent opens still refuse ordinary access during maintenance; tests exercise that boundary through real maintenance ownership.
This focused change removes 387 application lines and 552 test/support lines. Documentation changes are neutral; no main-branch changes are included in those counts.
Evidence
The runtime and build results below are retained qualification for the pre-rebase source. Refreshed-head CI passed on
98b99a495033d3931ebf5ea238d2fa6afcb910f0.pnpm buildpassed in 280.41 seconds, including declarations, UI, native built-module/Doctor closure checks, and SDK exports. Production and test types and the registered architecture/format/dead-export guards passed. One test-variable shadowing error from the broader check was repaired; final focused lint passed with no warnings or errors.git patch-id --stable:dfe41f68ef700bea705da0f2d95f30c1008b6b34). Overlapping upstream snapshot, read-admission, startup-refusal, and WAL-maintenance changes were inspected and retained. No public SDK or bundled-plugin caller uses the retired producer.The genuine published 2026.9.5 updater qualification passed against the preserved pre-rebase candidate below; this cell was not rerun on the refreshed head. The installed updater exited 0 in 398.949 seconds, activated the source-qualified artifact, restarted the native Gateway, passed readiness and the shared-worker canary, and recorded successful durable finalization. All 267 retained evidence files and the candidate tarball were verified; the native service stopped and uninstalled cleanly, and the isolated lease was independently confirmed released. This proves the Linux native update flow; it does not claim transcript preservation or a production deployment.
Earlier CI failed one upstream UI expectation in
chat-position-rail.test.ts; every other selected job passed. Main corrected the asynchronous assertion ordering in0883394977d1fb3af657635967f6e447bd7fff9a, then added focused-marker coverage ind229666927c6a0f75199fef8a93f76a25166824f. Both commits are included in the refreshed base. The original failure is retained; the refreshed exact-head CI run now passes.Historical qualified source:
c2d976ee4f22858aca6e4c339998860c72cd6dfd, tree67a0b5d8f89d9af913580ad961b552236ead455e, based on187bc24e8839e84aa447c78fa86fce94fc91ffb3. Final remote source/build proof.Refreshed head:
98b99a495033d3931ebf5ea238d2fa6afcb910f0, treeeb8bed9f60200007ac42e99c656bfa5a7342d7f3, based on146fba007c95c1e30b3c3d5c8dbfaa35f96e0dcf. The 32-file retirement delta is unchanged at +265/−1,204 overall lines.Compatibility review: the
lifecycle-write-custody.tsedit only narrows an internal TypeScript phase union backed by a process-local map. It changes no persisted data model; the retained published-updater proof and matching patch identity confirm upgrade compatibility.Maintainer compatibility confirmation.