Part 1 of 4 · 1 min read
Overview
Agent runs are slow, expensive and have side effects. A careless API double-bills, leaks job ids, and leaves clients guessing. Interviewers ask "how would you expose a 10-minute agent over an API?" and expect job ids, idempotency, status, cancel and webhooks.
About the example, and what is real
Real: the state machine, idempotency, owner scoping, Retry-After, HMAC signing with replay window and dedupe, and the 21 test cases in code/mini-jobapi. Assumed: run-time distribution (exponential, mean 3 min), 2 min proxy timeout, 5 percent lost submit responses, 30 percent lost webhook acks, retry policy. Not real: no HTTP framework, database, queue or network; the "clock" is a parameter.