75 / 90

Day 75:障害フィードバック・境界付き修復・独立検証済み結果

文書化された障害を注入し、構造化エラーフィードバックを観測し、制御された修復経路を実習し、独立スコアラーで結果を検証します。隠れた思考連鎖は収集しません。

エージェント 480 分(8時間)
01 120 分

制御された修復経路:invalid_arguments フィードバック後の回復

Agent支援エンジニアリングチェック

前提条件

Day 74 の検証層。決定論的アダプタの障害モード。

学習目標

注入された invalid_arguments 障害を実行し、構造化エラー観測を確認し、アダプタがリトライ予算内で回復して外部検証済みの完了実行へ至ることを確かめます。

手順

1. REPL で tempfile ワークスペース内に DeterministicModelAdapter(fault="invalid_arguments") と AgentConfig(max_steps=6, max_retries=2) でタスクを実行します。
2. ステップ 1 は filename ../outside.txt の read_note を提案。basename 規則が拒否:観測 {ok:false, error:invalid_arguments}。retries が 1 になります。
3. 次のモデルリクエストでアダプタは履歴(まだ成功した list_notes がない)から再計画し、list_notes → 両方の読み取り → write_report を発行します。これが制御された修復経路:悪い呼び出しを黙って再試行せず、エラー観測が次のアクションを操縦します。
4. RunResult を検証:status completed、steps 5、retries 1、termination goal_reached。続いて evaluate() で採点します。
5. Reflexion 流の言語化フィードバックとの対比:本アダプタは失敗の観測を読み直すだけで推論テキストを保存しません。修復の証拠はすべて action/observation トレースにあります。

演習と予測記録

障害実行を行い、trace[0].observation.error、trace[1].observation.ok、steps、retries、status、termination を記録し、report.txt の内容が expected_report() と一致することを確認しなさい。

独立習得基準

正確なカウンタ(steps=5、retries=1、completed/goal_reached)で修復経路を再現し、同じ悪い呼び出しが逐語再試行されない理由を説明できること。

公式ソースリソースと権利証跡

linking Open Access / CC BY 4.0

Reflexion: Language Agents with Verbal Reinforcement Learning

著者・提供機関: Noah Shinn, Federico Cassano, Ashwin Gopinath, Karthik Narasimhan, Shunyu Yao | オリジナル出所URL ↗

該当セクション・タイムスタンプ: Section 2 & 3 (Reflexion Architecture and Memory Buffer)

検証バージョンと日付: NeurIPS 2023 / arXiv:2303.11366v4 (Verified: 2026-10-30)

選定理由:

Rigorous framework analyzing dynamic error feedback, memory buffering of execution failures, and controlled self-reflection loops without updating model weights.

ソース前提知識:

Reinforcement learning concepts, agent evaluation loops, and error feedback handling.

安全フォールバック(オフライン回復性):

Error recovery state diagrams and retry budget algorithms are detailed in curriculum materials.

比較対象候補リソースと選定評価 (2)

Single-turn generative text refinement; Reflexion operates across multi-turn external environment action-observation failures.

Domain-specific LLM-based agent for open-world Minecraft; Reflexion establishes domain-general verbal feedback control loops.

linking Open Access / CC BY 4.0

ReAct: Synergizing Reasoning and Acting in Language Models

著者・提供機関: Shunyu Yao, Jeffrey Zhao, Dian Yu, Nan Du, Izhak Shafran, Karthik Narasimhan, Yuan Cao | オリジナル出所URL ↗

該当セクション・タイムスタンプ: Section 3 & 4 (ReAct Formulation and Synergy)

検証バージョンと日付: ICLR 2023 / arXiv:2210.03629v2 (Verified: 2026-10-30)

選定理由:

Foundational academic paper introducing the interleaved Thought-Action-Observation control loop in LLM agents, establishing formal interleaving of task reasoning and external tool execution.

ソース前提知識:

Prompt engineering, token generation basics, and conversational interaction loops.

安全フォールバック(オフライン回復性):

Complete algorithmic step traces, state loop diagrams, and control loop pseudocode are self-contained in curriculum materials.

比較対象候補リソースと選定評価 (2)

Pure reasoning without environmental actions or external tool grounding; ReAct extends reasoning into an interactive environment action-observation loop.

Early neuro-symbolic modular router concept; ReAct offers simpler, prompting-native action-observation loop dynamics suitable for standard API models.

02 120 分

安全な終了:missing_note と loop 障害の予算

独立習得チェック(AI 支援なし)

前提条件

Day 75 Activity 1:リトライカウンタとその予算。

学習目標

目標未達の 2 つの終了(リトライ超過による tool_failure(missing_note 障害)と、ステップ予算枯渇(loop 障害))を独立に実演し、無制限リトライが危険な理由を述べます。

手順

1. fault="missing_note":アダプタは常に read_note missing.txt を提案し、各観測は not_found。AgentConfig(max_steps=4, max_retries=1) では 2 回目の失敗で retries が 2 > 1:status failed、termination tool_failure、report.txt は存在しません。
2. fault="loop":アダプタは list_notes を永遠に提案。AgentConfig(max_steps=2, max_retries=1) でちょうど 2 ステップ後に終了:status budget_exhausted、termination step_budget。
3. 両実行を表にします:status、steps、retries、termination、report.txt の有無。
4. 有限ステップ/リトライ予算が重要な理由を 2 文で:無限ループはスタックしたポリシーを無限コストへ変え、予算はハングを構造化された検査可能な終了へ変えます。
5. ここは独立習得チェックです。援助なしで実行し表にまとめてください。

演習と予測記録

両障害実行を行い 4 列の表(status、steps、retries、termination)を作り、両ワークスペースに report.txt がないことを検証しなさい。

独立習得基準

両終了を正確なカウンタで無援助に再現し、リトライとステップ予算が有限であるべき理由を 2 文で説明できること。

公式ソースリソースと権利証跡

linking Anthropic PBC copyright (no open license stated) / linked reference Linking only; no documentation text is copied

Anthropic Tool Use (Function Calling) Implementation Guide

著者・提供機関: Anthropic PBC | オリジナル出所URL ↗

該当セクション・タイムスタンプ: Tool Use Overview, Schema Definitions, and Stop Reasons

検証バージョンと日付: Claude API Specification (Verified: 2026-10-30)

選定理由:

Detailed production reference for client-side tool definitions, tool_use content blocks, stop reason tool_use, and tool_result response formatting.

ソース前提知識:

REST API concepts, JSON schema specification, and basic Python client programming.

安全フォールバック(オフライン回復性):

Offline mock request/response cycles and tool payload schemas are provided in the repo.

比較対象候補リソースと選定評価 (2)
Google Gemini Function Calling Documentation ↗ compared_alternative [Creative Commons Attribution 4.0]

Protobuf and REST function declaration schema; Anthropic documentation provides explicit structured message block mechanics (tool_use / tool_result).

Cohere Tool Use and Multi-Step Agents Guide ↗ compared_alternative [Open Documentation]

Multi-step tool calling parameter definitions; Anthropic specification demonstrates clear separated content blocks essential for inspectable event traces.

linking Open Access / CC BY 4.0

Reflexion: Language Agents with Verbal Reinforcement Learning

著者・提供機関: Noah Shinn, Federico Cassano, Ashwin Gopinath, Karthik Narasimhan, Shunyu Yao | オリジナル出所URL ↗

該当セクション・タイムスタンプ: Section 2 & 3 (Reflexion Architecture and Memory Buffer)

検証バージョンと日付: NeurIPS 2023 / arXiv:2303.11366v4 (Verified: 2026-10-30)

選定理由:

Rigorous framework analyzing dynamic error feedback, memory buffering of execution failures, and controlled self-reflection loops without updating model weights.

ソース前提知識:

Reinforcement learning concepts, agent evaluation loops, and error feedback handling.

安全フォールバック(オフライン回復性):

Error recovery state diagrams and retry budget algorithms are detailed in curriculum materials.

比較対象候補リソースと選定評価 (2)

Single-turn generative text refinement; Reflexion operates across multi-turn external environment action-observation failures.

Domain-specific LLM-based agent for open-world Minecraft; Reflexion establishes domain-general verbal feedback control loops.

03 120 分

独立スコアリングハーネスと再現可能な評価成果物

独立習得チェック(AI 支援なし)

前提条件

Day 75 Activity 1-2 の観測実行。

学習目標

evaluate() で 4 つの独立次元(結果・ツール振る舞い・予算・障害処理)を採点し、CLI 成果物が決定論的で思考連鎖フィールドを含まないことを証明します。

手順

1. evaluate() はワークスペースを再検証します:report_ok はファイルの存在とバイト列が expected_report() と一致することを要求 - アダプタの自己申告ではなく外部検証です。
2. 4 つの採点次元:outcome_passed(正しいレポート成果物)、tool_behavior_passed(すべてのアクション名が ALLOWED_TOOLS 内)、budget_passed(steps <= 6 かつ budget_exhausted でない)、failure_handling_passed(すべてのエラーコードが既知の構造化コードで、失敗があれば安全な終了で終わる)。
3. CLI を 2 回実行して 2 ファイルへ出力し diff - バイト一致の出力が再現可能な証拠を作ります。
4. python -m unittest tests.projects.test_agent_learning -v を実行:6 テストすべて合格のはずです。
5. 成果物を禁止キー(thought、chain_of_thought)でスキャン - トレースポリシーはアクションと観測のみを収集します。
6. モデル識別を正直に記録:evidence.model_adapter は deterministic-v1 でありフィクスチャです。ライブモデルの品質については何も語りません。

演習と予測記録

/tmp/agent-run.json の metrics と unittest 結果を取得し、各採点次元を 1 行で述べ、プロセス終了コードだけでは検証済み結果にならない理由を説明しなさい。

独立習得基準

4 つの採点次元すべてと、プロセス終了コードだけでは学習証拠にならない理由を、deterministic-v1 の限定付きで説明できること。

公式ソースリソースと権利証跡

linking IETF Trust License / Open Standard

RFC 8259: The JavaScript Object Notation (JSON) Data Interchange Format

著者・提供機関: Tim Bray (Ed.) | オリジナル出所URL ↗

該当セクション・タイムスタンプ: Section 1-4 (JSON Syntax and Grammar)

検証バージョンと日付: IETF Standards Track RFC 8259 (Verified: 2026-10-30)

選定理由:

Foundational Internet standard defining strict JSON grammar, token parsing, and whitespace rules underpinning model tool calling serialization.

ソース前提知識:

Text encoding, UTF-8 parsing, and serialized data exchange.

安全フォールバック(オフライン回復性):

JSON grammar parsing rules and error recovery guidelines are documented in curriculum notes.

比較対象候補リソースと選定評価 (2)
RFC 7049: Concise Binary Object Representation (CBOR) ↗ compared_alternative [IETF Open Standard]

Binary serialization standard; text-based LLMs operate primarily on human-readable UTF-8 JSON interchange formats.

YAML 1.2 Specification (OASIS / yaml.org) ↗ compared_alternative [Open Standard]

Indentation-sensitive text format; JSON has universally standardized parsing across language runtimes and tool schemas.

linking Apache-2.0 (specification; unrelicensed legacy contributions remain MIT) / Open Specification

Model Context Protocol (MCP) Specification

著者・提供機関: Anthropic PBC & Open Source Contributors | オリジナル出所URL ↗

該当セクション・タイムスタンプ: Architecture Overview, Transports, Tools, and Resources

検証バージョンと日付: MCP Specification 2024-11-05 (Verified: 2026-10-30)

選定理由:

Normative open architecture specification defining Host, Client, and Server separation, resource subscriptions, tool listing/invoking primitives, and JSON-RPC 2.0 message framing.

ソース前提知識:

Client-server architecture, JSON-RPC 2.0 protocol, and standard IO communication.

安全フォールバック(オフライン回復性):

Architectural comparison tables, loop invariants, and message frame examples are self-contained in curriculum materials.

比較対象候補リソースと選定評価 (2)

Precursor JSON-RPC architecture for code intelligence in IDEs; MCP adapts similar client-server decoupling specifically for LLM context, tools, and prompts.

OpenAI Responses API Built-in Tools ↗ compared_alternative [Proprietary Documentation]

Hosted, vendor-managed built-in tool execution (successor to the Assistants API tools); MCP provides an open, decoupled local/remote client-server standard.

04 120 分

証拠台帳・限定事項の開示・計画レビュー

独立習得チェック(AI 支援なし)

前提条件

Day 75 Activity 1-3 の成果物が保存済みであること。

学習目標

実行の証拠台帳(コマンド・アダプタ識別・metrics・終了表)を明示的な限定事項とともに組み立て、選択した Agent ツールトラックを確認し、計画レビューを書きます。

手順

1. evidence-ledger.json を作成:コマンドライン、フィクスチャ名、model_adapter id、ワークスペースポリシー(tempfile ワークスペースでリポジトリツリーは使わない)、成果物の metrics、成果物パス。
2. 少なくとも 4 つの限定を開示:決定論的ポリシーはライブモデルではない。予算とパスチェックは OS サンドボックスではなく教育用制御。3 ツールは MCP や tool_use プロトコル準拠ではなく構造の実演。構造上ネットワーク無効のためプロバイダ証拠は存在しない。
3. 選択トラック確認:サイトで /your-language/agent-track を開き、選択した Agent ツールトラックが選択されたままか確認し、今日の方法のどこが共有部分(ループ・予算・証拠)で、どこがツール固有(コマンド・権限 UI)かを記録します。
4. 計画レビュー(分散想起):明日、5 つのループ段階と終了表を記憶から再導出し、CLI を再実行して成果物を diff。来週、ノートを読む前に 1 つの障害シナリオを再実行し evaluate() で再採点。
5. 独立ルーブリック:台帳の各主張が検証用の成果物またはコマンドを名指ししていること。限定リストが完備していること。ライブモデル能力の主張がどこにもないこと。

演習と予測記録

evidence-ledger.json、5 項目の限定リスト、計画レビューチェックリストを書きなさい。台帳の各主張は成果物を引用すること。

独立習得基準

独立:台帳が保存済み成果物から metrics を再現し、少なくとも 4 つの正直な限定を開示し、選択トラックを確認し、ライブモデル主張がゼロであること。

公式ソースリソースと権利証跡

linking arXiv.org perpetual non-exclusive license / Open Access

Toolformer: Language Models Can Teach Themselves to Use Tools

著者・提供機関: Timo Schick, Jane Dwivedi-Yu, Roberto Dessì, Roberta Raileanu, Maria Lomeli, Luke Zettlemoyer, Nicola Cancedda, Thomas Scialom | オリジナル出所URL ↗

該当セクション・タイムスタンプ: Section 2 (Approach: Tool Use and Filtering)

検証バージョンと日付: NeurIPS 2023 / arXiv:2302.04761v1 (Verified: 2026-10-30)

選定理由:

Original paper demonstrating self-supervised discovery and execution of tool API calls (calculator, QA, search, calendar) via inline tokenized tool invocations.

ソース前提知識:

Transformer autoregressive generation, API calling syntax, and self-supervised filtering.

安全フォールバック(オフライン回復性):

Inline tool invocation formats and self-contained mock execution traces are provided in curriculum notes.

比較対象候補リソースと選定評価 (2)
Gorilla: Large Language Model Connected with Massive APIs (Patil et al. 2023) ↗ compared_alternative [Apache-2.0 / arXiv Open Access]

Focuses on massive API retrieval and documentation formatting; Toolformer focuses on the fundamental token-level seam between model generation and tool execution.

TALM: Tool Augmented Language Models (Parisi et al. 2022) ↗ compared_alternative [arXiv Open Access]

Iterative search-and-execute augmentation; Toolformer provides clearer self-supervised API call tokenization syntax.

linking Open Access / CC BY 4.0

Reflexion: Language Agents with Verbal Reinforcement Learning

著者・提供機関: Noah Shinn, Federico Cassano, Ashwin Gopinath, Karthik Narasimhan, Shunyu Yao | オリジナル出所URL ↗

該当セクション・タイムスタンプ: Section 2 & 3 (Reflexion Architecture and Memory Buffer)

検証バージョンと日付: NeurIPS 2023 / arXiv:2303.11366v4 (Verified: 2026-10-30)

選定理由:

Rigorous framework analyzing dynamic error feedback, memory buffering of execution failures, and controlled self-reflection loops without updating model weights.

ソース前提知識:

Reinforcement learning concepts, agent evaluation loops, and error feedback handling.

安全フォールバック(オフライン回復性):

Error recovery state diagrams and retry budget algorithms are detailed in curriculum materials.

比較対象候補リソースと選定評価 (2)

Single-turn generative text refinement; Reflexion operates across multi-turn external environment action-observation failures.

Domain-specific LLM-based agent for open-world Minecraft; Reflexion establishes domain-general verbal feedback control loops.