Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: parent
goal_ref: "Claude-GPT上でIssue契約修復、fresh review、条件付き実装を一続きに実行した際、delegation transport・runtime capability・skill handoffの不整合で途中停止しない状態にする"
change_kind: workflow
parent_mode: delivery-rollup
closure_mode: child-completeSummary
Issue #2230 上で、Claude-GPT が該当プロンプトを完走できなかった理由を検証させたところ、以下の三層でワークフロー契約が分離していることが判明した。
- Claude-GPT の Spark delegation transport が現行 Claude Code の Agent tool schema と不整合
- Claude-GPT 起動前 preflight と、skill が要求する実行 capability が不整合
- issue-refinement-loop の handoff 条件と impl-review-loop の intake 条件が相互矛盾
この Parent issue は、上記 3 層を解消する child issue 群(Child A/B/C)と、それらを統合検証する Child D を束ねる delivery-rollup tracking である。
2026-08-21 の anchor review(https://github.com/squne121/loop-protocol/issues/2271#issuecomment-5368571793)が REQUEST_CHANGES を判定し、Child B の mutation broker 前提の矛盾(P0-1)、Parent closure が統合 E2E を要求しない点(P0-2)、Child 間依存順序が advisory prose に留まる点(P0-3)を指摘した。本 Issue はこの anchor review を反映して改訂されている。
Goal
Claude-GPT 上の root/main thread が、次の工程を安全かつ再開可能に実行できる状態にする。
- workflow capability preflight
- optional Spark delegation
- Issue 契約修復と mutation readback
- parent rollup と readback
- current live body に対する fresh contract review
- implementation entry 判定
- impl-review-loop による実装・検証・PR review
- merge 直前で停止
Desired Destination
- Child A/B/C の実装完了後、単一の統合 clean HEAD(Child D)上で Claude-GPT が Issue 実装: visual-impact-policy-trusted の decision/evidence artifact に run_attempt identity を結合する #2230 相当の作業プロンプトを再実行し、typed terminal result(
draft_pr_ready/blocked/human_judgment_required/implementation_not_authorized)のいずれかへ到達すること - 未分類の Agent schema error、raw
gh認証失敗、遅延したuv_not_foundを発生させないこと - child issue 完了ごとに本 Parent の
## Child Issuesチェックボックスを更新すること
Current Validated Scope
- 本 Parent issue 自体はコンテキストコンテナであり、実装作業は行わない
- 実装作業範囲は各 child issue の Allowed Paths に限定される
- 三層の不整合が存在するという診断結果(実装: visual-impact-policy-trusted の decision/evidence artifact に run_attempt identity を結合する #2230 comment 分析)は validated
- Mutation Transport Decision(下記)は 決定: GitHub mutation を minimal harness に縮退し server-side protection と live readback を正本にする #2223 の現行 Owner Decision と整合していることを確認済み
Decisions Fixed
- 2026-08-21: 実装: visual-impact-policy-trusted の decision/evidence artifact に run_attempt identity を結合する #2230 comment 分析に基づき、不整合を 3 層(Spark delegation transport / capability preflight / loop handoff 契約)に分解し、それぞれ独立した child issue で解決する方針を確定した
- 2026-08-21: 本 Parent は
delivery-rollupとして運用し、closure は child issue 全完了時点とする - 2026-08-21: anchor review REQUEST_CHANGES を反映し、Mutation Transport Decision の固定、Dependency Graph の normative 化、Parent Closure Rule への integration gate 追加、Child D の追加を確定した
Quality Decision Record
Status: N/ADecision Date: 未記録Does this prove the parent goal complete?: N/AReason:delivery-rollupparent のため quality-gate 判定は行わないEvidence: N/ANext Action: Child A/B/C/D 全完了後に closure 判定を行う
Mutation Transport Decision
Issue #2223 の現行 Owner Decision(https://github.com/squne121/loop-protocol/issues/2223)を canonical route として採用する。
- canonical route: capability-scoped mutation actor(対象 operation の GitHub mutation capability を明示的に割り当てられた Agent/SubAgent)が使用する operation-scoped native GitHub client / connector / gh の直接使用(承認済み native route)
- generic production mutation broker の存在は前提にしない
- mutation authority は agent hierarchy(root/main thread / nested / leaf という深さ)では判定しない。各 Agent/SubAgent に明示的に割り当てられた capability/role contract(frontmatter の
tools/disallowedTools/permissionMode等)で判定する。mutation capability を明示的に持つ Agent/SubAgent(issue-editor/issue-creator等)は責務範囲内で mutation してよく、条件を満たす nested delegation も許可する - read capability と write(mutation)capability を別々に判定する。read route の存在だけで mutation-ready と判定しない
- mutation 手順: pre-readback → 単一の明示的 mutation → post-readback → 不一致なら追加 mutation せず停止
- 決定: GitHub mutation を minimal harness に縮退し server-side protection と live readback を正本にする #2223 を再度 supersede して production broker を復活させない
- 新しい enforcing hook は追加しない
Child B(#2273)はこの決定に整合するよう reframe 済みである(2026-08-22 追記: #2273 は当初 2026-08-21 時点の reframe で「root-owned mutation route」という hierarchy-based な残存表現を含んでいたが、同日付 OWNER 敵対的レビュー(#2273 (comment) )を受けて「capability-scoped mutation actor + operation-scoped native GitHub route」へ置換済み。本 Parent の Mutation Transport Decision も同レビューを反映し同日付で更新した)。
2026-08-22 追記(同日 Child B への追加 OWNER 敵対的レビュー #2273 (comment) を反映): PR #2303 により launch.sh からの GitHub 認証は native gh CLI 経由(Claude Code 本体と同一の認証情報共有)が実際の transport となったことが確定した。この事実を受け、Child B の AC10 および AC7-9 は write permission の可否をあらかじめ blocked と決め打ちせず unverified として判定し、正しさは mutation 前後の live readback(#2223 のモデルに準拠)で担保する方針に更新されている。本 Mutation Transport Decision もこの更新と整合する。
scripts/claude-gpt/launch.sh は 2026-08-21 時点では Claude/AGY 子プロセスに対して HOME/GH_CONFIG_DIR の隔離・GH_TOKEN/GITHUB_TOKEN の unset・MCP 空 config(mcpServers: {})を適用していた。上記 anchor review は、この隔離が続く限り Claude-GPT 実行環境からの GitHub write positive lane が preflight 上つねに unavailable になり得ることを指摘した(P0-2)。
2026-08-22 追記(Child B #2273 への新規 OWNER 敵対的レビュー #2273 (comment) を受けた事実更新): PR #2303(merged, commit c3cbe6c)が launch.sh を変更し、GitHub 認証関連の env var(GH_CONFIG_DIR/GH_TOKEN/GH_HOST/GH_REPO)は Claude-GPT 子プロセスへ native Claude Code と同様に共有されるようになった(native GitHub auth)。隔離されたまま残るのは SSH/GPG/credential-helper 関連の secret のみである。したがって上記の「GitHub write positive lane が preflight 上つねに unavailable になり得る」という懸念は #2303 により解消済みの事実であり、本 Parent はこれを stale な指摘として supersede する。
この隔離アーキテクチャ自体の解消方針(隔離継続 vs Claude Code との機能同等性優先への変更)は、#2303 によって GitHub 認証部分は機能同等性優先へ既に変更済みという確定事実になったため、この点についてはもはや open な Owner Decision ではない。ただし、隔離アーキテクチャ全体(SSH/GPG/credential-helper を含む)の設計判断自体は、引き続き本 Parent および Child B(#2273)のスコープ外として扱う。Child B は現状の(更新後の)availability を正直に報告するに留め、存在しない broker や代行 route を前提にした fallback を実装しない。
Parent Closure Rule
delivery-rollup: 以下をすべて満たした場合に限り本 Parent を close する(Child A/B/C の close だけでは close しない)。
parent_closure_requirements:
- child_a_pr_merged # Child A (#2274)
- child_b_pr_merged # Child B (#2273)
- child_c_pr_merged # Child C (#2272)
- child_d_completed # 統合 E2E gate(下記 Child Issues 参照)
- mutation_transport_decision_is_current # 上記 Mutation Transport Decision と現在の #2223 Owner Decision が整合
- integration_head_is_clean
- issue_2230_equivalent_prompt_executed
- typed_terminal_result_observed
- no_unclassified_agent_schema_error
- no_late_uv_not_found
- no_unclassified_github_mutation_failure
- sut_sha_claude_code_version_proxy_version_recordedquality-gate / routing-map / decision-log: N/A(本 Parent の parent_mode ではない)。Quality Decision Record は close 判定の必須材料にしないが、Child D 完了時点の証跡(SUT SHA・terminal result・reason_code)を close コメントに記録する。
Child Issues
- Child A (実装: Spark delegation の per-invocation model pin 回帰を解消し final-diff live E2E を必須化する #2274): Spark delegationのper-invocation model pin回帰を修正する (P0)
- Child B (実装: Claude-GPT に workflow-profile capability preflight と controlled GitHub route を配線する #2273): 現行 決定: GitHub mutation を minimal harness に縮退し server-side protection と live readback を正本にする #2223 Owner Decision に整合する workflow-profile capability preflight を実装する (P0)
- Child C (実装: issue-refinement-loop から impl-review-loop への fresh implementation entry contract を統一する #2272): issue-refinement-loopからimpl-review-loopへのhandoff契約を統一する (P1)
- Child D (統合: merged Child A/B/C の単一 clean HEAD で issue-to-impl E2E を検証する #2278): Child A/B/C の統合 clean HEAD 上で issue-to-impl E2E を検証する (P0, integration gate)
Dependency Graph
Child A #2274
|
v
Child B #2273
Child C #2272 は原則並行可能(shared docs は最終側が rebase)
Child A + Child B + Child C すべて merged
|
v
Child D(Integration Gate, #2278)
- Child B(実装: Claude-GPT に workflow-profile capability preflight と controlled GitHub route を配線する #2273)は Child A(実装: Spark delegation の per-invocation model pin 回帰を解消し final-diff live E2E を必須化する #2274)の merge 済み integrated result を implementation base SHA に含めることを着手前条件とする(advisory prose ではなく Child B 本文の
## Dependenciesに明記済み)。 - Child D(統合: merged Child A/B/C の単一 clean HEAD で issue-to-impl E2E を検証する #2278)は Child A・Child B・Child C すべての merge を前提条件とする(統合: merged Child A/B/C の単一 clean HEAD で issue-to-impl E2E を検証する #2278 本文の
## RelatedにBlocked by: #2272, #2273, #2274を明記済み)。
Remaining Parent Gaps
- Child D(統合: merged Child A/B/C の単一 clean HEAD で issue-to-impl E2E を検証する #2278)の実装完了と統合 E2E 実行(本 Parent の Desired Destination 達成条件)
- Child A/B/C の実装 PR マージ
Phase Handoff Contract
child issue(A/B/C/D)起票時に以下の構造を引き継ぐ:
Desired DestinationCurrent Validated ScopeRemaining Parent GapsCurrent ObjectiveBounded Current ContextNormative ReferencesAllowed PathsRequired SkillsValidation CommandsStop ConditionsOpen QuestionsNext ActionArtifact RefsHandoff Prompt DraftLinked PR(implementation のみ)
Outcome
Claude-GPT 上の root/main thread が、次の工程を安全かつ再開可能に実行できる状態にする。
- workflow capability preflight
- optional Spark delegation
- Issue 契約修復と mutation readback
- parent rollup と readback
- current live body に対する fresh contract review
- implementation entry 判定
- impl-review-loop による実装・検証・PR review
- merge 直前で停止
Child A/B/C の merge 後、Child D が単一の統合 clean HEAD から元の Issue #2230 作業プロンプト相当を再実行した際、以下のいずれかの typed terminal result へ到達する。
draft_pr_readyblockedhuman_judgment_requiredimplementation_not_authorized
途中で未分類の Agent schema error、raw gh 認証失敗、遅延した uv_not_found を発生させない。
Acceptance Criteria
- AC1: Spark preferred route が利用可能なら実 Spark SubAgent が完了する
- AC2: Spark preferred route が利用不能かつ fallback allowed なら、理由付き fallback 結果を返す
- AC3: trusted
uvや GitHub controlled route が不足する場合、SubAgent 起動・Issue mutation 前に停止する - AC4: Issue 修復後の fresh review が
goの場合だけ impl-review-loop へ進む - AC5: stale comment/snapshot 単独では実装を authorize しない
- AC6: raw
gh、rawgit push、ambient HOME credential を fallback route にしない - AC7: 各 mutation phase 後に live readback を行い、中断時に決定論的な再開点を返す
- AC8: PR merge は行わず、人間の merge 判断直前で停止する
- AC9: 新しい永続 ledger、digest-bound authorization、独自 graph control-plane を追加しない
- AC10: Mutation Transport Decision が 決定: GitHub mutation を minimal harness に縮退し server-side protection と live readback を正本にする #2223 の現行 Owner Decision と矛盾しない
- AC11: Child D が Child A/B/C 統合後の単一 clean HEAD 上で typed terminal result への到達を証跡(SUT SHA・Claude Code version・proxy version)付きで確認する
- AC12: Child A/B の実装順序が normative dependency(base SHA 条件)として Child 本文に明記されている
Required Design References
- Issue 導入: AIエージェント運用をminimal harnessへ縮退し、過剰なcontrol-planeを廃止する #1860
- Issue 実装: 通常 claude-gpt 対話中、明示 @ 指示時だけ GPT-5.3-Codex-Spark SubAgent を起動する #2186 / PR 実装: claude-gpt session内でexplicit @agent-spark-codex明示時だけGPT-5.3-Codex-Spark SubAgentを起動する #2244
- Issue 実装: @agent-spark-codex を構造化 delegation directive で自然言語要求から起動可能にする #2258 / PR 実装: @agent-spark-codex を構造化 delegation directive で自然言語要求から起動可能にする (#2258) #2263
- Issue 決定: GitHub mutation を minimal harness に縮退し server-side protection と live readback を正本にする #2223(Owner Decision: capability/role-based mutation authority model、generic production broker 不採用)
- docs/dev/workflow.md
- docs/dev/agent-skill-boundaries.md
Related
- Source analysis: 実装: visual-impact-policy-trusted の decision/evidence artifact に run_attempt identity を結合する #2230 (comment)
- Owner Decision: https://github.com/squne121/loop-protocol/issues/2223(capability/role-based mutation authority model。本 Parent の Mutation Transport Decision はこの Owner Decision に整合させた)
- Anchor review(2026-08-21, 本改訂の根拠): 導入: Claude-GPT → issue-refinement-loop → impl-review-loop の実行契約を end-to-end で整合させる #2271 (comment)
- Anchor review(2026-08-22, Mutation Transport Decision 用語更新の根拠): 実装: Claude-GPT に workflow-profile capability preflight と controlled GitHub route を配線する #2273 (comment)
- Anchor review(2026-08-22, OWNER 敵対的レビュー on Child B, launch.sh GitHub auth 事実更新の根拠): 実装: Claude-GPT に workflow-profile capability preflight と controlled GitHub route を配線する #2273 (comment)
Notes
なし
Activity
squne121 commentedon Aug 21, 2026
判定
REQUEST_CHANGES。Issue #2271 の問題診断は妥当ですが、現行の Parent/Child 契約では実装開始を許可できません。
確認時点の対象は
main@59c323afです。三層への分解自体は、#2230 の作業ログ、現行impl-review-loop資産、Spark delegation の回帰状況と整合しています。問題は、Child B が現在の Owner Decision と矛盾していること、Parent が最終 E2E 未実施のまま閉じられること、Child 間の実装順序と統合責務が定義されていないことです。P0-1 — Child B が、#2223 で明示的に不採用となった production broker に依存している
Child B #2273 は、次を前提にしています。
#2223 mutation brokerの non-mutating capability probeghは fallback として使用しないしかし、現在の #2223 は implementation Issue ではなく Owner Decision record へ変更されており、以下を明示しています。
ghを直接使用するしたがって、#2273 が probe しようとしている canonical production broker は、現在の設計上は存在せず、今後も作らない方針です。
必要な修正は Child B の reframe です。 以下のいずれかを Owner Decision として明示的に選ぶ必要があります。
root-owned connector route
ghcredential を Claude 子プロセスへ戻さないhost-mediated mutation boundary
決定: GitHub mutation を minimal harness に縮退し server-side protection と live readback を正本にする #2223 を再度 supersede
現方針との整合性からは、1または2が妥当です。Child B の「non-mutating probe」は、read route の存在確認と write capability を別 field に分離すべきです。read-only probe が通っただけで mutation-ready と判定してはいけません。
P0-2 — Parent の closure rule が、Parent 自身の Goal 完了を証明しない
Parent は次を Remaining Parent Gap として明記しています。
一方、Parent Closure Rule は、
となっており、Quality Decision Record も必須ではありません。つまり、最終統合 E2E が未実施でも、三つの Child が閉じれば Parent を閉じられます。
さらに、各 Child は最終統合 E2E を自分の scope から除外しています。
Child A は Spark route 単体の live smoke
Child B は capability preflight 単体
Child C は handoff policy と consumer の契約テスト
三変更をマージした単一 HEAD での 実装: visual-impact-policy-trusted の decision/evidence artifact に run_attempt identity を結合する #2230 相当実行は、どの Child の完了条件にも含まれていない
修正案
Parent を次のいずれかへ変更してください。
Child D を追加する
統合: merged Child A/B/C の単一 clean HEAD で issue-to-impl E2E を検証するまたは Parent closure に明示的な integration gate を追加する
推奨 closure は次です。
ここで
typed_terminal_resultはdraft_pr_readyである必要はありません。正しい preflight によるblockedや、正しい判断によるhuman_judgment_requiredでも、未分類例外ではなく契約どおり到達したことを証明できれば Parent Goal の対象になります。P0-3 — Child A/B の依存順序が advisory に留まり、統合差分を保証しない
Child A と Child B は、少なくとも以下を重複して編集します。
scripts/claude-gpt/launch.shscripts/claude-gpt/lib.shscripts/claude-gpt/tests/test_delegation_directive.pydocs/dev/workflow.mdコメントでは「並行 PR は避け、片方をマージ後にもう片方を rebase」とされていますが、明示的な dependency は設定しない方針です。
これは不十分です。rebase は textual conflict を解消するだけで、以下を保証しません。
必須 dependency graph
Child B の
Depends on Child Aは advisory prose ではなく、着手前条件と base SHA 条件にしてください。P0-4 — Child A の「custom agent definition へ一本化」だけでは model pin にならない
Child A は
updatedInput.modelの外部 model ID 注入を撤去し、session-local custom agent definition のmodelに一本化する方針です。この方向は、実 runtime schema が per-invocation full ID を拒否した事実への修正として妥当です。ただし、Claude Code の現行 model resolution 順序は次です。
CLAUDE_CODE_SUBAGENT_MODELさらに、model allowlist により指定 model が使用できない場合、継承 model への置換が起こり得ます。SubAgent は現行版では background が既定であり、環境変数でも background behavior が変わります。(Claude)
Child A は
CLAUDE_CODE_SUBAGENT_MODELを Out of Scope にしていますが、設定変更を Out of Scope にすることと、その変数が未設定または無害であることを検証しないことは別です。最低限、次の negative control が必要です。
CLAUDE_CODE_SUBAGENT_MODEL未設定-異なる model が指定されている
inherit相当の値availableModelsが Spark を許可しないCLAUDE_CODE_FORK_SUBAGENT=1run_in_background: trueが tool input に明示されるCLAUDE_CODE_DISABLE_BACKGROUND_TASKS=1を scoped に使う場合の readbacklauncher が
env -iにより ambient 値を除去しているなら、それを 実装上の暗黙前提ではなく、テストされた invariant にしてください。また、upstream proxy の current registry に
gpt-5.3-codex-sparkが存在することは確認できますが、catalog 登録は account entitlement、Claude Code schema compatibility、実際の SubAgent route 成功を保証しません。PR #2263 では、先行 live run 後の fix delta で
updatedInput.modelpin が加わり、最終差分の live E2E が静的 test に置き換わったことが今回の回帰原因です。したがって Child A の「最終 commit に対する live smoke 必須化」は正しいですが、SUT SHA と evidence SHA の完全一致を機械判定する必要があります。P1-1 — 現行 runtime smoke の
--agents経路が launcher policy と自己矛盾している現行
lib.shは caller-supplied--agentsを policy-weakening flag として拒否対象に含めています。一方、現行
runtime_smoke_test.shの SubAgent canary は、次の形で launcher の後段引数に--agents "$CANARY_AGENTS_JSON"を渡します。静的な code path 読解では、この invocation は launcher の forbidden flag 判定に到達します。
本レビューでは実機 smoke を再実行していないため、runtime 結果自体は断定しません。ただし Child A は
runtime_smoke_test.sh --spark-delegationを canonical VC にする以上、次を明示的に修復すべきです。--agentsは引き続き拒否「既存 ordinary SubAgent smoke が回帰しない」だけでは、既に壊れている baseline を固定する可能性があります。AC10 は positive control が実 Agent 起動を観測したことまで要求してください。
P1-2 — Child A の preferred fallback live test が再現可能になっていない
Child A は次を同時に要求しています。
preferred + fallback: allowedの live failure/fallback 確認-意図的 quota exhaustion は行わない
このままでは、実 Spark が正常な環境で preferred fallback failure を決定論的に発生させる方法がありません。
検証を次の二つに分離すべきです。
Live positive
Hermetic negative
実 provider 障害を待つテストは再現可能な Verification Command ではありません。
P1-3 — Child C の direct handoff transport が未定義
Child C の問題認識は正しいです。現行資産では、
impl-review-loopの advisory policy は stale/missing snapshot を停止理由にしないsteps/preparation.mdの後段には stale review hard stop があるLOOP_HANDOFF_RESULT_V1の実 consumer がimpl-review-loopに存在しないという不整合があります。
一方、現在の
LOOP_HANDOFF_RESULT_V1は Issue comment に publish される durable audit artifact です。Child C は「過去 comment は authorization にしない」「same-invocation direct handoff を consumeする」としていますが、direct transport の型、寿命、受け渡し方法が未定義です。次の契約を明記してください。
既存
issue-contract-reviewparser はすでにcontract_body_sha256、allowed_paths_normalized_sha256、base_ref、base_sha_at_snapshot等を要求しています。新しい独立 freshness tuple を作らず、既存 fingerprint parser を再利用すべきです。重要なのは次の分離です。
これは durable authorization packet を新設せず、#1860 の minimal harness と両立します。#1860 は live Issue/PR、実 diff、実 test、current-head CI、独立 review を authority とし、新規 ledger/digest control-plane を禁止しています。
P1-4 — Child C の「pytest で runtime verification 完了」は証明範囲が不足している
Child C は runtime verification を immediate としつつ、理由を「pytest による契約テストで即時検証可能」としています。
しかし対象は単純な parser ではなく、次の process-level workflow です。
最低限、fake GitHub transport を用いた integration test が必要です。
go→ Step 1request_changes/blocked→ stop-再開時は deterministic
resume_fromParent の最終 clean-worktree E2E は、この Child の unit/integration testとは別に必要です。
P1-5 — Child B の capability schema と既存 preflight 出力契約が不整合
既存
preflight.shは stdout にCLAUDE_GPT_PREFLIGHT_RESULT_V1の JSON を返し、proxy、認証、canonical path、read restriction を構造化しています。Child B は Outcome で
CLAUDE_GPT_WORKFLOW_CAPABILITIES_V1を掲げる一方、Runtime Verification では「構造化 YAML」と記述しています。以下へ固定すべきです。
format: JSON
stdout: exactly one JSON object
stderr: human-readable diagnostics
exit code:
0: ready または degradedcapabilityごとに:
requiredapplicablestatusevidence_sourcereason_coderemediation例:
{ "schema": "CLAUDE_GPT_WORKFLOW_CAPABILITIES_V1", "status": "blocked", "capabilities": { "trusted_uv": { "required": true, "status": "blocked", "reason_code": "trusted_uv_missing" }, "spark": { "required": false, "status": "fallback_only" }, "github_read": { "required": true, "status": "available" }, "github_mutation": { "required": true, "status": "unproven", "reason_code": "canonical_mutation_transport_not_selected" } } }available、verified_read_only、mutation_unprovenを混同しないことが重要です。P1-6 —
uvremediation が、拒否対象の公式デフォルト install へ戻る可能性があるリポジトリは
uv == 0.11.29を project pin としています。一方、Astral の standalone installer は user executable directory を既定の配置先とし、Unix 環境では
~/.local/bin/uvが一般的な配置先です。Child B はこの位置を明示的に拒否します。([Astral Docs]2)したがって AC9 の remediation を単に「uv をインストールする」とすると、次回 preflight でも
trusted_uv_missingになります。remediation は少なくとも次を含む必要があります。
0.11.29-実 binary の
uv --version自動
sudoは不要ですが、operator が実行する具体的な trusted installation pathは必要です。P1-7 — Parent の terminal result は列挙だけで、状態機械になっていない
Parent は次の四つを terminal result としています。
draft_pr_readyblockedhuman_judgment_requiredimplementation_not_authorizedしかし、各 Child がどの phase、reason、retry semantics でこれらへ写像するか定義されていません。
root-owned output-only envelopeを定義すべきです。これは永続 ledger や authorization packetではありません。
状態は相互排他的・網羅的である必要があります。
blockedではなく degraded continuationuv不足 → mutation 前blockedrequest_changes→implementation_not_authorizedhuman_judgment_requireddraft_pr_readyblockedに丸めずinternal_contract_errorとして区別P1-8 — mutation readback と deterministic resume の最小規則が不足している
Parent AC7 は「各 mutation phase 後に live readbackを行い、中断時に決定論的な再開点を返す」としていますが、Child B/C 間で mutation ownership と resume semantics が分かれています。
#2223 の Owner Decision に沿い、root-owned mutation は次へ限定してください。
body hash は authorization authority ではなく、同時変更検出と fresh review のための correctness bindingとしてのみ使用します。
P2 — 本文に既に stale / contradictory な記述がある
修正対象は次です。
Decision Date: 未記録のままです。推奨する Issue #2271 の最小改訂
Parent Closure Rule
Child Issues
Dependency Order
追加 Acceptance Criteria
最終評価
implementation_not_authorizedsqune121 commentedon Aug 21, 2026
はい。現行の
issue-refinement-loopは、通常は「指定した1 Issue」を mutation 対象にする設計と考えるのが正しいです。入力も単一のissue_numberで、Step 4 はissue-editorに「現在の Issue」の rewrite を委譲します。scope rollup にもamend_current_issueはありますが、既存 sibling を一括修正するamend_related_issueのような action はありません。Step 4.5 は child/follow-up の作成・再利用を扱いますが、既存 sibling Issue 本文の自動追随更新とは別です。また、
issue-refinement-loopの iteration 承認は既にdefault_required: falseです。つまり「needs-fix → 次 iteration」は人間承認なしで継続するのが標準ですが、これは Claude Code 自体の permission mode や--dangerously-skip-permissionsを変更する意味ではありません。今回については、明示的な multi-Issue refinement として #2271 + #2272/#2273/#2274 を同期修正し、Child D も materialize するのを推奨します。レビューの最終 routing 自体が「Owner mutation-route decision → Child A → Child B、Child C は並行可能 → Child D integration gate」を推奨しています。
特に #2273 は現在も「#2223 mutation broker」を前提にしており、現行 #2223 の「generic production broker は作らない・root/main が mutation を所有・通常 mutation は client/connector/gh + pre/post live readback」という Owner Decision と正面衝突しています。ここはレビューの選択肢1 root-owned connector route を採るのが最小変更です。
#2274 の追加指摘も有効です。Claude Code の現行公式仕様では subagent model resolution は
CLAUDE_CODE_SUBAGENT_MODEL→ per-invocation → agent definition → parent の順で、availableModelsの影響も受けます。また v2.1.198 以降は subagent が background 既定です。したがって review が要求している env/allowlist/background の negative control を Issue に反映する価値があります。([code.claude.com]1)今後についても、「関連Issueも修正」「sub issueも修正」などと明示された場合は、対象Issueだけでなく指定された関連Issue群も更新対象として扱います。明示がない通常の
issue-refinement-loop依頼では single-target mutation のまま扱います。以下をそのまま Claude Code に渡せます。
Claude Code 作業プロンプト — Issue #2271 multi-Issue refinement
対象リポジトリ:
squne121/loop-protocol対象 Parent Issue:
trusted human-context anchor:
既存 sub issues:
目的
上記 anchor comment の
REQUEST_CHANGESを対象にissue-refinement-loopを実行し、Parent #2271 だけでなく、レビュー指摘の影響を直接受ける既存 sub issue #2272/#2273/#2274 も同期して refinement する。必要なら integration verification 用の Child D を dedupe 後に新規 materialize し、Parent #2271 の child / dependency / closure contract と整合させる。
この作業は Issue contract の refinement が目的であり、Child A/B/C のコード実装や
impl-review-loopの実行までは行わない。承認済みスコープ
このプロンプト自体を operator-selected trusted human-context directive として扱う。
以下は人間による事前承認済みであり、途中で改めて承認を求めないこと。
上記の multi-Issue scope expansion 自体を
human_judgment_requiredの理由にしない。ただし、この承認範囲を超える新しい semantic scope、destructive operation、権限昇格、外部 credential の要求、無関係な Issue の変更などが新たに必要になった場合は、既存 hard-stop policy を無効化せず typed blocker として停止する。
人間承認不要の loop policy
issue-refinement-loopはmax_iterations: 3を使用する。needs-fixから次 iteration へ進む際の repository loop approval は不要とし、自動継続する。ただし、これは Claude Code の permission model を変更する指示ではない。
以下は禁止する。
--dangerously-skip-permissionsbypassPermissionsGitHub mutation ownership
#2223 の現在の Owner Decision を authority とする。
採用する mutation route は root-owned GitHub mutation route とする。
原則:
SubAgent は調査・レビュー・candidate body/proposal の生成に使用し、実 GitHub mutation は root/main thread が行うこと。
legacy skill procedure と #2223 Owner Decision が衝突する場合は、#2223 の root-owned mutation ownership を優先し、skill 自体のコード変更には今回踏み込まない。
必須 SubAgent
少なくとも以下を使用する。
codebase-investigator
以下を調査させる。
mainissue-refinement-loopimpl-review-loopscripts/claude-gpt/-関連 tests/docs
web-researcher
anchor comment の external/runtime claim を current upstream documentation で再検証させる。
最低限:
CLAUDE_CODE_SUBAGENT_MODELmodelavailableModelsCLAUDE_CODE_FORK_SUBAGENTCLAUDE_CODE_DISABLE_BACKGROUND_TASKS--agentssession-local agent definition behavior一次情報・公式 documentation を優先する。
issue-reviewer
各 mutation 後の current live body を独立にレビューさせる。
SubAgent を起動したら、必ず全 SubAgent の完了を待ってから root/main thread が判断すること。
background のまま結果未取得で「完了」と扱わない。
Step 1 — live state と anchor の fact-check
最初に live state を取得する。
レビュー時点の
main@59c323afを現在の authority と仮定しない。current
main、live Issue body/comments、関連 Issue/PR、repository assets を再取得して anchor comment の各 blocker を fact-check する。anchor を stale snapshot として盲目的に適用せず、
を分類する。
ただし anchor comment は trusted human-context feedback なので、事実確認後も成立している REQUEST_CHANGES は rewrite input として扱う。
Step 2 — Parent #2271 refinement
#2271 に
issue-refinement-loopを適用する。anchor:
https://github.com/squne121/loop-protocol/issues/2271#issuecomment-5368571793Parent では最低限以下を修正する。
Mutation transport decision
#2223 と整合する以下の判断を固定する。
#2223 を再 supersede して production broker を復活させない。
Dependency graph
実装順序を normative にする。
「必要なら rebase」の advisory prose だけで済ませない。
可能なら GitHub native dependency も同期する。
Parent Closure Rule
Child A/B/C が close しただけでは Parent を close できないようにする。
少なくとも以下を closure requirements に含める。
uv_not_foundがないStep 3 — Child B #2273 を全面 reframe
#2273 は anchor review の P0-1 を受けるため、単なる部分追記ではなく contract の意味を修正する。
現在の以下の前提を除去する。
#2223 mutation broker新しい Outcome は概ね以下とする。
workflow-profile issue-to-implがuvを別々に評価し、
GitHub mutation が必要な phase では root-owned mutation route が利用可能かを事前判定する。
read-only route の存在だけでは write capability を PASS にしない。
raw credential を leaf SubAgent へ渡さない。
GitHub mutation correctness は root/main による pre/post live readback で担保する。
また #2273 は #2274 の final route semantics を前提として実装されるため、
Depends on #2274を着手前条件として明文化する。
Step 4 — Child A #2274 を補強
基本方針である
updatedInput.modelへの external full model ID injection を撤去し、session-local custom agent definition を使うという方向は維持する。
ただし model pin の成立条件を追加する。
最低限以下を AC / VC に反映する。
CLAUDE_CODE_SUBAGENT_MODELunsetinheritavailableModelsが Spark を許可しないケースCLAUDE_CODE_FORK_SUBAGENT=1CLAUDE_CODE_DISABLE_BACKGROUND_TASKS=1ambient environment が launcher により除去されるなら、それを「暗黙前提」ではなく tested invariant にする。
smoke harness
caller-supplied
--agentsが launcher policy 上 forbidden なら、runtime smoke から caller-owned--agentsを渡す設計にしない。canary/custom agent fixture は launcher-owned/session-owned test fixture として内部合成する契約にする。
以下を検証対象に含める。
live / negative verification 分離
provider failure を待つ nondeterministic VC にしない。
へ分割する。
negative case では少なくとも
を決定論的に検証する。
live evidence の SUT SHA と最終 Issue/PR が要求する implementation SHA が一致することを machine-checkable にする。
Step 5 — Child C #2272 を補強
same-invocation direct handoff の transport を曖昧な prose のままにしない。
新しい durable ledger / authorization packet / digest control-plane は作らない。
authority は current root invocation 内だけで有効な ephemeral implementation-entry decision とする。
少なくとも以下を contract として定義する。
既存 GitHub comment 上の
LOOP_HANDOFF_RESULT_V1は audit/history として扱い、過去 comment 単独を implementation authorization にしない。impl-review-loopが same-invocation direct result を実際に consume する process-level regression test を要求する。body drift / base SHA drift が起きた場合は decision を invalidation し、fresh review/preflight へ戻ること。
Step 6 — Child D を materialize
まず dedupe search を行う。
同一目的の open Issue が存在しなければ、Parent #2271 の新しい child として以下の Issue を作成する。
推奨タイトル:
統合: merged Child A/B/C の単一 clean HEAD で issue-to-impl E2E を検証する目的:
Child A/B/C が統合された単一 clean HEAD 上で #2230 相当 workflow を実行し、Parent #2271 の Goal が実際に成立したことを確認する。
Child D は原則として verification/integration gate とし、無関係な production code を追加しない。
E2E で新しい実装 defect が見つかった場合は、Child D に無制限に code scope を吸収せず follow-up Issue として materialize する。
Child D は #2272/#2273/#2274 の completion を prerequisite とする。
Parent #2271 の
## Child Issues、closure rule、native sub-issue relationship を同期する。Step 7 — multi-Issue fresh review
mutation 後、必ず live readback する。
対象:
各 Issue について current body を入力に fresh review を行う。
implementation Issue は current body に対して contract readiness / issue review を再実行し、stale snapshot を approval に使わない。
needs-fixの場合は iteration budget 内で自動 rewrite → fresh review を継続する。途中 iteration ごとの人間承認は求めない。
Parent #2271 は delivery-rollup parent なので、implementation handoff marker を生成する対象として扱わない。
Mutation consistency
複数 Issue を一括で「成功したこと」にしない。
Issue ごとに以下を行う。
partial failure が発生した場合は、成功済み mutation を推測で巻き戻さず、live state を再取得して deterministic resume point を返す。
完了条件
以下をすべて満たしたら終了する。
最終報告
最後に簡潔に以下を報告する。
Issue refinement 完了後は impl-review-loop を自動開始しない。
今回の作業は refined Issue set が implementation-ready な状態になったところで停止する。
この形なら、今回の「sub issue も直す」が単なる参考指示ではなく、明示的に許可された mutation scope になります。また、Child B を先に直すのではなく、設計上は #2274 → #2273、#2272 は並行、最後に Child D が最も整合的です。
squne121 commentedon Aug 24, 2026
全 child issue (#2272, #2273, #2274, #2278, #2311) が CLOSED になったため、delivery-rollup parent として本 Issue を close します(post-merge-cleanup、PR #2325 マージ起点、closure_mode: child-complete)。