Retrieval Drill: Run-State and Execution-Limit Vocabulary
Agent-Assisted Engineering Check
Prerequisites
Day 76 state and retry mechanics; Day 73-75 tool protocols.
Learning Objective
Recall closed-book definitions of the week's control vocabulary - step budget, retry budget, trace, termination, checkpoint, idempotent effect, disposable workspace - then verify each against code rather than memory vibes.
Instructions
1. Closed book: write a one-line definition for each of: max_steps, max_retries, trace, termination, checkpoint, idempotent effect, disposable workspace.
2. Self-mark against the authoritative definitions: project.json controls (max_steps=6, max_retries=2, tool_payload_bytes=4096), the agent.py RunResult fields, and the cli.py TemporaryDirectory workspace.
3. Record which terms were fuzzy; schedule those for tomorrow's recall (spaced retrieval beats re-reading).
4. Distinguish the look-alikes: retry budget (failed observations tolerated) vs step budget (total iterations allowed); checkpoint (persisted state enabling resume) vs trace (the record itself); timeout (one blocking wait) vs deadline (end-to-end bound).
Practice & Prediction Log
Score yourself out of 7 on the written definitions before revealing the reference list; log every miss to your retrieval queue.
The trace is both the run state and the audit record; a checkpoint is that trace plus counters serialized durably.
max_steps: bound on loop iterations (6). max_retries: bound on failed observations tolerated before tool_failure (2). trace: append-only list of {action, observation} pairs. termination: why the run ended (goal_reached|tool_failure|step_budget). checkpoint: durable serialization of trace+counters enabling resume. idempotent effect: repeat application leaves state unchanged. disposable workspace: TemporaryDirectory fixture destroyed after the run.
Write all seven definitions unaided and self-score honestly before checking the code; 6/7 minimum.
Authoritative Source Resources & Provenance
Site Reliability Engineering, Chapter 22: Addressing Cascading Failures
Relevant Section / Range: Preventing Server Overload: Retries; Latency and Deadlines
Verified Version & Date: O'Reilly 2016 free online edition (Verified: 2026-10-30)
Primary analysis of how unbounded retries amplify partial outages into cascading failures, motivating hard retry budgets and deadlines in agent runtimes.
Retries, queueing, and load-shedding basics.
The retry-amplification scenario and budget arithmetic are fully reproduced in the lesson's worked example.
Compared Candidate Sources & Selection Analysis (2)
Broader stability-pattern catalog (circuit breakers, bulkheads); the SRE chapter is free and directly quantifies retry amplification.
Strong companion article; the SRE chapter frames the failure mode (cascading overload) that the retry budget defends against.
Exponential Backoff And Jitter
Relevant Section / Range: Adding Backoff; Adding Jitter (Full Jitter, Equal Jitter, Decorrelated Jitter)
Verified Version & Date: AWS Architecture Blog 2015 (Verified: 2026-10-30)
Detailed practitioner reference proving that full jitter (sleep = random_between(0, min(cap, base*2**attempt))) prevents synchronized retry storms and reduces total work during contention.
Retries, timeouts, and basic probability of correlated load.
The backoff exercise is implemented in pure Python with a local flaky stub; the derivation of jitter benefits is fully reproduced in lesson instructions.
Compared Candidate Sources & Selection Analysis (2)
Product-scoped truncated exponential backoff recipe; Brooker's analysis explains why jitter matters, not just what to configure.
Library implementation reference; the AWS article supplies the comparative evidence (with/without jitter) that anchors the lesson.