80 / 90

第80日: 差分レビュー、独立テストと CI 失敗からの回復

エージェントの差分をレビュアーの視点で検査し、独立したテストで変更を証明し、意図的に失敗させたエージェント変更を CI 診断から検証済み修正まで導く。

Self-Directed Learning & Python 480 分(8時間)
01 120 分

エージェント差分の検査と PR 型レビューチェックリスト

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

前提条件

第79日。第14〜15日の Git 協業基礎。Ticket 24 のレビューチェックリスト(curriculum/engineering/ci_delivery_rollback)。

学習目標

エージェント生成の diff をプルリクエストのレビュアーのように1行ずつ検査し、変更を CI に流す前に6項目チェックリストを適用する。

手順

1. まだステージしません:git diff と git status を実行し、エージェントが生成した全ハンクを読みます。
2. 各ハンクに Ticket 24 チェックリストを適用します:正確性と仕様適合・テスト十分性・アサーション改竄なし・API とファイル形式の後方互換・シークレットや危険シェル呼出しゼロ・クリーンで非破壊的な履歴。
3. すべてのハンクを accept / question / reject に分類し1行の理由を付けます。
4. ハンク要約や疑わしい行の特定はエージェントに手伝わせて構いませんが、判定はあなたのものです — エージェント支援は決定の手前で終わります。
5. 即時 reject 条件:テストアサーションの弱化、スコープ外ファイル、ハードコードされた認証情報、説明のない再フォーマット。

演習と予測記録

review_notes.md を作成してください:diff ハンクごとに1行(ファイル・ハンク範囲・判定・理由)、加えて最重要チェックリスト所見3件を引用行付きで記録します。

独立習得基準

すべての差分ハンクに明示的で証拠に基づく判定を付ける構造化レビューを完了できる。

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

linking CC BY-NC-SA 3.0 noncommercial share-alike

Pro Git, Second Edition

著者・提供機関: Scott Chacon and Ben Straub | オリジナル出所URL ↗

該当セクション・タイムスタンプ: Chapter 3 (Git Branching), Section 7.7 (Reset Demystified), Sections 5.2/6.2 (Contributing to a Project)

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

選定理由:

Freely licensed reference for branching, merging, conflict resolution, and safe recovery vocabulary used through the delivery workflow.

ソース前提知識:

Basic git status/log/diff vocabulary from earlier study days

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

git help <command> and the Git manual pages ship with Git and cover the same commands offline; every required workflow is stated locally in the lesson.

比較対象候補リソースと選定評価 (2)
GitHub Skills interactive courses ↗ compared_alternative [MIT (varies by course)]

Interactive but requires a GitHub account and an external service; disposable local repositories keep the exercise self-contained.

Atlassian Git Tutorials ↗ compared_alternative [All Rights Reserved]

Vendor-owned prose with no permissive license; Pro Git covers the same ground under CC BY-NC-SA.

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: Everyone can see what's happening

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

選定理由:

Standard practitioner reference defining the CI contract this block rehearses: every change merges to a mainline verified by an automated build and test run, and failures are fixed before further work proceeds.

ソース前提知識:

Version control basics, automated test suites, and build vocabulary.

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

The CI gate contract (lint, test, package, verdict) is executed locally by scripts/ci_practice_runner.py with no external dependency.

比較対象候補リソースと選定評価 (2)
GitHub Actions Documentation ↗ compared_alternative [CC BY 4.0]

Provider-specific workflow syntax; Fowler's article states the vendor-neutral CI discipline the learner must internalize first, while the docs are kept as the pipeline-mechanics source.

Atlassian Continuous Integration Guide ↗ compared_alternative [All Rights Reserved]

Vendor-oriented tutorial; Fowler's original definition keeps the explanation tool-agnostic and historically important.

02 120 分

公開シームでの独立検証テスト

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

前提条件

第80日 アクティビティ1。

学習目標

受入基準に対する検証テストを、エージェント支援なしで公開インターフェースの継ぎ目(シーム)に作成し、変更をエージェントの主張ではなく独立した証拠で証明する。

手順

1. 第79日アクティビティ1の各受入基準から unittest ケースを1件ずつ導出します。
2. 公開シームでテストします:cli.evaluate / run_task / 公開ツール関数を呼び、プライベート内部には触れません。
3. red-green に従います:実行前に期待値を予測し、本物の失敗テストが失敗するのを見てから、実装に対して合格することを確認します。
4. 正常系に加え、障害経路(無効引数)1件と予算不変条件(steps <= 6)1件をカバーします。
5. 自分の仕事を裁くテストをエージェントに書かせたり弱めさせたりしてはいけません。

演習と予測記録

tests/projects/test_day79_change.py に受入基準へ対応する unittest ケース3件を作成し、python -m unittest tests.projects.test_day79_change -v を実行して出力を記録してください。

独立習得基準

エージェントが成功を主張しても誤った実装を検出できる、公開シームの独立テストを作成できる。

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

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 web article (May 2006) (Verified: 2026-10-30)

選定理由:

Standard practitioner reference defining the CI contract this block rehearses: every change merges to a mainline verified by an automated build and test run, and failures are fixed before further work proceeds.

ソース前提知識:

Version control basics, automated test suites, and build vocabulary.

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

The CI gate contract (lint, test, package, verdict) is executed locally by scripts/ci_practice_runner.py with no external dependency.

比較対象候補リソースと選定評価 (2)
GitHub Actions Documentation ↗ compared_alternative [CC BY 4.0]

Provider-specific workflow syntax; Fowler's article states the vendor-neutral CI discipline the learner must internalize first, while the docs are kept as the pipeline-mechanics source.

Atlassian Continuous Integration Guide ↗ compared_alternative [All Rights Reserved]

Vendor-oriented tutorial; Fowler's original definition keeps the explanation tool-agnostic and historically important.

linking Open Access / CC BY 4.0

SWE-bench: Can Language Models Resolve Real-World GitHub Issues?

著者・提供機関: Carlos E. Jimenez, John Yang, Alexander Wettig, Shunyu Yao, Kexin Pei, Ofir Press, Karthik R. Narasimhan | オリジナル出所URL ↗

該当セクション・タイムスタンプ: Appendix A.3 Execution-Based Validation

検証バージョンと日付: ICLR 2024 / arXiv:2310.06770v3 (Verified: 2026-10-30)

選定理由:

Defines the standard pattern this block teaches: a bounded issue statement paired with executable fail-to-pass tests as verifiable acceptance criteria for agent-produced changes.

ソース前提知識:

Unit testing, issue descriptions, and repository evaluation vocabulary.

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

The acceptance-criteria pattern is exercised locally through the Ticket 22 fixture scorer and the Ticket 24 regression exercise without external datasets.

比較対象候補リソースと選定評価 (2)
HumanEval: Evaluating Large Language Models Trained on Code ↗ compared_alternative [arXiv non-exclusive license / Open Access]

Function-level synthesis benchmark; SWE-bench models the repository-scoped issue-to-diff workflow that this delivery block rehearses.

Multi-SWE-bench: A Multilingual Benchmark for Issue Resolving ↗ compared_alternative [Open Access / CC BY 4.0]

Extends issue resolution to multiple programming languages; the original Python-centric SWE-bench provides a cleaner pedagogical anchor.

03 120 分

失敗するエージェント変更: CI 診断と修正済み再提出

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

前提条件

第80日 アクティビティ2。

学習目標

意図的に失敗させたエージェント変更を CI の全工程に通す:赤い失敗を観測し、トレースバックから根本原因を診断し、修正済み差分を指示して、テストアサーションに一切触れずに緑を検証する。

手順

1. 回帰ステージを実行します:python3 scripts/ci_practice_runner.py --stage regression --json。制御された欠陥(unicode_multibyte_stripping)が注入されテストが走ります。
2. 実際の失敗を読みます:test_failed_red=true、test_multilingual_unicode_handling で AssertionError: 11 != 17 — 欠陥はテストではなく実装のマルチバイト文字除去です。
3. レビュアーのように診断します:根本原因行はアサーション側でなく実装側に特定し、再実行前に修正後の値を予測します。
4. レビュー済み修正を適用し、元のアサーションを保ったまま test_restored_green=true を確認します。
5. RED のトレースバックと GREEN の出力を逐語で証拠として記録します。

演習と予測記録

diagnosis.md を作成してください:失敗アサーション行・実装側の根本原因行・適用修正の説明・最終的な 'Ran N tests ... OK' 出力。

独立習得基準

アサーション改竄ではなく証拠を通して回復した、実際の欠陥の診断・修正ができる。失敗したエージェント変更を変更されていないアサーションの緑で証明する。

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

linking CC BY 4.0

GitHub Actions Documentation

著者・提供機関: GitHub, Inc. | オリジナル出所URL ↗

該当セクション・タイムスタンプ: N/A

検証バージョンと日付: GitHub Docs continuous publication (Verified: 2026-10-30)

選定理由:

Primary reference for pipeline stages, required status checks, and branch protection mechanics that the local CI practice runner mirrors in a disposable environment.

ソース前提知識:

YAML familiarity, shell commands, and Git hosting vocabulary.

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

Pipeline stage semantics (lint, test, package, deploy gate) are exercised offline by scripts/ci_practice_runner.py; no GitHub account or push authorization is required for the practice.

比較対象候補リソースと選定評価 (2)
GitLab CI/CD Documentation ↗ compared_alternative [CC BY-SA 4.0]

Equivalent pipeline concepts under a different provider; GitHub Actions matches the hosted-workflow conventions used in this project's delivery story.

Jenkins User Documentation ↗ compared_alternative [CC BY-SA 4.0]

Self-hosted CI server documentation; GitHub Actions better matches the hosted pipeline model the learner will meet first.

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 web article (May 2006) (Verified: 2026-10-30)

選定理由:

Standard practitioner reference defining the CI contract this block rehearses: every change merges to a mainline verified by an automated build and test run, and failures are fixed before further work proceeds.

ソース前提知識:

Version control basics, automated test suites, and build vocabulary.

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

The CI gate contract (lint, test, package, verdict) is executed locally by scripts/ci_practice_runner.py with no external dependency.

比較対象候補リソースと選定評価 (2)
GitHub Actions Documentation ↗ compared_alternative [CC BY 4.0]

Provider-specific workflow syntax; Fowler's article states the vendor-neutral CI discipline the learner must internalize first, while the docs are kept as the pipeline-mechanics source.

Atlassian Continuous Integration Guide ↗ compared_alternative [All Rights Reserved]

Vendor-oriented tutorial; Fowler's original definition keeps the explanation tool-agnostic and historically important.

04 120 分

評価: 証拠に基づくレビュー判定とマージ決定

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

前提条件

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

学習目標

完全なプルリクエストレビューパケット(差分判定・独立テスト結果・CI ステージ出力)を組み立て、すべて再実行可能な証拠に基づく承認/却下のマージ決定を下す。

手順

1. review_notes.md・あなたの unittest 出力・回帰ステージ JSON を1つのパケットに集約します。
2. 証拠の1つを自分で再実行し(unittest または CI ステージ)、主張が今も成立することを確認します。
3. APPROVE または REJECT を決定します:全チェックリスト項目が再実行済み証拠で合格した場合のみ承認、さもなければ具体的なブロック基準を添えて却下します。
4. マージ準備ノートを書きます:リスク水準・ロールバックの手掛かり(どのバージョンがサービスを復旧するか)・残存する制限。
5. 独立/エージェント支援の分離を明示します:あなたのテストと判定は独立証拠、生成された diff はエージェント支援成果です。

演習と予測記録

review_packet.md を作成してください:決定(APPROVE/REJECT)・6項目のチェックリスト結果各1行証拠付き・再実行コマンドとその出力・ロールバック注記。

独立習得基準

すべての承認基準が再実行可能な証拠で裏付けられた、防御可能なマージ決定を下せる。

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

linking CC BY-NC-SA 3.0 noncommercial share-alike

Pro Git, Second Edition

著者・提供機関: Scott Chacon and Ben Straub | オリジナル出所URL ↗

該当セクション・タイムスタンプ: Chapter 3 (Git Branching), Section 7.7 (Reset Demystified), Sections 5.2/6.2 (Contributing to a Project)

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

選定理由:

Freely licensed reference for branching, merging, conflict resolution, and safe recovery vocabulary used through the delivery workflow.

ソース前提知識:

Basic git status/log/diff vocabulary from earlier study days

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

git help <command> and the Git manual pages ship with Git and cover the same commands offline; every required workflow is stated locally in the lesson.

比較対象候補リソースと選定評価 (2)
GitHub Skills interactive courses ↗ compared_alternative [MIT (varies by course)]

Interactive but requires a GitHub account and an external service; disposable local repositories keep the exercise self-contained.

Atlassian Git Tutorials ↗ compared_alternative [All Rights Reserved]

Vendor-owned prose with no permissive license; Pro Git covers the same ground under CC BY-NC-SA.

linking Open Access / CC BY 4.0

SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering

著者・提供機関: John Yang, Carlos E. Jimenez, Alexander Wettig, Kilian Lieret, Shunyu Yao, Karthik Narasimhan, Ofir Press | オリジナル出所URL ↗

該当セクション・タイムスタンプ: Appendix B.4 Failure Modes

検証バージョンと日付: NeurIPS 2024 / arXiv:2405.15793v2 (Verified: 2026-10-30)

選定理由:

Primary literature on agent-computer interfaces showing that bounded tool commands, trajectory inspection, and environment constraints determine whether an agent can carry an engineering task to verifiable completion.

ソース前提知識:

Agent loops, tool protocols, and basic software engineering workflow vocabulary.

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

The permission/budget control profile, tool contract schema, and trace audit procedure are fully implemented in the local bounded agent fixture (projects/agent_learning).

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

Broader generalist agent platform; SWE-agent isolates the agent-computer interface design principles most relevant to bounded task delivery.

AutoCodeRover: Autonomous Program Improvement ↗ compared_alternative [Open Access / CC BY 4.0]

Focuses on autonomous program repair via code search; SWE-agent better matches the curriculum's bounded-tool and human-verification emphasis.