Skip to content

実装: issue-refinement-loop の hard dependency を GitHub native blockedBy に materialize / readback する #2435

Closed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: >-
  issue-refinement-loop が refinement で確定した hard dependency を Issue 本文の
  `Blocked By` / `Depends On` prose だけで完了扱いせず、GitHub native issue dependency
  (`blockedBy`) に materialize し、live readback が expected set と一致するまで
  refinement-ready / implementation-ready と判定しない。
change_kind: workflow-routing
source_issue: 2424
dedupe_key: "retrospective:issue-2424:issue-refinement-loop-native-dependency-materialization"

Parent Issue

none(standalone workflow correction)

Parent Goal Ref

  • Goal: docs/dev/github-ops.md の native dependency primary / body fallback 方針を issue-refinement-loop の実際の mutation / readiness 経路へ materialize する。
  • Desired Destination: refinement で hard predecessor/blocker set が確定した場合、既存 controlled native_relationships / issue_relationship.update executor を通じて native blockedBy を同期し、live readback 後にのみ proceed/readiness を返す。

Current Validated Scope

  • 本 Issue の write-capable scope は、issue-refinement-loop が確定済みの hard dependency を canonical semantic decision(ISSUE_EXECUTION_DECISION_V1 の relations[].relation_type=depends_on / execution.predecessors[])に投影し、既存 .claude/skills/edit-issue/scripts/edit_issue_txn.py の native_relationships / issue_relationship.update controlled route へ渡し、fresh native readback まで確認する producer + materializer wiring の追加である。
  • trusted human context / trusted anchor / controlled reframe / 実装: issue-refinement-loop で scope_collision_check/v1 を消費する #2406 confirmed-hard-predecessor など、hard dependency が既に確定した経路のみを扱う。新しい dependency semantic classifier(何を hard dependency とみなすかの判定ロジック)は作らない。
  • 全ての production refinement lane が最終的に通る単一の共通 dependency-materialization choke point を実装し、lane ごとの個別 writer は作らない。
  • native relationship の更新は full-set replace ではなく explicit add/remove delta とし、expected_after = (live_before - explicit_remove) ∪ explicit_add を postcondition として fresh readback と比較する(exact equality は postcondition であり mutation instruction ではない)。refinement が明示的に remove 対象としていない既存 native blocker は保持する。
  • body の Blocked By / Depends On は human-readable mirror / fallback のままとし、native API が利用可能な production path では completion SSOT にしない。
  • canonical path の修正、producer/materializer wiring、integration/regression test、body-only false-green 防止までを scope に含める。
  • 新しい dependency schema、新しい GitHub relationship writer、新しい ledger、新しい broker、新しい authorization/security layer は作らない。

Remaining Parent Gaps

なし(parent_issue: none の standalone workflow correction)

Retrospective / Incident

Issue #2424 の issue-refinement-loop では #2422、#2423、#2432 が hard prerequisite として確定し、本文に ## Blocked By として反映された。一方、refinement 完了報告も Dependencies: #2424 本文に #2422、#2423、#2432 を Blocked By として反映 を完了条件として扱い、GitHub native blockedBy relation の materialization/readback を完了条件に含めなかった。

2026-08-30 の live readback では GET /repos/squne121/loop-protocol/issues/2424/dependencies/blocked_by が [] であり、本文上の blocker set と native dependency SSOT が乖離している。

これは新しい GitHub mutation primitive の不足ではない。repository には既に以下が存在する。

Root Cause

  1. issue-refinement-loop の contract/reframe は dependency を Issue body の構造要素として扱えるが、確定済み hard dependency を ISSUE_EXECUTION_DECISION_V1 の relations[].relation_type=depends_on / execution.predecessors[] へ投影する producer が存在しない。plan_refinement_loop.py は scope-rollup 由来の semantic relation を coordinates に限定し、sequential_required 等を depends_on へ自動変換しないよう意図的に fail-closed になっている(誤変換防止としては妥当だが、trusted human context / trusted anchor / controlled reframe / 実装: issue-refinement-loop で scope_collision_check/v1 を消費する #2406 confirmed-hard-predecessor で既に確定した hard dependency をこの canonical decision へ転記する経路自体が欠落している)。
  2. 既存 .claude/skills/edit-issue/scripts/edit_issue_txn.py は native_relationships(add/remove delta、expected_before drift check、fresh full-pagination readback、exact-set 比較)を Issue 実装: edit-issue transaction に GitHub native 親子・依存関係の同期と readback を追加する #1883 / PR 実装: edit-issue transaction に GitHub native 親子・依存関係の同期と readback を追加する #1897 で実装済みであり、writer 自体は存在する。欠落しているのは、確定済み hard dependency をこの既存 executor の入力へ橋渡しする materializer wiring である。
  3. Step 4 rewrite / issue-editor handoff が body rewrite の成功を確認しても、この materializer を呼び出さず、native blockedBy の add/remove delta も readback も実行しない。
  4. final deterministic review / readiness も body contract の整合性を確認するのみで、GitHub native blocked_by live set と desired dependency set の exact equality を gate にしていない。
  5. そのため body-only Blocked By が deterministic review を通過し、native SSOT が空でも refinement が完了扱いになれる。
  6. relationship primitive(実装: edit-issue transaction に GitHub native 親子・依存関係の同期と readback を追加する #1883/実装: edit-issue transaction に GitHub native 親子・依存関係の同期と readback を追加する #1897)の unit/transaction tests と issue-refinement-loop の end-to-end integration test が分離しており、この producer/materializer wiring の欠落を検出できなかった。

Outcome

issue-refinement-loop が hard dependency を確定したすべての production refinement lane(trusted human context / trusted anchor / deterministic controlled reframe / #2406 confirmed-hard-predecessor 等)で、desired blockedBy set を machine-readable に保持し、単一の共通 dependency-materialization choke point を経由して既存 controlled executor(.claude/skills/edit-issue/scripts/edit_issue_txn.py)を再利用して native relationship を explicit add/remove delta で同期し、GitHub live readback が expected exact set と一致した場合のみ dependency materialization 完了として扱う。

本文の Blocked By / Depends On は必要なら human-readable mirror として保持してよいが、native API が利用可能な production path では SSOT / completion evidence にしない。

In Scope

Out of Scope

Acceptance Criteria

Required Skills

なし

Verification Commands

# AC1
$ rg -n "hard dependency の SSOT は GitHub native" .claude/skills/issue-refinement-loop/SKILL.md .claude/skills/issue-refinement-loop/references/

# AC2
$ rg -n "dependency-materialization choke point" .claude/skills/issue-refinement-loop/SKILL.md .claude/skills/issue-refinement-loop/references/ .claude/skills/issue-refinement-loop/scripts/
# AC3
# AC4
# AC5
# AC6
# AC7
# AC8
# AC9
# AC11
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/ -k "native_dependency or blocked_by or dependency_materialization" -v
$ uv run --locked pytest .claude/skills/edit-issue/tests/test_edit_issue_txn.py -v
# AC10
$ rg -ln -e "add_blocked_by" -e "remove_blocked_by" --glob "!.claude/skills/edit-issue/**" .claude/skills/issue-refinement-loop/scripts/ .claude/skills/issue-refinement-loop/references/

Allowed Paths

  • .claude/skills/issue-refinement-loop/SKILL.md
  • .claude/skills/issue-refinement-loop/references/
  • .claude/skills/issue-refinement-loop/scripts/
  • .claude/skills/issue-refinement-loop/tests/
  • .claude/skills/edit-issue/tests/test_edit_issue_txn.py(既存 primitive の regression test 補強が必要な場合のみ)
  • docs/dev/agent-skill-boundaries.md(既存 boundary の記述補足が必要な場合のみ)

Stop Conditions

  • Allowed Paths 外の変更が必要と判明した場合
  • In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
  • 後続 Phase / 別スコープへの波及が判明した場合
  • nested SubAgent delegation が必要になった場合
  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
  • 既存 native_relationships / issue_relationship.update controlled executor では実現できず、新しい GitHub relationship writer / broker / ledger が必要と判明した場合。
  • hard dependency と informative reference の semantic classification を repository-wide に再設計する必要が生じた場合。
  • 実装: issue-refinement-loop で scope_collision_check/v1 を消費する #2406 の scope-collision producer/consumer schema 自体の変更が必要と判明した場合。
  • secret/credential exposure、destructive git operation、又は既存 authorization boundary の実質的な拡張が必要な場合。

Required Design References

Runtime Verification Applicability

decision: immediate
reason: >-
  本変更の中核は GitHub native issue relationship の production mutation と live readback であり、
  body fixture / mock だけでは body-only false success の再発を防止できない。native relationship
  primitive 自体(add/remove delta, expected_before drift check)は Issue #1883 / PR #1897 で
  live canary 済みのため再検証しない。本 Issue の runtime verification は producer→materializer
  wiring の統合経路(disposable Issue での add→readback→remove→readback)に限定する。
applicable_acs:
  - AC4
  - AC6
  - AC7
execution_environment:
  - gh CLI(認証済み、issue dependency API 利用可能)
  - uv(Python 実行)
  - repository への controlled executor 実行権限
skip_conditions: >-
  gh CLI 未認証、または GitHub native issue dependency API(blocked_by 等)が
  実行環境から到達不能な場合は exit 77 で SKIP し、fallback を成功として扱わない。
fallback_policy: >-
  native dependency API / controlled executor が到達不能な場合の fallback は
  body-only mirror の維持に限定し、materialization success とは扱わない。
  fallback 経由の完了を PASS として報告しない。
artifact_requirements:
  - desired blockedBy set
  - controlled transaction result
  - GitHub live blocked_by readback
  - exact-set comparison result
fallback_success_is_pass: false

Source

source_kind: retrospective
source_issue: 2424
observed_at: "2026-08-30"
observed_failure: >-
  Issue #2424 body contained blockers #2422/#2423/#2432 while GitHub native
  blocked_by live readback returned an empty set; refinement completion reported
  the body mutation as dependency completion.
related_policy_issue: 233
related_validation_issue: 265
partial_route_issue: 2406
review_comment: "https://github.com/squne121/loop-protocol/issues/2435#issuecomment-5467747884"

Delivery Rule

Activity

  1. added
    enhancement
    on Aug 30, 2026
  2. squne121 commented on Aug 30, 2026

    @squne121
    OwnerAuthor

    総合判定

    REQUEST_CHANGES。#2435 が解決しようとしている障害は実在し、方向性もほぼ正しいですが、このまま実装開始するのは非推奨です。

    事故の再現性は確認できています。#2424 本文には #2422 / #2423 / #2432 が hard prerequisite として記載されていますが、現在の GitHub native blocked_by readback は実際に [] です。つまり「body 上は blocked、native SSOT 上は dependency なし」という split-brain は現存します。

    さらに #233 は「native dependency を SSOT とし、hard dependency を materialize + live readback する。ただし issue-refinement-loop への実装配線は別 Issue」と明示し、#265 は逆側で「native が利用可能なら body fallback を一切見ない。check_blockers は validation のみで mutation owner ではない」としています。したがって #2435 という Issue 自体は必要です。

    敵対的レビュー findings

    優先度 | Finding | 判定 -- | -- | -- P0 | Issue 内の canonical path が現行 main と一致しない | must-fix P0 | 「materializer の未配線」だけでなく、canonical semantic decision producer 自体が hard dependency をまだ生成できない | must-fix P0 | AC3/AC7 の「desired exact set へ同期」は、#1883 で明示的に禁止した destructive replace semantics を復活させる余地がある | must-fix P0 | Outcome は「全 production lane」なのに AC2 は trusted-anchor / human-context / controlled reframe の「いずれか」でよい | must-fix P1 | native unavailable と controlled executor/environment failure の意味が混ざっている | should-fix P1 | blockedBy の relationship state と「open predecessor による readiness block」が十分分離されていない | should-fix P1 | Runtime Verification が既存 primitive の再検証まで抱え込みすぎる | should-fix P2 | GitHub CLI/REST の現行機能を踏まえて transport の位置づけを更新した方がよい | quality improvement

    P0 — まず Issue のパスが壊れています

    #2435 は scripts/github-ops/edit_issue_txn.py と scripts/github-ops/tests/test_edit_issue_txn_relationships.py を Required Design References、Verification、Allowed Paths、AC10 で参照しています。

    しかし現行 main で実在する canonical 実装は、

    .claude/skills/edit-issue/scripts/edit_issue_txn.py

    で、テストも

    .claude/skills/edit-issue/tests/test_edit_issue_txn.py

    です。後者には #1883 の native relationship test 群も既に同居しています。

    指定されている scripts/github-ops/... の2パスは現行 main で取得すると 404 でした。AC10・Verification Commands・Allowed Paths を修正してから refinement-ready にするべきです。

    P0 — 実際の欠落は「writer 呼び忘れ」より1段上です

    既存 ISSUE_EXECUTION_DECISION_V1 schema にはすでに relations[].relation_type = depends_on と execution.predecessors[] が存在します。新 schema は不要です。

    問題は current producer です。plan_refinement_loop.py は現在、scope-rollup candidate から生成する semantic relation を coordinates に限定しており、sequential_required 等を勝手に depends_on へ変換しないよう deliberately fail-closed になっています。そして predecessors はこの経路では追加されず、コード自身が「genuinely directional dependency source が将来入ったときだけ blocked route が到達可能」と説明しています。

    したがって #2435 は、

    hard dependency が既に trusted human context / trusted anchor / controlled reframe / #2406 confirmed-hard-predecessor 等で確定した
    → その確定結果を既存 ISSUE_EXECUTION_DECISION_V1 に投影する
    → 既存 edit_issue_txn.py へ渡す

    までを scope に明記すべきです。

    semantic classifier を新設する必要はありません。「既に確定した dependency を canonical decision に転記するだけ」です。

    P0 — 「exact-set sync」はそのままだと危険です

    ここが最も敵対的に見た場合の問題です。

    #1883 では native relationship update を設計した際、replace semantics を明示的に禁止しています。入力は expected_before + add_blocked_by + remove_blocked_by という explicit delta であり、destructive remove 前には live state drift を確認する契約です。

    PR #1897 のレビューでも「replace semantics destructive remove が存在しないこと」が明示的な確認項目になり、live disposable Issue による canary まで実施されています。

    ところが #2435 AC3/AC7 の

    desired exact set へ同期する
    stale native relation を remove する

    という書き方だと、実装者が

    remove = live_native - body_or_planner_desired

    と実装しかねません。

    これは native SSOT に人間が直接追加した blocker まで「body に無いから stale」と消す可能性があります。#265 の「native が SSOT」とも逆行します。

    推奨する意味論は replace ではなく delta + exact postcondition です。

    expected_after = (live_before - explicit_remove) ∪ explicit_add

    とし、readback が expected_after と完全一致することを成功条件にします。exact equality は postcondition であって mutation instruction ではない、と AC に書くべきです。

    P0 — AC2 の「いずれか」は弱すぎます

    Outcome は「hard dependency を確定したすべての production refinement lane」と言っていますが、AC2 は trusted-anchor / human-context / controlled reframe の**「いずれか」**で materializer が動けば満たせます。

    ここは「各 lane 個別に配線」するより、全 lane が最終的に通る1つの dependency-materialization choke point を作る方が保守性が高いです。#2406 も confirmed hard predecessor 専用 writer を持つのではなく、その共通 point を利用するだけにします。#2406 自身も既存 native_relationships route の再利用を前提にしています。

    推奨する最小実装

    1. ISSUE_EXECUTION_DECISION_V1 を再利用し、確定済み hard dependency だけを relations: depends_on へ投影する。semantic inference はここで行わない。relationship 全体と、「open のため今 blocking している predecessor」は分けて扱う。

    2. final deterministic review / implementation handoff の直前に共通 dependency materialization step を1個だけ置く。各 trusted lane に個別 writer を作らない。

    3. live blockedBy を pre-readback し、current refinement が明示した add/remove delta だけを .claude/skills/edit-issue/scripts/edit_issue_txn.py の既存 native_relationships に渡す。current Issue の dependency なので原則 add_blocked_by/remove_blocked_by のみで、add_blocking を逆算して二重書きしない。

    4. expected_after = live_before - explicit_remove + explicit_add を計算し、既存 transaction の fresh readback が exact match した場合だけ dependency_materialization=ok とする。body の Blocked By は mirror のまま。

    5. native read/write が利用不能なら body refinement 自体は完了させてもよいが、implementation handoff だけを禁止する。人間承認に飛ばす必要はなく、environment_failure / dependency_materialization_unavailable として再実行可能にする。

    6. integration tests は human-context、trusted-anchor、controlled-reframe、実装: issue-refinement-loop で scope_collision_check/v1 を消費する #2406 route、実装: 実CI raw attemptsからReliability V1 close evidenceをproduction生成する #2424 型3 blocker、explicit remove、既存の無関係な native blocker を保存するケース、body-only false-green の8系統程度で十分。新 ledger / broker / receipt / authorization layer は不要。

    7. live runtime verification は actual issue-refinement-loop entrypoint から disposable Issue 1件で add→readback→remove→readback を確認すれば十分。native primitive 自体は PR 実装: edit-issue transaction に GitHub native 親子・依存関係の同期と readback を追加する #1897 で複数 live canary 済みなので、同じ primitive-level canary framework を再構築しない。

    GitHub の現行実装を踏まえた transport 判断

    2026年6月の GitHub CLI v2.94.0 以降は gh issue edit --add-blocked-by/--remove-blocked-by/--add-blocking/--remove-blocking を正式サポートし、gh issue view --json blockedBy,blocking も利用できます。REST API にも blocked_by の list/add/remove 専用 endpoint が正式にあります。(The GitHub Blog)

    ただし、#2435 で既存 controlled executor を CLI に置換するのは勧めません。現行 GitHub CLI の DeferredUpdateIssue は advanced issue mutations を並列実行する仕様で、CLI source も通常の content update の後に deferred mutation を行っています。既存 #1883 transaction が要求する「relationship → readback → content」の順序保証とは異なります。(Go Packages)

    つまり v2.94+ の高水準 CLI は、将来 issue_relationship.update の内部 transport を簡素化する候補にはなりますが、#2435 の scope で第二の writer surface を作る理由にはなりません。

    また GitHub native dependency は relationship type ごとに最大50件です。したがって、この Issue のためだけに新しい巨大 pagination abstraction を作る価値もありません。既存 executor の full-readback をそのまま再利用すれば十分です。(The GitHub Blog)

    #2435 の修正後の位置づけ

    #2435 のタイトル・Goal は概ね維持して構いません。ただし Root Cause は、

    「native writer がない」ではなく、確定済み hard dependency を canonical ISSUE_EXECUTION_DECISION_V1 に載せる producer wiring と、その canonical decision を既存 edit transaction へ渡す materializer wiring が欠落している」

    にした方が実装と一致します。

    また AC3/AC7 は「full set replacement」ではなく「explicit delta による収束 + exact post-readback」に変更し、テストには “native に #99 が既に存在し、今回 #42 を追加する場合、#99 を消さない” ケースを必須化するのがよいです。

    この修正まで入れば、#2435 はかなり良い Issue になります。 新しいセキュリティゲート、承認フロー、dependency ledger、mutation broker は不要です。必要なのは既存の semantic-decision schema と、既に十分鍛えられた #1883 transaction の間を細く接続することです。

    なお、#2435 自体には現時点でコメントはありません。今回参照できる実装レビュー履歴として重要なのは、既存 native transaction を導入した PR #1897 側です。

    ## 総合判定

    REQUEST_CHANGES。#2435 が解決しようとしている障害は実在し、方向性もほぼ正しいですが、このまま実装開始するのは非推奨です。

    事故の再現性は確認できています。#2424 本文には #2422 / #2423 / #2432 が hard prerequisite として記載されていますが、現在の GitHub native blocked_by readback は実際に [] です。つまり「body 上は blocked、native SSOT 上は dependency なし」という split-brain は現存します。

    さらに #233 は「native dependency を SSOT とし、hard dependency を materialize + live readback する。ただし issue-refinement-loop への実装配線は別 Issue」と明示し、#265 は逆側で「native が利用可能なら body fallback を一切見ない。check_blockers は validation のみで mutation owner ではない」としています。したがって #2435 という Issue 自体は必要です。

    敵対的レビュー findings

    優先度 Finding 判定
    P0 Issue 内の canonical path が現行 main と一致しない must-fix
    P0 「materializer の未配線」だけでなく、canonical semantic decision producer 自体が hard dependency をまだ生成できない must-fix
    P0 AC3/AC7 の「desired exact set へ同期」は、#1883 で明示的に禁止した destructive replace semantics を復活させる余地がある must-fix
    P0 Outcome は「全 production lane」なのに AC2 は trusted-anchor / human-context / controlled reframe の「いずれか」でよい must-fix
    P1 native unavailable と controlled executor/environment failure の意味が混ざっている should-fix
    P1 blockedBy の relationship state と「open predecessor による readiness block」が十分分離されていない should-fix
    P1 Runtime Verification が既存 primitive の再検証まで抱え込みすぎる should-fix
    P2 GitHub CLI/REST の現行機能を踏まえて transport の位置づけを更新した方がよい quality improvement

    P0 — まず Issue のパスが壊れています

    #2435 は scripts/github-ops/edit_issue_txn.py と scripts/github-ops/tests/test_edit_issue_txn_relationships.py を Required Design References、Verification、Allowed Paths、AC10 で参照しています。

    しかし現行 main で実在する canonical 実装は、

    .claude/skills/edit-issue/scripts/edit_issue_txn.py

    で、テストも

    .claude/skills/edit-issue/tests/test_edit_issue_txn.py

    です。後者には #1883 の native relationship test 群も既に同居しています。

    指定されている scripts/github-ops/... の2パスは現行 main で取得すると 404 でした。AC10・Verification Commands・Allowed Paths を修正してから refinement-ready にするべきです。

    P0 — 実際の欠落は「writer 呼び忘れ」より1段上です

    既存 ISSUE_EXECUTION_DECISION_V1 schema にはすでに relations[].relation_type = depends_on と execution.predecessors[] が存在します。新 schema は不要です。

    問題は current producer です。plan_refinement_loop.py は現在、scope-rollup candidate から生成する semantic relation を coordinates に限定しており、sequential_required 等を勝手に depends_on へ変換しないよう deliberately fail-closed になっています。そして predecessors はこの経路では追加されず、コード自身が「genuinely directional dependency source が将来入ったときだけ blocked route が到達可能」と説明しています。

    したがって #2435 は、

    hard dependency が既に trusted human context / trusted anchor / controlled reframe / #2406 confirmed-hard-predecessor 等で確定した
    → その確定結果を既存 ISSUE_EXECUTION_DECISION_V1 に投影する
    → 既存 edit_issue_txn.py へ渡す

    までを scope に明記すべきです。

    semantic classifier を新設する必要はありません。「既に確定した dependency を canonical decision に転記するだけ」です。

    P0 — 「exact-set sync」はそのままだと危険です

    ここが最も敵対的に見た場合の問題です。

    #1883 では native relationship update を設計した際、replace semantics を明示的に禁止しています。入力は expected_before + add_blocked_by + remove_blocked_by という explicit delta であり、destructive remove 前には live state drift を確認する契約です。

    PR #1897 のレビューでも「replace semantics destructive remove が存在しないこと」が明示的な確認項目になり、live disposable Issue による canary まで実施されています。

    ところが #2435 AC3/AC7 の

    desired exact set へ同期する
    stale native relation を remove する

    という書き方だと、実装者が

    remove = live_native - body_or_planner_desired

    と実装しかねません。

    これは native SSOT に人間が直接追加した blocker まで「body に無いから stale」と消す可能性があります。#265 の「native が SSOT」とも逆行します。

    推奨する意味論は replace ではなく delta + exact postcondition です。

    expected_after = (live_before - explicit_remove) ∪ explicit_add

    とし、readback が expected_after と完全一致することを成功条件にします。exact equality は postcondition であって mutation instruction ではない、と AC に書くべきです。

    P0 — AC2 の「いずれか」は弱すぎます

    Outcome は「hard dependency を確定したすべての production refinement lane」と言っていますが、AC2 は trusted-anchor / human-context / controlled reframe の**「いずれか」**で materializer が動けば満たせます。

    ここは「各 lane 個別に配線」するより、全 lane が最終的に通る1つの dependency-materialization choke point を作る方が保守性が高いです。#2406 も confirmed hard predecessor 専用 writer を持つのではなく、その共通 point を利用するだけにします。#2406 自身も既存 native_relationships route の再利用を前提にしています。

    推奨する最小実装

    1. ISSUE_EXECUTION_DECISION_V1 を再利用し、確定済み hard dependency だけを relations: depends_on へ投影する。semantic inference はここで行わない。relationship 全体と、「open のため今 blocking している predecessor」は分けて扱う。
    2. final deterministic review / implementation handoff の直前に共通 dependency materialization step を1個だけ置く。各 trusted lane に個別 writer を作らない。
    3. live blockedBy を pre-readback し、current refinement が明示した add/remove delta だけを .claude/skills/edit-issue/scripts/edit_issue_txn.py の既存 native_relationships に渡す。current Issue の dependency なので原則 add_blocked_by/remove_blocked_by のみで、add_blocking を逆算して二重書きしない。
    4. expected_after = live_before - explicit_remove + explicit_add を計算し、既存 transaction の fresh readback が exact match した場合だけ dependency_materialization=ok とする。body の Blocked By は mirror のまま。
    5. native read/write が利用不能なら body refinement 自体は完了させてもよいが、implementation handoff だけを禁止する。人間承認に飛ばす必要はなく、environment_failure / dependency_materialization_unavailable として再実行可能にする。
    6. integration tests は human-context、trusted-anchor、controlled-reframe、実装: issue-refinement-loop で scope_collision_check/v1 を消費する #2406 route、実装: 実CI raw attemptsからReliability V1 close evidenceをproduction生成する #2424 型3 blocker、explicit remove、既存の無関係な native blocker を保存するケース、body-only false-green の8系統程度で十分。新 ledger / broker / receipt / authorization layer は不要。
    7. live runtime verification は actual issue-refinement-loop entrypoint から disposable Issue 1件で add→readback→remove→readback を確認すれば十分。native primitive 自体は PR 実装: edit-issue transaction に GitHub native 親子・依存関係の同期と readback を追加する #1897 で複数 live canary 済みなので、同じ primitive-level canary framework を再構築しない。

    GitHub の現行実装を踏まえた transport 判断

    2026年6月の GitHub CLI v2.94.0 以降は gh issue edit --add-blocked-by/--remove-blocked-by/--add-blocking/--remove-blocking を正式サポートし、gh issue view --json blockedBy,blocking も利用できます。REST API にも blocked_by の list/add/remove 専用 endpoint が正式にあります。([The GitHub Blog]1)

    ただし、#2435 で既存 controlled executor を CLI に置換するのは勧めません。現行 GitHub CLI の DeferredUpdateIssue は advanced issue mutations を並列実行する仕様で、CLI source も通常の content update の後に deferred mutation を行っています。既存 #1883 transaction が要求する「relationship → readback → content」の順序保証とは異なります。([Go Packages]2)

    つまり v2.94+ の高水準 CLI は、将来 issue_relationship.update の内部 transport を簡素化する候補にはなりますが、#2435 の scope で第二の writer surface を作る理由にはなりません。

    また GitHub native dependency は relationship type ごとに最大50件です。したがって、この Issue のためだけに新しい巨大 pagination abstraction を作る価値もありません。既存 executor の full-readback をそのまま再利用すれば十分です。([The GitHub Blog]3)

    #2435 の修正後の位置づけ

    #2435 のタイトル・Goal は概ね維持して構いません。ただし Root Cause は、

    「native writer がない」ではなく、確定済み hard dependency を canonical ISSUE_EXECUTION_DECISION_V1 に載せる producer wiring と、その canonical decision を既存 edit transaction へ渡す materializer wiring が欠落している」

    にした方が実装と一致します。

    また AC3/AC7 は「full set replacement」ではなく「explicit delta による収束 + exact post-readback」に変更し、テストには “native に #99 が既に存在し、今回 #42 を追加する場合、#99 を消さない” ケースを必須化するのがよいです。

    この修正まで入れば、#2435 はかなり良い Issue になります。 新しいセキュリティゲート、承認フロー、dependency ledger、mutation broker は不要です。必要なのは既存の semantic-decision schema と、既に十分鍛えられた #1883 transaction の間を細く接続することです。

    なお、#2435 自体には現時点でコメントはありません。今回参照できる実装レビュー履歴として重要なのは、既存 native transaction を導入した PR #1897 側です。

  3. squne121 commented on Aug 30, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop 終了報告(human_judgment_required)

    anchor comment: #2435 (comment)

    Step 0f preflight(preflight.run.with_human_context)が STATUS: blocked / NEXT_ACTION: human_judgment_required を返したため、review/rewrite ループへ進む前に停止しました。

    Blockers

    • PLANNER_FAIL_CLOSED
    • missing_required_section
    • structural_repair_action:structural_human_review_required_items_present

    欠落している必須セクション(.github/ISSUE_TEMPLATE/implementation.yml 由来)

    • ## Current Validated Scope(本 Issue の write-capable scope)— disposition: human_review_required(exact source なし)
    • ## Remaining Parent Gaps(本 Issue で塞がない parent gap。なければ「なし」)— disposition: human_review_required(exact source なし)
    • ## Required Skills — disposition: auto_apply_safe(template default なし を機械的に挿入可能)

    Current Validated Scope と Remaining Parent Gaps は deterministic structural repair が exact source 一致を確認できず、自動挿入対象外(fabrication 回避のため fail-closed)です。parent_issue: none のスタンドアロン Issue のため、Remaining Parent Gaps は「なし」で足りる可能性が高く、Current Validated Scope は既存の ## In Scope / ## Allowed Paths を要約する形で埋められる見込みですが、これは human_review_required 判定であり本ループでは自動確定しません。

    次のアクション

    Issue 本文に上記2セクションを追記のうえ、issue-refinement-loop を再実行してください。追記位置は ## Parent Goal Ref の直後(Current Validated Scope → Remaining Parent Gaps の順)が既存構造と整合します。

  4. squne121 commented on Aug 30, 2026

    @squne121
    OwnerAuthor

    推奨アクションは、今回の human_judgment_required をそのまま人間への質問として残さず、この次の Claude Code プロンプト自体を明示的な human decision / controlled reframe として与え、Issue 本文を補修してから同じ issue-refinement-loop を再開することです。

    今回不足しているのは Current Validated Scope、Remaining Parent Gaps、Required Skills です。後者はテンプレート既定値が なし、Remaining Parent Gaps も parent_issue: none の standalone Issue なので なし と固定できます。 テンプレート上も Current Validated Scope は「本 Issue の write-capable scope」、Remaining Parent Gaps は「なければ なし」と定義されています。

    また、anchor comment は P0 修正内容まで十分具体的です。特に canonical path 修正、producer wiring の追加、replace semantics 禁止、全 production lane 共通 choke point 化が明示されています。 現行の canonical editor にも native_relationships、expected_before、add_blocked_by、remove_blocked_by が既に存在するため、新 writer を作る方向には進ませないのが適切です。

    以下をそのまま Claude Code に渡すのを推奨します。

    #2435 (comment)

    Issue #2435 を対象に、停止した issue-refinement-loop を再開し、人間の追加承認なしで refinement-ready まで完遂してください。

    これは人間による明示的な follow-up decision / controlled reframe です。
    前回の

    • STATUS: blocked
    • NEXT_ACTION: human_judgment_required
    • missing_required_section
    • structural_human_review_required_items_present

    に対する人間判断を、このプロンプトで与えます。

    重要な方針

    今回の停止を理由に、もう一度「Current Validated Scope をどうしますか」「Remaining Parent Gaps をどうしますか」と人間へ質問しないでください。

    このプロンプト自体を trusted human context として扱い、以下の bounded decision を採用してください。

    Human decision: Current Validated Scope

    Issue 本文に次の意味論を持つ ## Current Validated Scope を追加してください。

    • 実装: issue-refinement-loop の hard dependency を GitHub native blockedBy に materialize / readback する #2435 の write-capable scope は、issue-refinement-loop で既に確定済みの hard dependency を canonical semantic decision に投影し、既存 native relationship transaction へ渡し、fresh native readback まで確認する production wiring の修正である。
    • trusted human context / trusted anchor / controlled reframe / 実装: issue-refinement-loop で scope_collision_check/v1 を消費する #2406 confirmed-hard-predecessor 等で既に hard dependency と確定したものだけを扱う。ここで新しい dependency semantic classifier を作らない。
    • 既存 ISSUE_EXECUTION_DECISION_V1 の relations[].relation_type = depends_on / execution.predecessors[] を再利用する。
    • 全 production refinement lane が最終的に通る共通 dependency-materialization choke point を使用する。lane ごとに別 writer を作らない。
    • mutation は canonical .claude/skills/edit-issue/scripts/edit_issue_txn.py の既存 native_relationships / issue_relationship.update controlled route を再利用する。
    • native relationship 更新は full-set replace ではなく explicit delta とする。
    • expected_after = (live_before - explicit_remove) ∪ explicit_add を postcondition とし、fresh readback が exact match した場合だけ materialization success とする。
    • exact equality は mutation instruction ではなく postcondition である。
    • refinement が所有していない既存 native blocker を「desired set にない」という理由だけで削除しない。
    • body の Blocked By / Depends On は human-readable mirror / fallback であり、native API が利用可能な production path では completion SSOT にしない。
    • canonical path の修正、producer/materializer wiring、integration/regression test、body-only false-green 防止までを本 Issue の scope に含める。
    • 新 schema、新 GitHub relationship writer、新 ledger、新 broker、新 authorization/security layer は作らない。

    上記を Issue 本文の既存 In Scope / Out of Scope / Outcome / anchor comment と整合する簡潔な文章へ整形して構いません。
    意味論を拡張・縮小しないでください。

    Human decision: Remaining Parent Gaps

    次を確定値として採用してください。

    ## Remaining Parent Gaps
    
    なし(`parent_issue: none` の standalone workflow correction)

    新たな parent Issue を推測したり作成したりしないでください。

    Human decision: Required Skills

    template default に従い、

    ## Required Skills
    
    なし

    としてください。


    anchor comment の findings を Issue contract に反映する

    単に3見出しを足して preflight を通すだけでは不十分です。

    指定 anchor comment
    #2435 (comment)

    を refinement input として扱い、P0/P1 findings を Issue 本文へ反映してください。

    最低限、次を解消してください。

    1. canonical path の修正

    誤った旧参照:

    • scripts/github-ops/edit_issue_txn.py
    • scripts/github-ops/tests/test_edit_issue_txn_relationships.py

    を現行 main の canonical path に修正する。

    原則:

    • .claude/skills/edit-issue/scripts/edit_issue_txn.py
    • .claude/skills/edit-issue/tests/test_edit_issue_txn.py

    実際の main を fresh に確認してから確定すること。

    Required Design References / Verification Commands / Allowed Paths / AC10 等、旧 path が残る全箇所を修正する。

    1. Root Cause を producer + materializer wiring の欠落として正確化する

    「writer がない」だけを root cause にしない。

    確定済み hard dependency を、

    trusted source
    → existing canonical ISSUE_EXECUTION_DECISION_V1
    → common dependency materialization point
    → existing edit_issue_txn.py
    → native readback

    へ投影する wiring が不足している、という構造へ修正する。

    新 semantic classifier は scope に追加しない。

    1. AC3 / AC7 の destructive replace ambiguity を除去する

    desired exact set へ同期
    や
    live_native - desired を stale として全削除

    と解釈できる契約は禁止する。

    explicit add/remove delta のみを current refinement の mutation authority とする。

    成功判定は

    expected_after = (live_before - explicit_remove) ∪ explicit_add

    に対する fresh readback exact equality とする。

    次の regression case を必須にする。

    1. AC2 を Outcome と一致させる

    「trusted-anchor / human-context / controlled reframe のいずれか1つで動けばよい」という弱い AC にしない。

    hard dependency を確定できる production lanes が最終的に共通 dependency-materialization choke point を通ることを acceptance criteria にする。

    #2406 confirmed-hard-predecessor route についても専用 writer を増やさず、同じ common point を consume する設計とする。

    1. failure classification を分離する

    少なくとも、

    • GitHub native dependency capability 自体が unavailable
    • controlled executor failure
    • auth/environment failure
    • readback mismatch
    • semantic human judgment requirement

    を同一の「native unavailable」に潰さない。

    routine/retryable environment failure を不必要な human approval に変換しない。

    1. relationship と readiness を分離する

    blockedBy relationship が存在すること
    と
    その predecessor が open なので implementation readiness を block していること

    を同一概念として扱わない。

    1. Runtime Verification を必要十分にする

    既存 #1883 native relationship primitive 自体を一から再検証する巨大 harness は作らない。

    actual issue-refinement-loop production entrypoint から disposable Issue 等を使用して、

    add
    → fresh native readback
    → remove
    → fresh native readback

    までの integration evidence を取得する方向を優先する。


    サブエージェントを使用すること

    main thread だけで判断を確定しないでください。

    少なくとも2つの独立した fresh SubAgent を起動してください。

    既存の無関係なセッションや別タブを作業対象として流用しないでください。

    SubAgent A: contract / anchor reviewer

    read-only で次を調査させる。

    目的:

    • 今回与えた Human decision が missing sections を完全に解消するか
    • anchor の P0/P1 findings が Issue contract のどこへ反映されるべきか
    • scope expansion を起こしていないか
    • refinement-ready に不足する内容がないか

    Issue/GitHub mutationは禁止。

    SubAgent B: repository semantics verifier

    read-only で current main を調査させる。

    最低限:

    目的:

    Issue/GitHub mutationは禁止。

    必須

    両 SubAgent の作業完了を必ず待ってください。

    途中結果だけを見て mutation を始めないでください。

    両者の結果を main thread で突き合わせてから、Issue body の candidate を確定してください。

    SubAgent 間に disagreement があれば、current main の repository evidence とこの human decision を authority として main thread が bounded に解決してください。

    routine な disagreement を理由に人間へ escalation しないでください。


    mutation

    Issue body mutation は repository が定める canonical controlled route を使用してください。

    ad-hoc な第二 writer を作らないでください。

    contract_update.run.with_human_context がこの明示的 human decision を consume 可能なら canonical route として使用してください。

    それでも「見出しの exact source がない」という理由だけで preflight が停止する場合、このプロンプトに exact human decision が既に存在するため、同じ質問を人間へ返さないでください。

    その場合は repository の canonical edit-issue / ISSUE_EDIT_TXN_INPUT_V1 controlled transaction を使い、このプロンプトで明示された section と anchor findings を Issue body へ反映し、その後 fresh canonical preflight を実行してください。

    preflight 実装を改造して無理に通すことは禁止します。
    #2435 の refinement と、issue-refinement-loop 自体の別の structural-repair 改善を混ぜないでください。

    mutation 前には fresh body / updated_at / SHA 等、既存 transaction が要求する optimistic concurrency evidence を取得してください。


    issue-refinement-loop を再開する

    Issue 修正後、canonical main root / default branch から、同じ anchor comment を direct human context として fresh preflight を実行してください。

    対象:

    過去の blocked preflight result を再利用しないでください。

    fresh readback からやり直してください。

    その後は issue-refinement-loop の canonical routing に従ってください。

    needs_fix / request_changes が出た場合、max iteration の範囲内では人間承認を求めず、自動で rewrite → fresh review を継続してください。

    deterministic repair / structural repair / issue-editor handoff / comment publication / routine GitHub Issue mutation / test / read-only investigationについて、人間への都度承認を求めないでください。


    権限・実行許可

    この作業の完遂に必要な以下の操作を明示的に許可します。

    Claude Code の routine permission prompt や loop iteration approval を、人間判断が必要な semantic decision と混同しないでください。

    許可済みの routine operation は可能な限り自律実行してください。

    ただし repository policy が明示的に human-only とする不可逆操作を迂回してはなりません。


    この作業でやらないこと

    今回は Issue refinement です。

    #2435 の実装コードを書かないでください。
    PR を作成しないでください。
    implementation phase を開始しないでください。

    また、

    は行わないでください。


    human escalation を許す条件

    単なる

    • template heading 不足
    • exact wording 不足
    • routine permission
    • retryable environment failure
    • SubAgent の軽微な見解差
    • deterministic rewrite
    • anchor findings の反映

    では人間へ戻さないでください。

    このプロンプトで明示した human decision でも解消不能な、新しい semantic contradiction が発見された場合のみ human escalation を許可します。

    その場合も、まず

    • contradiction
    • conflicting authoritative sources
    • 自律的に解決できない理由
    • 最小限必要な human decision

    を具体化してください。


    完了条件

    以下をすべて満たして終了してください。

    • missing Current Validated Scope 解消
    • missing Remaining Parent Gaps 解消
    • missing Required Skills 解消
    • anchor comment の P0 findings を Issue 本文へ反映
    • relevant P1 findings も可能な範囲で反映
    • canonical path を current main に修正
    • destructive replace ambiguity 解消
    • unrelated native blocker preservation を AC/test に追加
    • producer + materializer wiring を Root Cause / scope に明記
    • all production lanes の common choke point requirement を明記
    • verification commands が実在 path / current main と一致
    • fresh canonical preflight PASS または proceed 相当
    • fresh review が approve / proceed 相当
    • Issue 実装: issue-refinement-loop の hard dependency を GitHub native blockedBy に materialize / readback する #2435 が refinement-ready
    • 最終 Issue comment に evidence と verdict を投稿

    最後に main thread から簡潔に報告してください。

    報告内容:

    • SubAgent A/B の結論
    • Issue body の主要変更点
    • fresh preflight result
    • fresh review verdict
    • unresolved findings
    • refinement-ready: yes/no
    • 次の推奨アクション

    SubAgent を起動しただけで終了せず、必ず完了を待ってから最終報告してください。

    この方針なら、前回の停止理由そのものを満たす human decision を先に与えているため、同じ「exact source がない」で再停止する余地をかなり減らせます。また、issue-refinement-loop 自体の preflight 実装をその場で修正させない点も重要です。今回の #2435 と「trusted human context から structural repair をもっと自動化する」という別問題を混ぜると scope creep になります。

    なお、issue-refinement-loop の現行契約自体は loop iteration の追加承認をデフォルトでは要求せず、direct human context 用の privileged preflight / contract-update lane も定義しています。 したがって、今回の「人間承認不要」という要求は loop policy とも整合します。

  5. squne121 commented on Aug 30, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop 完了報告

    anchor comment: #2435 (comment)

    trusted human context として与えられた bounded decision に基づき、missing sections の解消と anchor comment(REQUEST_CHANGES、P0 x4 / P1 x3)の findings 反映を行いました。

    実施内容

    • ## Current Validated Scope / ## Remaining Parent Gaps / ## Required Skills を追加(テンプレート必須セクション欠落を解消)。
    • canonical path を修正: scripts/github-ops/edit_issue_txn.py → .claude/skills/edit-issue/scripts/edit_issue_txn.py、scripts/github-ops/tests/test_edit_issue_txn_relationships.py → .claude/skills/edit-issue/tests/test_edit_issue_txn.py(Required Design References / Verification Commands / Allowed Paths / AC10 全箇所)。
    • Root Cause を「writer 不在」ではなく「確定済み hard dependency を ISSUE_EXECUTION_DECISION_V1 へ投影する producer と、既存 edit_issue_txn.py executor へ渡す materializer の wiring 欠落」という構造に修正。
    • AC3/AC7 を「desired exact set へ同期」から explicit add/remove delta + expected_after postcondition の意味論へ修正し、既存の無関係な native blocker を誤って remove しない regression case を AC7(b) として追加。
    • AC2 を「いずれかの lane」から「全 production lane が共通 dependency-materialization choke point を通る」契約へ強化。
    • AC8 に failure classification(native-capability-unavailable / controlled-executor-failure / auth-or-environment-failure / readback-mismatch / semantic-human-judgment-required)の区別を追加。
    • AC11 を新設し、native blockedBy relationship の存在と readiness block 判定の分離を明記。
    • Runtime Verification Applicability を decision: immediate 必須5フィールド(applicable_acs / execution_environment / skip_conditions / fallback_policy / artifact_requirements)を満たす形に修正し、primitive 自体の再検証範囲を disposable Issue の統合経路に限定。

    SubAgent A(contract/anchor reviewer)結論

    missing sections は Human Decision で過不足なく解消可能と判定。anchor findings の反映先マッピングを提示(Root Cause / AC2 / AC3・AC7 / Verification Commands 等)。AC10 の VC が当初の正規表現では vacuous になりうる懸念を指摘(→ 反映済み: AC10 の対象文字列とパスを修正)。scope 矛盾なしと判定。

    SubAgent B(repository semantics verifier)結論

    anchor comment の6つの技術的 claim(canonical path、ISSUE_EXECUTION_DECISION_V1 schema、producer 未配線、destructive replace 禁止契約、#2406 route 再利用、Issue #233/#265 の scope 記述)を現行 main のコード・Issue 本文で直接確認し、すべて confirmed と判定。materializer wiring の自然な配置点として Step 4 rewrite 後 / Step 4.5 を提示。

    両 SubAgent 間に disagreement はありませんでした。

    追加の外部事実確認(web-researcher)

    Out of Scope に記載した GitHub CLI v2.94+ 関連の外部仕様主張(5件)を一次資料で検証し、4件が confirmed(GitHub CLI v2.94.0 の --add-blocked-by 等のフラグ、gh issue view --json blockedBy,blocking、REST API の blocked_by endpoint、relationship type ごと最大50件の制限)、1件(CLI 内部の mutation 実行順序の詳細)は公開資料に記載がなく unable_to_verify でしたが、これは Issue 本文の実際の記述には影響しません。

    Verification 結果

    • fresh canonical preflight: STATUS: pass / NEXT_ACTION: proceed(structural repair disposition: no_missing_fields_detected)。
    • fresh Step 2 review(deterministic): canonical_step2_route: step_2_5 → verdict: approve / next_action: proceed。rewrite ループは2回の needs-fix(runtime-verification タグ欠落 + VC broad search path、および VC unexpected-pass)を経て解消。
    • Step 2.5 semantic design review applicability: semantic_review_applicable: false(checker_gap_count=0、heuristic_concern_count=0、severity_tagged_anchor_findings=[]、owner_decision_conflict=false、cross_contract_change すべて false)→ Step 2.5 はスキップし直接完了。

    unresolved findings

    なし。anchor comment の P0 findings(4件)はすべて反映済み。P1 findings(3件)もすべて反映済み。P2(GitHub CLI transport 位置づけの記述更新)は quality improvement 扱いのため Out of Scope に留め、AC/VC には含めていません。

    refinement-ready: yes

    次の推奨アクション

    本 Issue は issue_kind: implementation であり、通常の canonical routing では承認完了時に LOOP_HANDOFF_RESULT_V1 marker 経由で impl-review-loop への自動 handoff が発生しますが、今回のセッションでは「実装フェーズを開始しない」という明示指示があったため、この自動 handoff は意図的にスキップしています。実装に進む場合は、別途 /impl-review-loop 2435 を明示的に実行してください。

  6. changed the title [-]改善: issue-refinement-loop の hard dependency を GitHub native blockedBy に materialize / readback する[/-] [+]実装: issue-refinement-loop の hard dependency を GitHub native blockedBy に materialize / readback する[/+] on Aug 30, 2026
  7. squne121 commented on Aug 30, 2026

    @squne121
    OwnerAuthor

    implement-issue: 実装完了 (2026-08-30T10:25:52Z)

  8. self-assigned this
    on Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions