Skip to content

fix: preserve apply reconciliation tuple baselines - #931

Merged
steipete merged 1 commit into
mainfrom
fix/apply-409-systematic
Jul 29, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/apply-409-systematic

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Summary

  • capture the exact pre-mutation canonical tuple for every record reconciliation change
  • publish reconciliation moves against that captured baseline instead of the sparse state checkout
  • keep CURRENT-based single-retry conflict handling and per-item failure isolation intact

Root cause

Apply run https://github.com/openclaw/clawsweeper/actions/runs/30422286379 hydrated Worker-owned records into the ClawSweeper worktree, while CLAWSWEEPER_STATE_DIR correctly remained a sparse checkout with no records/ tree. publish-main nevertheless used that sparse checkout as the compare-and-swap baseline.

For an open record such as openclaw-openclaw/100078, the preselect lane therefore sent expectedDigest: null for the live items/100078.md and decision-packets/100078.json rows. The Durable Object correctly rejected the items operation with canonical_record_tuple_conflict. #928's CURRENT recovery could not prove the move because its local baseline location was also null, so the legitimate items-to-closed transition was treated as obsolete rather than published.

The endpoint fences are unchanged. Reconciliation now snapshots only the four-section tuples it actually mutates, passes that exact snapshot through a step-scoped temporary directory, and deletes it after publication. A genuinely concurrent canonical writer still trips the digest fence and goes through the existing CURRENT-based single retry.

Proof

  • in-process real-handler reproduction in test/dashboard-worker.test.ts: before the fix the lane received 409 instead of 202; after the fix the canonical row moves from items to closed
  • exact reconciliation snapshot coverage in test/reconcile.test.ts
  • CURRENT retry and poison-item sibling isolation in test/repair/publish-main.test.ts
  • shell baseline handoff and batching coverage in test/sweep-workflow.test.ts
  • all scoped tests, builds, linters, and format checks pass
  • ~/.claude/skills/autoreview/scripts/autoreview --mode local: clean, no accepted/actionable findings

pnpm run check reaches the full coverage suite but has six unrelated macOS baseline failures: five Linux Landlock fixtures cannot resolve capset from macOS libc, and one temporary-path assertion compares /var/... with macOS's /private/var/... resolution.

Deployment

No Worker redeploy is required. The Durable Object endpoint is unchanged; merging updates the apply workflow's checked-out lane code for the next run.

@steipete
steipete merged commit 2cfb2e0 into main Jul 29, 2026
11 checks passed
@steipete
steipete deleted the fix/apply-409-systematic branch July 29, 2026 04:58
azaj01 pushed a commit to azaj01/clawsweeper that referenced this pull request Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant