Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: none
goal_ref: "trusted direct human context の substantive contract feedback を、provenance/binding/fail-closed を維持したまま既存 issue-editor controlled transaction に安全に handoff 可能にする"
change_kind: workflow
dedupe_key: "trusted-human-contract-feedback-controlled-editor-handoff:v1"Parent Issue
なし(単独改善)
Parent Goal Ref
- Goal: 実装: Contract Snapshot publish の transport round-trip と PATCH reconciliation を修正する #2619 の refinement で発見された control-plane gap を、実装: Contract Snapshot publish の transport round-trip と PATCH reconciliation を修正する #2619 の transport/PATCH 修正とは独立した narrow follow-up として解消する。
- Desired Destination: trusted direct human context の substantive contract feedback が、既存の
NEXT_ACTION: issue_editor_requiredcontrol-plane handoff 経路を通って既存 issue-editor SubAgent / controlled transaction にだけ到達し、provenance/binding/fail-closed の安全境界を維持する。
Current Validated Scope
preflight.run.with_human_contextは trusted direct human context の substantive contract feedback を認識できる。- 既存コードは
decide_rewrite_route.pyのdecide_scope_reframe_contract_route()により、revised acceptance criteria 等の contract section marker から Acceptance Criteria 等の section-boundCONTRACT_PATCH_PLAN_V1を生成できる。また同関数は承認済み scope reframe をroute: issue_editor_required(reason_code: approved_scope_requires_full_contract_rewrite、operations: [])としてrun_refinement_preflight.pyのconsume_trusted_anchor_contract_patch_plan()へ返す唯一の既存 producer である。 - 本 Issue が扱う gap は、既存の section-bound patch derivation でも表現不能で、かつ既存 scope-reframe full-rewrite route(
issue_editor_required,operations: [])にも該当しない、explicit trusted human contract directive に限定される。該当しない場合、現状のcontract_update.run.with_human_contextはPLANNER_FAIL_CLOSED、writes=0に停止する。 - 既存の issue-editor SubAgent(
.claude/agents/issue-editor.md)はすでにissue_number+reviewer_feedback_url(またはreviewer_feedback_text)を正式入力として受け取り、candidate body を生成して既存edit_issue_txn.pycontrolled transaction に渡せる。本 Issue はこの既存経路を再実装せず、control-plane 側の routing 判定だけを拡張する。
Remaining Parent Gaps
- 実装: Contract Snapshot publish の transport round-trip と PATCH reconciliation を修正する #2619 の Contract Snapshot transport round-trip / PATCH reconciliation 実装は本 Issue と独立に追跡する。
- raw GitHub mutation または controlled editor の executor(
edit_issue_txn.py)自体の変更が必要と判明した場合は、別 follow-up に分離する。
Outcome
preflight.run.with_human_context / contract_update.run.with_human_context が、既存の authority_category == human_review_directive かつ explicit directive かつ with_human_context かつ trusted principal(既存 human_review_directive predicate が扱う trust 範囲。OWNER/MEMBER/COLLABORATOR を含み、#2620 固有の OWNER-only 新設ポリシーは導入しない)かつ same-target/provenance/anchor binding valid という 既存 predicate の組み合わせだけを eligibility の SSOT として、safe section-bound patch representation が存在しない substantive contract feedback を検出した場合に、preflight / contract_update 自身が controlled transaction を実行するのではなく、writes=0 のまま既存 NEXT_ACTION: issue_editor_required を返す状態にする。
issue_editor_required を受け取った root/main thread が、既存 issue-editor SubAgent を issue_number + canonical reviewer_feedback_url(anchor comment の URL。raw anchor_comment.snapshot 本文を reviewer_feedback_text として転送しない)で起動する。candidate body の意味論的生成は issue-editor、mutation/precondition/readback は既存 edit_issue_txn.py、rewrite 後の authorization は既存 fresh preflight/review/readiness gate、という現在の責務分割(control-plane routing と data-plane mutation の分離)を維持する。
Runtime Verification Applicability
- decision: immediate
- reason: 本 Issue の Allowed Paths が
.claude/skills/issue-refinement-loop/SKILL.mdおよび.claude/skills/issue-refinement-loop/scripts/**を含み、docs/dev/extension-surface-runtime-policy.yamlのskill-invocation-procedure-or-contract-change/subagent-lifecycle-start-stop-delegation-fallbackrule(default_decision: immediate)に一致するため、静的検証だけでは不十分であり、realrun_preflight()の production-reachable path を通した確認が必要。
applicable_acs: AC1, AC6
execution_environment: repo checkout 内でuv run pytestを実行できるローカル/CI 環境。外部ネットワーク・live GitHub API 呼び出し・実 GitHub write は不要(deterministic fixture のみ)。
skip_conditions:uv/ pytest 実行環境が利用できない場合は SKIP(exit 77)とし、test-runner が Stop Condition を発火して人間にエスカレーションする。
fallback_policy: fallback 経由でのみissue_editor_requiredに到達した結果、または_*_fallback: trueを含む結果は PASS として扱わず FAIL とする。
artifact_requirements: test-runner が realrun_preflight()実行の stdout/exit code ログをartifacts/<issue_number>/runtime-verification/配下に保存し、PR## Runtime Verification Evidenceセクションに redact 済み要約(NEXT_ACTION値、mutation 回数、PASS/FAIL/SKIP のみ。raw stdout 全文や secret は貼らない)を引用する。
Background
#2619 の refinement で control-plane gap を確認した。preflight.run.with_human_context は trusted direct human context の substantive contract feedback を認識しても、既存の section-bound CONTRACT_PATCH_PLAN_V1 生成(decide_scope_reframe_contract_route())でも表現できず、かつ既存の承認済み scope-reframe full-rewrite route にも該当しない場合、contract_update.run.with_human_context は PLANNER_FAIL_CLOSED、writes=0 で停止する。
最小案は、既存の human-context provenance・anchor binding・fail-closed 判定を通過した substantive feedback だけを、既存 NEXT_ACTION: issue_editor_required の eligibility 拡張として検出し、control-plane(preflight/contract_update)は writes=0 のまま routing 判定だけを返すこととする。preflight が edit_issue_txn.py を直接呼び出す実装、または新しい editor transaction route を作る実装は既存の control-plane/data-plane 分離を破るため採用しない。root/main thread が issue_editor_required を受けて既存 issue-editor SubAgent を起動する既存パターンをそのまま再利用する。
運用上 #2619 の暫定例外として direct issue-editor 更新を行った案は一般化・恒久 route にしない。raw mutation や新しい parser/executor/security machinery、新しい substantive feedback 判定 heuristic/classifier を追加する案は、より広い権限・schema surface を増やすため採用しない。
関連根拠: #2619、anchor comment https://github.com/squne121/loop-protocol/issues/2619#issuecomment-5615784499、review anchor comment https://github.com/squne121/loop-protocol/issues/2620#issuecomment-5616372032、`run_refinement_preflight.py:8557-8712`、`decide_rewrite_route.py` の decide_scope_reframe_contract_route()(約800行目)。
In Scope
preflight.run.with_human_context/contract_update.run.with_human_contextの既存 human-context lane 内に、safe section-bound patch representation が存在しない explicit trustedhuman_review_directiveを検出した場合に既存NEXT_ACTION: issue_editor_requiredを返す最小の明示 routing 判定を追加する(decide_rewrite_route.pyの routing SSOT を拡張し、run_refinement_preflight.pyにのみ ad-hoc な分岐を追加して routing SSOT を二重化しない)。- eligibility 判定は新しい classifier/heuristic を作らず、既存の
authority_category == human_review_directive、explicit directive confidence、with_human_context、trusted principal(既存 predicate の trust 範囲をそのまま使用)、same-target/provenance/anchor binding valid、という既存 predicate の組み合わせだけを使う。 - route の入口で既存の trusted direct human-context provenance、target issue/anchor URL/body binding、fresh precondition/readback を要求し、満たせない場合は
issue_editor_requiredを返さず既存 fail-closed のままwrites=0にする。 - scope reframe/freeform exact allowed-path delta 専用の
CONTRACT_PATCH_PLAN_V1生成に依存しない handoff 判定を実現する。ただし既存 section-bound patch route・既存 scope-reframe full-rewrite route の意味・validation・fail-closed 挙動は変更しない(regression させない)。 issue_editor_requiredの handoff payload として canonicalreviewer_feedback_urlを伝搬する経路を保証する(raw anchor comment body をreviewer_feedback_textとして転送しない)。.claude/skills/issue-refinement-loop/SKILL.mdおよび.claude/skills/issue-refinement-loop/references/loop-state.mdのissue_editor_required記述を、「approved scope reframe + empty operations[] 限定」から「既存 section-bound patch derivation でも表現不能で、かつ既存 scope-reframe full-rewrite route にも該当しない explicit trusted human_review_directive を含む」に更新する。- focused deterministic regression を追加し、既存 controlled editor transaction は injected callback/fixture で観測し、raw GitHub mutation を行わない。real
run_preflight()の production-reachable path から result/stdout のNEXT_ACTION: issue_editor_requiredまでを少なくとも1本、fixture/deterministic 環境で確認する。
Out of Scope
- raw
ghmutation、edit_issue_txn.pyを含む issue-editor executor、parser、publisher、security harness の変更。 - 新たな receipt、ledger、state schema、または既存 schema のキー集合変更。
- 新しい substantive contract feedback 判定 classifier/heuristic の新設(既存
human_review_directivepredicate の組み合わせ以外の判定ロジックを追加しない)。 - 実装: trusted human contract feedback を controlled editor handoff に接続する #2620 固有の OWNER-only trust ポリシーの新設(既存
human_review_directiveの trust 範囲を維持する)。 - 巨大な新規 E2E harness、live GitHub 書き込みを伴う test の追加。
- 実装: Contract Snapshot publish の transport round-trip と PATCH reconciliation を修正する #2619 の Contract Snapshot transport/PATCH reconciliation、canonical parser の実装または修正。
- 実装: Contract Snapshot publish の transport round-trip と PATCH reconciliation を修正する #2619 の暫定例外として行う direct issue-editor 更新への依存、再利用、またはその例外の恒久化。
- trusted human-context provenance、anchor binding、fail-closed semantics の緩和、曖昧な自由文からの自動 body rewrite。
preflight/contract_update自身がissue-editorSubAgent またはedit_issue_txn.pyを直接起動・実行すること(control-plane は routing 判定のみを行い、実行は root/main thread に委ねる)。
Acceptance Criteria
- AC1: safe section-bound patch representation が存在しない explicit trusted
human_review_directive(既存 predicate:authority_category == human_review_directiveかつ explicit directive かつwith_human_contextかつ trusted principal かつ same-target/provenance/anchor binding valid)が検出された場合、preflight.run.with_human_context/contract_update.run.with_human_contextは controlled transaction を自ら実行せず、writes=0 のまま既存NEXT_ACTION: issue_editor_requiredを返す。route input には同一 target issue と canonicalreviewer_feedback_url(raw anchor comment body ではない)が含まれる。 - AC2: 既存の section-bound patch representation が存在しない(=
CONTRACT_PATCH_PLAN_V1を section-bound patch として安全に生成できない)valid な explicit trusted human directive でも、新しい patch plan を捏造せず AC1 のissue_editor_requiredに到達できる。 - AC3: untrusted human context、invalid anchor、target issue または anchor URL/body の mismatch、provenance 不一致はすべて fail-closed のまま
writes=0であり、issue_editor_requiredroute を選ばない。 - AC4: 曖昧な自由文または既存 predicate の組み合わせで trusted explicit human_review_directive と判定できない入力は fail-closed のまま
writes=0であり、自動 body rewrite もissue_editor_requiredへの到達も行わない。 - AC5: 既存
CONTRACT_PATCH_PLAN_V1scope-reframe full-rewrite route および existing section-bound / freeform exact allowed-path-delta route の validation と fail-closed behavior は regression しない。 - AC6:
focused deterministic tests は、helper/callback 単体テストに加えて realrun_preflight()の production-reachable path から result/stdout のNEXT_ACTION: issue_editor_requiredに到達すること、および preflight 自体の mutation 回数が0回であることを確認する。AC3/AC4 の negative case も fixture callback で検証し、raw GitHub mutation・巨大な新規 E2E/live GitHub harness は追加しない。
Verification Commands
# AC1
$ uv run pytest .claude/skills/issue-refinement-loop/tests/test_preflight_run_with_anchor.py
$ uv run pytest .claude/skills/issue-refinement-loop/tests/test_decide_rewrite_route_human_review_directive.py# AC2
$ uv run pytest .claude/skills/issue-refinement-loop/tests/test_decide_rewrite_route_human_review_directive.py# AC3
$ uv run pytest .claude/skills/issue-refinement-loop/tests/test_preflight_run_with_anchor.py# AC4
$ uv run pytest .claude/skills/issue-refinement-loop/tests/test_preflight_run_with_anchor.py# AC5
$ uv run pytest .claude/skills/issue-refinement-loop/tests/test_scope_delta_authority_e2e.py# AC6
$ uv run pytest .claude/skills/issue-refinement-loop/tests/test_preflight_run_with_anchor.py -k "production_reachable or issue_editor_required"Allowed Paths
.claude/skills/issue-refinement-loop/SKILL.md.claude/skills/issue-refinement-loop/references/loop-state.md.claude/skills/issue-refinement-loop/scripts/decide_rewrite_route.py.claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py.claude/skills/issue-refinement-loop/tests/test_preflight_run_with_anchor.py.claude/skills/issue-refinement-loop/tests/test_scope_delta_authority_e2e.py.claude/skills/issue-refinement-loop/tests/test_decide_rewrite_route_human_review_directive.py
Stop Conditions
- 動作検証 AC の VC が SKIP(exit 77)を返した場合(実行環境不可のためエスカレーション)
- fallback 経由でのみ「成功」する場合(FAIL として扱い、実行環境を確認)
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
run_refinement_preflight.pyに ad-hoc な分岐を追加しないと実現できず、decide_rewrite_route.pyの routing SSOT を二重化せざるを得ないと判明した場合- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
Required Skills
なし
Required Design References
docs/dev/agent-skill-boundaries.md.claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py:8557-8712.claude/skills/issue-refinement-loop/scripts/decide_rewrite_route.py(decide_scope_reframe_contract_route()、約800行目).claude/skills/issue-refinement-loop/scripts/scope_signal_delta.py(run_trusted_anchor_iteration_zero()).claude/agents/issue-editor.md.claude/skills/edit-issue/scripts/edit_issue_txn.py
Scope Delta(任意)
N/A
Notes for Reviewer
- Source: 実装: Contract Snapshot publish の transport round-trip と PATCH reconciliation を修正する #2619 refinement anchor comment https://github.com/squne121/loop-protocol/issues/2619#issuecomment-5615784499、および 実装: trusted human contract feedback を controlled editor handoff に接続する #2620 review anchor comment https://github.com/squne121/loop-protocol/issues/2620#issuecomment-5616372032(REQUEST CHANGES、BLOCKER/HIGH/MEDIUM 指摘を本 Issue に反映済み)。
- Architecture: control-plane(
preflight/contract_update)は routing 判定のみを行い writes=0 を維持する。実際の Issue body mutation は既存issue-editorSubAgent と既存edit_issue_txn.pycontrolled transaction に委譲する。preflight が transaction を直接実行する実装は採用しない。 - routing priority(既存 route を上書きしない優先順位):
- existing section-bound
CONTRACT_PATCH_PLAN_V1で安全に表現可能 → existing contract-update route - existing approved scope-reframe full-rewrite(
operations: [])→ existingissue_editor_required - explicit trusted
human_review_directive(binding valid、safe patch representation unavailable)→issue_editor_required、preflight writes=0(本 Issue の新規 eligibility) - ambiguous/untrusted/invalid binding → 既存 fail-closed
- existing section-bound
- eligibility 判定に新しい heuristic/classifier を導入しない。既存
human_review_directivepredicate の trust 範囲(OWNER/MEMBER/COLLABORATOR を含む)をそのまま使い、実装: trusted human contract feedback を controlled editor handoff に接続する #2620 固有の OWNER-only ポリシーは作らない。 - handoff payload は raw
anchor_comment.snapshotをreviewer_feedback_textとして転送せず、canonicalreviewer_feedback_urlを渡す。 run_refinement_preflight.pyにのみ ad-hoc な分岐を追加して routing SSOT を二重化する実装にはしない。routing SSOT はdecide_rewrite_route.pyに一本化する。- 実装: Contract Snapshot publish の transport round-trip と PATCH reconciliation を修正する #2619 との分離は維持する。実装: Contract Snapshot publish の transport round-trip と PATCH reconciliation を修正する #2619 の Contract Snapshot transport/PATCH reconciliation は本 Issue に取り込まない。
- Scope Collision (C1, advisory): 実装: #1939 Workstream 4 — retrospective candidate を issue-refinement-loop → impl-review-loop へ controlled handoffする #2602、実装: workflow trusted signalsとIssue/PR Task equivalenceをTask Contextへ統合する #2565、実装: run_refinement_preflight.py の結果に decisions フィールドを出力しSKILL.mdとのSSOT乖離を解消する #1556、実装: fix(issue-refinement-loop): no-human-approval autonomy mode を loop state routing に明示する #1007、実装: issue-refinement-loop の preflight result から LOOP_STATE を生成する route wrapper を追加し CLI/schema 迷走を防ぐ #1006、feat(agent-ops): issue-contract-fixer SubAgent を追加し、LLM rewrite 前に deterministic contract repair を完了させる #998、feat(issue-refinement-loop): LOOP_ITERATION_CAPSULE_V1 を導入し、raw body / raw log の main context 流入を禁止する #997、実装: issue-refinement-loop の rewrite routing が既存 blocker contract を consume して non-body-author-fixable blocker を早期停止できるようにする #944、test: scope_signal_guard termination の publisher-level 回帰テストを追加する #926 が
run_refinement_preflight.pyまたは focused test paths を広く宣言する。edit intent は trusted direct human feedback の controlled editor handoff に限定され、各 Issue の別 concern と統合しない。実装開始時に current-main と open PR を再確認し、競合する unmerged edit があれば停止する。
Delivery Rule
1 Issue = 1 PRを原則とする。- worktree を切って作業し、Draft PR を既定とする。
Activity
squne121 commentedon Sep 10, 2026
結論
#2620 は
REQUEST CHANGES相当です。 問題設定自体は妥当で、#2619 から transport/PATCH 問題を分離したのも正しいです。ただし現在の契約には、実装者がrun_refinement_preflight.pyから直接edit_issue_txn.pyを呼ぶ実装に進めてしまう余地があります。これは既存 architecture と衝突します。このリポジトリでは、orchestrator は control-plane の routing に限定し、Issue 本文編集は
issue-editorSubAgent に委譲するのが既存 SSOT です。issue-editorはすでにissue_number + reviewer_feedback_url | reviewer_feedback_textを受け取り、candidate body を生成して既存 controlled transaction に渡せます。したがって #2620 で作るべきものは新しい editor transaction route ではなく、既存
NEXT_ACTION: issue_editor_requiredの eligibility 拡張です。敵対的レビュー
Severity | 指摘 | 問題 | 推奨 -- | -- | -- | -- BLOCKER | handoff の終点が曖昧 | Issue は「existing issue-editor controlled transaction へ handoff」と書いていますが、preflight が transaction を直接実行するのか、issue-editor へ routing するのか固定されていません。前者だと control-plane/data-plane 分離を破ります。 | preflight は writes=0 のまま NEXT_ACTION: issue_editor_required を返すだけにする。main-thread が issue-editor(issue_number, reviewer_feedback_url=anchor_url) を起動する。 BLOCKER | Allowed Paths に SKILL.md がない | 現行 SKILL.md は issue_editor_required を「approved scope reframe + empty operations」に限定して説明しています。#2620 が別種の feedback に拡張すると正本が即座に stale になります。 | .claude/skills/issue-refinement-loop/SKILL.md を Allowed Paths に追加。references/anchor-comment-handling.md も route semantics を更新するなら追加。 HIGH | Current Validated Scope の前提が正確でない | 「CONTRACT_PATCH_PLAN_V1 は scope reframe / exact allowed-path delta からしか生成されない」は広すぎます。既存コードは revised acceptance criteria 等を contract section marker として認識し、Acceptance Criteria の section patch を生成できます。 | gap を「既存の section-bound patch derivation でも表現不能で、既存 scope-reframe full-rewrite route にも該当しない explicit human contract directive」に限定する。 HIGH | substantive contract feedback が型付けされていない | 新しい heuristic を preflight に入れれば Out of Scope の parser/classifier 変更になります。単なる長文レビューや箇条書きを誤って body rewrite authority にできます。 | 新 classifier は作らず、既存の authority_category == human_review_directive、explicit directive、with_human_context、same-target binding を eligibility の SSOT にする。 HIGH | direct owner feedback が既存 trust model より狭い | #2086 系では human review directive は trusted OWNER/MEMBER/COLLABORATOR を既存カテゴリとして扱っています。#2620 だけ OWNER-only にすると隠れた二重ポリシーになります。 | 既存 human_review_directive predicate をそのまま再利用。OWNER-only に変えるなら「意図的な trust-policy change」と明文化する。 HIGH | raw feedback の handoff 方法が未固定 | 既存ルールは raw anchor_comment.snapshot を Step 4 の reviewer_feedback_text に流すことを明示的に禁止しています。 | raw body ではなく canonical reviewer_feedback_url を渡す。これなら issue-editor が fresh source を読み直せます。 MEDIUM | AC6 が callback-only false-green になり得る | #2048/PR #2057 では helper-level test が production reachability を証明できない問題を実際に踏み、最終的に canonical path E2E まで追加しています。 | 新しい巨大 E2E harness は不要。ただし real run_preflight() → result/stdout の issue_editor_required までは通し、contract-patch mutation が0回であることを確認する。 MEDIUM | freshness 責務が重複しそう | #2583 は source anchor を transaction dispatch 直前に再取得して identity/revision を検証する既存先例があります。editor transaction 自体も precondition/readback を所有しています。 | preflight は human-context provenance + anchor binding まで。current Issue body の stale-write 防止/readback は既存 editor transaction、rewrite 後の authorization は既存 fresh preflight/review/readiness gate に任せる。推奨する routing
実装の中心はこの程度に抑えるのがよいです。
issue_editor_requiredを受けた root/main thread が、canonical anchor URL をreviewer_feedback_urlとして既存issue-editorに渡す。candidate body の意味論的生成は issue-editor、mutation/precondition/readback はedit_issue_txn.py、その後の fresh gate は既存 refinement loop、という現在の責務分割を維持します。これなら #2620 の Out of Scope に書かれている「parser/executor/security harness を増やさない」「曖昧な自由文を自動 rewrite しない」にも整合します。
WEB側の仕様確認
GitHub 側にも追加機構は不要です。GitHub REST の issue-comment GET は
comment_idによる直接取得ができ、response にhtml_url、raw Markdownbody、updated_at、issue_url、author_associationが含まれます。つまり現在使っている anchor identity / target binding / freshness 確認の材料は公式 API だけで十分あります。(GitHub Docs)また GitHub CLI の
gh issue editは--body-fileを正式に提供しています。したがって、既存 controlled executor の上に ETag/CAS service、approval ledger、別 publisher、permission service を追加する技術的理由は見当たりません。(GitHub CLI)個人趣味開発という前提なら、セキュリティ機構を増やすより「既存 trust classification → 既存 routing → 既存 issue-editor → 既存 transaction」を一本化する方が品質と完走率の双方に効きます。#2619 の元レビューも、同じ思想で新 parser・receipt・permission/security harness・mandatory live GitHub test を増やさない方針でした。
#2620 に入れる最小修正
Issue body は大規模に書き直す必要はなく、次の6点で十分です。
Outcome/AC1 を「controlled transaction を preflight が実行する」ようにも読める表現から、
NEXT_ACTION: issue_editor_requiredを返す control-plane handoff に変更する。SKILL.mdを Allowed Paths に追加し、issue_editor_requiredの eligibility が scope reframe 限定ではなくなったことを正本へ反映する。Current Validated Scope の
CONTRACT_PATCH_PLAN_V1に関する記述を、existing section-bound patch でも表現できない feedback に限定して修正する。substantive contract feedbackの判定を新 heuristic にせず、既存human_review_directive + explicit + with_human_context + same-target bindingに固定する。handoff payload は raw comment body ではなく canonical
reviewer_feedback_urlとする。AC6 は real
run_preflight()でNEXT_ACTION: issue_editor_required/ preflight writes=0 /既存 patch route非回帰を確認する。新しい live GitHub test や agent-guard subsystem は追加しない。この修正後なら、APPROVE にかなり近い narrow workflow fix です。現在の最大の問題は安全性不足ではなく、既存
## 結論issue_editor_requiredを再利用するのか、それとは別に transaction を呼ぶのかが契約上固定されていないことです。そこを一本化するのが最優先です。#2620 は
REQUEST CHANGES相当です。 問題設定自体は妥当で、#2619 から transport/PATCH 問題を分離したのも正しいです。ただし現在の契約には、実装者がrun_refinement_preflight.pyから直接edit_issue_txn.pyを呼ぶ実装に進めてしまう余地があります。これは既存 architecture と衝突します。このリポジトリでは、orchestrator は control-plane の routing に限定し、Issue 本文編集は
issue-editorSubAgent に委譲するのが既存 SSOT です。issue-editorはすでにissue_number + reviewer_feedback_url | reviewer_feedback_textを受け取り、candidate body を生成して既存 controlled transaction に渡せます。したがって #2620 で作るべきものは新しい editor transaction route ではなく、既存
NEXT_ACTION: issue_editor_requiredの eligibility 拡張です。敵対的レビュー
issue-editorへ routing するのか固定されていません。前者だと control-plane/data-plane 分離を破ります。NEXT_ACTION: issue_editor_requiredを返すだけにする。main-thread がissue-editor(issue_number, reviewer_feedback_url=anchor_url)を起動する。SKILL.mdがないSKILL.mdはissue_editor_requiredを「approved scope reframe + empty operations」に限定して説明しています。#2620 が別種の feedback に拡張すると正本が即座に stale になります。.claude/skills/issue-refinement-loop/SKILL.mdを Allowed Paths に追加。references/anchor-comment-handling.mdも route semantics を更新するなら追加。CONTRACT_PATCH_PLAN_V1は scope reframe / exact allowed-path delta からしか生成されない」は広すぎます。既存コードはrevised acceptance criteria等を contract section marker として認識し、Acceptance Criteriaの section patch を生成できます。substantive contract feedbackが型付けされていないauthority_category == human_review_directive、explicit directive、with_human_context、same-target binding を eligibility の SSOT にする。direct owner feedbackが既存 trust model より狭いOWNER/MEMBER/COLLABORATORを既存カテゴリとして扱っています。#2620 だけ OWNER-only にすると隠れた二重ポリシーになります。human_review_directivepredicate をそのまま再利用。OWNER-only に変えるなら「意図的な trust-policy change」と明文化する。anchor_comment.snapshotを Step 4 のreviewer_feedback_textに流すことを明示的に禁止しています。reviewer_feedback_urlを渡す。これなら issue-editor が fresh source を読み直せます。run_preflight()→ result/stdout のissue_editor_requiredまでは通し、contract-patch mutation が0回であることを確認する。推奨する routing
実装の中心はこの程度に抑えるのがよいです。
issue_editor_requiredを受けた root/main thread が、canonical anchor URL をreviewer_feedback_urlとして既存issue-editorに渡す。candidate body の意味論的生成は issue-editor、mutation/precondition/readback はedit_issue_txn.py、その後の fresh gate は既存 refinement loop、という現在の責務分割を維持します。これなら #2620 の Out of Scope に書かれている「parser/executor/security harness を増やさない」「曖昧な自由文を自動 rewrite しない」にも整合します。
WEB側の仕様確認
GitHub 側にも追加機構は不要です。GitHub REST の issue-comment GET は
comment_idによる直接取得ができ、response にhtml_url、raw Markdownbody、updated_at、issue_url、author_associationが含まれます。つまり現在使っている anchor identity / target binding / freshness 確認の材料は公式 API だけで十分あります。([GitHub Docs]1)また GitHub CLI の
gh issue editは--body-fileを正式に提供しています。したがって、既存 controlled executor の上に ETag/CAS service、approval ledger、別 publisher、permission service を追加する技術的理由は見当たりません。([GitHub CLI]2)個人趣味開発という前提なら、セキュリティ機構を増やすより「既存 trust classification → 既存 routing → 既存 issue-editor → 既存 transaction」を一本化する方が品質と完走率の双方に効きます。#2619 の元レビューも、同じ思想で新 parser・receipt・permission/security harness・mandatory live GitHub test を増やさない方針でした。
#2620 に入れる最小修正
Issue body は大規模に書き直す必要はなく、次の6点で十分です。
NEXT_ACTION: issue_editor_requiredを返す control-plane handoff に変更する。SKILL.mdを Allowed Paths に追加し、issue_editor_requiredの eligibility が scope reframe 限定ではなくなったことを正本へ反映する。CONTRACT_PATCH_PLAN_V1に関する記述を、existing section-bound patch でも表現できない feedback に限定して修正する。substantive contract feedbackの判定を新 heuristic にせず、既存human_review_directive + explicit + with_human_context + same-target bindingに固定する。reviewer_feedback_urlとする。run_preflight()でNEXT_ACTION: issue_editor_required/ preflight writes=0 /既存 patch route非回帰を確認する。新しい live GitHub test や agent-guard subsystem は追加しない。この修正後なら、APPROVE にかなり近い narrow workflow fix です。現在の最大の問題は安全性不足ではなく、既存
issue_editor_requiredを再利用するのか、それとは別に transaction を呼ぶのかが契約上固定されていないことです。そこを一本化するのが最優先です。squne121 commentedon Sep 10, 2026
推奨アクション
#2620 は、このコメントを
operator_asserted_human_contextとして採用し、Issue本文を in-place refinement するのが妥当です。対象コメントは #2620 に属する OWNER コメントで、run_refinement_preflight.pyが transaction を直接呼ぶ設計を否定し、NEXT_ACTION: issue_editor_requiredの eligibility 拡張へ契約を修正するよう明示しています。特に、コメント記載の6点だけでなく、current-main では
references/loop-state.mdもissue_editor_requiredを「approved scope reframe + empty operations[]」に限定しています。さらにdecide_rewrite_route.py自体も同じ前提で full-body-rewrite fallback を定義しています。したがって まず codebase-investigator に実際の routing SSOT を確認させ、必要なら #2620 の Allowed Paths をその最小集合まで拡張するべきです。run_refinement_preflight.pyだけに局所分岐を追加して SSOT を二重化するのは避けるべきです。また
issue-editorは既にissue_number + reviewer_feedback_urlを正式入力として持ち、本文 mutation を controlled executor に委譲する責務分割になっています。root/main thread が本文を書き換えたりedit_issue_txn.pyを直接呼ぶ必要はありません。以下を、そのまま既に auto mode の Claude Code に投入するのを推奨します。
Issue #2620 を、以下の anchor comment を direct human context として扱い、
.claude/skills/issue-refinement-loopで refinement 完了まで進めてください。Target Issue:
#2620
Anchor comment:
#2620 (comment)
この対話プロンプトは operator からの明示的な direct human instruction です。
対象 anchor は
operator_asserted_human_contextとしてpreflight.run.with_human_contextlane で処理してください。with_agent_reportや unlabeledwith_anchorとして扱わないでください。既に Claude Code は auto mode で起動済みです。
通常の refinement iteration、調査、レビュー、Issue本文修正について人間承認を求めず自動継続してください。
ただし Claude Code 自体の permission mode を変更したり、dangerous permission bypass flag を追加したりしないでください。
repository の canonical workflow / skill contract は維持してください。
Operator decisions
anchor comment の REQUEST CHANGES と推奨方向を採用します。
#2620 は新規 Issue へ分割せず、現在の Issue を in-place refinement してください。
architecture の決定は以下で固定します。
preflight.run.with_human_contextは Issue body mutation を直接実行しない。writes=0のままNEXT_ACTION: issue_editor_requiredを返す control-plane handoff とする。NEXT_ACTION: issue_editor_requiredを受けた root/main thread が既存issue-editorSubAgent を起動する。issue-editorにはissue_number: 2620と、この canonical anchor URLをreviewer_feedback_urlとして渡す。anchor_comment.snapshotをreviewer_feedback_textとして転送しない。issue-editor、mutation/precondition/readback は既存 controlled transaction の責務とする。run_refinement_preflight.pyからedit_issue_txn.pyを直接実行する新 route は作らない。eligibility は新 heuristic を作らず、既存 trust/authority model を再利用してください。
authority_category == human_review_directiveexplicitwith_human_contextOWNER-only の新しい trust policy は作らず、current-main の既存
human_review_directivepredicate を SSOT としてください。routing priority は概ね次を維持してください。
existing section-bound
CONTRACT_PATCH_PLAN_V1で安全に表現可能→ existing contract-update route
existing approved scope-reframe full-rewrite case
→ existing
issue_editor_requiredexplicit trusted
human_review_directive→
issue_editor_required→ preflight writes=0
ambiguous / untrusted / invalid anchor / binding mismatch
→ existing fail-closed
→ writes=0
Investigation — SubAgent required
最初に
codebase-investigatorSubAgent を使って current-main を read-only 調査してください。SubAgent の完了を必ず待ってから、その結果を main thread で consume してください。
最低限、次を確認してください。
.claude/skills/issue-refinement-loop/SKILL.md.claude/skills/issue-refinement-loop/references/loop-state.md.claude/skills/issue-refinement-loop/references/anchor-comment-handling.md.claude/skills/issue-refinement-loop/references/scope-signal-guard.md.claude/skills/issue-refinement-loop/scripts/run_refinement_preflight.py.claude/skills/issue-refinement-loop/scripts/decide_rewrite_route.py.claude/skills/issue-refinement-loop/scripts/scope_signal_delta.py.claude/agents/issue-editor.md.claude/skills/edit-issue/scripts/edit_issue_txn.py特に、
issue_editor_requiredの eligibility / reason code / routing semantics の production SSOT がどこにあるかを確認してください。anchor comment は
SKILL.mdの Allowed Paths 追加を指摘していますが、current-main のreferences/loop-state.mdや routing helper も scope-reframe-only semantics を持っている可能性があります。必要な場合は、Issue #2620 の Allowed Paths を「今回の narrow eligibility 拡張を一貫して実装・文書化・検証するための最小 SSOT集合」に更新してください。
これは今回の owner-approved refinement scope 内の修正として扱い、単に現在の Allowed Paths 外だからという理由だけで human escalation しないでください。
ただし unrelated subsystem まで広げないでください。
たとえば調査結果次第では以下が候補です。
.claude/skills/issue-refinement-loop/SKILL.md.claude/skills/issue-refinement-loop/references/loop-state.md.claude/skills/issue-refinement-loop/references/anchor-comment-handling.md.claude/skills/issue-refinement-loop/scripts/decide_rewrite_route.py実際に必要かどうかは current-main の production call path を確認して決めてください。
run_refinement_preflight.pyにだけ ad-hoc branch を追加して routing SSOT を二重化する実装にはしないでください。Issue contract refinement
anchor comment の指摘を Issue body に反映してください。
特に以下を明確化してください。
Outcome / AC1:
controlled transaction の直接実行ではなく
NEXT_ACTION: issue_editor_requiredを返す control-plane handoff であること。Current Validated Scope:
gap を「CONTRACT_PATCH_PLAN_V1 が scope reframe / allowed-path delta しか扱えない」と広く表現しない。
existing section-bound patch derivation でも表現不能で、既存 scope-reframe full-rewrite route にも該当しない explicit trusted human contract directive に限定する。
AC2:
section-bound safe patch representation が存在しない explicit trusted human directive でも、新しい patch plan を捏造せず
issue_editor_requiredに到達すること。AC3/AC4:
untrusted、ambiguous、invalid/mismatched binding は従来どおり fail-closed / writes=0。
AC5:
existing contract-patch route と existing approved-scope-reframe route を regression させない。
AC6:
helper callback 単体だけでなく real
run_preflight()production-reachable path からresult/stdout の
NEXT_ACTION: issue_editor_requiredまで確認する。preflight mutation が0回であることも確認する。
巨大な新規E2E/live GitHub harness は追加しない。
handoff payload:
raw feedback text ではなく canonical
reviewer_feedback_url。trust:
current-main の existing
human_review_directivepredicate を再利用し、実装: trusted human contract feedback を controlled editor handoff に接続する #2620 固有の OWNER-only policy は新設しない。#2619 の Contract Snapshot transport/PATCH reconciliation は引き続き別 scope とし、#2620 に取り込まないでください。
Rewrite execution
canonical refinement result が
issue_editor_requiredを返した場合、root/main thread 自身で Issue body を編集しないでください。issue-editorSubAgent を起動し、を渡してください。
issue-editorの完了を必ず待ってください。その compact result / readback を受け取ってから次の fresh preflight / review に進んでください。
SubAgent を fire-and-forget にしないでください。
起動した全 SubAgent は、main thread が次の routing decision を行う前に completion join してください。
nested SubAgent delegation は行わず、必要な sequential orchestration は root/main thread が担当してください。
planner が web research を必要と判定した場合は
web-researcherSubAgent を使用し、その完了も待ってからレビューへ進んでください。canonical Step 2 が root-owned review pipeline である場合、legacy
issue-reviewerSubAgent を独自に追加して二重レビュー経路を作らないでください。Loop policy
needs-fix が残る限り、skill の canonical iteration policy に従って自動継続してください。
各 iteration で人間承認を求めないでください。
rewrite 後は必ず fresh Issue body / anchor state を取得し、fresh preflight → review/readiness を再実行してください。
mutation 前の approval/readiness を再利用しないでください。
target comment の指摘を表面的に文章へ追記するだけではなく、Outcome / Scope / AC / Allowed Paths / Verification Commands / Notes が互いに矛盾しない状態まで refinement してください。
Stop policy
通常の needs-fix、Issue本文更新、SubAgent dispatch、focused test planningでは停止しないでください。
停止するのは以下のような canonical non-overridable condition のみです。
単なる「人間承認が未取得」は停止理由にしないでください。このプロンプトに記載した Operator decisions は今回の human decision として扱ってください。
Completion condition
Issue #2620 の本文が anchor comment の BLOCKER/HIGH 指摘を解消し、current-main の routing SSOT と整合し、fresh refinement review が implementation-ready と判断できるところまで完了してください。
今回の作業は Issue refinement です。
#2620 の実装、実装用 branch 作成、implementation PR 作成には進まないでください。
最後に簡潔に以下を報告してください。
issue_editor_requiredがどの責務境界として Issue contract に固定されたかこのプロンプトでは、コメントの指摘をそのまま適用するだけでなく、current-main の routing SSOT を調べてから Allowed Paths を確定する点を追加しています。現状の Issue は実装対象を
run_refinement_preflight.pyと一部テストに限定していますが、既存 architecture ではissue_editor_requiredの意味が複数の正本に記載されているため、ここを refinement 時点で整合させるのが重要です。squne121 commentedon Sep 10, 2026
Refinement Loop 完了報告(#2620)
Verdict: approved(implementation-ready)
anchor comment https://github.com/squne121/loop-protocol/issues/2620#issuecomment-5616372032(OWNER, REQUEST CHANGES 相当、
operator_asserted_human_contextとしてpreflight.run.with_human_contextレーンで処理)の BLOCKER×2 / HIGH×5 / MEDIUM×2 指摘をすべて Issue 本文へ反映しました。preflight/contract_updateは writes=0 のままNEXT_ACTION: issue_editor_requiredを返す control-plane handoff に限定し、実行主体(issue-editorSubAgent + 既存edit_issue_txn.py)を root/main thread 側に明確化。decide_rewrite_route.py::decide_scope_reframe_contract_route()、references/loop-state.md)に基づき、SKILL.md/references/loop-state.md/decide_rewrite_route.py/ 新規 focused test を追加。run_refinement_preflight.pyへの ad-hoc 分岐でSSOTを二重化しないことを Stop Conditions/Notes に明記。CONTRACT_PATCH_PLAN_V1が生成可能な範囲を正確化し、gap を「既存 section-bound patch derivation でも表現不能かつ既存 scope-reframe full-rewrite route にも非該当な explicit trusted human_review_directive」に限定。run_preflight()production-reachable path + preflight mutation回数0の確認をAC6に明記。human_review_directivepredicate(OWNER/MEMBER/COLLABORATOR含む既存trust範囲)を再利用。#2620固有のOWNER-only新設なし。reviewer_feedback_urlに固定、raw snapshotは転送しない。Allowed Paths 拡張の結果、
docs/dev/extension-surface-runtime-policy.yamlの risk-trigger policy(skill-invocation-procedure-or-contract-change/subagent-lifecycle-start-stop-delegation-fallback、default_decision: immediate)に一致したため、Runtime Verification Applicability をimmediateに更新し、必須フィールド(applicable_acs/execution_environment/skip_conditions/fallback_policy/artifact_requirements)と対応 Stop Conditions を追加しています。Fix_delta 1周: 初回 rewrite で Allowed Paths の1エントリ(
anchor-comment-handling.md)に条件付き注釈がpath literalへ結合される不整合を検出し、調査の結果このファイルは本Issueのnarrow scopeで変更確証がないため削除。fresh preflight/review で解消確認済み。Final body_sha256:
sha256:441e17514d9452b54286d07fea132abe30709b698ca791b085e407627092f96cfresh preflight(
preflight.run.with_human_context):STATUS: pass/NEXT_ACTION: proceedfresh Step 2 review(
run_root_review_pipeline.py produce):canonical_step2_route: step_2_5/verdict: approve/blocking_issues: []/ 全 deterministic checks passNote: 本 iteration は operator 指示により Issue refinement のみを対象としており、実装・実装用 branch 作成・implementation PR 作成には進んでいません(
impl-review-loopへの自動 handoffLOOP_HANDOFF_RESULT_V1marker は本コメントでは意図的に出力していません)。実装は別途フェーズとして開始してください。squne121 commentedon Sep 10, 2026
推奨は そのまま #2620 の
impl-review-loopを開始です。refinement は既にapproved (implementation-ready)まで完了しており、直近レポートでも実装フェーズには未着手と明示されています。Issue 契約も、実装の中心を
decide_rewrite_route.pyの routing SSOT 拡張に限定し、run_refinement_preflight.py側だけに ad-hoc 分岐を作らないこと、preflight 自身は writes=0 のままissue_editor_requiredを返すことを固定済みです。 現時点のmainはf36f41a7...で、open PR #2621 は #2619 のimpl-review-loop/scripts/ensure_contract_snapshot.pyとそのテストを変更するものなので、#2620 の Allowed Paths との直接衝突は確認できません。impl-review-loop自体も、root/main thread が control-plane を担当し、Implementation → Verification → PR Review を SubAgent に委譲し、APPROVEと live mergeability を満たすまで循環する設計です。最終approved境界では PR のマージ判断を人間に残します。以下を、既に auto mode で起動している対話的 Claude Code にそのまま投入するのを推奨します。
Issue #2620 を対象に、
.claude/skills/impl-review-loopを使用して、実装・検証・PR作成・PRレビュー・レビュー修正ループを、canonical skill contract に従って実行してください。Target:
#2620
直近の refinement completion report:
#2620 (comment)
Claude Code は既に auto mode で起動済みです。
通常の調査、worktree/branch作成、実装、テスト、commit、push、Draft PR作成、PR本文修正、CI確認、レビュー、レビュー指摘修正、再検証、再レビューについて、人間承認を求めず自律的に継続してください。
ただし
.claude/skills/impl-review-loopおよび live Issue に定義された実 hard stop / human escalation 条件は勝手に無効化しないでください。routine confirmation と canonical hard stop を混同しないでください。
最終停止点は
.claude/skills/impl-review-loopのroute: approved/IMPL_REVIEW_LOOP_RESULT_V1.status: draft_pr_ready相当、すなわち人間が最終マージ判断できる状態です。PR の merge 自体は実行しないでください。
auto-merge も有効化しないでください。
0. Fresh entry / collision check
開始時に必ず live state を再取得してください。
mainHEAD過去の body SHA、contract snapshot、artifact、今回プロンプト記載時点の main SHA を Step 1 authorization として再利用しないでください。
#2620 の Notes に従い、current-main と open PR を fresh に再確認してください。
実際に #2620 の Allowed Paths を変更している unmerged PR があれば、canonical conflict handling に従ってください。
単なる関連 Issue、advisory overlap、別パスの変更だけを理由に停止しないでください。
直近 refinement report
#2620 (comment)
を intake に渡す必要がある場合は
agent_report_comment_urlsとして扱ってください。human_context_comment_urlsとして扱わないでください。以前の review comment
#2620 (comment)
の substantive feedback は既に live Issue body に反映済みです。
実装 authority は fresh live Issue contract を正本にしてください。
1. Root-owned synchronous entry transition
.claude/skills/impl-review-loopの Root-Owned Synchronous Entry Transition を省略しないでください。root/main thread 自身が、一続きの invocation 内で、
issue-contract-reviewまで実行してください。
古い contract snapshot、古い review report、artifact、digest、comment marker だけを implementation entry authorization として使用しないでください。
2. SubAgent execution contract
root/main thread は control-plane / state tracking / routing に徹してください。
各実作業は
.claude/skills/impl-review-loopが規定する SubAgent に委譲してください。少なくとも以下を守ってください。
Step 1:
implementation-workerSubAgent を起動するStep 1 SubAgent の完了を必ず待つ
compact result / actual changed paths / HEAD / PR binding を受領してから次へ進む
Step 2:
test-runnerSubAgent を起動するtest-runner の完了を必ず待つ
VC_ADJUDICATION_RESULT_V1等の canonical result を受領してから次へ進むStep 4:
pr-reviewerSubAgent を起動するpr-reviewer の完了を必ず待つ
verdict/reviewed_head_sha/blockers/warningsを受領してから Step 5 を判定するREQUEST_CHANGES の修正、update_branch、body-only remediation 等を worker に再委譲した場合も、その SubAgent の完了を必ず待つ
SubAgent を fire-and-forget にしないでください。
完了前に次 Step に進まないでください。
root/main thread が SubAgent の作業を横取りして直接実装しないでください。
また、#2620 の Stop Conditions にある
nested SubAgent delegationは避けてください。root/main thread → SubAgent の委譲とし、SubAgent 自身にさらに別 SubAgent を起動させないでください。
3. #2620 implementation constraints
live Issue の Acceptance Criteria / Allowed Paths / Out of Scope を正本として実装してください。
特に以下は必須です。
Routing SSOT
中心となる変更は
.claude/skills/issue-refinement-loop/scripts/decide_rewrite_route.pyの既存 routing SSOT の拡張です。
run_refinement_preflight.pyにだけ ad-hoc な特例分岐を追加して routing SSOT を二重化しないでください。routing priority は既存 contract を維持してください。
existing section-bound
CONTRACT_PATCH_PLAN_V1で安全に表現可能→ existing contract-update route
existing approved scope-reframe full rewrite / empty operations[]
→ existing
issue_editor_requiredsafe section-bound representation が存在しない explicit trusted
human_review_directivewith_human_context→ existing
issue_editor_required→ preflight / contract_update writes = 0
ambiguous / untrusted / invalid binding
→ existing fail-closed
→ writes = 0
既存 route を新 route が横取りしないようにしてください。
Eligibility
新しい semantic classifier / heuristic / parser を作らないでください。
既存の、
authority_category == human_review_directivewith_human_contextの組み合わせだけを eligibility SSOT としてください。
#2620 固有の OWNER-only trust policy を作らないでください。
既存 predicate の OWNER/MEMBER/COLLABORATOR を含む trust model を維持してください。
Handoff
preflight/contract_update自身からedit_issue_txn.pyやissue-editorを直接実行しないでください。control-plane は writes=0 のまま
NEXT_ACTION: issue_editor_requiredを返すだけにしてください。handoff payload は canonical
reviewer_feedback_urlを使用してください。raw
anchor_comment.snapshotbody をreviewer_feedback_textとして転送しないでください。candidate body の semantic generation は既存
issue-editor、mutation / precondition / readback は既存
edit_issue_txn.py、rewrite 後 authorization は fresh refinement gates、
という既存責務分割を維持してください。
Scope
#2619 の Contract Snapshot transport/PATCH reconciliation を #2620 に取り込まないでください。
以下を新設・変更しないでください。
edit_issue_txn.pyAllowed Paths を厳守してください。
Allowed Paths 外の変更が本当に必要なら勝手に scope expansion せず、Issue の Stop Conditions に従ってください。
4. Tests / runtime verification
Issue に記載された Verification Commands をすべて実行してください。
最低限、
test_preflight_run_with_anchor.pytest_decide_rewrite_route_human_review_directive.pytest_scope_delta_authority_e2e.pyを対象にしてください。
新規 focused test file が current-main に存在しない場合は、Allowed Paths 内なので必要に応じて作成してください。
AC6 は helper-only test で済ませないでください。
real
run_preflight()の production-reachable path を通して、NEXT_ACTION: issue_editor_requiredreviewer_feedback_urlpropagationを確認してください。
AC3 / AC4 negative cases について、
が
issue_editor_requiredに到達せず、writes=0 の既存 fail-closed を維持することを確認してください。既存 section-bound patch route、
approved scope-reframe full-rewrite route、
freeform exact allowed-path-delta route
の regression も確認してください。
Runtime Verification Applicability は
immediateです。必要な runtime evidence を
artifacts/2620/runtime-verification/へ保存してください。
PR の
## Runtime Verification Evidenceには、Issue contract に従って redact 済みの、NEXT_ACTIONの要約だけを記載してください。
raw stdout 全文や秘密情報は貼らないでください。
SKIP exit 77 や fallback-only success は PASS とみなさないでください。
5. PR creation
原則
1 Issue = 1 PRとしてください。専用 worktree / branch を使用してください。
既存の #2620 branch / PR が fresh discovery で見つかった場合は重複作成せず canonical resume/rebind を行ってください。
新規作成なら Draft PR を基本とし、PR body に必ず、
Closes #2620を入れてください。
PR description には最低限、
を明示してください。
6. Review loop
PR 作成後に終了しないでください。
Step 2 verification → Step 4 PR review → Step 5 routing を繰り返してください。
pr-reviewerがREQUEST_CHANGESの場合:fix_deltaに変換してください。
reviewed HEAD と current PR HEAD がずれた場合は人間に聞かず current head で re-review してください。
BEHINDの場合は canonicalupdate_branchaction を implementation-worker に委譲し、完了を待ち、その後 verification と PR review を再実行してください。単なる
human_review_required: trueという SubAgent 自己申告だけを routine stop にしないでください。canonical skill の正式な routing result に従ってください。
CI / mergeability の一時的な UNKNOWN、BLOCKED、UNSTABLE 等も、skill が定める bounded retry / current-head re-evaluation を実行し、即座に人間承認へ逃げないでください。
7. Human approval policy
以下については routine human approval を要求しないでください。
auto mode の範囲で自動継続してください。
ただし、live Issue / skill が規定する実 hard stop、
secret/protected-path gate、
actual Git conflict、
permission failure、
明示的 owner veto、
max-iteration 等の canonical escalation 条件が成立した場合は、その事実を隠さず停止してください。
8. Completion condition
以下が揃うまで作業完了扱いにしないでください。
APPROVEblockers == []approved条件を満たすCloses #2620が PR に存在.claude/skills/impl-review-loopの Step 5 がroute: approvedに到達ここまで到達したら、PRをマージせず停止してください。
最後に compact に、
IMPL_REVIEW_LOOP_RESULT_V1を報告してください。
このプロンプトでは、特に 「SubAgent を起動したら必ず join する」「root が実装を横取りしない」「routine な
human_review_required自己申告で止まらない」「最終 merge だけ残す」 を強く固定しています。一方で、#2620 自身や skill が定義する本物の hard stop まで無効化はしていません。これが現在のリポジトリ契約との整合性が最も高い運用です。squne121 commentedon Sep 10, 2026
root-owned entry router audit
route: invoke_impl_review_loop
reason: fresh_review_go_live_equality
squne121 commentedon Sep 10, 2026
implement-issue: 実装完了 (2026-09-10T10:30:12Z)
.claude/worktrees/issue-2620-trusted-human-editor-handoffworktree-issue-2620-trusted-human-editor-handofffix: #2620 human_review_directive handoff の investigation_derived_pat…