Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "#384"
goal_ref: "Scope Collision Preflight を実装可能な段階へ進めるため、任意の SSOT 文書から bounded な section evidence を決定論的に返す基盤を確立する"
change_kind: workflowParent Issue
Parent Goal Ref
- Goal: Scope Collision の設計判断を SSOT に固定し、skill は必要な証拠だけを消費する作業手順層に保つ
- Desired Destination: section retrieval → collision evidence producer → impl-review-loop consumer wiring の順で、全文再読に依存しない preflight を構成する
Current Validated Scope
ssot-discoveryに任意の SSOT 文書・見出しを対象とする Markdown-aware section selector を追加する- selector の出力に commit 固定 provenance、section hash、行範囲、サイズ予算、reason code を含める
SSOT_DISCOVERY_RESULT_V1の optionalsection_limited_matchesを v1 互換で定義し、consumer inventory と未知 field の互換方針を明記する- fixture unit test と
docs/dev/workflow.mdintegration test を追加する
Remaining Parent Gaps
- 実装: issue-contract-review に scope_collision_check を JSON / script-first で追加する #387:
scope_collision_check/v1を evidence producer として固定し、follow-up(#948): check_issue_overlap と #387 scope_collision_check の path 正規化を統一する #973 の path normalization 収束先を確定する - 後続 consumer Issue: 実装: issue-contract-review に scope_collision_check を JSON / script-first で追加する #387 と本 Issue の出力を preparation / intake capsule で fail-closed に消費し、Step 1 前に routing する
Background
指定 anchor comment は、現行 #385 が retrieval evidence の返却だけを追加し、impl-review-loop の実行経路で消費しないため Outcome 未達になると指摘した。現状 match_ssot.py は文書単位の match と registry の静的 sections を返すだけで、見出し範囲・provenance・budget・schema 互換性を持たない。
最初の実装単位は Scope Collision 専用の自然言語 routing ではなく、任意の SSOT 文書から最小 section evidence を返す決定論的基盤である。本 Issue はその producer 基盤に限定する。collision の分類・path normalization・impl-review-loop の intake gate 配線は別責務として混在させない。
Outcome
ssot-discovery が Markdown-aware に選択した SSOT section を、commit 固定の provenance とサイズ予算付き section_limited_matches として返し、fixture と実文書のテストで再現可能に検証できる状態。
In Scope
match_ssot.pyに fenced code 内の偽 heading を除外し、ATX と Setext heading を扱う section selector を追加する- 選択 section を同階層以上の次 heading 直前までに限定し、
start_lineと exclusiveend_lineを返す source_commit、blob_sha、content_sha256、heading_level、permalink、selector_version、selection_reason_code、char_countを返す- 予算超過または section 未発見時は全文 fallback せず reason code を返す
section_limited_matchesの v1 optional-field 互換性、consumer inventory、document match と section no-match の status を output contract に固定する- fixture unit test と workflow.md integration test を追加する
ssot-discoverytest directory を python-test-plan のtargetsに登録し、python-test とci_test_selection/v1が同じ scope を実行・記録する
Out of Scope
- Scope Collision の
C0/C1/C2/C3、candidate_class、required_actionを判定すること - 実装: issue-contract-review に scope_collision_check を JSON / script-first で追加する #387 の
scope_collision_check、follow-up(#948): check_issue_overlap と #387 scope_collision_check の path 正規化を統一する #973 の path normalization 統一、または GitHub Issue 取得を実装すること - impl-review-loop の
preparation.md、intake capsule、LOOP_STATE、router への consumer wiring docs/dev/workflow.mdの policy 本文変更
Acceptance Criteria
- AC1: selector は fenced code 内の heading 風テキストを除外し、ATX と Setext heading の section 範囲を決定論的に返す
- AC2: section match は
source_commit、blob_sha、content_sha256、heading_level、start_line、end_line_exclusive、permalink、selector_version、selection_reason_code、char_countを含む - AC3:
section_limited_matchesはSSOT_DISCOVERY_RESULT_V1の optional field として output contract に定義され、consumer inventory と unknown field の互換方針を記録する - AC4: section 未発見または予算超過は全文 fallback をせず、machine-readable reason code を返す
- AC5: parser fixture test と
docs/dev/workflow.mdの section retrieval integration test が PASS する - AC6:
.claude/skills/ssot-discovery/tests/を python-test-plan のtargetsに含め、current-head のCI_CHECK_RUN_SCOPEDが実際の scope argv を検証する - AC7: python-test の parallel/serial lane union が scope と一致し重複しないことを、current-head の
CI_CHECK_RUN_SCOPEDで検証する - AC8:
ci_test_selection/v1artifact が python-test-plan の scope を使用し、変更された ssot-discovery test を uncovered にしないことを、current-head のCI_CHECK_RUN_SCOPEDで検証する - AC9: ssot-discovery と python-test-plan の Ruff E501 を含む静的解析を、current-head の
CI_CHECK_RUN_SCOPEDで検証する
AC6–AC9 の実レーン、artifact、Ruff の成功証跡は PR の current-head に束縛した CI_CHECK_RUN_SCOPED を正本とする。以下の VC は実行前の設定面を決定論的に確認する静的 assertion であり、CI lane をローカルで再生成・再実行しない。
Verification Commands
$ uv run --locked pytest .claude/skills/ssot-discovery/tests/test_section_selector.py -v # AC1
$ rg -n "source_commit" .claude/skills/ssot-discovery/scripts/match_ssot.py # AC2
$ rg -n "section_limited_matches" .claude/skills/ssot-discovery/references/output-contract.md # AC3
$ uv run --locked pytest .claude/skills/ssot-discovery/tests/test_section_selector.py -v # AC4
$ uv run --locked pytest .claude/skills/ssot-discovery/tests/test_section_selector.py -v # AC5
$ rg -n '"\.claude/skills/ssot-discovery/tests/"' .github/ci/python-test-plan.json # AC6
# baseline-expect: pass
$ rg -n '"parallel_exclude": \[\]' .github/ci/python-test-plan.json # AC7
$ rg -n '"\.claude/skills/ssot-discovery/tests/"' .github/ci/python-test-plan.json # AC8
# baseline-expect: pass
$ rg -n '"schema_version": "python_test_plan/v1"' .github/ci/python-test-plan.json # AC9Allowed Paths
.claude/skills/ssot-discovery/scripts/match_ssot.py.claude/skills/ssot-discovery/references/output-contract.md.claude/skills/ssot-discovery/tests/test_section_selector.py.claude/skills/ssot-discovery/tests/test_match_ssot_registry.py.github/ci/python-test-plan.json
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
Required Skills
- ci-test-performance
Required Design References
- docs/dev/workflow.md#Scope Collision Preflight
- docs/dev/agent-skill-boundaries.md
Runtime Verification Applicability
runtime_verification_applicability:
decision: not_applicable
rationale: Markdown section selector と YAML output contract の決定論的テストで完結し、UI または外部 runtime I/O は含まない。
verification_commands_ref: AC1-AC9Scope Delta(任意)
anchor comment の再分割判断に従い、consumer wiring を別 Issue に移し、本 Issue を汎用 section retrieval 基盤へ縮退する。
Source
- parent_issue: 実装: workflow.md の Allowed Paths overlap hard stop を Scope Collision Classification に置き換える #384
- producer_dependency: 実装: issue-contract-review に scope_collision_check を JSON / script-first で追加する #387
- normalization_follow_up: follow-up(#948): check_issue_overlap と #387 scope_collision_check の path 正規化を統一する #973
- anchor_comment: 実装: ssot-discovery に汎用 section retrieval evidence を追加する #385 (comment)
- dedupe_key: generic-ssot-section-retrieval-provenance-budget
Delivery Rule
1 Issue = 1 PR- Draft PR 既定
- 実装: issue-contract-review に scope_collision_check を JSON / script-first で追加する #387 は本 Issueの section evidence schema を consume する producer として後続する
- consumer wiring は本 Issue と 実装: issue-contract-review に scope_collision_check を JSON / script-first で追加する #387 の完了後に別 Issue として着手する
Activity
squne121 commentedon May 25, 2026
人間から指摘
「.claude/skills/impl-review-loop/steps/context-protocol-and-guardrails.md に、Scope Collision 判定では policy 正本の再解釈や全文読込を避け、section-limited evidence を使う guardrail を追加する」impl-review-loopはオーケストラレータ層であり、可能な限り判断などの作業は記載したくない。単純決定論的な処理以外(既存Issueを調査し、スコープ重複を調査する、ような)はサブエージェントに移譲したい。
「.claude/skills/ssot-discovery/scripts/match_ssot.py に、workflow.md の Scope Collision 関連キーワードに対して関連 section を優先抽出する routing を追加する」これは具体的にはどういうことだろうか。人間の意図としてはエージェントスキルを修正するときは運用設計ドキュメントをSSOTとして参照する、ゲーム開発においてはロジック設計書などをSSOTとして参照し、ドリフトしてないか確認する作業手順があるべきだと思っているが、全文参照や関係ないドキュメントを参照することはトークン消費やコンテクスト管理の観点から避けるべき。普遍的な話をしてる。
issue-contract-review にAC重複、AC重複後の詳細確認をAIエージェントフレンドリーに出力する処理を追加したらいいと思う。
squne121 commentedon May 25, 2026
.claude/skills/ssot-discovery/scripts/match_ssot.py に、workflow.md の Scope Collision 関連キーワードに対して関連 section を優先抽出する routing を追加する結論: 人間指摘は妥当です。#385 は少し責務が混線しています。
#385 本文では、impl-review-loop に「Scope Collision 判定では policy 正本全文ではなく section-limited evidence を使う guardrail」を追加する、とありますが、同時に skill 側では policy を再定義しない方針も書かれています。これは方向性としては正しい一方、書き方を誤ると impl-review-loop が Scope Collision の判断主体になる リスクがあります。#385 の Out of Scope では issue-contract-review への scope_collision_check 実装が明示的に除外されていますが、ユーザー指摘どおり、実際の重複検出・詳細確認はそちらへ寄せる方が設計として一貫します。
match_ssot.py の routing とは何か
具体的には、match_ssot.py に「入力キーワードが Scope Collision 系なら、docs/dev/workflow.md 全文ではなく、Scope Collision 関連 section だけを優先候補として返す」処理を入れる、という意味です。
現状の match_ssot.py は、registry の keyword/title/description、またはドキュメント本文・見出しにキーワードが含まれるかを見て、文書単位で matched_documents を返す構造です。sections は registry entry から取るだけで、入力意図に応じて workflow.md の特定 section を切り出す routing はありません。 出力契約も現状は matched_documents[].sections を返すだけで、section-limited retrieval の証拠構造や collision 用 evidence は未定義です。
したがって実装イメージはこうです。
input:
task_keywords:
- "Allowed Paths overlap"
- "Scope Collision"
- "C1"
- "C2"
routing:
detected_route: "workflow.scope_collision"
preferred_document: "docs/dev/workflow.md"
preferred_sections:
- "Scope Collision Preflight"
- "C0 no collision"
- "C1 benign overlap"
- "C2 ordered overlap"
- "C3 conflicting overlap"
output:
matched_documents:
- path: "docs/dev/workflow.md"
relevance: "high"
reason: "specialized route: workflow.scope_collision"
sections:
- "## Scope Collision Preflight"
- "### C0 no collision"
- "### C1 benign overlap"
- "### C2 ordered overlap"
- "### C3 conflicting overlap"
重要なのは、match_ssot.py は 判定しない ことです。やるべきことは「この作業に必要な SSOT section を最小抽出する」までです。これはゲーム開発でも同じで、たとえば「当たり判定」「ダメージ計算」「AI 状態遷移」などのキーワードから、ゲームロジック設計書の該当 section だけを返す。全文や無関係な設計書を読ませない。つまりこれは Scope Collision 専用というより、SSOT section routing の一般化です。
impl-review-loop に書くべき内容
impl-review-loop はオーケストレータなので、ここに collision 分類ロジックを書くべきではありません。
書くならこの程度です。
Scope Collision context guardrail
When Allowed Paths overlap or Scope Collision is suspected, the orchestrator MUST NOT reinterpret
docs/dev/workflow.mddirectly or load the full policy document.The orchestrator only performs deterministic routing:
ssot-discoverywith Scope Collision related keywords and target pathsThe orchestrator MUST NOT invent or restate C0/C1/C2/C3 policy text.
つまり AC1 は「impl-review-loop に Scope Collision の判定規則を書く」ではなく、impl-review-loop は section-limited evidence を要求し、判定主体へ委譲するという guardrail に修正すべきです。
issue-contract-review に寄せるべき処理
ユーザー案の「issue-contract-review に AC 重複、AC 重複後の詳細確認を AI エージェントフレンドリーに出力する処理を追加」はかなり妥当です。
置くべき責務は次です。
ISSUE_CONTRACT_REVIEW_RESULT_V1:
scope_collision_check:
status: ok | needs_review | blocked | skipped
current_issue: 385
compared_issues:
- issue: 384
state: closed
relationship: parent
- issue: 338
state: open
relationship: related_case
ただし、ここでも二段階に分けた方がよいです。
決定論的処理
Allowed Paths の完全一致・prefix overlap・AC テキスト類似・同じ parent/dedupe_key などを機械的に抽出する。
意味判断
C1 benign overlap なのか、C2 ordered overlap なのか、C3 conflicting overlap なのかは、必要なら subagent に委譲する。
つまり issue-contract-review は「候補抽出 + 証拠整形 + machine-readable handoff」を主責務にする。分類まで持たせる場合も、policy 本文を内蔵せず、ssot-discovery が返した section-limited evidence を入力にして判断する形にするべきです。
#385 の修正方針
#385 はそのままだとやや危険です。次のどちらかに整理するのがよいです。
案 A: #385 を最小 context routing Issue に絞る
#385 の責務を以下に限定します。
impl-review-loop は Scope Collision 時に全文読込・policy 再解釈を禁止する
impl-review-loop は ssot-discovery / issue-contract-review へ委譲する
ssot-discovery は Scope Collision 関連キーワードから docs/dev/workflow.md の該当 section を返す
output-contract.md は section-limited evidence を表現できるようにする
collision 判定・AC 重複検出は実装しない
この場合、#385 の Remaining Parent Gaps にある issue-contract-review follow-up を別 Issue として起票するのが自然です。
案 B: #385 を広げて issue-contract-review まで含める
ユーザーの現在の問題意識に合わせるなら、#385 の Allowed Paths を増やし、issue-contract-review の AC overlap / scope collision evidence 出力まで含める。ただしこれは #385 本文の Out of Scope と衝突します。現状 #385 は issue-contract-review 実装を明示的に除外しているため、こちらを選ぶなら Issue 契約の再作成が必要です。
私なら 案 A + follow-up Issue を推奨します。理由は、#385 は「SSOT section-limited retrieval の基盤整備」、follow-up は「Issue contract 同士の重複検出・AI agent friendly evidence 出力」と分けた方が、1 Issue = 1 PR に合います。
follow-up Issue 起票案
実装: issue-contract-review に Scope Collision / AC overlap evidence 出力を追加する
Goal
issue-contract-reviewが current issue と関連 open issue の Allowed Paths / Acceptance Criteria / parent relationship / dedupe_key を比較し、Scope Collision 判定に必要な候補証拠を machine-readable に出力できるようにする。Background
impl-review-loopはオーケストレータ層であり、Scope Collision の意味判断や AC 重複調査を抱え込むべきではない。一方で、Allowed Paths overlap や AC overlap を人間または agent が都度全文読込で確認する運用は token cost / context pollution / stale instruction carryover の原因になる。
そのため
issue-contract-reviewに、決定論的に抽出可能な overlap evidence を JSON/YAML で出力する処理を追加する。In Scope
scope_collision_checkを machine-readable に出力するssot-discoveryの section-limited evidence を入力として受け取れる形にするrecommended_next_actionを出力するOut of Scope
docs/dev/workflow.mdの policy 本文変更Acceptance Criteria
issue-contract-reviewがscope_collision_checkfield を出力するcollision_candidates,evidence_refs,recommended_next_actionが含まれる#385 へのコメント案
人間指摘を受けて、#385 の責務境界を再確認したいです。
impl-review-loopは orchestrator 層なので、Scope Collision の意味判断や policy 再解釈を持たせるべきではありません。ここに追加する guardrail は「判定規則」ではなく、以下の決定論的 routing に限定するのがよいです。docs/dev/workflow.md全文を読まないssot-discoveryに Scope Collision 関連 keyword / target paths を渡すssot-discoveryから section-limited evidence を受け取るissue-contract-reviewまたは専用 subagent に委譲するまた、
match_ssot.pyの routing は Scope Collision 専用の判断処理ではなく、SSOT section routing の一般化として扱うべきです。具体的には、入力 keyword が
Scope Collision,Allowed Paths overlap,C0,C1,C2,C3などに該当する場合、docs/dev/workflow.md全文ではなくScope Collision Preflight周辺 section を優先的にmatched_documents[].sectionsとして返す処理です。AC 重複や重複後の詳細確認は #385 に含めるより、follow-up として
issue-contract-reviewにscope_collision_checkを追加する Issue を切った方が責務分離に合います。最終判断としては、#385 は SSOT 最小読込・section routing の基盤整備に限定し、issue-contract-review の AC overlap / Scope Collision evidence 出力は別 Issue にするのが最も安全です。
squne121 commentedon May 25, 2026
結論
#385 は 現状のまま実装不可寄り です。方向性は正しいですが、Issue 本文が「低トークン・section-limited・script-first」を掲げながら、実際の AC / Allowed Paths が 自然言語 HOW 追記 と ssot-discovery への責務混入 に寄っています。
特に、人間コメントで「impl-review-loop はオーケストレーター層なので判断を書きたくない」「単純決定論的処理以外はサブエージェントに移譲したい」「issue-contract-review に AC 重複・詳細確認を AI エージェントフレンドリーに出力する処理を追加したらよい」と明示されています。これは #385 の AC1 / Outcome と衝突します。
さらに、すでに #387「issue-contract-review に scope_collision_check を JSON / script-first で追加する」が存在します。#387 は collision_candidates / candidate_class / required_action を JSON evidence として出す Issue であり、#385 が持つべきでない責務をかなり正しく切り出しています。
敵対的レビュー
#385 の Outcome は、impl-review-loop / ssot-discovery が collision_class / action / evidence_refs を扱える状態を求めています。
しかし #384 の workflow SSOT は、Skill / SubAgent を「設計判断の正本ではなく作業手順を伝える層」とし、SSOT 本文の長文重複を避け、必要 section / script / reference を段階的に読む progressive disclosure を優先すると定義しています。
このまま実装すると、impl-review-loop に「Scope Collision をどう判断するか」という半ポリシー・半判断ロジックが入りやすい。これは人間コメントの「オーケストレーターに判断を持たせたくない」と逆方向です。
修正方針: #385 の impl-review-loop 側は、判断ではなく「issue-contract-review の scope_collision_check evidence を取得・記録・停止/継続へ routing する」だけに落とすべきです。
#387 は scope_collision_check.py を追加し、OPEN implementation issue の Allowed Paths overlap を JSON evidence 化する Issue です。candidate_class / required_action / collision_candidates を出す設計になっています。
一方、#385 は #387 を Remaining Parent Gaps として残しながら、自身の AC3 で collision_class / action / evidence_refs の evidence 契約を要求しています。
これは producer が未実装のまま consumer / HOW を先に固定する構図です。
#384 本文は workflow 不具合では自然言語 workaround より script / checker / hook / CI、次に config / template / schema、最後に Skill / SubAgent 手順追記を優先すると定義しています。
修正方針: #387 の Delivery Rule にある Depends on #385 merge は逆にすべきです。
推奨は次です。
#387: issue-contract-review が scope_collision_check JSON evidence を出す
↓
#385: impl-review-loop / ssot-discovery がその evidence を section-limited に consume する
現行 match_ssot.py は docs/dev/ssot-registry.md を読み、keywords / paths から SSOT 文書を返す matcher です。出力も matched_documents / sections / unmatched_keywords / warnings / errors という retrieval contract です。
output-contract.md も SSOT_DISCOVERY_RESULT_V1 として、文書 path、relevance、reason、sections を返すだけの契約です。
ここに collision_class / action を追加すると、SSOT discovery が retrieval ではなく workflow decision を持つことになります。これは issue-contract-review / checker 側に切るべき責務です。
修正方針: ssot-discovery に追加してよいのは、せいぜい以下です。
section_limited_matches:
section_heading: "### Scope Collision Preflight"
start_line: 218
end_line: 245
evidence_refs:
collision_class / action は #387 の scope_collision_check か、caller 側の routing 結果として扱うべきです。
#385 の AC2 は「match_ssot.py が Scope Collision 関連キーワードに対して docs/dev/workflow.md の該当 section を優先的に返せる」としています。
しかし現行 match_ssot.py の sections は registry entry 由来の配列であり、実ファイルから該当 section の start/end line や excerpt を抽出しているわけではありません。
つまり、単に sections: ["Scope Collision Preflight"] を返しても、LLM は結局 docs/dev/workflow.md を開きに行く必要があります。
修正方針: AC2 は次のように変えるべきです。
match_ssot.py --keywords "Scope Collision"がdocs/dev/workflow.mdのScope Collision Preflightsection についてsection_heading/start_line/end_line/evidence_refを返す可能なら excerpt は短く制限する。全文読込回避が目的なので、section line range だけでなく、caller が最小範囲を sed -n 等で読める contract が必要です。
#385 は .claude/skills/ssot-discovery/scripts/match_ssot.py を変更対象に含みますが、tests / fixtures は Allowed Paths にありません。
これは #338 で問題視された「自然言語追記に流れる」「決定論的 checker / fixture-driven test に閉じない」構図と同じです。#338 の人間指摘は「自然言語指示での解決ではなく、トークン消費を抑えた解決方法、スクリプトによる決定論的解決を優先」でした。
修正方針: match_ssot.py を変更するなら、最低限 tests / fixtures を Allowed Paths に追加するべきです。
.claude/skills/ssot-discovery/scripts/tests/
.claude/skills/ssot-discovery/scripts/tests/fixtures/
または、#385 では script を触らず、#387 側の checker 実装に寄せるべきです。
WEB 調査による補強
Claude Code Skills の公式 docs は、Skill 本体は使われる時だけ読み込まれ、長い reference は必要時だけ読む設計が token cost を抑えると説明しています。また、複雑な skill では supporting files を使って SKILL.md を focused に保ち、詳細 reference や scripts は必要時だけ読むべきとしています。
同じ docs では、SKILL.md 本文は一度 load されると context に残るため、body は concise にし、細部は supporting files に逃がすべきとも説明されています。
GitHub CLI 側も gh issue view に --json / --jq / --comments を提供しており、Issue body / labels / comments を machine-readable に抽出する実装方針は公式機能で支えられます。
また gh issue list も --json / --jq / --search / --state を持つため、OPEN issue の candidate 抽出は script-first にできます。
したがって、#385 の「全文 SSOT を読まない」方向性は正しい。ただし、実装は impl-review-loop の自然言語 guardrail ではなく、issue-contract-review / helper script / structured output を優先すべきです。
#385 の修正版方針
推奨判断
#385 は本文更新してから実装。
または、#387 を先に実装してから #385 を consumer HOW-layer Issue に縮退する。
変更すべき契約
Current Validated Scope の修正案
.claude/skills/impl-review-loop/steps/context-protocol-and-guardrails.mdに、Scope Collision 判定を orchestrator が再解釈しないこと、
issue-contract-reviewのscope_collision_checkevidence を consume すること、evidence 不在時は human escalation / follow-up にすることを短く追記する
.claude/skills/ssot-discovery/scripts/match_ssot.pyには、Scope Collision 関連 keyword に対して
docs/dev/workflow.mdの section heading / line range / evidence_ref を返すsection-limited retrieval を追加する
.claude/skills/ssot-discovery/references/output-contract.mdには、retrieval evidence の field contract だけを追加する。
collision_class/actionは持たせないAC 修正案
AC1: impl-review-loop の context protocol は Scope Collision を独自判断せず、
issue-contract-reviewの structured evidence を consume する方針だけを記載しているAC2:
match_ssot.py --keywords "Scope Collision"がdocs/dev/workflow.mdの該当 section についてsection_heading/start_line/end_line/evidence_refを返すAC3:
output-contract.mdにsection_limited_matchesまたは同等の retrieval evidence schema があるAC4:
collision_class/actionはssot-discoveryの責務外であり、issue-contract-reviewまたは caller evidence として扱うことが明記されているAC5: skill 側の追記は HOW に限定され、
docs/dev/workflow.mdの policy を重複再定義していないAC6: section-limited retrieval の fixture-driven test が存在し PASS する
Allowed Paths 修正案
.claude/skills/impl-review-loop/steps/context-protocol-and-guardrails.md
.claude/skills/ssot-discovery/scripts/match_ssot.py
.claude/skills/ssot-discovery/scripts/tests/
.claude/skills/ssot-discovery/scripts/tests/fixtures/
.claude/skills/ssot-discovery/references/output-contract.md
起票・本文修正用コメント案
#385 は現状のまま実装すると、Scope Collision 判断を impl-review-loop / ssot-discovery に戻してしまい、#384 の「Skill / SubAgent は設計判断の正本ではなく作業手順層」「自然言語 workaround より script / checker / schema を優先」と衝突する。
人間コメントでも、impl-review-loop はオーケストレーター層なので判断を持たせず、issue-contract-review に AC 重複・詳細確認を AI agent friendly に出力する処理を追加する方針が示されている。
修正方針:
impl-review-loopは Scope Collision を再解釈せず、issue-contract-reviewの structured evidence を consume するssot-discoveryはcollision_class/actionを出さず、section heading / line range / evidence_ref など retrieval evidence だけを出すcollision_class/required_actionは 実装: issue-contract-review に scope_collision_check を JSON / script-first で追加する #387 のscope_collision_check側に寄せる追加で、
match_ssot.pyを変更するなら tests / fixtures を Allowed Paths に追加する必要がある。最終判断
#385 の目的は妥当です。しかし、現在の契約は 「全文読込回避」問題を、また自然言語 HOW に押し戻す危険 があります。
実装前に必ずやるべきことは 3 点です。
collision_class / action を ssot-discovery から外す。
impl-review-loop は判断せず、structured evidence の consume / routing に限定する。
実装: issue-contract-review に scope_collision_check を JSON / script-first で追加する #387 を先行または同時に整合させ、script-first evidence producer を確定する。
この修正なしで PR を作ると、#384 / #338 で繰り返し潰してきた「自然言語手順追加による設計退行」になります。
squne121 commentedon May 25, 2026
issue-refinement-loop により本文を更新しました。今回の変更点は次のとおりです。
impl-review-loopが Scope Collision を独自判断しないことを明記ssot-discoveryの責務を retrieval evidence に限定し、collision_class/required_actionなどの workflow decision field を 実装: ssot-discovery に汎用 section retrieval evidence を追加する #385 から除外match_ssot.py変更に対応する既存ssot-discovery/testsの regression test を Allowed Paths / AC / VC に追加squne121 commentedon Jul 11, 2026
敵対的レビュー結論
Verdict: REQUEST_CHANGES / 現行契約のまま実装開始は NO-GO
目的自体は妥当です。
impl-review-loopに判断ロジックを持たせず、必要な SSOT 節と構造化判定結果だけを消費させる設計は、Claude Code / Agent Skills の progressive disclosure と整合します。公式仕様でも、SKILL.mdは起動時に読み込まれる一方、references/やscripts/は必要時だけ利用する構造が推奨されています。([Agent Skills]1)しかし、2026年7月11日時点の #385 は、「証拠を返す」部分だけ追加し、実際にその証拠を preflight で強制消費する経路がないため、ACをすべて満たしても Outcome を達成しない契約です。Issue は現在も open で、紐づくブランチやPRはありません。([GitHub]2)
Blocker 1:
impl-review-loopの変更が実行経路に接続されない#385 の Allowed Paths では、
impl-review-loop側はsteps/context-protocol-and-guardrails.mdへの文言追加しか許可されていません。([GitHub]2)ところが現在の実装では、
context-protocol-and-guardrails.mdは LOOP_STATE 更新、SubAgent 出力、外部調査記録しか持たない。impl-review-loop/SKILL.mdはこのファイルを手順一覧の最後、8番目に置いている。preparation.mdの intake capsule とnext_action.routeで Step 1 前に確定する。したがって AC1/AC5 の文言を追加しても、preparation、LOOP_STATE、intake capsule、contract snapshot parser のいずれも
scope_collision_checkを読みません。最悪の場合、
rgは全て PASS する一方、ループは従来どおり Scope Collision evidence を無視して実装を開始します。必要な変更は少なくとも以下です。
impl-review-loop/SKILL.mdsteps/preparation.mdbuild_intake_capsule.pyまたは snapshot normalizerevaluate_scope_collision_gate.py相当の決定論的 router現行 Allowed Paths と Stop Conditions は、これらの必要変更を検出した時点で実装を停止させるため、Issue contract 自体が Outcome と両立していません。
Blocker 2:
target pathから Scope Collision 節を選ぶ規則が存在しない現在の
match_ssot.pyは文書単位の検索です。sectionsは registry に静的に書かれた一覧をそのまま返すmatched_documents[].sectionsまでで、節単位 evidence はない。さらに
docs/dev/ssot-registry.mdの workflow entry には、Scope Collision Preflightが代表 section として登録されていません。そのため AC2 の「Scope Collision 関連 keyword / target path 入力」は曖昧です。
Scope Collisionがあれば本文検索で推定可能.claude/skills/...の target path だけでは、workflow.md のどの節を選ぶか決定できないowner comment で示された意図は「ゲームロジック設計書などにも使える普遍的な最小節読込」ですが、現行 AC は Scope Collision 専用特殊ルートに固定されています。Issue 本文もその責務混線を認識しています。([GitHub]2)
Scope Collision を最初の fixture とする汎用 section selector に変更すべきです。
Blocker 3:
evidence_refが監査証拠として成立していないAC2 は以下しか要求していません。
section_headingstart_lineend_lineevidence_refしかし、
evidence_refの形式と不変条件が未定義です。不足している項目は次です。
end_lineが inclusive / exclusive のどちらか行番号だけでは main 更新後に別内容を指します。GitHub公式でも、特定版への永久参照には branch 名ではなく commit ID を使い、特定行範囲と組み合わせるよう案内しています。([GitHub Docs]3)
最低限、次のような契約が必要です。
Blocker 4: machine-readable schema 変更なのに互換性判断がない
SSOT_DISCOVERY_RESULT_V1は producer と consumer の境界を越える YAML contract です。リポジトリの schema governance でも、この種の machine-readable contract は schema と定義されています。現在の output contract は
matched_documents[].sectionsを定義しています。#385 はここへ
section_limited_matches(または同等 field)を追加しますが、以下がありません。V1に optional field を追加するのかV2にするのかstatusリポジトリの review gate は schema change で consumer inventory が欠ける場合、approval禁止と定義しています。
または同等 fieldは Acceptance Criteria として不適切です。実装者ごとに異なる schema が成立します。Blocker 5: #385 と #387 の依存順が逆
#385 は #387 未完了でも着手可能とし、structured evidence がなければ stop / human escalation としています。([GitHub]2)
一方、#387 は
scope_collision_checkの field contract と preflight wiring を実装する producer Issueです。この順序では #385 の consumer は、
という半実装になります。
さらに後発の #948 / PR #967 により、起票前 overlap 用の別 producer
ISSUE_OVERLAP_PREFLIGHT_RESULT_V1が既に実装されています。#973 は、#948 と #387 の path normalization が別実装になり、判定 drift を起こし得ることを明示しています。
#385 は現在のリポジトリ状態に合わせて、受理する producer schema、優先順位、provenance を再定義する必要があります。
Major 1: Markdown 節抽出を正規表現だけで実装すると壊れる
現在の見出し検索は
^#+\s+に依存しています。CommonMark では、
します。([CommonMark仕様]4)
単純な行 regex では、コード例中の
## Scope Collisionを本物の heading と誤認したり、ネストした節の終端を誤ったりします。次のどちらかを契約化すべきです。
現状はどちらでもありません。
Major 2: 「最小コンテクスト」が計測不能
line range metadata を返すだけでは、実際に全文を読まない保証になりません。
必要なのは例えば以下です。
max_chars/max_lineschar_countsection_too_largeClaude Code公式も、supporting filesを必要時だけ読む構造は推奨していますが、skill 本文は一度ロードされるとセッション中に残り続けます。したがって削減効果を得るには、どのファイルを用意したかではなく、consumer が何文字ロードしたかを制御する必要があります。([Claude]5)
Major 3: Verification Commands が存在確認に偏りすぎている
現在の VC は大半が
rgで文字列の存在を確認し、実動作は-k scope_collisionの1テストだけです。([GitHub]2)これでは以下を検証できません。
fixture-freeの実文書テストは残してよいですが、parser unit fixtures + real-document integration + impl-review-loop routing integration の三層が必要です。Major 4: 後発の詳細設計書と同期しない
#385 起票後、
docs/dev/workflows/impl-review-loop-design.mdが追加されています。この文書は LOOP_STATE、Failure Modes、Artifact/Evidence Contract、control-plane/data-plane境界を記録しています。同文書の change management は、LOOP_STATEやSubAgent contract変更時に canonical sourceとの同期を要求しています。
Scope Collision preflightを実動作させるなら、この設計書への反映が必要になる可能性が高いですが、#385の Allowed Pathsには含まれていません。
推奨する再分割
現在の #385 を一つの PR で処理するより、次の依存順に変更する方が安全です。
A. 汎用 SSOT section retrieval
Scope Collision専用ではなく、任意の文書・headingを対象とする selectorを実装します。
B. #387 structured collision producer
scope_collision_check/v1C. impl-review-loop consumer wiring
AとBの両方に依存させます。
依存関係は次が妥当です。
修正版ACに最低限必要なもの
schema_version / source_commit / blob_sha / heading_level / end_line_exclusive / content_sha256 / reason_codeを含める。impl-review-looppreparationがstructured evidenceを実際にparseし、continue | wait | stop_human | refresh_contract_snapshot | refresh_ssot_evidenceを返す。runtime_verification_applicability: not_applicableはUIや対話ランタイムを要求しないという意味では維持できます。ただし、「rgと単体pytestだけで完結する」という現在の rationale は撤回し、決定論的な end-to-end integration testを必須にすべきです。最終判断: #385 は close不要ですが、現行本文をそのまま implementer に渡すべきではありません。汎用 retrieval と consumer wiringを分離し、#387/#973との依存順、schema provenance、実行経路、検証方法を修正してから再度 contract review に通す必要があります。
[-]実装: impl-review-loop / ssot-discovery に Scope Collision の最小コンテクスト読込手順を追加する[/-][+]実装: ssot-discovery に汎用 section retrieval evidence を追加する[/+]squne121 commentedon Jul 11, 2026
Refinement Loop: Approved
The issue has been approved and is ready for implementation.
approvedsqune121 commentedon Jul 11, 2026
Contract Review Result
squne121 commentedon Jul 11, 2026
Contract Review Result
fix: #385 pin SSOT section evidence to HEAD