Webhook Contract Repair / Public work sample
Repair the contract. Recover the work.
Repair a payload contract, then test duplicate delivery and restart recovery with a durable local inbox.
Public v0.2.0 / runnable recovery lab
The contract bench / Synthetic educational simulation
Follow the field.
Account for the effect.
Inspect six fixed states from the public work sample. Nothing is sent or saved here.
HTTP example / 422
The right data. The wrong path.
The broken mapper reads outside body. Its undefined fields disappear when serialized: the destination receives {} and rejects the contract.
A / Keep the identity. Repair the shape.
body.event_id"evt_demo_01"eventIdundefinedbody.order.unit_price"19.95"unitPriceCentsundefinedInspect all five contract fields
body.order.id"order_demo_01"orderIdundefinedbody.order.quantity"2"quantityundefinedbody.order.currency"CAD"currencyundefinedInternal note and customer fields stay outside the destination contract.
B / Count what survives.
- 01 Inbox receiptSeparate lab
- 02 Fulfillment rowSeparate lab
- 03 Commit + completionSeparate lab
The HTTP fixture has no durable inbox. Continue to inspect the recovery model.
Stage 1 of 6: Locate. HTTP example / 422. 0 receipts, 0 local fulfillment rows.
Downloads & setup
The problem
A corrected payload is only part of the job. A receiver also needs a clear account of what happens when a delivery repeats or a process stops between receiving an event and completing its work.
What I did
I defined the failure cases and reviewed the AI-assisted implementation, using synthetic fixtures, automated checks and explicit recovery boundaries.
How it works
- Reproduce a rejected request and repair its data contract using the original HTTP example.
- Record receipts in a local SQLite inbox before returning 202. Acknowledgement means the receipt is stored, not that the business work has finished.
- Replay duplicate deliveries and restart after four injected process-exit checkpoints, checking for one intended local fulfillment.
What you can verify
- Public v0.2.0 passed 29 tests and release-commit CI on Windows and Ubuntu.
- The runnable failure/replay lab shows expected and actual outcomes for fixed synthetic fixtures.
- Requires Node.js 24.15.0 or newer, writable local storage, child-process permission and loopback access for the HTTP example. No accounts or API keys are needed.
Project scope
This synthetic personal project proves the tested local SQLite transaction only. Email, payments and other external API effects need additional idempotency and recovery design. It is not production provider authentication, enterprise OAuth or a production-ready webhook service. Original v0.1.0 remains available.