Repository navigation
Closed
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phasetriage-requiredNeeds owner triage for priority decision
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "PR #2096(#2086 fix_delta)の Safety Claim Matrix が自己開示した AC3 の残存ギャップを、fixture-backed の real subprocess E2E と no-gh/network negative control で閉じる"
change_kind: code
command_contract:
command_id: preflight.run.fixture.with_human_context
execution_class: exact_skill_runtime_anchor_fixture
entrypoint: scripts/agent-guards/skill_runtime_exec.py
child_entrypoint: .claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py
cwd_policy: canonical_main_root
required_branch: default_branch
network_effect: local_only
mutation: false
shell: false
timeout_seconds: 120Parent Issue
なし(単独改善)。
Parent Goal Ref
- Goal: 実装: operator-selected human context の scope reframe を自動継続し scope expansion stop を撤去する #2086 は PR 実装: operator-selected human context の scope reframe を自動継続し scope expansion stop を撤去する #2096 で実装・close 済み。本 Issue は PR 実装: operator-selected human context の scope reframe を自動継続し scope expansion stop を撤去する #2096 の Safety Claim Matrix が自己開示した「
contract_update_requiredpositive route は real subprocess E2E 未証明」という残存ギャップを閉じる。 - Desired Destination:
preflight.run.fixture.with_human_contextを production human-context lane を一般化せずに閉じた test-only sibling profile として追加し、real executor から real preflight/planner までの offline E2E を証明する。
Current Validated Scope
- current main
fe4f242cb5a325d163d45f5eb822d40c49947488では、registry/policy への ID 追加だけでは足りない。executor はpreflight.run.fixtureと anchor profiles を ID 固定で別 dispatch し、fixture+anchor を相互に拒否するため、narrow sibling admission/dispatch が必要である。 run_refinement_preflight.pyは--fixture、--anchor-comment-url、--human-context-comment-url、--investigation-evidence-transport-pathを同時に受理済みであり、本 Issue は wrapper の production logic を変更しない。- primary positive fixture の expected route は
runtime_evidence.route.action == "contract_update_required"、implementation_allowed == falseに一意固定する。issue_editor_requiredは full-rewrite fallback であり、AC 成功の代替にしない。
Remaining Parent Gaps
- なし。実装: operator-selected human context の scope reframe を自動継続し scope expansion stop を撤去する #2086 の production human-context contract と 実装: operator-selected human context の scope reframe を自動継続し scope expansion stop を撤去する #2096 の既存実装は変更しない。
Outcome
preflight.run.fixture.with_human_context が closed test-only profile として real registry→policy→root-no-worktree→executor→run_refinement_preflight.py→planner を shell=False の argv で通過し、fixture-backed transport の正確な contract_update_required route と gh 非呼出しを再現可能に証明できる状態。
In Scope
- exact command ID
preflight.run.fixture.with_human_contextと execution classexact_skill_runtime_anchor_fixtureを registry、policy、executor の同一 closed grammar に追加する。 - child argv を次の順序で固定する:
--issue-number {issue_number}、--repo {repo}、--fixture {fixture}、--anchor-comment-url {anchor_comment_url}、--human-context-comment-url {anchor_comment_url}、任意の--investigation-evidence-transport-path {investigation_evidence_transport_path}。shell=False、timeout 120 秒、mutation: false、network_effect: local_only、canonical main root/default branch、trusted repo/issue/anchor binding、target Issue artifact root 内への fixture confinement を維持する。 - registry metadata/placeholder/optional flag pair、registry validation、exact parser、root-no-worktree invariant、executor admission/dispatch/render の全到達性を実装・回帰テストで証明する。
- real checked-in
command_registry.py、skill_runtime_command_policy.py、skill_runtime_exec.py、run_refinement_preflight.py、plan_refinement_loop.pyを使う real subprocess E2E を追加する。stub、directrun_preflight()、known_contextまたは derived path のテスト側直接注入を AC3 の代替にしない。 - test-only
tmp_pathに fixture、空のGH_CONFIG_DIR、ghcanary marker を隔離し、E2E child 環境だけで canary を PATH 先頭へ置く。production の executable trust/PATH validation は変更しない。 - existing
preflight.run.fixture、preflight.run.with_human_context、agent-report/unlabelled fail-closed、authority transport、registry security、executor anchor tests を回帰として保持する。
Out of Scope
- production
preflight.run.with_human_contextの command ID、argv、placeholders、network effect、fixture reject、human authority boundary の変更または一般化。 run_refinement_preflight.py、plan_refinement_loop.py、controlled mutation consumer、Issue body の実装時 mutation を変更すること。issue_editor_requiredを primary positive route として扱うこと、または test success を live GitHub API/network/credential に依存させること。- 実装: operator-selected human context の scope reframe を自動継続し scope expansion stop を撤去する #2086 の他 AC、実装: repair_action candidate を controlled Issue transaction へ自動適用する main control-plane consumer を追加する #2039 の
repair_action.applyruntime lane、実装: issue-refinement-loop / impl-review-loop の main drift を自動再束縛・scope-clean reconciliation する #2102 の main-drift rebind、実装: read-only issue-reviewer の producer I/O を root-owned に分離し、0-byte stdout も validator-first で分類する #2049/implement: recover reviewer transport failures and cryptographically bind compact verdicts to artifacts #2054/実装: implementation Issue の Runtime Verification Applicability 欠落を authoring・readiness・reviewer・consumer 全経路で fail-closed に統一する #2040 の reviewer/RVA work の実装。
Acceptance Criteria
- AC1: exact ID
preflight.run.fixture.with_human_contextが registry に exact argv、required placeholders、optional transport flag pair、execution_class: exact_skill_runtime_anchor_fixture、local_only、mutation: false、canonical root/default-branch/artifact-root metadata と共に存在し、既存preflight.run.fixtureと productionpreflight.run.with_human_contextの registry contract は byte-for-byte の意味で変更されない。 - AC2: 同 ID が registry validation、fixture+human-context 専用 exact parser、root-no-worktree allowlist/invariants、executor argparse/admission/dispatch/render を全て通り、real child subprocess を起動できる。fixture path は target Issue artifact root 外、absolute path、
..traversal、symlink escape、leading-、NUL/newline を拒否し、duplicate/reordered/--flag=value/unknown extra token は child 起動前に exit 2 で拒否する。 - AC3: real repository assets を使う
test_fixture_human_context_real_subprocess_reaches_contract_update_required_ac3が、realskill_runtime_exec.pysubprocess → real registry/policy → realrun_refinement_preflight.py→ real planner/classifier を通し、bound fixture と bound investigation-evidence transport からruntime_evidence.route.action == "contract_update_required"およびimplementation_allowed == falseを assert する。controlled mutation/consumer invocation は 0 とし、issue_editor_required、directrun_preflight()、stub asset、test からの production-transport bypass は PASS 根拠にしない。 - AC4: AC3 の同じ E2E で
ghcanary が未発火である。GH_TOKENを unset しただけを証明とせず、全 GitHub token env の除去、空の per-testGH_CONFIG_DIR、GH_PROMPT_DISABLED=1、bounded timeout を補助 control とし、canary 発火、network fallback、live API success、SKIP exit 77、fallback success は FAIL とする。 - AC5: wrong repo/issue、mismatched anchor/human-context URL、mismatched transport repo/body SHA/HEAD SHA/anchor/digest、agent-report/unlabelled/untrusted-authority lane は
contract_update_requiredへ到達せず fail-closed である。productionpreflight.run.with_human_contextに--fixtureを渡す場合と agent-report lane に transport を渡す場合は既存どおり child 起動前に拒否する。 - AC6:
preflight.run.fixture、productionpreflight.run.with_human_context、registry security、policy anchor、executor anchor、および既存の directrun_preflight()transport tests に回帰がない。
Verification Commands
# AC1
# baseline-expect: pass
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_command_registry.py .claude/skills/issue-refinement-loop/tests/test_command_registry_security.py -q# AC2
# baseline-expect: pass
$ uv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_policy_anchor.py scripts/agent-guards/tests/test_skill_runtime_exec_anchor.py -q# AC3
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_fixture_human_context_subprocess.py::test_fixture_human_context_real_subprocess_reaches_contract_update_required_ac3 -q# AC4
# baseline-expect: fail
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/test_fixture_human_context_subprocess.py::test_fixture_human_context_real_subprocess_reaches_contract_update_required_ac3 -q# AC5
# baseline-expect: pass
$ uv run --locked pytest scripts/agent-guards/tests/test_skill_runtime_policy_anchor.py scripts/agent-guards/tests/test_skill_runtime_exec_anchor.py -q# AC6
# baseline-expect: pass
$ uv run --locked pytest .claude/skills/issue-refinement-loop/tests/ -qSupplemental Checks
Ruff は実装完了時の必須 supplemental check とするが、baseline_vc_preflight.py の許可対象外であるため、baseline Verification Commands の execution set には含めない。
$ uv run --locked ruff check .claude/skills/issue-refinement-loop/scripts/command_registry.py scripts/agent-guards/skill_runtime_command_policy.py scripts/agent-guards/skill_runtime_exec.py .claude/skills/issue-refinement-loop/tests/test_command_registry.py .claude/skills/issue-refinement-loop/tests/test_command_registry_security.py .claude/skills/issue-refinement-loop/tests/test_operator_selected_scope_reframe.py .claude/skills/issue-refinement-loop/tests/test_fixture_human_context_subprocess.py scripts/agent-guards/tests/test_skill_runtime_policy_anchor.py scripts/agent-guards/tests/test_skill_runtime_exec_anchor.pyRuntime Verification Applicability
decision: immediate
rationale: "AC3/AC4 は real subprocess、fixture-backed GitHub payload、child environment と canary の実行時境界を通さなければ検証できない。"
applicable_acs: ["AC3", "AC4", "AC5"]
execution_environment: "local pytest; real skill_runtime_exec.py subprocess; canonical main root/default branch; fixture-backed GitHub payload; network not required"
skip_conditions: "uv または pytest が実行不能な場合のみ stdout を SKIP: で開始して exit 77 とし、PASS へ昇格させず Stop Conditions に従う。"
fallback_policy: "network fallback、live GitHub/gh success、stub/direct-call path、canary 発火、SKIP、または fallback 経由の success は FAIL。"
artifact_requirements: "real child argv、route/provenance、exit code、canary marker 不在、fixture/transport binding を test assertion として残し、runtime evidence は PR に添付する。"Allowed Paths
- .claude/skills/issue-refinement-loop/scripts/command_registry.py
- scripts/agent-guards/skill_runtime_command_policy.py
- scripts/agent-guards/skill_runtime_exec.py
- .claude/skills/issue-refinement-loop/tests/test_command_registry.py
- .claude/skills/issue-refinement-loop/tests/test_command_registry_security.py
- .claude/skills/issue-refinement-loop/tests/test_operator_selected_scope_reframe.py
- .claude/skills/issue-refinement-loop/tests/test_fixture_human_context_subprocess.py
- scripts/agent-guards/tests/test_skill_runtime_policy_anchor.py
- scripts/agent-guards/tests/test_skill_runtime_exec_anchor.py
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
- production executable trust/PATH policy、secret protection、root-no-worktree/default-branch/repository binding、または destructive-operation guard を緩和しなければ AC を満たせない場合
- canary を test-only child environment に閉じ込められず、live network/credential を成功根拠から除外できない場合
Required Skills
- Python: dataclass/argparse/subprocess の strict argv・environment・timeout 境界
- pytest:
tmp_pathによる fixture/canary 分離、targeted regression、negative control - privileged runtime registry/policy/executor contract: closed command grammar、root-no-worktree、authority transport、fail-closed dispatch
Required Design References
- docs/dev/agent-skill-boundaries.md
- docs/dev/workflow.md
- docs/dev/runtime-verification-policy.md
- .claude/skills/issue-refinement-loop/SKILL.md
- .claude/skills/issue-contract-review/references/contract-compliance.md
Scope Delta(任意)
reframe_in_place: current executor の ID-fixed fixture/anchor dispatch を確認し、AC3 実到達性に必要な executor と直接 regression tests を Allowed Paths に追加した。run_refinement_preflight.py は flags の同時受理が現行実装で確認済みのため Out of Scope のまま維持する。
Notes for Reviewer
- command ID は
preflight.run.fixture.with_human_contextに固定する。既存 ID との衝突は確認されず、fixture sibling を先行させることでpreflight.run.fixtureを拡張した test-only profileであることを明示する。新 execution class は既存 fixture/anchor class を一般化せず、専用exact_skill_runtime_anchor_fixtureとする。 - edit intent は「既存 production semantics unchanged、new sibling admission/dispatch only」。executor の narrow branch と root-no-worktree invariant を含むため、単なる registry dict 追加ではない。
- Scope collision: 実装: repair_action candidate を controlled Issue transaction へ自動適用する main control-plane consumer を追加する #2039 は registry/policy/executor を shared し
repair_action.applyの dispatcher work を所有するため、実装開始時に current main と hunk semantics を再確認し、同一 command-class branch に競合があれば rebase/順序調整する。実装: issue-refinement-loop / impl-review-loop の main drift を自動再束縛・scope-clean reconciliation する #2102 は current PR fix(loop): main drift evidence を再束縛する (#2102) #2118 の実 diff に当該 files がなく mere declared-path overlap。実装: read-only issue-reviewer の producer I/O を root-owned に分離し、0-byte stdout も validator-first で分類する #2049 は registry hunk の可能性があるが reviewer transport で command semantics は別、implement: recover reviewer transport failures and cryptographically bind compact verdicts to artifacts #2054 は reviewer transport、実装: implementation Issue の Runtime Verification Applicability 欠落を authoring・readiness・reviewer・consumer 全経路で fail-closed に統一する #2040 は RVA と refinement tests でありいずれも mere overlap。文字列 overlap 単独は停止理由ではない。 GH_TOKENunset だけは不十分。GitHub CLI は token env より低い優先度で stored credentials を利用し得るため、test-only canary の未発火を primary proof にする。GH_CONFIG_DIR/prompt disable/token removal は補助 isolation であり、production trust boundary の緩和ではない。
Source
- origin: PR 実装: operator-selected human context の scope reframe を自動継続し scope expansion stop を撤去する #2096(https://github.com/squne121/loop-protocol/pull/2096)の Safety Claim Matrix AC3 行における self-disclosed limitation
- related: 実装: operator-selected human context の scope reframe を自動継続し scope expansion stop を撤去する #2086(closed)、実装: root preflight の bytecode cache 誤検知を防止する #1439 / PR fix: preflight provenance の pyc 生成を防止する #1444(fixture sibling precedent)、実装: fix(issue-refinement-loop): bind freeform OWNER scope authority end-to-end and expose routing telemetry #2053 / PR fix(issue-refinement-loop): bind freeform OWNER scope authority end-to-end and expose routing telemetry #2068(authority transport precedent)
- external primary sources: GitHub CLI environment/auth manual、Python
subprocessdocumentation、pytesttmp_pathdocumentation
Metadata
Metadata
Assignees
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phasetriage-requiredNeeds owner triage for priority decision
Activity
squne121 commentedon Aug 12, 2026
敵対的レビューの結論として、#2136 は現状のままでは AC3 を満たせない契約です。Issue 本文は
skill_runtime_exec.py経由の real subprocess E2E を要求している一方、Allowed Paths は registry・policy・issue-refinement 側テストの3箇所だけで、executor 本体を含んでいません。 現行 executor はpreflight.run.fixtureだけを fixture command と認識し、anchor runtime command に--fixtureが付くと明示的に拒否します。したがって sibling command を registry/policy に足すだけでは dispatch 不能です。 過去にpreflight.run.fixtureを導入した #1439 でも、まさにこの理由で registry・policy に加えてskill_runtime_exec.pyの受理分岐まで実装対象にしています。さらに、PR #2096 では「実 subprocess」を称するテストが stub registry / stub child を使っていたため OWNER レビューで false-green と判定された前例があります。 #2096 の最終 Safety Claim Matrix も、今回の positive route が real subprocess E2E では未検証だったことを follow-up として明示しています。 したがって #2136 の AC は単なる
rg存在確認ではなく、real registry → real policy → real executor → real preflight → real planner の到達性を固定すべきです。もう一つ重要なのは「
gh非依存」の証明です。GH_TOKENを消すだけでは不十分です。GitHub CLI は保存済み credential を使用でき、環境変数 token も認証源になります。([GitHub CLI]1) したがって E2E には「ghが呼ばれたら必ず検知・FAILする canary」を入れるべきです。fixture repo は pytest のtmp_pathでテストごとに分離できます。([pytest]2) また subprocess 境界は shell string ではなく argv sequence・shell=False・bounded timeout を維持するのが Python の標準 API と整合します。([Python documentation]3)加えて、#2136 は implementation Issue かつ runtime subprocess E2E が主目的なのに
Runtime Verification Applicabilityセクションがありません。 ここも refinement 対象に入れるべきです。issue-refinement-loop自体は iteration approval を既定で要求せず、needs-fix は budget 内なら自動継続する契約なので、「人間承認不要」は permission bypass ではなく、この loop continuation として扱えます。このチャットから CodexCLI のサブエージェントを直接起動することはできないため、完了済みとは扱いません。以下の作業プロンプトでは、サブエージェントを並列起動し、全員の terminal result を待ってからレビュー・編集へ進むことを hard requirement にしています。
Task
Repository:
squne121/loop-protocolTarget: GitHub Issue
#2136Issue #2136 に対して、current main・関連 Issue/PR/コメント・repository assets・外部一次資料を調査した上で、adversarial review → issue-refinement-loop → Issue 本文の controlled rewrite → fresh review/readiness まで実行してください。
これは Issue refinement のみです。実装コード変更、実装 PR 作成、Issue close は行わないでください。
人間への iteration 承認確認は不要です。
issue-refinement-loopの repository-nativeloop_iteration_approval_gate.default_required: falseに従い、needs-fixかつ iteration budget が残っている限り自動継続してください。ただしこれは Codex/Claude の permission bypass を意味しません。
--dangerously-skip-permissions等を追加したり、repository guard・Stop Condition・secret protection・destructive-operation guard を弱化したりしてはいけません。Mandatory SubAgent fan-out
最初に main thread だけで結論を出さず、少なくとも以下の4 SubAgentを並列起動してください。
SubAgent 自身には GitHub Issue mutation / repository mutation をさせず、read-only investigation/review に限定してください。
Agent A — runtime-path investigator
current main を対象に、最低限以下を追跡してください。
.claude/skills/issue-refinement-loop/scripts/command_registry.pyscripts/agent-guards/skill_runtime_command_policy.pyscripts/agent-guards/skill_runtime_exec.py.claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py.claude/skills/issue-refinement-loop/tests/test_operator_selected_scope_reframe.py.claude/skills/issue-refinement-loop/tests/test_command_registry.py.claude/skills/issue-refinement-loop/tests/test_command_registry_security.pyscripts/agent-guards/tests/test_skill_runtime_policy_anchor.pyscripts/agent-guards/tests/test_skill_runtime_exec_anchor.py以下を明示してください。
preflight.run.fixturepreflight.run.with_human_context--fixture--anchor-comment-url--human-context-comment-url--investigation-evidence-transport-pathについて、
registry → registry validation → policy exact parser → root-no-worktree policy → executor argparse/dispatch → render_command → run_refinement_preflight.pyの actual call graph を追跡すること。
特に、新規 sibling command を registry/policy に追加するだけで current
skill_runtime_exec.pyが受理できるのか、コードで証明してください。Agent B — history / related-work investigator
GitHub live dataから最低限以下を確認してください。
特に以下を抽出してください。
preflight.run.fixtureを追加したときに必要だった runtime surfacesIssue番号から内容を推測せず、live body/comment/PR diff を確認してください。
Agent C — external-spec researcher
Webアクセスを使用し、技術的主張は一次資料を優先してください。
最低限調査:
GitHub CLI official manual
GH_TOKENGH_PROMPT_DISABLEDPython official
subprocessdocumentationshell=Falsepytest official documentation
tmp_path目的は、AC3 の「
gh非依存 real subprocess E2E」を false-green なく証明する test design を作ることです。特に、
を敵対的に検証してください。
結論だけでなく、根拠URL・参照箇所を report してください。
Agent D — independent adversarial contract reviewer
Agent A/B/C の結果をまだ見ない状態で live #2136 を独立レビューしてください。
重点:
contract_update_required OR issue_editor_requiredが positive-route 証明として弱すぎないかpreflight.run.with_human_contextの safety boundary を accidental に広げないかghaccess の accidental successP0/P1/P2 で findings を返してください。
Join barrier
4 SubAgent 全員の terminal result を受け取るまで、Issue #2136 を編集してはいけません。
途中で一部 agent が終了しても、残りを dangling のまま進めないでください。
全 agent について最終的に以下を記録してください。
danglingは最終編集前に必ず0にしてください。SubAgent が失敗した場合は同じ役割を一度だけ再実行してよいです。再実行後も失敗なら、取得できた repo evidence を main thread が検証し、fail-closed に扱ってください。
Preliminary adversarial hypotheses
以下は作業開始時の仮説です。鵜呑みにせず current main で再検証してください。
H1 — P0: Allowed Paths が insufficient
Issue #2136 は新規 sibling command を
skill_runtime_exec.py経由で real subprocess 実行することを要求している。しかし current executor が
preflight.run.fixtureのみ認識--fixtureを渡すと rejectする構造なら、新 sibling command の dispatch には
scripts/agent-guards/skill_runtime_exec.pyの変更が必要である。その場合、現在の Allowed Paths は AC3 と矛盾している。
H2 — P0: AC2 / VC が existence-only false-green
eligible_command_idsに名前が存在するだけでは不十分。最低でも、
が一致しなければ real command は起動できない。
rgのみを AC1/AC2 の成功根拠にしないこと。H3 — P1: positive route を
A OR fallbackにしないIssue の origin は AC3 positive route の gap である。
したがって primary E2E は可能なら exactly
contract_update_requiredを期待値とすること。issue_editor_requiredは full-rewrite fallback を証明する別 fixture として扱い、primary positive route の代替成功条件にしないこと。current implementation semantics を調査した結果、positive fixture 自体が正しく
issue_editor_requiredを返すべき設計なら、その根拠を Issue に明示した上で期待値を一意に固定してください。曖昧な
A または Bは残さないでください。H4 — P1: 「gh 非依存」を negative control で証明する
単に fixture を渡すこと、
GH_TOKENを unset すること、ネットワークがたまたま失敗することは証明にならない。GitHub CLI が呼ばれた場合に deterministic に test failure / sentinel を発生させる方法を、current executor の environment sanitation / executable trust policy を壊さず設計してください。
production trust boundary を緩めるために PATH や executable validation を一般化してはいけません。
test-only temporary repo / canary / existing fixture hook 等、current architecture と整合する最小手段を選んでください。
E2E success と同時に「canary が未発火」を assert してください。
H5 — P1: Runtime Verification Applicability が必要
#2136 は implementation Issue で、real subprocess E2E が completion criterion である。
Issue 本文に canonical
## Runtime Verification Applicabilityが無いなら、refinement で追加してください。推奨 semantics:
正確な schema は current repository の canonical RVA policy / neighboring implementation Issues を読んで決定してください。独自 schema を発明しないこと。
Required refinement outcome
SubAgent join 後、main thread で findings を統合し、Issue #2136 を repository-native
issue-refinement-loopで改善してください。max_iterationsは repository default を使用してください。各 iteration:
needs-fixなら budget 内で自動 rewriteとし、iteration continuation のために人間承認を求めないでください。
ただし max iteration exhaustion、真正な semantic ambiguity、secret/credential、destructive operation、permission escalation 等の repository hard-stop は迂回しないでください。
Contract changes that must be evaluated
調査結果が preliminary hypotheses を支持するなら、少なくとも以下を Issue 本文に反映してください。
1. command ID を固定
例示扱いをやめ、実装前に exact ID を contract として固定すること。
第一候補:
preflight.run.fixture.with_human_context既存 naming convention と衝突する場合のみ別名を選び、その理由を Issue に書くこと。
Verification Commands と parser tests が同じ ID を参照する状態にしてください。
2. sibling exact profile として閉じる
新 command は production
preflight.run.with_human_contextの parser/argv を一般化するのではなく、test-only sibling profile とする。期待する security semantics を明文化してください。current repo と整合する範囲で最低限:
新 execution class が必要なら、既存 class を無理に再利用せず専用 sibling class とする。ただし class 名は current naming policy を調査して確定する。
3. Allowed Paths を actual runtime reachability に合わせる
必要性が確認できた場合、少なくとも次を追加候補として評価すること。
scripts/agent-guards/skill_runtime_exec.pyscripts/agent-guards/tests/test_skill_runtime_exec_anchor.pyscripts/agent-guards/tests/test_skill_runtime_policy_anchor.py.claude/skills/issue-refinement-loop/tests/test_command_registry.py.claude/skills/issue-refinement-loop/tests/test_command_registry_security.py実コードを読んで不要な path は追加しないこと。
一方、必要と判明した path を「現 Allowed Paths 外だから」という理由で残したまま refinement を approve しないこと。これは今まさに Issue contract を refinement している段階なので、AC と実装面が一致するよう Issue 本文側を修正する。
run_refinement_preflight.pyは、fixture + human-context + investigation transport を既に同時処理可能で production logic change が不要なら Out of Scope のまま維持する。4. additive-only claim を訂正
executor dispatcher に narrow branch が必要なら、Notes for Reviewer の
edit_intent: additive-only(新規 dict entry ... only)は事実と一致しない。
代わりに、
等、actual diff と一致する表現へ直す。
5. Acceptance Criteria を behavioral にする
最終 AC は最低限、以下の責務を一意に判定できるようにしてください。
AC — registry contract
新 sibling command の exact argv / placeholders / metadata が registry に存在し、production
preflight.run.with_human_contextとpreflight.run.fixtureの既存 contract は変わらない。AC — policy + executor reachability
同 command が、
をすべて通過し、real child process へ到達する。
単なる文字列存在確認を PASS にしない。
AC — real positive E2E
real repository assets を使用すること。
禁止:
command_registry.pyskill_runtime_exec.pyrun_refinement_preflight.pyplan_refinement_loop.pyrun_preflight()call を real subprocess E2E の代用にすることknown_context/ derived path を直接注入して production transport を迂回することreal chain:
test subprocess→ real
skill_runtime_exec.py→ real registry/policy
→ real
run_refinement_preflight.py→ real planner/classifier
を通過させる。
fixture と bound investigation evidence transport を使用し、期待する exact positive route を assert する。
AC — no-gh/network negative proof
live GitHub auth の有無に依存せず test が成功し、
ghinvocation canary が未発火であること。network fallback / live API success を fixture success として扱わない。
AC — security negative matrix
current parser/security contract に適用可能なものを含める。
候補:
..traversal reject-/ newline / NUL 等 unsafe pathpreflight.run.with_human_contextに fixture を混入しても受理されないwith_agent_report/ unlabeled lane が human authority に昇格しない既存 security parser が保証していない項目を勝手に AC 化せず、actual policy を確認して選定する。
AC — regression
既存:
preflight.run.fixturepreflight.run.with_human_contextに回帰がない。
6. Verification Commands を behavioral にする
rgは補助診断には使ってよいが、AC1/AC2 の唯一の verification にしない。current test topology を確認した上で、概ね次の lane を Issue に明記してください。
uv run --locked pytest \ .claude/skills/issue-refinement-loop/tests/test_operator_selected_scope_reframe.py \ -k "real_subprocess" \ -q必要なら
-kを final exact test 名へ更新し、他テストの偶然 PASS を AC evidence としない。関連全体 regression:
変更 Python について repository 標準に従う Ruff lane も追加してください。
test files も Ruff 対象に含めるのが repository convention なら含める。
7. Required Skills を現実に合わせる
なしのままにしない。最低限、実際に必要なら:
を記載する。
Scope collision treatment
Shared files が #2102 / #2054 / #2049 / #2040 / #2039 等と overlap していても、文字列 path overlap だけで停止しない。
各 related Issue について、
を比較してください。
特に current
mainは作業開始時と Issue起票時で変わり得るため、Issue mutation 直前にも main SHA と shared-file contents を再取得してください。stale snapshot を refinement evidence に使わないこと。
Web-research quality requirements
外部調査は検索結果 snippets だけで完結させず、一次資料本文を確認してください。
優先:
外部資料から Issue contract に導入する assertion は、repository current implementation と衝突しないか Agent A の code evidence と照合してください。
特に「stored GitHub credentials がある環境でも fixture E2E が accidental network success しない」ことを test goal に反映してください。
Issue mutation
Issue本文の編集は main thread が repository-native controlled Issue editing route を使用してください。
raw body overwrite を雑に行わず、
を行うこと。
SubAgent に mutation authority を渡さない。
Issue #2136 以外の Issue/PR は読み取り専用。別 Issue の body/comment/state/label/dependency は変更しない。
Review loop completion criterion
Issue を更新した後、fresh issue-reviewer を実行し、validator-first で verdict を consume してください。
needs-fixかつ budget が残る:→ 人間承認を求めず次 iteration へ。
approve:→ fresh contract/readiness evidence を取得して終了。
max_iterationsexhaustion / genuine hard-stop:→ repository contract の termination reason をそのまま返す。
iteration counter をリセットして budget を迂回しない。
Final response format
最後に以下を機械的に報告してください。
その後、人間向けに短く以下だけ要約してください。
Issue refinement 完了後も実装には着手しないでください。
このプロンプトでは、特に **「executor を Allowed Paths に含める」「stub 禁止」「
gh非呼出し negative control」「positive route の期待値を一意化」「RVA追加」**を必須の敵対的論点にしています。これらを通さないと、#2096 で一度発生した false-green の再発余地が残ります。squne121 commentedon Aug 12, 2026
はい。今回のケースでは、実装上の問題ではなく、レビュー制御系の失敗が実装開始を止めています。
「compact verdict」とは何か
compact verdictは GitHub の機能でも、一般的なソフトウェア開発標準でもありません。loop-protocol固有の、SubAgent のレビュー結果を親オーケストレーターへ渡すための小さな機械可読メッセージです。現行
ISSUE_REVIEW_RESULT_COMPACT_V1は、概ねSTATUS / VERDICT / SUMMARY / BLOCKERS / NEXT_ACTION / MUST_READ / REVIEWED_BODY_SHA256 / EVIDENCE / ARTIFACTの9フィールドです。raw review 全文を親コンテキストに流さず、approveかneeds-fixかを機械的に routing する目的で使われています。今回まずかったのは、
VERDICT: needs-fix+
BLOCKERS: 0という組み合わせです。validator は
needs-fixなら blocker は1件以上必要と明示的に要求するので、この組み合わせを invalid とします。さらに reviewer 自身の契約では、execute-readiness の timeout や environment failure のような
human_judgment系エラーは、そもそも semantic なneeds-fixに畳み込んではいけないことになっています。つまり今回起きたことを簡略化すると、
です。
これがないと作業できないのか
一般論では、まったく必要ありません。
個人趣味開発にも GitHub にも Python 開発にも compact verdict は不要です。これはこのリポジトリの agent orchestration protocol にすぎません。
ただし、現在の
issue-refinement-loopを契約通り厳密に使う場合だけは必要です。現行 SKILL は、reviewer stdout を最初に validator に通し、validation_status != validならhuman_judgment_requiredに固定すると明記しています。なので、
「実装に本質的に必要」ではなく、「現在の自動化フレームワークが実装 authorization の必須ゲートにしている」
というのが正確です。
そして、あなたがリンクした #2054 はまさにこの欠陥を修正する Issue です。#2054 は transport failure を semantic judgment から分離し、
transport_status: environment_failure+
semantic_verdict: nullとして扱うことを目的にしています。また artifact/transport は semantic approval を与えず、live Issue、tests、CI、independent review が semantic authority のままだと明記しています。
不要な要件が進行を邪魔しているか
今回については、そう評価してよいです。
compact format 自体には、LLM出力を deterministic に扱う価値があります。しかし、
まで必須化すると、control-plane の信頼性が product development の single point of failure になります。
特に個人開発なら、より実用的なのは、
実際の semantic blocker → stop
reviewer infrastructure failure → 1回程度 retry → deterministic checker/tests に fallback
です。
なお、報告時の
main_sha=fe4f242...から現在の repository は既に7aac382...系まで進んでいるため、継続時には古い SHA を authority にせず current main を再取得すべきです。現在の code search も7aac382...上の reviewer/validator を示しています。以下は、停止した #2136 を再開し、compact-verdict の transport failure だけを理由に再停止しないための CodexCLI 用プロンプトです。#2054 を #2136 の途中で実装するようにはしていません。
Task
Repository:
squne121/loop-protocolTarget Issue:
#2136Issue #2136 の作業を current main から再開し、実装・テスト・PR作成・レビュー修正を merge-ready まで進めてください。
人間への iteration 承認確認は不要です。
ただし permission bypass、secret protection の緩和、destructive-operation guard の解除、
--dangerously-skip-permissions等は禁止します。OWNER / OPERATOR OVERRIDE FOR THIS RUN
前回の
issue-refinement-loopは以下で停止した。gopass / proceedneeds-fix相当でありながらBLOCKERS: 0となり validator に拒否されたこの OWNER instruction により、その過去の invalid compact verdict は implementation blocker として扱わない。
これは semantic review の省略を意味しない。
以下を明確に区別すること。
特に以下を禁止する。
approveに捏造するBLOCKERS: 0を機械的にBLOCKERS: 1に書き換えて validator を通すvalidate_review_compact_output.pyを 実装: preflight.run.with_human_context に gh fixture 対応を追加し AC3 positive route の real subprocess E2E を完成する #2136 のために緩和する#2054 は reviewer transport failure と semantic verdict の分離を所有する別 Issue として扱う。
1. Fresh authority
最初に live state を再取得する。
最低限:
前回記録された
は historical evidence としてのみ扱い、authority として pin しない。
current main drift が #2136 の command registry / policy / executor semantics に影響する場合のみ再評価する。
無関係な main drift を理由に full issue-refinement-loop を最初から再実行しない。
2. Minimal semantic revalidation
fresh compact reviewer output を implementation authorization の単一必須条件にしない。
代わりに parent/main thread が live Issue body に対して deterministic evidence を直接取得する。
Contract checker
live body を一時ファイルへ保存し、次を実行する。
期待:
actual semantic blocker が返った場合だけ implementation を止め、blocker を修正する。
tool/runtime/environment failure と semantic blocker を混同しない。
Static readiness
期待:
Baseline Verification Commands
Issue #2136 の現在の
## Verification Commandsを文字通り確認する。特に baseline expectation を尊重する。
passpassfailfailpasspasspassAC3 / AC4 は未実装状態で fail することが正しいため、expected baseline failure を implementation blocker として扱わない。
各 VC の actual exit/result と declared baseline expectation が一致することを確認する。
3. Reviewer transport failure policy
fresh reviewer を利用できるなら bounded に1回実行してよい。
valid compact output が得られた場合:
以下の場合:
は、
として記録する。
同じ reviewer transport failure の再取得を目的に loop を繰り返さない。
reviewer transport failure は implementation iteration budget を消費させない。
deterministic checker、static readiness、baseline VC が正常なら、この OWNER instruction を implementation authorization として作業を続行する。
4. Implementation
current main から専用 branch / worktree を作成する。
Issue #2136 の current Allowed Paths のみ変更する。
current live body の契約を authority とする。
実装の中心は exact command ID:
である。
要求される production chain:
を real subprocess で到達可能にする。
既存の
の production semantics を広げない。
新 sibling profile のみを narrow に追加する。
5. AC3 / AC4
primary E2E は必ず real repository assets を使う。
禁止:
positive route は一意に:
を要求する。
issue_editor_requiredを AC3 の代替成功条件にしない。6. no-gh proof
GH_TOKENunset だけを「gh 非依存」の証明にしない。test-only child environment で:
を使用する。
canary が発火したら FAIL。
production executable trust / PATH validation は変更しない。
canary は test-only child environment に限定する。
7. Security / negative controls
Issue 本文の negative matrix を実装する。
最低限:
は child 起動前または contract-defined fail-closed point で拒否する。
8. Verification
実装後、Issue #2136 の全 Verification Commands を current HEAD で実行する。
AC3 / AC4 はこの時点では baseline fail から PASS へ変わる必要がある。
加えて:
および変更範囲に対応する agent-guards regression を実行する。
Ruff を実行する。
git diff --checkを実行する。新規/変更 test file が repository の CI test plan coverage policy に違反していないか確認する。
9. Adversarial implementation review
実装後はコード diff を独立に再レビューする。
レビューでは compact verdict transport の成功そのものを品質根拠にしない。
以下を authority とする。
actual P0/P1 blocker があれば修正して再検証する。
reviewer transport の malformed output や timeout だけなら fix iteration として数えず、direct evidence review に fallback する。
SubAgent を使用する場合、必要な役割だけを使用し、fan-out 自体を完了条件にしない。
10. PR
実装と検証が完了したら PR を作成する。
PR body に最低限:
を含める。
さらに以下を明記する。
前回の invalid compact envelope は「Issue contract failure」ではなく、
として記録する。
11. Continue without human iteration approval
通常の以下について人間承認を求めない。
停止するのは以下だけ。
reviewer transport failure / compact verdict formatting failure 単独では停止しない。
12. Final result
最後に次を報告する。
このプロンプトのポイントは、compact verdict を削除するのではなく、「reviewer の通信障害を semantic blocker に昇格させない」ことです。#2054 が完成すれば本来この workaround 自体を repository-native に吸収できますが、#2136 をそれまで待たせる技術的必然性はありません。
squne121 commentedon Aug 12, 2026
Contract Review Result
test(refinement): make fixture E2E clone repeatable (#2136)
fix(refinement): harden fixture human-context runtime profile (#2136)
feat(refinement): add fixture human-context runtime profile (#2136)
test(refinement): make fixture E2E clone repeatable (#2136)
fix(refinement): harden fixture human-context runtime profile (#2136)
fix(refinement): #2136 adversarial hardening (H1/H3) + regression cov…
feat(refinement): fixture human-context runtime profile (#2143)