Skip to content

実装: impl-review-loop の runtime_only VC adjudication を current-head evidence に安全に接続する #2467

Closed

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: none
goal_ref: "#2432 を変更せず、runtime_only の正規 producer skip を current-head 独立 binding によって安全に nonblocking adjudication できるようにする"
change_kind: code

Parent Issue

none

Parent Goal Ref

Current Validated Scope

  • runtime_only の正規 producer skip を、current-head 独立 binding(Issue / PR / current head / reviewed head / diff head / Issue body digest / declaration-order command hashes / per-command status・exit code / source integrity)に接続する adjudicator とその focused regression tests。
  • Step 2 と test-runner の記述を、runtime_only が baseline skip 単独では Step 4 へ進めず、current-head 独立 binding が必要である最小契約へ整合する範囲。この範囲には .claude/agents/test-runner.md への narrow な uv run [--locked] pytest execution allowance の追加(AC8)を明示的に含む。
  • 実装: pr_review_only VC の current-head adjudication を修正する #1540 / PR fix: pr_review_only VC の current-head 判定を修正する #1544 の pr_review_only 限定先例を保持し、runtime_only をその例外へ拡張しない。

Remaining Parent Gaps

Outcome

.claude/skills/impl-review-loop/scripts/adjudicate_vc_result.py と指定の tests/documentation が、正規 runtime_only producer skip を current-head 独立 binding の下でのみ nonblocking に adjudicate し、baseline skip 単独では Step 4 review に進ませない最小 tooling 成果物として完成し、指定 Verification Commands が PASS する。本 Issue の完了は、この tooling blocker の解消のみを意味し、他 PR の merge readiness を意味しない(下記 Background 参照)。

Runtime Verification Applicability

  • decision: immediate
  • reason: 変更対象の .claude/skills/impl-review-loop/** と .claude/agents/test-runner.md は docs/dev/extension-surface-runtime-policy.yaml が定める runtime-loaded extension surface(skill-invocation-runtime-smoke / subagent-delegation-runtime-smoke)に該当するため、静的検証のみでは完結しない。
  • verification_profile: 同 policy が指定する skill-invocation-runtime-smoke および subagent-delegation-runtime-smoke を用いる。
    applicable_acs: [AC1, AC2, AC8]
    execution_environment: 現在の Claude Code session / repository configuration(新しい credential・新しい外部サービス・権限昇格は使用しない)
    skip_conditions: current-head 独立 binding の再現に必要な adjudicator/test-runner 実装が未着手の間はスキップし、実装 PR 内で smoke を実行する
    fallback_policy: runtime smoke が実行不能な環境では、該当 AC の静的 assertion(procedure_steps_executed/output_contract_schema_fields_present/delegation_target_actually_invoked/permission_mode_effective_behavior_matches_parent_classifier)のみで結論とせず、human_judgment として明示する
    artifact_requirements: 追加の artifact / receipt / publisher を新設せず、既存の test-runner report と orchestrator binding のみを証跡とする
  • scope: bounded runtime smoke は以下 2 経路のみに限定する。
    • 正常経路: 正規 canonical producer envelope(runner=skipped / classification=skipped / category=preflight_scope_runtime_only / decision=go / scope_class=runtime_only / verification_owner=impl-review-loop / 非空 deferred_reason / runtime_verification_required=true)+ current-head 独立 binding が一致する場合、nonblocking で Step 4 へ進むこと。
    • negative 経路: baseline producer の skipped record のみ(上記 envelope 不備、または current-head 独立 binding 不一致)の場合、nonblocking PASS にならず blocking のままであること。

In Scope

  • exact canonical runtime_only producer envelope(runner/classification/category/decision/scope_class/verification_owner/deferred_reason/runtime_verification_required の各正規値)のみを runtime_only delegation candidate の入口として認識する最小の adjudicator 分岐と focused test coverage を追加する。raw marker text(例: Issue 本文中の # preflight-scope: runtime_only コメント)の直接 parse は producer 側の責務とし、adjudicator(consumer)側では行わない。
  • baseline skip を非blocking PASS とみなさず、current-head 独立 binding(Issue / PR / current head / reviewed head / diff head / Issue body digest / declaration-order command hashes / per-command status・exit code / source integrity)の完全性・整合性を満たす場合だけ runtime_only を adjudicate する。
  • artifact / receipt / materialized TEST_VERDICT(存在する場合)は診断用の optional provenance として検証してよいが、その不在自体は nonblocking adjudication の必須入力・blocking condition にしない。current routing authority は test-runner の current-head-bound read-only report を orchestrator が独立に current-head へ binding して生成する VC_ADJUDICATION_RESULT_V1 とする。
  • malformed marker/category/decision/scope/owner/hash/current-head binding、stale binding、fallback、human review、stop condition、source-integrity 不全を fail-closed にする。
  • .claude/agents/test-runner.md の既存 command policy に、既存 Allowed Paths 内の repo-relative なテスト対象に対する narrow な uv run --locked pytest <repo-relative target> [pytest args] および uv run pytest <repo-relative target> [pytest args] の正規 execution allowance を追加する(arbitrary uv run や unrestricted shell execution への一般化は行わない)。
  • Step 2 と test-runner の記述を実装済みの runtime_only adjudication 契約へ必要最小限で更新する。
  • .claude/skills/impl-review-loop/steps/step-4-pr-review.md に既存実装済みの current-head / declaration-order command-hash binding(evaluate_step4_vc_gate())が runtime_only 統合によって regression しないことを、non-regression AC として明示する(新規 runtime_only 専用 Step 4 gate は実装しない)。

Out of Scope

Acceptance Criteria

  • AC1: exact canonical runtime_only producer envelope(runner=skipped/classification=skipped/category=preflight_scope_runtime_only/decision=go/scope_class=runtime_only/verification_owner=impl-review-loop/非空deferred_reason/runtime_verification_required=true)を持つ正規 producer skip だけが runtime_only として認識され、raw marker text の直接 parse は行わない。envelope の欠落・不正値は fail-closed になる。
  • AC2: baseline skip 単独は nonblocking PASS にならず、runtime_only の nonblocking adjudication には current-head 独立 binding(Issue / PR / current head / reviewed head / diff head / Issue body digest / declaration-order command hashes / per-command status・exit code / source integrity)が必須である。artifact / receipt / TEST_VERDICT の不在だけでは blocking にしない。
  • AC3: runtime_only current-head 独立 binding は Issue、PR、current head、reviewed head、diff head、contract body digest、ordered command hashes の既存 binding 全件に一致した場合だけ受理される。
  • AC4: malformed hash/current-head binding、stale binding、fallback、human-review-required、stop-condition-triggered、source-integrity failure はすべて fail-closed となる。
  • AC5: pr_review_only と通常の expected baseline pass/fail の既存 non-regression semantics を維持し、runtime_only の追加で既存例外の認可範囲を広げない。
  • AC6: .claude/skills/impl-review-loop/steps/step-4-pr-review.md に既存実装済みの current-head / declaration-order command-hash binding(evaluate_step4_vc_gate())が、runtime_only 統合によって regression しないことを確認する(non-regression のみ、新規実装は行わない)。
  • AC7: 実装: Reliability V1: workflow-run 統計単位と power contract を整合させる #2432 が持つ Acceptance Criteria 1個〜10個分の shape を使う e2e fixture が、正規 runtime_only current-head 独立 binding でのみ Step 4 を通し、baseline-only と不正 envelope を遮断する。
  • AC8: .claude/agents/test-runner.md の既存 Allowed Path 内で、repo-relative なテスト対象に対する narrow な uv run --locked pytest ... および uv run pytest ... の正規 execution allowance を command policy に追加する。arbitrary uv run や unrestricted shell execution へは一般化しない。
  • AC9: 変更は既存 Allowed Paths に留まり、新 schema、registry、persistent authorization を導入しない。

Verification Commands

# AC1
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_adjudicate_vc_result_runtime_only.py::test_runtime_only_producer_envelope_accepted -q

# AC2
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_adjudicate_vc_result_non_regression_gate_runtime_only.py::test_non_regression_scope_runtime_only_requires_current_head_binding -q

# AC3
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_adjudicate_vc_result.py -q -k binding

# AC4
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_adjudicate_vc_result_non_regression_gate.py -q -k 'stale or fallback or human or stop or source_integrity'

# AC5
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_adjudicate_vc_result_non_regression_gate.py -q -k 'pr_review_only or expected'

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

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

# AC8
$ grep -n "uv run --locked pytest" .claude/agents/test-runner.md

# AC8
$ grep -n "uv run pytest" .claude/agents/test-runner.md

# AC9
$ uv run --locked pytest .claude/skills/impl-review-loop/tests/test_adjudicate_vc_result.py .claude/skills/impl-review-loop/tests/test_adjudicate_vc_result_non_regression_gate.py .claude/skills/impl-review-loop/tests/test_adjudicate_vc_result_runtime_only.py .claude/skills/impl-review-loop/tests/test_adjudicate_vc_result_non_regression_gate_runtime_only.py .claude/skills/impl-review-loop/tests/test_adjudicate_vc_result_e2e_runtime_only.py .claude/skills/impl-review-loop/tests/test_step4_requires_current_vc.py -q

# AC9
$ pnpm typecheck

# AC9
$ pnpm lint

# AC9
$ pnpm test

# AC9
$ pnpm build

# AC9
$ uv run pytest .claude/skills/gemini-cli-headless-delegation/tests/test_model_routing.py

Allowed Paths

  • .claude/skills/impl-review-loop/scripts/adjudicate_vc_result.py
  • .claude/skills/impl-review-loop/tests/test_adjudicate_vc_result.py
  • .claude/skills/impl-review-loop/tests/test_adjudicate_vc_result_non_regression_gate.py
  • .claude/skills/impl-review-loop/tests/test_adjudicate_vc_result_runtime_only.py
  • .claude/skills/impl-review-loop/tests/test_adjudicate_vc_result_non_regression_gate_runtime_only.py
  • .claude/skills/impl-review-loop/tests/test_adjudicate_vc_result_e2e_runtime_only.py
  • .claude/skills/impl-review-loop/steps/step-2-verification.md
  • .claude/agents/test-runner.md

Stop Conditions

  • Allowed Paths 外の変更が必要と判明した場合。
  • In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合。
  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)。
  • 後続 Phase / 別スコープへの波及が判明した場合。
  • nested SubAgent delegation が必要になった場合。
  • 本 Issue が明示的に許可する bounded runtime smoke(現在の Claude Code session / repository configuration を用いたもの)以外の外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合。
  • baseline_vc_preflight.py、TEST_VERDICT schema family、registry、workflow、publisher、または persistent authorization の変更が必要になった場合。
  • 実装: Reliability V1: workflow-run 統計単位と power contract を整合させる #2432 の Issue contract または Allowed Paths を変更する必要が判明した場合。

Required Skills

なし

Required Design References

  • docs/dev/workflow.md
  • docs/dev/agent-skill-boundaries.md
  • docs/dev/runtime-verification-policy.md
  • docs/dev/extension-surface-runtime-policy.yaml
  • .claude/skills/impl-review-loop/steps/step-4-pr-review.md
  • .claude/skills/impl-review-loop/steps/step-2-verification.md
  • .claude/agents/test-runner.md

Scope Delta(任意)

N/A

Background

#2432 をブロック解除する別 control flow であり、#2432 の contract / Allowed Paths を変更しない。#1540 / PR #1544 は pr_review_only 限定先例で、runtime_only はその scope 外だったため、既存の pr_review_only authorization を広げず専用の fail-closed 分岐として扱う。

Overlap preflight は C1 (#2141, #2041, #1944, #1909, #1908, #1116, #966, #962, #961) を返した。#2141 は state: CLOSED / stateReason: NOT_PLANNED で確定しており、本 Issue の開始条件ではない。#2041 は phase-status publisher、その他は tests directory または agent document の broad-path match であり、本 Issue の edit intent は runtime_only adjudication のみである。

#2467 の完了は、#2432 / PR #2465 が現在依存する canonical VC tooling blocker を解消するものであり、PR #2465 自体の merge readiness を意味しない。PR #2465 は独立した implementation/review 状態(現在 Draft/Open)を持ち、その状態は本 Issue の完了によって自動的に変化しない。

Delivery Rule

  • 1 Issue = 1 PR。
  • .claude/worktrees/issue-2467-runtime-only-vc-adjudication/ を使用し、Draft PR を既定とする。

Activity

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

    @squne121
    OwnerAuthor

    #2141 close に伴う依存関係の解消(note only)

    Issue #2141(「実装: pr_head_replay_publish_exec.execute() の production caller を配線する」)は fresh fact-check の結果、production replay state(source_base/source_head/expected_remote_pr_head を同一 decision cycle で生成する producer)が存在しないことが確認され、not planned として CLOSED(state_reason: NOT_PLANNED)になりました。詳細: #2141

    本 Issue 本文の overlap preflight 節および Delivery Rule 節にある「#2141 merge 後に開始する」という prose dependency は、native GitHub dependency(blockedBy/trackedIssues)ではなく body 内記述のみです。#2141 が not planned で完了したため、この依存条件は解消されており、本 Issue は #2141 の merge を待たず着手可能です。

    本文の該当2箇所(overlap preflight 節・Delivery Rule 節)を narrow に修正しようとしましたが、本 Issue 自体に pre-existing の EXTSURF001(Runtime Verification Applicability の decision: not_applicable と、Allowed Paths が extension-surface risk-trigger policy の immediate ルールと重複する点との不整合)があり、canonical edit_issue_txn.py の static readiness gate が本文全体への書き込みを(依頼した2箇所とは無関係の理由で)fail-closed にブロックしています。この EXTSURF001 の是正自体は #2467 のスコープ判断(Runtime Verification Applicability decision の選定)が必要なため、本 note では本文を rewrite せずコメントでの記録に留めます。着手時にこの EXTSURF001 是正と合わせて本文の #2141 依存記述を更新することを推奨します。

  3. squne121 commented on Sep 2, 2026

    @squne121
    OwnerAuthor

    総合判定

    REQUEST_CHANGES。Issue #2467 が解こうとしている runtime_only producer / consumer 不整合そのものは実在し、独立 tooling fix として切り出した判断も妥当です。 現行 producer は runtime_only を正規の skipped / go / verification_owner=impl-review-loop として生成する一方、adjudicator 側の明示的な authorized-skip 処理は pr_review_only 用に偏っています。

    ただし、現在の #2467 本文をそのまま実装すると、後から導入された evidence-authority 設計を一部巻き戻し、不要な artifact/receipt ハーネスを Step 2 の routing gate に再導入する可能性があります。 個人趣味開発・ワークフロー優先という前提では、実装前に Issue contract を狭く修正した方がよいです。

    優先度 | Finding | 判定 -- | -- | -- P0 | AC2/AC3 の artifact / receipt 必須化が現行 Step 2 authority と衝突 | must-fix P0 | Runtime Verification Applicability: not_applicable が現行 extension-surface policy と矛盾し、実際に EXTSURF001 で停止 | must-fix P0 | test-runner の command allowlist が uv run pytest を許可しておらず、#2432/#2467 の VC を正規経路で実行できない | must-fix P1 | AC1 が「marker を adjudicator が認識」と書かれ、producer/consumer layer を混同 | simplify P1 | AC6 の declaration-order command binding は既に実装済み。新機能扱いすると不要な改変を誘発 | non-regression 化 P1 | #2141 merge 後 dependency が canonical body に残ったまま | remove P2 | #2467 完了を #2465 merge-ready と同一視しない方がよい | clarify

    なお、#2467 が直れば #2432 / PR #2465 の canonical VC tooling blocker は解消できますが、#2465 自身にはその後の敵対的レビューで統計実装側の P0 finding も出ています。したがって「#2467 完了 = #2465 が自動的に merge-ready」とは契約化しない方がよいです。PR #2465 は現在も Draft/Open です。

    結論として、#2467 は捨てる Issue ではありません。むしろ必要です。ただし #1540/PR #1544 の古い artifact-heavy precedent をそのまま runtime_only に横展開せず、#1856/#88 後の current authority model に合わせて reframe してから実装するのが最も小さく、壊れにくく、趣味開発向きです。

    ## 総合判定

    REQUEST_CHANGES。Issue #2467 が解こうとしている runtime_only producer / consumer 不整合そのものは実在し、独立 tooling fix として切り出した判断も妥当です。 現行 producer は runtime_only を正規の skipped / go / verification_owner=impl-review-loop として生成する一方、adjudicator 側の明示的な authorized-skip 処理は pr_review_only 用に偏っています。

    ただし、現在の #2467 本文をそのまま実装すると、後から導入された evidence-authority 設計を一部巻き戻し、不要な artifact/receipt ハーネスを Step 2 の routing gate に再導入する可能性があります。 個人趣味開発・ワークフロー優先という前提では、実装前に Issue contract を狭く修正した方がよいです。

    優先度 Finding 判定
    P0 AC2/AC3 の artifact / receipt 必須化が現行 Step 2 authority と衝突 must-fix
    P0 Runtime Verification Applicability: not_applicable が現行 extension-surface policy と矛盾し、実際に EXTSURF001 で停止 must-fix
    P0 test-runner の command allowlist が uv run pytest を許可しておらず、#2432/#2467 の VC を正規経路で実行できない must-fix
    P1 AC1 が「marker を adjudicator が認識」と書かれ、producer/consumer layer を混同 simplify
    P1 AC6 の declaration-order command binding は既に実装済み。新機能扱いすると不要な改変を誘発 non-regression 化
    P1 #2141 merge 後 dependency が canonical body に残ったまま remove
    P2 #2467 完了を #2465 merge-ready と同一視しない方がよい clarify

    P0 — artifact / receipt を runtime_only PASS の必須条件に戻してはいけない

    ここが最大の問題です。

    #1540 / PR #1544 は確かに有用な先例でした。当時は pr_review_only skip を current-head TEST_VERDICT_MACHINE/v2、workflow/check run、artifact digest 等へ強く bind しました。PR #1544 では GitHub Actions artifact API digest と payload hash まで区別していました。

    しかし、その後の Issue #1856 authority cutover により、現在の step-2-verification.md は明示的に別設計へ移っています。現在の routing 正本は test-runner の read-only report を orchestrator が独立に、

    • live PR current HEAD
    • literal Verification Command / SHA256
    • per-AC status / exit code

    へ照合して作る VC_ADJUDICATION_RESULT_V1 です。materializer、publisher、producer-side signature、PR 上の TEST_VERDICT artifact/comment は routing input に要求しないと書かれています。TEST_VERDICT が存在してもしなくても同じ判定になるのが現行契約です。

    pr-review-judge の evidence policy も、TEST_VERDICT_MACHINE 自体は diagnostics-only であり、Step 4 を開くのは current-head の VC_ADJUDICATION_RESULT_V1 だと明記しています。

    したがって #2467 AC3 の

    artifact / receipt の既存 binding 全件に一致した場合だけ受理

    は削るべきです。

    残すべきなのは TEST_VERDICT_MACHINE/v2 の read-only report → canonical adapter → current VC result という現在の経路です。artifact/receipt が存在する場合に追加 provenance として検証するのは構いませんが、存在しないことを runtime_only adjudication の blocking 条件にはしないのがよいです。

    GitHub 自体は Actions artifact に digest: sha256:... と workflow run の head_sha を提供しているので、artifact digest を検証する技術的根拠自体はあります。([GitHub Docs]1) ただし「検証可能だから routing に必須化する」は別問題です。この用途では余分な依存です。

    P0 — Runtime Verification Applicability は immediate が正しい

    #2467 は現在、

    decision: not_applicable

    ですが、Allowed Paths には .claude/skills/impl-review-loop/** と .claude/agents/test-runner.md が含まれています。最新コメントで既に、この矛盾により EXTSURF001 が canonical body edit をブロックしていることが記録されています。

    repo の extension-surface SSOT では skill invocation の変更は default_decision: immediate、verification profile は skill-invocation-runtime-smoke です。 proven_not_runtime_loaded 例外も human evidence が必要で、未証明なら適用されません。

    外部実装とも一致します。Claude Code は project skill を .claude/skills/ から発見し、current session 中の skill 編集も監視して反映します。([Claude]2) Project subagent も .claude/agents/ から実際に discovery されます。([Claude]3)

    したがってここは素直に、

    decision: immediate
    applicable_acs: [AC2, AC7]

    程度へ変更し、1本だけ bounded runtime smoke を実施するのが妥当です。

    ただし大掛かりな artifact publisher、永続 ledger、新 schema は不要です。実際の worktree で impl-review-loop → test-runner が runtime_only VC を実行し、

    canonical baseline skip + matching current-head report → nonblocking

    かつ

    baseline skip only → blocking

    になることを1回確認すれば十分です。

    また現在の Stop Conditions にある「外部サービス利用が必要なら停止」は、その runtime smoke と衝突する可能性があります。ここは 既存 Claude Code セッション/設定を使う policy-mandated smoke は許可、新しい credential・service・権限昇格は stop と狭く書くべきです。

    P0 — test-runner が uv run pytest を自分の契約上実行できない

    これは実装に入るとかなり高確率で詰まります。

    現在の .claude/agents/test-runner.md は「以下のコマンドだけを実行する」として pnpm ...、rg、grep、test、一部 gh 等を列挙していますが、uv run pytest がありません。

    一方、#2432 の runtime_only VC は uv run --locked pytest ... が中心です。 #2467 自身も uv run --locked pytest ... と uv run pytest ... を Verification Commands に持っています。

    つまり runtime_only consumer を直しても、producer/current-head executor の policy が pytest 実行を禁止したままです。

    ここは Allowed Paths に test-runner.md が既にあるので、#2467 で直すのが自然です。ただし arbitrary uv run を開ける必要はありません。

    推奨は narrow に、

    uv run --locked pytest <repo-relative target> [pytest args]

    uv run pytest <repo-relative target> [pytest args]

    だけを追加することです。これなら workflow freedom を上げつつ、command surface を無意味に一般化しません。

    P1 — 「exact canonical marker を認識」は layer が違う

    adjudicator は raw Issue body の

    # preflight-scope: runtime_only

    文字列を読むべきではありません。

    marker の parse は既に baseline_vc_preflight.py の producer 責務で、consumer には normalized envelope が届きます。現行 adjudicate_vc_result.py も pr_review_only を raw marker ではなく producer fields の完全一致で判定しています。

    AC1 は「exact marker」ではなく、例えば次の canonical producer envelope に書き換える方が堅いです。

    runner=skipped、classification=skipped、category=preflight_scope_runtime_only、decision=go、scope_class=runtime_only、verification_owner=impl-review-loop、non-empty deferred_reason、runtime_verification_required=true。

    これを満たすものだけ runtime_only delegation candidate とする。それ以外は既存どおり non-PASS にする、で十分です。

    P1 — Step 4 の command-order binding は作り直さない

    AC6 は必要な性質ですが、既に存在します。

    test_step4_requires_current_vc.py は current HEAD / contract digest / expected command hashes による reviewer gate を既に検証しています。 さらに既存 regression test には command hashes の順序だけを逆転させ、stale binding として拒否するケースも入っています。

    したがって AC6 は、

    existing declaration-order binding を runtime_only integration が regression させない

    へ変更する方がよいです。

    evaluate_step4_vc_gate() 自体に新しい runtime_only 特殊ロジックを足す必要はありません。runtime_only の差分は Step 2 adjudication までで完結させ、Step 4 には既存 VC_ADJUDICATION_RESULT_V1 だけを見せるのが最小設計です。

    P1 — #2141 dependency は canonical body から削除する

    Issue body は今も「#2141 merge 後に開始」としていますが、#2141 は 2026-09-02 に not_planned で CLOSED です。

    最新コメントでもこの prose dependency は解消済みとされています。

    コメントで上書きするのではなく、EXTSURF001 修正時に body の2箇所から完全に削るのがよいです。別 dependency へ置換する必要もありません。

    推奨する #2467 の最小設計

    実装は次の程度まで削れます。

    1. baseline producer が作った canonical runtime_only envelope を consumer が限定認識する。
    2. baseline skipped record 自体は絶対に PASS にしない。
    3. Step 2 の test-runner read-only report を既存 adapter で current VC shape に変換する。
    4. Issue/PR/current HEAD/reviewed HEAD/diff HEAD、Issue body digest、declaration-order command hashes、per-command exit_code=0/status=pass、no fallback / no human review / no stop condition、source integrity を満たした runtime_only VC だけを nonblocking にする。
    5. artifact / receipt は routing eligibility から外す。 materialized diagnostics が存在する場合だけ既存 receipt validation を壊さない。
    6. pr_review_only、expected_pass、expected_fail の既存意味論は一切変えない。
    7. test-runner に narrow な uv run [--locked] pytest execution allowance を追加する。
    8. existing Step 4 gate は変更せず regression test のみ通す。
    9. Runtime Verification Applicability: immediate とし、worktree で positive 1本 + baseline-only negative 1本程度の runtime smoke を行う。

    この形なら、新 schema、registry、publisher、persistent authorization、追加 approval gate は不要です。

    Issue contract で具体的に直す箇所

    現在 推奨
    RVA not_applicable immediate
    AC2 complete current-head TEST_VERDICT/v2 evidence head-bound read-only test-runner report + independent Step2 binding と明記
    AC3 artifact / receipt 必須 削除。diagnostics-only optional provenance へ
    AC1 exact canonical marker canonical producer envelope へ
    AC6 Step4 bindingを新要件風に記述 existing behavior の non-regression へ
    Allowed Paths の test-runner 維持し、uv pytest allowlist 修正を明示
    external service が必要なら stop policy-required bounded runtime smoke のみ例外化
    #2141 merge後 削除
    Outcome「#2432 gate解除」 「runtime_only tooling blocker を解除」までに限定

    なお、#2467 が直れば #2432 / PR #2465 の canonical VC tooling blocker は解消できますが、#2465 自身にはその後の敵対的レビューで統計実装側の P0 finding も出ています。したがって「#2467 完了 = #2465 が自動的に merge-ready」とは契約化しない方がよいです。PR #2465 は現在も Draft/Open です。

    結論として、#2467 は捨てる Issue ではありません。むしろ必要です。ただし #1540/PR #1544 の古い artifact-heavy precedent をそのまま runtime_only に横展開せず、#1856/#88 後の current authority model に合わせて reframe してから実装するのが最も小さく、壊れにくく、趣味開発向きです。

  4. squne121 commented on Sep 2, 2026

    @squne121
    OwnerAuthor

    推奨は #2467 をそのまま実装へ送らず、まず OWNER コメントを trusted human context として contract reframe を完了させる ことです。現本文は artifact/receipt を blocking evidence に要求し、RVA を not_applicable とし、既に not_planned で閉じた #2141 の merge 待ちを残しています。

    特に #1856 で通常レビューの authority は TEST_VERDICT producer/publisher 依存から current-head CI / exact-head VC へ cutover 済みなので、#2467 で artifact-heavy な旧モデルを復活させないのが重要です。 コメント側も VC_ADJUDICATION_RESULT_V1 を Step 4 の authority とし、runtime_only 特殊処理は Step 2 までに閉じることを推奨しています。

    その前提で、Claude Code には以下を渡すのがよいです。

    #2467 (comment)

    を trusted human context / OWNER anchor として、Issue #2467 に対する issue-refinement-loop を実行してください。

    目的は 実装開始ではなく、Issue #2467 の contract を現行 repository authority model に整合させ、implementation-ready な状態まで refinement を完了すること です。

    実行方針

    • 最初に issue-refinement-loop Skill をロードし、その canonical procedure / planner / command registry を正本として従うこと。
    • anchor_comment_url には上記 comment URL を使用し、direct human context lane として処理すること。
    • bare/unlabeled anchor や agent-report lane に読み替えないこと。
    • loop iteration ごとの人間承認は不要。loop_iteration_approval_gate.default_required: false の契約どおり、needs-fix なら max_iterations の範囲で自動継続すること。
    • Claude Code 自体の permission mode と repository loop approval を混同しないこと。repository refinement loop の継続確認を私へ求めないこと。
    • Issue 本文更新、必要な controlled GitHub mutation、canonical refinement artifacts の生成、readback、再レビュー等、issue-refinement-loop 完遂に必要な作業は実行してよい。
    • ただし、本タスクは Issue refinement である。実装: impl-review-loop の runtime_only VC adjudication を current-head evidence に安全に接続する #2467 の production implementation を開始したり、実装用 PR を作成したりしないこと。

    サブエージェント

    必ず main orchestrator から必要な SubAgent を利用すること。

    最低でも、planner が許可する canonical investigation lane で codebase-investigator を使用し、以下を repository の現行 HEAD で検証すること。

    planner が web research を要求する、または anchor comment 中の外部仕様が dispositive なら web-researcher も起動し、必要最小限の外部仕様を検証すること。

    SubAgent completion rule

    • SubAgent を background 実行してもよい。
    • SubAgent の完了を必ず待つこと。
    • 「バックグラウンドで開始したので先へ進む」は禁止。
    • 全 required SubAgent の結果を join してから Step 2 review / contract mutation に進むこと。
    • SubAgent 自身にはさらに SubAgent を起動させないこと。nested SubAgent delegation は行わない。
    • SubAgent が失敗した場合は、その failure を握り潰して親が推測で補完せず、canonical retry / routing policy に従うこと。

    canonical Step 2 が root-owned review pipeline である場合、旧 issue-reviewer SubAgent を独自に追加せず、現行 issue-refinement-loop の routing を優先すること。


    Anchor comment を反映する推奨 reframe

    以下は OWNER anchor の desired direction である。ただし repo の現行 SSOT と fresh investigation に照らして検証し、矛盾があれば canonical planner/reviewer の evidence に従って最小修正すること。

    P0-1: artifact / receipt を blocking authority に戻さない

    現在の #2467 AC2/AC3 にある、

    • complete current-head TEST_VERDICT/v2 evidence
    • artifact
    • receipt
    • producer-side provenance

    等を runtime_only nonblocking adjudication の必須 routing input にしないこと。

    現行 authority model に合わせ、

    test-runner read-only report
    → orchestrator による independent current-head binding
    → VC_ADJUDICATION_RESULT_V1

    を authoritative path とすること。

    最低限、以下へ bind すること。

    • live PR current HEAD
    • literal Verification Command
    • declaration-order command SHA256
    • per-AC result/status
    • exit code

    TEST_VERDICT / artifact / receipt 等が存在する場合に diagnostics / optional provenance として検証することは妨げないが、不在そのものを blocking condition にしない。

    新 publisher、materializer、receipt schema、persistent ledger、persistent authorization は追加しない。

    P0-2: Runtime Verification Applicability を修正

    現行 decision: not_applicable をそのまま残さない。

    .claude/skills/impl-review-loop/** および .claude/agents/test-runner.md が runtime-loaded extension surface であるという現行 SSOT を確認し、原則として

    decision: immediate

    へ reframe すること。

    applicable_acs は AC renumbering 後の実際の runtime-sensitive AC に最小限 bind すること。anchor にある [AC2, AC7] は参考値であり、番号を盲目的に固定しない。

    必要な runtime verification は bounded smoke 1本程度 に抑えること。

    最低限、実 worktree / current session で以下の2方向を確認できる contract にする。

    • canonical runtime_only baseline skip + matching current-head report → nonblocking
    • baseline skip only → blocking

    大掛かりな publisher、artifact harness、追加 approval gate は導入しない。

    Stop Conditions の「外部サービス利用」は、この policy-mandated smoke を阻害しないよう narrow にすること。

    許可:

    • 現在の Claude Code session / repository configuration を使った policy-mandated runtime smoke

    停止:

    • 新しい credential
    • 新しい外部 service
    • 権限昇格
    • persistent authorization の導入

    P0-3: test-runner の pytest execution gap を解消

    .claude/agents/test-runner.md の現行 command policy を確認すること。

    #2432 / #2467 の runtime_only Verification Commands を canonical test-runner が実行できないのであれば、#2467 の既存 Allowed Path を使って pytest に限定した narrow allowlist を contract に含めること。

    許可対象の目安:

    • uv run --locked pytest <repo-relative-target> [pytest args]
    • uv run pytest <repo-relative-target> [pytest args]

    arbitrary uv run や unrestricted shell execution に一般化しないこと。

    P1-1: marker parse と adjudicator responsibility を分離

    adjudicator に raw Issue marker、

    # preflight-scope: runtime_only

    を parse させる contract にしない。

    marker parse は producer responsibility とし、consumer/adjudicator は normalized canonical runtime_only producer envelope のみを限定認識する形にすること。

    fresh codebase investigation で exact field names を確認すること。anchor comment で想定されている shape は概ね以下。

    • runner=skipped
    • classification=skipped
    • category=preflight_scope_runtime_only
    • decision=go
    • scope_class=runtime_only
    • verification_owner=impl-review-loop
    • non-empty deferred_reason
    • runtime_verification_required=true

    これを満たす canonical envelope のみ runtime_only delegation candidate とし、不正・欠落・別 category は fail-closed の既存 semantics に流すこと。

    baseline skipped record 自体を PASS へ変換してはならない。

    P1-2: Step 4 command binding を新規機能として作り直さない

    current HEAD / contract digest / expected command hashes / declaration order 等の Step 4 binding が既に実装・テスト済みか確認すること。

    既存で保証されている場合、AC を

    「runtime_only integration が existing declaration-order/current-head binding を regression させない」

    という non-regression AC に変更すること。

    evaluate_step4_vc_gate() 等へ runtime_only 専用 semantics を追加する設計へ拡大しない。

    runtime_only 固有差分は Step 2 adjudication までで閉じ、Step 4 には通常どおり authoritative VC_ADJUDICATION_RESULT_V1 を渡すだけにする。

    P1-3: #2141 dependency を削除

    Issue #2141 の live state を確認すること。

    not_planned / CLOSED が確認できる場合、#2467 body に残る

    #2141 merge 後に開始する

    という prose dependency を overlap preflight / Delivery Rule 等から削除すること。

    別 dependency へ置き換えないこと。

    P2: #2465 との関係を明確化

    #2467 の Outcome を、

    「#2432 / PR #2465 の canonical VC tooling blocker を解消する」

    以上に広げないこと。

    #2467 completed => PR #2465 merge-ready

    とは contract 化しない。

    PR #2465 側には独立した implementation/review findings が存在し得るため、#2467 の完了はそれらを自動解消しないことを Background / Remaining Gap 等で必要最小限明示すること。


    Contract の設計制約

    維持すること:

    • 1 Issue = 1 PR
    • 実装: Reliability V1: workflow-run 統計単位と power contract を整合させる #2432 の Issue body / contract / Allowed Paths は変更しない
    • pr_review_only の既存 authorization semantics を runtime_only に一般化しない
    • baseline skip 単独は nonblocking PASS にならない
    • malformed / stale / mismatched current-head evidence は fail-closed
    • current-head / literal command / ordered command hash binding
    • focused regression coverage
    • hobby-development 向けの minimal harness

    導入しないこと:

    • 新 schema family
    • registry
    • publisher
    • materializer requirement
    • artifact/receipt mandatory authority
    • persistent authorization
    • persistent ledger
    • broad control-plane refactor
    • runtime_only 専用 Step 4 gate
    • unnecessary approval gate

    Allowed Paths は fresh investigation に基づき必要最小限に保つこと。現在の Allowed Paths で目的を満たせるなら広げない。


    issue-refinement-loop の進め方

    1. OWNER anchor を direct human context として canonical preflight。
    2. planner result / REFINEMENT_LOOP_PLAN_V1 を consume。
    3. required SubAgent investigation を dispatch。
    4. SubAgent 完了を待つ。
    5. 必要なら web-researcher を dispatch。
    6. その完了も待つ。
    7. canonical Step 2 root review pipeline を実行。
    8. needs-fix / request_changes なら人間確認なしで次 iteration。
    9. trusted contract patch plan が生成され contract_update_required 相当へ route された場合は、canonical contract_update.run.with_human_context route を実行。
    10. mutation 後は Issue body/title を readback。
    11. fresh preflight。
    12. fresh Step 2 review。
    13. fresh static/readiness check。
    14. blocker が残る場合は bounded loop 内で修正を継続。
    15. NEXT_ACTION: issue_editor_required の場合は、同一 contract-update を no-progress retry せず、canonical issue-editor / controlled full rewrite route に handoff。
    16. full rewrite 後も readback → fresh preflight → fresh review → fresh readiness を省略しない。
    17. stale artifact / stale previous review を implementation-ready evidence として再利用しない。

    人間確認不要の範囲

    以下について私への確認を求めず進めてよい。

    • Issue / comments / related PR / repository files の read
    • canonical planner / preflight / review commands
    • SubAgent dispatch
    • SubAgent completion wait
    • repository-local deterministic tests/checks
    • refinement artifacts の生成
    • trusted OWNER anchor に基づく 実装: impl-review-loop の runtime_only VC adjudication を current-head evidence に安全に接続する #2467 body/title の controlled update
    • refinement loop 内で必要な body rewrite
    • stale metadata hygiene
    • post-update readback
    • fresh re-review
    • fresh readiness validation
    • bounded runtime smoke
    • max_iterations 内の自動修正 iteration

    「変更してよいですか」「次の iteration へ進んでよいですか」「Issue 本文を更新してよいですか」といった確認は不要。

    ただし、canonical policy が human_judgment_required と判定する 新しい未解決の意味論判断、新 credential、権限昇格、別 Issue の新規起票が必須など、repository contract 上どうしても人間判断を要求する場合のみ停止すること。

    その際も、単に「承認待ち」とせず、

    • blocker code
    • 根拠
    • 既に完了した作業
    • unresolved decision
    • 最小の推奨 disposition

    まで提示すること。


    完了条件

    以下すべてを満たすまで終了しない。

    最後に簡潔に、

    • final verdict
    • Issue body の主要変更点
    • 実行した SubAgent と結果
    • runtime verification applicability
    • 残存 blocker の有無
    • final preflight/review/readiness
    • Issue URL
    • 次に implementation を開始可能か

    を報告してください。

    重要: refinement 完了後も、この依頼では #2467 の実装そのものへ進まないでください。

    この形なら、単に「コメントを反映して直す」ではなく、contract_update.run.with_human_context → 必要なら issue-editor full rewrite → fresh preflight/review/readiness まで Claude Code に継続させられます。issue-refinement-loop 自体も trusted human context からの contract update と、更新後の fresh gates を要求する設計です。

    また PR #2465 は現在 Open / Draft なので、「#2467 完了=#2465 merge-ready」にしない制約も残すべきです。

  5. squne121 commented on Sep 2, 2026

    @squne121
    OwnerAuthor

    推奨は (a) planner 修正を先に行うでも、(b) 人間が手でコメントを書き直すでもなく、「現在のあなたの判断を、Claude Code が最小 freeform OWNER directive として #2467 に転記し、その新 URL を with_human_context へ再投入する」 です。

    理由は明確です。現在の #2467 本文はまだ未更新で、RVA: not_applicable、artifact/receipt binding、#2141 merge 後 が残っています。 一方 #2141 は既に closed / not_planned、PR #2465 は現在も Open/Draft です。

    前回の PLANNER_FAIL_CLOSED は、実装を見る限り false positive と考えてよいです。scanner は日本語の 権限昇格 と 外部サービス を否定文脈まで理解せず boundary として拾います。 しかも現行 contract は freeform human-context lane を正式に認め、with_human_context か否かは operator が invocation 時に選択します。構造化 YAML が無くても freeform lane は継続できます。 箇条書き directive だけでも operator-selected human context なら explicit directive として認識する仕様です。

    今回は ANCHOR_SCOPE_REFRAME_V1 YAML を使わない 方がよいです。その schema は allowed_path_deltas を必須かつ1件以上要求するため、Allowed Paths を増やさない今回の reframe に使うと、存在しない scope expansion を捏造することになります。

    以下をそのまま Claude Code に渡すのが推奨です。

    Issue #2467 の issue-refinement-loop を、前回の PLANNER_FAIL_CLOSED から canonical に再開してください。

    対象:
    #2467

    前回 anchor:
    #2467 (comment)

    今回の目的は #2467 の implementation を開始することではなく、Issue contract の refinement を implementation-ready まで完了させること です。

    今回のユーザー指示自体を、operator が明示した trusted human context として扱ってください。

    重要な disposition

    前回の停止理由である changes_permission_boundary / changes_external_service_boundary は、元 OWNER anchor 内の禁止・停止条件を説明する文言を scope_signal_delta.py の keyword scanner が positive signal として拾った false positive と見なします。

    ただし、canonical planner の判定を orchestrator が上書きしたり bypass してはいけません。

    代わりに、現行 repository の Accepted Trust Model / operator-selected human-context lane を使用し、今回ユーザーが承認した contract disposition だけを含む、狭い新しい freeform OWNER directive comment を #2467 に作成し、その新 comment URL を preflight.run.with_human_context / contract_update.run.with_human_context へ投入してください。

    このコメント作成は、agent が独自判断を GitHub に書き込むものではありません。
    今回のユーザーによる明示的 disposition を GitHub comment へ機械的に転記する transport operation です。

    この GitHub comment mutation は実行してよく、コメント作成について私へ追加確認を求める必要はありません。

    絶対に行わないこと

    ANCHOR_SCOPE_REFRAME_V1 は今回使わない

    current repository schema を確認してください。

    今回の disposition は Allowed Paths の追加を要求していません。

    ANCHOR_SCOPE_REFRAME_V1 schema が non-empty allowed_path_deltas を要求する現行仕様であるなら、今回そこへ架空の path delta を入れてはいけません。

    その場合は、正式にサポートされている freeform operator-selected human-context directive lane を使用してください。

    YAML fence を無理に作らないでください。

    Step 1: canonical procedure を再ロード

    最初に issue-refinement-loop Skill をロードしてください。

    以後は、その時点の repository HEAD にある、

    • SKILL.md
    • canonical procedure
    • planner
    • command registry
    • anchor-comment handling
    • scope-signal guard
    • review/readiness routing

    を正本としてください。

    前回セッションの推測だけでコマンドを再構成しないでください。

    Step 2: 必須 SubAgent investigation

    main orchestrator から codebase-investigator を起動してください。

    SubAgent には mutation を許可せず、current HEAD で最低限以下を確認させてください。

    1. anchor-comment-handling.md の Operator-Selected Human-Context / Accepted Trust Model

    2. freeform human-context directive が canonical lane として有効であること

    3. scope_signal_delta.py::detect_boundary_flags() の現在の boundary keyword semantics

    4. 元 anchor のどの literal が

      • changes_permission_boundary
      • changes_external_service_boundary
      • requires_issue_split
      • destructive_or_non_idempotent_operation
      • expands_allowed_paths
        を発火させたか
    5. 今回必要な 実装: impl-review-loop の runtime_only VC adjudication を current-head evidence に安全に接続する #2467 contract rewrite は既存 Allowed Paths の範囲内であり、新しい path layer を必要としないこと

    6. 実装: pr_head_replay_publish_exec.execute() の production caller を配線する #2141 の current state/state_reason

    7. 実装: 通常レビューの evidence authority を TEST_VERDICT 非依存の CI/merge_state_status 正本へ切替える(Phase 1: authority cutover) #1856 後の Step 2 evidence authority

    8. current extension-surface runtime policy と 実装: impl-review-loop の runtime_only VC adjudication を current-head evidence に安全に接続する #2467 に要求される RVA decision / required fields / verification profile

    9. test-runner の現在の command policy

    10. AC6 / Step 4 current-head declaration-order binding が既存実装であること

    11. PR feat(ci): Reliability V1 fixed power contract #2465 の現在の state/draft 状態

    SubAgent completion rule

    SubAgent は background 実行して構いません。

    ただし 必ず完了を待ってください。

    「background で起動したので先へ進む」は禁止です。

    codebase-investigator の completion notification を受け、その result を main orchestrator が join してから次へ進んでください。

    SubAgent 自身には SubAgent を起動させないでください。

    SubAgent が失敗した場合は親が推測で埋めず、canonical retry/routing policy に従ってください。

    planner が外部仕様調査を dispositive と判断した場合のみ web-researcher を追加起動して構いません。
    その場合も 完了を必ず待って join してください。

    Step 3: 新 OWNER directive candidate を生成する

    investigation 完了後、元 anchor の技術的 disposition を維持しつつ、boundary scanner に不要な administrative wording を与えない最小 freeform comment を生成してください。

    意味論は以下で固定します。

    #2467 contract disposition

    • runtime_only producer/consumer mismatch を修正対象として維持する。
    • adjudicator が raw marker text を再parseする設計にはしない。
    • canonical producer envelope の完全一致を runtime_only delegation candidate の入口とする。
    • baseline producer の skipped record 単独を PASS にしない。
    • current routing authority は、test-runner の head-bound read-only report を orchestrator が独立 binding して生成する VC_ADJUDICATION_RESULT_V1 とする。
    • artifact / receipt / materialized TEST_VERDICT は routing eligibility の mandatory input に戻さない。
    • artifact / receipt が存在する場合の既存 provenance validation を壊さないが、その不存在だけでは blocking にしない。
    • Issue / PR / current head / reviewed head / diff head / Issue body digest / declaration-order command hashes / per-command status・exit code / source integrity の既存 binding を維持する。
    • fallback、human-review-required、stop-condition-triggered、source-integrity failure は既存どおり non-PASS とする。
    • pr_review_only、expected pass、expected fail の既存意味論を変更しない。
    • Step 4 の current-head / declaration-order binding を新しく実装しない。runtime_only integration による non-regression requirement とする。
    • test-runner の既存 Allowed Path 内で、repo-relative pytest target に対する narrow な
      uv run --locked pytest ...
      および
      uv run pytest ...
      の正規 execution allowance を契約へ含める。
    • Runtime Verification Applicability は current extension-surface SSOT が要求する immediate とする。
    • decision: immediate に必要な全 fields は current SSOT/readiness checker から導出し、古い例から推測しない。
    • current extension-surface policy が指定する verification profile を使用する。
    • bounded runtime smoke は positive path と baseline-only negative path を確認できる最小構成とする。
    • 実装: pr_head_replay_publish_exec.execute() の production caller を配線する #2141 の「merge 後に開始」dependency は完全に削除する。代替 dependency を作らない。
    • Outcome は「実装: impl-review-loop の runtime_only VC adjudication を current-head evidence に安全に接続する #2467 が runtime_only tooling blocker を解消する」までに限定する。
    • 実装: impl-review-loop の runtime_only VC adjudication を current-head evidence に安全に接続する #2467 completion を PR feat(ci): Reliability V1 fixed power contract #2465 merge-ready と同義にしない。
    • current Allowed Paths は必要最小限で維持し、新しい path layer を追加しない。

    Step 4: comment を投稿する前に boundary precheck

    新 OWNER directive candidate を GitHub に投稿する前に、repository の 実際の canonical detect_boundary_flags() 実装を直接使って candidate text を検査してください。

    scanner logic を自前で再実装しないでください。

    少なくとも次を確認してください。

    • changes_permission_boundary == false
    • changes_external_service_boundary == false
    • destructive_or_non_idempotent_operation == false
    • requires_issue_split == false
    • expands_allowed_paths == false

    false でない flag がある場合、contract semantics は変更せず wording だけを狭くして再検査してください。

    この wording-only normalization について人間確認は不要です。

    boundary flag を false にするために必要な technical requirement を削除してはいけません。

    特に元 anchor にあった、停止条件や運用上の禁止事項を説明するだけの administrative paragraph は、新 anchor へコピーしないでください。

    Step 5: narrow freeform OWNER directive を #2467 に投稿

    precheck が clean になったら、その candidate を #2467 の新しい top-level comment として投稿してください。

    repository が提供する controlled GitHub mutation mechanism を優先し、loaded Skill の mutation policy に従ってください。

    投稿後は必ず readback し、

    • URL
    • comment id
    • body
    • issue association
    • author association
    • updated snapshot

    を検証してください。

    OWNER / MEMBER / COLLABORATOR の trusted principal 条件を満たさない場合は fail-closed してください。

    この新 comment URL を以後の active anchor としてください。

    元の
    issuecomment-5508736863
    は technical evidence / provenance として保持して構いませんが、次の scope authority evaluation の active anchor には使用しないでください。

    Step 6: canonical with_human_context で再開

    新 comment URL を anchor_comment_url として、

    preflight.run.with_human_context

    を fresh に実行してください。

    重要:

    • with_agent_report にしない。
    • unlabeled anchor にしない。
    • operator-selected with_human_context lane として実行する。
    • planner artifact の actual route を読む。
    • route を main orchestrator が独自に推測しない。

    fresh preflight が contract update を要求する場合は、canonical

    contract_update.run.with_human_context

    を実行してください。

    issue_editor_required に route された場合は、no-progress retry をせず canonical issue-editor / controlled full rewrite route へ handoff してください。

    Step 7: #2467 contract rewrite

    canonical route が許可した範囲で Issue body を更新してください。

    少なくとも次が最終 body に反映されていることを確認してください。

    • artifact / receipt mandatory routing requirement の除去
    • runtime_only baseline skip 単独 PASS の禁止
    • current-head independent Step 2 authority への整合
    • canonical producer envelope と consumer responsibility の分離
    • RVA を extension-surface SSOT と整合
    • immediate decision の required fields を current schemaどおり記載
    • bounded runtime smoke contract
    • test-runner の narrow pytest execution allowance
    • existing Step 4 binding の non-regression 化
    • 実装: pr_head_replay_publish_exec.execute() の production caller を配線する #2141 stale dependency の削除
    • feat(ci): Reliability V1 fixed power contract #2465 merge-ready を Outcome から除外
    • AC と Verification Commands の番号対応を一意にする
    • 各 AC の VC comment label を current readiness checker が認識できる canonical form にする
    • pytest selector が 0 collected / exit 5 にならず、実在する test target/selector を指す contract にする

    Verification Commands は実装前 contract なので、まだ存在しないテスト名を「既に PASS するもの」として捏造しないでください。
    必要なら implementation により追加される test target と、refinement 時点で確認可能な static/non-regression command を契約上区別してください。

    Step 8: mutation 後の readback と fresh review

    Issue mutation 後は必ず GitHub から title/body を readback してください。

    その readback snapshot を使って fresh に、

    1. refinement preflight
    2. canonical root-owned Step 2 review pipeline
    3. static/readiness check
    4. extension-surface policy check
    5. AC/VC alignment check

    を実行してください。

    旧 review artifact を再利用しないでください。

    canonical Step 2 が root-owned review pipeline なら、旧 issue-reviewer SubAgent を独自追加しないでください。

    Step 9: bounded auto-fix loop

    fresh review が needs-fix / request_changes を返した場合、max_iterations の範囲で人間確認なしに修正 iteration を継続してください。

    以下の確認を私へ求めないでください。

    • 次 iteration へ進んでよいか
    • Issue body を更新してよいか
    • comment を投稿してよいか
    • full rewrite してよいか
    • readback / re-review してよいか
    • bounded runtime smoke を contract に入れてよいか

    repository loop approval と Claude Code client permission mode を混同しないでください。

    今回変更してよいもの

    refinement 完遂のために必要な以下は許可します。

    今回変更してはいけないもの

    scope_signal_delta.py の negation false positive 自体は、#2467 refinement 完了後の follow-up candidate として記録してよいですが、今回それを先に実装しないでください。

    新 Issue の起票も今回の成功条件ではありません。

    genuine stop

    新しい narrow anchor を canonical with_human_context lane に投入した後も、current repository policy が 別の genuine semantic decision を human_judgment_required と判定した場合のみ停止してください。

    同じ旧 anchor の keyword false positive を理由に停止してはいけません。新 anchor の actual boundary evidence を確認してください。

    停止時は必ず、

    • blocker code
    • route.action / reason_code
    • triggering evidence
    • active anchor URL
    • boundary flags
    • 完了済み作業
    • unresolved semantic decision
    • 最小の推奨 disposition

    まで提示してください。

    完了条件

    以下をすべて満たすまで終了しないでください。

    最終報告

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

    • final verdict
    • new active OWNER anchor URL
    • old false-positive boundary の disposition
    • Issue body の主要変更点
    • 実行した SubAgent と completion result
    • runtime verification applicability / profile
    • test-runner pytest contract の disposition
    • 実装: pr_head_replay_publish_exec.execute() の production caller を配線する #2141 dependency の disposition
    • artifact/receipt authority の disposition
    • final preflight
    • final Step 2 review
    • final readiness
    • remaining blocker の有無
    • Issue URL
    • implementation を次タスクで開始可能か

    refinement が成功しても、この依頼では #2467 の production implementation へ進まないでください。

    この経路なら #2467 の refinement と planner の false-positive 改修を分離できます。scope_signal_delta.py の negation-aware 化は再発防止として価値がありますが、#2467 を先に通すための prerequisite にする必要はありません。

  6. squne121 commented on Sep 2, 2026

    @squne121
    OwnerAuthor

    Revised Acceptance Criteria (Issue Contract Disposition)

    前回コメントの技術方針を維持しつつ、Issue #2467 の contract を狭く修正してください。

    • runtime_only producer/consumer 不整合の修正を対象として維持する。
    • adjudicator が raw marker text を直接 parse する設計にはしない。
    • 正規化済み producer envelope の完全一致のみを runtime_only delegation candidate の入口とする。
    • baseline producer の skipped record 単独では PASS にしない。
    • current routing authority は、test-runner の head-bound read-only report を orchestrator が独立に current-head へ binding して生成する VC_ADJUDICATION_RESULT_V1 とする。
    • artifact / receipt / materialized TEST_VERDICT は routing eligibility の必須入力に戻さない。存在する場合の既存 provenance 検証は壊さないが、不在だけでは blocking にしない。
    • Issue / PR / current head / reviewed head / diff head / Issue body digest / declaration-order command hashes / per-command status・exit code / source integrity の既存 binding は維持する。
    • fallback、human-review-required、stop-condition-triggered、source-integrity failure は既存どおり non-PASS とする。
    • 既存の pr_review_only、expected pass、expected fail の意味論は変更しない。
    • Step 4 の current-head / declaration-order binding は新規実装せず、runtime_only 統合による non-regression requirement として扱う。
    • 既存の対象ディレクトリ範囲内で、repo-relative なテスト対象に対する narrow な uv run --locked pytest ... および uv run pytest ... の正規 execution を test-runner の契約へ含める。
    • Runtime Verification Applicability は immediate とし、必要な fields は現行 readiness checker が要求する schema から導出する。
    • bounded runtime smoke は、正常経路(正規 producer skip + current-head evidence 一致で nonblocking)と baseline-only の negative 経路(current-head evidence がない場合は blocking のまま)の最小2ケースのみで構成する。
    • 実装: pr_head_replay_publish_exec.execute() の production caller を配線する #2141 に関する「merge 後に開始する」という記述は削除する。代替の依存条件は追加しない。
    • Outcome は「実装: impl-review-loop の runtime_only VC adjudication を current-head evidence に安全に接続する #2467 が本 tooling blocker を解消する」の範囲に限定し、他 PR の merge readiness とは同一視しない。
    • 現在の対象範囲は必要最小限で維持し、新しい対象ディレクトリ層は追加しない。
    • Verification Commands は refinement 時点で確認可能な static/non-regression コマンドと、実装により追加される test target を明確に区別し、まだ存在しない test target を実装前から PASS するものとして記載しない。

    以上を Issue 本文へ反映してください。

  7. squne121 commented on Sep 2, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop: refinement 完了 (approved)

    trusted with_human_context anchor(https://github.com/squne121/loop-protocol/issues/2467#issuecomment-5509460780)に基づく contract refinement が完了しました。

    • deterministic Step 2 review (C1–C13): approve
    • Step 2.5 semantic design review: 1回実施(3 findings、うち high 1件が rewrite_lane: semantic として反映)。反映後の再評価で semantic_review_applicable: false(applicable な signal 消滅)。
    • fresh readiness check (contract_readiness_check.py --mode preflight-static): go
    • 最終 body_sha256: sha256:ee01c96fb5a52b7bf3b730e3cfdc14c5e479d8a41fd4f191cee6096aee78c6b9

    反映した主な変更点:

    このサイクルで新規の hard dependency は確立していません(既存の #2141 依存を除去したのみ)。evaluate_termination_dependency_gate() は「no hard dependency confirmed this cycle」に該当し no-op です。

    次の implementation 着手についての注記: 本 refinement サイクルは implementation-ready 状態に到達していますが、今回の依頼は明示的に「refinement 完了後も #2467 の production implementation へ進まないこと」を求めているため、canonical root_entry_router.py による impl-review-loop 自動起動は本セッションでは実行していません。LOOP_HANDOFF_RESULT_V1 marker も同じ理由でこのコメントには含めていません。次のタスクで implementation を開始する場合は、fresh preflight から再開してください(本 refinement の readiness 状態は stale artifact として再利用しないこと)。

  8. squne121 commented on Sep 2, 2026

    @squne121
    OwnerAuthor

    推奨は、refinement を再実行せず、#2467 の現行 Issue body を authority として fresh root-entry preflight → impl-review-loop を起動することです。最終 refinement は approved / readiness go まで到達しており、その完了コメント自身も「次回 implementation は stale artifact を再利用せず fresh preflight から」と指定しています。

    また現行 impl-review-loop は、Step 1=implementation-worker、Step 2=test-runner、Step 4=pr-reviewer を SubAgent に委譲し、APPROVE だけでなく live mergeability と blocker absence まで確認して draft_pr_ready で止まります。merge は人間判断のままなので、「マージ直前まで自動化」という要求にそのまま合います。

    特に SubAgent 待機は強く指定した方がよいです。repository の Common Completion Protocol は、wait_agent の通知だけでは成功扱いせず、final result を consume → list_agents で canonical task が terminal completed であることを確認してから routingするよう要求しています。 Claude Code 自体も現在は background SubAgent がデフォルトになり得るため、依存関係のある worker は foreground を優先するか、background の場合は完了通知まで待つ必要があります。 ([Claude]1)

    承認について一点だけ区別が必要です。プロンプトは repository loop の「人間承認」を不要にできますが、Claude Code 本体の permission enforcement はプロンプトでは変更できません。 Anthropic の現行仕様でも permission rule はモデルではなく Claude Code が強制します。完全にツール確認を減らしたいなら、セッション側では auto mode または必要な allow rules を使うのが適切です。dontAsk は未許可 tool を自動拒否するので、この用途には逆効果です。bypassPermissions は VM/container 等の隔離環境向けとされています。 ([Claude]2)

    以下を Claude Code の新規セッションにそのまま投入する構成を推奨します。

    #2467

    を対象に、impl-review-loop で production implementation → verification → adversarial PR review → fix loop を実行し、actual merge の直前、canonical draft_pr_ready / merge-ready 相当の終了点まで、人間の iteration approval を求めず自律的に完遂してください。

    Issue #2467 は既に issue-refinement-loop による refinement が完了し implementation-ready です。

    Refinement completion の audit reference:
    #2467 (comment)

    ただし、この過去コメント、過去 readiness artifact、過去 body digest、過去 handoff result を Step 1 authorization として再利用してはいけません。

    現行 live Issue と現行 repository HEAD を authority とし、fresh preflight から開始してください。

    最上位の実行方針

    最初に .claude/skills/impl-review-loop/SKILL.md をロードし、そこから参照される canonical procedure / steps / command registry / workflow safety boundary を正本として実行してください。

    特に impl-review-loop の Root-Owned Synchronous Entry Transition を守ってください。

    root/main thread が同一の継続した control flow 内で、

    1. capability preflight
    2. live Issue 実装: impl-review-loop の runtime_only VC adjudication を current-head evidence に安全に接続する #2467 fetch
    3. current-run issue-contract-review
    4. live Issue の再取得
    5. root_entry_router.py / run_root_transition() による fresh routing
    6. route が invoke_impl_review_loop の場合のみ Step 1 起動

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

    過去の LOOP_HANDOFF_RESULT_V1、contract snapshot URL、refinement completion comment、body SHA、artifact 等を persistent authorization token のように扱わないでください。

    今回の request 自体が Issue #2467 の implementation を開始し、canonical impl-review-loop を merge 実行直前まで進める明示的な OWNER intent です。

    人間承認について

    通常の implementation / verification / review / fix iteration の継続について、私への確認を求めないでください。

    以下はすべて、この依頼の範囲内では追加の人間承認なしで実行して構いません。

    • canonical linked worktree の作成・利用
    • implementation branch の作成
    • Issue 実装: impl-review-loop の runtime_only VC adjudication を current-head evidence に安全に接続する #2467 の Allowed Paths 内のファイル読み書き
    • implementation-worker による実装
    • 必要な formatter / typecheck / lint / pytest / test / build の実行
    • Issue に列挙された Verification Commands の実行
    • bounded runtime smoke の実行
    • commit の作成
    • canonical controlled publish lane を通した branch push
    • Draft PR の作成
    • PR body の canonical hygiene 修正
    • current branch の通常の fast-forward / merge-only update
    • current-head CI の確認と bounded retry
    • test-runner による再検証
    • pr-reviewer による再レビュー
    • REQUEST_CHANGES findings の修正
    • stale-head の再レビュー
    • main drift の canonical reconciliation
    • mergeability / required checks の再取得
    • impl-review-loop 完遂に必要な controlled GitHub comments / status updates
    • repository が canonical procedure として既に許可しているその他の reversible / bounded actions

    これらについて「実行してよいですか」「次の iteration に進んでよいですか」「push してよいですか」「PR を作ってよいですか」と質問しないでください。

    Claude Code runtime の permission prompt と repository workflow の human approval gate は別物です。
    runtime が既に許可している操作はそのまま実行し、repository loop 上の不要な approval gate を独自に追加しないでください。

    permission 境界に遭遇した場合も、単なる SubAgent の human_review_required: true 自己申告を human veto と解釈せず、現行 impl-review-loop の routing policy に従ってください。

    絶対に実行しないこと

    PR の actual merge は行わないでください。

    また、以下も merge の代替として勝手に実行しないでください。

    • gh pr merge
    • GitHub API による merge
    • auto-merge の enable
    • merge commit を main へ直接 push
    • protected/default branch への直接実装 push
    • force push / history rewrite を安全境界の回避策として使用
    • --no-verify 等による canonical safety check の迂回

    最終地点は、現行 impl-review-loop が定義する approved / draft_pr_ready 相当、すなわち 人間が merge 判断だけを残した状態です。

    PR の Draft/Ready 状態については独自判断で canonical procedure を変更せず、現行 Issue Delivery Rule と impl-review-loop の正本に従ってください。

    Issue #2467 の contract を厳守

    実装対象・Acceptance Criteria・Verification Commands・Allowed Paths・Stop Conditions は、開始時に fresh fetch した 現在の Issue #2467 本文を正本にしてください。

    特に現行 contract の設計意図を維持してください。

    scope creep を避け、Issue #2467 の bounded tooling fix に限定してください。

    SubAgent を必ず使用する

    main/root orchestrator 自身が implementation・verification・review を肩代わりしないでください。

    canonical impl-review-loop に従って、少なくとも以下の SubAgent lane を使用してください。

    Step 1

    implementation-worker

    • implement-issue skill を実行
    • canonical linked worktree 上で実装
    • Allowed Paths を厳守
    • tests / commit / Draft PR 作成まで canonical procedure に従う
    • REQUEST_CHANGES 後は最新 blockers を fix_delta として受け取って修正

    Step 2

    test-runner

    Step 4

    pr-reviewer

    • pr-review-judge の canonical procedure に従う
    • current PR head のみをレビュー
    • Issue AC、Allowed Paths、actual diff、Verification evidence、required CI を照合
    • blockers があれば REQUEST_CHANGES
    • blockers がなく current-head review が成立した場合のみ APPROVE

    必要な repository investigation を canonical procedure が SubAgent に委譲する場合も、その routing に従って構いません。

    ただし Issue #2467 の Stop Conditions に抵触する nested SubAgent delegation を新たに必要とする設計へ変更してはいけません。

    SubAgent の完了を必ず待つ

    これは重要です。

    SubAgent を dispatch しただけで次の Step へ進まないでください。

    dependency-critical な SubAgent は可能なら foreground で実行してください。

    background execution になった場合も、完了通知を待たずに root が作業を推測して先へ進むことを禁止します。

    repository の Common Completion Protocol を厳守してください。

    各 dispatch site で必ず、

    1. spawn_agent の返却から canonical task_name を保存する。
    2. wait_agent で対象 agent の activity / completion を待つ。
    3. timeout、途中経過、steer response、partial mailbox message を「完了」とみなさない。
    4. SubAgent の final result を実際に取得・consume する。
    5. 続けて list_agents を実行し、その canonical task name が terminal completed であることを確認する。
    6. final result と terminal completed の両方が確認できてから次の routing を決める。

    errored / interrupted / shutdown / not_found は成功として扱わないでください。

    「background agent を開始しました。完了通知を待ちます」とだけ出して処理を終了することも禁止します。

    必要な SubAgent が残っている間は、その completion を current session 内で待ち、結果を join してから次工程へ進んでください。

    SubAgent が API error 等で failure した場合は、partial output を完成結果として扱わず、canonical bounded retry / recovery routing に従ってください。

    implementation / review loop

    Step 1 → Step 2 → Step 4 → Step 5 を canonical に反復してください。

    Verification failure

    Step 2 が blocking の場合:

    • Step 4 を起動しない
    • failure evidence を fix_delta にする
    • implementation-worker に戻して修正
    • candidate HEAD が変わったら verification evidence を stale として破棄
    • current head で Step 2 を再実行

    REQUEST_CHANGES

    pr-reviewer が REQUEST_CHANGES の場合:

    • blockers を正確に LOOP_STATE.blockers_history / fix_delta へ保持
    • 人間へ確認せず implementation-worker に戻す
    • 修正
    • test-runner 再実行
    • current-head gate を再構築
    • pr-reviewer 再実行

    を自動継続してください。

    stale head

    reviewed_head_sha != current PR head の場合、人間へ確認せず current head で re-review してください。

    BEHIND / main drift

    canonical route_to_update_branch / route_scope_clean_reconciliation が選ばれた場合は、その mechanical action と再検証・再レビューを自動実行してください。

    fail_closed warning

    UNKNOWN / BLOCKED / UNSTABLE / DRAFT 等で canonical policy が bounded retry / current-head CI evaluator への委譲を定めている場合、直ちに人間へ escalation せず、その routing を完遂してください。

    Iteration budget

    この implementation は bounded scope なので、通常の default 3 iteration をまず使用してください。

    同一 root session 内で canonical procedure が明示的に continuation を許可し、単にレビュー修正を収束させるためだけに追加 iteration が必要な場合は、repository policy が許す範囲で 最大 6 iteration まで継続して構いません。

    iteration ごとの人間承認は求めないでください。

    ただし max-iteration の canonical hard gate を超えて無限ループしたり、counter をリセットして迂回してはいけません。

    hard stop

    「承認不要」は hard safety / scope gate の無効化を意味しません。

    現行 Issue / impl-review-loop が本当に停止を要求する次のようなケースでは、fail-closed を維持してください。

    • Issue の Allowed Paths 外の変更が本当に必要
    • Issue contract の固定スキーマ / scope 自体の変更が本当に必要
    • 新規 Issue に分割しなければ成立しない
    • 実装: Reliability V1: workflow-run 統計単位と power contract を整合させる #2432 等の別 scope 変更が必要
    • secret/protected-path Decision Gate の実 hard failure
    • actual Git conflict (mergeable == CONFLICTING / merge_state_status == DIRTY)
    • pr-reviewer の正式な verdict: HUMAN_REVIEW_REQUIRED
    • current credentials では genuinely 不可能な repository operation
    • canonical retry/recovery を使い切った runtime failure
    • max iteration hard gate 到達

    逆に、artifact missing、stale telemetry、SubAgent の単なる human_review_required: true 自己申告、mergeability UNKNOWN の一時状態など、現行 policy が warning / retry として扱うものを独自の human approval gate に格上げしないでください。

    runtime verification

    Issue #2467 は runtime-loaded extension surface を変更するため、Issue contract が指定する Runtime Verification Applicability: immediate を実施してください。

    現在の Claude Code session / repository configuration のみを使用し、新 credential / 新 external service / privilege escalation を要求しない bounded runtime smoke にしてください。

    特に、

    • canonical runtime_only producer envelope + matching current-head evidence → nonblocking
    • baseline skip only / malformed or stale binding → blocking

    を actual candidate implementation 上で確認してください。

    .claude/agents/test-runner.md を変更した後の agent discovery については、現行 impl-review-loop の bounded live-reload / fresh runtime recovery policy に従ってください。

    agent discovery の一時的な not found を即 human escalation にせず、canonical recovery を実行してください。

    最終判定

    verdict: APPROVE 単独で終了しないでください。

    canonical route_loop_verdict_v2() が少なくとも、

    • pr-reviewer verdict = APPROVE
    • reviewed head == current PR head
    • blockers == []
    • Step 2 current-head gate valid
    • required verification / CI satisfied
    • live mergeability が canonical approvable state (CLEAN / HAS_HOOKS 等)
    • actual Git conflict なし

    を満たして route: approved と判定するまでループしてください。

    その状態に到達したら actual merge は実行せず停止してください。

    最終報告

    完了時は簡潔に次を報告してください。

    途中経過の説明だけでセッションを終了せず、canonical hard stop が発生しない限り、この依頼の current session 内で implementation → verification → review → fixes → re-verification → re-review を完遂してください。

    補足すると、max_iterations=6 は私が「承認問い合わせを減らす」目的で追加した推奨値です。repository の標準値は 3 なので、正本への忠実性を最優先するならその段落だけ削除して default 3 のままでも構いません。#2467 は scope が限定されているため、まず 3 回で収束させる方が自然です。

    また、Claude Code の current background-agent semantics を考えると、今回のような直列依存の loop では「SubAgent を foreground 優先」と書いた点が有効です。background でも Claude Code は completion notification を待つ仕様ですが、repository 側の final result + list_agents completed の二重確認まで明示したことで、以前の「background task を開始したまま session が止まる」パターンをかなり抑えられます。 (Claude)

  9. self-assigned this
    on Sep 2, 2026
  10. squne121 commented on Sep 2, 2026

    @squne121
    OwnerAuthor

    root-owned entry router audit

    route: stop
    reason: review_verdict_blocked

  11. squne121 commented on Sep 2, 2026

    @squne121
    OwnerAuthor

    root-owned entry router audit

    route: invoke_impl_review_loop
    reason: fresh_review_go_live_equality

  12. squne121 commented on Sep 2, 2026

    @squne121
    OwnerAuthor

    implement-issue: 実装完了 (2026-09-02)

    • PR: feat: impl-review-loop の runtime_only VC adjudication を current-head evidence に安全に接続する #2483
    • Worktree: .claude/worktrees/issue-2467-impl-review-loop-runtime-only-vc-adjudic
    • Branch: worktree-issue-2467-impl-review-loop-runtime-only-vc-adjudic
    • Head SHA: 0b434cf056579afba0784abe21120273be463c62
    • Verification: AC1〜AC9 個別コマンドすべて PASS(AC9 統合実行含む)、AC8 grep 検証 2 件 PASS。pnpm typecheck / pnpm lint / pnpm test(1874 tests)/ pnpm build すべて PASS。uv run pytest .claude/skills/gemini-cli-headless-delegation/tests/test_model_routing.py も PASS。
    • 動作検証(Runtime Verification Applicability: immediate, applicable_acs: AC1/AC2/AC8): 実 baseline_vc_preflight.py を real git repository 上で subprocess 実行し、canonical runtime_only envelope が current-head 独立 binding 成立時のみ Step 4 gate を開く正常経路、baseline-only 実行・改ざん envelope が Step 4 gate を開かない negative 経路の両方を test_adjudicate_vc_result_e2e_runtime_only.py で実行し PASS を確認した(PR 本文 Checks 節参照)。
    • 後続: PR レビュー(pr-review-judge)→ マージ → post-merge-cleanup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

agent/implementerenhancementphase/implementation

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions