Check yourself
- Approved by
- Panaversity ·
6 min read
Each question is tagged with the section it tests. An outline answer follows each one.
- [33.1] What do the loop, the checkpoint, the safe replay and the wait mean? The harness calls the model and runs its tools. Each step is saved before the next one starts. A step with side effects can run twice without harm, because its key was saved. A waiting worker is saved and asleep, and costs nothing.
- [33.2] What goes in the spec for a durable worker, and why must each line be there? The tools, which ones change the outside, which are safe to replay and with what key, the approval and who may give it, rejection as a normal result, no model name in tool code, and the budget. If the spec does not say it, no test checks it and no review catches it.
- [33.3] In what order do you build the worker with Claude Code, and what do you check at each step? Scaffold the Worker and check the pinned versions. Host Pi Durable in a Durable Object and check that the registry is a field of the object. Add the tools and check that the key is saved with
api.memo()before the ledger call. - [33.4] Why does each conversation get its own object, and where does the worker's identity live? So conversations are isolated, run one message at a time, and accept each
operationIdonce. The identity, role contract and release live in Postgres, where auditors and the platform can read them. - [33.5] How does a worker wait days for a person without paying, and what four rules make an approval safe? The tool returns a waiting status and the object hibernates until a signal or a deadline wakes it. Only the holder of the named reviewer's link can approve, a link works once, a rejection is a result, and approving twice never pays twice.
- [33.6] Which moment do the hard tests aim at, and why do recorded answers make tests free? The moment between acting and saving, such as a crash right after the ledger call. Recorded answers replace the live model, so the tests need no API key, give the same result every time and run in seconds.
- [33.7] How do you turn 50 invoices of measured usage into a cost per invoice? Multiply the measured input and output tokens by the model's prices, add active object time, count waits as zero, and divide by 50. With the paper's medium-invoice numbers that is about $0.017 per invoice; the lab's recorded run gives $0.0049. Either way, almost all of it is model tokens.
- [33.8] What five mistakes do you look for first when you review a durable worker? Invented Pi APIs, a side effect in a tool marked safe, waiting code that keeps the object awake, trusting a signal's sender, and state shared at module scope.
- [33.9] What are the limits of this stack, and what do you check before you upgrade Pi? It is experimental and pinned, rollback is not free, a conversation cannot be deleted by a Pi call, worker-wide rules need something shared, and there are no subagents. Check that
agentssupports the new Pi version, and test the upgrade on a copy like a database migration.
Flashcards
Chapter 33's words and its operating rules. Each answer is on the back of its card.
1 / 19
- Owner
- Panaversity