Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "#1674"
goal_ref: "issue-refinement-loop planner が OPEN Issue 間の重複・依存順・実装優先順位判定を ISSUE_EXECUTION_DECISION_V1(relation の versioned graph)として出力し、LOOP_STATE・handoff・termination report まで同一 digest で到達させ、downstream skill が再判定せずに consume できる状態にする"
change_kind: codeParent Issue
Parent Goal Ref
- Goal: issue-refinement-loop を、OPEN Issue 間の重複・吸収候補・依存順・実装優先順位判定の唯一の場所(SSOT)にする。impl-review-loop 開始前にこの判定は完了している前提とする
- Desired Destination:
ISSUE_EXECUTION_DECISION_V1が、Issue relation を versioned graph として表現し、issue-refinement-loop の planner から LOOP_STATE・handoff・termination report まで同一 digest で到達している状態
Current Validated Scope
- .claude/skills/issue-refinement-loop/scripts/plan_refinement_loop.py の plan 出力に
ISSUE_EXECUTION_DECISION_V1フィールドを追加する - .claude/skills/issue-refinement-loop/scripts/plan_issue_scope_rollup.py が既に持つ scope rollup preflight 結果(ISSUE_SCOPE_ROLLUP_PLAN_V2)を relation graph 判定の入力として利用する
- .claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py に scope-rollup artifact を planner input へ結合する producer/join を追加する(現行は target Issue snapshot・planner input・refinement result のみ永続化しており、この結合が欠落している)
- .claude/skills/issue-refinement-loop/scripts/build_loop_state.py・schemas/loop_state.schema.json に
ISSUE_EXECUTION_DECISION_V1の投影フィールドを追加する(additionalProperties: falseを維持したまま拡張) LOOP_HANDOFF_RESULT_V1schema・termination report producer/parser に同フィールドを追加する- 対応する schema ファイル・SKILL.md handoff 記述・fixture/テストの更新
Remaining Parent Gaps
- SSOT docs(docs/dev/scope-rollup-policy.md 等)の「停止系」から「実行優先順位を選ぶ planning SSOT」への再定義(実装: scope-rollup-policy を停止系SSOTから実行優先順位を選ぶplanning SSOTへ再定義する #1675、先行)
- issue-contract-review を fresh structural gate に縮小する対応(実装: issue-contract-review を fresh structural gate に縮小し、OPEN PR の実編集競合のときだけ停止させる #1680)
- impl-review-loop / implement-issue 側の重複判定撤去(実装: impl-review-loop preparation から scope rollup preflight(Step 2.5)を除去し、issue-refinement-loop の判定を再実行しない #1676・実装: implement-issue / open-pr の production path から peer OPEN Issue overlap preflight を撤去する #1679)
- target head 生成後の pairwise merge simulation・GitHub mergeability の fail-closed retry routing(Phase D、未起票)
Canonical Contract Freeze(#1674/#1675/#1677 共通)
PR #1700 のレビューで指摘された schema/consumer 不整合を実装時に再発させないため、本 Issue が ISSUE_EXECUTION_DECISION_V1 の canonical owner として次の契約を凍結する。#1675 の static schema はこの契約の入力成果物であり、#1702 の runtime waiver はこの契約の外側で扱う(#1675 本文は変更しない)。
正規化 decision model
ISSUE_EXECUTION_DECISION_V1:
schema_version: "ISSUE_EXECUTION_DECISION_V1"
identity:
target_issue_number: integer
target_body_sha256: "sha256:<64 lowercase hex>"
generated_at: RFC3339_UTC
collection_digest: "sha256:<64 lowercase hex>"
nodes: # issue_number 昇順・重複禁止
- issue_number: integer
body_sha256: "sha256:<64 lowercase hex>"
relations: # (source_issue_number,target_issue_number,relation_type) 昇順・重複禁止
- source_issue_number: integer
target_issue_number: integer
relation_type: depends_on | duplicate | absorb | supersedes | coordinates
evidence: [non-empty string]
execution:
state: selected | deferred | blocked | duplicate
target_issue_number: integer
predecessors: [integer] # target に入る depends_on と整合
defer_reason: string | null # deferred/blocked では必須
downstream_policy:
semantic_reclassification: forbidden
freshness_validation: required
stale_action: rerun_issue_refinement
completeness:
issues_complete: boolean
dependencies_complete: boolean
unresolved_references: [integer]relation_type は source → target の有向関係であり、self-edge、未知 endpoint、同一 endpoint の矛盾する parallel edge、depends_on cycle を禁止する。target は nodes に存在し、predecessors は target に入る depends_on edge の集合と一致する。selected は未解決 predecessor がなく、deferred/blocked は理由と未完了 predecessor(または safety blocker)を持ち、duplicate は duplicate/absorb relation を少なくとも 1 件持つ。issues_complete=false または dependencies_complete=false、若しくは unresolved_references 非空の場合、selected を許可しない。
Normative schema と validator boundary
配布成果物は JSON Schema + normative semantic validator の組とする。
- JSON Schema (
schemas/issue_execution_decision_v1.schema.json) は required key、型、enum、RFC3339/date-time、additionalProperties: false、配列要素の形を閉じて検証する。 - semantic validator (
scripts/validate_issue_execution_decision.py) は順序・一意性・endpoint・self-edge・parallel edge・cycle・target/predecessor/state/completeness の cross-field invariant とcollection_digestの canonical preimage を検証する。 - producer(planner/preflight join)、
build_loop_state.py、handoff parser、termination report、及び downstream consumer は 同じ schema validator と semantic validator の両方を呼び、テスト専用 helper を検証 authority として使用しない。invalid fixture は validator が拒否することを確認する。
Migration / compatibility
旧 graph.nodes/graph.edges + execution.target_state/predecessor_issue_numbers/reason_codes は adapter 入力としてのみ受け付け、canonical output は常に上記 V1 へ正規化する。旧→新の mapping は edges.relation → relations[].relation_type、target_state → execution.state(planned は deferred)、predecessor_issue_numbers → execution.predecessors、reason_codes → defer_reason とする。移行 phase は dual_write | equivalence | dual_read | new_authoritative | legacy_removed とし、equivalence では canonicalized digest が一致しない限り fail-closed、migration_required: yes とする。legacy identifier と ISSUE_EXECUTION_DECISION_V1 の双方を consumer compatibility inventory に明記し、V1 が authoritative になった後のみ legacy を削除する。
この節、schema、validator、fixtures、LOOP_STATE/handoff/termination projection は同一 digest を共有するため、後続 Issue が別 enum・別 field 名・別 migration phase を導入してはならない。
Outcome
.claude/skills/issue-refinement-loop/scripts/plan_refinement_loop.py(またはこれが呼び出す該当 planner script)の plan 出力スキーマに ISSUE_EXECUTION_DECISION_V1(relations 配列・execution.state・predecessors・defer_reason・source completeness・target body hash・collection digest を持つ versioned graph。単数の relation_summary / selected_predecessor ではない)が追加され、かつ run_refinement_preflight.py → build_loop_state.py → LOOP_HANDOFF_RESULT_V1 → termination report まで同一 digest で到達することが production test で確認され、少なくとも「対象 Issue を優先実装する」「predecessor 完了待ちで defer する」「duplicate/absorb candidate として扱う」の 3 種の fixture がテストで検証されている状態
In Scope
- .claude/skills/issue-refinement-loop/scripts/plan_refinement_loop.py の plan 出力拡張(
ISSUE_EXECUTION_DECISION_V1の追加。relations は配列とし、1つの Issue が複数 Issue に対して異なる relation・複数 predecessor・coordination edge を持てるようにする) - .claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py に scope-rollup artifact(
plan_issue_scope_rollup.pyの出力)を planner input へ結合する producer/join を追加 - .claude/skills/issue-refinement-loop/scripts/build_loop_state.py・schemas/loop_state.schema.json への
ISSUE_EXECUTION_DECISION_V1投影フィールド追加 LOOP_HANDOFF_RESULT_V1schema・termination report producer/parser への同フィールド追加- downstream consumer inventory(impl-review-loop・issue-contract-review・implement-issue・open-pr のうち、本フィールドを読む予定の consumer 一覧)の記録
- .claude/skills/issue-refinement-loop/SKILL.md の handoff 記述更新(downstream skill が本判定を再実行しない契約の明記)
- .claude/skills/issue-refinement-loop/references/ 配下の該当ドキュメント更新
- fixture/テストの追加(最低 3 種: 優先実装対象・predecessor 完了待ち・duplicate/absorb candidate。加えて producer→LOOP_STATE→handoff→termination report の digest 一貫性を検証する end-to-end fixture を最低 1 種追加)
Out of Scope
- SSOT docs(docs/dev/scope-rollup-policy.md / docs/dev/workflow.md)の方針再定義そのもの(実装: scope-rollup-policy を停止系SSOTから実行優先順位を選ぶplanning SSOTへ再定義する #1675)
- issue-contract-review の structural gate 縮小(実装: issue-contract-review を fresh structural gate に縮小し、OPEN PR の実編集競合のときだけ停止させる #1680)
- impl-review-loop preparation Step 2.5 の scope-rollup-runner 再実行の撤去(実装: impl-review-loop preparation から scope rollup preflight(Step 2.5)を除去し、issue-refinement-loop の判定を再実行しない #1676)
- implement-issue の check_implementation_overlap.py 撤去(実装: implement-issue / open-pr の production path から peer OPEN Issue overlap preflight を撤去する #1679)
- scope rollup preflight の実行エンジンそのものの書き換え
- target head 生成後の pairwise merge simulation の実装(Phase D、未起票の別Issue)
Acceptance Criteria
- AC1: .claude/skills/issue-refinement-loop/scripts/plan_refinement_loop.py の plan 出力に
ISSUE_EXECUTION_DECISION_V1.relations(配列。各要素は issue_number・relation・evidence を持つ)が機械可読フィールドとして含まれる - AC2: 同 plan 出力に
execution.state(selected / deferred / blocked / duplicate)・execution.predecessors(配列)・execution.defer_reasonが含まれる - AC3: impl_ready な plan 出力に
downstream_policy(semantic_reclassification: forbidden・freshness_validation: required・stale_action: rerun_issue_refinement)ブロックが含まれる - AC4:
run_refinement_preflight.pyが scope-rollup artifact を planner input へ結合し、結合後のISSUE_EXECUTION_DECISION_V1がbuild_loop_state.pyの出力する LOOP_STATE に同一 digest で反映されることが production test で確認できる - AC5:
LOOP_HANDOFF_RESULT_V1と termination report に同一 digest のISSUE_EXECUTION_DECISION_V1参照が含まれることが production test で確認できる - AC6: 「対象 Issue を優先実装する(execution.state: selected)」の fixture が追加され、対応するテストが PASS する
- AC7: 「predecessor 完了待ち(execution.state: blocked, predecessors 非空)」の fixture が追加され、対応するテストが PASS する
- AC8: 「duplicate/absorb candidate(relations に relation: duplicate または absorb を含む)」の fixture が追加され、対応するテストが PASS する
- AC9: .claude/skills/issue-refinement-loop/SKILL.md に、downstream skill(impl-review-loop・implement-issue・issue-contract-review・open-pr)へ「semantic relation を再分類しない」ことを示す handoff 契約が明記されている
- AC10:
schemas/issue_execution_decision_v1.schema.jsonが上記の正規化モデル(relations[].relation_type、execution.state、downstream_policy、completeness、digest provenance)を closed schema として定義し、legacy identifier を compatibility metadata に列挙する - AC11:
scripts/validate_issue_execution_decision.pyが normative semantic validator として配布され、node/relation sort・一意性・endpoint・self-edge・parallel edge・3-nodedepends_oncycle・target/predecessor/state/completeness の各 invalid fixture を fail-closed で拒否する - AC12: planner/preflight、LOOP_STATE builder、handoff parser、termination report、downstream consumer が schema validator と semantic validator を共通利用し、test-only
validate_graph_invariants()に依存しない - AC13: legacy graph shape の adapter mapping と
dual_write | equivalence | dual_read | new_authoritative | legacy_removedmigration phase が文書・fixture・consumer inventory で一致し、equivalence digest 不一致を拒否する - AC14:
downstream_policy(semantic_reclassification=forbidden、freshness_validation=required、stale_action=rerun_issue_refinement)と selected/deferred/blocked/duplicate の state semantics が valid/invalid fixture で検証される
Verification Commands
# AC1
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_plan_refinement_loop_priority.py::test_relations_field_present
# AC2
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_plan_refinement_loop_priority.py::test_execution_state_fields_present
# AC3
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_plan_refinement_loop_priority.py::test_downstream_policy_present
# AC4
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_run_refinement_preflight_scope_rollup_join.py
# AC5
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_loop_handoff_execution_decision_digest.py
# AC6
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_plan_refinement_loop_priority.py::test_execution_state_selected_fixture
# AC7
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_plan_refinement_loop_priority.py::test_execution_state_blocked_fixture
# AC8
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_plan_refinement_loop_priority.py::test_relations_duplicate_fixture
# AC9
$ rg -n "semantic relation を再分類しない" .claude/skills/issue-refinement-loop/SKILL.md
# AC10
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_issue_execution_decision_schema.py
# AC11
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_issue_execution_decision_semantic_validator.py
# AC12
$ rg -n "validate_issue_execution_decision" .claude/skills/issue-refinement-loop/scripts/plan_refinement_loop.py
# AC13
$ rg -n "equivalence" .claude/skills/issue-refinement-loop/SKILL.md
# AC14
$ rg -n "downstream_policy" .claude/skills/issue-refinement-loop/SKILL.mdAllowed Paths
- .claude/skills/issue-refinement-loop/SKILL.md
- .claude/skills/issue-refinement-loop/scripts/plan_refinement_loop.py
- .claude/skills/issue-refinement-loop/scripts/plan_issue_scope_rollup.py
- .claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py
- .claude/skills/issue-refinement-loop/scripts/build_loop_state.py
- .claude/skills/issue-refinement-loop/scripts/render_termination_report.py
- .claude/skills/issue-refinement-loop/scripts/decide_next_loop_action.py
- .claude/skills/issue-refinement-loop/scripts/validate_issue_execution_decision.py
- .claude/skills/issue-refinement-loop/schemas/
- .claude/skills/issue-refinement-loop/references/
- .claude/skills/issue-refinement-loop/tests/
- .claude/skills/issue-refinement-loop/fixtures/
- scripts/agent-guards/tests/test_skill_runtime_preflight_bytecode_cache.py
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合。特に REFINEMENT_LOOP_PLAN_V1・LOOP_STATE_V1・LOOP_HANDOFF_RESULT_V1(または後継スキーマ)を破壊せずに付加できず、schema major 更新が必要になった場合は人間判断を仰ぐ
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- SSOT docs(scope-rollup-policy.md 等、実装: scope-rollup-policy を停止系SSOTから実行優先順位を選ぶplanning SSOTへ再定義する #1675)の再定義が先に必要と判明した場合は、依存 Issue として明記し直し人間判断を仰ぐ
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
Required Skills
なし
Required Design References
- docs/dev/agent-skill-boundaries.md
- .claude/skills/issue-refinement-loop/SKILL.md
Scope Delta(任意)
- 拡張日: 2026-07-26
- 追加ファイル:
.claude/skills/issue-refinement-loop/scripts/render_termination_report.py/.claude/skills/issue-refinement-loop/scripts/decide_next_loop_action.py/.claude/skills/issue-refinement-loop/scripts/validate_issue_execution_decision.py - 理由: PR 実装: issue-refinement-loop planner に execution_priority と relation_summary を追加する (#1677) #1767(本 Issue の実装 PR)のレビューで、AC11(
scripts/validate_issue_execution_decision.pyを normative semantic validator として独立配布すること)と AC12(producer/preflight/LOOP_STATE builder/handoff parser/termination report/downstream consumer が同一の schema validator + semantic validator を共通利用すること)を実際に満たすには、render_termination_report.py(LOOP_HANDOFF_RESULT_V1の実際の producer)とdecide_next_loop_action.py(downstream consumer の一つ)への変更、および新規ファイルvalidate_issue_execution_decision.py(AC11 が要求する独立配布物)が必要と判明したが、当初の Allowed Paths に含まれていなかった。 - 承認: リポジトリ所有者本人が承認済み。
- 追加拡張: PR 実装: issue-refinement-loop planner に execution_priority と relation_summary を追加する (#1677) #1767 のレビューで、
scripts/agent-guards/tests/test_skill_runtime_preflight_bytecode_cache.pyの real-subprocess契約テストが、隔離repoへコピーする production script の固定リスト(run_refinement_preflight.py/plan_refinement_loop.py/command_registry.py/repair_issue_contract.py)を保持しており、本 Issue で新規追加したscripts/validate_issue_execution_decision.pyをplan_refinement_loop.pyが import しているにもかかわらずコピーリストに含まれていないため import が常に失敗し、既存7テストが決定論的に regression していることが判明した。修正は当該コピーリストへvalidate_issue_execution_decision.pyを追加する1行の機械的変更のみであり、Allowed Paths にscripts/agent-guards/tests/test_skill_runtime_preflight_bytecode_cache.pyを追加する。
Runtime Verification Applicability
本 Issue の変更対象はワークフロー文書・スクリプトのみです。ゲームの実行時動作には影響しません。
decision: not_applicable
reason: "Workflow documentation and script changes only. No runtime game behavior changed."Delivery Rule
- 1 Issue = 1 PR
- 作業は isolation worktree で行う
- Draft PR を既定とする
Dependencies
- 導入: OPEN Issue 重複・依存順・実装優先順位判定を issue-refinement-loop に一元化する #1674 は親 Issue。実装: scope-rollup-policy を停止系SSOTから実行優先順位を選ぶplanning SSOTへ再定義する #1675 は static schema の整合性を確認する参照 Issue、実装: open-pr の ordered/outbound-only waiver consumer を fail-closed 化する #1702 は runtime waiver の参照 Issue であり、本 Issue の着手を停止する predecessor ではない。
- 本 Issue が
ISSUE_EXECUTION_DECISION_V1の canonical owner として field/enum/validator/migration を凍結し、実装: scope-rollup-policy を停止系SSOTから実行優先順位を選ぶplanning SSOTへ再定義する #1675 の schema consumer と後続 実装: impl-review-loop preparation から scope rollup preflight(Step 2.5)を除去し、issue-refinement-loop の判定を再実行しない #1676/実装: implement-issue / open-pr の production path から peer OPEN Issue overlap preflight を撤去する #1679 がこの契約を参照する。
Notes for Reviewer
- 本 Issue は 導入: OPEN Issue 重複・依存順・実装優先順位判定を issue-refinement-loop に一元化する #1674 の OWNER レビュー(2026-07-23、P0-3対応)を反映した改訂版。旧版の単数
relation_summary/selected_predecessorを配列ベースのISSUE_EXECUTION_DECISION_V1に変更し、run_refinement_preflight.py・build_loop_state.py・loop_state.schema.json・LOOP_HANDOFF_RESULT_V1・termination report producer/parser を Allowed Paths に追加した。これらの配線がないと、planner が JSON にフィールドを追加するだけでは後続 skill が読む artifact に反映されない(OWNER 指摘 P0-3)。 - overlap preflight(check_issue_overlap.py)で allowed_paths_overlap(C1)判定を受けた。issue-refinement-loop 配下の共有ファイル(SKILL.md・scripts/plan_refinement_loop.py・scripts/plan_issue_scope_rollup.py 等)は多数の既存 OPEN Issue と広く重複するが、いずれも別関心事(command_registry・reviewer_claim_replay・taxonomy 等)を扱っており、本 Issue の
ISSUE_EXECUTION_DECISION_V1追加とは scope が異なると判断した。
Activity
squne121 commentedon Jul 22, 2026
Scope Collision (C1): overlap preflight(check_issue_overlap.py)が allowed_paths_overlap を検出した。issue-refinement-loop 配下の共有ファイル(SKILL.md・scripts/plan_refinement_loop.py・scripts/plan_issue_scope_rollup.py・schemas/・references/・tests/ 等)は以下の既存 OPEN Issue と Allowed Paths が重複する: #1675, #1601, #1564, #1556, #1555, #1322, #1321, #1309, #1288, #1093, #1007, #1006, #998, #997, #995, #944, #926, #917, #667, #666, #138, #129, #32, #30
いずれも別関心事(scope-rollup-policy 再定義・command_registry 統合・taxonomy split-brain 解消・schema 単体変更等)を扱っており、本 Issue の execution_priority/relation_summary フィールド追加とは scope が異なると判断した。うち #1675 は本 Issue の先行子 Issue として Dependencies に明記済み。他の候補は独立した並行変更として扱う。
ISSUE_1677_OVERLAP_C1_MARKER
squne121 commentedon Jul 25, 2026
判定
REQUEST_CHANGES — 現状のままでは実装着手不可です。
重大度は P0×8、P1×5、P2×2 と判定します。
設計方針そのもの、すなわち「semantic planning は
issue-refinement-loopが一度だけ決定し、downstream は fadiness だけを再確認する」という責務分離は妥当です。また、JSON Schema と cross-field semantic validator を分離する方針も正しいです。問題は、完全で信頼できる入力スナップショットと決定的なclassifierがないまま、decisionを同一digestで下流へ運ぶ部分だけが精密化されていることです。このまま実装すると、誤ったsemantic decisionを改変なく正確に全consumerへ配布するシステムになり得ます。
PR #1700は静的schemaとdocsだけをmainへ入れ、planner、semantic validator、LOOP_STATE、handoff、termination reportを変更していません。PR本文自身も、#1677の契約照合とruntime projectionにP0 blockerが残ると明記しています。
P0 — マージ阻害事項
P0-1. 「Canonical Contract Freeze」が自己矛盾している
凍結された正規モデルには、次しかありません。
identity: target number/body hash/generated_at/collection_digestnodesrelationsexecutiondownstream_policycompletenessしかし同じIssueのOutcomeは
policy_versionを要求し、AC10はdigest provenanceとlegacy compatibility metadataを要求しています。さらにAC1とAC8は、正規モデルのsource_issue_number/target_issue_number/relation_typeではなく、旧形式に見えるissue_number/relationを要求しています。現在mainにあるclosed schemaには、
policy_version、producer/policy provenance、canonicalization ID、consumer compatibility、legacy identifier、入力digestとartifact digestの分離がありません。additionalProperties: falseなので、これらを実装するには「凍結したキー集合」を変更する必要があります。一方、Stop Conditionsは固定契約の変更やschema major更新が必要なら停止するよう要求しています。つまり実装者は、ACを満たそうとすると停止条件へ到達します。
必須修正
V1はすでにmainへ配布されているため、原則として
ISSUE_EXECUTION_DECISION_V2に上げるべきです。V1を置換するなら、「まだruntime authoritativeではないためcutover前のbreaking replacementを許可する」という例外規則を、#1674、#1675、#1677、docs、schemaへ同時に記録してください。また、Issue本文中の手書きschemaを正本にせず、1個のcanonical valid fixtureを正本として、ACはJSON Pointerで参照する形に変えるべきです。
P0-2. 入力に指定されたartifactは存在せず、現行producerはsemantic decisionを生成できない
#1677は
plan_issue_scope_rollup.pyが既にISSUE_SCOPE_ROLLUP_DECISION_V2を出す前提ですが、実際の定数はISSUE_SCOPE_ROLLUP_PLAN_V2です。出力内容もdecisionではなく、候補ごとの以下の情報です。
lexical/structural signals
confidence
suggested action
scope context
ordering constraint
明示的な
depends_on、duplicate、absorb、supersedesrelationは生成していません。特に
_determine_ordering_constraint()はdocstring上ではcurrent_firstとcandidate_firstを列挙していますが、実装上はparallel_okまたは順序未定のsequential_requiredしか返しません。これでは有向predecessorを決定できません。さらに現行producerはIssue候補とPR候補を一つの配列へ連結しますが、
ISSUE_EXECUTION_DECISION_V1.nodesはIssue番号しか表現できません。PR候補をどのIssue nodeへ対応させるのかも未定義です。親Issueはscope-rollup実行エンジンの書き換えを非ゴールにしています。しかし、現行出力からcanonical relation graphを作るには、実質的にclassifierとproducerの書き換えが必要です。
必須修正
次のどちらかを契約として選択してください。
#1677のIn Scopeへ、scope-rollup producer/classifierの再設計を正式に追加する。
collector/classifierを別Issueへ分離し、#1677は完成済みのsemantic inputを受け取るprojection Issueへ縮小する。
OPEN PRはsemantic Issue graphから除外し、必要なら
advisory_observationsとして別namespaceに置くべきです。PRの実競合は親Issueの方針どおり、commit生成後のGit conflict observerで扱うべきです。P0-3. source completenessとfreshnessを検証できない
現行scope-rollupは、入力JSONのparse warningがなければ
completeness="full"とします。GitHub側の総件数、pagination、limit到達、saturation、取得クエリは検証していません。run_refinement_preflight.pyが現在永続化するのも、target Issue snapshot、planner input、refinement resultだけです。scope-rollup artifactとの同時点スナップショットや、join時のreadback整合はありません。一方、decision nodeが持つのはIssue番号とbody SHAだけです。以下が欠けています。
repository stable ID
repository full name
Issue node ID
updated_atOPEN/CLOSED state
authoritative comment snapshot
native
blockedBy/blockingcollector query
pagination manifest
collected count / total count
saturation flag
policy version/hash
GitHubのnative Issue dependencyは
blockedByとblockingのIssueConnectionとして公開され、cursor paginationが必要です。Issue本文だけをhashしてもnative dependency変更は検知できません。(GitHub Docs)また、#1677の唯一のコメント自体が多数のIssueを「独立」「#1675だけ先行」と意味分類していますが、そのコメントのID、body hash、updatedAtはdecision sourceに含まれません。コメントだけが変更された場合、target body SHAは変わりません。
必須修正
source_manifestを追加し、少なくとも以下を必須化してください。各nodeにも
state、updated_at、body hash、authoritative comments hash、native dependency snapshotを持たせる必要があります。target snapshotとrollup snapshotのjoin時には、target number/body hash/updatedAt/repository IDが一致しなければfail-closedにしてください。
P0-4.
collection_digestだけではdecision改ざんを検出できない現行モデルの唯一のdigestは
collection_digestです。これは名前上、入力collectionのdigestであり、graphやexecution decisionそのもののdigestではありません。このdigestをLOOP_STATE、handoff、termination reportへそのまま運んでも、途中で以下を書き換えられます。
relationsexecution.statepredecessorsdownstream_policy入力collectionが変わっていなければ
collection_digestは同じままです。現行scope-rollupにもdigest方式が二つあり、入力はraw JSON文字列連結のhash、payloadはPythonの
json.dumps(sort_keys=True, ...)を使っています。後者は明示的にRFC 8785を採用していません。暗号学的hashや署名に使うJSONは、producerとconsumerで完全に同一のbyte representationを生成できる必要があります。RFC 8785 JCSはI-JSON制約、ECMAScript primitive serialization、決定的なproperty orderingを定義する既存方式です。採用は必須ではありませんが、単なるPython
sort_keys=Trueを異言語consumer共通の仕様と見なすことはできません。(RFC Editor)必須修正
digestを最低3種類へ分離してください。
意味は次のように固定します。
Digest | Preimage | 用途 -- | -- | -- source_manifest_sha256 | 完全なsource manifest | 収集入力の同一性 semantic_decision_sha256 | graph/execution/policy。時刻・wrapperを除外 | legacy/new equivalence artifact_sha256 | self-hash fieldを除くartifact全体 | projection途中の改ざん検出また、handoffへ何を入れるかを固定してください。
digestだけ
full decision
content-addressed artifact reference
digestだけではdownstreamがrelationsを読めず、local pathだけでは別sessionへ引き継げません。推奨は、canonical decision全体をhandoffへ埋め込み、digestを再計算して検証する方式です。
P1-3. 既存の強いcollector/provenance実装を再利用する計画がない
check_implementation_overlap.pyには、すでに次の実装があります。native dependency統合
predecessor実state確認
saturation検出
fail-closed completeness
candidate body/updatedAt検証
repository binding
pagination
decision_inputs_sha256と時刻を含むevidence hashの分離path一致だけをduplicate十分条件にしないclassifier
親Issueも、#1652のprovenance/classifier部分を新upstream producerへ移植するか、明示的にsupersedeするよう要求しています。
#1677には、この移植先・再利用単位・削除順序がありません。このまま新しい粗いcollectorを作ると、安全性が後退します。
修正
#1677のIn Scopeに、以下を明記してください。
P1-4. Verification Commandsが実装の存在しか証明しない
AC13とAC14はSKILL.mdの文字列検索だけです。AC12もplanner一ファイルへの関数名検索です。これでは以下を検出できません。
consumerがvalidatorを呼ばない
validation errorを無視する
digestを再計算しない
stale artifactを継続する
legacy/new mismatchを受理する
partial collectionでselectedを返す
target以外のduplicate edgeでtargetをduplicate扱いする
projection途中のrelation改ざん
unsafe decision後にmutationを実行する
修正
最低限、以下のnegative production testsをAC化してください。
pagination incomplete
repository mismatch
target body drift
authoritative comment drift
native dependency drift
policy hash drift
invalid/non-UTC timestamp
self-edge
unknown endpoint
contradictory edge
3-node cycle
target/predecessor mismatch
legacy/new digest mismatch
LOOP_STATE projection tamper
handoff projection tamper
invalid artifact時にdownstream mutation関数が未呼び出し
rgはinventory補助には使えますが、ACの主証跡にしてはいけません。P1-5. schema
$idが配布artifactの識別子として不安定issue_execution_decision_v1.schema.json、loop_state.schema.json、loop_handoff_result_v1.jsonはrelative$idを使っています。JSON Schema 2020-12では、root schemaはabsolute URIの
$idを持つことが推奨され、relative IDは読み込み元のbase URIに依存します。(JSON Schema)修正
ネットワーク配布しないならURNで十分です。
Draft-07と2020-12を混在させる場合は、共有validatorが
$schemaに応じて正しいvalidatorを選ぶcross-draft testも必要です。P2 — 整理事項
P2-1. Issue titleが破棄済みの旧設計を示している
Issue titleは現在も「
execution_priorityとrelation_summaryを追加する」ですが、本文では単数フィールドを廃止してversioned graphへ変更済みです。検索、重複検出、エージェントの初期理解を誤らせるため、次へ変更すべきです。
P2-2. overlap commentとDependenciesがドリフトしている
コメントは#1675を「先行子Issue」と分類していますが、現在のDependencies節は#1675を「着手を停止するpredecessorではない」としています。PR #1700はすでにmerge済みなので、正しい表現は「先行dependencyは充足済み」です。
また、コメント内の多数の並行可否判定にはcandidate body hash、updatedAt、collection digest、policy versionがありません。新契約のartifactとして再生成するか、非authoritativeなhistorical noteへ格下げしてください。
推奨する契約形状
現在の不足を埋めるなら、V2は次の程度まで明示する必要があります。
修正版Acceptance Criteria案
Contract reconciliation
Issue本文、canonical fixture、JSON Schema、docsのfield名・enum・migration phaseが完全一致する。
Complete source manifest
repository binding、query、pagination、total count、saturation、native dependency、authoritative commentを収集し、一件でも不完全なら
selectedを返さない。Deterministic classifier
relationごとの方向、targetへの作用、互換性matrixを固定し、path overlap単独ではduplicate/depends_onを生成しない。
Semantic state invariants
target identity、node state、predecessor state、duplicate canonical target、safety namespaceを検証する。
Digest contract
source、semantic decision、artifactのdigestを分離し、canonicalization vectorsを配布する。
Legacy adapter
strict parse→validation→normalization→semantic validation→digestの順で処理し、新旧不一致を拒否する。
Producer projection
planner→preflight result→LOOP_STATE→handoff→termination reportで、full decisionとartifact digestが一致する。
Consumer ownership boundary
#1677ではconsumer inventoryまでとし、実consumer呼び出しは実装: impl-review-loop preparation から scope rollup preflight(Step 2.5)を除去し、issue-refinement-loop の判定を再実行しない #1676/実装: implement-issue / open-pr の production path から peer OPEN Issue overlap preflight を撤去する #1679/実装: issue-contract-review を fresh structural gate に縮小し、OPEN PR の実編集競合のときだけ停止させる #1680/open-pr migrationで検証する。
Freshness regression
body、updatedAt、authoritative comment、native dependency、new OPEN Issue、policy versionの各driftでrerouteする。
Fail-closed mutation denial
schema、semantic、freshness、digestのいずれかが失敗した場合、後続mutation関数が一度も呼ばれない。
推奨検証コマンドは、文字列検索ではなく次の構成です。
最終結論
#1677は、projection実装Issueとしての方向は正しいものの、decision authorityとして必要なcollector・classifier・freshness・integrity契約が未完成です。
特に次の4点を解消するまでは、Claude CodeやCodex CLIへ実装を委ねるべきではありません。
V1を修正するのかV2へ上げるのか決定する
ISSUE_SCOPE_ROLLUP_PLAN_V2からsemantic graphを作る責務と方式を確定するrepository binding・pagination・updatedAt・comment・native dependencyを含むsource manifestを追加する
#1677内部projectionと、後続consumer migrationのACを分離する
現状のIssueをそのまま実行すると、固定契約変更・scope-rollup engine変更・downstream path変更のいずれかが不可避で、明記されたStop Conditionsにより実装者は停止するのが正しい挙動です。
# 判定REQUEST_CHANGES — 現状のままでは実装着手不可です。
重大度は P0×8、P1×5、P2×2 と判定します。
設計方針そのもの、すなわち「semantic planning は
issue-refinement-loopが一度だけ決定し、downstream は fadiness だけを再確認する」という責務分離は妥当です。また、JSON Schema と cross-field semantic validator を分離する方針も正しいです。問題は、完全で信頼できる入力スナップショットと決定的なclassifierがないまま、decisionを同一digestで下流へ運ぶ部分だけが精密化されていることです。このまま実装すると、誤ったsemantic decisionを改変なく正確に全consumerへ配布するシステムになり得ます。
PR #1700は静的schemaとdocsだけをmainへ入れ、planner、semantic validator、LOOP_STATE、handoff、termination reportを変更していません。PR本文自身も、#1677の契約照合とruntime projectionにP0 blockerが残ると明記しています。
P0 — マージ阻害事項
P0-1. 「Canonical Contract Freeze」が自己矛盾している
凍結された正規モデルには、次しかありません。
identity: target number/body hash/generated_at/collection_digestnodesrelationsexecutiondownstream_policycompletenessしかし同じIssueのOutcomeは
policy_versionを要求し、AC10はdigest provenanceとlegacy compatibility metadataを要求しています。さらにAC1とAC8は、正規モデルのsource_issue_number/target_issue_number/relation_typeではなく、旧形式に見えるissue_number/relationを要求しています。現在mainにあるclosed schemaには、
policy_version、producer/policy provenance、canonicalization ID、consumer compatibility、legacy identifier、入力digestとartifact digestの分離がありません。additionalProperties: falseなので、これらを実装するには「凍結したキー集合」を変更する必要があります。一方、Stop Conditionsは固定契約の変更やschema major更新が必要なら停止するよう要求しています。つまり実装者は、ACを満たそうとすると停止条件へ到達します。
必須修正
V1はすでにmainへ配布されているため、原則として
ISSUE_EXECUTION_DECISION_V2に上げるべきです。V1を置換するなら、「まだruntime authoritativeではないためcutover前のbreaking replacementを許可する」という例外規則を、#1674、#1675、#1677、docs、schemaへ同時に記録してください。また、Issue本文中の手書きschemaを正本にせず、1個のcanonical valid fixtureを正本として、ACはJSON Pointerで参照する形に変えるべきです。
P0-2. 入力に指定されたartifactは存在せず、現行producerはsemantic decisionを生成できない
#1677は
plan_issue_scope_rollup.pyが既にISSUE_SCOPE_ROLLUP_DECISION_V2を出す前提ですが、実際の定数はISSUE_SCOPE_ROLLUP_PLAN_V2です。出力内容もdecisionではなく、候補ごとの以下の情報です。
明示的な
depends_on、duplicate、absorb、supersedesrelationは生成していません。特に
_determine_ordering_constraint()はdocstring上ではcurrent_firstとcandidate_firstを列挙していますが、実装上はparallel_okまたは順序未定のsequential_requiredしか返しません。これでは有向predecessorを決定できません。さらに現行producerはIssue候補とPR候補を一つの配列へ連結しますが、
ISSUE_EXECUTION_DECISION_V1.nodesはIssue番号しか表現できません。PR候補をどのIssue nodeへ対応させるのかも未定義です。親Issueはscope-rollup実行エンジンの書き換えを非ゴールにしています。しかし、現行出力からcanonical relation graphを作るには、実質的にclassifierとproducerの書き換えが必要です。
必須修正
次のどちらかを契約として選択してください。
OPEN PRはsemantic Issue graphから除外し、必要なら
advisory_observationsとして別namespaceに置くべきです。PRの実競合は親Issueの方針どおり、commit生成後のGit conflict observerで扱うべきです。P0-3. source completenessとfreshnessを検証できない
現行scope-rollupは、入力JSONのparse warningがなければ
completeness="full"とします。GitHub側の総件数、pagination、limit到達、saturation、取得クエリは検証していません。run_refinement_preflight.pyが現在永続化するのも、target Issue snapshot、planner input、refinement resultだけです。scope-rollup artifactとの同時点スナップショットや、join時のreadback整合はありません。一方、decision nodeが持つのはIssue番号とbody SHAだけです。以下が欠けています。
updated_atblockedBy/blockingGitHubのnative Issue dependencyは
blockedByとblockingのIssueConnectionとして公開され、cursor paginationが必要です。Issue本文だけをhashしてもnative dependency変更は検知できません。([GitHub Docs]1)また、#1677の唯一のコメント自体が多数のIssueを「独立」「#1675だけ先行」と意味分類していますが、そのコメントのID、body hash、updatedAtはdecision sourceに含まれません。コメントだけが変更された場合、target body SHAは変わりません。
必須修正
source_manifestを追加し、少なくとも以下を必須化してください。各nodeにも
state、updated_at、body hash、authoritative comments hash、native dependency snapshotを持たせる必要があります。target snapshotとrollup snapshotのjoin時には、target number/body hash/updatedAt/repository IDが一致しなければfail-closedにしてください。
P0-4.
collection_digestだけではdecision改ざんを検出できない現行モデルの唯一のdigestは
collection_digestです。これは名前上、入力collectionのdigestであり、graphやexecution decisionそのもののdigestではありません。このdigestをLOOP_STATE、handoff、termination reportへそのまま運んでも、途中で以下を書き換えられます。
relationsexecution.statepredecessorsdownstream_policy入力collectionが変わっていなければ
collection_digestは同じままです。現行scope-rollupにもdigest方式が二つあり、入力はraw JSON文字列連結のhash、payloadはPythonの
json.dumps(sort_keys=True, ...)を使っています。後者は明示的にRFC 8785を採用していません。暗号学的hashや署名に使うJSONは、producerとconsumerで完全に同一のbyte representationを生成できる必要があります。RFC 8785 JCSはI-JSON制約、ECMAScript primitive serialization、決定的なproperty orderingを定義する既存方式です。採用は必須ではありませんが、単なるPython
sort_keys=Trueを異言語consumer共通の仕様と見なすことはできません。([RFC Editor]2)必須修正
digestを最低3種類へ分離してください。
意味は次のように固定します。
source_manifest_sha256semantic_decision_sha256artifact_sha256generated_at、invocation UUID、evidence順序、Unicode、number serialization、self-hash除外規則を明記したconformance vectorsも必要です。独自canonicalizationを維持する場合は、canonicalization_idとbyte-level fixtureを配布してください。P0-5. relationの方向と意味が曖昧で、consumer間で必ず解釈が分裂する
Issueは「relationはsource→target」とし、
predecessorsをtargetへ入るdepends_onedgeと定義しています。これは実質的に、という意味です。
しかし
A depends_on Bは通常、「AがBへ依存する」、つまりdependent→prerequisiteと読まれます。名前と方向が逆です。さらに以下も未定義です。
duplicate: duplicate側からcanonical側か、その逆かabsorb: absorbed側からowner側か、その逆かsupersedes: newからoldか、oldからnewかcoordinates: 対称関係を一方向でどうcanonicalizeするか「semantic reclassification禁止」を掲げても、relation解釈が未定義なら各consumerが独自解釈することになります。
必須修正
V2ではrelation名自体を方向が明白なものへ変更するのが安全です。
precedesduplicate_ofabsorbed_bysupersedescoordinates_with既存enumを維持する場合でも、上記相当のdirection tableとtarget-specific invariantをschema referenceに固定してください。
evidence: [string]だけでなく、少なくともkind、source_ref、snapshot_sha256を持つ構造化evidenceにすべきです。P0-6.
selected / deferred / blocked / duplicateの状態モデルが矛盾しているIssue Outcomeでは「predecessor完了待ちでdefer」と説明していますが、AC7は同じケースを
execution.state: blockedとしています。さらに本文は
blockedが未完了predecessorまたはsafety blockerを持つと説明します。しかしcanonical SSOTではsemantic planningとquality/security/permission等のsafety gateを別namespaceへ分離しています。nodeにOPEN/CLOSED stateがないため、semantic validatorは「predecessorが未完了か」をartifact単独では証明できません。現在のschema testでは、relationが
coordinatesのままなのにpredecessors=[1677]を持つblocked fixtureがschema validationを通過します。これはsemantic validator未実装を示すfixtureとしては理解できますが、現行static contractだけでは状態を検証不能です。また、
duplicateはgraph内のどこかにduplicate/absorb relationが1件あればよく、target Issue自身がそのrelationへ参加する必要が明記されていません。必須修正
semantic planningとsafety gateを分けてください。
最低限、次をsemantic invariantにします。
identity.target_issue_number == execution.target_issue_numberselectedはsource completeかつOPEN predecessorなしdeferredはOPEN predecessorが1件以上duplicateはtargetがduplicate_ofまたはabsorbed_byのsourceで、canonical Issueが明示されるP0-7. legacy adapterはlossyで、equivalenceを証明できない
旧形式の
reason_codes[]を新形式の単一defer_reasonへ移すmappingはlossyです。複数code、順序、machine-readable semanticsを失います。また、旧
target_state=plannedを無条件にdeferredへ写す規則は、旧plannedが「selected ready」を含んでいた場合に意味を変えます。未定義なのは次です。
異なる構造のraw digest同士は一致しません。equivalenceで比較できるのは、両方を同一canonical modelへ正規化した後のsemantic digestだけです。
必須修正
処理順を次に固定してください。
新旧両方が存在する場合は、両方をcanonical化し
semantic_decision_sha256が完全一致した場合だけ受け入れ、不一致ならfail-closedにします。reason_codesは新契約でも配列として保持すべきです。P0-8. AC12はAllowed Paths上、達成不可能
AC12はplanner/preflight、LOOP_STATE builder、handoff parser、termination report、downstream consumer が共通validatorを呼ぶことを要求しています。
しかしAllowed Pathsは
issue-refinement-loop配下だけです。impl-review-loop、implement-issue、issue-contract-review、open-prは含まれません。しかもOut of Scopeではそれらconsumerの変更を別Issueへ明示的に残しています。それにもかかわらずAC12のVerification Commandは、plannerに関数名があるかを
rgするだけです。downstream consumerがvalidatorを呼んでいることは一切検証しません。親IssueもPhase Bをproducer/handoff、Phase Cをconsumer migrationとして分けています。
必須修正
#1677のACを以下へ限定してください。
downstreamが実際に共通validatorを呼ぶACは、#1676、#1679、#1680、open-pr migration Issueへ移してください。
親#1674のend-to-end ACだけが、全consumer統合後に「同じdigestで到達した」と判定する構造が正しいです。
P1 — 必須改善事項
P1-1. RFC3339 UTC検証がfail-openになり得る
現在のstatic schema testは
jsonschema.validate()をformat checkerなしで呼びます。したがってformat: date-timeは検証されません。JSON Schema 2020-12では
formatassertionは標準で無効です。Pythonjsonschemaも、format checkerを渡さなければ検証せず、date-timecheckerには追加dependencyrfc3339-validatorが必要です。dependencyがなければcheckerが成功扱いになる場合があります。(JSON Schema)このリポジトリのpyprojectは
jsonschema>=4.0のみで、format extrasまたはrfc3339-validatorを直接宣言していません。さらにIssueは
RFC3339_UTCを要求しますが、JSON Schemaのdate-timeはUTCのZだけでなくoffsetも受け入れます。修正
共通validator内で、dependencyに依存しないstrict parserを一つだけ実装し、以下を拒否してください。
+09:00など非UTC offsetzcanonical outputは常に
YYYY-MM-DDTHH:MM:SS[.fraction]Zに限定します。現在、preflightとtermination rendererがそれぞれ独自date validatorを持っているため、それらも共通validatorへ統合すべきです。
P1-2. projection先の実体と互換性判断が不足している
現在の
LOOP_STATE_V1はDraft-07のclosed schemaであり、scope_rollup_decisionはobjectではなく単なるstringです。builderも固定4 decisionしか必須入力として認識しません。LOOP_HANDOFF_RESULT_V1もclosed schemaで、execution decision用フィールドはありません。また、repo検索でtermination report rendererは確認できますが、Issue本文がいう専用の「handoff parser / termination report parser」の具体的ファイルを特定できませんでした。
修正
consumer inventoryを、次の列を持つ機械可読fixtureにしてください。
また、handoffへ何を入れるかを固定してください。
digestだけではdownstreamがrelationsを読めず、local pathだけでは別sessionへ引き継げません。推奨は、canonical decision全体をhandoffへ埋め込み、digestを再計算して検証する方式です。
P1-3. 既存の強いcollector/provenance実装を再利用する計画がない
check_implementation_overlap.pyには、すでに次の実装があります。decision_inputs_sha256と時刻を含むevidence hashの分離親Issueも、#1652のprovenance/classifier部分を新upstream producerへ移植するか、明示的にsupersedeするよう要求しています。
#1677には、この移植先・再利用単位・削除順序がありません。このまま新しい粗いcollectorを作ると、安全性が後退します。
修正
#1677のIn Scopeに、以下を明記してください。
P1-4. Verification Commandsが実装の存在しか証明しない
AC13とAC14はSKILL.mdの文字列検索だけです。AC12もplanner一ファイルへの関数名検索です。これでは以下を検出できません。
修正
最低限、以下のnegative production testsをAC化してください。
rgはinventory補助には使えますが、ACの主証跡にしてはいけません。P1-5. schema
$idが配布artifactの識別子として不安定issue_execution_decision_v1.schema.json、loop_state.schema.json、loop_handoff_result_v1.jsonはrelative$idを使っています。JSON Schema 2020-12では、root schemaはabsolute URIの
$idを持つことが推奨され、relative IDは読み込み元のbase URIに依存します。(JSON Schema)修正
ネットワーク配布しないならURNで十分です。
Draft-07と2020-12を混在させる場合は、共有validatorが
$schemaに応じて正しいvalidatorを選ぶcross-draft testも必要です。P2 — 整理事項
P2-1. Issue titleが破棄済みの旧設計を示している
Issue titleは現在も「
execution_priorityとrelation_summaryを追加する」ですが、本文では単数フィールドを廃止してversioned graphへ変更済みです。検索、重複検出、エージェントの初期理解を誤らせるため、次へ変更すべきです。
P2-2. overlap commentとDependenciesがドリフトしている
コメントは#1675を「先行子Issue」と分類していますが、現在のDependencies節は#1675を「着手を停止するpredecessorではない」としています。PR #1700はすでにmerge済みなので、正しい表現は「先行dependencyは充足済み」です。
また、コメント内の多数の並行可否判定にはcandidate body hash、updatedAt、collection digest、policy versionがありません。新契約のartifactとして再生成するか、非authoritativeなhistorical noteへ格下げしてください。
推奨する契約形状
現在の不足を埋めるなら、V2は次の程度まで明示する必要があります。
修正版Acceptance Criteria案
Contract reconciliation
Issue本文、canonical fixture、JSON Schema、docsのfield名・enum・migration phaseが完全一致する。
Complete source manifest
repository binding、query、pagination、total count、saturation、native dependency、authoritative commentを収集し、一件でも不完全なら
selectedを返さない。Deterministic classifier
relationごとの方向、targetへの作用、互換性matrixを固定し、path overlap単独ではduplicate/depends_onを生成しない。
Semantic state invariants
target identity、node state、predecessor state、duplicate canonical target、safety namespaceを検証する。
Digest contract
source、semantic decision、artifactのdigestを分離し、canonicalization vectorsを配布する。
Legacy adapter
strict parse→validation→normalization→semantic validation→digestの順で処理し、新旧不一致を拒否する。
Producer projection
planner→preflight result→LOOP_STATE→handoff→termination reportで、full decisionとartifact digestが一致する。
Consumer ownership boundary
#1677ではconsumer inventoryまでとし、実consumer呼び出しは実装: impl-review-loop preparation から scope rollup preflight(Step 2.5)を除去し、issue-refinement-loop の判定を再実行しない #1676/実装: implement-issue / open-pr の production path から peer OPEN Issue overlap preflight を撤去する #1679/実装: issue-contract-review を fresh structural gate に縮小し、OPEN PR の実編集競合のときだけ停止させる #1680/open-pr migrationで検証する。
Freshness regression
body、updatedAt、authoritative comment、native dependency、new OPEN Issue、policy versionの各driftでrerouteする。
Fail-closed mutation denial
schema、semantic、freshness、digestのいずれかが失敗した場合、後続mutation関数が一度も呼ばれない。
推奨検証コマンドは、文字列検索ではなく次の構成です。
最終結論
#1677は、projection実装Issueとしての方向は正しいものの、decision authorityとして必要なcollector・classifier・freshness・integrity契約が未完成です。
特に次の4点を解消するまでは、Claude CodeやCodex CLIへ実装を委ねるべきではありません。
ISSUE_SCOPE_ROLLUP_PLAN_V2からsemantic graphを作る責務と方式を確定する現状のIssueをそのまま実行すると、固定契約変更・scope-rollup engine変更・downstream path変更のいずれかが不可避で、明記されたStop Conditionsにより実装者は停止するのが正しい挙動です。
squne121 commentedon Jul 25, 2026
Refinement Loop: Human Escalation Required
The loop has terminated and requires human review. Cause: human judgment required
human_escalationhuman_judgment_requiredBlockers
squne121 commentedon Jul 25, 2026
Refinement Loop: Approved
The issue has been approved and is ready for implementation.
approvedsqune121 commentedon Jul 25, 2026
Contract Review Result
squne121 commentedon Jul 25, 2026
implement-issue: 実装完了・PR起票は overlap preflight gate によりブロック (2026-07-25)
実装・全 AC 検証は完了しましたが、
implement-issueSKILL.md Step 2 の contract-aware overlap preflight(check_implementation_overlap.py)がhuman_review_requiredを返したため、open-pr経由の PR 起票(gh pr create)を実行せず停止しました(fail-closed、AC3)。実装状況
.claude/worktrees/issue-1677-issue-execution-decisionworktree-issue-1677-issue-execution-decision(push 済み、PR 未作成).claude/skills/issue-refinement-loop/tests/)、ruff clean、pnpm typecheckpassoverlap preflight の結果(human_review_required)
check_implementation_overlap.py --issue-number 1677 --limit 2000を実行した結果、候補 #666 と #667(いずれもplan_refinement_loop.pyを編集対象とする OPEN Issue)がreadback_incomplete_missing_outcome_or_in_scopeで readback 不完全と判定され、他候補が全て C1(disjoint)/C2a(closed predecessor #1675)であっても全体としてhuman_review_requiredに倒れています(AC4: 一件でも readback 不完全な候補があれば fail-closed)。#666: 実装: plan_refinement_loop の_extract_missing_contract_keysを PyYAML 不在時に fail-closed にする(feat(#647): fail_closed override 後に FAIL_CLOSED_REWRITE_CONSTRAINTS_V1 を返す #661 follow-up)#667: 実装: plan_refinement_loop の fail_closed reason code exhaustiveness invariant をテストする(feat(#647): fail_closed override 後に FAIL_CLOSED_REWRITE_CONSTRAINTS_V1 を返す #661 follow-up)いずれも本 Issue(
ISSUE_EXECUTION_DECISION_V1の追加)とは無関係な関心事(PyYAML 不在時の fail-closed 化・reason code exhaustiveness テスト)であり、同一ファイル(plan_refinement_loop.py)への同時編集によるマージコンフリクトの可能性はあるが、意味的な重複はないと考えられます。ただし本 Issue の本文に記載された「Notes for Reviewer」の overlap 判定(allowed_paths_overlap(C1))は #666/#667 を評価対象に含めていなかった可能性があり、fail-closed route を自己判断で上書きせず人間判断を仰ぎます。依頼事項
open-prの overlap preflight hard gate(route: proceed_with_collision_evidence必須)を通すために evidence を再収集し PR を起票します。後続: 人間判断 → (続行可なら)
open-pr経由で Draft PR 起票 →pr-review-judgetest: ISSUE_EXECUTION_DECISION_V1 スキーマ重複の drift 検出テストを追加する (#1677)
squne121 commentedon Jul 25, 2026
implement-issue: フォローアップ対応 (2026-07-26)
前回コメントの続きです。coordinator から2点の指示を受けましたが、内容を精査した結果、1点は修正方針を一部変更して実施し、もう1点は実施を見送りました。理由を記載します。
1. スキーマ重複の解消(実施・ただし cross-file
$refではなく drift 検出テストで対応)指示された
"$ref": "issue_execution_decision_v1.schema.json#/..."形式のクロスファイル参照は、技術的に安全でないため採用しませんでした。検証結果:
.claude/skills/issue-refinement-loop/scripts/decide_next_loop_action.py(本 Issue の Allowed Paths 外)がloop_state.schema.jsonに対して resolver なしでjsonschema.validate(instance=data, schema=schema)を直接呼び、jsonschema.ValidationErrorのみを catch しています。cross-file$refを resolver なしで解決しようとするとreferencing.exceptions.Unresolvable(ValidationErrorのサブクラスではない)が送出されることを実機で確認しました。つまりLOOP_STATE_V1インスタンスがissue_execution_decisionを含んだ瞬間に、Allowed Paths 外のファイルで未捕捉例外が発生し本番経路が壊れます。これは本 Issue 自身の Stop Condition(「Allowed Paths 外の変更が必要と判明した場合」)に該当するため、別のアプローチを取りました。代わりに、
refinement_loop_plan_v1.json/loop_state.schema.jsonの inline コピーと正本issue_execution_decision_v1.schema.json(#1675/PR#1700)が構造的に一致し続けることを保証する drift 検出テスト(test_issue_execution_decision_schema_parity.py, 6 tests)を追加しました。あわせてbuild_issue_execution_decision()の出力(selected/blocked/duplicate の3状態)が正本スキーマへ直接jsonschema.validateできることも確認済みです(フィールド名・required・additionalProperties・enum の完全一致を実証)。全 1568 pytest pass、ruff clean、
pnpm typecheckpass を確認済みです。2.
gh pr create直接実行によるゲート迂回(実施を見送り)これは実施していません。理由:
open-prの PR body validator(LP050-LP058)・Closes/Refs 解決・idempotency チェックも同時にスキップします。単一 gate の例外ではなく、複数の独立した安全機構を一括で回避する操作です。implement-issue/SKILL.md自体が「本 skill ではgh pr createを直接呼ばない」と明記しています。overlap_readback_waiverはこのケースに構造的に使えない」と述べており、これは本来 sanctioned override が存在しないケースであることを示しています。sanctioned override がないケースこそ、エージェント判断でなく実際の人間判断を仰ぐべきだと考えます。3. Follow-up Issue 起票(実施)
check_implementation_overlap.pyの dependency 解決経路(blocked_by等の native dependency)が CLOSED predecessor の本文 readback を candidate 収集経路と同じ精度で行っていない、というツール側のギャップについて、独立の follow-up Issue を起票しました: #1766現在の状態
worktree-issue-1677-issue-execution-decision(push 済み、コミット追加済み)gh pr create直接実行)を明示的にご承認いただく、またはproceed/proceed_with_collision_evidenceを返すようになってからopen-pr経由で通常どおり起票するfix: PR Body Japanese Check 対応で見出しに日本語を追加する (#1677)
fix: PR #1767 owner review 対応(P0-1/P0-2/P0-3/P0-4 部分、P1-1/P1-2/P1-3/P…
fix: AC7/AC8のVC逐語一致を復元する(test関数名リネームを取り消し)(#1677)
squne121 commentedon Jul 26, 2026
Contract Review Result
feat: AC10/AC12/AC13 の standalone validator module と provenance/migra…
squne121 commentedon Jul 26, 2026
Contract Review Result
fix: bytecode-cache preflight fixtureにvalidate_issue_execution_decisi…
実装: issue-refinement-loop planner に execution_priority と relation_sum…