Skip to content

実装: runner の structured 実行 evidence に main-session init permissionMode を観測値として出力する #2935

Open

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: none
goal_ref: "runner の structured 実行 evidence に main-session init permissionMode を観測値として出力し、Claude-GPT Auto の runtime 観測を可能にする"
change_kind: code

Parent Issue

none

Parent Goal Ref

Current Validated Scope

  • scripts/agent-ops/run_worktree_agent_runtime_smoke.py は system init event の permissionMode を extract_named_subagent_resume_observations() で取得する(obs["init"]["permission_mode"])。ただし現在の採用規則は mode if isinstance(mode, str) else None であり、空文字 "" も観測値として採用する。この値は build_named_subagent_resume_evidence() が返す nested evidence の named_subagent_resume.permission_mode_observed にしか載らない。
  • 通常の structured 実行(claude-gpt adapter 含む)の schema_summary(WORKTREE_AGENT_RUNTIME_SMOKE_RESULT_V1、--evidence-json の出力)には top-level の permission_mode_observed が存在しない。--require-observed-runtime-field permission_mode は SubagentStop payload 由来のみ(extract_claude_subagentstop_permission_mode、閉集合 _PERMISSION_MODE_VALUES で検証)で、init 由来の値は使わない。
  • downstream consumer: PR fix: Auto mode の固定 /tmp scratch 上書き false-deny を run-scoped workspace で解消する #2931 HEAD 344f5da35326e04dacd13aa57dd962674888f336 の test_run_scoped_scratch_runtime.py は evidence["permission_mode_observed"](top-level)を first choice とし、evidence["named_subagent_resume"]["permission_mode_observed"] だけを互換 surface として読む。同 test は現 runner に schema_summary["permission_mode_observed"] が無いことも検査している。
  • 観測証跡: PR fix: Auto mode の固定 /tmp scratch 上書き false-deny を run-scoped workspace で解消する #2931 HEAD 344f5da3 で test_run_scoped_scratch_runtime.py --case claude-gpt-auto-scratch が SKIP: permission_mode_unobserved(exit 77、観測 mode None、runner_exit=0)。
  • 外部仕様(OWNER 提示の一次資料を fresh に fact-check 済み): Claude Code は --permission-mode auto で Auto を開始する(公式 CLI reference。受理値は default / acceptEdits / plan / auto / dontAsk / bypassPermissions、manual は default の alias)。stream-json の system/init は permissionMode を含む。argv で要求した mode と init が報告する mode が一致しない upstream 事例がある(--permission-mode bypassPermissions in claude_args is silently ignored (session reports permissionMode: "default") anthropics/claude-code-action#1512: bypassPermissions 指定に対し init が default を報告)。init が bypassPermissions を報告しても個別 write が拒否される事例もある(v2.1.123: --dangerously-skip-permissions still denies .claude/skills/ writes in stream-json mode (regression of v2.1.122 fix) anthropics/claude-code#54850)。したがって argv / declaration と runtime 観測を分離する設計が必要であり、init の mode は「init 時点で runtime が報告した mode」の証拠に留まる。
  • 本 Issue の write-capable scope は runner の structured evidence 出力と対応 tests、必要最小限の policy 文書のみ。

Remaining Parent Gaps

なし

Outcome

run_worktree_agent_runtime_smoke.py の structured 実行 evidence の top-level に、main-session init permissionMode が permission_mode_observed: string | null として(観測できたときだけ非 null で)出力され、offline fixture regression と、既存 runner + repository-owned Claude-GPT launcher による bounded live smoke の両方で確認され、#2860 AC5 が SKIP から PASS へ到達できる producer 側の状態にする。

blocker semantics(意味を分離して固定する):

Runtime Verification Applicability

  • decision: immediate
  • reason: docs/dev/extension-surface-runtime-policy.yaml の rule subagent-lifecycle-start-stop-delegation-fallback が scripts/agent-ops/** を default_decision: immediate(profile subagent-lifecycle-causal-evidence-smoke)で対象とする。さらに本 Issue の目的は、実 Claude Code が main-session init で permissionMode を emit し、それを runner が evidence に出せることの確認であり、fake fixture だけでは native event に field が実在することを証明できない(predecessor 実装: runtime smoke の --require-observed-runtime-field が観測済み field を常に unavailable 扱いにする defect を修正する #2854 と同型)。offline fixture は parser の regression を固定するが、実 runtime での観測可否の証明にはならない。
    applicable_acs: [AC6]
    execution_environment: linked worktree 内から、認証済みの Claude Code と repository-owned Claude-GPT launcher(scripts/claude-gpt/launch.sh)、uv、GitHub read access とネットワークが利用可能な現在の session で、scripts/agent-ops/run_worktree_agent_runtime_smoke.py を --runtime claude --mode structured --claude-adapter claude-gpt --claude-bin "$PWD/scripts/claude-gpt/launch.sh" で直接起動する(runner の --claude-bin は絶対 path 必須で、相対 path は argparse error(exit 2)になるため、必ず絶対 path で渡す)。canonical root からは実行しない。output directory は run ごとに未使用の worktree 配下 path とする。launcher の起動引数(argv / receipt)は観測値の代替にしない。新しい credential・外部サービス・権限昇格・permission boundary の変更は使用しない。新 daemon・新 harness・新 approval layer は追加しない。
    skip_conditions: 環境不能(認証・claude / launcher / uv・ネットワーク・linked worktree が利用不能)の場合は、既存の runner preflight に従い stdout SKIP: <reason> と exit 77 を返す(docs/dev/runtime-verification-policy.md の SKIP 規約に従う)。runner は main-session init の permissionMode が未観測であること自体を理由に新たな exit 77 経路を持たない(exit 0 のまま permission_mode_observed: null を出力する)。exit 0 でも null の場合は、AC6 の判定側で unconfirmed として扱う。SKIP / exit 77 / unconfirmed は PASS ではなく、その version / 起動経路では未確認として Stop Conditions に従って停止する。
    fallback_policy: fake claude fixture の結果・launcher argv / receipt・settings の再読込・declaration・worker の自己申告・assistant 本文を native 観測の代替として PASS にしない。SKIP / exit 77 / unconfirmed を PASS に読み替えない。fallback-only は FAIL。
    artifact_requirements: worktree-local の artifacts/runtime-smoke/main-session-permission-mode-<UTC timestamp>/ 配下の summary.md と --evidence-json の出力(main へ commit しない)、および claude --version の出力を PR 本文の Runtime Verification Evidence に引用する。新しい schema・receipt・publisher は追加しない。生の認証情報・session transcript は引用しない。
  • extension-surface policy の評価: hard 一致は Allowed Paths 中の scripts/agent-ops/** 配下の path(rule subagent-lifecycle-start-stop-delegation-fallback、final_decision: immediate)。required set は profile subagent-lifecycle-causal-evidence-smoke の assertion subagent_start_stop_causal_evidence_correlated の 1 件。docs/dev/runtime-verification-policy.md は ordinary で required set に含めない。本 Issue はこの policy を緩和せず、predecessor 実装: runtime smoke の --require-observed-runtime-field が観測済み field を常に unavailable 扱いにする defect を修正する #2854 の live smoke と同じ foreground Agent fixture で live の causal evidence を AC6 に束縛する。## Allowed Paths を変更した場合はこの評価を再導出して runtime_assertion_bindings を更新する。

runtime_assertion_bindings:

  • profile: subagent-lifecycle-causal-evidence-smoke
    assertion: subagent_start_stop_causal_evidence_correlated
    ac: AC6
    disposition: dispositive

In Scope

  • structured 実行(claude-gpt adapter 含む)の stream-json から、main-session の system/init event(stream 内の最初の type == "system" && subtype == "init" event そのもの。session_id の有無には依存しない)の permissionMode を抽出し、schema_summary(WORKTREE_AGENT_RUNTIME_SMOKE_RESULT_V1、--evidence-json が書き出す JSON)の top-level key permission_mode_observed として出力する。
  • exact field contract(この 1 key の additive V1 extension は、OWNER が 実装: runner の structured 実行 evidence に main-session init permissionMode を観測値として出力する #2935 (comment) の REQUEST_CHANGES と本 refinement 依頼で明示承認した固定契約であり、Stop Conditions の「未知の schema 変更」には該当しない):
    • key: permission_mode_observed、型: string | null、位置: schema_summary の top-level(named_subagent_resume 配下ではない)。別名(main_session_permission_mode 等)を使わない。schema の値 WORKTREE_AGENT_RUNTIME_SMOKE_RESULT_V1 は変更しない。
    • source: Claude stream-json の type == "system" && subtype == "init" の permissionMode のみ。runtime が実際に emit した値だけを観測値とする。
    • 観測値として出力するのは、init の permissionMode が 非空の string であり、かつ既存の閉集合 _PERMISSION_MODE_VALUES(default / plan / acceptEdits / auto / dontAsk / bypassPermissions。実装: runtime smoke の --require-observed-runtime-field が観測済み field を常に unavailable 扱いにする defect を修正する #2854 と同一)に含まれるときだけである。それ以外は未観測として null を出力する。既存の閉集合を再利用し、新しい汎用 parser / enum / schema framework は作らない。
    • 未観測(null)となる入力: init event が無い、permissionMode が無い、非 string(number / bool / object / list / null)、空文字 ""、閉集合外("bogus"、大文字小文字違い "AUTO" 等)。いずれの場合も launcher argv・declaration・settings・worker の自己申告・launcher receipt・SubagentStop 由来の値から補完しない。
    • init の permissionMode が未観測であること自体は runner の exit code を変えない(exit 0 のまま null を出力し、新たな exit 77 経路を追加しない。--require-observed-runtime-field の既存契約も変更しない)。
    • 下流 consumer は key の欠落も null と同じく未観測として扱う(fix: Auto mode の固定 /tmp scratch 上書き false-deny を run-scoped workspace で解消する #2931 の observed_main_permission_mode が top-level evidence["permission_mode_observed"] を first choice で読むことと整合する)。runner は structured 実行で key を常に出力する。
    • top-level 用の抽出は、nested の既存抽出(session_id is None ガードで init を採用する既存 helper)とは別に行ってよい(実装方法は固定しない)。ただし top-level の契約は常に「最初の system/init event そのもの」を基準とする。
    • 既存の named_subagent_resume.permission_mode_observed(nested)の有効値の出力は変更しない。nested の空文字・閉集合外の扱いを本 Issue で変更することは要求しない。
  • 既存 --require-observed-runtime-field permission_mode(SubagentStop 由来)の契約を変更しない。main-session init 由来の観測値は別 field であり、SubagentStop 観測値と混同・合成しない。effective_permission_profile の観測は扱わない。
  • permissionMode == "auto" の観測は「init 時点で runtime が Auto と報告した」ことの証拠に留まり、個々の action の effective behavior、argv で要求した mode との一致、effective_permission_profile を証明しない。この位置付けを docs/dev/runtime-verification-policy.md に必要最小限だけ追記する。
  • offline fixture の regression test を新規 test file に追加する。unobserved の negative fixture には、init なし・permissionMode なし・非 string・空文字 ""・閉集合外を含める。--evidence-json を読み返して top-level key を検証する。
  • 本 Issue の PR HEAD で、既存 runner + repository-owned Claude-GPT launcher を 1 回 bounded に live 実行し、--evidence-json の machine-generated evidence から main-session init の permission mode が観測できることを確認する(AC6)。

Out of Scope

Acceptance Criteria

  • AC1: init event に閉集合内の非空 string permissionMode がある structured 実行で、--evidence-json の top-level permission_mode_observed に、その値がそのまま出力される。少なくとも 2 種類の異なる値(例: auto と default)で検証し、値の固定実装を排除する。
  • AC2: init event が無い、permissionMode が無い、非 string、空文字 ""、閉集合外("bogus" / "AUTO")の場合、また最初の system/init が permissionMode を持たず後続の system/init だけが有効値を持つ場合(最初の init だけを採用するため)、top-level permission_mode_observed は null となり、launcher argv・declaration・SubagentStop 由来の値で補完されない。上記の各 fixture(空文字 "" と、最初の init が session_id も permissionMode も持たず後続 init が有効値を持つ case を含む)が個別の negative case として存在する。
  • AC3: 既存 --require-observed-runtime-field permission_mode の SubagentStop 由来契約が変わらず、既存 permission_mode 関連 test(test_run_worktree_agent_runtime_smoke_permission_mode.py、test_run_worktree_agent_runtime_smoke_named_subagent_resume.py)が変更なしで PASS する(これらは read-only の回帰確認対象で、編集しない。変更が必要になった場合は Scope Delta で Allowed Paths を拡張する)。main-session init 由来の値は SubagentStop 由来の観測を満たさず、named_subagent_resume.permission_mode_observed の有効値の出力も変わらない。
  • AC4: 新規 regression test file scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_main_session_permission_mode.py が、既存の scripts/agent-ops/tests/ directory target により CI collection 対象になり(CI の test plan が既にこの directory 全体を target にしているため、個別 file の登録も test plan 設定ファイルの編集も要求しない)、focused pytest で直接実行して PASS する。
  • AC5: runner が変更後も起動可能であり(--help が exit 0。新 test file 内の subprocess 起動 test で確認する)、docs/dev/runtime-verification-policy.md に main-session init 由来の permission_mode_observed の位置付け(source、string | null、未観測の規約、「init 時点の runtime 報告」に留まり effective behavior / effective_permission_profile / argv との一致を証明しないこと、SubagentStop 由来の観測との区別)が記載されている。
  • AC6: 実 Claude Code で、linked worktree から未使用の output directory を使い、predecessor 実装: runtime smoke の --require-observed-runtime-field が観測済み field を常に unavailable 扱いにする defect を修正する #2854 の live smoke と同じ foreground Agent fixture(scripts/agent-ops/tests/fixtures/subagentstop_handback_provenance_smoke_prompt.md)に --claude-adapter claude-gpt --claude-bin "$PWD/scripts/claude-gpt/launch.sh"(絶対 path 必須)--evidence-json <path> --require-subagent-causal-evidence --require-min-subagents 1 を付けた structured smoke を実行し、Claude Code の version、起動条件、exit code、--evidence-json の top-level permission_mode_observed と nested の subagent_causal_evidence.causal_evidence_source(JSON path は evidence["subagent_causal_evidence"]["causal_evidence_source"]。permission_mode_observed と違い top-level ではない)を PR 本文に記録する。exit 0 で --evidence-json の top-level permission_mode_observed が _PERMISSION_MODE_VALUES 内の非空 string であり、かつ evidence["subagent_causal_evidence"]["causal_evidence_source"] == "hook_id_correlated" のときだけ AC6 を満たす(後者は extension-surface policy の assertion subagent_start_stop_causal_evidence_correlated の確認)。観測値を launcher の argv / receipt と一致させて補完してはならない(一致は参考記録に留める)。permission_mode_observed が null(exit 77 / SKIP を含む)の場合は、その version / 起動経路では unconfirmed とし、PASS に読み替えず Stop Conditions に従って停止する。causal evidence だけが不成立の場合は permission_mode_observed の観測結果と分けて記録し、AC6 は満たさない。

Verification Commands

全コマンドは linked worktree から実行する(canonical root から実行しない)。AC6 の output directory と evidence path は run ごとに未使用の path を使い、AC6 の TS 設定と runner 起動は同一 shell で実行する。

# AC1
$ uv run --locked pytest scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_main_session_permission_mode.py -k "observed and not unobserved"

# AC2
$ uv run --locked pytest scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_main_session_permission_mode.py -k unobserved

# AC3
$ uv run --locked pytest scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_permission_mode.py scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_named_subagent_resume.py

# AC4
$ uv run --locked pytest scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_main_session_permission_mode.py

# AC5
$ uv run --locked pytest scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_main_session_permission_mode.py -k runner_help
$ rg -n "permission_mode_observed" docs/dev/runtime-verification-policy.md

# AC6
# preflight-scope: runtime_only
$ claude --version
# preflight-scope: runtime_only
$ TS=$(date -u +%Y%m%dT%H%M%SZ)
# preflight-scope: runtime_only
$ uv run --locked python3 scripts/agent-ops/run_worktree_agent_runtime_smoke.py --runtime claude --mode structured --claude-adapter claude-gpt --claude-bin "$PWD/scripts/claude-gpt/launch.sh" --worktree "$PWD" --prompt-file scripts/agent-ops/tests/fixtures/subagentstop_handback_provenance_smoke_prompt.md --output-dir "artifacts/runtime-smoke/main-session-permission-mode-$TS" --evidence-json "artifacts/runtime-smoke/main-session-permission-mode-evidence-$TS.json" --timeout-seconds 300 --max-turns 6 --expect-marker SUBAGENTSTOP_HANDBACK_PROVENANCE_SMOKE_OK --require-subagent-causal-evidence --require-min-subagents 1

AC1 用の test 名は observed を含み unobserved を含まない、AC2 用の test 名は unobserved を含む(-k による選択規約。選択件数が 0 件の VC は PASS として扱わない)。AC1〜AC2 の新規 test file は実装前 baseline では未作成(FAIL)である。AC4 は新規 test file を直接 focused pytest で実行する(test plan 設定ファイルを検索する確認コマンドは置かない)。AC5 の --help は新 test file 内の runner_help test が subprocess で起動して確認する。AC6 の実機結果(--evidence-json の permission_mode_observed と causal_evidence_source)は PR 本文の Runtime Verification Evidence に引用する。SKIP(exit 77)は PASS ではない。

Allowed Paths

  • scripts/agent-ops/run_worktree_agent_runtime_smoke.py
  • scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_main_session_permission_mode.py
  • docs/dev/runtime-verification-policy.md

Stop Conditions

  • Allowed Paths 外の変更が必要と判明した場合
  • In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
  • 上記の固定契約には、In Scope で OWNER が明示承認し固定した 1 key の additive extension(schema_summary top-level permission_mode_observed: string | null)は含まれず、この key の追加自体は停止理由にならない。それを超える変更(他の key の追加・既存 key の改名・型変更・schema 値の変更、named_subagent_resume 配下の既存 key の変更、--require-observed-runtime-field の契約変更、汎用 schema / parser framework の新設)が必要になった場合は停止する
  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
  • 後続 Phase / 別スコープへの波及が判明した場合
  • nested SubAgent delegation が必要になった場合
  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
  • AC6 の live smoke が SKIP(stdout SKIP: + exit 77)、permission_mode_observed: null、causal_evidence_source が hook_id_correlated でない、fallback-only の FAIL、または PR 引用に必要な証跡欠落となった場合。実装 / static 完了と runtime 完了を分け、unconfirmed として記録し、merge は止めて owner に環境整備・scope 判断を求める。SKIP を PASS に読み替えない。
  • 実装: Auto mode の固定 /tmp scratch 上書き false-deny を run-scoped temporary workspace で解消する #2860 の Stop Condition を緩める、または fix: Auto mode の固定 /tmp scratch 上書き false-deny を run-scoped workspace で解消する #2931 の merge / 実装: Auto mode の固定 /tmp scratch 上書き false-deny を run-scoped temporary workspace で解消する #2860 の closure を本 Issue の完了だけで可能と扱う必要が生じた場合

Required Skills

なし

Required Design References

  • docs/dev/runtime-verification-policy.md
  • docs/dev/extension-surface-runtime-policy.yaml
  • docs/dev/agent-skill-boundaries.md

Scope Delta(任意)

N/A

Notes for Reviewer

Delivery Rule

1 Issue = 1 PR、専用 worktree で作業し、Draft PR を既定とする。

Activity

  1. added
    phase/implementation
    agent/implementer
    enhancement
    triage-required
    on Oct 4, 2026
  2. squne121 commented on Oct 5, 2026

    @squne121
    OwnerAuthor

    敵対的レビュー結果

    判定: REQUEST_CHANGES。P0 はありませんが、P1 が4件あります。
    方向性自体は妥当です。launcher argv や declaration ではなく、Claude Code が実際に emit した system/init.permissionMode を main-session の観測値として使うのは正しいです。ただし、現 Issue contract のまま実装すると「#2935 自体は完了したのに #2860 AC5 は依然 SKIP」という false-green が成立します。

    確認時点の live state は、main = 940ede55df45eedf8423e7bb983c48e962ae0be7、#2935 は OPEN・コメントなし・実装 PR は未検出、関連 PR #2931 は HEAD 344f5da35326e04dacd13aa57dd962674888f336 です。#2931 の現 HEAD に対する CI は成功していますが、PR 本文上の AC5 は依然 SKIP: permission_mode_unobserved / exit 77 です。

    P1 — Runtime Verification Applicability: deferred が current repository policy と predecessor #2854 に反している

    問題: #2935 は runner 本体 scripts/agent-ops/run_worktree_agent_runtime_smoke.py を変更するのに、runtime verification を #2860 へ deferred しています。一方 current docs/dev/extension-surface-runtime-policy.yaml は scripts/agent-ops/** を subagent-lifecycle-start-stop-delegation-fallback の対象とし、default_decision: immediate、verification profile を subagent-lifecycle-causal-evidence-smoke としています。

    さらに、この Issue とほぼ同型の predecessor #2854 は「fake fixture だけでは native event に field が実在することを証明できない」として immediate な実 Claude Code smoke を要求していました。#2935 だけ offline fixture + --help で merge 可能にする合理的な差分は見つかりません。

    これは実際に重要です。Claude Code 公式仕様では Auto の開始方法は --permission-mode auto ですが、実 runtime がどの mode になったかは別問題です。公式 CLI は Auto 開始方法を明記しています。[Claude](https://code.claude.com/docs/en/cli-reference) そして upstream では --permission-mode bypassPermissions を指定したのに system/init.permissionMode が default を報告し、実際の挙動も default だった事例があります。つまり argv/declaration と runtime observation を分離する #2935 の発想そのものが必要です。[GitHub](https://github.com/anthropics/claude-code-action/issues/1512?utm_source=chatgpt.com)

    Impact: fixture parser が PASS しても current Claude-GPT launch path で field を拾えず、#2935 を merge → #2860 を再実行 → また exit 77、という無駄な1周が発生します。

    最小修正: #2935 自身を decision: immediate に変更してください。新 daemon や新 harness は不要です。#2935 PR HEAD で既存 runner + repository-owned Claude-GPT launcher を1回 bounded live 実行し、--evidence-json に main-session init mode が載ることを確認すれば十分です。#2860 の scratch producer→consumer 全体の AC5 は引き続き #2860 側に deferred して構いません。


    P1 — downstream consumer が要求する exact field contract が Issue に固定されていない

    問題: #2935 は「main-session 観測値を別 field で出力」としか規定しておらず、キー名・top-level/nested・nullability を固定していません。

    しかし PR #2931 HEAD の実 consumer は既に具体的です。

    evidence["permission_mode_observed"]
    

    を top-level first choice として読み、named-resume の

    evidence["named_subagent_resume"]["permission_mode_observed"]
    

    だけを compatibility surface として扱います。さらに同 test は current runner に

    schema_summary["permission_mode_observed"]
    

    が無いことを明示的に検査しています。

    したがって #2935 実装者が妥当に見える名前、例えば main_session_permission_mode や main_permission_mode_observed を追加しても、#2935 の現 AC1〜AC3 は満たせます。しかし #2860 consumer は読めず、AC5 は SKIP のままです。

    加えて Stop Conditions に「固定契約(キー集合・スキーマ)の変更が必要なら停止」とある一方、本 Issue の目的そのものが WORKTREE_AGENT_RUNTIME_SMOKE_RESULT_V1 の schema_summary に field を追加することなので、実装 agent にとって自己矛盾しています。

    Impact: Issue-local green / downstream red の典型的 producer-consumer semantic divergence です。

    最小修正: In Scope / AC1 に exact contract を固定してください。例えば、

    schema_summary["permission_mode_observed"]: string | null
    source: Claude stream-json system/init.permissionMode
    

    とし、この 1 field の additive V1 extension は明示的に承認済みで Stop Condition の「未知の schema 変更」に該当しないと書くのが最小です。--evidence-json を読み返して top-level key を検証する regression も入れるべきです。


    P1 — AC4 の python-test-plan 登録要求が current CI SSOT と矛盾している

    問題: #2935 AC4 は新 test を .github/ci/python-test-plan.json に登録し、VC で

    rg -n "test_run_worktree_agent_runtime_smoke_main_session_permission_mode" \
      .github/ci/python-test-plan.json

    を要求しています。

    しかし current python-test-plan.json は既に scripts/agent-ops/tests/ ディレクトリ全体を target にしています。さらに predecessor #2854 は、同じ場所に test_run_worktree_agent_runtime_smoke_permission_mode.py を新設した際、

    scripts/agent-ops/tests/ は python-test-plan の target 配下なので test plan の変更は不要

    と明示していました。

    つまり正しい最小実装では新 test file を置くだけで CI 対象です。現 VC はその正しい実装を FAIL にします。

    Impact: implementation agent に redundant な CI SSOT 編集を強制します。最悪、directory target と個別 file target の重複登録という不要な mechanism を入れます。これは今回の目的と無関係な harness churn です。

    最小修正: .github/ci/python-test-plan.json を Allowed Paths から外し、AC4 を「既存 scripts/agent-ops/tests/ target により CI collection 対象になる」に変更してください。VC は focused pytest の実行で十分です。必要なら directory target 自体を1回 grep する程度で足ります。


    P1 — 「PR #2931 の non-blocker」という記述が live #2860 Stop Condition と矛盾する

    #2935 は、

    PR #2931 の merge を機械的にブロックする項目ではない

    としています。

    一方 live #2860 は AC7 / Stop Conditions で、

    AC5 が SKIP-only の場合は merge / Issue closure を止め owner 判断

    と明示しています。そして current PR #2931 本文自身も final HEAD について、

    AC5 は SKIP。Issue の Stop Condition により merge と Issue closure は止める

    と記録しています。

    したがって GitHub native blockedBy でないことと、repository contract 上 merge blocker でないことが混同されています。

    Impact: downstream agent が #2935 の「non-blocker」を authority にして PR #2931 を merge-ready と判定すると、#2860 の current Stop Condition に違反します。

    最小修正: wording を次の意味に限定すべきです。

    #2935 は GitHub native blockedBy として登録する必要はない。ただし #2860 の current Stop Condition が owner により override されない限り、#2931 merge は #2935 の実装と final-HEAD AC5 PASS まで停止する。

    新しい gate は不要です。既存 contract の意味を揃えるだけです。


    P2 — 「non-empty string」契約に対する negative regression が抜けている

    In Scope は「非空 string の permissionMode のみ観測値」と明記しています。しかし現 AC2 / fixture は

    • field absent
    • non-string

    だけで、"" を含みません。

    しかも current extract_named_subagent_resume_observations() は実際には

    mode if isinstance(mode, str) else None

    なので、空文字を observed として採用します。既存 helper をそのまま再利用する自然な実装なら、全指定 test を PASS しつつ Issue 本文には違反します。

    最小修正: permissionMode: "" fixture を AC2 に追加してください。少なくとも "" は unobserved とする必要があります。より整合的にするなら、既存 #2854 と同じ permission-mode domain (default, plan, acceptEdits, auto, dontAsk, bypassPermissions) を共有する narrow helper に寄せてもよいですが、新しい汎用 parser framework は不要です。公式の current mode 集合もこの6系統です。[Claude](https://code.claude.com/docs/en/permissions)

    技術選択そのものは妥当

    system/init.permissionMode を runtime observation として採用する判断は維持してよいです。実 claude -p --output-format stream-json の upstream evidence でも system/init に permissionMode が出ています。[GitHub](https://github.com/anthropics/claude-code/issues/38673?utm_source=chatgpt.com) また、argv で requested mode を指定しても actual init mode が異なる upstream failure があるため、launcher source を evidence に昇格させず runtime event を見る設計は適切です。[GitHub](https://github.com/anthropics/claude-code-action/issues/1512?utm_source=chatgpt.com)

    一方で permissionMode == auto は「init 時点で runtime が Auto と報告した」ことまでの証拠に留めるべきです。upstream には system/init が bypassPermissions を報告していても特定 write が拒否される regression もあり、mode observation 単独は個々の action の effective behavior まで証明しません。[GitHub](https://github.com/anthropics/claude-code/issues/54850?utm_source=chatgpt.com) #2935 が effective_permission_profile を Out of Scope にしている点、#2854 の SubagentStop observation と別 field にする点は正しいです。

    修正後の最小 contract

    大きな仕組み追加は要りません。#2935 は次の5点だけ直せばかなり堅くなります。

    この修正なら launcher、hooks、Auto allow、permission policy、新 schema registry、新 approval layerには触れず、#2860 の本来の目的に直接効く instrumentation だけで閉じられます。

  3. squne121 commented on Oct 5, 2026

    @squne121
    OwnerAuthor

    推奨は、comment 5991689409 を OWNER の trusted human context / REQUEST_CHANGES として issue-refinement-loop に渡し、#2935 の契約そのものを修正してから fresh review まで回すことです。現時点では #2935 は OPEN、専用の実装 branch/PR は未検出です。repository SSOT でも scripts/agent-ops/** は runtime verification immediate、scripts/agent-ops/tests/ は既に python-test-plan の directory target に含まれています。添付の前回ログ上でも #2935 は #2860 AC5 の permission_mode_unobserved を解消する follow-up として起票された経緯です。貼り付けたテキスト(1)

    また upstream evidence でも、stream-json の system/init に permissionMode が出力される例があり、要求した permission mode と実際の init mode が食い違った報告があります。したがって argv/declaration ではなく runtime event を authority にする target comment の方向性は維持すべきです。[GitHub](https://github.com/anthropics/claude-code-action/issues/1512?utm_source=chatgpt.com)

    以下を、そのまま現在の fresh / auto mode の対話的 Claude Code に貼れます。

    repo = squne121/loop-protocol

    対象 Issue:
    #2935

    今回の trusted human context / OWNER REQUEST_CHANGES:
    #2935 (comment)

    使用する repository-native Skill:
    .claude/skills/issue-refinement-loop/SKILL.md

    この対話的 Claude Code session は既に fresh / auto mode で起動済みです。現在の session をそのまま継続してください。

    新しい session の起動、/clear、permission mode の変更、bypassPermissions、--dangerously-skip-permissions は不要で、要求していません。

    目的

    Issue #2935 を、上記 OWNER REQUEST_CHANGES を trusted human context として current issue-refinement-loop で自律的に精緻化してください。

    必要な Issue contract 修正、調査、web fact-check、controlled Issue body update、fresh review、再修正を canonical loop の範囲内で反復し、implementation に handoff 可能な canonical terminal state まで、人間の iteration ごとの追加承認なしで進めてください。

    これは Issue refinement の依頼です。

    • runner の実装
    • implementation branch / PR の作成
    • impl-review-loop の起動
    • implementation-worker による production code 実装

    までは進めないでください。

    issue-refinement-loop が approved に到達した場合も、current Skill の termination / handoff report を投稿して終了してください。approved を implementation 開始承認として扱わないでください。

    authority / freshness

    最初に必ず live state を fresh に取得してください。

    少なくとも以下を再取得・確認してください。

    prompt 作成時点の snapshot は main = 940ede55df45eedf8423e7bb983c48e962ae0be7、#2935 は OPEN、#2935 自身の実装 PR / branch は未検出でしたが、これを current authority として再利用せず live state を優先してください。

    target comment は OWNER の direct human context です。agent report として分類しないでください。

    canonical preflight では target URL を preflight.run.with_human_context の human context / anchor comment URL として明示的に渡してください。unlabeled lane や with_agent_report に送らないでください。

    明示的な承認

    私は今回、以下の通常の非破壊的作業を追加の個別承認なしで実施することを明示的に承認します。

    • live GitHub / repository state の再取得
    • current Skill / Agent / SSOT の読解
    • read-only repository investigation
    • read-only Web research
    • codebase-investigator 等の必要な SubAgent dispatch
    • planner が要求する場合の web-researcher dispatch
    • canonical preflight
    • deterministic repair / deterministic structural repair
    • contract_update.run.with_human_context
    • issue-editor の controlled transaction による Issue 実装: runner の structured 実行 evidence に main-session init permissionMode を観測値として出力する #2935 body/title の必要最小限の修正
    • target OWNER REQUEST_CHANGES を反映する contract rewrite
    • body readback
    • fresh preflight
    • fresh Step 2 review
    • semantic review が current workflow 上 applicable の場合の実行
    • bounded rewrite / review iteration
    • Issue comment / termination report の投稿
    • recurrent defect の dedupe
    • owner Issue が存在しない recurrent defect の follow-up Issue materialization
    • current workflow が要求する dependency / follow-up materialization
    • canonical terminal state までの自動継続

    loop iteration ごとの人間承認は不要です。current issue-refinement-loop の loop policy に従って bounded に自動継続してください。

    ただし Claude Code の permission mode 自体を変更する承認ではありません。

    OWNER REQUEST_CHANGES の disposition

    target comment の finding を単に summary するのではなく、current repository evidence で1件ずつ adjudicate し、成立する finding は Issue #2935 の contract に実際に反映してください。

    少なくとも次の5点を解消対象として扱ってください。

    1. Runtime Verification Applicability

    current repository policy を再評価してください。

    prompt 作成時点では:

    • docs/dev/extension-surface-runtime-policy.yaml
    • rule subagent-lifecycle-start-stop-delegation-fallback
    • selector scripts/agent-ops/**
    • default_decision: immediate
    • profile subagent-lifecycle-causal-evidence-smoke

    が成立しています。

    predecessor #2854 も、fake fixture のみでは native runtime field の実在を証明できないとして decision: immediate を採用しています。

    fresh inspection でも成立するなら #2935 自身の Runtime Verification Applicability を immediate に修正してください。

    ただし区別してください。

    新 daemon、新 harness、新 approval layer は追加しない contract にしてください。

    #2935 の future implementation PR HEAD では、既存 runner と repository-owned Claude-GPT launcher を使った bounded live smoke により、--evidence-json の machine-generated evidence から main-session init permission mode が観測できることを確認する AC / VC を持たせてください。

    SKIP / exit 77 を PASS に読み替えない contract を維持してください。

    2. exact field contract

    この点は今回の私の明示的 owner judgment として扱ってください。

    #2935 が意図的に追加する additive V1 field contract を Issue 本文で固定することを承認します。

    fresh code / consumer inspection でも target comment の前提が成立するなら、最低限次を明示してください。

    WORKTREE_AGENT_RUNTIME_SMOKE_RESULT_V1 / schema_summary:

    permission_mode_observed: string | null

    source:

    Claude stream-json の

    type == "system" && subtype == "init" の permissionMode

    consumer compatibility:

    #2931 の current consumer が top-level

    evidence["permission_mode_observed"]

    を first choice として読むことと整合させる。

    規約:

    • runtime が実際に emit した値だけを observation とする
    • launcher argv から補完しない
    • settings / declaration から補完しない
    • worker 自己申告から補完しない
    • field absence は未観測
    • non-string は未観測
    • empty string は未観測
    • downstream が読む exact key を別名にしない

    この 既知の1 field の additive extension は今回明示的に承認した contract change であり、Stop Conditions の「未知の schema / fixed contract change」と自己矛盾して停止しないよう、Stop Conditions 側も整合させてください。

    これを契機に汎用 schema framework を新設しないでください。

    current runner に既存 permission-mode enum / narrow helper が存在し再利用可能なら重複 parser を作らない contract を優先してください。ただし refinement 時点で実装方法を過剰固定しないでください。

    3. python-test-plan の redundant edit

    fresh inspection で .github/ci/python-test-plan.json が既に

    scripts/agent-ops/tests/

    ディレクトリ全体を target としていることを確認してください。

    成立するなら:

    • .github/ci/python-test-plan.json を Allowed Paths から外す
    • 個別 test file の登録を要求する AC / VC を削除する
    • focused pytest で新 regression file 自体を直接検証する
    • 必要なら CI SSOT の directory target が存在することを read-only で確認する

    という最小 contract に修正してください。

    directory target と個別 file target の重複登録を要求しないでください。

    4. #2931 の blocker semantics

    次の概念を分離してください。

    • GitHub native blockedBy
    • repository / Issue contract 上の merge Stop Condition

    #2935 は GitHub native blockedBy として登録する必要がない、という記述は許容できます。

    しかし current #2860 の Stop Condition が owner により別途 override されない限り、

    は #2935 の実装と、必要な final-head AC5 runtime completion まで停止する、

    という意味に揃えてください。

    「#2935 は PR #2931 の merge blocker ではない」と無条件に書かないでください。

    #2931 の live body / current #2860 contract と意味論を一致させてください。

    5. empty-string negative regression

    current contract の「非空 string の permissionMode のみ観測」と test fixture を一致させてください。

    少なくとも以下を unobserved negative fixture に含めてください。

    permissionMode: ""

    既存 #2854 / runtime policy が permission-mode domain の closed set を正本としているなら、その existing definition を調査して整合させてください。

    新しい汎用 parser / enum framework は作らないでください。

    SubAgent の利用

    SubAgent は必ず current agent definition を読んでから使ってください。agent 名だけから役割を推測しないでください。

    codebase-investigator

    planner / investigation policy が Step 1 investigation を要求する場合は codebase-investigator を使い、少なくとも次を独立確認させてください。

    task:
    #2935 OWNER REQUEST_CHANGES の repository-side factual validation

    target:
    Issue #2935 / comment 5991689409 / current main

    authority:
    current main + live GitHub + repository SSOT

    確認対象:

    expected output:
    各 OWNER findingについて supported / contradicted / stale と exact repository evidence、Issue contract に必要な最小修正。

    dispatch したら terminal completion と final result を必ず待ってから downstream decision に使ってください。

    web-researcher

    target comment は current Claude Code behavior に依存するため、canonical planner の web_research_policy が applicable / required と判定した場合は web-researcher を使ってください。

    最低限 fact-check する claim:

    • current Claude Code の permission mode / Auto 起動仕様
    • stream-json system/init.permissionMode
    • requested permission mode と runtime observed permission mode が一致しない可能性
    • current permission-mode value domain

    official docs / upstream repository / maintainer Issue を優先してください。

    AGY → native Web fallback 等の具体 procedure は current web-researcher.md の契約に従い、この prompt で再実装しないでください。

    これも dispatch したら terminal completion と final result を待ってください。

    planner が web research を不要と明示的に判定した場合は、その canonical reason を記録し、prompt の文章だけを理由に planner を迂回しないでください。

    issue-editor

    Issue body mutation が必要なら current canonical Step 4 の issue-editor controlled route を使用してください。

    raw gh issue edit を ad hoc に使わないでください。

    NEXT_ACTION: issue_editor_required の場合は、今回 main/root thread 自身が渡した target human context URL

    #2935 (comment)

    を reviewer_feedback_url として再利用してください。

    issue-editor も terminal completion と authoritative readback を待ってください。

    canonical Step 2

    current issue-refinement-loop が定めるとおり、canonical Step 2 は root-owned review pipeline を authority としてください。

    退役した issue-reviewer relay を独自に復活させないでください。

    実行順序

    1. current repository / GitHub state を fresh に取得。
    2. current issue-refinement-loop、必要 references、agents、SSOT を読む。
    3. target comment を human-context lane として canonical preflight を実行。
    4. planner が要求する investigation / web research を SubAgent に委譲し、全て terminal completion まで待つ。
    5. target finding を current evidence で adjudicate。
    6. canonical planner / contract patch plan が deterministic / structural repair を指示した場合は current registered consumer を使って実行。
    7. contract_update.run.with_human_context が必要なら controlled route を使う。
    8. full rewrite が必要なら issue-editor に handoff。
    9. mutation 後は authoritative body/title readback。
    10. fresh preflight を再実行。
    11. fresh canonical Step 2 review。
    12. semantic design review が applicable なら current Step 2.5 に従う。
    13. needs-fix / REQUEST_CHANGES は bounded に自動修復し fresh review。
    14. max iteration 未到達なら追加の人間承認を求めず自動継続。
    15. recurrent defect が見つかった場合は existing Issue を検索し、owner が無ければ repository-native follow-up materialization で Issue を起票する。
    16. canonical terminal state に到達して終了する。

    SubAgent を background dispatch しただけで次工程へ進まないでください。必ず terminal status と final result を取得してください。

    follow-up Issue

    今回の5 finding そのものは #2935 の Issue contract defect なので、原則として #2935 内で修正し、新規 Issue に逃がさないでください。

    ただし調査中に、#2935 の scope では修正すべきでない recurrent / repository-wide root cause が別に判明した場合は:

    1. open / closed Issue を dedupe
    2. ownership を確認
    3. owner Issue が無ければ follow-up Issue を repository-native route で materialize
    4. 実装: runner の structured 実行 evidence に main-session init permissionMode を観測値として出力する #2935 の blocker か non-blocker かを明記

    してください。

    単なる一般的 hardening、schema、wrapper、approval layer を追加する follow-up は作らないでください。

    停止境界

    次は通常の停止理由にしないでください。

    • deterministic repair
    • normal needs-fix
    • review REQUEST_CHANGES
    • static readiness failure で自動修正可能なもの
    • stale body / stale review の fresh rerun
    • bounded iteration 内の再レビュー

    次の場合のみ genuine escalation を許容します。

    • destructive operation が必要
    • secret / credential の取得・変更・公開が必要
    • force push / history destruction が必要
    • policy bypass が必要
    • target OWNER comment と今回の明示承認でも解消できない genuine human_judgment_required
    • irreconcilable scope conflict
    • evidence integrity を維持できない
    • canonical loop 上限到達
    • current repository authority が明示的に human decision を要求し、今回の owner directive では決定できない

    他 task の dirty work、foreign worktree / branch、別 session の artifact を変更・削除しないでください。

    最終到達点

    可能ならこの turn で:

    まで進めてください。

    ただし approved 後も runner implementation や PR 作成には進まないでください。

    最終報告

    最後に evidence-based に次を報告してください。

    SubAgent pending、fresh review pending、stale evidence の状態で完了扱いにしないでください。

    current repository-native issue-refinement-loop の terminal state まで、この turn で進めてください。

    この prompt は、今回の OWNER comment が既に与えている判断を再度人間に問い返さず、contract repair の authority として使う構成です。特に exact additive field の承認と #2931 blocker semantics を明示したので、そこを human_judgment_required として再停止する可能性を抑えています。

  4. squne121 commented on Oct 5, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop: approved

    OWNER finding 5 件の disposition

    1. Runtime Verification Applicability: confirmed。deferred → immediate に修正。policy rule subagent-lifecycle-start-stop-delegation-fallback が scripts/agent-ops/** を default_decision: immediate で対象とする。AC6 で既存 runner + repository-owned Claude-GPT launcher の bounded live smoke を要求し、SKIP / exit 77 / unconfirmed を PASS に読み替えない。
    2. exact field contract: confirmed。schema_summary top-level permission_mode_observed: string | null(source は system/init.permissionMode、既存の閉集合 _PERMISSION_MODE_VALUES を再利用)を固定し、この 1 key の additive extension を明示承認として Stop Conditions と整合させた。
    3. python-test-plan: confirmed。.github/ci/python-test-plan.json は scripts/agent-ops/tests/ を directory ごと target としているため、Allowed Paths と AC / VC から除去。
    4. fix: Auto mode の固定 /tmp scratch 上書き false-deny を run-scoped workspace で解消する #2931 blocker semantics: confirmed。GitHub native blockedBy と repository contract 上の merge Stop Condition を分離し、実装: Auto mode の固定 /tmp scratch 上書き false-deny を run-scoped temporary workspace で解消する #2860 の現行 Stop Condition が override されない限り fix: Auto mode の固定 /tmp scratch 上書き false-deny を run-scoped workspace で解消する #2931 の merge と 実装: Auto mode の固定 /tmp scratch 上書き false-deny を run-scoped temporary workspace で解消する #2860 の closure は 実装: runner の structured 実行 evidence に main-session init permissionMode を観測値として出力する #2935 の実装と final-HEAD の AC5 runtime 完了まで停止する、と記述。
    5. 空文字 negative regression: confirmed。init 経路の既存採用規則 mode if isinstance(mode, str) は "" を採用するため、permissionMode: "" を含む unobserved negative fixture を AC2 に追加。

    調査(SubAgent)の独立検証結果

    • codebase-investigator は Finding 5 を contradicted と報告したが、根拠は SubagentStop 経路の extractor / test であり init 経路ではなかった。control-plane の実コード確認で confirmed と判定した。Finding 2 も nested 側の field を根拠としていたため、同様に top-level 不在を確認した。
    • web-researcher(route: native_web)の 4 claim(Auto 起動は --permission-mode auto、system/init.permissionMode、requested と observed の乖離事例、6 値の値域)を公式 CLI reference と upstream issue で spot-check した。

    semantic review の経緯と warning(実装時の注意)

    loop 実績

    • review cycle: 4 回(Step 2 needs-fix 1 回、approve 後の semantic warning 反映 1 回、semantic high の needs-fix 1 回、最終 approve)。needs-fix の routing は 2 回で、上限 3 に到達していない。
    • follow-up Issue: なし(実装: runner の structured 実行 evidence に main-session init permissionMode を観測値として出力する #2935 の scope 外の recurrent / repository-wide root cause は検出されなかった。dedupe 対象なし)。
    • hard dependency の確定なし(blockedBy は意図的に登録しない)。dependency materialization gate は対象外。
    LOOP_HANDOFF_RESULT_V1:
      status: refinement_approved
      routing_action: none
      contract_review:
        status: blocked
        gate_result: missing_go
        latest_comment_url: none
        generated_at: "2026-10-05T10:00:00Z"
        body_sha256: "59e254e513b13b40e1d4b4f62613cedf711d71af8bcfef358d238ddfa5fb2f69"
      metadata:
        title_prefix_ready: true
      label_sync_observation:
        kind: presentation_sync
        result: noop
        detail: "presentation-only。この refinement ではラベルを変更していない"
      auto_fixes:
        result: auto_fixed
        required: []
        skipped: []
      blockers: []
      permissions:
        unavailable: []
      generated_at: "2026-10-05T10:00:00Z"
      checked_body_sha256: "59e254e513b13b40e1d4b4f62613cedf711d71af8bcfef358d238ddfa5fb2f69"
      checker_exit_code: 0
      missing_sections: []
      missing_contract_keys: []

    注記: contract_review は issue-contract-review をこの refinement では実行していないことを示す(gate_result: missing_go)。implementation 開始時に fresh な issue-contract-review が必要であり、本 marker は audit telemetry のみで implementation 開始の authority ではない。

  5. squne121 commented on Oct 5, 2026

    @squne121
    OwnerAuthor

    確認した current state では、#2935 は refinement が approved まで完了し、実装・branch・PR は未開始です。終了時点でも「実装開始時に fresh な contract review が必要」と明示されています。貼り付けたテキスト(1) 現行 impl-review-loop は過去の refinement_approved コメント自体を開始権限にせず、Root-Owned Synchronous Entry Transition 内で current-run review を取り直す設計なので、追加 refinement はせず、その canonical entry から #2935 の実装ループを開始するのが推奨です。関連 PR #2931 は #2935 の実装 PR ではないため流用せず、landing disposition が future live state で別候補を見つけた場合だけそちらを resume させるのが適切です。

    以下をそのまま、既に fresh / auto mode で起動している対話的 Claude Code に貼れます。

    repo = squne121/loop-protocol

    対象 Issue:
    #2935

    refinement 終了報告(audit / handoff telemetry。実装開始 authority としては扱わない):
    #2935 (comment)

    refinement で取り込まれた OWNER REQUEST_CHANGES:
    #2935 (comment)

    使用する repository-native Skill:
    .claude/skills/impl-review-loop/SKILL.md

    この対話的 Claude Code session は既に fresh / auto mode で起動済みです。現在の session をそのまま継続してください。

    新しい session の起動、/clear、permission mode の変更、bypassPermissions、--dangerously-skip-permissions は不要で、要求していません。

    目的

    Issue #2935 を current repository-native impl-review-loop で実装し、

    fresh intake → implementation → verification → PR review → fix → re-verification → fresh re-review → terminal gate

    を canonical loop の範囲内で自律的に反復し、人間が merge 判断できる直前の merge-ready state まで進めてください。

    iteration ごとの人間承認は不要です。

    ただし 実 merge / auto-merge は行わないでください。

    current state の扱い

    prompt 作成時点では以下を確認済みです。ただし、これらを current authority として固定せず、開始時に repository-native flow で fresh に再取得してください。

    開始時は必ず current HEAD の以下を読み、過去 transcript やこの prompt の procedure を canonical contract の代替にしないでください。

    canonical entry を使うこと

    開始判断を過去の refinement_approved comment から prose で再実装しないでください。

    current impl-review-loop が定める Root-Owned Synchronous Entry Transition と intake flow を使い、

    • capability preflight
    • live Issue binding
    • current-run issue-contract-review
    • immediate live re-fetch / freshness reconciliation
    • intake capsule
    • pre-Step-1 Evidence-Based Landing Disposition
    • canonical routing

    を current Skill の手順どおり処理してください。

    build_intake_capsule.py 等の current canonical producer が authority の判断を返す箇所では、同じ判断を ad hoc な gh / prose parsing で二重実装しないでください。

    過去 comment 5992207061 は agent-produced termination/audit report として扱い、implementation authorization に昇格させないでください。

    current-run entry transition / intake が正常に Step 1 を許可した場合、その結果を今回の明示的な実装依頼と組み合わせて実装へ進んでください。

    landing disposition / duplicate 防止

    worker / worktree / PR 作成前に、current impl-review-loop の Evidence-Based Landing Disposition を必ず評価してください。

    • exact current-scope の既存 open/draft PR があれば existing_pr_resume に従い再利用する
    • exact implementation が main に既に landed 済みなら duplicate implementation を作らない
    • evidence contradictory / stale / malformed なら current canonical reconciliation route に従う
    • ordinary dispatch の場合だけ新規 implementation worktree / branch / PR を作る

    PR #2931 は #2935 本文中で downstream / related とされ、#2935 自身の Allowed Paths に #2931 側のファイル変更は含まれません。単に #2935 を参照しているという理由で #2931 を #2935 の implementation candidate と誤認しないでください。

    明示的な承認

    私は今回、Issue #2935 を merge 直前まで進めるために必要な、以下の通常の非破壊的作業を追加の個別承認なしで実施することを明示的に承認します。

    • current repository / GitHub live state の read
    • git fetch 等の read/freshness 更新
    • current Skill / Agent / SSOT / tests / scripts の読解
    • canonical intake capsule / root entry / contract review / landing-disposition producer の実行
    • canonical linked worktree の作成
    • 実装: runner の structured 実行 evidence に main-session init permissionMode を観測値として出力する #2935 の live Allowed Paths 内の実装・編集
    • focused regression test の新設
    • current Issue が要求する Verification Commands の実行
    • current impl-review-loop が要求する typecheck / lint / test / build / CI verification
    • worktree-local artifacts/ への runtime evidence 生成
    • Issue 実装: runner の structured 実行 evidence に main-session init permissionMode を観測値として出力する #2935 AC6 の bounded real Claude / Claude-GPT runtime smoke
    • repository-owned scripts/claude-gpt/launch.sh の current contract に従う通常利用
    • commit の作成
    • branch の通常 push
    • Draft PR の作成
    • PR body の canonical 更新
    • current workflow 上必要なら Draft → Ready for review への遷移
    • GitHub PR / Issue への通常コメント投稿
    • current-head CI / check 状態の取得
    • current workflow が認める通常の CI 再実行・再検証
    • implementation-worker / test-runner / pr-reviewer その他 current Skill が要求する SubAgent dispatch
    • REQUEST_CHANGES / deterministic blocker /通常の test failure /修正可能な CI failure に対する fix → re-test → re-review
    • current Skill の bounded branch update / PR body hygiene repair
    • recurrent defect の既存 Issue open/closed 検索と dedupe
    • distinct な recurrent root cause が確認できた場合の narrow な再発防止 GitHub Issue 起票

    これらについて iteration ごとの人間確認を要求しないでください。

    この承認は permission bypass の指示ではありません。現在の auto mode / permission policy をそのまま使ってください。

    Issue #2935 で固定すべき contract

    実装時は live Issue 本文を正本にしてください。特に以下を弱めないでください。

    exact output field

    structured run の machine-generated evidence / schema_summary に、

    permission_mode_observed: string | null

    を top-level key として追加すること。

    別名へ変更しないでください。

    source は main-session の最初の system/init.permissionMode runtime event のみです。

    launcher argv、launcher receipt、settings、declaration、worker self-report、SubagentStop 値で補完しないでください。

    有効値は既存 _PERMISSION_MODE_VALUES を再利用してください。

    default
    plan
    acceptEdits
    auto
    dontAsk
    bypassPermissions

    以外、および非-string、空文字、欠落は unobserved / null としてください。

    top-level の first-init contract は session_id 有無に依存させないでください。

    既存 nested named_subagent_resume.permission_mode_observed と、既存 --require-observed-runtime-field permission_mode の SubagentStop contract は変更しないでください。

    permissionMode == auto は「init 時点で runtime が Auto と報告した」ことまでしか証明しません。effective permission behavior や effective_permission_profile の証拠へ昇格させないでください。

    Allowed Paths

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

    refinement approved 時点では次の 3 path です。

    • scripts/agent-ops/run_worktree_agent_runtime_smoke.py
    • scripts/agent-ops/tests/test_run_worktree_agent_runtime_smoke_main_session_permission_mode.py
    • docs/dev/runtime-verification-policy.md

    既存 test_run_worktree_agent_runtime_smoke_permission_mode.py 等は regression verification 対象ですが read-only です。変更が必要なら勝手に広げず、current contract / Scope Delta / Stop Conditions に従ってください。

    .github/ci/python-test-plan.json は変更しないでください。scripts/agent-ops/tests/ directory が既に CI target です。

    AC6 / runtime verification は必須

    Issue #2935 は Runtime Verification Applicability が immediate です。

    offline fixture green だけで完了扱いにしないでください。

    PR の current HEAD に対して live Issue の AC6 / VC を canonical execution path で実行し、

    • Claude Code version
    • launcher / execution conditions
    • runner exit code
    • --evidence-json top-level permission_mode_observed
    • nested evidence["subagent_causal_evidence"]["causal_evidence_source"]
    • artifact paths

    を current PR の Runtime Verification Evidence に記録してください。

    --claude-bin は絶対 path 必須です。Issue の actual Verification Command と current runner CLI contract を fresh に読み、相対 path に退行しないでください。

    PASS 条件は current Issue 本文どおりです。

    • runner / verification が成功
    • permission_mode_observed が有効な非空 string
    • evidence["subagent_causal_evidence"]["causal_evidence_source"] == "hook_id_correlated"

    permission_mode_observed: null、SKIP / exit 77、fallback-only、causal evidence 不成立、証跡欠落を PASS に読み替えないでください。

    一方、main-session init 未観測だけを理由に runner 本体へ新しい exit-77 mechanism を勝手に追加しないでください。Issue contract 上、runner は解析後の structured evidence に null を出し、AC6 判定側で unconfirmed とします。

    runtime-only VC の execution authority は current impl-review-loop / canonical executor contract に従ってください。test-runner の tool allowlist を拡張したり、禁止されている arbitrary Python execution を迂回させたりしないでください。

    SubAgent の使い方

    current impl-review-loop が定める canonical agents を使用してください。

    少なくとも:

    • Step 1: implementation-worker
    • verification: current Step 2 が要求する test-runner / canonical verification executor
    • Step 4: pr-reviewer

    を current contract に従って使ってください。

    各 dispatch では、親会話の暗黙 context に頼らず最低限次を具体値で渡してください。

    • task / canonical task name
    • Issue / PR の実 URL・番号
    • current HEAD
    • authority / live Issue contract
    • Allowed Paths
    • fix_delta(再修正の場合)
    • relevant evidence references
    • expected structured output

    SubAgent を background dispatch しただけで downstream へ進まないでください。

    各 SubAgent について terminal completion notification / final result を実際に取得し、その structured result を確認してから次の dependency step へ進んでください。

    pending / running / backgrounded の状態を success と解釈しないでください。

    independent な read-only investigation は current Skill が許すなら並列化して構いませんが、implementation → verification → review → fix の dependency ordering は守ってください。

    SubAgent output の主張が routing-critical な場合は、root/control-plane が必要な live state / deterministic producer で検証してください。

    review / fix loop

    実装後は PR review を必ず current HEAD に対して行ってください。

    REQUEST_CHANGES が返った場合:

    1. blocker を fix_delta として記録
    2. implementation-worker の current repair route に委譲
    3. terminal completion を待つ
    4. current HEAD を取得し直す
    5. affected verification を再実行
    6. current HEAD で fresh PR review
    7. Step 5 terminal gate を再評価

    まで自動で進めてください。

    stale reviewed HEAD、main drift、branch behind、body hygiene 等については、current route_loop_verdict_v2 / step5-terminal-gate が返す canonical action に従ってください。

    通常の test failure、CI failure、REQUEST_CHANGES、stale HEAD は、それ自体を人間停止理由にしないでください。修復可能なら bounded loop 内で修復・再検証してください。

    APPROVE 単独を merge-ready と扱わないでください。

    最終 approval は current step5-terminal-gate の approved route と、

    • current-head VC evidence
    • current-head PR review
    • blockers == []
    • required CI / branch protection
    • live mergeability

    が current Skill の terminal conditions を満たした場合だけ確定してください。

    再発防止 Issue

    実装・test・review 中に、#2935 の局所修正だけでは再発する concrete root cause を見つけた場合は、まず GitHub の open / closed Issue を検索して重複を確認してください。

    既存 Issue が同じ root cause を所有している場合は、新規 Issue を作らずその Issue を参照してください。

    既存 ownership がなく、かつ #2935 の Allowed Paths を越えて吸収すべきでない recurrent defect が evidence 付きで確認できた場合は、再発防止用 GitHub Issue をその場で起票することを承認します。

    follow-up Issue は narrow にし、少なくとも次を記録してください。

    security 一般論、追加 schema registry、wrapper、approval layer、恒久 gate を concrete failure の裏付けなく増やさないでください。

    current #2935 scope 内で直せる defect は follow-up に逃がさず、この PR で修正してください。

    downstream #2860 / PR #2931

    #2935 の PR で #2860 / PR #2931 の production files / tests / body を変更しないでください。Issue #2935 の Out of Scope を守ってください。

    #2860 / #2931 は downstream completion です。

    #2860 の current Stop Condition が owner により別途 override されない限り、

    が必要です。

    今回の到達点は #2935 自身の PR を merge-ready にすることです。#2931 を merge-ready と宣言することではありません。

    最終報告では、この downstream disposition も明示してください。

    停止境界

    以下の場合のみ、current repository contract に従って停止 / escalation してください。

    • destructive operation が必要
    • secret / credential の取得・変更・公開が必要
    • force push / history destruction が必要
    • permission / policy bypass が必要
    • live Issue / PR 上で current owner の明示的停止指示がある
    • actual Git conflict / canonical conflict hard stop
    • Issue 実装: runner の structured 実行 evidence に main-session init permissionMode を観測値として出力する #2935 の Stop Conditions に該当し、自動修復しても解消できない
    • AC6 が環境依存の SKIP / permission_mode_observed: null / causal evidence 不成立のまま bounded retry でも解消しない
    • Allowed Paths 外の変更が不可避
    • irreconcilable scope conflict
    • evidence integrity を維持できない
    • current canonical loop 上限到達
    • current Skill の真正な route_human_escalation / hard fail-close

    単なる advisory telemetry、古い snapshot、過去 handoff marker の missing_go、SubAgent の自己申告 human_review_required: true だけを停止理由にしないでください。current impl-review-loop の authority / routing rules を優先してください。

    他 task の dirty work、foreign worktree / branch、別 session の artifact を変更・削除しないでください。

    merge 境界

    以下は明示的に禁止します。

    terminal gate が approved に到達し、#2935 PR が human merge decision の直前になった時点で停止してください。

    最終報告

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

    SubAgent pending、CI pending、runtime evidence pending、fresh PR review pending、stale HEAD、terminal gate 未通過の状態で完了扱いにしないでください。

    current repository-native impl-review-loop の terminal approved / merge-ready state、または genuine hard stop まで、この turn で自律的に進めてください。

    この prompt では、refinement の approved をそのまま implementation authorization に誤変換せず、現行 Skill の fresh Root-Owned Entry Transition を必ず通すようにしています。また、#2935 の実装時に最も false-green を起こしやすい AC6 の null/SKIP と downstream #2931 の扱いを明示的に固定しています。

  6. squne121 commented on Oct 5, 2026

    @squne121
    OwnerAuthor

    root-owned entry router audit

    route: invoke_impl_review_loop
    reason: fresh_review_go_live_equality

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/implementationtriage-required

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions