The same delivery changes the task twice.
Use the event ID as the uniqueness key and rerun the exact evt-1 replay; the expected second action is duplicate.
Hands-on recipe
Keep one task identity while reconciling repeated or out-of-order delivery. This is an offline integration exercise; the site does not currently promise customer Webhooks.
Includes executed local fixtures, scripts and receipts. These checks do not represent a video-generation service run.
node run-recipe.mjs --out ./my-run
Run the command from the unzipped kit. Before accepting an event, the receiver checks the task ID, event ID and its deliberately small processing/succeeded state vocabulary. The fixture rejects unknown tasks and an invented state with HTTP 400. These validation rules are local examples, not a provider payload specification.
Read ledger.json after the replay. evt-1 changes local-A to succeeded; replaying the same event ID is recorded as duplicate. The event set is a fixture store in memory. A deployed receiver would need durable event uniqueness and an atomic state update appropriate to its own database.
The distinct evt-2 arrives late with processing. Its lower state rank is logged as stale, leaving local-A succeeded. This two-state policy demonstrates a terminal guard; it does not define cancellation, failure, retry or conflicting-terminal rules for a real API.
local-B remains processing until GET /status/local-B returns its matching task ID and succeeded state. Update the same ledger entry and verify one poll, zero /generate requests and a closed local server. The negative receipt also checks a poll result bound to the wrong task.
Use the event ID as the uniqueness key and rerun the exact evt-1 replay; the expected second action is duplicate.
Change only the transition guard and replay evt-2 after success. The state must remain succeeded.
Enable one task-bound reconciliation read for that pending identity. Check its returned task ID before applying state; do not submit another generation.
Keep the replay ledger and receipts as evidence of this local reducer. Adapting it to a real service requires that service’s documented callback support, verification rules and durable storage; this kit makes no customer Webhook commitment.