Skip to content

実装: worktree runtime smoke の Claude peer messaging を invocation-local に無効化する #2437

Closed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
parent_issue: none
issue_kind: implementation
goal_ref: >
  worktree-agent-runtime-smoke が起動する Claude Code / Claude-GPT invocation が Claude native peer messaging を
  使用せず、default interactive lane では pre-existing/human Herdr namespace を探索・一覧・snapshot・操作・message せず、同一 main session の Agent spawn から terminal
  completion の観測を阻害しないように、harness-owned invocation-local policy を追加する。`--require-session-baseline-preservation` が明示された場合だけ、pre-existing Herdr session baseline preservation observation を opt-in で実行する。
change_kind: workflow-runtime
relationship: standalone_follow_up
native_relationships: none
related:
  - "#2176 (historical Herdr isolation)"
  - "PR #2222 (historical runtime-smoke lifecycle evidence)"
  - "#2219 (historical runtime-smoke expansion)"
  - "#1830 (historical advisory workflow boundary)"
  - "#2403 (related)"
  - "PR #2407 (related/historical; out of scope)"

Parent Issue

なし(standalone follow-up。native parent / dependency / blocked-by / blocking は設定しない)

Parent Goal Ref

Harness-started runtime-smoke invocation に invocation-local peer policy を適用し、Claude native peer messaging を使用させず、in-session Agent(...) spawn→terminal completion と、default interactive lane の fresh isolated Herdr session・ambient HERDR_* stripping・self-cleanup を維持する。pre-existing Herdr session baseline observation は --require-session-baseline-preservation の明示 opt-in 時だけ実行する。

Remaining Parent Gaps

親Issueなし。#2403/PR #2407等は関連/歴史参照のみで変更しない。

Background

This is a standalone follow-up: it has no native parent, dependency, blocked-by, or blocking relationship. #2176, PR #2222, #2219, #1830, #2403, and PR #2407 are related or historical references only.

The runtime-smoke runner currently keeps structured execution as a direct subprocess and runs interactive execution in a fresh named Herdr session after stripping ambient HERDR_* identity. By default it does not explore, list, snapshot, operate on, or message pre-existing/human Herdr namespaces. Only an explicit --require-session-baseline-preservation opt-in performs before/after observation for pre-existing Herdr session baseline preservation. That namespace isolation does not by itself control Claude Code native cross-session tools. The smallest appropriate change is a harness-owned invocation-local Claude policy: native structured and interactive settings set crossSessionInbound: "refuse" and deny bare SendMessage and ListAgents; Claude-GPT extends its existing fixed runtime-smoke settings/profile channel without reopening arbitrary --settings passthrough.

This is not an absolute security boundary. The contract is limited to the initial/effective policy of processes started by this harness not being weakened by caller prompt or public smoke CLI input. Hostile/self-relaunch behavior, OS sandboxing, Unix-user/VM/account isolation, and caller-proof global enforcement are outside this Issue.

The top-level coordinator is not a verification dependency or handoff through an independent peer. Guidance must say that canonical-root contention uses existing safe mechanism, bounded wait, safe-point retry, or explicit SKIP/FAIL reason; it does not SendMessage an independent peer. Do not introduce a top-level global hard deny or policy engine.

Outcome

Harness-started runtime-smoke の initial/effective invocation policy に crossSessionInbound: "refuse" と bare SendMessage / ListAgents deny を固定し、human peer を観測せずに Agent(...) spawn→terminal completion と default interactive lane の fresh isolated Herdr boundary を維持する。pre-existing Herdr session baseline observation は --require-session-baseline-preservation の明示 opt-in 時だけ実行する。これは absolute security boundary ではない。

Current Validated Scope

  • Native structured and interactive harness invocations receive harness-owned settings injection with crossSessionInbound: "refuse" and bare SendMessage / ListAgents deny.
  • Claude-GPT receives the same policy only through its fixed launcher-owned runtime-smoke profile/channel; arbitrary caller settings passthrough remains closed.
  • The controlled canary checks generated settings and spawned-process tool absence/denial without starting, sending to, or observing a human/independent peer.
  • Required in-session Agent(...) spawn→terminal completion/lifecycle evidence remains the supported coordination path; post-spawn peer or subagent SendMessage coordination is not required.
  • Structured execution remains a direct subprocess. The default interactive lane creates a fresh random/named isolated Herdr session, strips ambient HERDR_*, cleans up only its own session, and does not explore, list, snapshot, operate on, or message pre-existing/human Herdr namespaces. Pre-existing Herdr session baseline preservation observation runs only with explicit --require-session-baseline-preservation.
  • Coordinator behavior is guidance only: independent peers are not verification dependencies/handoffs, and canonical-root contention follows existing safe mechanisms, bounded wait, safe-point retry, or explicit SKIP/FAIL reason.

In Scope

  • Generate and inject harness-owned native Claude settings for structured direct subprocess and interactive isolated-Herdr invocations with crossSessionInbound: "refuse" and permissions.deny: ["SendMessage", "ListAgents"].
  • Narrowly extend the existing launcher-owned Claude-GPT runtime-smoke settings/profile path with the same policy while retaining rejection of arbitrary caller --settings and policy-bypass inputs.
  • Preserve structured direct-subprocess semantics. Preserve the default interactive lane's fresh random/named isolated Herdr session, ambient HERDR_* stripping, and cleanup of only its own session, without exploring, listing, snapshotting, operating on, or messaging pre-existing/human Herdr namespaces; perform before/after pre-existing Herdr baseline preservation observation only with explicit --require-session-baseline-preservation.
  • Add focused static/generated-settings and controlled spawned-process canaries, lifecycle evidence, bounded feature-unavailable SKIP handling, and minimal runtime-smoke workflow guidance.

Acceptance Criteria

  • AC1: Native structured and interactive harness argv/settings generation contains exactly crossSessionInbound: "refuse" and a bare permissions.deny entry for both SendMessage and ListAgents; the settings are harness-owned invocation-local input and do not rewrite global Claude settings.
  • AC2: Claude-GPT runtime-smoke generated settings/profile contains the same three policy values only through its existing launcher-owned fixed channel; arbitrary caller --settings or public CLI policy input cannot weaken that generated invocation policy.
  • AC3: Focused tests verify generated settings exactly, and a controlled spawned test process reports SendMessage and ListAgents absent or denied. The canary neither starts nor observes a human/independent peer and neither records peer transcript, turn, message, or session state.
  • AC4: With the bare peer-tool deny in effect, the required in-session Agent(...) spawn and terminal completion/lifecycle evidence remain observed. The contract does not require post-spawn SendMessage, resume, agent-team, or other subagent messaging coordination.
  • AC5: Default interactive execution still creates and cleans only its own fresh random/named isolated Herdr namespace, strips ambient HERDR_*, and does not explore, list, snapshot, operate on, or message pre-existing/human Herdr sessions. Only an explicit --require-session-baseline-preservation opt-in performs before/after pre-existing Herdr session baseline preservation observation. Structured execution remains a direct subprocess and performs no Herdr control-plane mutation.
  • AC6: Runtime evidence uses only these bounded names with configured versus observed meaning preserved: peer_policy_configured, cross_session_inbound_configured_refuse (configured), outbound_peer_tools_absent, agent_spawn_completion_observed, herdr_namespace_isolated, and preexisting_herdr_preserved (observed). preexisting_herdr_preserved retains its existing evidence key/type and is observed only for explicit --require-session-baseline-preservation; outside that opt-in it is unavailable/null rather than inferred or fabricated from a prior SKIP. No inbound behavioral proof is claimed and no controlled sender targets a human peer.
  • AC7: On macOS/Linux/WSL2 Claude Code v2.1.224+ or native Windows v2.1.234+ where the feature is available, runtime-smoke validates the policy. Where the feature/runtime is unavailable it exits under the existing bounded explicit SKIP convention with a reason code; it does not add a broad compatibility harness or complicate the normal WSL2 path.
  • AC8: Runtime-smoke guidance leaves independent peers out of coordinator verification dependency/handoff. Canonical-root contention uses an existing safe mechanism, bounded wait, safe-point retry, or explicit SKIP/FAIL reason, without adding a lease, mutex, peer registry, daemon, or new workflow enforcement mechanism.

Required Design References

  • docs/dev/runtime-verification-policy.md
  • docs/dev/agent-runtime-ops.md
  • .claude/skills/worktree-agent-runtime-smoke/SKILL.md
  • .claude/skills/worktree-agent-runtime-smoke/references/claude-code.md

Required Skills

  • worktree-agent-runtime-smoke

Runtime Verification Applicability

decision: immediate
reason: >
  This changes extension/lifecycle runtime policy for harness-started Claude processes and requires runtime evidence in addition to focused static tests. Default interactive evidence must not inspect pre-existing/human Herdr namespaces; their baseline-preservation observation is only an explicit `--require-session-baseline-preservation` opt-in.
applicable_acs:
  - AC1
  - AC2
  - AC3
  - AC4
  - AC5
  - AC6
  - AC7
  - AC8
execution_environment: >
  A linked worktree, Python/uv, pytest, pnpm dependencies, and authenticated/installed Claude plus Herdr only for the real runtime-smoke lane; the default lane uses its own fresh isolated session and does not inspect pre-existing/human Herdr namespaces. `--require-session-baseline-preservation` is used only when intentional opt-in baseline observation is required; network/auth prerequisites follow docs/dev/runtime-verification-policy.md.
skip_conditions: >
  If Claude/Herdr or the relevant documented cross-session feature is unavailable, or a real Herdr isolated-session launch is prevented by nested-session policy or equivalent execution-environment constraint, use the existing exit-77 explicit SKIP convention with a bounded reason code and do not classify SKIP as PASS.
fallback_policy: >
  A fallback, mock-only result, unavailable feature, or SKIP is not runtime PASS; focused tests may pass independently but do not satisfy the required live runtime evidence. A real-Herdr isolated-session launch blocked by nested-session policy is runtime SKIP exit 77 with a bounded reason code, not PASS.
artifact_requirements: >
  Write only the existing worktree-local allowlisted runtime-smoke artifacts/runtime-smoke/<run-id>/summary.md evidence; exclude raw prompts, transcripts, credentials, HOME paths, human Herdr/session state, and peer content. Preserve `preexisting_herdr_preserved` as its existing bounded observed evidence key/type only for explicit opt-in baseline observation; outside that opt-in record it as unavailable/null and never manufacture interactive PASS from a prior SKIP.

Verification Commands

# AC1
# AC3
# AC4
# AC5
# AC6
# AC7
# AC8
$ uv run pytest scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke.py scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_herdr_isolation.py scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_workspace_snapshot.py

# AC2
$ uv run pytest scripts/claude-gpt/test_launch_transport_policy.py

$ pnpm typecheck
$ pnpm lint
$ pnpm test
$ pnpm build
$ uv run pytest .claude/skills/gemini-cli-headless-delegation/tests/test_model_routing.py

Allowed Paths

  • scripts/agent-ops/run_worktree_agent_runtime_smoke.py
  • scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke.py
  • scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_herdr_isolation.py
  • scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_workspace_snapshot.py
  • .claude/skills/worktree-agent-runtime-smoke/SKILL.md
  • .claude/skills/worktree-agent-runtime-smoke/references/claude-code.md
  • scripts/claude-gpt/launch.sh
  • scripts/claude-gpt/test_launch_transport_policy.py
  • docs/dev/agent-runtime-ops.md
  • docs/dev/runtime-verification-policy.md

Out of Scope

Stop Conditions

  • Allowed Paths 外の変更が必要と判明した場合

  • In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合

  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)

  • 後続 Phase / 別スコープへの波及が判明した場合

  • nested SubAgent delegation が必要になった場合

  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合

  • Implementing the default lane requires exploring, listing, snapshotting, operating on, messaging, reading, storing, sending to, or otherwise observing a pre-existing/human Herdr session or human/independent-peer transcript, turn, message, session state, secrets, or global configuration. An explicit --require-session-baseline-preservation opt-in may perform only its existing before/after baseline observation and bounded preexisting_herdr_preserved outcome; if it requires recording or exposing session state, stop.

  • The change requires mutation of global Claude/Herdr configuration, arbitrary --settings passthrough, or a new global/top-level enforcement mechanism.

  • The documented upstream semantics make bare SendMessage/ListAgents deny incompatible with required Agent(...) spawn-to-terminal-completion lifecycle; report the exact incompatibility rather than weaken the contract.

  • Existing safe canonical-root handling cannot produce bounded wait, safe-point retry, or explicit SKIP/FAIL reason without creating a prohibited coordination mechanism.

  • A real Herdr isolated-session launch is prevented by nested-session policy or equivalent execution-environment constraint; stop runtime verification with SKIP exit 77 and a bounded reason code, and do not treat SKIP as PASS.

References

Source / Dedupe Key

source_kind: owner_approved_human_context_refinement
source_context: "Issue #2437 anchor review refinement on 2026-08-30"
dedupe_key: "follow-up:squne121/loop-protocol:worktree-agent-runtime-smoke:invocation-local-peer-policy-v2"

Activity

  1. added
    enhancement
    phase/implementation
    agent/implementer
    on Aug 30, 2026
  2. squne121 commented on Aug 30, 2026

    @squne121
    OwnerAuthor

    結論

    Issue #2437 の方向性自体は妥当です。ただし、現状の契約のままなら REQUEST_CHANGES を推奨します。

    理由はセキュリティ不足ではありません。むしろ逆で、実際に起きた事故より広い「隔離の証明」を runtime-smoke harness に背負わせ始めており、#2219 / PR #2222 で既に膨らんだ検証ハーネスをさらに重くする危険があるためです。#2437 は「人間の別タブを触らない」という実用上重要な境界だけを、安価な launch-time policy で閉じるべきです。Issue 自体には現在コメントはありません。

    前提確認

    PR #2407 で実際に起きたのは、fix-auto-permission-boundaries などが SubAgent と誤認されたのではなく、同一マシン上で別作業中の独立 Claude session に coordinator が SendMessage したことです。loop-protocol-c9、loop-protocol-3d、loop-protocol-91 にも handoff を依頼し、一部には idle notification まで設定していました。これは #2437 が解決したい問題として正しいです。

    一方 Herdr 側は既にかなり強く分離されています。PR #2176 では interactive lane の既存 Herdr 全体 snapshot 前後比較まで実装済みで、現行 runner も structured は直接 subprocess、interactive は独立 named Herdr session という構成です。Herdr 公式仕様でも named session は panes・socket・persisted runtime state が別 namespace であり、agent.prompt や pane.send_keys のような強い操作面はその session 内にあります。したがって、ここをさらに強化する必要性は低いです。 ([Herdr]1)

    さらに #2219 / PR #2222 では、multi-turn、複数 SubAgent exact lifecycle pairing、hook sink、nonce/staleness、cleanup、forbidden marker などが追加され、当時すでに runtime-smoke 関連 178 tests PASS まで拡張されています。#2437 で同じ方向の「証拠強度競争」を続けるのは避けた方がよいです。

    敵対的レビュー findings

    1. P0 — 実事故の主体と、強制境界を入れる対象がずれています。 fix: preserve GH_CONFIG_DIR for bare preflight.run #2407 で他 session に送信したのは runtime-smoke の子 process ではなく、それを実行していた coordinator 側です。実装: worktree runtime smoke の Claude peer messaging を invocation-local に無効化する #2437 Scope B/C で smoke child に SendMessage / ListAgents deny を掛けるのは正しいものの、これだけでは同じ coordinator が再び「canonical root を空けて」と別タブへ送ることまでは防げません。ここを完全に強制しようとして top-level Claude Code 全体に deny を掛けると、通常の SubAgent/agent-team 利用まで巻き込みます。したがって Goal は「runtime-smoke child の deterministic isolation」に狭め、coordinator については workflow rule として『独立 peer を verification dependency にしない』までに留めるのが妥当です。事故全体を cryptographic/security boundary 的に閉じる Issue にしない方がよいです。

    2. P0 — AC3 の「既に動いている independent Claude session を相手にする negative live canary」は削除すべきです。 守りたい人間セッションが存在することをテスト前提にし、しかも「送信されなかったこと」を証明するためにその peer の turn/transcript を観測し始めれば、本末転倒です。CI/ローカル環境でも nondeterministic になります。Claude 公式では bare deny の SendMessage / ListAgents は tool 自体を model context から除外し、deny は ask/allow より優先され、Claude Code client が enforcement します。したがって、生成 settings の unit test + 実 process で tool が unavailable/denied であることの canary で十分です。人間の既存 peer は一切テスト対象にしないのがよいです。([Claude]2)

    3. P1 — 「caller が絶対に解除できない」「deterministic isolation」という表現は security boundary としては強すぎます。 Claude Code の settings は running session 中にも hot reload され、permissions も対象です。Anthropic の issue tracker にも、local config は hostile --dangerously-skip-permissions agent に対する完全な security boundary ではないという未解決報告があります。([Claude]3) ただし今回の用途では、そこを解決する必要はありません。現行 native smoke は既に harness-owned inline --settings を process-local overlay として持ち、Claude-GPT は caller の --settings を拒否して launcher-owned settings を生成しています。 AC は「harness が起動した process の initial/effective invocation policy を caller prompt や公開 CLI input から弱められない」程度へ狭めるべきです。self-relaunch、OS sandbox、account-level isolation まで追わない方がこのプロジェクトに合っています。

    4. P1 — SendMessage deny は cross-session だけを止める機能ではありません。 Anthropic 公式 docs は、同じ SendMessage が independent session、SubAgent、agent-team teammate に使われるため、bare deny すると SubAgent への message も消えると明記しています。([Claude]4) したがって AC4 は「SubAgent lifecycle が維持される」では広すぎます。「Agent(...) spawn → terminal completion の観測は維持される。ただし smoke process 内での SubAgent への追加 SendMessage / resume coordination は利用不可でよい」と明文化してください。現在の smoke が要求する lifecycle はこれで足ります。将来 SendMessage が本当に必要になったときだけ、より細粒度な境界を別途検討すべきです。

    5. P1 — AC8 の evidence 名が「設定した」と「実際に観測した」を混同しています。 claude_peer_inbound_refused=true は、実際に controlled sender から送って drop を観測しない限り「refuse が設定された」証拠でしかありません。逆にそこを live peer で証明しようとすると AC3 の過剰テストに戻ります。peer_policy_configured、outbound_peer_tools_absent、cross_session_inbound_configured_refuse のように、config evidence と behavioral evidence を分離した方が正確です。Herdr の preexisting_herdr_preserved は既存 snapshot で実観測できるため、そのままで構いません。

    6. P2 — version/platform compatibility harness は作らない方がよいです。 Cross-session messaging は Claude Code v2.1.224+、macOS/Linux/WSL2 で提供され、native Windows では提供されません。([Claude]4) 対応外 runtime のために大量の branching を追加するより、「対応 runtime では policy を検証、feature unavailable なら明示 SKIP」に留めるべきです。WSL2 が主要環境なら十分です。

    7. P2 — canonical-root contention の lease/mutex 新設まで 実装: worktree runtime smoke の Claude peer messaging を invocation-local に無効化する #2437 に入れない方がよいです。 「peer に main root を空けろと SendMessage しない」というルールだけ必要です。busy なら bounded wait、SKIP/FAIL with reason、あるいは安全な既存 preflight mechanism に戻すだけで足ります。新しい repository coordination protocol を作ると Issue が別物になります。

    最小実装案

    現行コードには、ちょうど良い injection point が既にあります。native structured lane は _CLAUDE_SPAWN_HOOK_OBSERVABILITY_SETTINGS_JSON を inline --settings で追加し、Claude-GPT は CLAUDE_GPT_RUNTIME_SMOKE_HOOKS という固定値チャネルを launcher-owned settings に変換しています。

    ここにだけ、

    {
      "crossSessionInbound": "refuse",
      "permissions": {
        "deny": ["SendMessage", "ListAgents"]
      }
    }

    を追加するのが最も小さい変更です。これは Anthropic が公式に案内している cross-session off の組み合わせそのものです。crossSessionInbound: refuse は inbound を drop し、bare deny は outbound/listing tool を model context から外します。なお project/local により厳しい値があればそれも維持され、permissions は scopes 間で merge されます。([Claude]4)

    native interactive lane は現在 Herdr の agent start に追加 Claude args を渡す余地があるので、同じ harness-owned settings を herdr agent start ... -- --settings <fixed-json> として渡す。Claude-GPT interactive は caller --settings を通さず、既存 launcher の smoke-only fixed settings generation に同じ3項目を足す。この程度で十分です。新しい policy engine、peer registry、socket inspection、account-level disable、PreToolUse hook は不要です。

    テストも、generated settings の exact test、native structured/interactive argv、Claude-GPT generated settings、caller override poison test、既存 --require-min-subagents lifecycle regression の5系統程度でよいです。AC3 の「既存 human peer を用意して本当に送信されないことを確認」は merge gate から外してください。

    Issue #2437 をどう直すか

    私なら Issue を閉じたり分割したりはせず、そのまま refinement して実装します。ただし Goal/AC の表現を次のように変更します。

    「人間・peer から完全に security-isolate する」ではなく、**「runtime-smoke invocation が Claude native peer messaging を使用せず、既存 Herdr namespace に触れず、通常の Agent spawn/completion を妨げない」**を destination にします。

    AC3 は pre-existing independent session negative canary を削除し、harness-owned settings / tool-surface canary に変更。AC4 は「SubAgent messaging」ではなく「Agent spawn/completion」に限定。AC8 は observed と configured を区別。そして Scope A の coordinator 禁止事項は workflow guidance として残すものの、そこへ新しい enforcing hook を導入しない、という形です。

    この方針はリポジトリ自身の #1830 で採用した「通常 workflow を阻害する enforcing harness を quarantine し、観測は fail-open / advisory に寄せる」という設計判断とも整合します。

    推奨判定は needs-fix / REQUEST_CHANGES。ただし修正量は小さくできます。 crossSessionInbound + 2 tool deny という Claude Code 本来の機能を invocation-local に適用し、既存 Herdr isolation と SubAgent lifecycle regression を再利用するだけに留めるのが、品質と作業性のバランスが最も良いです。セキュリティハーネスとして高度化する必要はありません。

    必要なら、次にこのレビューを反映した Issue #2437 の refinement 用 Claude-GPT / Claude Code 作業プロンプトまで、実装方針を固定して作れます。

  3. squne121 commented on Aug 30, 2026

    @squne121
    OwnerAuthor

    推奨は、Issue #2437 を分割・クローズせず、アンカーコメントを owner-authoritative な human context として in-place refinement することです。現行 issue-refinement-loop は loop iteration の承認を既定で要求せず、human-context anchor から trusted contract update に進む正規経路も持っています。途中の needs-fix や issue_editor_required は、人間へ戻さず既存 consumer に流すべきです。

    アンカーコメントの主張は概ね採用でよいですが、1点だけ最新仕様に合わせて補正すべきです。Claude Code の現行公式ドキュメントでは cross-session messaging は macOS/Linux/WSL2 で v2.1.224+、native Windows でも v2.1.234+ とされています。したがって「native Windows では利用不可」というコメント中の記述は、そのまま Issue に固定しない方がよいです。公式仕様は crossSessionInbound: "refuse" と SendMessage / ListAgents deny を off 手段として明記し、SendMessage deny が SubAgent/agent-team messaging も消す点も明記しています。([Claude]1)

    以下の対象に対して issue-refinement-loop を実行してください。

    対象 repository:
    squne121/loop-protocol

    対象 Issue:
    #2437

    human-context anchor:
    Issue comment ID 5467989616

    これは人間による明示的な実行指示です。
    また、上記 anchor comment は repository owner が Issue #2437 の semantic direction を具体的に reframe するために投稿した human context として扱ってください。

    目的は Issue #2437 の refinement を、人間の追加承認を要求せず、terminal approve / implementation-ready になるまで bounded に完遂すること です。

    最重要ルール

    • issue-refinement-loop の canonical procedure と command registry を SSOT として実行する。
    • loop iteration ごとの人間承認は要求しない。
    • needs-fix は残り iteration がある限り自動継続する。
    • deterministic repair / structural repair / trusted human-context contract update / issue-editor rewrite は、このプロンプトで事前承認済みとみなす。
    • anchor comment が既に決定している semantic choice を、もう一度 human_judgment_required として人間へ質問し直さない。
    • 人間に machine-readable reframe、Allowed Paths、AC 文言などを書き直させない。repository の既存 human-context consumer を使用して自動 materialize する。
    • refinement run なので、Issue の実装コードを書いたり implementation PR を作成したりしない。今回の destination は Issue 実装: worktree runtime smoke の Claude peer messaging を invocation-local に無効化する #2437 自体の implementation-readiness である。

    canonical human-context lane

    anchor URL/ID を agent report や unlabeled anchor として扱わないこと。

    canonical main root / default branch から、current repository の issue-refinement-loop が定義する

    • preflight.run.with_human_context
    • 必要なら contract_update.run.with_human_context

    の正規 profile を使用する。

    コマンド文字列を記憶や推測で再構築せず、current main の command registry / skill を読んで exact invocation を使うこと。

    preflight.run.with_human_context が trusted contract patch plan を生成した場合は、その plan を canonical consumer に渡して contract update を実行する。

    NEXT_ACTION: issue_editor_required の場合:

    • 同じ contract-update mutation を再試行しない。
    • anchor comment の再投稿を人間に要求しない。
    • canonical issue-editor / controlled Issue rewrite lane へ自動 handoff する。
    • body/title readback → fresh preflight → fresh review → fresh readiness まで完了させる。

    apply_deterministic_repair / apply_deterministic_structural_repair が返った場合も、人間確認を挟まず canonical consumer で適用する。

    anchor comment の semantic direction

    anchor comment の REQUEST_CHANGES / needs-fix を反映する。

    Issue #2437 は閉じたり分割したりせず、そのまま refinement して implementation-ready にする。

    特に以下を Issue contract に反映すること。

    1. Goal を実事故に合わせて狭める

    「人間・peer session から完全な security isolation を証明する」ことを destination にしない。

    destination は概ね次の意味にする:

    • worktree-agent-runtime-smoke が起動した runtime-smoke invocation が Claude native peer messaging を使用しない。
    • pre-existing human Herdr namespace を操作しない。
    • 通常必要な同一 main session 内の Agent(...) spawn → terminal completion を阻害しない。

    coordinator/top-level workflow 側については、

    • independent Claude peer session を verification dependency / handoff surface にしない。
    • canonical-root contention の解決目的で peer session を message しない。

    という workflow guidance を維持する。

    ただし、そのためだけに top-level Claude 全体を hard-deny する新 enforcement hook / policy engine を追加する契約にはしない。

    2. AC3 の live human-peer canary を削除する

    pre-existing independent Claude session、特に人間が実際に操作中の session を negative canary の相手にしてはならない。

    以下の組み合わせへ変更する:

    • generated harness-owned settings の exact/static test
    • spawned test process 自身で SendMessage / ListAgents が absent / denied であることを確認する controlled canary
    • human peer の transcript、turn、message body、session state を観測しない

    「他 session に送信されなかったことを確認するために、他 session を調べる」という循環した検証設計を作らない。

    3. absolute security-boundary claim を弱める

    以下のような絶対表現は避ける:

    • caller が絶対に解除できない
    • deterministic security isolation
    • hostile process に対する完全な boundary

    今回保証するのは、

    harness が起動する process の initial/effective invocation policy が、caller prompt や smoke runner が公開している CLI input によって弱められないこと

    程度に限定する。

    self-relaunch、OS-level sandbox、別 Unix user、VM、account-level isolation 等まで Issue #2437 に持ち込まない。

    4. SendMessage deny と SubAgent の関係を正確にする

    current official Claude Code docs を再確認すること。

    SendMessage は independent peer session だけではなく、SubAgent / agent-team teammate messaging にも使われるため、bare deny するとそれらへの追加 messaging も使用不能になる。

    したがって AC4 は、

    • Agent(...) spawn
    • SubAgent の terminal completion
    • 必要な lifecycle evidence

    が維持されることを要求する。

    一方で、

    • spawn 後の SubAgent への追加 SendMessage
    • resume coordination via SendMessage

    まで維持するとは要求しない。

    現行 runtime smoke にそれらが不要なら新しい細粒度 boundary を発明しない。

    5. evidence の configured / observed を分離する

    claude_peer_inbound_refused=true のような、実際に peer から送信していないと behavioral proof にならない名前を避ける。

    例として以下のように分離する:

    • peer_policy_configured
    • cross_session_inbound_configured_refuse
    • outbound_peer_tools_absent
    • agent_spawn_completion_observed
    • herdr_namespace_isolated
    • preexisting_herdr_preserved

    実際に観測したものと、settings に設定したことだけを示す evidence を混同しない。

    human peer へ controlled sender を向けて inbound refusal を実証する必要はない。

    6. platform/version 記述は現在の公式仕様で修正する

    anchor comment 自体の技術的意図は authority として尊重するが、外部仕様に関する factual claim は現在の公式ドキュメントで更新する。

    特に現時点の Claude Code 公式 docs では cross-session messaging は:

    • macOS / Linux / WSL2: v2.1.224+
    • native Windows: v2.1.234+

    とされている。

    したがって「native Windows では unavailable」と固定しない。

    Issue #2437 では巨大な version/platform compatibility harness を作らず、

    • current runtime で feature が利用可能なら policy を検証
    • feature 自体が利用不能なら bounded reason code 付きで明示的 SKIP

    程度にする。

    今回の主要環境である WSL2 の正常系を複雑化させない。

    7. canonical-root coordination protocol を新設しない

    Issue #2437 のために新しい lease/mutex/peer registry/coordination daemon 等を作る契約にしない。

    canonical root が他作業で使用中の場合は、

    • repository に既存の safe coordination mechanism があればそれを使う
    • bounded wait
    • safe-point retry
    • SKIP/FAIL with reason

    のいずれかにする。

    独立した Claude session に
    「main root を空けて」
    「handoff して」
    「終わったら通知して」
    等を SendMessage してはいけない。

    最小実装方針として Issue に残す内容

    current main の実コードを確認し、まだ成立している場合に限り、以下を implementation guidance として残す。

    native structured / interactive runtime-smoke の harness-owned settings に:

    • crossSessionInbound: "refuse"

    • permissions deny:

      • SendMessage
      • ListAgents

    を invocation-local に設定する。

    Claude-GPT は arbitrary caller --settings passthrough を再開せず、既存 launcher-owned runtime-smoke settings/profile mechanism を narrow に拡張する。

    新しい以下の仕組みは作らない:

    • policy engine
    • peer registry
    • peer transcript inspection
    • socket crawler
    • account-level disable
    • OS sandbox
    • PreToolUse enforcement hook
    • global ~/.claude / Herdr configuration rewrite

    ただし current main の実装調査により injection point が既に変わっている場合は、現在の code evidence を優先して Issue wording を修正すること。

    Herdr boundary

    Herdr については current implementation と公式 docs を確認する。

    既存設計が現在も:

    • structured lane = direct subprocess
    • interactive lane = fresh isolated named Herdr session
    • ambient HERDR_SESSION / HERDR_SOCKET_PATH 等を strip
    • pre-existing Herdr namespace の before/after preservation

    となっているなら、その設計を再利用する。

    symmetry だけを理由に structured lane を Herdr 経由へ変更しない。

    サブエージェント

    この refinement ではサブエージェントを積極的に使用すること。

    最低限、必要に応じて:

    • codebase investigator
    • repository / related Issue・PR investigator
    • web researcher
    • skill が指定する editor/reviewer worker

    へ分担する。

    重要:

    • 同一 Claude session 内の Agent(...) SubAgent のみ使用する。
    • 各 SubAgent が terminal completion に到達するまで必ず待つ。
    • SubAgent の結果を受け取る前に、その結果を前提とする final decision をしてはいけない。
    • nested delegation が repository contract 上禁止されている場合は行わない。
    • SendMessage / ListAgents で独立 Claude session を探したり連絡したりしない。
    • Herdr の別 tab / pane / named session を discovery・prompt・send-keys・stop・kill しない。

    特に以下のような既存の人間/peer session 名が見えても、一切操作しない:

    • fix-auto-permission-boundaries
    • loop-protocol-c9
    • loop-protocol-3d
    • loop-protocol-91
    • その他、この refinement run 自身が作成していない Herdr / Claude session

    それらは SubAgent ではない。

    repository evidence

    Issue #2437 本文だけで判断しない。

    少なくとも関連する:

    を current main で確認する。

    関連 PR/Issue の historical design は参考にするが、current main の code と current Issue state を優先する。

    Web research

    外部仕様に依存する claim は現在の一次資料で検証する。

    優先:

    1. Claude Code 公式 cross-session messaging documentation
    2. Claude Code 公式 permissions documentation
    3. Claude Code 公式 settings documentation
    4. Herdr 公式 concepts / CLI / agent automation documentation

    ブログや二次情報より公式資料を優先する。

    公式仕様と anchor comment の factual statement が食い違う場合:

    • owner の semantic intent は維持
    • stale factual premise だけ現在の仕様へ訂正

    する。

    仕様確認から新しい security-hardening project を発明しない。

    許可

    以下はこの依頼で明示的に許可する。

    • repository / Issue / PR / comments / git history の read
    • official web documentation の調査
    • read-only SubAgent investigation
    • refinement 用一時 artifact の生成
    • repository が定義する checker / preflight / review command の実行
    • Issue 実装: worktree runtime smoke の Claude peer messaging を invocation-local に無効化する #2437 本文の controlled update
    • canonical issue-editor transaction
    • deterministic repair / structural repair
    • stale workflow label の routine hygiene
    • refinement に必要な bounded GitHub mutation
    • fresh readback / re-review / re-preflight
    • skill が通常要求する非破壊的な cleanup

    これらについて逐一人間の確認を求めない。

    この authorization は Claude Code 自身の runtime permission/security configuration を無条件に弱体化する指示ではない。
    user-global settings の変更や dangerously-skip 系設定の新規導入によって解決しないこと。

    停止条件

    以下の場合だけ停止して、具体的 evidence と blocker を報告する。

    1. secret / credential / token の内容を読む必要がある。
    2. unrelated human session / Herdr pane / peer Claude session を停止・kill・変更・操作する必要がある。
    3. user-global Claude / Herdr configuration を変更しないと成立しない。
    4. force push、history rewrite、default branch の破壊的変更など不可逆操作が必要。
    5. anchor comment と current repository evidence を合わせても、owner の新しい semantic choice が本当に必要で、既存 human-context directive から一意に導けない。
    6. GitHub mutation capability 等の environment failure が bounded retry 後も解消しない。
    7. current upstream semantics が Issue の destination と根本的に矛盾し、既存 intent を保った bounded reframe が不可能。

    以下は停止理由にしてはいけない:

    • routine Issue body rewrite
    • Allowed Paths の既存 evidence に基づく具体化
    • AC/VC の整形
    • generated settings の名称決定
    • configured/observed evidence 名の修正
    • current docs に合わせた version 記述修正
    • safe deterministic repair
    • intermediate needs-fix
    • issue_editor_required
    • SubAgent の完了待ち
    • repository-owned bounded wait
    • 「念のため人間に確認したい」という理由だけの escalation

    completion condition

    以下を満たすまで refinement を続ける。

    final reviewer が needs-fix を返し、iteration budget が残っている場合は自動 rewrite → re-review を継続する。

    最終報告

    完了時だけ簡潔に以下を報告する。

    途中で人間の追加承認を取りに戻らず、canonical issue-refinement-loop を最後まで進めてください。

    このプロンプトで特に重要なのは、human-context consumer を正しく通すことと、別 Herdr/Claude session をサブエージェント扱いしないことです。Issue #2437 の現行本文は live independent-peer canary や強い isolation claim まで要求していますが、アンカーコメントはそこを明確に縮小するよう指示しています。

    また、SendMessage deny は SubAgent messaging まで除去するため、refinement 後の AC は「SubAgent communication 全般を維持」ではなく Agent spawn → terminal completion を維持とするのが適切です。(Claude)

  4. changed the title [-]実装: worktree runtime smoke を人間 Herdr / Claude peer session から fail-closed に分離する[/-] [+]実装: worktree runtime smoke の Claude peer messaging を invocation-local に無効化する[/+] on Aug 30, 2026
  5. squne121 commented on Aug 30, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop: approved

    • Issue: 実装: worktree runtime smoke の Claude peer messaging を invocation-local に無効化する #2437
    • Final verdict: approve
    • Final Gate: passed (CONTRACT_REVIEW_ONCE_RESULT_V1.status: go)
    • Reviewed body: sha256:c8c02e1901a0d808009af4662d756a4df2d240a3578ba1f752ab063af93e5367
    • Human-context anchor: #issuecomment-5467989616
    • Runtime-only verification is explicitly deferred to post-implementation execution; unavailable real-Herdr nested-session environments must return bounded SKIP/Stop Condition rather than PASS.
    • This was a refinement-only run. Per the explicit request, no implementation worktree, implementation code, PR, or impl-review-loop handoff was started.
    FOLLOW_UP_MATERIALIZATION_RESULT_V1:
      schema_version: 1
      materialized_by: issue-refinement-loop
      follow_up_issues: []
      note_only_observations: []
  6. squne121 commented on Aug 30, 2026

    @squne121
    OwnerAuthor

    推奨アクションは、再 refinement ではなく、そのまま impl-review-loop を開始することです。Issue #2437 はすでに issue-refinement-loop: approved、CONTRACT_REVIEW_ONCE_RESULT_V1.status: go まで到達しており、実装自体はまだ開始されていません。 また現行 Issue は runtime verification を immediate とし、利用不能環境では reason code 付き SKIP を要求しています。

    一点だけ、現在の Claude Code 公式ドキュメントでは cross-session messaging は macOS/Linux(WSL2含む)向けで、native Windows は unavailable とされています。Issue に残っている Windows の version 記述より現在の一次資料を優先し、Windows向け互換ハーネスを増やさず feature-unavailable SKIP に落とすのが妥当です。また SendMessage deny は SubAgent/agent-team messaging にも影響するため、維持対象は Issue の契約どおり Agent(...) spawn → terminal completion です。([Claude]1)

    以下を Claude-GPT にそのまま渡せます。

    以下の対象に対して、current repository の canonical impl-review-loop を実行してください。

    対象 repository:
    https://github.com/squne121/loop-protocol

    対象 Issue:
    https://github.com/squne121/loop-protocol/issues/2437

    目的は、Issue #2437 を 実装 → 検証 → PR 作成 → 独立 PR review → REQUEST_CHANGES 修正 → current-head 再検証 / 再レビューまで自律的に反復し、実際の merge を行う直前の merge-ready 状態まで、人間の途中承認を要求せず進めることです。

    Issue #2437 はすでに issue-refinement-loop で final approve / implementation-ready になっています。refinement を最初からやり直すことを目的にせず、current impl-review-loop の Root-Owned Synchronous Entry Transition が要求する fresh contract review / live readback は canonical procedure の一部として実行してください。

    最重要方針

    .claude/skills/impl-review-loop/SKILL.md とその steps/**、implement-issue、open-pr、pr-review-judge、runtime verification policy、command registry を current main から読み、それらを SSOT としてください。

    コマンドや手順を記憶から再構築せず、current repository に存在する canonical executor / script / skill を使用してください。

    Root-Owned Synchronous Entry Transition が要求する場合は、同一 continuous invocation 内で、

    capability preflight
    → live Issue fetch
    → current-run issue-contract-review
    → live Issue 再取得
    → root entry routing
    → Step 1 起動

    まで連続して実行してください。

    過去の snapshot、comment、handoff artifact、ledger、body hash 等を authorization token として再利用しないでください。それらは telemetry / evidence としてのみ扱い、live Issue、current worktree、current HEAD、実テスト、CI、PR review を優先してください。

    人間承認について

    これは repository owner からの明示的な実行・publish authorization です。

    以下の通常作業は、このプロンプトで事前承認済みです。逐一「実行してよいですか」「push してよいですか」「PR を作ってよいですか」と確認しないでください。

    これらは additional human approval を要求する理由にしないでください。

    ただし、この authorization を理由に Claude / Claude-GPT の user-global security settings を弱めたり、--dangerously-skip-permissions、global allow、global ~/.claude rewrite 等を導入してはいけません。

    明示的に禁止する最終操作

    実際の merge は行わないでください。

    以下は禁止です。

    • gh pr merge
    • auto-merge の有効化
    • merge queue への投入
    • default branch への直接 push
    • merge commit / squash merge の実行
    • post-merge cleanup
    • Issue を「merge 済み」として手動 close すること

    最終 destination は「merge を実行すればよい状態」で停止することです。

    impl-review-loop の反復

    canonical loop を以下の意味で最後まで実行してください。

    Step 1:
    implementation-worker SubAgent に implement-issue を実行させる。

    Step 2:
    test-runner SubAgent に current HEAD を独立検証させる。

    Step 4:
    pr-reviewer SubAgent に current HEAD の独立 PR review を実行させる。

    Step 5:
    canonical route_loop_verdict_v2() 等の current routing implementation に従って判定する。

    REQUEST_CHANGES の場合は人間へ戻らず、blockers を fix_delta として Step 1 に戻し、自動修正してください。

    BEHIND の場合は、canonical update_branch route が安全に適用可能なら自動実行し、その新 HEAD で Verification と PR Review をやり直してください。

    reviewed_head_sha が stale の場合は、修正せずに current HEAD で review を再実行してください。

    CI failure が実装修正可能な failure なら、自動修正 → push → current-head verification → review を続行してください。

    単なる human_review_required: true という SubAgent の自己申告だけで停止しないでください。current impl-review-loop の canonical routing contract に従い、実 blocker を確認してください。

    iteration budget は、current skill が明示的な入力として許可するなら max_iterations=5 を使用してください。current skill がより厳しい上限を normative に定めている場合はそれを優先してください。

    サブエージェントの必須利用

    この作業ではサブエージェントを使用してください。

    最低限、canonical loop が要求する:

    • implementation-worker
    • test-runner
    • pr-reviewer
    • 必要になった場合の canonical update-branch worker

    を使用してください。

    必要なら、read-only の codebase investigator / web researcher 等を追加利用して構いません。

    重要な completion rule:

    1. SubAgent を spawn する。
    2. その SubAgent が terminal completion に到達するまで待つ。
    3. final structured result を取得する。
    4. その result を検証・LOOP_STATE に反映する。
    5. その後でのみ、その結果に依存する次 Step へ進む。

    SubAgent の終了を待たずに、結果を推測して先へ進んではいけません。

    複数 SubAgent を並列実行して依存関係がない場合も、全員が terminal completion になるまで待ってから統合判断してください。

    同一 Claude-GPT root session 内の Agent(...) SubAgent と、別 Herdr tab / pane / named session / 独立 Claude Code session を混同しないでください。

    SendMessage や cross-session discovery を使って、既存の独立 Claude session に仕事を依頼してはいけません。

    特に、この run が作成していない Herdr / Claude session を、

    • prompt
    • send-keys
    • message
    • stop
    • kill
    • handoff
    • idle notification

    してはいけません。

    同一 root session が spawn した SubAgent の completion 取得に current runtime の sanctioned agent-status API が必要な場合は、その run が spawn した agent にのみ限定してください。独立 peer discovery のために使用してはいけません。

    Issue #2437 の Stop Conditions に従い、worker 内からさらに nested SubAgent delegation が必要になる設計にはしないでください。root impl-review-loop が canonical workers を spawn することと、worker が nested delegation することは区別してください。

    Issue #2437 の実装方針

    まず current main の実コードを再確認してください。以下は technical recommendation であり、current code evidence が変化していれば current code を優先してください。

    Native Claude structured lane

    現在の runner が process-local --settings overlay を持っている場合、その既存 settings generation に最小差分で以下を統合してください。

    {
      "crossSessionInbound": "refuse",
      "permissions": {
        "deny": [
          "SendMessage",
          "ListAgents"
        ]
      }
    }

    既存 SubagentStart / SubagentStop hook observability settings を消してはいけません。

    既存 JSON を丸ごと別 policy engine へ置き換えず、harness-owned invocation-local settings として統合してください。

    global .claude/settings* や ~/.claude を変更してはいけません。

    Native Claude interactive lane

    既存の設計:

    • structured = direct subprocess
    • interactive = fresh isolated named Herdr session
    • ambient HERDR_* identity strip
    • cleanup
    • pre-existing Herdr namespace before/after preservation

    を維持してください。

    current Herdr CLI が agent start ... -- <claude args> のような runtime argv pass-through を正式に提供していることを current upstream docs / installed version で確認し、成立する場合は既存 agent_extra_args 等の injection point を使って、native interactive Claude に同じ fixed --settings を渡してください。

    symmetry のためだけに structured lane を Herdr 経由へ変えてはいけません。

    Claude-GPT lane

    Claude-GPT では arbitrary caller --settings passthrough を開放してはいけません。

    現行 scripts/claude-gpt/launch.sh が持つ launcher-owned fixed runtime-smoke settings/profile channel を確認し、その既存 channel を narrow に拡張して、

    • crossSessionInbound: "refuse"
    • bare SendMessage deny
    • bare ListAgents deny

    を launcher-owned generated settings に統合してください。

    既存 permissions.deny、authorization hooks、runtime-smoke observability hooks を上書き・欠落させないよう merge してください。

    caller が --settings、--dangerously-skip-permissions、--permission-mode bypassPermissions 等で policy を弱められない現在の性質を維持してください。

    新しい arbitrary settings passthrough API を追加しないでください。

    テスト方針

    少なくとも Issue #2437 の AC に対応して以下を検証してください。

    • native structured generated settings の exact test
    • native interactive argv/settings generation の exact test
    • Claude-GPT generated launcher settings の exact test
    • caller override / poison input が policy を弱められない negative test
    • SendMessage / ListAgents が controlled spawned process で absent または denied になる canary
    • human / independent peer session を一切起動・観測しない canary
    • bare peer-tool deny があっても Agent(...) spawn → terminal completion が観測できる lifecycle regression
    • structured direct-subprocess semantics の維持
    • interactive isolated Herdr namespace の作成・cleanup
    • ambient HERDR_* strip
    • pre-existing Herdr namespace preservation
    • configured evidence と observed evidence の意味の分離

    Issue が指定する evidence names:

    • peer_policy_configured
    • cross_session_inbound_configured_refuse
    • outbound_peer_tools_absent
    • agent_spawn_completion_observed
    • herdr_namespace_isolated
    • preexisting_herdr_preserved

    の意味を勝手に強化しないでください。

    特に cross_session_inbound_configured_refuse は configuration evidence であり、human peer から実送信して behavioral proof を取るものではありません。

    runtime verification

    Issue #2437 の Runtime Verification Applicability: immediate を遵守してください。

    Issue 本文に列挙された focused pytest と repository-wide verification を実行してください。

    少なくとも current Issue の Verification Commands として指定されている:

    • runtime-smoke runner の focused pytest
    • Herdr isolation pytest
    • workspace snapshot pytest
    • scripts/claude-gpt/test_launch_transport_policy.py
    • pnpm typecheck
    • pnpm lint
    • pnpm test
    • pnpm build
    • Gemini model-routing regression

    を canonical command shape で実行してください。

    mock-only result を runtime PASS にしないでください。

    real Claude / Herdr runtime が利用可能なら live runtime-smoke を実行し、Issue の allowlisted evidence のみ保存してください。

    runtime / auth / cross-session feature / nested-Herdr execution constraint により実 runtime が利用不能な場合は、Issue の既存 contract に従い exit 77 + bounded reason code の SKIP としてください。

    SKIP を PASS に読み替えてはいけません。

    upstream specification の扱い

    実装開始時に Claude Code の current official documentation を fresh に確認してください。

    2026-08-30 時点の公式 documentation では cross-session messaging は macOS / Linux(WSL2 を含む)で提供され、native Windows では unavailable とされています。

    Issue #2437 本文に残る version/platform 文言より current official upstream fact を優先してください。

    ただし、この差異を理由に大きな compatibility harness や別 security project を作らないでください。

    native Windows で feature が unavailable なら、Issue 自身の既存 fallback semantics に従って bounded feature-unavailable SKIP としてください。

    WSL2 の正常経路を複雑化させないでください。

    また current official docs で、bare SendMessage deny が independent-session messaging だけでなく SubAgent / agent-team messaging も除去することを確認してください。

    したがって維持すべき契約は、

    Agent(...) spawn → SubAgent terminal completion → lifecycle evidence

    です。

    spawn 後の追加 SendMessage / resume coordination を維持するために、新しい細粒度 policy mechanism を発明しないでください。

    実装しないもの

    以下は Issue #2437 のために追加しないでください。

    • global policy engine
    • peer registry
    • peer transcript inspection
    • human peer canary
    • socket crawler
    • account-level disable
    • OS sandbox
    • new lease / mutex / daemon
    • top-level Claude 全体の global hard deny
    • PreToolUse enforcement hook の新設
    • global Claude / Herdr config rewrite
    • independent peer を verification dependency にする仕組み

    canonical root が busy の場合も、別 Claude session に「root を空けて」「handoff して」「終わったら通知して」と message しないでください。

    existing safe mechanism、bounded wait、safe-point retry、または explicit SKIP/FAIL reason を使用してください。

    Allowed Paths

    live Issue #2437 の current Allowed Paths を再取得し、それを authority としてください。

    Allowed Paths 外を編集しないでください。

    現在の Issue contract と current repository evidenceから Allowed Paths 外の production change が本当に必要だと判明した場合、勝手に scope を拡大しないでください。

    停止条件

    途中承認を求めるのは routine work ではなく、以下のような真の hard blocker に限定してください。

    • secret / credential / token の内容を読む必要がある
    • user-global Claude / Herdr configuration を変更しないと成立しない
    • force push / history rewrite / destructive default-branch mutation が必要
    • unrelated human Herdr / Claude session を操作しないと成立しない
    • Allowed Paths 外の semantic production change が不可避
    • Issue の固定 contract / schema / semantic destination 自体を変更しないと成立しない
    • 新規 Issue への scope split が本当に必要
    • current upstream semantics と Issue destination が根本的に両立しない
    • canonical conflict runbookでも解決不能な実 Git conflict があり、新しい semantic choice が必要
    • bounded retries 後も GitHub / runtime 等の必須 capability が利用不能
    • canonical iteration budget を使い切っても blocker が残る

    単なる「念のため確認したい」は停止理由にしないでください。

    PR create、push、コメント、current-head CI 再実行、REQUEST_CHANGES 修正、safe branch update、review 再実行はすでに許可されています。

    merge直前の completion condition

    以下が成立するまで、自動ループを続けてください。

    • Issue 実装: worktree runtime smoke の Claude peer messaging を invocation-local に無効化する #2437 の実装が current Allowed Paths 内で完了
    • 1 Issue = 1 PR
    • PR body が Closes #2437 等の canonical linkage を持つ
    • Issue Verification Commands が current HEAD で要求どおり評価済み
    • runtime verification が PASS、または contract が明示的に認める正確な SKIP として分類されている
    • current-head required CI の状態を確認済み
    • pr-reviewer が current PR HEAD に対して APPROVE
    • reviewer blockers が空
    • stale review ではない
    • branch が BEHIND なら canonical update 後に再検証済み
    • live mergeability が canonical impl-review-loop の approved 条件(CLEAN / HAS_HOOKS 等)を満たす
    • unresolved actual Git conflict がない
    • human explicit stop comment がない

    ここまで到達したら、merge はせず停止してください。

    最終報告

    最終報告には最低限以下を含めてください。

    • IMPL_REVIEW_LOOP_RESULT_V1 または current canonical equivalent
    • final status
    • iteration count
    • Issue URL
    • PR URL
    • worktree / branch
    • current PR HEAD SHA
    • implementation summary
    • changed files
    • Allowed Paths compliance
    • Issue VC results
    • runtime verification resultと、SKIPなら exact reason code
    • current-head CI status
    • final PR review verdict
    • reviewed HEAD SHA
    • live mergeability
    • unresolved warnings / non-blocking notes
    • 「実際の merge は未実行」であること
    • merge-ready なら「人間が merge を実行できる直前の状態」であること

    途中経過で人間へ承認を取りに戻らず、canonical impl-review-loop の safe automatic routes を使い切ってから最終結果を返してください。

    この版では、worktree作成・実装・commit・push・PR作成/更新・CI確認・レビュー差し戻し修正・safe branch update・再レビューまで事前許可し、merge だけを明確な境界として残しています。現行 impl-review-loop 自体も APPROVE + blockersなし + live mergeability まで到達したところで PR を人間の merge 判断に渡す設計なので、この停止位置と整合します。

  7. squne121 commented on Aug 30, 2026

    @squne121
    OwnerAuthor

    root-owned entry router audit

    route: invoke_impl_review_loop
    reason: fresh_review_go_live_equality

  8. added 5 commits that reference this issue on Aug 30, 2026
  9. squne121 commented on Aug 31, 2026

    @squne121
    OwnerAuthor

    推奨は、#2437 の実装を作り直すのではなく、まず Issue contract の runtime_only 指定が適切かを再精査し、contract-only で解消できればそのまま PR #2454 の impl-review-loop を再開することです。adjudicate_vc_result.py はもともと fail-closed な VC routing authority として導入されたため、今回だけ通す special-case を先に追加するのは避けるべきです。

    以下をそのまま Claude-GPT に渡せます。

    対象 repository:
    https://github.com/squne121/loop-protocol

    対象 Issue:
    https://github.com/squne121/loop-protocol/issues/2437

    対象 PR:
    https://github.com/squne121/loop-protocol/pull/2454

    目的

    Issue #2437 / PR #2454 の impl-review-loop が canonical Step 4 VC gate で停止している原因を解消し、可能なら PR #2454 を 実際には merge せず、human が merge できる直前の merge-ready 状態まで進めてください。

    人間への途中承認は不要です。

    ただし、ログをそのまま current truth とみなさず、最初に live GitHub state、current main、current PR HEAD、Issue body/comments、CI、review state、repository の current canonical skill/script/registry を再取得してください。

    現在観測されている停止理由は以下です。

    • PR feat: isolate runtime smoke Claude peer messaging #2454 の実装自体は完成している。
    • Issue Verification Commands は実行済みで成功している。
    • structured runtime verification は PASS。
    • interactive runtime verification は nested Herdr 等の実行環境制約により exit 77 / explicit SKIP であり、PASS へ読み替えていない。
    • required CI は成功している。
    • PR は mergeable。
    • しかし Issue 実装: worktree runtime smoke の Claude peer messaging を invocation-local に無効化する #2437 の最初の Verification Command にある preflight-scope: runtime_only により fresh contract review が AC8 を classification: skipped / scope_class: runtime_only とする。
    • adjudicate_vc_result.py がこれを unsupported_baseline_classification:AC8 として fail-closed にし、Step 4 の pr-reviewer 起動を禁止している。

    この仮説を必ず current main / current HEAD で再現・検証してから変更してください。


    最重要方針

    最初から adjudicate_vc_result.py を緩めないでください。

    優先順位は次です。

    1. Issue 実装: worktree runtime smoke の Claude peer messaging を invocation-local に無効化する #2437 の Verification Command metadata / contract classification が誤っているだけではないか確認する。
    2. contract-only refinement で正しく表現できるなら、その方法を優先する。
    3. contract-only では意味論を偽ることになる場合のみ、impl-review-loop infrastructure 側の gap として別 Issue 化する。
    4. 「今回だけ通す」「AC8だけ例外」「runtime_only skip を無条件 PASS/non-blocking にする」special-case は禁止する。

    特に、Issue #2437 の最初の Verification Command は実体として pytest の focused test command です。

    preflight-scope: runtime_only が本当に正しいかを検証してください。

    候補として、

    • 通常の regression/current-head verification として扱う
    • baseline-expect: fail 等、repository が既に持つ canonical baseline semantics を使う
    • static pytest verification と real runtime verification の責務を contract 上分離する

    などを検討してください。

    ただし、候補を推測で採用しないでください。

    current main 上での baseline behavior と PR current HEAD 上での behavior を実際に確認し、current command registry / contract-review semantics に沿って選定してください。

    絶対に維持する意味論

    Issue contract を修正する場合でも以下は弱めないでください。

    • Runtime Verification Applicability の decision: immediate
    • real runtime evidence が必要であること
    • exit 77 / unavailable runtime / fallback / mock-only result を PASS と扱わないこと
    • structured runtime の Agent(...) spawn → terminal completion evidence
    • human/independent peer を runtime canary に使用しないこと
    • crossSessionInbound: "refuse"
    • bare SendMessage / ListAgents deny
    • global Claude / Herdr configuration を変更しないこと
    • independent peer messaging を coordinator dependency にしないこと

    つまり、Step 2 の static VC classification を正しくするために real runtime requirement を削ってはなりません。


    Phase 0 — canonical preflight / live state

    current main / default branch から開始してください。

    コマンドや手順を記憶から再構築しないでください。

    以下を current repository から読み、SSOT としてください。

    live で以下も取得してください。

    stale transcript の SHA や以前の判定を authorization として再利用しないでください。


    Phase 1 — サブエージェントによる敵対的 root-cause review

    サブエージェントを必ず使用してください。

    少なくとも以下の独立した観点を分担してください。

    SubAgent A — contract semantics reviewer

    read-only で以下を調査:

    SubAgent B — loop infrastructure reviewer

    read-only で以下を調査:

    SubAgent C — adversarial reviewer

    A/B のどちらにも依存せず、

    • contract を変更すると verification を弱めないか
    • adjudicator を変更すると fail-closed semantics を壊さないか
    • false PASS / stale evidence / SKIP-as-PASS が発生しないか
    • 最小の変更は何か

    を敵対的にレビューしてください。

    サブエージェント完了条件

    サブエージェントを spawn しただけで先へ進まないでください。

    各サブエージェントが terminal completion し、final result を返すまで待ってください。

    repository-defined canonical Agent/SubAgent mechanism を使用してください。

    独立した別 Claude Code / Claude-GPT / Herdr session へ SendMessage して作業を依頼してはいけません。

    人間が操作中の Herdr session、他タブ、他 Claude session を一覧・操作・通知・停止対象にしてはいけません。

    in-session Agent(...) / repository-defined SubAgent mechanism のみを使用してください。

    サブエージェント結果が競合する場合は、root が証拠を比較して決定してください。単なる意見の相違を human escalation にしないでください。


    Phase 2A — 推奨経路: Issue contract-only refinement

    root-cause review の結果、

    preflight-scope: runtime_only が static pytest Verification Command に対する誤った classification metadata であり、contract-only で正確に表現可能だと判断した場合、この経路を優先してください。

    current repository の canonical issue-refinement-loop を使用してください。

    手順を推測せず、current main の command registry / skill が定義する exact profile / executor を使用してください。

    必要なら human-context route / contract update consumer を使用してください。

    許可

    以下は人間承認なしで実行して構いません。

    ただし contract refinement は blocker 解消だけを目的とし、Goal/Outcome/AC の実質的な要求を弱めないでください。

    新しい Verification Command metadata を選択するときは、

    1. base/main 上での command behavior
    2. PR current HEAD 上での behavior
    3. canonical baseline/current classification
    4. Step 2 adjudicator が受理する schema
    5. real runtime verification が別途保持されること

    を証拠として示してください。

    Issue body を変更したら body SHA drift を当然のものとして扱い、fresh current-run contract review からやり直してください。


    Phase 2B — fallback: loop infrastructure gap

    contract-only refinement が以下のいずれかに該当する場合は採用しないでください。

    • baseline semantics を偽る必要がある
    • real runtime requirement を弱める必要がある
    • current canonical annotation vocabulary では正確に表現不能
    • supported classification に見せかけるだけの workaround になる
    • repository 設計上 runtime_only が本来 adjudicator に受理されるべきことが確認できた

    その場合は loop infrastructure defect と判断してください。

    まず既存 Issue/PR を検索し、重複 Issue を作らないでください。

    特に historical Issue #1115 と、その後の adjudicate_vc_result.py 変更履歴・関連 Issue を確認してください。

    既存の open Issue が正しくこの gap を扱っているなら、その Issue を使用してください。

    存在しない場合は、新しい standalone implementation Issue を人間承認なしで作成して構いません。

    Issue の destination は概ね以下です。

    preflight-scope: runtime_only の baseline/preflight skip と current-head real runtime evidence を明確に分離し、runtime-only command が存在しても Step 2/Step 4 が deterministic に adjudicate できるようにする。ただし bare SKIP / unavailable runtime を PASS に昇格させない。

    設計時には少なくとも以下を固定してください。

    • runtime_only baseline skip を無条件 non-blocking にしない
    • current-head runtime evidence の identity/head/body/command binding を要求する
    • missing / stale / malformed evidence は fail-closed
    • exit 77 / explicit SKIP は PASS ではない
    • static/current command PASS と real runtime evidence の authority を混同しない
    • special-case AC8 / #2437 判定を作らない
    • generic contract と dedicated tests を追加する

    新 Issue を作った場合は current canonical issue-refinement-loop で contract を精緻化し、その後 canonical impl-review-loop で実装してください。

    1 Issue = 1 PR を維持してください。


    作業権限

    この依頼は、目的達成に必要な 安全・可逆・通常の repository/GitHub 操作を事前承認します。

    人間へ個別承認を取りに戻る必要はありません。

    以下を許可します。

    Read / investigation

    • repository 全体の read/search
    • git history / blame / diff / merge-base
    • Issue / PR / comments / reviews / threads / Actions / check runs の read
    • current main / remote refs の fetch
    • official upstream docs の web research
    • installed CLI の --help / version / capability確認

    Repository changes

    • dedicated linked worktree の作成・再利用
    • feature branch 作成
    • dependency restore / bootstrap
    • Allowed Paths 内編集
    • tests追加・修正
    • docs更新
    • generated artifact 更新
    • formatter / lint autofix
    • explicit git add
    • commit
    • non-force push
    • safe branch update
    • canonical merge-base / ff-only / update-branch mechanism の利用

    GitHub mutations

    • Issue body update
    • Issue comment
    • 新規 follow-up Issue 作成(Phase 2B の条件成立時)
    • labels / metadata の canonical update
    • Draft PR 作成
    • PR body update
    • Ready for review 化
    • review request
    • CI rerun
    • review comment
    • REQUEST_CHANGES 対応
    • resolved thread の処理
    • current-head review の再実行

    Verification

    • pytest / pnpm / lint / typecheck / build
    • repository-defined runtime verification
    • bounded wait / polling
    • current-head evidence generation
    • canonical CI log retrieval
    • test-runner SubAgent
    • pr-reviewer SubAgent
    • implementation-worker SubAgent

    permission/control-plane の一時的失敗は即 human escalation にせず、

    • repository-defined safe mechanism
    • bounded retry
    • safe-point retry
    • canonical wrapper
    • explicit reason-coded SKIP/FAIL

    を先に使い切ってください。


    禁止事項 / 本当の停止条件

    以下のみ停止条件としてください。

    • force push が必要
    • remote history rewrite が必要
    • secret / credential の取得・表示・保存が必要
    • global ~/.claude / global Herdr configuration の変更が必要
    • 人間が操作中の別 session / Herdr pane / Claude session の操作が必要
    • destructive filesystem operation が必要
    • unrelated user work を破壊する必要がある
    • canonical bounded recovery を使い切っても必要な GitHub/runtime capability が利用不能
    • unresolved actual Git conflict に新しい semantic choice が必要
    • contract-only と infrastructure-fix のどちらも成立せず、新しい product decision が必要
    • human explicit stop comment が live state に存在
    • canonical iteration budget を使い切って blocker が残る

    「念のため確認したい」「Issue body が変わる」「PR comment を投稿する」「push する」「CI を再実行する」は停止理由ではありません。


    Phase 3 — #2437 / PR #2454 の impl-review-loop 再開

    contract blocker が解消したら、current repository の canonical impl-review-loop を PR #2454 / Issue #2437 に対して fresh state から再開してください。

    古い VC artifact、古い contract body SHA、古い PR head SHA を再利用しないでください。

    以下を current head に bind し直してください。

    • Issue body SHA
    • PR HEAD SHA
    • base SHA
    • literal Verification Commands
    • command hashes
    • Allowed Paths
    • diff summary
    • runtime evidence
    • CI evidence

    Step 2 では test-runner SubAgent を使用してください。

    test-runner が terminal completion し final read-only report を返すまで待ってください。

    その report と current-head binding を canonical adapter/adjudicator で処理してください。

    Step 4 gate が blocking == false になった場合のみ pr-reviewer SubAgent を起動してください。

    pr-reviewer についても terminal completion + final result の両方を確認してください。

    REQUEST_CHANGES が出た場合:

    • 原因を分類
    • implementation-worker SubAgent で修正
    • subagent completion を待つ
    • commit / non-force push
    • current-head CI
    • test-runner 再実行
    • adjudication
    • pr-reviewer 再実行

    を canonical iteration budget 内で繰り返してください。

    途中で human approval を要求しないでください。


    CI / branch drift

    main が進んで PR が BEHIND になった場合は、current repository が定義する canonical safe branch update mechanism を使用してください。

    raw な独自 merge/update 手順を作らないでください。

    update 後は HEAD が変わるため、

    • runtime evidence
    • VC evidence
    • Step 4 binding
    • review
    • CI

    の stale 判定を行い、必要なものを current HEAD に対して再取得してください。

    stale green check / stale approval を merge-ready evidence に使わないでください。


    merge禁止

    PR #2454 を merge しないでください。

    Phase 2B で infrastructure fix PR を作った場合も、明示的な別指示がない限り実際の merge はしないでください。

    contract-only refinement で解消できた場合の最終目標は、

    PR #2454 = human が merge ボタンを押せる直前

    です。

    infrastructure PR が必要で、その merge が #2454 再開の prerequisite になる場合は、無理に #2454 を merge-ready と偽らず、

    を明示して停止してください。


    最終報告

    最終報告には最低限以下を含めてください。

    1. root cause
    2. contract-only refinement を採用したか / infrastructure fix を採用したか
    3. その選択理由
    4. Issue 実装: worktree runtime smoke の Claude peer messaging を invocation-local に無効化する #2437 の最終 body SHA
    5. PR feat: isolate runtime smoke Claude peer messaging #2454 current HEAD
    6. current main/base SHA
    7. subagents 一覧
    8. 各 subagent の terminal completion と final result
    9. Verification Commands 結果
    10. runtime verification 結果
    11. exit 77 / SKIP があればその reason code
    12. VC_ADJUDICATION_RESULT_V1 の final status
    13. pr-reviewer verdict
    14. required CI 状態
    15. review threads / REQUEST_CHANGES の unresolved 件数
    16. mergeable / mergeStateStatus
    17. iteration count
    18. unresolved warnings / non-blocking notes
    19. IMPL_REVIEW_LOOP_RESULT_V1 または current canonical equivalent
    20. 実際の merge は未実行であること

    merge-ready なら最後に明確に、

    PR #2454 は、人間が merge を実行できる直前の状態です。実際の merge は実行していません。

    と報告してください。

    最も重要なのは、gate を通すために evidence semantics を弱めるのではなく、誤った contract classification なら contract を正し、本当に framework gap なら framework を一般解として直すことです。

    このプロンプトでは、contract 修正で済む場合に余計な基盤 Issue を増やさず、それで済まない場合だけ別 Issue/PR に分離するようにしています。特に「runtime_only を adjudicator が拒否するから受理するよう変更」という短絡を防ぎつつ、サブエージェントの完了待ちまで明示しています。

  10. squne121 commented on Aug 31, 2026

    @squne121
    OwnerAuthor

    現状のボトルネックは実装そのものではなく、PR #2454 のレビュー指摘を PR 本文へ反映し、fresh current-head evidence で再検証して pr-reviewer を再実行することです。特に reviewer は「AC1–AC8 の明示」「current-head runtime evidence 更新」「interactive lane の exit 77 を PASS にせず SKIP のまま扱うこと」を要求しています。

    また、以前のプロンプトには commit・non-force push・current-head evidence・pr-reviewer 再実行などの事前承認が含まれていたにもかかわらず、delegated PR body update が external write として拒否されています。今回は 「PR #2454 本文更新そのものを直接承認する」 と対象を明記するのが重要です。

    Issue #2437 / PR #2454 の作業を、現在地点から継続してください。

    対象:

    目的は Issue #2437 の impl-review-loop を完遂し、PR #2454 を人間がそのまま merge 判断できる merge-ready 状態まで持っていくことです。

    実際の merge は実行しないでください。

    重要: このメッセージによる明示的なユーザー承認

    このメッセージは、Issue #2437 / PR #2454 を merge-ready にするために必要な以下の repository / GitHub external writes を、ユーザー本人が明示的に承認するものです。

    人間への追加確認なしで実行して構いません。

    前回 implementation-worker が PR #2454 本文更新を [External System Writes] として拒否した点について、今回のこのメッセージを「PR #2454 本文更新に対する direct user authorization」として扱ってください。

    子 SubAgent 側に authorization が伝播せず、同じ external-write classifier によって delegated write のみ拒否される場合、それだけを理由に再び人間へ承認を要求しないでください。

    その場合は、

    1. main session が repository の canonical GitHub writer / wrapper を使って更新する
    2. または user authorization を扱える既存の writer/editor SubAgent に切り替える

    のどちらかで継続してください。

    raw な独自 GitHub mutation を作らず、current repository の skill / wrapper / command registry が mutation 経路を規定している場合は必ずそれを使ってください。

    現在地点

    以前の transcript の SHA・判定・artifact をそのまま current evidence と見なしてはいけません。

    ただし、作業履歴として以下は把握してから current state を再取得してください。

    • Issue 実装: worktree runtime smoke の Claude peer messaging を invocation-local に無効化する #2437 の実装は既にかなり進んでいる。

    • PR feat: isolate runtime smoke Claude peer messaging #2454 は既に存在する。

    • current-head verification / runtime evidence は実行済みだった。

    • pr-reviewer は直近で REQUEST_CHANGES を返した。

    • 主な指摘は以下だった。

      • PR 本文に AC1–AC8 の明示的な達成状況が不足
      • current-head runtime evidence の記載を更新する必要がある
      • interactive lane の exit 77 / herdr_isolated_session_unavailable は SKIP であり、PASS に変換してはいけない
    • その最小 PR 本文修正を implementation-worker に委譲したところ、external system write classifier により拒否されて停止した。

    したがって、ゼロから Issue #2437 を再実装しないでください。

    まず current state を取得し、「本当に残っている差分」だけを処理してください。

    Step 0: canonical state を再確立する

    current repository の SSOT を読み直してください。

    少なくとも、

    を fresh に取得してください。

    stale transcript に記録された SHA、body SHA、command hash、review verdict、CI status を current truth として再利用しないでください。

    既存 worktree が current canonical workflow から安全に継続可能なら再利用して構いません。不要な worktree 作り直しは禁止します。

    Step 1: reviewer の未解決指摘だけを特定する

    current PR review / comments を再取得して、未解決 blocker を列挙してください。

    直近の REQUEST_CHANGES が依然 current なら、まず以下を修正してください。

    PR 本文

    PR #2454 の本文に current implementation と一致する形で AC1–AC8 の達成状況を明記してください。

    各 AC について、

    • status
    • implementation / behavior
    • evidence
    • Verification Command または runtime evidence
    • PASS / SKIP の distinction

    が追える状態にしてください。

    特に interactive runtime-smoke が execution-environment constraint により

    exit 77
    herdr_isolated_session_unavailable

    となる場合は、repository contract に従って SKIP と記録してください。

    PASS に書き換えたり、successful runtime execution が観測されたかのように表現してはいけません。

    current-head runtime evidence を現在の PR HEAD に bind し直してください。

    PR 本文には、古い SHA や古い artifact を current evidence として残さないでください。

    既存 Safety Claim Matrix が current implementation と一致しているなら保持・更新してください。

    Closes #2437 も保持してください。

    PR reviewer の要求が本文修正だけで満たされるなら、コードを無意味に変更しないでください。

    Step 2: 実装変更が本当に必要なら修正する

    fresh review / verification からコード上の blocker が判明した場合のみ実装修正してください。

    Issue #2437 の現在の contract / Allowed Paths / Required Design References / Verification Commands を authoritative としてください。

    Issue body 自体に contract defect があり変更が避けられない場合のみ Issue body を更新してください。

    Issue body を変更した場合は body SHA drift を正常なものとして扱い、fresh current-run contract review / preflight からやり直してください。

    古い contract evidence を流用しないでください。

    Step 3: SubAgent を使用する

    この作業では SubAgent を実際に使用してください。

    ただし、人間が操作中の Herdr session、別タブ、独立した Claude / Claude-GPT session を探索・一覧・操作・message してはいけません。

    @session、cross-session SendMessage、独立 peer への coordination を使わないでください。

    許可されるのは 現在の main session が Agent(...) で生成する child SubAgent です。

    推奨構成:

    • implementation-worker

      • PR 本文修正
      • 必要なコード/テスト/ドキュメント修正
    • test-runner または current impl-review-loop が指定する verification agent

      • current-head Verification Commands
      • regression checks
    • pr-reviewer

      • fresh current HEAD に対する最終 semantic review

    repository が現在別の canonical agent 名を定義しているならそちらを優先してください。

    SubAgent を起動したら terminal completion まで必ず待ってください。

    「起動したのでバックグラウンドで待つ」とだけ報告して main session を終了してはいけません。

    各 SubAgent の final result を main session が取得してから次のステップへ進んでください。

    child agent completion の観測のために post-spawn SendMessage を要求してはいけません。

    Step 4: fresh verification

    PR 本文または implementation を修正した後、current HEAD を再取得してください。

    Issue #2437 の literal Verification Commands を current contract から取得し、canonical runner を使って実行してください。

    コマンド文字列を transcript や記憶から復元しないでください。

    必要な、

    • Issue number
    • PR number
    • current PR HEAD SHA
    • current contract body SHA
    • literal Verification Commands
    • command hashes
    • Allowed Paths
    • diff summary
    • current VC result
    • runtime evidence

    を current-run の値で bind してください。

    runtime_only
    SKIP
    expected_pass
    blocking
    pr_review_only

    などは repository の current semantics に従って判定してください。

    特に SKIP を PASS に昇格させないでください。

    Step 5: CI

    non-force push または HEAD change が発生した場合、new HEAD の CI を追跡してください。

    required checks が terminal state になるまで確認してください。

    失敗した場合は canonical CI log retrieval を使って原因を分類してください。

    Issue #2437 / PR #2454 に起因する failure なら修正してください。

    unrelated infrastructure failure や flaky failure の場合は、repository の既存 policy に従って bounded rerun / retry / explicit classification を行い、Issue #2437 と無関係な大規模修正に scope expansion しないでください。

    Step 6: pr-reviewer

    current-head verification が Step 4 の reviewer gate を満たした場合のみ pr-reviewer SubAgent を起動してください。

    必ず terminal completion を待ってください。

    APPROVE / non-blocking

    merge-ready 判定へ進んでください。

    REQUEST_CHANGES / blocking

    人間へ戻さず、内容を分類してください。

    修正可能なら、

    implementation-worker
    → verification
    → CI
    → pr-reviewer

    を再実行してください。

    このループは blocker がなくなるまで継続してください。

    PR 本文だけの指摘なら PR 本文だけ直し、不要なコード churn を作らないでください。

    merge-ready 判定

    少なくとも以下を fresh current state で確認してください。

    • Issue 実装: worktree runtime smoke の Claude peer messaging を invocation-local に無効化する #2437 の current contract を満たしている
    • AC1–AC8 が PR 本文上でも追跡可能
    • literal Verification Commands が current HEAD に対して期待どおり
    • runtime evidence が current HEAD に bind されている
    • SKIP と PASS が正しく区別されている
    • pr-reviewer に unresolved blocking finding がない
    • required CI が成功または repository policy 上の正当な non-blocking terminal classification
    • PR が Draft ではない
    • PR が GitHub 上 mergeable
    • unresolved actual Git conflict がない
    • unresolved review thread / requested change が merge blocker として残っていない
    • Closes #2437 が適切
    • unrelated scope expansion がない

    ここまで達成したら作業完了です。

    PR #2454 を実際には merge しないでください。

    停止条件

    以下の場合のみ人間へ戻してください。

    • force push / history rewrite が必要
    • destructive filesystem operation が必要
    • secret / credential / authentication material の取得・変更が必要
    • Issue 実装: worktree runtime smoke の Claude peer messaging を invocation-local に無効化する #2437 と無関係な重大な scope expansion が必要
    • actual merge を実行する必要がある
    • current repository の canonical policy が、今回の explicit user authorization を受けても main session 自身による必要な GitHub write を hard-deny し、利用可能な正規代替経路も存在しない
    • upstream semantics と Issue contract が根本的に両立せず、実装で解消不能

    単なる

    • PR 本文更新
    • commit
    • non-force push
    • CI rerun
    • review response
    • current-head evidence regeneration
    • SubAgent 再実行
    • REQUEST_CHANGES 修正

    では停止しないでください。

    最終報告

    最後に以下を報告してください。

    1. Issue 実装: worktree runtime smoke の Claude peer messaging を invocation-local に無効化する #2437 current contract の最終状態
    2. PR feat: isolate runtime smoke Claude peer messaging #2454 URL
    3. final HEAD SHA
    4. 実際に変更したファイル / PR body / Issue body
    5. AC1–AC8 の最終 status
    6. Verification Commands と結果
    7. runtime evidence の PASS / SKIP 内訳
    8. CI required checks の状態
    9. pr-reviewer の最終 verdict
    10. 使用した各 SubAgent と terminal completion / final result
    11. unresolved warnings / non-blocking notes
    12. mergeability
    13. 「実際の merge は未実行」であること

    条件を満たした場合は最後に明確に、

    MERGE_READY: YES

    と記載してください。

    満たしていない場合は、

    MERGE_READY: NO

    とし、残っている blocker を具体的に列挙してください。

    承認待ちで途中停止するのではなく、このプロンプトで承認済みの操作はそのまま実行して、merge-ready または上記停止条件まで canonical loop を完遂してください。

    この版では特に、**「child の external-write authorization が通らなければ main session の canonical writer にフォールバックする」**ところまで明記しています。前回と同じ PR 本文更新承認ループに戻るのを防ぐための重要な追加です。

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

    agent/implementerenhancementphase/implementation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions