fix(ploeg): replay a finished outcome that carries a checkpoint #167

Merged
ryangr0 merged 1 commit from ryangr0/ploeg-outcome-replay-with-checkpoint into development 2026-10-03 11:52:16 +00:00 AGit
Owner

A worker that lost the response to its outcome report and retried the
same report with an inline checkpoint got 404 instead of the original
success. handleOutcome wrote the checkpoint before ReportOutcome's
digest-based replay check, and Store.Checkpoint needs a Lease or a
running Run, which the first report had already removed.

The handler now builds the report first and, when a checkpoint rides
along, asks Store.IsOutcomeReplay whether the report matches the digest
that finished the run. A replay skips the checkpoint write and goes
straight to ReportOutcome, which answers with the original success, so no
second checkpoint or created Work Item appears. A different report for a
finished run still fails the checkpoint write and is rejected as before.
ReportOutcome and IsOutcomeReplay share one digest computation.

The replay test uses the same rule as ReportOutcome (finished run, matching outcome digest, LLM account row). The digest does not cover the checkpoint, so a retry with the same outcome but a different checkpoint replays and drops that checkpoint; harmless for a lost-response retry.

Verified with mise run verify on the pinned toolchain (all gates passed).

Ticket: https://vikunja.webgrip.dev/tasks/1757

🤖 Generated with Claude Code

A worker that lost the response to its outcome report and retried the same report with an inline checkpoint got 404 instead of the original success. handleOutcome wrote the checkpoint before ReportOutcome's digest-based replay check, and Store.Checkpoint needs a Lease or a running Run, which the first report had already removed. The handler now builds the report first and, when a checkpoint rides along, asks Store.IsOutcomeReplay whether the report matches the digest that finished the run. A replay skips the checkpoint write and goes straight to ReportOutcome, which answers with the original success, so no second checkpoint or created Work Item appears. A different report for a finished run still fails the checkpoint write and is rejected as before. ReportOutcome and IsOutcomeReplay share one digest computation. The replay test uses the same rule as ReportOutcome (finished run, matching outcome digest, LLM account row). The digest does not cover the checkpoint, so a retry with the same outcome but a different checkpoint replays and drops that checkpoint; harmless for a lost-response retry. Verified with `mise run verify` on the pinned toolchain (all gates passed). Ticket: https://vikunja.webgrip.dev/tasks/1757 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(ploeg): replay a finished outcome that carries a checkpoint
Some checks failed
[Workflow] On Pull Request / warnings (pull_request) Has been cancelled
[Workflow] On Pull Request / release-policy (pull_request) Has been cancelled
[Workflow] On Pull Request / checks (pull_request) Has been cancelled
ed241eed7a
A worker that lost the response to its outcome report and retried the
same report with an inline checkpoint got 404 instead of the original
success. handleOutcome wrote the checkpoint before ReportOutcome's
digest-based replay check, and Store.Checkpoint needs a Lease or a
running Run, which the first report had already removed.

The handler now builds the report first and, when a checkpoint rides
along, asks Store.IsOutcomeReplay whether the report matches the digest
that finished the run. A replay skips the checkpoint write and goes
straight to ReportOutcome, which answers with the original success, so no
second checkpoint or created Work Item appears. A different report for a
finished run still fails the checkpoint write and is rejected as before.
ReportOutcome and IsOutcomeReplay share one digest computation.

VIK-1757

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ryangr0 merged commit fedd3c010d into development 2026-10-03 11:52:16 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
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
webgrip/unfold!167
No description provided.