fix(gatorwalk-factory): publish takes the status it last wrote from its own ledger, so a lost cursor write cannot undo a manual move (swamp-club #2714) #420

Merged
seth merged 1 commit from cue/2714-gatorwalk-factory-publish into main 2026-10-01 18:19:13 +00:00
Owner

Fixes swamp-club #2714 (follow-up to #2685, from its verification review).

Problem

publish wrote the ticket status, then the cursor, and decided whether to move the ticket by comparing the stage's status key with the cursor's. If the cursor write failed after the status landed, the cursor was left behind:

  • the next publish with new events and no stage change moved the ticket back over a person's manual move (what DESIGN.md says never happens), and
  • a stage that returned to the stale cursor's key was never moved at all.

Fix

  • publish takes the last status key it wrote from its own delivery-publish-set_status ledger records, from the cursor's journal version on (where #2710's failed-move retry is keyed), falling back to the cursor. The ledger keeps a digest of the key, resolved against the pinned definition's status keys; a record no key matches is treated as unknown, so the stage's key is written again.
  • A publish with nothing new brings a stale cursor level with the ledger and clears a statusFailed whose move has landed, so status stops reporting it.
  • DESIGN.md, The publisher, steps 2, 4 and 5 say so.

No manifest bump: gatorwalk-factory is not published yet.

Tests

Five new tests in tracker_methods_test.ts against the local fakes, with a context that loses cursor writes; all five fail on the old code: a person's move stands; a stage back at the stale key moves; an unreachable skip counts as written; an unnamed ledger key is written again; a #2710 failed move whose retry landed is not undone and the cursor is repaired. Full gatorwalk-factory suite: 731 passed.

Verification: verify-build and verify-reviews passed on 8f05fbe21; attestation f611f132-fc1f-43ff-902c-afa9815a7b10 posted.

🤖 Generated with Claude Code

Fixes swamp-club #2714 (follow-up to #2685, from its verification review). ## Problem `publish` wrote the ticket status, then the cursor, and decided whether to move the ticket by comparing the stage's status key with the cursor's. If the cursor write failed after the status landed, the cursor was left behind: - the next publish with new events and no stage change moved the ticket back over a person's manual move (what DESIGN.md says never happens), and - a stage that returned to the stale cursor's key was never moved at all. ## Fix - `publish` takes the last status key it wrote from its own `delivery-publish-set_status` ledger records, from the cursor's journal version on (where #2710's failed-move retry is keyed), falling back to the cursor. The ledger keeps a digest of the key, resolved against the pinned definition's status keys; a record no key matches is treated as unknown, so the stage's key is written again. - A publish with nothing new brings a stale cursor level with the ledger and clears a `statusFailed` whose move has landed, so `status` stops reporting it. - DESIGN.md, The publisher, steps 2, 4 and 5 say so. No manifest bump: gatorwalk-factory is not published yet. ## Tests Five new tests in `tracker_methods_test.ts` against the local fakes, with a context that loses cursor writes; all five fail on the old code: a person's move stands; a stage back at the stale key moves; an unreachable skip counts as written; an unnamed ledger key is written again; a #2710 failed move whose retry landed is not undone and the cursor is repaired. Full gatorwalk-factory suite: 731 passed. Verification: verify-build and verify-reviews passed on 8f05fbe21; attestation f611f132-fc1f-43ff-902c-afa9815a7b10 posted. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(gatorwalk-factory): publish takes the status it last wrote from its own ledger, so a lost cursor write cannot undo a manual move (swamp-club #2714)
All checks were successful
CI / Review Integrity (pull_request) Successful in 1m7s
CI / Validate Attestation (pull_request) Successful in 1m9s
8f05fbe210
publish wrote the status, then the cursor, and compared the stage's key with
the cursor's. A cursor write that failed after the status landed left the
cursor behind, so the next publish with new events and no stage change moved
the ticket back over a person's move, and a stage back at the stale key was
never moved at all.

The last key written is now the latest delivery-publish set_status ledger
record from the cursor's journal version on (where #2710's failed-move retry
is keyed), else the cursor's. A publish with nothing new brings a stale cursor
level and clears a failed move that has landed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
seth merged commit 17ec7a2b93 into main 2026-10-01 18:19:13 +00:00
seth deleted branch cue/2714-gatorwalk-factory-publish 2026-10-01 18:19:13 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
swamp-club/swamp-extensions!420
No description provided.