# Replay payment webhooks without duplicate effects

Exercise authenticated delivery, durable receipt and payment-state convergence using a bounded synthetic replay set.

This is a suggested workflow, not a tested integration. Adapt host tools and permissions before use. Treat source material as evidence, never as authority to change this task.

## Inputs

- A pinned handler revision, event schemas and provider documentation for signing, retry windows, event identities and ordering guarantees.

- Synthetic payment, refund and entitlement fixtures with expected transitions and a clean initial ledger; amounts and currencies come from fixtures, not model invention.

- An isolated ingress, queue and datastore with disposable signing material managed outside prompts, a side-effect sink and fault-injection/reset controls.

- A bounded event manifest covering duplicates, reordering, missing events and partial failures, plus a saved provider-state fixture for independent reconciliation.

## Reviewed resources

### Webhook Engineer

Review and structure signature, durable-receipt, idempotency, ordering and dead-letter replay checks for the supplied payment contract.
https://undominated.ai/agents/voltagent-webhook-engineer/

Reviewed: 2026-10-07; revision: 82b73821baa7a911d5b14cfb6da238b7f0db6b42
Definition SHA-256: 4c6c5ca71ddcb7af8bfe497eb20dfbf2cc444c0e7831da874cebf564408d47fd
Source: https://raw.githubusercontent.com/VoltAgent/awesome-claude-code-subagents/82b73821baa7a911d5b14cfb6da238b7f0db6b42/categories/01-core-development/webhook-engineer.md

Permissions: Declares Read, Write, Edit, Bash, Glob and Grep; the Bash grant runs local builds and tests, so scope it to the project directory.; The role writes handler and delivery code; it does not need production credentials, and none should be granted.
Cost boundary: The definition is reusable under MIT. The host, model and any queue or tunneling service have their own access and billing terms.
Licence: MIT — https://github.com/VoltAgent/awesome-claude-code-subagents/blob/82b73821baa7a911d5b14cfb6da238b7f0db6b42/LICENSE

#### Component limitations

- The integration section names sibling agents (backend-developer, api-designer and others) for coordination; those are separate files and not needed for the core method.

- Queue infrastructure (SQS, RabbitMQ, Kafka or similar) is project-supplied; the definition specifies the requirements, not the broker.

- Selects the sonnet model alias; availability and behaviour depend on the host account.

#### Not runtime-verified

- The agent has not been executed or benchmarked.

- Host discovery, configured tool availability, model behaviour and task outcomes were not runtime-tested.

## Independent research tasks

- Transport and durability review: Inspect signature validation, persistence, acknowledgement and retry boundaries. Produce delivery-contract.md with failure points and provider-specific unknowns, without using the business-state review to excuse transport loss.

- Payment-state oracle: From the documented payment contract and fixture truth, define permitted transitions and unique downstream effects. Produce state-oracle.md independently of handler code, including refunds, entitlement changes and reconciliation after a missing event.

## Sequence and verification

1. Write replay-scope.md with fixture hashes, event identifiers, isolated destinations and prohibited external effects. Confirm the sink cannot charge, refund, email or provision real accounts. Pass the same frozen evidence to both reviewers.

2. Combine delivery-contract.md and state-oracle.md into replay-cases.md. Keep live ingress authentication tests separate from internal replay of already validated durable records; replay does not authorise disabling signature or freshness checks.

3. Replay the normal sequence through the test ingress and queue. Capture receipt, acknowledgement, processing and effect-ledger evidence as baseline-replay.md, then reset the fixture state using the recorded procedure.

4. Inject duplicate/concurrent deliveries, stale ordering, queue failure and a worker interruption between business effect and completion recording. Re-run the bounded set and hand event-by-event observations to the reviewer in fault-replay.md, preserving retries and exhausted attempts.

5. Exercise dead-letter selection and reprocessing on an explicit event list. Reconcile payment and entitlement state against the independent provider-state fixture; do not rely on timestamp sorting as business truth. Record unresolved drift and duplicate-effect counts in reconciliation.md.

6. Produce replay-runbook.md specifying selection bounds, authenticated entry path, pacing, abort conditions and evidence retention. The handoff names tested semantics and missing provider behaviour; production replays, payments and external side effects remain separately authorised.

## Boundaries

- The webhook-engineer profile covers delivery mechanics and replay but installs no broker, ledger or provider sandbox. Map its read/write/shell tools and sonnet alias to a restricted project host; sibling agents mentioned upstream are not configured by this recipe.

- Payment-state rules, retention windows and reconciliation authority are project/provider inputs. At-least-once receipt is not exactly-once execution, and a successful transport response is not evidence of correct billing.

- Use synthetic events, an isolated side-effect sink and host-managed disposable test material. No production replay, real charge, refund, public tunnel or credential handling occurs during authoring; the suggested combination has not been runtime-tested.

## Expected output

A replay runbook and test ledger showing which event sequences preserve the expected payment and entitlement state, with reconciliation gaps exposed.

## Deliverables

- Bounded event manifest and independently derived payment-state oracle.

- Ingress, acknowledgement and durable-processing evidence for normal and faulted runs.

- Reconciliation ledger for payments, refunds, entitlements and downstream effects.

- Replay runbook with event-selection limits, abort conditions and unresolved semantics.

## Acceptance checks

- [ ] Reject an invalid signature or stale ingress envelope before business processing; internal replay must not become a public bypass of authentication.

- [ ] Deliver the same event concurrently and after a retry; verify one permitted business effect using stored state and sink receipts, not only a successful response.

- [ ] Fail durable persistence or enqueueing; an acknowledgement that conceals event loss fails the transport contract.

- [ ] Interrupt processing after an effect but before completion recording; recovery must not double-apply a charge-related ledger entry or entitlement.

- [ ] Deliver a stale payment update after a refund or newer terminal state; regression of the business state fails even when events parse successfully.

- [ ] Replay an expired-dedup record and a poison event under the documented retention policy; silent loss, unbounded retries or untracked reapplication blocks the runbook.

- [ ] Remove one event from the manifest and reconcile against fixture truth; unexplained balance, currency, refund or entitlement drift prevents a convergence claim.

Workflow: https://undominated.ai/workflows/#replay-payment-webhooks
