Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: parent
goal_ref: "issue-refinement-loopがdeterministic checkerで処理できないsemantic design findingを未解決のまま処理完了扱いにしない構造へ修正する"
change_kind: workflow
parent_mode: "delivery-rollup"
closure_mode: "child-complete"Summary
#2273 の敵対的レビュー(コメント1、コメント2)で指摘された P0-3〜P0-6 / P1-1〜P1-5 級の設計 finding が、issue-refinement-loop の 1 周では「機械的な文言置換では対応できないため次回 iteration や issue-contract-review に委ねる」として処理未完のまま loop 終了した。4 系統の独立調査(現行アーキテクチャ監査 / 履歴監査 / impl-review-loop 比較監査 / Claude Code 公式仕様調査)と 3 回の独立設計レビュー(bootstrap semantic review / adversarial review / contract-regression review)を経て root cause と target architecture を確定した。本 Issue は tracking parent であり、実装は Child C(ADR)→ Child A(semantic design review lane 実装)→ Child B(docs 明文化)の順で 3 分割する。
Goal
issue-refinement-loop および関連 custom agent が、決定論的に処理できる領域(syntax / facts / invariants / routing mechanics / evidence collection / transactional mutation)は script へ委譲して token/context 予算を節約しつつ、AC・schema・architecture・workflow contract など決定論的に解けない領域では Claude Code の推論能力を積極的に使う構造へ修正され、「機械的に直せないので次回に委ねる」という形で semantic finding が未解決のまま処理完了扱いになる構造的欠陥(#2273 で実際に発生)が解消された状態。
Root cause(確定・repository evidence で検証済み)
issue-refinement-loopのcheck_issue_contract.py(C1-C13)とdecide_rewrite_route.pyは「Issue 本文の構文的完全性」のみを verdict/routing の入力にしている。decide_rewrite_route.pyの_REPAIRABLE_FIX_CATEGORIES = {"missing_section", "missing_contract_key", "unknown_contract_failure"}に意味論的カテゴリ(schema 設計判断、AC 完全性、architecture trade-off)は定義されていない。SKILL.mdは Step 3(adversarial review)を明示的に不採用と記載している(歴史的経緯は関連 Issue feat: impl-review-loop / issue-refinement-loop の Step 3 (adversarial review) を例外ゲート条件化する #428 参照。feat: impl-review-loop / issue-refinement-loop の Step 3 (adversarial review) を例外ゲート条件化する #428 は impl-review-loop と issue-refinement-loop の両方を対象とする scope であり、Child A(実装: issue-refinement-loop に Step 2.5 semantic design review lane を追加する #2296)は issue-refinement-loop 側の scope とのみ重複しうる。impl-review-loop 側の residual scope は Child A では扱われず、feat: impl-review-loop / issue-refinement-loop の Step 3 (adversarial review) を例外ゲート条件化する #428 を duplicate close または統合と判断する場合は impl-review-loop 側 scope を follow-up issue として別途起票する必要がある)。- anchor comment 処理(
references/anchor-comment-handling.md)は marker 配下の scope-delta(Allowed Paths 拡張)専用抽出であり、自由記述の設計批判を捕捉する汎用経路ではない。 - 終了ゲート(
decide_next_loop_action.py)はreview_verdictとiterationのみを見ており、anchor comment 指摘の未解消数は考慮されない。 - 結果、deterministic checker が
approve/goを返せば LLM(main thread)が「機械的に直せないので次回に委ねる」と自己申告して loop を正常終了させても、それを止める機構が存在しない(実装: Claude-GPT に workflow-profile capability preflight と controlled GitHub route を配線する #2273 で実際に発生した実例)。 - 歴史的検証(Issue/PR perf(claude): AI 運用コスト削減施策 — refinement-loop 軽量化 / Haiku 化 / output budget / SKILL.md 分割 #293/perf(claude): deterministic reviewer SubAgent を Haiku / script-first 化する #294/perf(claude): 全 SubAgent に OUTPUT_BUDGET_V1 出力制約を導入する #296 等): script-first 化の目的は純粋な usage コスト削減であり、semantic review を機械化・禁止する Owner Decision は存在しない。むしろ
pr-review-judgeの AC6(「Deterministic Processing Script の禁止事項」)は semantic finding の自動生成を script に禁止し、verdict は LLM(pr-reviewer)側に予約している——issue 側にはこの制度が単に一度も制度化されなかった(regression ではなく never-built gap)。
最重要原則(今回の設計判断の中心)
Deterministic code: facts/invariants/syntax/reproducible checks/routing mechanics/evidence collection/transactional mutation/race guards
LLM reasoning: semantics/architecture/requirement completeness/AC設計/schema設計/trade-offs/contradiction resolution/evidence interpretation/fix design
Orchestrator: context budgeting/delegation/result joining/bounded iteration/authority-aware escalation
deterministic に判定できないこと自体を human escalation の理由にしてはならない。LLM が repository evidence、外部一次資料、Owner Decision、Issue/PR history から十分な根拠を得て合理的に決定できるなら、LLM が判断・修正案作成まで担当する。human escalation は、複数の合理的設計案から Owner の価値判断が必要 / canonical Owner Decision 同士が矛盾 / authority 不足 / bounded 調査でも dispositive evidence 無し / Owner 明示要求、の genuinely human-only な場合に限定する。
Desired Destination
- Child C(ADR)が merge 可能な状態で確定している
- Child A(
issue-refinement-loopへの semantic design review lane 追加)が merge 可能な状態で実装されている - Child B(
impl-review-loop/pr-reviewer/pr-review-judge/pr-reviewer-liteの既存分離の docs 明文化)が merge 可能な状態で実装されている - 上記 3 child すべてが Closed(merge 済み)になった時点で本 parent を Closed にする
Current Validated Scope
このタイミングで write-capable に扱う範囲は「Child C / A / B の起票、および C→A→B の順序での blocked_by 関係の明示、#2273 への follow-up link の追記」のみ。3 child の実装内容そのものはそれぞれの child issue の Allowed Paths に閉じる。
Decisions Fixed
- 2026-08-22: root cause は「deterministic checker が構文的完全性のみを見ており、semantic design finding を capture・追跡する仕組みが一度も制度化されていない(never-built gap)」と確定した。
- 2026-08-22: 対応は 3 child(C: ADR、A: semantic design review lane 実装、B: 既存分離の docs 明文化)に分割し、順序を C→A→B(A は C 完了後着手、B は A 完了後着手)に固定した。
- 2026-08-22: semantic review の新規 SubAgent は Sonnet 5 に
effort: highを指定する(Claude Code 公式仕様 https://code.claude.com/docs/en/model-config#adjust-effort-level で対象 model への effort 指定が正式サポート済みと確認済み)。 - 2026-08-22: semantic review 追加は既存の
ISSUE_REVIEW_RESULT_COMPACT_V2(固定 11 行 wire)とLOOP_REWRITE_ROUTER_STATE_V1(additionalProperties:false)にフィールドを追加せず、新規 sidecar artifactsemantic_review_result_v1として分離する。 - 2026-08-22: Step 番号は「Step 2.5」を使い、過去に不採用となった「Step 3」(feat: impl-review-loop / issue-refinement-loop の Step 3 (adversarial review) を例外ゲート条件化する #428 の adversarial review 案)は再利用しない。
Quality Decision Record
Status: N/A(本 parent はdelivery-rollupでありquality-gateではない)Decision Date: N/ADoes this prove the parent goal complete?: N/AReason: N/AEvidence: N/ANext Action: N/A
Parent Closure Rule
delivery-rollup: Child C / Child A / Child B の 3 child issue すべてが Closed(対応 PR が merge 済み)になった時点で本 parent を close する。quality-gate/routing-map/decision-logは該当しないため N/A。- close 判定に quality-gate 系の Quality Decision Record は用いない(本 parent では N/A 扱いのまま close する)。
Child Issues
- Child C(実装: Deterministic Evidence vs Model-Based Semantic Judgment 原則を ADR として明文化する #2295)— normative ADR: 「Deterministic Evidence vs Model-Based Semantic Judgment」原則を
docs/adr/に明文化する - Child A(実装: issue-refinement-loop に Step 2.5 semantic design review lane を追加する #2296、実装: Deterministic Evidence vs Model-Based Semantic Judgment 原則を ADR として明文化する #2295 に blocked_by)—
issue-refinement-loopへの semantic design review lane(Step 2.5)追加 - Child B(実装: impl-review-loop の deterministic evidence vs semantic judgment 分離パターンを docs として明文化する #2297、実装: issue-refinement-loop に Step 2.5 semantic design review lane を追加する #2296 に blocked_by)—
impl-review-loop/pr-reviewer/pr-review-judge/pr-reviewer-liteの既存分離パターンの docs 明文化
Remaining Parent Gaps
- issue-refinement-loop 以外の skill(
review-issue等)への本原則の展開は本 parent の scope 外であり、必要ならさらなる follow-up として別途検討する - feat: impl-review-loop / issue-refinement-loop の Step 3 (adversarial review) を例外ゲート条件化する #428(Step 3 adversarial review の例外ゲート化、narrow 案)との関係整理: Child A(実装: issue-refinement-loop に Step 2.5 semantic design review lane を追加する #2296)が feat: impl-review-loop / issue-refinement-loop の Step 3 (adversarial review) を例外ゲート条件化する #428 の scope を上位互換する設計になった場合、feat: impl-review-loop / issue-refinement-loop の Step 3 (adversarial review) を例外ゲート条件化する #428 を Child A の重複として close するか、feat: impl-review-loop / issue-refinement-loop の Step 3 (adversarial review) を例外ゲート条件化する #428 の残存部分を Child A に統合するかを Child A(実装: issue-refinement-loop に Step 2.5 semantic design review lane を追加する #2296)実装時に判断する
Phase Handoff Contract
Desired Destination: 本文「Desired Destination」参照Current Validated Scope: 本文「Current Validated Scope」参照Remaining Parent Gaps: 本文「Remaining Parent Gaps」参照Current Objective: Child C→A→B の順序で起票し、C→A、A→B のblocked_by関係を native dependency として登録するBounded Current Context: 本 Issue 本文の Goal セクション(root cause / 最重要原則)と 実装: Claude-GPT に workflow-profile capability preflight と controlled GitHub route を配線する #2273 のコメント2件Normative References:.claude/skills/pr-review-judge/SKILL.mdAC6、.claude/agents/pr-reviewer-lite.md、.claude/skills/issue-refinement-loop/SKILL.md、docs/dev/agent-skill-boundaries.mdAllowed Paths: 各 child issue 起票時に個別に確定する(本 parent 自体は N/A)Required Skills: なし(本 parent はコード変更を含まない)Validation Commands: 本文「Acceptance Criteria」参照Stop Conditions: 本文「Acceptance Criteria」に付随する運用注記を参照(Child C が OWNER 判断でブロックされた場合、Child A/B の着手を保留する)Open Questions: feat: impl-review-loop / issue-refinement-loop の Step 3 (adversarial review) を例外ゲート条件化する #428 との統合要否(Child A 起票時に判断)Next Action: Child C(実装: Deterministic Evidence vs Model-Based Semantic Judgment 原則を ADR として明文化する #2295)の着手(OWNER 判断待ち)Artifact Refs: 実装: Claude-GPT に workflow-profile capability preflight と controlled GitHub route を配線する #2273 コメント(P0/P1 finding 一覧)Handoff Prompt Draft: N/A(tracking parent のため)Linked PR: N/A(tracking parent のため)
Acceptance Criteria
- AC1: Child A / B / C がそれぞれ起票されており、本 parent の Child Issues セクションに実際の Issue 番号が反映されている
- AC2: Child A が Child C を、Child B が Child A を
blocked_byとして native dependency 登録している(C→A→B の順序が GitHub 上で機械的に確認できる) - AC3: Child C(ADR)が OWNER 判断を経て
docs/adr/へ merge 可能な状態(PR が Draft/Ready を問わず作成され、CI green)になっている - AC4: 実装: Claude-GPT に workflow-profile capability preflight と controlled GitHub route を配線する #2273 に本 parent への follow-up link がコメントとして追記されている
- AC5: Child C / Child A / Child B すべてが Closed(対応 PR merge 済み)になった時点で本 parent が Closed になる
Notes
- Child C(実装: Deterministic Evidence vs Model-Based Semantic Judgment 原則を ADR として明文化する #2295)/ Child A(実装: issue-refinement-loop に Step 2.5 semantic design review lane を追加する #2296、blocked_by 実装: Deterministic Evidence vs Model-Based Semantic Judgment 原則を ADR として明文化する #2295)/ Child B(実装: impl-review-loop の deterministic evidence vs semantic judgment 分離パターンを docs として明文化する #2297、blocked_by 実装: issue-refinement-loop に Step 2.5 semantic design review lane を追加する #2296)は本 parent Issue 起票直後に issue-author(本 SubAgent)で連続起票済み。dependency は native GitHub dependency として read-back 確認済み。
- feat: impl-review-loop / issue-refinement-loop の Step 3 (adversarial review) を例外ゲート条件化する #428(OPEN, docs-only, narrow scope)は Child A(実装: issue-refinement-loop に Step 2.5 semantic design review lane を追加する #2296)と scope が重なる可能性があるため Related に記載し、統合要否は Child A 実装時に判断する(導入: AIエージェント運用をminimal harnessへ縮退し、過剰なcontrol-planeを廃止する #1860 Owner Decision により起票自体は停止しない)。
- 関連 Issue: 実装: Deterministic Evidence vs Model-Based Semantic Judgment 原則を ADR として明文化する #2295, 実装: issue-refinement-loop に Step 2.5 semantic design review lane を追加する #2296, 実装: impl-review-loop の deterministic evidence vs semantic judgment 分離パターンを docs として明文化する #2297
Activity
squne121 commentedon Aug 24, 2026
delivery-rollup parent の全 child issue が完了したため close します。
closure_mode: child-completeの条件を満たしたため、post-merge-cleanup(PR #2321 対象)の一環として本 Issue をクローズします。