検索想起ドリル: 実行状態と実行制限の語彙
Agent支援エンジニアリングチェック
前提条件
第76日の状態・リトライ機構。第73〜75日のツールプロトコル。
学習目標
今週の制御語彙(ステップ予算、リトライ予算、トレース、終了理由、チェックポイント、冪等副作用、使い捨てワークスペース)を閉ブックで想起し、記憶の感触ではなくコードと照合して検証する。
手順
1. 閉ブック: max_steps, max_retries, trace, termination, checkpoint, idempotent effect, disposable workspace 各項目を1行で定義します。
2. 権威ある定義で自己採点します: project.json の controls(max_steps=6, max_retries=2, tool_payload_bytes=4096)、agent.py の RunResult フィールド、cli.py の TemporaryDirectory ワークスペース。
3. 曖昧だった語彙を記録し、翌日の想起対象にします(分散想起は再読に勝ります)。
4. 紛らわしい対を区別します: リトライ予算(許容する失敗観測数)とステップ予算(許容する総反復数)。チェックポイント(再開を可能にする永続状態)とトレース(記録そのもの)。タイムアウト(1つのブロッキング待機)とデッドライン(エンドツーエンドの上限)。
演習と予測記録
参照リストを開く前に手書き定義を7点満点で採点してください。全ての誤答を想起キューに記録します。
トレースは実行状態であると同時に監査記録です。チェックポイントはそのトレースとカウンタを耐久化したものです。
max_steps: ループ反復の上限(6)。max_retries: tool_failure までに許容する失敗観測数(2)。trace: {action, observation} ペアの追記専用リスト。termination: 実行が終わった理由(goal_reached|tool_failure|step_budget)。checkpoint: 再開を可能にする trace+カウンタの永続シリアライズ。idempotent effect: 繰り返し適用しても状態が変わらない副作用。disposable workspace: 実行後に破棄される TemporaryDirectory フィクスチャ。
7つ全ての定義を無支援で記述し、コード確認前に正直に自己採点できる。最低6/7。
公式ソースリソースと権利証跡
Site Reliability Engineering, Chapter 22: Addressing Cascading Failures
該当セクション・タイムスタンプ: Preventing Server Overload: Retries; Latency and Deadlines
検証バージョンと日付: 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.
比較対象候補リソースと選定評価 (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
該当セクション・タイムスタンプ: Adding Backoff; Adding Jitter (Full Jitter, Equal Jitter, Decorrelated Jitter)
検証バージョンと日付: 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.
比較対象候補リソースと選定評価 (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.