Skip to content

調査: isolated issue-creator の GitHub read/mutation 経路を deterministic execution boundary に再設計する #2292

Closed as not planned

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: research
parent_issue: "none"
goal_ref: "isolated Claude-GPT の issue creation workflow が、LLM の procedural compliance や ambient GitHub credential に依存せず、Issue #2223 の minimal-harness Owner Decision と両立する deterministic execution boundary を持てる設計を確定する"
change_kind: research-only
related_decisions:
  - "#2223: GitHub mutation を minimal harness に縮退し server-side protection と live readback を正本にする Owner Decision(CLOSED, COMPLETED)。新規 generic mutation broker・新規 enforcing PreToolUse hook を追加しない、が確定方針。"
  - "#2259: 実装: isolated Claude-GPT の issue.create 要求を parent-mediated narrow bridge で処理する(PR #2286, Draft・HOLD中)。本 Issue の調査対象である 10番目相当のAC(bridge到達要件)に関するflakinessの発見元。"

Parent Issue

none

Outcome

isolated Claude-GPT の issue creation workflow(dedupe read + mutation create + readback)が、LLM の自然言語 procedural compliance にも、child への ambient GitHub credential 付与にも依存しない deterministic な execution boundary を持つ設計案を確定し、次に何を実装すべきかの owner decision が可能な状態にする(推奨設計1案 + 後続 implementation Issue の scope 草案が本 Issue 本文に記載され、owner がそれを承認すれば直ちに実装 Issue を起票できる状態)。この設計は Issue #2223 の Owner Decision(新規 generic mutation broker を作らない、新規 enforcing hook を追加しない)と両立しなければならない。

Background

PR #2286(Issue #2259)のbridge到達要件に関するruntime system test は、create-issue skill の dedupe-check harness bug を修正した後も不安定なまま FAIL する。実機調査(3系統の独立 SubAgent 調査 + adversarial review)により、以下が事実として確定した:

  • 失敗原因は Auto Mode / permission classifier の拒否では ない(stdout/stderr に拒否文言は一切存在しない。独立 control-plane 再現でも同様)。
  • genuine issue-creator SubAgent は、dedupe 検索成功後、canonical mutation helper(.claude/skills/create-issue/scripts/create_issue_txn.py、bridge 経由)を呼ばずに、自身の判断で raw gh issue create を直接 Bash 実行することがある。
  • .claude/agents/issue-creator.md はこの mutation 経路について「procedural contract であり Bash tool レベルでの技術的な強制ではない」と明記している。つまりこの挙動は仕様上想定内であり、bug ではなく既存アーキテクチャの設計限界である。
  • .claude/skills/create-issue/SKILL.md Step 1.5(重複チェック gh issue list)も同様に、生の Bash から直接 gh を呼ぶ設計であり、isolated(credential-stripped)環境では認証エラーになる。
  • 敵対的レビューにより、新規 PreToolUse enforcing hook でこの raw gh 実行を技術的に deny する対応は、Issue 決定: GitHub mutation を minimal harness に縮退し server-side protection と live readback を正本にする #2223 の Owner Decision(新規 enforcing hook を追加しない)と衝突すると判定された。
  • 一方、Claude Code 公式ドキュメント調査により、hook に依存しない agent-local な技術的境界(tools frontmatter から Bash を除外する/MCP tool 経由に限定する/disallowedTools でコマンドパターンを deny する等)が存在する可能性が示唆された(要検証・要バージョン確認)。

In Scope

  • gh issue list 等の read plane(semantic dedupe に必要な read operation)を isolated child にどう提供するか
  • canonical create transaction(create_issue_txn.py)とその後の post-create authoritative readback(GitHub からの post-create GET を根拠にすること)
  • child の credential isolation を維持したまま、どこまでの capability を child に持たせるか
  • issue-creator SubAgent の tool surface(tools/disallowedTools/permissionMode/MCP server 限定 等)で raw gh 実行を技術的に不可能にできるか
  • skill preload と procedural contract の関係(procedural contract のままで良い operation と、技術的強制が必要な operation の切り分け)
  • Auto Mode 継承の実際の挙動(SubAgent の permissionMode が root session の autoMode 設定をどう継承するか)
  • hook を使う場合の Issue 決定: GitHub mutation を minimal harness に縮退し server-side protection と live readback を正本にする #2223 との衝突関係の詳細評価
  • narrow local bridge(既存の parent-mediated bridge パターンの拡張)/MCP server 経由専用化/parent-owned execution(child は closed-schema request のみ生成)の比較
  • production runtime と runtime smoke fake provider の equivalence boundary(テスト経路と本番経路の乖離を生まない設計)
  • 上記設計変更が波及する既存 caller(issue-creator を呼ぶ全 orchestrator: impl-review-loop, issue-refinement-loop, post-merge-cleanup 等)の migration cost
  • Issue 実装: isolated Claude-GPT の issue.create 要求を parent-mediated narrow bridge で処理する #2259 のbridge到達要件(runtime system test)を最終的にどう満たすか(この research の結論を反映した contract 修正の要否)
  • create-issue skill が使用する GitHub operation 全体(overlap preflight helper、post-create gh issue view、ready tuple 失敗時の gh issue comment 等 read/write 経路すべて)の網羅的な inventory 化
  • bridge server の request replay における atomic idempotency(同一 request ID の並行送信・crash window・payload mismatch を含む)

Out of Scope

Acceptance Criteria

  • AC1: create-issue workflow 内の全 GitHub read/write operation について、actor・credential owner・transport・input schema・output schema・completeness semantics・failure semantics・authoritative source・production/test implementation を列挙した operation inventory が本文に記載されている
  • AC2: Candidate C の MCP 実験が、root/global MCP の positive control を含む再現可能な実験 matrix(stdio MCP server の process_started/initialize/tools/list/tools/call を run 固有ファイルへ記録し、root positive control が PASS するまで SubAgent 実験を無効扱いにする手順)で実施され、raw command・debug log・server lifecycle evidence とともに本文に記載されている
  • AC3: 各候補(A/B/C/D/F を含む)について repository security authority(branch protection / CI / repository permission)と workflow operational boundary(capability scoping)を区別した上で、Issue 決定: GitHub mutation を minimal harness に縮退し server-side protection と live readback を正本にする #2223 の Owner Decision との整合性が本文に判定・記載されている
  • AC4: 推奨設計を1案(Candidate F、AC2 の corrected 実験が PASS することを前提条件とする conditional recommendation を含む)に絞り、前提条件・fallback・不採用条件が本文に明記されている
  • AC5: 推奨設計を実装する場合に必要な後続 implementation Issue の scope 草案(full read/create/readback・atomic idempotency・runtime correlation を含む)が本文に記載されている
  • AC6: PR 実装: isolated Claude-GPT の issue.create 要求を parent-mediated narrow bridge で処理する #2286 をmerge可能にするための prerequisite(Draft/HOLD 解除の最低条件)と、Issue 実装: isolated Claude-GPT の issue.create 要求を parent-mediated narrow bridge で処理する #2259 の10番目相当のAC(bridge到達要件)を弱めずに維持する検証経路が本文に明記されている

Verification Commands

# AC1
# preflight-scope: pr_review_only
$ test -n "research"
# AC2
# preflight-scope: pr_review_only
$ test -n "research"
# AC3
# preflight-scope: pr_review_only
$ test -n "research"
# AC4
# preflight-scope: pr_review_only
$ test -n "research"
# AC5
# preflight-scope: pr_review_only
$ test -n "research"
# AC6
# preflight-scope: pr_review_only
$ test -n "research"

上記コマンドはいずれも起票後の本 Issue 自身の本文を取得するものであり、実際の判定(本文中に AC1-AC6 各項目に対応する記載が存在するか)は owner レビューで行う(research issue の性質上、機械的 grep よりレビュー判定が正本)。

Allowed Paths

  • 読み取り専用。リポジトリ変更なし(既定)

Stop Conditions

  • Outcome / Scope / AC が検索可能な形で記載されていない場合は即停止
  • Allowed Paths 外への書き込みを試みた場合は即停止
  • 権限不足(permission denied)により操作が完了できない場合は即停止
  • 成果物の書き込みに失敗した場合(I/O エラー等)は即停止
  • 実装を開始しようとした場合は停止する(本 Issue は research に限定)
  • Issue 決定: GitHub mutation を minimal harness に縮退し server-side protection と live readback を正本にする #2223 の supersede が必要と判明した場合は、supersede を勝手に行わず human escalation する

Handoff Contract

Research Results

(4系統の並列 SubAgent 調査 + root 独立検証により作成。SubAgent A の caller inventory 主張は repository 実態と矛盾する箇所が確認されたため棄却し、root が直接ファイルを読んで置き換えた。)

AC1 — Current execution call graph

production call graph(現状):

caller(issue-refinement-loop / post-merge-cleanup / edit-issue 等)
  → issue-creator SubAgent(tools: [Read, Bash], disallowedTools: [Agent, Edit, MultiEdit, Write, Skill], permissionMode: acceptEdits)
    → create-issue skill 手順
      Step 1.5(dedupe read): `gh issue list --search ...` を Bash から直接実行(raw、bridge非経由)
      Step 4(mutation): `.claude/skills/create-issue/scripts/create_issue_txn.py` を Bash から起動
        → native profile: `gh issue create` 等を subprocess で直接実行
        → isolated profile(PR #2286, main未マージ): `issue_create_bridge_client.py` 経由で
          launcher-owned `issue_create_bridge_server.py`(Unix socket)へ委譲
          → server が trusted `create_issue_txn.py` transaction を実行し、GitHub authoritative readback(**注: 現行実装は request body から readback を代用しており、実際には GitHub からの GET を行っていない。詳細は下記「PR #2286 の readback 不備」参照**)

test-only call graph(scripts/claude-gpt/runtime_smoke_test.sh --scenario issue_create):

launch.sh(isolated profile env var発行)
  → 実 Claude-GPT session
    → genuine issue-creator SubAgent(Task tool 経由、production と同一 agent 定義)
      → Step 1.5: PATH 限定 fake `gh` wrapper(`gh issue list` のみ fake_gh.py へ透過転送)
      → Step 4: create_issue_txn.py → bridge → fake_gh.py(deterministic state file)
  → 独立証跡: hook-sink-multi-turn JSONL(SubagentStart/Stop)+ bridge ledger.jsonl バイトオフセット

production/test divergence: production の dedupe read(Step 1.5)は isolated profile でも生 gh 直叩きのままであり、この Issue #2259 の調査で「isolated 環境では認証エラーになる」ことが判明している。test 側だけが PATH wrapper で回避しており、production 側にはこの回避策は存在しない(bridge は create のみを扱い、read は対象外)。

caller inventory(rg -rl "issue-creator" で独立確認、SubAgent A の申告した .claude/agents/triage.md 等は repository に実在せず棄却): issue-editor.md(別役割、issue-creator とは別の子 Skill)、edit-issue/SKILL.md、issue-refinement-loop/SKILL.md、post-merge-cleanup/SKILL.md、speckit-taskstoissues/SKILL.md、worktree-agent-runtime-smoke/SKILL.md が issue-creator を参照/使用する。いずれも ISSUE_AUTHOR_RESULT_COMPACT_V1(STATUS/SUMMARY/BODY_HASH/COMMENT_URL/ARTIFACT/NEXT_ACTION)を消費する。

source anchors: .claude/agents/issue-creator.md(tools/disallowedTools/permissionMode の実値)、.claude/skills/create-issue/SKILL.md(Step 1.5, Step 4)、.claude/skills/create-issue/scripts/create_issue_txn.py(isolation 分岐)、PR #2286 diff(bridge server/client)、scripts/claude-gpt/runtime_smoke_test.sh(fake harness)。

AC1 更新 — GitHub operation inventory(owner 敵対的レビュー P0-3 反映)

現行 call graph(上記)は gh issue list(Step 1.5)・create_issue_txn.py(Step 4)・bridge 経由 create/readback のみを扱っており、create-issue skill が実際に持つ以下の追加 GitHub 依存経路を欠落させていた。少なくとも次を network/credential boundary を跨ぐ operation として列挙する。

operation actor read/write credential owner transport input schema output schema completeness semantics failure semantics authoritative source production/test implementation
template / local asset read issue-creator(Read tool) read none(filesystem) local FS file path file bytes 単一ファイル、completeness は Read tool 成功可否 file not found → skill 手順が human escalation repository(.claude/skills/create-issue/**) production と test 共通(filesystem)
anchor verification issue-creator read ambient gh credential(現行) raw gh CLI issue number issue JSON 単一 issue、パースエラーは未定義 認証失敗 → isolated環境で fail(現行既知バグ) GitHub REST/GraphQL production: raw gh/test: PATH wrapper fake
open Issue search(Step 1.5 dedupe read) issue-creator read ambient gh credential(現行) raw gh issue list --search search query issue 一覧(既定 30 件、--limit/pagination 未指定) 不完全(30件超・body未取得のため false negative dedupe の恐れ) 認証失敗・空結果を区別しない GitHub REST production: raw gh(isolated で認証エラー)/test: fake_gh.py
candidate Issue body read(false positive 除外の目視確認) issue-creator(procedural) read ambient gh credential(現行) raw gh issue view(本来必要だが Step 1.5 コマンドは --json number,title,url のみで body 未取得) issue number title/body 未実装(手順は body 確認を要求するが実行コマンドは取得しない、内部矛盾) 未定義 GitHub REST production のみ(未実装の穴)
overlap preflight helper root/orchestrator(scope rollup) read main thread credential ローカル script(scripts/agent-ops/*相当) issue draft overlap 判定 mutation-free error → human escalation repository script production のみ
body validation issue-creator / helper ローカル判定 none in-process body text pass/fail 決定論的 fail → 起票中断 create_issue_txn.py 内 validator production/test 共通
Issue create bridge/helper write bridge の trusted credential(isolated)/ambient(native) native: subprocess/isolated: Unix socket bridge title/body/labels 等 issue number/url 単一 create 失敗時 partial state の扱いが P0-5 参照 GitHub REST(Issue create endpoint) native/isolated で実装が分岐(PR #2286)
label application bridge/helper write 同上 同上 label 一覧 適用結果 未検証(readback 未実装) 未定義 GitHub REST 同上
parent/sub-issue relation bridge/helper write 同上 GraphQL relation 指定 node id node_id 欠落を無視する既知バグ(P0-4) 未定義 GitHub GraphQL PR #2286(未修正)
blocked-by / blocking relation bridge/helper write 同上 GraphQL relation 指定 node id 同上 未定義 GitHub GraphQL PR #2286(未修正)
post-create GET(authoritative readback) bridge/helper read bridge の trusted credential GitHub REST/GraphQL GET issue number title/body/labels/state/node_id 未実装(request body から SHA を代用、GitHub からの GET ではない。P0-4) mismatch 検出なし GitHub REST/GraphQL PR #2286(未修正、契約違反)
title / labels / state validation bridge/helper read 同上 同上 同上 pass/fail 未実装(上記に同じ) 同上 同上 PR #2286(未修正)
body SHA validation bridge/helper ローカル判定 none in-process remote body(本来) sha256 request body から算出しており remote body ではない(P0-4) mismatch を検出できない create_issue_txn.py PR #2286(未修正)
failure comment issue-creator(procedural、raw gh issue comment) write ambient gh credential raw gh CLI comment text comment id 未実装のcanonical route なし 認証失敗時に無言で失敗しうる GitHub REST production のみ、bridge 非経由
partial-failure reconcile 未実装 — — — — — 未実装(P0-5 のledger state machine 未整備) — — 未実装

推奨設計は、この全 operation を閉じた interface(narrow issue-create server、下記 Candidate F 参照)で処理できる必要がある。

AC2 — Candidate comparison

A: 文言強化のみ B: Bash残置+gh限定deny C: Bash-less narrow MCP D: parent-owned execution E: 新規SubAgent-local hook F: agent role split + narrow issue-create server
execution boundary なし(自然言語のみ) 技術的手段が存在しない(下記) tool schema(Bash非保持) issue-creator は proposal 生成のみ、実行は呼び出し元 PreToolUse hook(agent-local) proposal-only agent(Bash非保持)+ mutation-capable custom SubAgent(narrow MCP限定)
child Bash available? yes yes no yes(だが mutation 実行権限なし) yes proposal agent: no/committer agent: no(narrow MCP toolのみ)
raw gh technically possible? yes 実質 yes no(Bash自体が無い) 実行しても canonical outcome にならない 理論上 deny 可能 no(両 role とも Bash非保持)
model procedural compliance依存度 最大(唯一の防御) 高 最小(構造的に不可能) 最小(実行権限自体がない) 低(技術的deny) 最小(構造的に不可能、D と同水準)
#2223 compatibility compatible(だが無効) uncertain compatible(ただし実現手段に未解決の技術的不確実性あり、下記参照) conflict(#2223 本文の「root/main を通常 mutation の唯一 execution owner にしない」原則に抵触。下記 AC3 更新参照) requires_owner_supersede compatible(issue-committer を明示的 mutation-capable custom SubAgent role とすることで #2223 の capability-based delegation と整合、下記 AC3 参照)
new hook / broker required? no 実質必要になりがち no no new hook が必須 no(narrow issue-create server は generic broker ではない)
migration cost ほぼ0(無意味) 中 中〜高(MCP wiring が実証できていない) 高(全 caller の2段階契約への書き換え) 低(採用不可のため無関係) 高(agent role split + narrow server 実装 + 全 caller migration)
runtime testability / 実現可能性の実証状況 弱い 弱い 未確認(AC2 更新参照。root/global positive control 不成立のため inconclusive) 部分確認(tools:[Read] によるBash除去は実証済みだが、#2223 conflict のため不採用) 強いが採用不可 AC2 corrected 実験の PASS が前提条件(未実施)
verdict reject reject inconclusive(再実験待ち) #2223 conflict のため不採用(下記 AC3 更新参照) requires_owner_supersede recommended_conditionally(AC2 corrected 実験が PASS することを条件とする)

A/B は reject: #2292 の failure(issue-creator.md が既に procedural contract と明記しているにもかかわらず genuine SubAgent が raw gh へ逸脱した実績)そのものを再発防止できない。Claude Code の agent frontmatter(tools/disallowedTools)は tool 名単位の allow/deny のみで、Bash 内のコマンドパターン単位の SubAgent-local かつ hook-free な deny 機構は存在しない(下記 Phase 2 独立検証)。

E は requires_owner_supersede: 技術的には成立しても Issue #2223 の Owner Decision(新規 enforcing hook を追加しない)と正面衝突する。

C・D・F の評価は AC2/AC3/AC4 更新(第2回・第3回)を正本とする(下記参照。本テーブルの C/D/F 列は Superseded Findings 節の訂正を反映済み)。

AC3 — Issue #2223 compatibility

AC4 — Recommended architecture(第1回、Superseded — 詳細は Superseded Findings 参照)

推奨: Candidate D(parent-owned deterministic execution)を主案とし、Candidate C(Bash-less narrow MCP)は「per-subagent MCP tool 露出が実機で確認でき次第の将来強化」として保留する。

この結論は第2回検証(AC3 更新)で「D は #2223 と conflict」と訂正され、さらに第3回(owner 敵対的レビュー反映)で Candidate F へ置き換えられた。以降の推奨は「AC4 更新(第3回)」を正本とする。

AC5 — Draft implementation Issue scope(owner 承認後に起票、このタスクでは起票しない、第1回・部分的に Superseded)

第1回時点の Candidate D 前提の草案は、D が #2223 と conflict すると判明したため主案としては採用しない。実装 scope の詳細は「AC5 更新(第3回)」を正本とする。

AC6 — Issue #2259 AC10 disposition(第1回、Superseded — 詳細は AC6 更新(第3回)参照)

  • AC10 の意味論は維持できるか: 維持できる。弱めない(SKIP化・fallback PASS化しない)という結論は全回を通じて一貫している。
  • 具体的な hop chain・runtime evidence の設計は Candidate D 前提から Candidate F 前提へ更新する必要があるため、詳細は AC6 更新(第3回)を参照する。

Open Questions(第1回、一部 Superseded)

  • Candidate C(per-subagent custom MCP tool 露出)が実際に Claude Code の現行版で機能するのか → AC2 更新(第2回・第3回)で再実験の実施状況と結論を継続追跡。
  • 全 caller の2段階契約移行の詳細な設計・工数見積もりは AC5 更新(第3回)の implementation Issue で行う。

Artifact Refs(更新)

  • 本セクション(AC1-AC6、および下記 Superseded Findings / 第2回 / 第3回追記)自体が成果物
  • Phase 1 SubAgent 調査ログ(本 comment スレッドの過去コメント、及び本 turn の会話ログ)

Research Results 追記(第2回 bounded revalidation, 2026-08-22)

前回結論(Candidate D 推奨、Candidate C は pending)を owner 指示により再検証した。結論: Candidate D は #2223 と正面衝突するため不採用に確定。Candidate C は当時 C_DISPROVEN と結論したが、この結論は owner 敵対的レビュー(第3回、下記 Superseded Findings 参照)により inconclusive へ訂正された。

AC2 更新 — Candidate C の実現可能性再検証結果(一部 Superseded、詳細は AC2 更新(第3回)参照)

4系統の SubAgent(公式仕様再調査/launcher-bridge統合調査/実機実験/敵対的レビュー)を並列実行し、全件完了後に root が独立検証した。

  • 公式ドキュメント(再調査): .claude/agents/*.md の mcpServers frontmatter 自体は公式ドキュメントに具体例付きで記載されている(mcpServers: [{playwright: {type: stdio, ...}}, "github"] 形式)。ただし (a) parent への非露出、(b) --strict-mcp-config との相互作用、(c) --agents JSON 内での動作、(d) --agents の .md 定義への override precedence、のいずれも公式ドキュメントに明記がない、という当時の評価は、本 Issue の web-researcher による一次資料 fact-check(第3回、下記参照)で (a)(b)(c) は公式ドキュメントに明記されていることが確認され訂正された。(d) のみ未確認のまま残る。
  • 既存 launcher precedent(launcher-bridge統合調査): scripts/claude-gpt/lib.sh の claude_gpt_spark_agents_json_fragment() / claude_gpt_smoke_canary_agents_json_fragment() は launcher-owned agent injection の precedent として実在するが、いずれも mcpServers field を使用しておらず、tools は空配列または disallowedTools による制限のみ。MCP tool 露出の実装例は repository 内に存在しない。
  • 実機実験(第2回、当時「決定的」と評価したが第3回レビューで無効と訂正された): 独立した bounded runtime experiment を実行し、以下を server-side artifact(model 自己申告ではない)で確認した:
    • C0(--strict-mcp-config なし): agent定義自体は受理されるが、mcpServers field は silent no-op(tool が一切可視化されない、evidence file 未作成)
    • C1/C2(--strict-mcp-config あり、production launcher と同じ --strict-mcp-config --mcp-config ... --agents ... composition): mcpServers field を含む agent 定義自体が registration 失敗(available agents 一覧に登場しない)
    • 追加テスト(global --mcp-config 経由): root session 自身からも custom MCP server のtoolが見えず、そもそも MCP server が起動していない可能性が高い(この結果が第3回レビューで「positive control 不成立」と指摘された決定的な箇所)
    • 前回(第1回)の実機実験と今回(第2回、production-equivalent composition を含めてより丁寧に実施)の両方が独立に同じ否定的結果に到達し、再現性が確認された(ただし再現された否定的結果自体が invalid な positive control 上で得られたものであるため、Candidate C 固有の失敗を意味しない。第3回レビュー参照)

当時の結論(誤り、Superseded): Candidate C は現在の Claude Code v2.1.239 では技術的に実現不可能(C_DISPROVEN)。 この結論は撤回する。詳細は下記 Superseded Findings 節を参照。

AC3 更新 — Issue #2223 との整合性(重要な訂正)

前回の research では Candidate D を「#2223と compatible」と結論していたが、これは誤りだった。敵対的レビューと root 独立確認により、Issue #2223 本文に以下の明示的記述があることを確認した(該当箇所を直接引用、行番号は取得時点):

「root/main thread も GitHub mutation可能だが、通常 mutation の唯一の execution owner には しない。」
「通常の Issue body 編集・Issue 起票等は、適切な mutation-capable custom SubAgent が存在する場合はその SubAgent に委譲する。」

Candidate D(issue-creator を proposal-only 化し、Bash を完全除去して mutation 実行を root/orchestrator へ移す)は、この2文言と正面から衝突する。issue-creator はもはや「mutation-capable custom SubAgent」ではなくなり、通常の Issue 起票について root が恒常的な execution owner になるため、これは fallback/recovery限定の例外ではなく routine operation の既定アーキテクチャとしての root実行になり、上記引用の趣旨に反する。この判定(D は conflict)は第3回レビューでも維持される。

一方 Candidate C(Bash-less narrow MCP)は、issue-creator を mutation-capable のまま維持する(MCP tool 経由で自ら create transaction を実行し続ける)ため、この点では #2223 とより整合していた。第2回時点では「技術的に実現不可能であることが確定した」としてこの整合性の高さを無視したが、この技術的結論自体が第3回レビューで inconclusive へ訂正されたため、C(および C の発展形である F)の #2223 整合性の高さは再び有効な検討材料となる。

AC4 更新 — 推奨 architecture(第2回、暫定停止。第3回で Candidate F へ更新)

C_DISPROVEN(当時の誤った結論)かつ D は #2223 と conflict という状況になったため、当時は owner_decision_required として停止した。この停止は第3回レビューで、Candidate C の再判定(inconclusive)と Candidate F の提示により部分的に解消された。詳細は AC4 更新(第3回)を参照。

AC5 更新(第2回、Superseded — 詳細は AC5 更新(第3回)参照)

owner が Candidate D + #2223 amendment、または Candidate C 再検証待ちのいずれを選ぶかで実装 Issue 草案が分岐する、としていたが、D は AC3 更新の通り #2223 と conflict するため不採用。実装 Issue 草案は Candidate F 前提の AC5 更新(第3回)を正本とする。

AC6 更新(第2回、Superseded — 詳細は AC6 更新(第3回)参照)

Issue #2259 の AC10 disposition は owner decision 確定まで保留、という結論だったが、AC10 の意味論を弱めない(SKIP化・fallback PASS化しない)という結論のみは第1回から一貫して確定している。 具体的な hop chain は AC6 更新(第3回)を正本とする。

Open Questions(第2回、一部 Superseded)

  • Candidate C(per-subagent custom MCP tool 露出)が実際に Claude Code の現行版で機能するのか、より丁寧な実機検証(正しい MCP fixture 実装・正しい config 記法の確認)が必要。 → 第3回レビューで「root/global positive control が不成立のため実験自体が無効」と特定され、AC2 更新(第3回)の corrected 実験手順に置き換えられた。
  • 全 caller の2段階契約移行の詳細な設計・工数見積もりは AC5 更新(第3回)の implementation Issue で行う。
  • Issue 決定: GitHub mutation を minimal harness に縮退し server-side protection と live readback を正本にする #2223 の「root を通常 mutation の唯一 execution owner にしない」原則について、isolated session の credential-isolation 制約下での例外を owner が認めるか → Candidate D 不採用の確定(AC3 更新)により、この問いは Candidate F 前提では発生しない(issue-committer が mutation-capable custom SubAgent role を担うため)。

Research Results 追記(第3回、owner 敵対的レビュー反映, 2026-08-22)

対象コメント: https://github.com/squne121/loop-protocol/issues/2292#issuecomment-5379612388(owner、REQUEST_CHANGES/BLOCK 判定)。

Research Results 状態(機械可読な要約)

research_status: blocked_on_valid_mcp_positive_control
candidate_a: rejected_no_technical_enforcement
candidate_b: conflicts_with_no_new_hook_decision
candidate_c: inconclusive_invalid_positive_control
candidate_d: conflicts_if_root_is_sole_execution_owner
candidate_f: recommended_conditionally
pr_2286: draft_hold
issue_2259_ac10: retain

Superseded Findings(撤回・置換の明示、owner レビュー P0-1/P0-2 反映)

以下の第1回・第2回の結論は、owner 敵対的レビューにより誤りと判定され撤回する。単なる削除ではなく、以降このセクションを正本として参照する。

旧結論(世代) 状態 訂正後 訂正理由
Candidate C = C_DISPROVEN(第2回) 撤回 candidate_c: inconclusive_invalid_positive_control 第2回実機実験の最終ケース(global --mcp-config 経由でも root session から custom MCP server の tool が見えず、server 自体が起動していない可能性が高い)は root/global の positive control が失敗していることを意味する。positive control が成立しない実験からは「per-subagent inline MCP 固有の失敗」なのか「fixture・設定・trust・managed policy・server起動のいずれかが壊れている」のかを識別できない。にもかかわらず C_DISPROVEN へ格上げしたのは論理的に不正だった。
Candidate D 推奨(第1回主案) 既に第2回で訂正済み(維持) candidate_d: conflicts_if_root_is_sole_execution_owner Issue #2223 本文の明示的記述と正面衝突するため(AC3 更新参照)。
owner_decision_required(第2回、A/B/C/D/新規候補の中から owner が選ぶ、という停止の形) 撤回 下記 Candidate F の conditionally recommended 提示に置き換え Issue 自身の Outcome/AC4-AC6 が要求する「推奨設計1案」を提示せず撤退したことは、「owner が判断できる材料を揃えた」のではなく「Issue が要求した設計選定に失敗した」状態だった。

さらに、Claude Code 公式ドキュメントの一次資料 fact-check(本 loop の web-researcher SubAgent、第3回で実施)により、以下が確認された(4件すべて confirmed、根拠: https://code.claude.com/docs/en/sub-agents )。

  1. SubAgent 定義の disallowedTools: Bash または tools allowlist から Bash を除外することで、raw gh CLI 実行を技術的に不可能にできる。
  2. --agents フラグ・SDK agent 定義は inline mcpServers フィールドをサポートし、SubAgent 起動時に接続・終了時に切断され、そのツールは親 session に公開されない。
  3. --strict-mcp-config は --agents や SDK agent 定義で明示された inline mcpServers を除外しない("Doesn't filter servers passed via --agents")。
  4. v2.1.238+ で project-scope inline server に workspace trust 要件があるとの言及があるが、Owner が言及した v2.1.239 との非互換は確認されなかった。

これは「Candidate C/F の技術的前提(agent-local な tool/MCP 境界)が公式仕様として存在する」ことを裏付ける一方、第2回実機実験がこの仕様を正しく再現できなかった理由(positive control 不成立)は未解決のままである。したがって Candidate C の状態は technically_impossible ではなく inconclusive_invalid_positive_control が正しい。

AC2 更新(第3回) — Candidate C 再実験の最低条件

再実験は次の順で行う(owner レビュー必須修正を反映)。

  1. 最小 stdio MCP server を作り、process_started、initialize、tools/list、tools/call を run 固有ファイルへ記録する。
  2. root session + global --mcp-config + strict なしを positive control とし、これが PASS するまで SubAgent 実験を無効扱いにする。
  3. root session + --strict-mcp-config を確認する。
  4. --agents inline MCP + strict なしを確認する。
  5. --agents inline MCP + production 相当 strict 構成を確認する。
  6. tools を期待する exact MCP tool 名だけに限定し、未解決なら agent 起動時に明示的に失敗させる。
  7. trust 状態、managed MCP allow/deny、disabled server、起動 cwd、環境 scrub、stderr、Claude debug log を証跡に含める。

root positive control が失敗した run を、Candidate C の失敗 run として数えてはならない。この再実験は本 research の Allowed Paths(読み取り専用)の範囲を超えるため、AC5 の implementation Issue(または専用の spike Issue)側で実施する。

AC3 更新(第3回) — call graph の再拡張と bridge の未実装事項

上記「AC1 更新 — GitHub operation inventory」に加え、owner レビューが指摘した PR #2286 の2つの契約違反を記録する。

PR #2286 の readback 不備(P0-4): Issue #2259 の AC7 は post-create GET による readback を要求するが、現行 bridge server 実装は次の通りである。

node_id = _issue_graphql_node_id(...)
body_sha256 = _sha256_hex(body_text)

body_text は child request が渡した本文であり、GitHub から取得した本文ではない。GitHub 側で本文が変化・欠落・truncate しても request と同じ SHA が返る。node_id 取得が失敗して None になっても helper が success なら result は success のままである。テストも request["body"] の SHA を期待しており、誤った契約を固定化している。

修正要件: create 後に GitHub から対象 Issue を直接 GET し、少なくとも repository identity・issue number・node ID・canonical URL・title・body・labels・state・parent/dependency relations を検証する。body_sha256 は remote GET の body から算出する。node_id missing / body missing / body SHA mismatch / repository mismatch / URL mismatch / required labels mismatch / ready tuple mismatch のいずれかが欠けた場合は success を返してはならず、結果は最低でも success / partial_failure / remote_state_mismatch / readback_unavailable / reconcile_required に分類する。fake provider テストには、作成時に本文を意図的に変形する fixture を追加し remote mismatch を検出する negative test が必要。

PR #2286 の atomic idempotency 不備(P0-5): bridge server は ThreadingUnixStreamServer だが、idempotency 処理は ledger.get(request_id) → mutation → ledger.put(request_id, result) の順であり、get から put までの mutation 区間が排他されていない。同一 request ID を同時送信すると、両 thread が get == None を確認し双方が Issue を作成し得る。ledger は request_id と result しか保持せず、同じ request ID で異なる title/body を送っても過去 result をそのまま返し、run nonce/request digest と紐付いておらず、failure result も永続化され、remote create 成功後 fsync 前に process が停止する crash window がある。既存テストは同一 ID・同一 payload の順次2回送信のみを確認しており、競合や payload mismatch を検証していない。

修正要件: ledger を ABSENT → PENDING → COMMITTED → RECONCILED(PENDING → FAILED_RETRYABLE → FAILED_TERMINAL)の state machine へ変更し、各 entry に schema_version / request_id / run_scope / canonical_request_sha256 / repository_id / operation 等を持たせる。root positive control 不成立と同様、この修正自体は本 research の Allowed Paths 外であり、実装は AC5 の implementation Issue で行う。

AC4 更新(第3回) — 推奨 architecture(Candidate F, recommended_conditionally)

推奨: Candidate F(agent role split + narrow issue-create server)を、AC2 更新の corrected MCP positive-control 実験が PASS することを条件として conditionally recommend する。

Candidate F の構成

1. proposal-only agent(issue-proposer 相当、mutation不可)

tools:
  Read
  local validation用の限定Bash

GitHub credential:
  なし

GitHub read/write:
  なし

出力は closed schema:

ISSUE_CREATE_PROPOSAL_V2
  repository
  title
  body
  body_sha256
  issue_kind
  labels
  parent
  dependencies
  dedupe_query_intent
  validation_results

現行 issue-creator の raw gh issue list、gh issue view、gh issue comment はこの agent から除去する。

2. issue-committer 相当の mutation-capable custom SubAgent

この SubAgent を Issue #2223 上の明示的 mutation-capable role とする。

tools:
  mcp__issue_create__search_open
  mcp__issue_create__commit_transaction

disallowed:
  Bash
  Skill
  Agent
  Write
  Edit

Claude Code 公式仕様上、SubAgent へ inline MCP server を限定し、そのツールを親 session へ公開しない構成が定義されている(AC2/Superseded Findings 節の fact-check 参照。https://code.claude.com/docs/en/sub-agents )。

3. narrow な issue-create server(専用の narrow executor)

既存 bridge/helper を拡張し、次を一つの bounded capability として所有させる: bounded search・candidate detail read・exact-title/fingerprint dedupe・body validation・Issue create・labels・relationships・post-create GET・body hash・ready tuple・partial failure・reconcile・atomic idempotency。これは全 GitHub mutation を仲介する generic broker ではなく、Issue create transaction 専用の narrow executor である。

4. root/main の役割

root は proposal agent を起動し proposal schema を受け取って issue-committer へ渡し、結果を readback するだけを行う。root は通常 mutation の唯一 owner にはならない。mutation authority は issue-committer の explicit role に属し、Issue #2223 の capability-based delegation と整合する。

採用条件

Candidate F は、AC2 更新の corrected MCP 実験が PASS することを前提とする。corrected 実験でも SubAgent-local MCP が再現可能に失敗する場合は、その時点で初めて次を owner decision へ上げる。

  1. Issue 決定: GitHub mutation を minimal harness に縮退し server-side protection と live readback を正本にする #2223 へ isolated-session 例外を追加し、parent-owned execution(Candidate D 相当)を認める
  2. Claude Code version gate を設けて MCP route を保留する
  3. credential isolation または AC10 の意味論を変更する(ただし AC10 を黙って弱めてはならない)

AC5 更新(第3回) — implementation Issue scope 草案(Candidate F 前提)

  • title candidate: 「実装: issue-creator を proposal-only agent + narrow mutation-capable issue-committer へ分割し、narrow issue-create server で GitHub operation 全体を扱う」
  • In Scope(少なくとも):
    • agent role split(issue-proposer / issue-committer の tools/disallowedTools frontmatter 確定)
    • create-issue skill からの raw GitHub CLI operation(gh issue list / gh issue view / gh issue comment)の除去
    • AC2 の corrected 手順による SubAgent-local MCP positive-control test(root positive control を含む)
    • narrow read/create transaction schema(ISSUE_CREATE_PROPOSAL_V2 を含む)
    • server-side authoritative readback(GitHub からの post-create GET を根拠とする body_sha256/node_id/URL/labels/state 検証、P0-4 修正)
    • atomic request ledger(ABSENT/PENDING/COMMITTED/RECONCILED state machine、P0-5 修正)
    • repository mismatch rejection
    • launcher fail-closed startup
    • run-scoped evidence correlation
    • concurrent replay/crash/restart tests
    • all caller migration(issue-refinement-loop, post-merge-cleanup, edit-issue, speckit-taskstoissues, worktree-agent-runtime-smoke)
    • production/test equivalence test
  • Out of Scope: 新規 enforcing hook、新規 generic mutation broker、GitHub credential の proposal agent への付与。
  • rollback boundary: 移行中は旧(自律実行)契約と新(role split)契約を両方サポートするフラグ等は導入せず、単一 PR で全 caller を同時に切り替える。

AC6 更新(第3回) — Issue #2259 AC10 disposition

  • AC10 の意味論: 維持する(retain)。SKIP化・fallback PASS化は行わない。
  • canonical hop chain(Candidate F 前提): real launch.sh → real Claude-GPT session → genuine issue-proposer(proposal 生成のみ)→ issue-committer(narrow MCP 経由で narrow issue-create server へ到達)→ authoritative post-create GET → readback。
  • 実装: isolated Claude-GPT の issue.create 要求を parent-mediated narrow bridge で処理する #2259 contract amendment: 必要。AC10 の hop chain 記述を上記へ更新する amendment が、implementation Issue の完了後に必要。
  • runtime system test の independent evidence: (1) issue-proposer / issue-committer 両 SubAgent の genuine spawn/stop、(2) 両 agent の tool frontmatter に Bash が存在しないことの静的検査、(3) issue-committer が narrow MCP tool を実際に呼び出したことの server-side evidence(AC2 の tools/call 記録を継続利用)、(4) narrow issue-create server 側の post-create GET 実行証跡。

PR #2286 の処置(owner レビュー反映)

Issue #2292: OPEN / research blocked
PR #2286: OPEN / Draft / HOLD
Issue #2259 AC10: unchanged
Candidate C: inconclusive
Recommended direction: Candidate F, corrected MCP experimentを前提

PR #2286 を Draft/HOLD にした判断は維持する。Draft 解除前の最低条件:

  1. Candidate C の判定を inconclusive へ訂正した上での再実験(本 Issue の AC2 更新を参照。実験自体は implementation/spike Issue 側で実施)
  2. proposal/executor(Candidate F)の最終 architecture を確定する
  3. full GitHub operation inventory(上記 AC1 更新)を実装へ反映する
  4. remote body を用いた authoritative readback(P0-4)へ修正する
  5. atomic idempotency(P0-5)を実装する
  6. runtime evidence を request 単位で因果結合する
  7. corrected genuine runtime test が反復して PASS する
  8. PR 本文の古い Auto Mode 原因説と過大な AC6/AC7 達成主張を supersede する

Open Questions(第3回、更新)

owner_decision_required

true。ただし第3回時点の停止理由は「候補を選べなかった」ことではなく、「Candidate F を conditionally recommend した上で、AC2 の corrected MCP positive-control 実験の実施・結果確定を implementation/spike Issue 側の owner 承認に委ねる」ことである。本 Issue #2292 はこの状態で close せず OPEN のまま維持する(decision-complete として close してはならない)。PR #2286 は Draft/HOLD を維持し、Issue #2259 の AC10 を弱めない。

Final Owner Direction / Compatibility-first disposition(2026-08-22 追記)

owner の明示的な方針転換により、本 Issue の research goal(credential-isolated deterministic execution boundary の構築)は現時点の優先順位から外れた。以下を最終 Owner Decision として記録する。

research_disposition: hardening_deferred
credential_isolation: deferred_not_required_for_current_compatibility_goal
candidate_c: deferred_not_disproven
candidate_f: deferred_not_rejected
issue_2259: close_not_planned
pr_2286: close_unmerged
replacement_direction: compatibility_first_native_github_workflow
replacement_issue: "#2299(実装完了、PR #2303でマージ済み)"
security_authority:
  - github_ruleset
  - branch_protection
  - required_ci
  - repository_permission
correctness_authority:
  - pre_readback
  - mutation
  - authoritative_post_readback

上記により、本文冒頭付近の「close せず OPEN のまま維持する」という過去の停止指示は本 Owner Decision により supersede される。Candidate F・Candidate C は「技術的に不可能」と判断されたわけではなく、現在は優先順位上採用せず、将来 hardening として defer する(credential isolation が Claude-GPT の安定稼働・既存 workflow 完走を妨げないことが確認された時点で再検討可能)。本 Issue は research record として保存された状態で NOT_PLANNED close する。

Activity

  1. squne121 commented on Aug 22, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop 終了報告

    VERDICT: approve(BLOCKERS: 0、iteration 1で承認)

    • Step 0f preflight: STATUS warn / proceed_with_notes(構造的な missing field なし、repair不要)
    • Step 2 review: 初回 needs-fix(AC番号表記の誤検知+VC分類エラー)→ 本文修正 → 再レビューで approve
    • 残る非ブロッキング指摘: ## Runtime Verification Applicability セクション未設置(research issue のため warn のみ、approve を妨げない)

    本 Issue は issue_kind: research のため LOOP_HANDOFF_RESULT_V1 は出力しない(実装 handoff 対象外)。

  2. squne121 commented on Aug 22, 2026

    @squne121
    OwnerAuthor

    Issue #2292 敵対的レビュー

    判定

    REQUEST_CHANGES / BLOCK

    Issue #2292 が特定した問題、すなわち「issue-creator が procedural contract に従わず raw gh issue create を選択し得る」「isolated production では dedupe read も成立していない」という問題設定自体は妥当です。

    ただし、現在の Research Results は次の理由で owner decision の入力として未成立です。

    1. Candidate C を C_DISPROVEN とした実験は positive control が失敗しており、候補固有の失敗を識別できていない。
    2. Issue 自身が要求する「推奨設計1案」「後続 implementation scope」「AC10 の結論」を提示できていない。
    3. 現行 call graph が post-create readback や failure comment を含む全 GitHub operation を列挙していない。
    4. 関連PR #2286には、Issue #2292の設計判断以前に修正すべき AC6・AC7 の独立した実装上の blocker が残っている。

    PR #2286 は現在も OPEN・Draft・未マージ・mergeable です。Draft/HOLDを維持し、Issue #2259のAC10を弱めてはいけません。


    P0-1 — Candidate C の C_DISPROVEN は実験結果から導けない

    Issue #2292 の第2回検証では、以下の結果から Candidate C を「Claude Code v2.1.239では技術的に実現不可能」としています。

    • --strict-mcp-config なしでは agent 定義は受理されるが tool が見えない
    • production相当の strict構成では agent登録に失敗
    • global --mcp-config でも root から tool が見えず、MCP server自体が起動していない可能性がある

    最後の結果が決定的です。root側のglobal MCP positive controlすら失敗している以上、この実験は「SubAgent限定MCPが壊れている」のか、「fixture、設定、trust、managed policy、server起動のいずれかが壊れている」のかを識別できません。 にもかかわらず C_DISPROVEN へ格上げしたのは論理的に不正です。

    さらに、Claude Codeの現行公式ドキュメントは次を明示しています。

    • --agents で渡すagent定義のフィールドとして mcpServers をサポートする
    • inline MCP serverはSubAgent起動時に接続され、終了時に切断される
    • そのtoolは親sessionには公開されない
    • --strict-mcp-config は、--agents やSDKのagent定義で明示されたinline mcpServers を除外しない ([Claude]1)

    公式仕様が実機動作を無条件に保証するわけではありません。しかし、少なくとも現在の証拠で言えるのは、「この実験fixtureではMCP serverの正常起動を証明できなかった」までです。

    必須修正

    Candidate C の状態を次へ変更してください。

    candidate_c_status: inconclusive
    reason: >
      global/root MCP positive control が成立しておらず、
      per-subagent inline MCP 固有の失敗を識別できないため

    再実験の最低条件

    実験は次の順で行う必要があります。

    1. 最小stdio MCP serverを作り、process_started、initialize、tools/list、tools/call をrun固有ファイルへ記録する。
    2. root session + global --mcp-config + strictなしをpositive controlとし、これがPASSするまでSubAgent実験を無効扱いにする。
    3. root session + --strict-mcp-config を確認する。
    4. --agents inline MCP + strictなしを確認する。
    5. --agents inline MCP + production相当strict構成を確認する。
    6. tools を期待するexact MCP tool名だけに限定し、未解決ならagent起動時に明示的に失敗させる。
    7. trust状態、managed MCP allow/deny、disabled server、起動cwd、環境scrub、stderr、Claude debug logを証跡に含める。

    root positive controlが失敗したrunを、Candidate Cの失敗runとして数えてはいけません。


    P0-2 — Issue #2292 は自身のOutcome・AC4〜AC6を満たしていない

    IssueのOutcomeは、次の3点を成果物として要求しています。

    • 推奨設計1案
    • 後続implementation Issueのscope草案
    • Issue #2259のruntime system testをどう満たすかの結論

    AC4〜AC6も同じ内容を要求しています。ところが現在の最終追記は、Candidate Cを不可能、Candidate Dを#2223と衝突とし、推奨案を撤回して owner_decision_required: true で停止しています。これは 「ownerが判断できる材料を揃えた」のではなく、「Issueが要求した設計選定に失敗した」状態です。

    Issue refinement loopのコメントは VERDICT: approve としていますが、記録されている確認内容は構造的missing fieldやVC分類が中心であり、この実験妥当性やOutcome未達を評価していません。したがって、このapproveを実質的なarchitecture reviewの代替にはできません。

    必須修正

    次のどちらかが必要です。

    案1 — 現在のOutcomeを維持する

    Candidate Cを正しく再検証し、推奨設計、implementation scope、AC10 dispositionまで確定する。

    案2 — Issueをdecision packetへreframeする

    OutcomeとACを次のように変更する。

    research_status: blocked_on_valid_experiment
    candidate_c_status: inconclusive
    candidate_d_status: owner_amendment_required
    recommended_design: pending
    pr_2286_disposition: draft_hold
    ac10_disposition: retain_without_weakening

    現行Outcomeを残したまま owner_decision_required で完了扱いにするのは認められません。

    また、本文には複数世代の相反する結論が併存しています。古いCandidate D推奨や C_DISPROVEN を単に残すのではなく、Superseded Findings として明示的に撤回・置換する必要があります。


    P0-3 — 現行call graphはGitHub operation全体を表現していない

    Issue #2292のcall graphは主に次を扱っています。

    • Step 1.5のgh issue list
    • Step 4のcreate_issue_txn.py
    • bridge経由のcreate/readback

    しかし、実際のcreate-issue skillには追加のGitHub依存経路があります。

    • overlap preflight helper
    • 起票後のraw gh issue view --json title,labels
    • ready tuple失敗時のraw gh issue comment

    つまり、dedupe readとcreate mutationだけをMCPやbridgeへ移しても、Issue作成後にisolated childがraw gh issue viewで認証失敗し、workflow全体が未完了になる可能性があります。

    Step 1.5にも内部矛盾があります。

    • 実行コマンドは--json number,title,urlのみ
    • 手順はfalse positive除外のため「タイトル・本文を目視確認」と要求
    • しかし本文は取得していない

    また、gh issue list の既定取得件数は30件です。現在のコマンドには--limitもpaginationもないため、検索結果をcomplete inventoryとして扱えません。--jsonにはbodyフィールドを指定できますが、現行手順は指定していません。([GitHub CLI]2)

    必須のoperation inventory

    Issue本文に、少なくとも次の列を持つ一覧が必要です。

    operation
    actor
    read/write
    credential owner
    transport
    input schema
    output schema
    completeness semantics
    failure semantics
    authoritative source
    production/test implementation
    

    対象operationは最低でも次です。

    template / local asset read
    anchor verification
    open Issue search
    candidate Issue body read
    overlap preflight
    body validation
    Issue create
    label application
    parent/sub-issue relation
    blocked-by / blocking relation
    post-create GET
    title / labels / state validation
    body SHA validation
    failure comment
    partial-failure reconcile
    

    推奨設計は、この全operationを閉じたinterfaceで処理できる必要があります。


    P0-4 — PR #2286の「authoritative readback」は実装されていない

    Issue #2259のAC7は、Issue number、URL、node ID、body SHAを GitHubからのpost-create GET で確認することを要求しています。

    しかし、PR #2286のbridge serverは次の実装です。

    node_id = _issue_graphql_node_id(...)
    body_sha256 = _sha256_hex(body_text)

    ここでbody_textはchild requestから受け取った本文です。GitHubから取得した本文ではありません。したがって、GitHub側で本文が変化・欠落・truncateしても、requestと同じSHAが返ります。さらに、node_id取得が失敗してNoneになっても、helperがsuccessならresultはsuccessのままです。

    テストも、remote bodyではなくrequest["body"]のSHAを期待しており、誤った契約を固定化しています。

    PR本文の「authoritative post-create readbackを実装した」という主張は、現行コードと一致しません。

    必須修正

    create後にGitHubから対象Issueを直接GETし、少なくとも次を検証する必要があります。

    repository identity
    issue number
    node ID
    canonical URL
    title
    body
    labels
    state
    parent/dependency relations
    

    body_sha256はremote GETのbodyから算出してください。

    次のいずれかが欠けた場合、successを返してはいけません。

    node_id missing
    body missing
    body SHA mismatch
    repository mismatch
    URL mismatch
    required labels mismatch
    ready tuple mismatch
    

    結果は最低でも次へ分類すべきです。

    success
    partial_failure
    remote_state_mismatch
    readback_unavailable
    reconcile_required
    

    fake providerテストには、作成時に本文を意図的に変形するfixtureを追加し、remote mismatchを確実に検出するnegative testが必要です。


    P0-5 — request replayはatomic idempotencyになっていない

    bridge serverはThreadingUnixStreamServerですが、idempotency処理は次の順です。

    ledger.get(request_id)
    mutation
    ledger.put(request_id, result)
    

    getとputはそれぞれ個別にlockされますが、getからputまでのmutation区間は排他されていません。同一request IDを同時送信すると、両threadがget == Noneを確認し、双方がIssueを作成できます。これはコードから直接導かれる競合です。

    さらにledgerはrequest_idとresultしか保持していません。

    • 同じrequest IDで異なるtitle/bodyを送っても、過去resultをそのまま返す
    • run nonceやrequest digestと結び付いていない
    • failure resultも保存され、transient failureが永続化される
    • remote create成功後、ledger fsync前にprocessが停止するcrash windowがある

    現在のテストは「同じID・同じpayloadを順番に2回送る」ケースしか確認しておらず、競合やpayload mismatchを検証していません。

    GitHubのAPI運用ガイドも、secondary rate limit回避のため、並行requestを避けてserial queueを使用することを推奨しています。([GitHub Docs]3)

    必須修正

    ledgerを次のstate machineへ変更してください。

    ABSENT
      → PENDING
      → COMMITTED
      → RECONCILED
    
    PENDING
      → FAILED_RETRYABLE
      → FAILED_TERMINAL
    

    各entryには最低限次を持たせます。

    schema_version
    request_id
    run_scope
    canonical_request_sha256
    repository_id
    operation
    status
    issue_number
    node_id
    remote_body_sha256
    created_at
    updated_at
    attempt_count
    

    処理要件は次です。

    • request_id + canonical_request_sha256を束縛する
    • 同じIDで異なるdigestならrejectする
    • 同じrequest IDのreservationをatomicに取得する
    • Issue createはrepository単位のsingle mutation laneで直列化する
    • remote success後はdurable commitしてからresponseを返す
    • response loss後はremote markerを使ってreconcileする
    • retryable failureを永久cacheしない

    最低限必要なテストは次です。

    concurrent same-ID replay
    same ID / different payload
    server restart replay
    remote success / response loss
    remote success / ledger commit前crash
    transient GitHub failure retry
    partial failure reconcile
    

    P1-1 — runtime smoke evidenceが同一transactionへ因果的に結合されていない

    現行runtime smokeはbridge到達証跡として、ledger fileのbyte sizeが実行前後で増えたことだけを確認しています。これは、同時実行された別requestや別launcherの追記でも成立します。fake provider上のIssue title一致とledger差分は別々に評価されており、ledger entryのissue number、request ID、body hashとfake provider上のobjectをjoinしていません。

    SubAgent evidenceも、agent_type=issue-creatorのstart/stopを個別booleanで確認するだけで、同一agent_idのpairとは確認していません。また、evidence JSONのgenuine_issue_creator_subagent_pathは固定値Trueです。

    必須修正

    run-scoped correlation IDを全経路へ伝播させます。

    root invocation
    SubagentStart/Stop
    proposal result
    bridge/MCP request
    ledger entry
    fake provider record
    post-create result
    runtime evidence
    

    PASS条件は次のequality joinにしてください。

    same run_id
    same agent_id start/stop
    same request_id
    same canonical request digest
    same issue number
    same node ID
    same remote body SHA
    same repository ID
    

    「ledgerが増えた」ではなく、「このrequestのCOMMITTED entryが1件だけ存在する」を確認すべきです。


    P1-2 — bridge startupがfail-closedになっていない

    launcherはbridge serverのstdout/stderrを/dev/nullへ捨て、最大5秒socket出現を待ちます。しかしtimeout後にsocketやprocessの生存を必須確認せず、そのままisolation endpointをexportしてClaude sessionを開始します。

    bridge server側には既に--ready-fdが実装されています。socket fileの存在をpollするより、このready protocolを使用すべきです。

    必須修正

    ready-fdからREADYを受信
    AND bridge PIDが生存
    AND socketがUnix socket
    AND socket ownership/modeが期待値
    

    を満たさなければlauncher自体を失敗させてください。

    startup失敗時は、secretを除去したbounded stderrをevidenceへ残し、processとsocketをcleanupして停止する必要があります。


    P1-3 — claimed_repo mismatchを無視してmutationしている

    bridge handlerはchildのclaimed_repoとserver固定repositoryが異なる場合、audit logへ記録するだけで、server側repositoryへのIssue作成を続行します。

    「childがrepositoryを選べない」ことと、「childの意図したrepositoryが違っていても黙って別repositoryへ作る」ことは別です。

    正しい動作は次です。

    claimed_repo == authoritative_repo
      → 続行
    
    claimed_repo != authoritative_repo
      → rejected / repository_mismatch
      → mutationなし
    

    repository固定はauthority保護ですが、mismatch無視はcorrectness violationです。


    P1-4 — #2223との衝突判定が二値的すぎる

    Issue #2223は次を同時に定めています。

    • repository security authorityはGitHub Ruleset、branch protection、required CI、repository permission
    • agent frontmatterやhook、classifierはrepository security authorityではない
    • mutation authorityはagent hierarchyではなくexplicit capability/role contractで決める
    • mutation-capable custom SubAgentへの委譲を許可する
    • root/mainを通常mutationの唯一ownerにはしない
    • generic brokerと新規enforcing hookは作らない

    したがって、MCP tool allowlistをworkflow-level deterministic execution boundaryとして使うこと自体は、#2223と衝突しません。 衝突するのは、それをGitHub側security authorityの代替だと主張する場合です。

    同様に、Candidate Dが衝突するのは「rootがproposal解釈からmutationまで唯一のexecution ownerになる」形です。rootがmutation-capableな別custom SubAgentへclosed-schema requestを委譲する構成なら、#2223のcapability-based modelと両立できます。


    推奨設計 — Candidate F: proposal agent + narrow executor SubAgent

    現在のA〜Dの二者択一ではなく、次の構成を追加するのが妥当です。

    1. issue-author相当のproposal agent

    責務はIssue本文案の作成とlocal validationに限定します。

    tools:
      Read
      local validation用の限定Bash
    
    GitHub credential:
      なし
    
    GitHub read/write:
      なし
    

    出力はclosed schemaにします。

    ISSUE_CREATE_PROPOSAL_V2
      repository
      title
      body
      body_sha256
      issue_kind
      labels
      parent
      dependencies
      dedupe_query_intent
      validation_results
    

    現行skillのraw gh issue list、gh issue view、gh issue commentはこのagentから除去します。

    2. issue-committer相当のmutation-capable custom SubAgent

    このSubAgentを#2223上の明示的mutation-capable roleとします。

    tools:
      mcp__issue_create__search_open
      mcp__issue_create__commit_transaction
    
    disallowed:
      Bash
      Skill
      Agent
      Write
      Edit
    

    Claude Code公式仕様上、SubAgentへinline MCP serverを限定し、そのtoolを親sessionへ公開しない構成が定義されています。(Claude)

    3. narrow issue-create server

    既存bridge/helperを拡張し、次を一つのbounded capabilityとして所有させます。

    bounded search
    candidate detail read
    exact-title/fingerprint dedupe
    body validation
    Issue create
    labels
    relationships
    post-create GET
    body hash
    ready tuple
    partial failure
    reconcile
    atomic idempotency
    

    これは全GitHub mutationを仲介するgeneric brokerではなく、Issue create transaction専用のnarrow executorです。

    4. root/main

    rootは次だけを行います。

    proposal agentを起動
    proposal schemaを受け取る
    issue-committerへ渡す
    結果をreadback
    

    rootは通常mutationの唯一ownerにはなりません。mutation authorityはissue-committerのexplicit roleに属します。したがって#2223のcapability-based delegationと整合します。

    採用条件

    このCandidate Fは、P0-1のcorrected MCP experimentがPASSすることを前提とします。

    corrected experimentでもSubAgent-local MCPが再現可能に失敗する場合は、そこで初めて次をowner decisionへ上げるべきです。

    1. #2223へisolated-session例外を追加し、parent-owned executionを認める
    2. Claude Code version gateを設けてMCP routeを保留する
    3. credential isolationまたはAC10の意味論を変更する

    ただし3を採用する場合も、AC10を黙って弱めてはいけません。


    Issue #2292本文へ必要な具体的修正

    Research Resultsの冒頭

    次を追加してください。

    research_status: blocked_on_valid_mcp_positive_control
    candidate_a: rejected_no_technical_enforcement
    candidate_b: conflicts_with_no_new_hook_decision
    candidate_c: inconclusive_invalid_positive_control
    candidate_d: conflicts_if_root_is_sole_execution_owner
    candidate_f: recommended_conditionally
    pr_2286: draft_hold
    issue_2259_ac10: retain

    ACの更新

    現在のAC1〜AC6は抽象度が高すぎます。少なくとも次へ更新すべきです。

    AC1:
      create-issue workflow内の全GitHub read/write operationについて、
      actor・credential owner・transport・failure semanticsを列挙する。
    
    AC2:
      Candidate CのMCP実験がroot positive controlを含む再現可能なmatrixで実施され、
      raw command・debug log・server lifecycle evidenceが記載される。
    
    AC3:
      各候補についてrepository security authorityと
      workflow operational boundaryを区別して#2223整合性を判定する。
    
    AC4:
      推奨設計を1案に絞り、前提条件・fallback・不採用条件を記載する。
    
    AC5:
      full read/create/readback、atomic idempotency、runtime correlationを含む
      implementation Issue scopeを記載する。
    
    AC6:
      PR #2286をmerge可能にするためのprerequisiteと、
      Issue #2259 AC10を維持した検証経路を記載する。
    

    後続implementation Issueのscope

    最低限、次を含める必要があります。

    agent role split
    create-issue skillからraw GitHub CLI operationを除去
    SubAgent-local MCP positive-control test
    narrow read/create transaction schema
    server-side authoritative readback
    atomic request ledger
    repository mismatch rejection
    launcher fail-closed startup
    run-scoped evidence correlation
    concurrent replay/crash/restart tests
    all caller migration
    production/test equivalence test
    

    PR #2286の処置

    PR #2286をDraft/HOLDにした判断は維持すべきです。関連コメントも、AC10を弱めずarchitecture concernを別researchへ切り出す方針を明示しています。

    Draft解除前の最低条件は次です。

    1. Issue #2292のCandidate C判定をinconclusiveへ訂正し、再実験する。
    2. proposal/executorの最終architectureを確定する。
    3. full GitHub operation inventoryを実装へ反映する。
    4. remote bodyを用いたauthoritative readbackへ修正する。
    5. atomic idempotencyを実装する。
    6. runtime evidenceをrequest単位で因果結合する。
    7. corrected genuine runtime testが反復してPASSする。
    8. PR本文の古いAuto Mode原因説と過大なAC6/AC7達成主張をsupersedeする。

    最終判断

    Issue #2292はclose/decision-completeにしてはいけません。

    現時点の適切な状態は次です。

    Issue #2292: OPEN / research blocked
    PR #2286: OPEN / Draft / HOLD
    Issue #2259 AC10: unchanged
    Candidate C: inconclusive
    Recommended direction: Candidate F, corrected MCP experimentを前提
    

    なお、Issue本文に記載されたMCP実験のraw command、debug log、server fixture、trust/managed-policy状態はGitHub上の成果物として提示されていないため、その実験自体を独立再現できませんでした。この不足も、C_DISPROVENではなくC_INCONCLUSIVEと判定すべき理由の一つです。

  3. squne121 commented on Aug 22, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop 終了報告(第2回、owner 敵対的レビュー反映)

    対象コメント: https://github.com/squne121/loop-protocol/issues/2292#issuecomment-5379612388(owner、REQUEST_CHANGES/BLOCK 判定)

    VERDICT: approve(ブロッカーはゼロ件、1回目の反復で承認された)

    反映内容

    • Web調査(web-researcher SubAgent、AGY-first)により、Claude Code 公式ドキュメント(https://code.claude.com/docs/en/sub-agents )で agent-local tool/MCP 境界(disallowedTools: Bash、--agents inline mcpServers、--strict-mcp-config の inline server 非フィルタ)が4件とも confirmed であることを確認した。
    • Superseded Findings 節を新設し、Candidate C の判定を C_DISPROVEN から inconclusive_invalid_positive_control へ撤回・訂正した(第2回実機実験の root/global MCP positive control 不成立のため、per-subagent inline MCP 固有の失敗を識別できていなかった)。
    • Candidate F(proposal-only issue-proposer + narrow MCP限定 mutation-capable issue-committer + narrow issue-create server + root/main orchestration)を recommended_conditionally として追加。採用条件は AC2 更新の corrected MCP positive-control 実験(root positive control を先に PASS させる7段階手順)の PASS。
    • GitHub operation inventory(AC1 更新)を追加し、overlap preflight helper・post-create gh issue view・ready tuple 失敗時の gh issue comment を含む全 operation を actor/read-write/credential owner/transport/failure semantics 等の列で列挙した。
    • PR 実装: isolated Claude-GPT の issue.create 要求を parent-mediated narrow bridge で処理する #2286 の readback 不備(P0-4: request body から SHA を代用しており GitHub からの post-create GET ではない)と atomic idempotency 不備(P0-5: get→mutation→put の排他不足)を Issue 本文へ明記し、修正要件を記載した。
    • Acceptance Criteria(AC1-AC6)をコメント指摘の内容へ具体化した。
    • PR 実装: isolated Claude-GPT の issue.create 要求を parent-mediated narrow bridge で処理する #2286 の処置(Draft/HOLD 維持、Draft 解除の8つの最低条件)を明記した。
    • Research Results 状態 yaml summary(research_status: blocked_on_valid_mcp_positive_control 等)を追加した。

    検証

    • contract_readiness_check.py --mode preflight-static: status: go
    • validate_japanese_content.py --delta-check: DELTA_PASS(新規/変更 prose block のみ、初回は3件 fail し AC10 のダングリング参照とヘッダーの日本語比率不足を修正して解消)
    • run_root_review_pipeline.py produce: VERDICT: approve、BLOCKERS: 0(C5_ac_vc_number_alignment は AC 本文中の他Issue AC言及が誤検知した1回の needs-fix を経て pass)
    • gate-final-review: final_review_allowed: true

    現在の状態(各行の日本語補足付き)

    Issue #2292: OPEN / research blocked
    Issue #2292はOPENのまま研究継続中
    PR #2286: OPEN / Draft / HOLD
    PR #2286はDraft/HOLDを維持
    Issue #2259 AC10: unchanged
    Issue #2259のAC10は変更なし
    Candidate C: inconclusive
    候補Cは結論保留
    Recommended direction: Candidate F, corrected MCP experimentを前提
    推奨方向は候補Fで、修正済みMCP実験を前提とする
    

    Issue #2292 は close/decision-complete にせず、この状態で OPEN のまま維持する。owner_decision_required は true のままだが、停止理由は「候補選定に失敗した」ことではなく「Candidate F を conditionally recommend した上で、AC2 corrected 実験の実施・結果確定を後続 Issue に委ねる」ことである。

  4. squne121 commented on Aug 22, 2026

    @squne121
    OwnerAuthor

    Owner Decision(2026-08-22)

    owner から明示的な方針転換の指示がありました(PR #2286 コメントスレッド参照: #issuecomment-5379646783)。

    owner_decision:
      compatibility_first: true
      candidate_f_adopted_now: false
      credential_isolation_required_now: false
      ac10_exact_hop_chain_required_now: false
      future_hardening_allowed: true
      prerequisite_for_future_hardening:
        - Claude-GPT stable runtime
        - representative workflows complete reliably

    本 Research の Candidate F(proposal-only agent + narrow MCP server による role split)は、現時点の implementation direction として採用しない。これは Candidate F が技術的に成立しないという意味ではなく、現在の owner priority(Claude-GPT の安定稼働・既存 workflow 完走を credential isolation より優先する)の下では、それを正当化する complexity ではないという判断である。Superseded / Deferred by Owner Decision として扱う。

    Issue #2259 の AC10 が要求していた「genuine SubAgent が必ず特定 hop chain(create_issue_txn.py → bridge)を通ること」という厳密な technical enforcement の要求も、現時点では不要と判断された。Issue #2259 自体は NOT_PLANNED で close済み。

    保存する調査成果(削除しない)

    本 Issue の Research Results(Candidate A〜F の比較表、AC2 の MCP 実現可能性の実機実験手順・結果、Issue #2223 との整合性分析)は、将来 credential isolation を再検討する際の一次資料として保持する。特に、当初「C_DISPROVEN」と判定した Candidate C(Bash-less narrow MCP)は、後続ラウンドの実機実験で session-level --mcp-config 経由なら実現可能 であることが判明しており、将来再検討時はこの知見を出発点にする。

    close 理由

    research goal 自体(isolated issue-creator の deterministic execution boundary の設計確定)が current priority から外れたため、本 Issue を close する。将来 credential isolation hardening に再着手する際は、本 Issue の内容を出発点として新たな Issue を起票する。

  5. squne121 commented on Aug 22, 2026

    @squne121
    OwnerAuthor

    確認時点では、Issue #2292 は OPEN / research-only で、18:58:40 JST の本文は Candidate F を conditional recommendation とし、MCP positive-control 未確定のため OPEN 継続としていました。 その直後、PR #2286 の 19:01:01 JST の最新 Owner direction で方針が更新され、「credential isolation / Candidate F を今の prerequisite にせず、まず Claude-GPT を Claude Code 相当に安定稼働させる compatibility-first へ戻す」と明示されています。したがって #2292 本文の Candidate F 推奨をそのまま実装するのは、現在の指示系列とはずれます。

    PR #2286 は現在も OPEN / Draft / mergeable / 未マージ、head は ade3058cc7f2f3ca025cf63dced2187232faf867 です。 最新 head の ci workflow 自体は success ですが、これは旧 bridge 実装の CI が通っているという意味であり、最新 Owner direction がその architecture を採用するという意味ではありません。 また #2223 は generic broker / 新規 enforcing hook を作らず、通常の GitHub mutation は capability-based role と native client + authoritative readback を基本とする decision record なので、compatibility-first への変更と整合します。 main は現在 d530aa4f... で protected、typecheck / lint / test / build / python-test / validate-generated-artifact が required checks です。

    このため、Claude Code には「#2292 の研究成果を保存したうえで hardening deferred として終結 → #2259/#2286 の旧方針を未マージで終了 → replacement implementation Issue → refinement → 実装 → PR → review/CI 修正ループ → squash merge → Closes #N による Issue close確認」まで通しで実行させるのが妥当です。旧 #2292 の「owner approval待ち」は、今回のあなたの明示指示をその判断として扱わせます。

    あなたは squne121/loop-protocol の root/main Claude Code session として、このタスクを end-to-end で完了させる。

    対象は Issue #2292 を起点とする一連の設計・実装整理である。

    関連対象:

    Issue #2292
    調査: isolated issue-creator の GitHub read/mutation 経路を deterministic execution boundary に再設計する

    Issue #2259
    実装: isolated Claude-GPT の issue.create 要求を parent-mediated narrow bridge で処理する

    PR #2286
    実装: isolated Claude-GPT の issue.create 要求を parent-mediated narrow bridge で処理する

    Owner Decision Issue #2223
    決定: GitHub mutation を minimal harness に縮退し server-side protection と live readback を正本にする

    PR #2286 の owner comment 5379646783 および、その後の最新 direction comment 5379666901 も必ず読むこと。

    Authority

    この prompt は owner からの明示的な実行承認である。

    通常の設計判断、Issue 編集・作成・close、PR close、branch 作成、通常 commit/push、テスト、PR 作成、review 対応、CI 修正、ready 化、通常の squash merge、および Closes #N による Issue close まで、追加の人間承認を求めず自律的に進めてよい。

    過去の Issue / comment にある owner_decision_required、human approval required、owner 承認後 等は、このタスクで既に owner が判断を与えた事項について再度停止理由にしない。

    ただし、開始時に live GitHub state を取得し、この prompt より後に投稿された明示的な OWNER direction が存在する場合は、それを最新 authority として再計画する。再計画自体について人間確認は不要である。

    Current Owner Direction

    現時点の leading direction は compatibility-first とする。

    目的は、

    Claude-GPT が Claude Code で既に成立している Agent / Skill / GitHub read-write workflow を、専用 bridge・MCP・role split・新規 enforcement を prerequisite にせず、まず安定して実行できるようにすること

    である。

    credential isolation / deterministic capability hardening は削除すべき安全要件と断定するのではなく、現在の安定稼働に対する prerequisite から外し、将来 hardening として defer する。

    したがって、この run では以下を leading strategy とする。

    existing Claude-GPT launcher
    + minimum GitHub-auth compatibility change
    + existing Agent / Skill / native GitHub behavior
    + outcome-oriented runtime verification
    + authoritative live readback
    

    Candidate F、proposal-only issue-proposer、issue-committer、SubAgent-local narrow MCP、Candidate C の MCP positive-control は「技術的に不可能」と断定しない。ただし 現在は実装しないし、replacement implementation の prerequisite にもしない。

    Stop Conditions

    人間判断へ停止してよいのは、原則として次の2カテゴリーだけとする。

    Destructive operation が不可避な場合。

    具体例は force push、履歴書き換え、reset --hard による既存作業破棄、default/protected branch への direct push、branch protection bypass、repository/branch/tag の削除、他人の未保存作業の破棄、広範囲で不可逆なデータ削除など。

    通常の Issue/PR comment・edit・close/reopen、branch 作成、non-force push、PR 作成、review response、required checks 通過後の通常 squash merge は destructive operation と扱わず、この authorization の範囲で実施してよい。

    Secret / credential の値そのものを取得・表示・保存・転送する必要が生じた場合。

    token、password、private key、credential helper の秘密値等を stdout/stderr、transcript、GitHub comment、Issue/PR body、test artifact、hook log、repository fileへ出してはならない。

    既存の認証済み GitHub auth channel を、秘密値を materialize せず opaque な process/config capability として再利用できる場合は停止不要である。

    echo "$GH_TOKEN"、gh auth token の値取得、credential file の中身表示など、秘密値を読むための操作は禁止する。

    GitHub access の compatibility を与える場合も host HOME 全体、SSH credential、無関係な secret を child に渡さない。既存実装を調査し、GitHub workflow に必要な auth surface だけを最小限共有する。

    CI failure、review blocker、merge conflict、通常の permission error、テスト failure は、それ自体では human-stop condition ではない。原因を調査して通常の非破壊的修正を試みること。解決に branch-protection bypass、force push、秘密値の取得等が必要になった場合のみ上記 Stop Condition に入る。

    Phase 0 — Live readback

    最初に GitHub と local repository の両方を再取得する。

    prompt 内の SHA、過去 comment の SHA、過去の PASS/FAIL 判定を current truth とみなしてはならない。

    最低限、Issue #2292 / #2259 の current body・全 comments・state・labels、PR #2286 の state・Draft・merged・head/base SHA・mergeability・changed files・comments・review threads・checks、Issue #2223 の current Owner Decision、main HEAD・branch protection / required checks、local branch / HEAD / worktree / dirty status を確認する。

    また、compatibility-first または同趣旨の replacement Issue / PR が既に起票されていないか検索し、duplicate を作らない。

    PR #2286 の最新 owner comments 5379646783 と 5379666901 は必ず全文を読む。

    Phase 0 の終了時点で、観測事実と過去の stale claim を区別した短い state snapshot を内部成果物として作る。

    Phase 1 — SubAgent parallel investigation

    少なくとも4系統の SubAgent を可能な限り並列に起動する。

    SubAgent A は codebase-investigator 相当の read-only agent とし、現在 main と PR #2286 の双方について Claude-GPT launcher、GitHub credential isolation、Agent/Skill 呼び出し、issue-creator、create-issue skill、native gh / helper 経路、bridge 固有変更を比較する。

    特に「compatibility-first に必要な最小変更」「PR #2286 から bridge と独立して salvage できる変更」「bridge に不可分なので捨てるべき変更」を分離する。

    SubAgent B は issue-reviewer 相当の read-only agent とし、#2223 / #2259 / #2292 / PR #2286 最新 owner direction を contract-history として比較する。

    特に、#2292 の Candidate F recommendation と AC10 retain が最新 Owner Direction により supersede されたと扱うべきか、#2259 を大幅 reframe するより NOT_PLANNED close が妥当か、#2292 は research record を保存して hardening-deferred decision とともに close できるか、PR #2286 は未マージ close が妥当かを評価する。

    SubAgent C は test-runner 相当とし、現行 main / PR #2286 の runtime evidence とテスト構造を確認する。

    ただし、この段階で実 GitHub mutation を伴う destructive なテストはしない。

    replacement implementation で必要な outcome-oriented runtime verification を設計し、特定の create_issue_txn.py / bridge / MCP hop を通ったことではなく、GitHub read/write workflow の最終状態と authoritative live readback をどのように検証すべきかを整理する。

    SubAgent D は web-researcher 相当とし、必要な範囲だけ最新の Claude Code / GitHub CLI 公式一次資料を確認する。

    調査対象は GitHub CLI の headless auth、Claude Code child process/environment、Agent/Skill の通常 tool behavior 等に限定する。Candidate C/F の研究を再開するための広範な MCP 調査に戻らない。

    Mandatory join barrier

    A/B/C/D の全 SubAgent が終了するまで次 Phase に進んではならない。

    1件でも running / pending なら待つ。

    全件終了後、root が各結果を readback し、重要 claim は repository source、live GitHub state、必要なら公式一次資料で独立確認する。

    SubAgent の summary を無条件に正本にしない。

    Phase 2 — Disposition synthesis

    SubAgent barrier 後、root が最新 owner direction と証拠を統合する。

    新しい重大な反証がない限り、leading disposition は次とする。

    PR #2286 は merge しない。現 bridge / isolation-hardening architecture を継続実装せず、final disposition comment を投稿して OPEN/Draft のまま放置せず close unmerged する。branch/history は削除しない。

    Issue #2259 は、元 contract が credential-isolated bridge と特定 hop-chain AC10 を本質としているため、compatibility-first へ巨大 reframe して履歴を曖昧にしない。最新 Owner Direction、replacement Issue、PR #2286 unmerged close を記録したうえで、goal が現在採用されないなら NOT_PLANNED で close する。

    Issue #2292 は過去の Research Results、Candidate C/F の調査結果、P0 findings を削除しない。末尾に新しい Final Owner Direction / Compatibility-first disposition を追記し、少なくとも次を明記する。

    research_disposition: hardening_deferred
    credential_isolation: deferred_not_required_for_current_compatibility_goal
    candidate_c: deferred_not_disproven
    candidate_f: deferred_not_rejected
    issue_2259: close_not_planned
    pr_2286: close_unmerged
    replacement_direction: compatibility_first_native_github_workflow
    security_authority:
      - github_ruleset
      - branch_protection
      - required_ci
      - repository_permission
    correctness_authority:
      - pre_readback
      - mutation
      - authoritative_post_readback

    Issue #2292 の close reason は live contract を読み直して意味論で決定する。

    研究成果と owner decision の記録まで完了したと評価できるなら COMPLETED、元の deterministic-isolation research goal 自体を現在採用しないため終了する意味が強ければ NOT_PLANNED とする。

    どちらを選んでも、「Candidate F が技術的に不可能だったから閉じる」と誤記してはならない。

    Phase 3 — Mutate legacy artifacts

    GitHub mutation は #2223 の minimum correctness procedure に従う。

    各 mutation について必ず、

    live pre-readback
    → single bounded mutation
    → live post-readback
    → postcondition verification
    

    を行う。

    可能なら mutation-capable な既存 custom SubAgent(例: issue-editor 等)を使う。SubAgent を使った場合は その完了を必ず待つ。

    ただし procedural routing 自体を acceptance condition にしてはならない。root が recovery/fallback mutation を行う必要がある場合も、今回の owner authorization の範囲内で実行してよい。

    Phase 4 — Create replacement implementation Issue

    既存に duplicate がなければ、新規 implementation Issue を 1件だけ作成する。

    title の第一候補:

    実装: Claude-GPT の GitHub access を compatibility-first に切り替え既存 workflow を安定化する

    Goal は次とする。

    Claude-GPT session が、Claude Code session で既に成立している GitHub read/write workflow を、専用 bridge / MCP / role split を prerequisite とせず、既存 Agent / Skill の通常利用方法に近い形で安定して実行できる。

    scope は、Phase 1 の証拠に従い必要最小限にする。

    leading implementation は launcher 側の最小 GitHub-auth compatibility change とし、現在 main の Agent / Skill / native GitHub behavior をなるべく変更しない。

    新規 generic GitHub mutation broker、新規 enforcing PreToolUse hook、issue-proposer / issue-committer role split、narrow MCP server、Candidate C positive-control experiment、raw gh command の新しい technical deny framework は scope に入れない。

    GitHub auth を child に利用可能にする場合、無関係な HOME / SSH / secret surface は共有しない。秘密値を読み出さずに既存 GitHub auth capability を利用できる最小方法を実装する。

    Acceptance Criteria には少なくとも、GitHub read が Claude-GPT の実 session から成功すること、既存 mutation-capable Agent/Skill が通常手順で GitHub write を完了できること、mutation 後に GitHub live readback で expected outcome を確認できること、credential の値が logs/artifacts/transcript に露出しないこと、native Claude Code / non-Claude-GPT workflow が回帰しないこと、server-side GitHub protection を弱めないことを含める。

    runtime verification は hop-chain-oriented ではなく outcome-oriented にする。

    実 GitHub mutation が必要な canary は、unique run marker を持つ bounded disposable Issue 等の可逆的な対象を使用し、create/readback/close/readback を行う。cleanup のための通常 Issue close は destructive operation と扱わない。

    テストが作った remote object は番号を記録し、live postcondition を確認する。orphan を黙って残して PASS にしない。

    Phase 5 — issue-refinement-loop

    replacement Issue を起票後、issue-refinement-loop を実行する。

    この prompt と最新 owner direction に既に含まれる scope decision について、再度人間承認を要求してはならない。

    refinement SubAgent/loop の完了を待つ。

    機械的 reviewer が Candidate F / bridge / MCP hardening を prerequisite として再導入しようとした場合は、その suggestion を owner direction と照合し、scope creep なら採用しない。

    refinement で genuine contract defect が見つかった場合は自律的に修正して再レビューする。

    replacement Issue が implementation-ready / GO になるまで bounded loop を継続する。

    Phase 6 — Clean implementation branch

    replacement Issue が GO になったら、PR #2286 branch を再利用しない。

    live main の current HEAD から新しい task branch / worktree を作成する。

    PR #2286 の巨大な逆向き revert PR を作ってはならない。

    PR #2286 から salvage する場合は、SubAgent A/D が「bridge/isolation hardening から独立し、compatibility-first でも必要」と証明した小さな変更だけを選択する。

    bridge と不可分な server/client/ledger/MCP/role-split hardening を carry forward しない。

    dirty worktree が存在する場合は他者の変更を破棄しない。安全な別 worktree を使用する。

    Phase 7 — Implementation

    impl-review-loop または repository の現在の canonical implementation workflow を使用して implementation を開始する。

    実装 SubAgent を使用した場合は必ずその完了を待つ。

    変更は replacement Issue の Allowed Paths / scope に限定する。

    leading strategy は、

    existing Claude-GPT launcher
    + minimum GitHub auth compatibility change
    + existing Agent / Skill / native gh behavior
    + outcome-oriented runtime smoke
    

    とする。

    不要な architecture framework を増やさない。

    実装後、Issue に定義された verification commands と影響範囲の regression tests をすべて実行する。

    最低限 repository standard の、

    pnpm typecheck
    pnpm lint
    pnpm test
    pnpm build
    

    および relevant Python tests / Claude-GPT runtime tests を実行する。

    実際の command authority はその時点の repository の CI/config/Issue contract を live readback して決定する。

    Phase 8 — Independent post-implementation SubAgents

    実装完了後、最低2件の fresh SubAgent を並列で起動する。

    1件は test-runner 相当として、Issue AC と実 test evidence の対応を独立検証する。

    もう1件は pr-reviewer / issue-reviewer 相当として、scope、security regression、secret exposure、compatibility-first principle、#2223 compatibility を敵対的にレビューする。

    両方の完了を待つ。

    blocking finding があれば修正し、関連テストを再実行し、fresh reviewer を再度起動する。

    review → fix → retest → rereview のループを blocker 0 になるまで継続する。

    Phase 9 — Commit / push / PR

    全ローカル verification が green になったら通常 commit を作成し、non-force push する。

    PR を作成する。

    PR body には必ず replacement Issue の番号を使って、

    Closes #N

    を含める。

    N は #2292 や #2259 を機械的に使わず、Phase 4 で作成した replacement implementation Issue の実番号とする。

    PR body には #2259 / #2292 / closed-unmerged PR #2286 を historical context / superseded hardening direction として参照する。

    実施した tests と runtime evidence、secret-handling boundary、server-side protections を弱めていないことも記載する。

    Phase 10 — PR review and CI loop

    PR 作成後、current head SHA を取得する。

    fresh pr-reviewer SubAgent を起動し、完了を待つ。

    GitHub 上の PR comments、formal reviews、inline review threads、required checks をすべて取得する。

    P0/P1、REQUEST_CHANGES、blocking thread、required CI failure はすべて対応する。

    単に rerun して偶然 green にするのではなく、deterministic failure は root cause を修正する。

    修正 commit を push するたびに current head SHA を再取得し、古い head の CI / review approval を流用しない。

    required checks が current head に対して全て green になるまで待つ。

    reviewer blocker がなくなるまで fresh review を繰り返す。

    non-blocking suggestion は replacement Issue の scope と照合し、scope creep なら理由を記録して採用しなくてよい。

    Phase 11 — Ready / merge

    current head について次をすべて live readback する。

    mergeable
    required checks all green
    unresolved blocking review threads = 0
    fresh reviewer blocker = 0
    replacement Issue AC = all satisfied
    PR body contains exact "Closes #N"
    base = current intended main
    

    条件を満たしたら Draft なら ready for review にする。

    repository policy が許可する通常の squash merge を実行する。

    この task では、全 gate 通過後の通常 PR merge は owner authorization 済みであり、追加確認を求めない。

    branch protection bypass、force merge、required check の無効化は行わない。

    merge に server-side gate が残る場合は通常手段で解消する。解消に destructive bypass または secret materialization が必要な場合だけ Stop Condition とする。

    Phase 12 — Issue close verification

    merge 後に replacement Issue を live readback する。

    Closes #N により CLOSED になったことを確認する。

    自動 close されていない場合は、PR merge と全 AC 達成を再検証した上で completion comment を残し、通常の Issue close を行う。

    #2292 / #2259 / #2286 についても最終 state を再取得する。

    期待される最終方向は、

    pr_2286:
      merged: false
      state: closed
    
    issue_2259:
      state: closed
      disposition: not_planned_or_equivalent
    
    issue_2292:
      state: closed
      research_record_preserved: true
      hardening: deferred
      candidate_f: deferred_not_rejected
    
    replacement_issue:
      state: closed
      closed_by: replacement_pr_or_verified_manual_completion
    
    replacement_pr:
      state: merged
      merge_method: squash
    
    main:
      contains_replacement_change: true
    
    security:
      branch_protection_weakened: false
      required_ci_weakened: false
      secret_value_exposed: false

    実際の live evidence がこれと異なる場合、最新 owner direction と Issue contract に基づく正しい final state を採用し、差分理由を報告する。

    Final independent audit

    最後に fresh read-only SubAgent を1件起動し、全作業の独立 audit をさせる。

    監査対象は、

    旧 PR #2286 が未マージで終了していること、#2259/#2292 に disposition history が残っていること、replacement PR が Closes #N を持つこと、current main に変更が入っていること、replacement Issue が close 条件を満たしていること、required CI が merge 時 head で green だったこと、secret 値の露出を示す evidence がないこと、branch protection / required CI を弱めていないこと。

    audit SubAgent の完了を待つ。

    重大な不整合があれば、destructive/secret Stop Condition に抵触しない範囲で自律的に是正して再監査する。

    Final report

    完了時は、途中経過ではなく live final state を基準に次を簡潔に報告する。

    FINAL_RESULT
    latest_main_sha:
    issue_2292_state:
    issue_2259_state:
    pr_2286_state:
    replacement_issue:
    replacement_issue_state:
    replacement_pr:
    replacement_pr_state:
    replacement_pr_merge_sha:
    closes_binding:
    required_ci:
    review_blockers:
    runtime_verification:
    secret_exposure:
    server_side_protection_changed:
    subagents_started:
    subagents_completed:
    join_barriers_satisfied:
    destructive_operation_performed:
    remaining_blockers:
    

    subagents_completed は実際に全件完了を確認した数だけを記載する。

    未完了 SubAgent が存在する状態で「完了」と報告してはならない。

    途中で古い owner direction や stale SHA を current truth として扱わず、最終報告直前にも GitHub live readback を行うこと。

    このプロンプトでは、旧 PR #2286 を修理し続けるループから抜け、新しい小さい implementation Issue/PR に切り替える点を明示しています。また通常の squash merge まで今回の承認範囲に含めているため、Closes #N の実際の発火と Issue close まで人間待ちになりません。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions