86 / 90

第86日: キャップストーン統合 - ハーネス・ベースライン・管理されたデリバリー

限定エージェントハーネスを選定したモデルアダプタに接続し、決定論的ベースライン台帳を再確立し、使い捨てフィクスチャ上で CI デリバリーと故障回復を予行演習します。

AIエージェントとシステム開発 480 分(8時間)
01 120 分

統合アーキテクチャ: アダプタ境界

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

前提条件

第85日の凍結済み憲章と適合契約。projects/agent_learning のソース構成。

学習目標

検証済みハーネス (ツール・予算・スコアラー) と選択したモデルアダプタを組み合わせる統合継ぎ目を設計します。限定ツールをちょうど1つ追加し、既存の制限を一切弱めません。

手順

1. projects/agent_learning の構成要素を対応付けます: cli.py の入口、agent.py のステップ/リトライ予算とパス検査を持つループ、fixtures.py の使い捨て作業領域、deterministic-v1 アダプタ、独立スコアラー。
2. アダプタ境界を描きます: アダプタはアクションを提案するだけ。ハーネスが検証し、限定ツールを実行し、構造化された観測を返します。モデルは決して検証を迂回しません。
3. 新規の限定ツール1つ (例: count_words(note_name) -> int) を仕様化します: 登録名・型付き引数・フィクスチャ内パス処理・独自の失敗契約。
4. live アダプタスロットを仕様化します: deterministic-v1 と同じアクションスキーマで、チケット23の認可契約でゲートします。どちらのアダプタがアクションを出したかハーネスは区別できません。この不透明性こそ継ぎ目です。
5. integration_design.md を書きます: テキスト構成図、ツール契約、「制限維持」チェックリスト (ステップ予算・リトライ予算・ペイロード上限・パス検査・終了条件)。

演習と予測記録

count_words のツール契約 (名前・引数・戻り値型・エラーモード) と、アダプタ交換が予算を引き上げられないことを証明する制限維持チェックリストを作成してください。

独立習得基準

すべての制御がハーネス側にあり、予算・パス・終了に触れずにアダプタを交換できる設計を作成できること。

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

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 ↗

該当セクション・タイムスタンプ: Sections 2-3: API-call annotation, sampling, filtering, tool integration

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

選定理由:

Primary reference for model-tool integration with explicit API contracts; informs the capstone's adapter boundary where the harness owns tool validation and the model only proposes calls.

ソース前提知識:

Language-model finetuning, API calls, and tool schemas.

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

The capstone's tool contract template (name, typed arguments, error modes) is fully specified in the lesson instructions.

比較対象候補リソースと選定評価 (2)
Yao et al.: ReAct ↗ compared_alternative [Open Access / CC BY 4.0]

Prompt-time interleaving rather than finetuned tool calls; both define the model-side of the same adapter boundary.

Large API-corpus retrieval; Toolformer's minimal single-tool mechanics match the capstone's bounded tool set.

linking All Rights Reserved (personal research blog) Prose is linked, not copied; the curriculum uses its own bounded-agent implementation

LLM Powered Autonomous Agents

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

該当セクション・タイムスタンプ: Sections: planning, memory, tool use, challenges

検証バージョンと日付: Blog post June 23, 2023 (Verified: 2026-10-30)

選定理由:

Widely used survey mapping agent architecture components (planning, memory, tools) and their failure modes; supports the capstone integration architecture review.

ソース前提知識:

Agent loops, tool use, and planning vocabulary.

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

The capstone architecture lesson specifies the adapter boundary, budgets, and tool contracts directly; no blog content is required offline.

比較対象候補リソースと選定評価 (2)
Significant Gravitas: AutoGPT repository ↗ compared_alternative [MIT License (outside autogpt_platform/); Polyform Shield License (autogpt_platform/)]

Open-ended autonomous loop; deliberately excluded as the capstone must remain a bounded, evaluable system.

Yohei Nakajima: BabyAGI repository ↗ compared_alternative [MIT License]

Task-list autonomy demo; the survey article gives vocabulary while the capstone keeps fixed tasks and budgets.

02 120 分

ベースライン再実行と証拠台帳

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

前提条件

第86日 アクティビティ1。チケット19・21・22・23 で公開済みのコマンド群。

学習目標

検証済みの公開コマンドを変更せず再実行し、レビュアーが再現できるベースライン台帳を記録します。キャップストーンは記憶ではなくこの台帳と比較されます。

手順

1. 決定論的ベースラインを実行します: python -m projects.agent_learning.cli evaluate --fixture summarize-notes --output /tmp/capstone-baseline.json。終了コード 0 と、成果物内の expected_report_sha256 = 9e8315034af750009a4b2cfb261a077428afe441bc45c602cb7ead32ac0fd787 を確認。
2. スコアラーテストを実行します: python -m unittest discover -s tests/projects -p 'test_agent_learning.py' -v。合格数を記録。
3. 両契約を検証します: python3 projects/lora/evidence/validate_contract.py と python3 projects/agent_learning/evidence/validate_contract.py。blocked 状態が blocked のままであることを記録。
4. baseline_ledger.md に各行を記録します: コマンド・終了コード・成果物パス・SHA-256・環境 (python3 --version)・1行の観察。
5. 事前学習証拠パッケージが解析できることを確認します: python3 -c "import json; json.load(open('curriculum/projects/docs/pretrain-cloud-evidence/evidence-package.json'))" で run_status=blocked を確認。
6. 比較します: 今後のキャップストーン実行はすべて、この台帳に対する同一または正当化された差分を報告します。

演習と予測記録

baseline_ledger.md を作成し、コマンドごと1行 (最低5行) にコマンド・終了コード・成果物 sha256・観察を記録してください。再現しなかった行は緑に書き換えず、失敗として標識してください。

独立習得基準

5つのコマンドすべてを成果物レベルの証拠 (ハッシュまたは件数) で再現した台帳を、正直な失敗行を含めて提出できること。

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

linking MIT

OpenAI Evals: Framework for Evaluating LLMs and Contamination Checks

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

該当セクション・タイムスタンプ: README sections 'Running evals' and 'Writing evals'

検証バージョンと日付: OpenAI Evals Repository (Verified: 2026-10-30)

選定理由:

Standardized evaluation repository specifying rigorous separation of eval prompts, canary GUID strings, and contamination test protocols.

ソース前提知識:

Python, evaluation harnesses (MMLU, GSM8K), JSONL datasets.

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

Canary GUID matching, token set intersection, and leak detection scripts are implemented in the curriculum.

比較対象候補リソースと選定評価 (2)
EleutherAI LM Evaluation Harness ↗ compared_alternative [MIT]

Widely adopted evaluation harness; OpenAI Evals provides explicit canary guidance and contamination check specifications.

Hugging Face Lighteval ↗ compared_alternative [MIT]

Modern lightweight eval framework; OpenAI Evals illustrates standard test-set integrity guarantees.

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 ↗

該当セクション・タイムスタンプ: Sections 3-4: self-reflection loop, episodic memory, retry budgets

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

選定理由:

Defines failure-feedback-driven retry with bounded attempts; justifies the capstone's retry budget and its distinction between corrected-in-budget and safe termination.

ソース前提知識:

Agent loops, tool feedback, and retry semantics.

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

The fault-injection drill specifies verdict classes and budgets locally without needing the paper.

比較対象候補リソースと選定評価 (2)
Yao et al.: ReAct ↗ compared_alternative [Open Access / CC BY 4.0]

Single-episode action/observation protocol; Reflexion adds the cross-attempt self-correction used in the recovery drill.

External-tool critiquing loop; Reflexion's verbal-feedback retry is simpler to bind to the capstone's retry budget.

03 120 分

管理されたデリバリー: CI 検査とロールバック予行演習

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

前提条件

第86日 アクティビティ2のベースライン台帳。curriculum/engineering/ci_delivery_rollback のチケット24練習パッケージ。

学習目標

キャップストーン変更集合に対し、チケット24のデリバリー規律 (ブランチ・差分レビュー・自動検査・段階的デプロイ・ヘルスゲート・ロールバック) を、完全に使い捨てフィクスチャ内で予行演習します。

手順

1. CI 練習パイプラインを実行します: python3 scripts/ci_practice_runner.py。5つのステージ (clean_install, regression_exercise, conflict_resolution, controlled_deployment, health_failure_and_rollback) を特定。
2. キャップストーン用にステージ意味論を再現します: 「変更」は新規限定ツール+タスク。クリーンインストール後もスコアラーが合格し、意図的に壊したツール引数は検査で不合格になる必要があります。
3. ツール差分のレビュー練習: 全行を読み、予算定数が変わっていないこと、ネットワーク呼出しが現れていないことを確認。
4. ロールバック演習: 使い捨てフィクスチャに変更をデプロイし、ヘルス検査を不合格 (例: missing_note でスコアラー失敗) にし、既知の正常状態へ復元して復元証拠を記録。
5. delivery_log.md を書きます: ステージ・コマンド・観測結果・合否・ロールバック証拠。コマンドのスクリーンショットではなく観測可能な結果のみ。

演習と予測記録

5ステージすべてに加え、注入退行の診断とロールバック証拠 (例: 復元後ファイルハッシュが変更前ハッシュと一致) を含む delivery_log.md を作成してください。

独立習得基準

使い捨てフィクスチャ上で デプロイ→ヘルス失敗→検証済み復元 を、各ステージで成果物レベルの証拠とともに実演できること。

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

linking All Rights Reserved (martinfowler.com) Article is linked, not copied; pipeline practice uses the repository's own runner

Continuous Integration

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

該当セクション・タイムスタンプ: Practices of Continuous Integration: Make the Build Self-Testing; Fix Broken Builds Immediately

検証バージョンと日付: Second edition, May 2006 (Verified: 2026-10-30)

選定理由:

Standard essay defining CI as verified mainline integration; grounds the capstone delivery rehearsal's check-before-merge and broken-build-response rules.

ソース前提知識:

Version control, automated tests, and build scripts.

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

scripts/ci_practice_runner.py demonstrates each stage locally; the article is a reference, not a dependency.

比較対象候補リソースと選定評価 (2)
Humble & Farley: Continuous Delivery (Addison-Wesley) ↗ compared_alternative [All Rights Reserved (book)]

Full deployment-pipeline book; the Fowler essay suffices for the rehearsal vocabulary while the repo runner supplies practice.

Forsgren, Humble, Kim: Accelerate / DORA State of DevOps ↗ compared_alternative [CC BY-NC-ND (reports)]

Industry metrics research; cited as background while the article supplies the operative CI definition.

linking CC BY-NC-ND 4.0 noncommercial no-derivatives

Site Reliability Engineering, Chapter 8: Release Engineering

著者・提供機関: Dinah McNutt (ed. Betsy Beyer, Tim Harvey), in Site Reliability Engineering (eds. Betsy Beyer, Chris Jones, Jennifer Petoff, Niall Richard Murphy; Google) | オリジナル出所URL ↗

該当セクション・タイムスタンプ: Chapter 8: release pipeline, canarying, rollback criteria

検証バージョンと日付: O'Reilly 2016 / sre.google online edition (Verified: 2026-10-30)

選定理由:

Defines staged rollout, health-gated release, and rollback criteria; supplies the controlled-deployment and health-failure stages rehearsed by the capstone.

ソース前提知識:

Version control, CI basics, and deployment vocabulary.

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

The CI practice runner encodes the same stages in disposable fixtures, so the exercise is self-contained.

比較対象候補リソースと選定評価 (2)
Humble & Farley: Continuous Delivery ↗ compared_alternative [All Rights Reserved (book)]

General delivery pipeline text; the SRE chapter adds explicit rollback/health-gate criteria used by the drill.

Martin Fowler: Continuous Integration ↗ compared_alternative [All Rights Reserved]

Integration-side discipline; the SRE chapter covers the release and rollback side of the same rehearsal.

04 120 分

評価: フォルト注入と限定回復ドリル

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

前提条件

第86日 アクティビティ1〜3。

学習目標

各決定論的フォルト (不正引数・入力欠落・ループ) を注入し、構造化された観測が予算内の修正または安全な終了で終わることを確認して、統合システムが安全に失敗することを証明します。

手順

1. {invalid_arguments, missing_note, loop} の各フォルトについて、フィクスチャアダプタをそのフォルト有効で実行し、アクション/観測トレースを記録します。
2. invalid_arguments: ハーネスが構造化エラーを返し、エージェントが max_retries=2 以内に修正または終了することを確認。
3. missing_note: 例外の外部流出ではなく、構造化された missing-note 観測を確認。
4. loop: ステップ予算 (max_steps=6) が無限循環ではなく強制終了を引き起こすことを確認。
5. 各結果を corrected-in-budget / terminated-safe / UNBOUNDED (自動不合格) に分類。fault_drill.json にフォルト別判定を記録。
6. 最後に完全な回復を1回: 失敗実行から清浄フィクスチャを復元し、緑まで再実行。これがキャップストーンの管理回復証明です。

演習と予測記録

fault_drill.json を作成してください: 3フォルトそれぞれについてトレースポインタ・観測終了・リトライ回数・判定、およびハッシュで検証した回復再実行結果。

独立習得基準

すべてのフォルトが構造化・予算化された結果を生み、無制限の脱出がゼロであり、回復再実行が成果物ハッシュで検証できること。

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

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 ↗

該当セクション・タイムスタンプ: Sections 3-4: self-reflection loop, episodic memory, retry budgets

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

選定理由:

Defines failure-feedback-driven retry with bounded attempts; justifies the capstone's retry budget and its distinction between corrected-in-budget and safe termination.

ソース前提知識:

Agent loops, tool feedback, and retry semantics.

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

The fault-injection drill specifies verdict classes and budgets locally without needing the paper.

比較対象候補リソースと選定評価 (2)
Yao et al.: ReAct ↗ compared_alternative [Open Access / CC BY 4.0]

Single-episode action/observation protocol; Reflexion adds the cross-attempt self-correction used in the recovery drill.

External-tool critiquing loop; Reflexion's verbal-feedback retry is simpler to bind to the capstone's retry budget.

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 ↗

該当セクション・タイムスタンプ: Sections 2-3: API-call annotation, sampling, filtering, tool integration

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

選定理由:

Primary reference for model-tool integration with explicit API contracts; informs the capstone's adapter boundary where the harness owns tool validation and the model only proposes calls.

ソース前提知識:

Language-model finetuning, API calls, and tool schemas.

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

The capstone's tool contract template (name, typed arguments, error modes) is fully specified in the lesson instructions.

比較対象候補リソースと選定評価 (2)
Yao et al.: ReAct ↗ compared_alternative [Open Access / CC BY 4.0]

Prompt-time interleaving rather than finetuned tool calls; both define the model-side of the same adapter boundary.

Large API-corpus retrieval; Toolformer's minimal single-tool mechanics match the capstone's bounded tool set.