Failures are dropped
After three quick retries the old sender throws the message away.
Impact: 3,412 order events lost in one outage; orders paid but never shipped.
All problemsData & Systems
Build the scheduler that delivers webhooks to merchant endpoints from a one-page spec.
Your mission · Build from a spec
Copperleaf's old sender retries a failed webhook three times in a row and then drops it. Last week a two-hour outage at one warehouse system lost 3,412 order events, and paid orders never shipped. The holiday peak triples traffic from December 7, and support wants a sender that cannot lose an order.
After three quick retries the old sender throws the message away.
Impact: 3,412 order events lost in one outage; orders paid but never shipped.
Retries go out next to newer messages for the same shop.
Impact: Shops saw order.cancelled before order.paid and shipped cancelled orders.
Every tick fails with NotImplementedError.
Impact: The new worker cannot run before the holiday peak.
Edit the components marked “Your work”. The other components show where your changes fit.
| Field | Type | Notes |
|---|---|---|
max_attempts | integer >= 1 | Attempts before a message is given up. Production: 8. |
base_delay | integer >= 1 | Seconds to wait after the first failure. Production: 30. |
max_delay | integer >= base_delay | Longest wait between two attempts. Production: 3600. |
| Field | Type | Notes |
|---|---|---|
op | "enqueue" | |
id | non-empty string | The order event ID, for example "evt_9001". Unique. |
endpoint | non-empty string | The shop's endpoint key, for example "lumen-tea". |
| Field | Type | Notes |
|---|---|---|
endpoint | string | Only endpoints with messages waiting are listed, by name. |
queue | string[] | Waiting message IDs, front first. |
attempts | integer | Attempts made on the front message. |
next_attempt | integer | The second the front message is due. |
config/delivery.yaml Production settings from December 7: 8 attempts, 30 seconds doubling to one hour, and catch-up ticks of up to 900 seconds.# Webhook delivery worker, production settings from December 7. max_attempts: 8 base_delay_seconds: 30 max_delay_seconds: 3600 # 30, 60, 120, ... capped at one hour dead_letter_retention_days: 30 worker: tick_every_seconds: 1 max_catch_up_seconds: 900
samples/outage-replay.json A short outage at one shop while another keeps receiving. Arguments for Preview.[
{
"max_attempts": 6,
"base_delay": 30,
"max_delay": 600
},
[
{
"op": "enqueue",
"id": "evt_9001",
"endpoint": "lumen-tea"
},
{
"op": "enqueue",
"id": "evt_9002",
"endpoint": "north-bikes"
},
{
"op": "enqueue",
"id": "evt_9003",
"endpoint": "lumen-tea"
},
{
"op": "down",
"endpoint": "north-bikes"
},
{
"op": "enqueue",
"id": "evt_9004",
"endpoint": "north-bikes"
},
{
"op": "tick",
"seconds": 60
},
{
"op": "status"
},
{
"op": "tick",
"seconds": 240
},
{
"op": "up",
"endpoint": "north-bikes"
},
{
"op": "tick",
"seconds": 600
},
{
"op": "status"
}
]
]samples/outage-replay-expected.json What the spec says that replay returns, event by event. north-bikes is tried at 0, 30, 90, 210 and 450 seconds, and the last try succeeds.[
{"id": "evt_9001", "state": "queued", "position": 1},
{"id": "evt_9002", "state": "queued", "position": 1},
{"id": "evt_9003", "state": "queued", "position": 2},
{"endpoint": "north-bikes", "state": "down"},
{"id": "evt_9004", "state": "queued", "position": 2},
{"time": 60, "delivered": ["evt_9001", "evt_9003"], "dead": []},
{"time": 60, "endpoints": [{"endpoint": "north-bikes", "queue": ["evt_9002", "evt_9004"], "attempts": 2, "next_attempt": 90}], "dead": []},
{"time": 300, "delivered": [], "dead": []},
{"endpoint": "north-bikes", "state": "up"},
{"time": 900, "delivered": ["evt_9002", "evt_9004"], "dead": []},
{"time": 900, "endpoints": [], "dead": []}
]logs/old-sender-2026-11-19.log The old sender during the November 19 outage: three retries in a second, a drop, and an order.cancelled delivered before its order.paid.2026-11-19T14:02:11Z sender POST endpoint=harbor-wms event=evt_7710 status=503 try=1 2026-11-19T14:02:11Z sender POST endpoint=harbor-wms event=evt_7710 status=503 try=2 2026-11-19T14:02:12Z sender POST endpoint=harbor-wms event=evt_7710 status=503 try=3 2026-11-19T14:02:12Z sender DROP endpoint=harbor-wms event=evt_7710 reason=max_tries 2026-11-19T14:02:40Z sender POST endpoint=harbor-wms event=evt_7714 type=order.cancelled status=503 try=1 2026-11-19T16:05:03Z sender POST endpoint=harbor-wms event=evt_7731 type=order.cancelled status=200 try=1 2026-11-19T16:05:03Z sender POST endpoint=harbor-wms event=evt_7702 type=order.paid status=200 try=1 retried_from=14:01:58 2026-11-19T16:06:00Z sender SUMMARY window=14:00-16:05 dropped=3412 shops=41
metrics/endpoint-failures-2026-11.csv Failed attempts and dropped messages per day, with the outage on November 19.day,messages,failed_attempts,dropped,endpoints_failing 2026-11-16,1873204,9120,212,288 2026-11-17,1902511,8874,198,301 2026-11-18,1888930,9411,240,295 2026-11-19,1911067,61402,3412,334 2026-11-20,1895342,9033,205,290
TASK-201 Read docs/spec.md and decide the data model Reported by Nadia (integrations)
Expected NOTES.md says what the scheduler stores for the clock, each endpoint queue and each message, and why that is enough for retries and the order rules.
Actual Scheduler has queues, the down set and the dead-letter list, but nothing writes down how a tick picks the next attempt, and the delivery code is a stub.
TASK-202 Core: deliver the front of each queue to endpoints that are up Reported by Nadia (integrations)
Expected The tick returns {"time": 1, "delivered": ["m1"], "dead": []}.
Actual The tick fails with NotImplementedError: "Implement Scheduler.advance using the request contract".
TASK-203 Then retries with backoff, then the dead-letter list Reported by Joel (merchant support)
Expected Every result matches the expected file, north-bikes is due at 90 after two failures, and the short ticks end in the same final status as the long one.
Actual Every tick fails with NotImplementedError, and retry_delay in delivery/services/backoff.py is a stub.
TASK-204 Write down anything you chose to leave out or would do next Reported by Ines (engineering manager)
Expected A short list of what the scheduler does not handle yet and what you would build next, with a reason for each.
Actual NOTES.md has no entry.
Scores use evidence from your session. A short or incomplete session may not provide enough evidence for every skill. See a sample scorecard
Build the scheduler that delivers our outgoing webhooks. Each merchant endpoint gets its messages in order, failures are retried with exponential backoff, and a message that keeps failing goes to a dead-letter list. Time is a simulated clock that moves in ticks. The spec is one page. Start with a working core and grow it. Use the AI assistant however you like, and tell me your data model before you ask it for code.