Skip to content

fix(update): await transferred progress before finalization - #162909

Merged
steipete merged 1 commit into
mainfrom
dbasync/receiver-steps
Oct 1, 2026
Merged

steipete merged 1 commit into
mainfrom
dbasync/receiver-steps

Conversation

@steipete

@steipete steipete commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

After a schema handoff, the fresh update receiver still replayed transferred progress receipts synchronously. This was the remaining receiver path left by #162098.

Why This Change Was Made

Replay buffered steps through the existing async shared-state writer, awaiting each receipt in order before finalization. Capture the environment and database context once and recheck the live executor and requester at write admission. Refused receipts stop replay and finalization; uncertain outcomes retain the existing cleanup failure.

User Impact

Transferred progress follows committed history. The same writer now owns ordinary progress and fresh-receiver replay, while shipped synchronous ledger exports and recovery policy retain their existing contracts. Production delta: +17/−4 lines, net +13, in one file; four changed files including tests, fixture support, and documentation.

Update behavior

The receiver ships with the candidate, so this fix is available when an installed driver hands finalization to that candidate. Published drivers are unaffected. No schema, stored-state, durability, retention, or restart-policy change.

Evidence

On the exact committed source tree, Blacksmith Testbox ran each command as pnpm test <file> --maxWorkers=1:

File Cases Whole-command wall
src/cli/update-cli/update-command-migrated.test.ts 27 passed 119.27s
src/infra/update-migrated-finalize.worker.test.ts 21 passed 24.42s
src/cli/update-cli/update-command-legacy-finalize.test.ts 23 passed 86.72s

The migrated suite's command includes runtime preparation; Vitest duration was 76.34s. Its real fresh-process, delegated-executor, migrated-schema and SQLite worker boundaries catch regressions that helper mocks cannot. The two replay cases took 5.18s and 4.70s. CI file timing is not available at PR creation.

A scratch copy with the receipt await removed failed both new replay cases: the second receipt entered before the first settled. Filtered command wall: 66.282s. Source was restored and the scratch worktree removed.

Production types and all 27 test type graphs passed. Scoped oxlint, formatting, dead-export scans, both import-cycle checks (zero cycles), database worker ratchet against 510beb8d52bd, and all remaining selected guards passed. git diff --check passed. Independent Codex branch review is clean through P2.

The aggregate node scripts/check-changed.mjs --base 510beb8d52bd stopped at an inherited graph-budget failure: agents-other has 724 roots against a 720 limit. The agent test inventory, shard configurations, and checker are unchanged from the base. Every downstream lane was run explicitly and passed; the aggregate command itself is not claimed green. The first local test attempt stopped before Vitest because managed-Gateway artifact separation could not be verified; actual tests ran in isolation on Testbox.

A canonical local package of 92663a401056 passed its complete build and tarball integrity/import-graph checks in 1376.562s. It is a local canonical pack, not a Package Acceptance artifact: version 2026.9.7, state20/agent24, SHA-256 8fa0abb426c82c7fa4a59708edede0657f8c91b7893ae822e3c3e1b9a7f65c58.

The single published 2026.9.4 → candidate installed hop passed on Blacksmith Testbox. The recipe manually stopped the service, then ran the published CLI's managed update with --yes --tag file:<candidate> --json --no-restart: exit 0, 46.353s, normally joined. The fresh receiver adopted the run, replayed the buffered Doctor receipt and two advisory receipts in producer order at positions 14–16, and finalized run b96ceeb0-326c-4190-8346-374b000cb014 as succeeded/finished. Start/completion coalesce into one stored Doctor row, so these three rows represent at least four buffered writes. Candidate service health and account/service/process cleanup passed with no remaining owned PIDs. The manual post-hop start is a service smoke check, not an updater-owned restart claim.

Artifact delivery used the prior recipe's private broker chunks after whole-file transfers stalled. Two initial chunk batches hit broken pipes; all affected objects were reconciled by complete hashes or 404, then one bounded recovery succeeded. The guest verified the original complete tarball hash before the only installed update began. The complete evidence archive was independently hash-verified locally. No product test or update was retried to obtain green. The lease is stopped.

Retained evidence: receiver-successor-proof-20261001/qualification.json and extracted/evidence/results/published-hop-receiver-replay.json.

…riter

Await buffered progress receipts in the fresh candidate receiver before finalization, preserving captured database context and live executor/requester admission. Refused receipts stop replay; uncertain writes retain the existing cleanup failure. This candidate-side change preserves published drivers, schemas, stored state, and recovery policy.
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation cli CLI command changes size: S labels Oct 1, 2026
@steipete

steipete commented Oct 1, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper

clawsweeper Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 1, 2026, 2:32 PM ET / 18:32 UTC (Revision 2).

ClawSweeper review

What this changes

The candidate update receiver records transferred progress through the existing SQLite worker and awaits each receipt before finalization.

Merge readiness

✅ Ready for maintainer review

This remains useful work, with no actionable introduced defect found. Current main and the latest release retain synchronous receiver replay; the prior PR-body heading follow-up is resolved.

Priority: P2
Reviewed head: 92663a4010562c8a40603e599ec35d944650a2df

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with strong installed-update observations and meaningful receiver-boundary regressions; the prior description follow-up is complete.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The captured live observations exercise the changed candidate receiver through a real published 2026.9.4-to-candidate Linux/systemd update, recording ordered transferred receipts before succeeded/finished finalization. Boundary regressions supplement that run; updater-owned restart is not claimed. The same stored format and mutation kernel remain in use.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The captured live observations exercise the changed candidate receiver through a real published 2026.9.4-to-candidate Linux/systemd update, recording ordered transferred receipts before succeeded/finished finalization. Boundary regressions supplement that run; updater-owned restart is not claimed. The same stored format and mutation kernel remain in use.
Evidence reviewed 8 items Pinned introduction and merge result: The merge-base-to-head delta replaces synchronous receiver replay with sequential awaited worker writes. Inspection of the test merge confirmed its raw parents are the pinned base followed by the exact PR head; its production delta preserves this change.
Current main still needs this cutover: Fetched main still calls recordUpdateRunStep synchronously for every transferred buffered step. The merged #162098 explicitly retained fresh receiving-process replay for a separate migration, so it does not supersede this PR.
Latest release retains synchronous replay: GitHub release-source inspection confirms v2026.9.7 also uses the synchronous ledger writer in the transferred-step loop. Local retrieval of that historical blob failed, so the source was inspected through GitHub instead.
Findings None None.
Security None None.

How this fits together

When an update advances database schemas, the installed updater transfers buffered progress to a fresh candidate process. That receiver records the progress before completing update finalization.

flowchart TD
A[Installed updater] --> B[Schema handoff]
B --> C[Candidate receiver]
C --> D[Live authority checks]
D --> E[SQLite progress writer]
E --> F[Committed receipt]
F --> C
C --> G[Update finalization]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +13, Tests +138, Docs +7. Total +158 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 1 17 4 +13
Tests 2 143 5 +138
Docs 1 7 0 +7
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 167 9 +158

Review metrics

Metric Value Why it matters
Production versus regression support production net +13 lines; tests/support net +138 lines The production growth captures one replay context and live admission checks; regression support observes the actual receiver and native write boundary.
Receiver regression cost 119.27s full command; replay cases 5.18s and 4.70s The body measures the required single-worker command and explains why fresh-process and SQLite settlement coverage needs this cost.

Technical review

Best possible solution:

Use the shared async progress writer for receiver replay while preserving shipped drivers, stored receipts, and existing recovery ownership.

Do we have a high-confidence way to reproduce the issue?

Yes, source inspection identifies the remaining synchronous receiver path, and the captured regression evidence demonstrates ordering failures when the new await is removed. This review did not execute a current-main reproduction.

Is this the best way to solve the issue?

Yes, moving replay onto the existing writer is a narrow cutover that preserves the mutation kernel and adds sequential settlement without creating a competing owner.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 0dd332fa7358.

Labels

Label changes:

  • add P2: This is a bounded updater reliability and worker-ownership repair without evidence of an urgent user-facing outage.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The captured live observations exercise the changed candidate receiver through a real published 2026.9.4-to-candidate Linux/systemd update, recording ordered transferred receipts before succeeded/finished finalization. Boundary regressions supplement that run; updater-owned restart is not claimed. The same stored format and mutation kernel remain in use.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The captured live observations exercise the changed candidate receiver through a real published 2026.9.4-to-candidate Linux/systemd update, recording ordered transferred receipts before succeeded/finished finalization. Boundary regressions supplement that run; updater-owned restart is not claimed. The same stored format and mutation kernel remain in use.

Label justifications:

  • P2: This is a bounded updater reliability and worker-ownership repair without evidence of an urgent user-facing outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The captured live observations exercise the changed candidate receiver through a real published 2026.9.4-to-candidate Linux/systemd update, recording ordered transferred receipts before succeeded/finished finalization. Boundary regressions supplement that run; updater-owned restart is not claimed. The same stored format and mutation kernel remain in use.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured live observations exercise the changed candidate receiver through a real published 2026.9.4-to-candidate Linux/systemd update, recording ordered transferred receipts before succeeded/finished finalization. Boundary regressions supplement that run; updater-owned restart is not claimed. The same stored format and mutation kernel remain in use.

Evidence

What I checked:

  • Pinned introduction and merge result: The merge-base-to-head delta replaces synchronous receiver replay with sequential awaited worker writes. Inspection of the test merge confirmed its raw parents are the pinned base followed by the exact PR head; its production delta preserves this change. (src/infra/update-migrated-finalize.worker.ts:413, 92663a401056)
  • Current main still needs this cutover: Fetched main still calls recordUpdateRunStep synchronously for every transferred buffered step. The merged fix(update): await progress receipts before advancing commands #162098 explicitly retained fresh receiving-process replay for a separate migration, so it does not supersede this PR. (src/infra/update-migrated-finalize.worker.ts:410, 0dd332fa7358)
  • Latest release retains synchronous replay: GitHub release-source inspection confirms v2026.9.7 also uses the synchronous ledger writer in the transferred-step loop. Local retrieval of that historical blob failed, so the source was inspected through GitHub instead. (src/infra/update-migrated-finalize.worker.ts:408, c074824a27c9)
  • Existing mutation and authority owners: The async writer captures the database context, checks live authority before dispatch and after settlement, and preserves unknown-outcome cleanup errors. Its unchanged worker kernel requests authority at transaction and commit admission and uses the same step transformation as the synchronous ledger. No schema, serialized format, permission expansion, or recovery-policy change is introduced. (src/infra/update-run-write.async.ts:45, 92663a401056)
  • Meaningful receiver-boundary regressions: The changed cases exercise the fresh receiver, delegated executor, migrated schema, and real SQLite worker. They observe transaction, commit, and settlement order; refusal of the second commit leaves its receipt absent and prevents service inspection and package completion. The captured body reports both cases failing when the await was removed and passing after restoration. Tests were inspected, not executed during this read-only review. (src/cli/update-cli/update-command-migrated.test.ts:727, 92663a401056)
  • Published-driver after-fix observations: Captured sourceRevision d0f89967ba52f6bfd63b415835b2c75eff80f0fde9189dfafadd0ba6994f24af records a Linux/systemd installed 2026.9.4-to-exact-candidate update: exit 0 after 46.353 seconds, normally joined, receiver adoption, transferred Doctor/advisory receipts at positions 14–16, and succeeded/finished finalization. The candidate tarball hash was verified before installation. The service was manually stopped and --no-restart was used; the later service start proves health, not updater-owned restart. The linked allocation workflow is now cancelled and is not treated as a passing product test. (92663a401056)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-01T18:25:58.457Z sha 92663a4 :: needs changes before merge. :: none

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 1, 2026
@steipete
steipete merged commit ee6e666 into main Oct 1, 2026
126 of 129 checks passed
@steipete
steipete deleted the dbasync/receiver-steps branch October 1, 2026 19:22
@steipete

steipete commented Oct 1, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 2, 2026
…riter (openclaw#162909)

Await buffered progress receipts in the fresh candidate receiver before finalization, preserving captured database context and live executor/requester admission. Refused receipts stop replay; uncertain writes retain the existing cleanup failure. This candidate-side change preserves published drivers, schemas, stored state, and recovery policy.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant