Repository navigation
refactor(sqlite): keep default reporting out of heartbeat startup - #155106
vincentkoc wants to merge 4 commits into
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. |
|
@clawsweeper re-review Please review exact head |
|
@clawsweeper re-review Please review exact head |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: blocked before merge. Reviewed October 6, 2026, 9:09 PM ET / October 7, 2026, 01:09 UTC (Revision 5). ClawSweeper reviewWhat this changesSeparates SQLite’s synchronous transaction engine from default logging so the lease heartbeat worker can use an explicit reporter without loading ordinary reporting. Merge readiness⛔ Blocked before merge - 2 items remain Keep this maintainer-owned PR parked as requested. Current main still loads ordinary transaction reporting in the heartbeat worker, so the extraction is not demonstrably implemented or superseded. No concrete introduced correctness defect was found. Likely related people: vincentkoc and steipete (medium-confidence routing candidates). Priority: P3 Review scores
Verification
How this fits togetherThe state-lease heartbeat worker renews database ownership leases used by OpenClaw maintenance operations. Its SQLite transaction helper controls admission, commit, rollback, and warning delivery. flowchart TD
A[Maintenance lease owner] --> B[Heartbeat worker]
B --> C[Explicit silent reporter]
B --> D[Shared transaction engine]
E[Ordinary database callers] --> F[Default reporting wrapper]
F --> D
D --> G[Lease renewal or rollback]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +21, Tests +294, Other +3. Total +318 across 14 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Preserve the deferral; any revived logging isolation should use one current transaction owner and retain current admission, cleanup, and diagnostic contracts. Do we have a high-confidence way to reproduce the issue? Not applicable to this refactor: source confirms the unwanted reporting import, but no runtime timeout cause or repair was reproduced. Is this the best way to solve the issue? Yes for the pinned base: one shared engine with caller-owned reporting is coherent. Its suitability for current main requires reconciliation with the newer owner contracts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7b66485dcd9b. LabelsLabel changes:
Label 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 (4 earlier review cycles)
|
|
@clawsweeper re-review Please review exact head |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Scope reset: parking this transaction-engine extraction as a draft at 8dae343. The branch is preserved, but the engine split is deferred and will not be landed through the FreeBSD campaign. A still-needed warning-isolation fix may be considered separately in the existing owner, after checking current main. That does not imply this broader extraction is fixed, merged, or approved. |
Related: #149882
What Problem This Solves
Heartbeat worker startup imports the ordinary SQLite transaction reporter even though the worker supplies a no-op reporter. This unnecessarily loads default subsystem logging and its initialization.
User Impact
The heartbeat worker no longer imports default transaction reporting. Normal SQLite callers retain the default logger, custom warning sinks, and existing transaction behavior. The change does not alter SDK signatures, configuration, schemas, deadlines, readiness, leases, or filesystem security. It does not establish the cause of the historical FreeBSD startup timeout.
Why This Change Was Made
Keep one synchronous transaction engine and admission registry in an internal logger-independent owner. The ordinary module retains its public immediate/deferred functions and asynchronous preparation/admission flow. The heartbeat passes its existing no-op reporter; the coordinator uses the same core registry.
Savepoints, abandoned-handle fencing, commit authority, rollback, cache invalidation, warning thresholds and metadata remain intact. The transaction callback guard, raw-SQL owner allowlist, and review wrapper materialization follow the moved owner. Production: +453/-432 (net +21); tests: +297/-3; tooling: +4/-1. The added production lines express reporter ownership and retain the public wrappers around one engine.
Evidence
Current source:
8dae34392c93066d965ada4a6e99f681eac7e4e7, tree06859a897518aafb3bc68a1dd7f4d24786a76e17, integrating frozen maina7c27c04a3d6e797b8974ad6ee22724724918e8a. All 14 own postimages match the reviewed preceding head7fcce84f633432e3ffee6936c13aa7ec56ac3a38; the main-relative patch remains exactly 51,866 bytes / SHA-256ee4d1f70f26e71a5cadc5a299d517cc3afdc7c9b74e15b175ab730343446fcc0. Independent source and integration reviews plus fresh scoped autoreview found no actionable P0–P2 finding.The preceding head’s ordinary CI passed 133 jobs and skipped 16; one Gateway shard and its aggregate failed. The obsolete export, native-method lint annotation, and moved diagnostics mock had already passed their repaired gates, including all seven diagnostics cases. The remaining private approval fixture used a one-second readiness poll and left a request unjoined after that assertion failed. Canonical PR #155111 now fixes the publication/cleanup owner; this integration includes that landed repair. The original worker delay remains unmeasured. The refreshed exact-head CI 35651382158, attempt 1 succeeded at
8dae34392c93066d965ada4a6e99f681eac7e4e7: 135 successful jobs and 16 skipped, aggregate 106511459962 passed. The actual seven heartbeat diagnostics, 15 private approval cases and six canonical approval-fixture cases passed, including the original private case and late outer-handler join/DB cleanup. The old failed attempt remains failure evidence.The integration also inherits main’s fs-safe 0.18 upgrade. Its public seams were reviewed, but its internal copy, Root, hashing, and cancellation changes require fresh package proof. The completed fs-safe 0.17 proof below remains component evidence; it does not qualify this entire new head.
Completed component proof
Paired package proof, attempt 1 / carrier
5889eadd38e98d3d2640969a793b266a56115e39, passed on Linux/Node 24.21.0. It compared composed baseline17690d0019bb92ee80e8ceaaced8cad822e1159dwith candidate67214ac792717ee72cee7a4ae32b678ff12663fd(tree288acf94e1a51397afd87462bf7083fe957d82ef), whose difference is the exact same 14-path patch.chalk/tslogand default reporter regions removed. Required fs-safe 0.17 import inventory, semver, redaction and storage guards remain.8dd31bac12fdb2365d64fca537d0224cef39a2287ffd785ee8d245e71a590f96; emitted heartbeat SHA-2569bd8168f496f56afd825caa7db4164525b2ed89935405209e7d5b4279dd97968.Measured Vitest costs from that composed proof:
These are printed file/case durations, not isolated command wall times or marginal suite costs. The full eager-import file took 26.302 s; the 18-file invocation took 121.52 s. Individual new handoff-case times were not printed.
The raw success receipt and complete leading artifact records were authenticated. The single local ZIP download timed out partially; the full outer ZIP, candidate payload, manifest and source archive are not claimed as locally verified. The artifact’s published digest and seal are retained for strict consumer verification; no duplicate download or package resealing was performed.
Remaining qualification
Exact-head ordinary CI is green. The completed S4 ClawSweeper review artifact binds
8dae34392c93066d965ada4a6e99f681eac7e4e7and reports no source/security findings. Its public review delivery is still pending in the canonical publication queue. Its remaining proof requests are final fs-safe 0.18 package/emitted-worker plus Linux/FreeBSD operator qualification, and independent per-file test command wall times. Earlier file/case durations above do not satisfy the latter request.The first B4 producer, attempt 1 at
8a7b543c3a7ce59fe13535261b981f599dee9e16, passed package/build and emitted-worker checks on composed source10725d8613c64f5efdc8ea58eae70a3b8f4276ac/tree74bddc0882c455c519931e40040c260df9951ee8. It then failed during report initialization: the canonical multi-invocation collector requires file-based projects, while Gateway loads inline project leaves. Six earlier files passed 77 assertions; remaining tests, guards and sealing did not complete. No candidate payload was uploaded. This is a harness reporting failure, not evidence of a product assertion failure.The corrected producer 35654738554, attempt 1 succeeded at carrier
1c4bcfef50d09cf73837bfaa1bfccf8fa856d907, on unchanged B4. Its exact 14 common-owner blobs are identical to this standalone S4 head; the producer verified the actual S4 commit/tree/blobs before execution. Actual fs-safe 0.18 and selected Linux native-package content were recorded. Packaged heartbeat: 633,226 bytes/SHA-2569bd8168f496f56afd825caa7db4164525b2ed89935405209e7d5b4279dd97968, with default logger/chalk/tslog/file hooks absent and required storage/redaction/ten fs-safe import specifiers retained. All 20 files passed: 263 assertions, zero skips/pending/todo, followed by all three guards and canonical sealing. Separate native reports bind 19 files/242 cases in 87.460 s and the gateway file/21 cases in 4.839 s; combined span 92.300 s. These group command spans do not replace independent per-file costs.Final candidate: 81,917,057 bytes/SHA-256
0071fb86846a29276643133b0ad2958a310f7ee599e204578839655844161cc6; artifact10665090678, 245,792,513 bytes/API SHA-25685c73717fceb8c599a8ad032b7adb7e4f7fe4a1c6e1ce879b1ed2b06231c08cd. Complete raw receipt: 371,150 bytes/SHA-25638c5278a36727264266884b9e608e4f157e1badf61ad62fe8a9eaf47c9480c30. No full ZIP was downloaded locally. Consumer custody checks must authenticate the full archive, manifest, source archive and every member before package execution. This is current fs-safe 0.18 composed-candidate evidence for the matching owner change, not packaged proof of every standalone S4 byte or physical ARM.Operator run 35657209609, attempt 1 is admitted at signed consumer
f2a39ae720878fa77bc27356f7c6c1343ab4025c; it consumes only that sealed B4 artifact. Linux source controls run before seven independentpnpm test <file> --maxWorkers=1commands after the normal source prerequisite. Actual command wall times/results are recorded before restoring the sealed candidate runtime. Installed Linux/service controls and FreeBSD x64/emulated ARM operator results remain pending. Final consumer review corrected an inherited pre-Doctor bootstrapagents listcall; Doctor is now the first candidate OpenClaw CLI against published state, while normal npm postinstall remains unchanged and bootstrap preservation is checked after Doctor/update. Earlier native receipts are not relabeled as Doctor-first proof.The old fs-safe 0.17 operator workflow was held before publication, so no superseded native run was launched. No repeated baseline ARM, deadline increase or historical timeout-cure claim is part of this change. The exact S4 completed Claw report is authenticated; its canonical public delivery remains queued. Final operator receipts and seven command wall times will disposition its remaining moves before native landing.