- Category: C. AI Engineering & LLM Ops
- English term: Receipt and Definition of Done
- Related: Distinguishing 'Implemented' from 'Running' (Definition of Done) · Content-Addressable Hash Verification · Independent Verification (Verifier) · State Machine · Lease (Leased Lock)
General Meaning
In software engineering, the Definition of Done (DoD) establishes the unambiguous criteria required before a backlog item is considered truly finished. When managing autonomous AI agents, a shell command returning exit code 0 is insufficient proof of success; scripts can swallow errors silently, terminate prematurely, or complete without producing any actual code changes.
A receipt acts as an automated acceptance contract. It cryptographically inspects generated files, commit objects, or pull requests, refusing to mark a task complete until every required deliverable passes deterministic validation.
Why It Matters
- Eliminating superficial success: Prevents scripts that swallow fatal exceptions and exit with status 0 from being erroneously recorded as completed work.
- Guaranteeing end-to-end traceability: Persists immutable evidence linking the executing job ID, timestamp, and specific commit hashes or pull request numbers.
- Streamlining resumption and recovery: Enables interrupted multi-step workflows to verify partial receipts and resume cleanly without duplicating already-verified steps.
How the Site Factory Uses It
The Site Factory enforces strict completion verification through its workflow CLI (tools/work.py receipt) and verification engine (honbu/receipts.py). At the conclusion of any task, agents must execute python3 tools/work.py receipt --outcome done with associated artifacts. Deliverable files are validated via SHA-256 hashes, pull requests are checked for existence and state via gh pr view, and Git commits are checked against repository objects. If no artifacts are provided, the CLI raises a completion requires artifacts exception and aborts state transition.
Receipt issuance also validates scope boundaries: requests referencing unauthorized task IDs outside HONBU_WORK_IDS or exceeding per-execution caps (such as a maximum of 3 tasks per desk run) are rejected. Furthermore, the engine distinctly categorizes outcomes into done, pr (pending merge), deploy (awaiting publish), handoff (transferred to another agent), and no_change.
Caveats & Operational Rules
- Never equate exit code 0 with true completion: Standard CLI termination is never accepted as proof of done; agents must furnish verifiable file hashes or pull request proofs to the receipt engine.
- Modifying artifacts after receipt generation invalidates records: Altering deliverables after SHA-256 hashes are recorded causes immediate verification mismatch errors; agents must finalize all edits before issuing receipts.
Related Terms
- Distinguishing 'Implemented' from 'Running' (Definition of Done)
- Content-Addressable Hash Verification
- Independent Verification (Verifier)
- State Machine
- Lease (Leased Lock)
References
- Book: Jez Humble & David Farley, Continuous Delivery, Chapter 5 (Acceptance Test Stage and Definition of Done)
Verified: 2026-11-08