Unit 10 of 12 · about 6 hours · implement, measure
A kill-point matrix with deterministic fake tools and injected faults
Successful replay on the happy path says little about a crash in the one unsafe window. A repeatable kill schedule turns each durability claim into evidence or a counterexample.
You'll be able to
- Enumerate and execute kill points on both sides of intent, request delivery, recipient commit, outcome persistence and acknowledgement.
- Build deterministic tools that expose delay, partial or invalid results, duplicate delivery, outage and timeout-after-commit.
- Measure recovery, unresolved outcomes, duplicate effects and interventions using independent recipient state.
Covers
Read
In this order, only the parts listed
0 of 2 done
- Durable Tool-Using Workflow: fault and evidence contractDurable Tool-Using Workflow
Milestone D - Failure handling; Milestone F - Final evaluation; Correctness requirements; Failure-injection requirements; Measurement requirements
Test only this section's deterministic tool workflow. Agent loops, load campaigns and real irreversible services are outside this unit.
- AWS: the deliberately unsafe split commitMaking Retries Safe with Idempotent APIs
Reducing client complexity with idempotent API design, atomic token-plus-mutation paragraph (page read 2026-10-18)
Revisit only this paragraph to design a negative control: effect commit without atomic deduplication.
Focus on
- Build on the Systems units on network fault injection and deterministic histories. Reuse their scripted schedules; add model proposals, approval, policy and tool-effect boundaries rather than rebuilding a simulator.
- Keep the fake recipient's ledger separate from workflow persistence. Record exactly whether the request was delivered and committed before withholding its reply; a generic thrown exception does not establish that window.
- For every kill point, restart from committed state and redeliver the input. Check allowed transitions, current authority, approval validity, recipient effect count and correlation, not just a success return value.
- Separate safety from recovery. No unauthorized or duplicate effect is a safety invariant; eventual completion assumes available dependencies and valid authority. Safe manual review is not automatic recovery success.
Common mistakes · 3
- Killing only the coordinator while the supposed remote effect lives in its memory. That loses the evidence needed to distinguish committed from uncommitted work.
- Testing graceful shutdown instead of abrupt process death at a controlled barrier. Cleanup can hide the unsafe window.
- Reporting zero duplicates among successful runs while discarding unresolved or failed runs. Retain every matrix row and its final classification.
Try it yourself
Closed-book, before checking anything
Quiz yourself
Answer first, then mark it. Missed ones go to Review.
0 got · 0 missed
1.Which kill point most directly exposes a missing recipient deduplication contract?Answer
After the recipient commits but before the coordinator saves the outcome. Recovery may resend an effect that already happened.
2.A run safely stops in manual review. Is it a recovered task success?Answer
No. It may satisfy safety while remaining unresolved. Report that separately from automatic recovery and completed business outcomes.
3.Why include an intentionally broken executor?Answer
It proves the fault schedule and independent oracle can detect the target violation instead of merely observing a passing implementation.
4.What does a process-kill matrix not establish about storage?Answer
It does not establish power-loss durability, corruption recovery or survival of a lost disk. State those exclusions alongside the SQLite storage contract.
You're done when
Every declared boundary has a retained kill/replay result, no row hides an unauthorized or duplicate effect, unresolved rows have owners, and the bad variant fails the independent oracle.
Only when you can do this without notes.
Leads to
Notes
Resources · 2 for this unit, 12 more in the section
- Durable Tool-Using WorkflowRoadmap-Final · primary
Build the reduced core through typed tools, one approval, one simulated irreversible effect, one compensable effect, capability policy, idempotency, durable intent and outcome, bounded execution and replay. Run kill tests around every persistence and effect boundary before adding an agent loop.
- Making Retries Safe with Idempotent APIsAmazon Builders' Library · required
Read "Retrying and the potential for undesirable side effects", "Reducing client complexity with idempotent API design", "Semantic equivalence and support for default retry strategies", "Late arriving requests and the life span of unique client request identifiers" and the parameter-mismatch section. Record the key and the effect atomically, scope keys by caller, and reject a reused key with different parameters.
Also in this section
- AI Agents in Depth - Tools and Asynchronous InteractionBojie Li · required
Read Chapter 4: 4.2 tool design and schema fidelity, 4.3 MCP, 4.5 versus 4.6 (read-only perception tools against execution tools), the "Idempotency and Cancellation Semantics" passage and the observability part of 4.6, and 4.7 human-in-the-loop timeouts. Add 5.1.5 Failure and Error Recovery and 6.2 asynchronous interaction. Translate the advice into explicit state and effect contracts.
- Model Context Protocol Specification 2026-07-28Model Context Protocol · required
Read the 2026-07-28 architecture and versioning pages: there is no initialize handshake, every request carries
_metaprotocol version, client info and capabilities, andserver/discoverlists versions and capabilities. Then the stdio and Streamable HTTP bindings,tools/listandtools/call(input and output schemas,isErrorversus JSON-RPC errors), resources and prompts, the tasks extension, and the roots and sampling deprecations. Build one small stdio server and client, record the wire messages, and keep application authorization outside the protocol. - Idempotent RequestsStripe · required
Read the page as one concrete recipient contract: an
Idempotency-Keyheader, the first result saved and replayed, parameter mismatch rejected, keys pruned after at least 24 hours (API v1), and the different API v2 retry semantics. Encode these cases in your fake effect recipient; do not treat 24 hours as universal. - Timeouts, Retries, and Backoff with JitterAmazon Builders' Library · required
Read "Timeouts", "Retries and backoff" and "Jitter": a timeout leaves the outcome unknown, side-effecting calls are unsafe to retry without idempotency, and retries belong at one layer with a token-bucket budget. Model the unknown outcome as its own workflow state.
- How to Do Distributed Locking (fencing tokens)Martin Kleppmann · required
Read "What are you using that lock for?", "Protecting a resource with a lock" and "Making the lock safe with fencing". The effect recipient must remember the highest token and reject older ones (34 accepted, delayed 33 rejected); a random lock value is not a fencing token. Fencing rejects stale authority, while idempotency rejects repeated operations.
- SagasHector Garcia-Molina and Kenneth Salem · reference
Read Section 1 (p. 250: compensation does not necessarily restore the earlier state) and Section 9 Designing Sagas, with Sections 4 and 5 on backward and forward recovery. Some actions cannot be compensated; model failed compensation and manual handling explicitly.
- LangGraph Persistence and InterruptsLangChain · support
Read persistence (checkpointer versus store; the in-memory saver does not survive a restart), interrupts (
interrupt,Command(resume=...), the rules of interrupts, "side effects called before interrupt must be idempotent") and the Functional API determinism and idempotency sections. Resuming restarts the interrupted node from its beginning: reproduce the repeated pre-interrupt action with a SQLite checkpointer across two processes. - DBOS Transact Python: Workflows and StepsDBOS · support
Read the workflow tutorial ("Workflow IDs and Idempotency", "Determinism"), the step tutorial ("Configurable Retries", "Step Timeouts") and the system-database page (SQLite by default). Kill a process mid-workflow and confirm that completed steps do not rerun while the interrupted step does. Choose this or LangGraph as the implementation companion, not both.
- Temporal: Workflow Replay, Activity Retries and TestingTemporal · reference
Read Event History and replay, the Python workflow logic requirements, "Make Activities idempotent", the default retry policy (unlimited attempts unless set) and Signals versus Updates. Activities may run more than once, so replay does not make an external effect exactly-once.
- Writing Effective Tools for AI AgentsAnthropic · support
Read "Running an evaluation" and "Principles for writing effective tools" through "Prompt-engineering your tool descriptions": a small task-shaped tool surface, unambiguous parameter names, bounded and paginated results, actionable errors. Compare with the OpenAI function-definition best practices and rewrite one tool contract.
- AI Engineering Handbook - Agent EngineeringHandbook Academy · support
Study the Part 7 chapters on tool design, MCP and security, human review and long-running agents. Use them to audit user-facing workflow behavior and failure paths after the durable core works.
- The Hitchhiker's Guide to Agentic AI - Harness and MCPHaggai Roitman · support
Use v3 sections 18.4 to 18.7 (tool integration, orchestration with the explicit state machine in 18.5.5, state management and checkpoints, error handling), then Chapter 23 for MCP vocabulary and 23.6 for its security model. Its transport lists predate the 2026-07-28 specification and 18.4.5 contradicts Chapter 23, so take protocol facts from the specification.