Skip to content

実装: pr-reviewer.md/scope-rollup-runner.md のhook根拠記述を#1691後の実態に合わせて修正する #2193

Closed

Description

@squne121

Parent Issue

なし(単独改善)

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "#2192"
change_kind: docs

Parent Goal Ref

なし(親 Issue なし)。関連する調査は #2192(Claude-GPT運用ログレトロスペクティブ)。

Current Validated Scope

以下4ファイル中、hook(local_main_branch_guard.sh/.py、worktree_scope_guard.sh)を現在形の active enforcement 根拠として引用している箇所。いずれも .claude/settings.json の hooks.PreToolUse に当該2 hookが登録されていない現状と矛盾する記述である。

  • .claude/agents/pr-reviewer.md(該当行付近: 「完了時の返却」節、local_main_branch_guard.sh が生 gh pr review を gh_mutation_denied として拒否する、という記述)
  • .claude/skills/pr-review-judge/SKILL.md(該当行付近: 生 gh pr review を直接呼び出してはならない、local_main_branch_guard.sh が拒否する、という記述。実装: Agent/Skill の重複を削減し progressive disclosure へ移行する #1732 の Agent/Skill ownership 方針では permission・prohibition の詳細は Skill 側が owner であり、本ファイルが実質的な訂正対象の正本)
  • .claude/agents/scope-rollup-runner.md(該当行付近: 「scope_rollup.run exact executor 実行」節、local_main_branch_guard.py に登録された exact command class としてのみ許可される、という記述)
  • .claude/skills/impl-review-loop/steps/preparation.md(該当行付近: local_main_branch_guard.py がこの exact invocation のみを canonical root context で allow する、という記述)

Remaining Parent Gaps

なし。本 Issue 単体で完結する。

Outcome

上記4ファイルのコミットが更新され、以下の意味論に整合した状態になる。

  • pr-reviewer consumer surface(pr-reviewer.md + pr-review-judge/SKILL.md): raw formal gh pr review を使用しないことは、reviewer と呼び出し元(orchestrator)間の behavioral workflow contract として説明される。local_main_branch_guard.sh が現在技術的にこれを拒否している、という active enforcement claim は含まれない。local_main_branch_guard.sh/.py は現在 .claude/settings.json の hooks.PreToolUse に登録されていない(commit f971a95d, PR chore: local_main_branch_guard / worktree_scope_guard の2 hook を緊急停止する #1691)ことを踏まえた記述にする。
  • scope_rollup consumer surface(scope-rollup-runner.md + impl-review-loop/steps/preparation.md): scope_rollup.run の exact command class が skill_runtime_command_policy.py(ScopeRollupRunCommand/parse_scope_rollup_run_command/is_scope_rollup_run_command)に classifier/policy として現に存在すること と、それが Claude project PreToolUse に wiring されていること を区別する。現在 wiring されていないため、raw 形状からの逸脱を Claude Code hook レベルで technically block しているとは記述しない。canonical invocation 形状(run_scope_rollup_preflight.py への直接 exact-match dispatch。現時点で skill_runtime_exec.py には統合されていない独立レーン)への準拠は、Skill/executor 側の自己規律(workflow/producer-consumer 契約)として維持される、という記述にする。
  • branch protection / CI / repository permission は merge/repository safety の重要な境界だが、「raw gh pr review を禁止する仕組み」「scope_rollup.run を allow する仕組み」の直接的代替としては説明しない。

いずれも .claude/rules/project-constitution.md の「hook は fail-closed ローカルガードレールでありセキュリティ境界ではない」という既定方針、および #1860(minimal-harness Owner Decision)・#1732(Agent/Skill ownership、hook non-authority方針)と整合する。

In Scope

  • .claude/agents/pr-reviewer.md の該当記述を、hook による技術的強制ではなく behavioral workflow contract として訂正する。
  • .claude/skills/pr-review-judge/SKILL.md の該当記述(local_main_branch_guard.sh が拒否する、という現在形 claim)を同様に訂正する。
  • .claude/agents/scope-rollup-runner.md の該当記述を、classifier/policy existence と project-hook wiring を区別する記述へ訂正する。
  • .claude/skills/impl-review-loop/steps/preparation.md の該当記述を同様に訂正する。
  • 訂正後も4ファイルの他の記述(mutation policy、実行手順、command_id/argv 定義等)には影響を与えない。
  • 必要に応じて local_main_branch_guard/worktree_scope_guard への言及自体は残してよいが、その場合は「現在 project PreToolUse に wiring されていない」旨、または「歴史的経緯(PR chore: local_main_branch_guard / worktree_scope_guard の2 hook を緊急停止する #1691)」であることが文脈上明確であること。

Out of Scope

  • .claude/hooks/local_main_branch_guard.sh/worktree_scope_guard.sh を .claude/settings.json へ再登録すること(別の設計判断であり本 Issue のスコープ外)。
  • hook script(local_main_branch_guard.py/.sh、worktree_scope_guard.sh)自体の実装修正。
  • .claude/settings.json の変更。
  • docs/dev/hook-boundaries.md の変更(本 Issue の repo change scope には含めない。当該文書は current .claude/settings.json と topology drift があり、known-stale / non-normative for active wiring として扱うが、本 Issue ではこの文書自体を修正しない)。
  • scope_rollup.run を skill_runtime_exec.py の sibling exact profile へ統合する実装(#1601 の scope。本 Issue はドキュメント/instruction 文言の実態整合のみを扱い、#1601 の実装着手を待たない)。
  • hooks 全体の再設計。

Acceptance Criteria

  • AC1: .claude/agents/pr-reviewer.md と .claude/skills/pr-review-judge/SKILL.md において、local_main_branch_guard が raw formal review を現在技術的に拒否するという active-enforcement claim が0件であること。guard 名を歴史的経緯・classifier existence の説明として残す場合は、「現在 repo-controlled project PreToolUse に wiring されていない」または「この behavioral contract の authority ではない」旨が明確であること。
  • AC2: .claude/agents/scope-rollup-runner.md と .claude/skills/impl-review-loop/steps/preparation.md において、(a) classifier/policy implementation の存在、(b) current project-hook wiring の有無、(c) supported/canonical execution contract、の3概念が混同されていないこと。local_main_branch_guard.py が repo に存在することだけを Claude project runtime enforcement の証拠として記述しないこと。
  • AC3: 現在の .claude/settings.json に local_main_branch_guard/worktree_scope_guard が project PreToolUse handler として wiring されていないことを確認する。本 AC から effective runtime 全体(user/local/managed policy/plugin/Skill・Agent frontmatter を含む)での不在を推論・主張しない。
  • AC4: #1732 の ownership boundary(command/routing 詳細は Skill 側が owner)と矛盾せず、Agent 側ファイルだけを修正して Skill 側に同じ stale claim を残さないこと。
  • AC5: branch protection / CI / repository permission と、behavioral workflow contract / deterministic executor policy の責務が分離して説明されていること(前者を後者の技術的代替として記述しない)。
  • AC6: 本 Issue 本文において、#1601 が semantic collision として記録され、precedence: #2193 before #1601 および #1601 は実装着手前に fresh refinement(current main / #1690 / #1860 / #1732 基準の再評価)を要する ことが明文化されていること(本 AC は Issue 本文自体の完全性を指し、コード変更の検証対象ではない)。

Verification Commands

単純な zero-match 判定ではなく、以下各コマンドの match 行を reviewer が active_enforcement_claim / classifier_or_policy_existence / historical_note / explicit_non_wired_note のいずれかに分類する。分類基準: 「拒否する」「blockする」「防ぐ」等の能動的enforcement動詞を伴い、かつ「現在wiringされていない」旨のdisclaimerを伴わない行は active_enforcement_claim。

# AC1
# baseline-expect: pass
$ rg -n 'local_main_branch_guard' .claude/agents/pr-reviewer.md .claude/skills/pr-review-judge/SKILL.md

PASS 基準: match 行のうち active_enforcement_claim に分類される行が0件。

# AC2
# baseline-expect: pass
$ rg -n -e 'local_main_branch_guard' -e 'worktree_scope_guard' .claude/agents/scope-rollup-runner.md .claude/skills/impl-review-loop/steps/preparation.md

PASS 基準: match 行のうち active_enforcement_claim に分類される行が0件。かつ classifier/policy existence の記述と project-hook wiring の記述が明確に区別されていること(reviewer 目視)。

# AC3
# baseline-expect: fail
$ rg -n -e 'local_main_branch_guard' -e 'worktree_scope_guard' .claude/settings.json

PASS 基準: exit code 1(無match)。このコマンドの成功は「repo-controlled project PreToolUse への未wiring」のみを証明し、effective runtime全体での不在は主張しない。

# AC4
# baseline-expect: pass
$ rg -n -e 'local_main_branch_guard' -e 'worktree_scope_guard' .claude/agents/pr-reviewer.md .claude/agents/scope-rollup-runner.md .claude/skills/pr-review-judge/SKILL.md .claude/skills/impl-review-loop/steps/preparation.md

PASS 基準: Agent側ファイル(pr-reviewer.md/scope-rollup-runner.md)と Skill側ファイル(pr-review-judge/SKILL.md/impl-review-loop/steps/preparation.md)の両方で同じ stale claim パターンが解消されていること(Agent側だけが直り Skill側に残る不整合が0件)。

# AC5
# baseline-expect: pass
$ rg -n -e 'gh pr review' -e 'scope_rollup\.run' -e 'run_scope_rollup_preflight' -e 'skill_runtime_exec' .claude/agents/pr-reviewer.md .claude/skills/pr-review-judge/SKILL.md .claude/agents/scope-rollup-runner.md .claude/skills/impl-review-loop/steps/preparation.md

PASS 基準: 各 match が、branch protection/CI/repository permission ではなく behavioral workflow contract / deterministic executor policy の文脈で使われていることを reviewer が目視確認する。

# AC6
# baseline-expect: pass
$ gh issue view 2193 --repo squne121/loop-protocol --json body

PASS 基準: 出力 body に #2193 before #1601 の precedence 記述と #1601 の fresh refinement 要求記述が含まれていることを reviewer が目視確認する(本 AC はコード diff ではなく Issue 本文自体の完全性を検証する)。

# 構文健全性
# baseline-expect: pass
$ git diff --check -- .claude/agents/pr-reviewer.md .claude/skills/pr-review-judge/SKILL.md .claude/agents/scope-rollup-runner.md .claude/skills/impl-review-loop/steps/preparation.md

Allowed Paths

  • .claude/agents/pr-reviewer.md
  • .claude/skills/pr-review-judge/SKILL.md
  • .claude/agents/scope-rollup-runner.md
  • .claude/skills/impl-review-loop/steps/preparation.md
  • .claude/settings.json(read-only、AC3 の Verification Command が参照するために追加。本 Issue の Out of Scope により書き込み変更は行わない)

これ以外の新しい repository path が必要になった場合のみ、新規の scope change stop condition とする。上記2 Skill path および .claude/settings.json(read-only参照)の追加自体は 2026-08-19 の OWNER decision(issuecomment 経由、「少なくとも以下4ファイルへ拡張する」という指示範囲内の付随的な検証専用参照)で承認済みであり、再度の human escalation 理由にしない。

Required Design References

  • #1690(hook削除の completed disposition)
  • PR #1691(local_main_branch_guard.sh/.py・worktree_scope_guard.sh を .claude/settings.json の hooks.PreToolUse から削除した merge済みPR、commit f971a95d)
  • #1860(minimal-harness Owner Decision。hook を security/admission authority として扱わない方針)
  • #1732(Agent/Skill ownership 方針。command/routing/permission/prohibition の詳細は Skill 側が owner。hook を authority・security boundary・dependency・AC にしない方針)
  • .claude/rules/project-constitution.md(「hook は fail-closed ローカルガードレールでありセキュリティ境界ではない。セキュリティ上の保護は branch protection / GitHub Actions CI / repository permission で行う」)
  • 現在の .claude/settings.json(hooks.PreToolUse 現行登録一覧。local_main_branch_guard/worktree_scope_guard は不在)
  • docs/dev/hook-boundaries.md は current .claude/settings.json と topology drift があるため、known-stale / non-normative reference for active wiring として扱う(本 Issue では修正しない。参照する場合も active topology の正本として無条件に使用しない)。#1691 単独を policy authority にしない。

#1601 との Semantic Collision

  • collision_type: semantic
  • related_issue: #1601
  • precedence: #2193 before #1601
  • rationale: #2193 は current main に存在する stale enforcement claim を現在の事実へ訂正する即時 remediation であり、#1601(scope_rollup.run を skill_runtime_exec.py の sibling exact profile へ統合する設計)の実装完了を待つ必要はない。#1601 の中核 intent(integrate_sibling_profile)自体は現在の architecture でも保持すべき candidate として残るが、hook の Claude project 再wiring や hook を authorization/security authority とする旧契約は既定事項として引き継がない。
  • #1601 implementation prerequisite: #1601 は実装着手前に current main / #1690 / #1860 / #1732 を基準とした fresh な issue-refinement-loop 再実行を要し、古い hook-authority / settings-cutover 前提を再評価すること。
  • #2193 の完了を #1601 の実装完了待ちにしない。

Required Skills

なし

Delivery Rule

1 Issue = 1 PR。作業は dedicated worktree で行い、Draft PR を既定とする。

Runtime Verification Applicability

  • decision: not_applicable
  • reason: repository instruction/documentation の訂正のみであり、claim を repo-controlled project configuration(.claude/settings.json)の記述に限定するため。user/local/managed policy/plugin/Skill・Agent frontmatter を含む effective runtime 全体の hook 不在は本 Issue では主張しない。もし refinement/実装中に「effective runtime 全体で hook が存在しない」という強い claim が必要になった場合は、その時点で本 decision を見直し、/hooks 等による effective configuration inventory の証跡を要求する。

Stop Conditions

  • Allowed Paths 外の変更が必要と判明した場合(Allowed Paths は上記4ファイル)。
  • In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合。
  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)。
  • 後続 Phase / 別スコープへの波及が判明した場合。
  • nested SubAgent delegation が必要になった場合。
  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合。
  • hooks 再設計(local_main_branch_guard.sh/worktree_scope_guard.sh の settings.json 再登録、hook script 自体の実装修正、docs/dev/hook-boundaries.md の修正)が必要と判明した場合は follow-up issue へ分離する。
  • scope_rollup.run の skill_runtime_exec.py 統合実装(#1601 の scope)が必要と判明した場合は本 Issue に含めず #1601 側で扱う。
  • 2026-08-19 の OWNER decision(Allowed Paths 4ファイル拡張・#1601 precedence・#2193 before #1601)でカバーされていない新規の architecture/scope change が発生した場合のみ human escalation する。「Skill 2ファイルが当初 Allowed Paths に無かった」「#1601 の precedence が未決定だった」という、今回既に解決済みの理由では再度 human escalation しない。

Notes for Reviewer

Scope Collision (C1): related_issue=#1909, #1661, #1601; overlapping_paths=.claude/agents/pr-reviewer.md, .claude/agents/scope-rollup-runner.md。#1909(bounded local context bundle生成)・#1661(scope-rollup-runner capture timestamp修正)は本Issueの「hook根拠記述の実態整合」という単一意図とは非重複。#1601 は semantic collision として上記セクションで precedence を明示済み(#2193 before #1601)。実装着手前に #1909/#1661 該当PRのマージ状況を確認し、必要ならrebaseする。

本 Issue は 2026-08-19 に OWNER decision(human escalation 後の reframe 承認)を経て、Allowed Paths を2ファイルから4ファイルへ拡張し、#1601 との precedence を確定した。SubAgent調査(instruction ownership auditor / #1601 scope-rollup contract auditor / verification scope auditor)の結果を反映済み。

Related

#2192(本Issueの根拠となったretrospective research issue)、#1691(hooks縮小の経緯)、#1601(semantic collision、precedence: #2193 before #1601)、#1690・#1860・#1732(Required Design References)

Activity

  1. squne121 commented on Aug 18, 2026

    @squne121
    OwnerAuthor

    結論

    REQUEST_CHANGES / reframe_in_place を推奨します。
    #2193 の問題認識――「#1691 後も Agent 定義が、現在は project hook として接続されていない guard を技術的 enforcement 根拠として説明している」――自体は正しいです。問題は、現契約のまま2ファイルだけ直すと、同じ stale claim を production instruction 側に残したまま「修正完了」にできることです。さらに、置換先として指定している「branch protection / CI / repository permission が実際の安全境界」という説明も、pr-reviewer と scope_rollup.run の両方にはそのまま適用できません。

    1. [P0] Allowed Paths が実際の instruction ownership を取りこぼしています。 pr-reviewer.md は pr-review-judge Skill を preload する構成ですが、その pr-review-judge/SKILL.md 自身が現在も「raw gh pr review は local_main_branch_guard.sh が gh_mutation_denied で拒否する」と説明しています。同様に、scope-rollup-runner.md を呼び出す impl-review-loop/steps/preparation.md も、local_main_branch_guard.py が exact invocation だけを canonical root で allow すると現在形で説明しています。つまり 実装: pr-reviewer.md/scope-rollup-runner.md のhook根拠記述を#1691後の実態に合わせて修正する #2193 の2ファイルだけを修正しても、実行時に参照される Skill/Step には同じ誤根拠が残ります。しかも 実装: Agent/Skill の重複を削減し progressive disclosure へ移行する #1732 の現行設計では command/routing 詳細を Skill 側の owner とする方針なので、Agent だけ直すのはその所有境界とも逆行します。

    2. [P0] 実装:scope_rollup.runをskill_runtime_execのsiblingexactprofileへ統合する #1601 は「同一ファイルへの編集競合」ではなく、契約上の意味衝突です。 実装: pr-reviewer.md/scope-rollup-runner.md のhook根拠記述を#1691後の実態に合わせて修正する #2193 は「hook 再登録は Out of Scope、実態に合わせて enforcement claim を撤去する」としています。一方 OPEN の 実装:scope_rollup.runをskill_runtime_execのsiblingexactprofileへ統合する #1601 は scope-rollup-runner.md、settings.json、local_main_branch_guard.py、hook-boundaries.md 等を変更し、Claude/Codex guard を canonical allow / legacy deny に揃えることを現在も要求しています。実装: pr-reviewer.md/scope-rollup-runner.md のhook根拠記述を#1691後の実態に合わせて修正する #2193 の Notes にある「PR 状況を確認して必要なら rebase」では解消できません。実装:scope_rollup.runをskill_runtime_execのsiblingexactprofileへ統合する #1601 を 導入: AIエージェント運用をminimal harnessへ縮退し、過剰なcontrol-planeを廃止する #1860 の executor/minimal-harness 方針へ reframe するか、実装: pr-reviewer.md/scope-rollup-runner.md のhook根拠記述を#1691後の実態に合わせて修正する #2193 と明示的な precedence/dependency を設定する必要があります。 実装:scope_rollup.runをskill_runtime_execのsiblingexactprofileへ統合する #1601 には現在コメントによる後続 disposition もありません。

    3. [P1] Required Design Reference が既に stale です。 docs/dev/hook-boundaries.md は「.claude/settings.json に設定されている hooks の SSOT」を名乗りながら、local_main_branch_guard / worktree_scope_guard を blocker・fail-closed hook として現在も manifest に保持しています。一方、実際の .claude/settings.json の PreToolUse にはその2つはありません。chore: local_main_branch_guard / worktree_scope_guard の2 hook を緊急停止する #1691 自体は当初「緊急停止・調査: PreToolUse hook chain(local_main_branch_guard/worktree_scope_guard)の繰り返し誤ブロックを踏まえ無効化・縮小・現状維持の方針を決定する #1690 の判断待ち」という性格でしたが、その後 調査: PreToolUse hook chain(local_main_branch_guard/worktree_scope_guard)の繰り返し誤ブロックを踏まえ無効化・縮小・現状維持の方針を決定する #1690 が removal を completed として確定しています。したがって 実装: pr-reviewer.md/scope-rollup-runner.md のhook根拠記述を#1691後の実態に合わせて修正する #2193 は chore: local_main_branch_guard / worktree_scope_guard の2 hook を緊急停止する #1691 単独ではなく 調査: PreToolUse hook chain(local_main_branch_guard/worktree_scope_guard)の繰り返し誤ブロックを踏まえ無効化・縮小・現状維持の方針を決定する #1690 + 導入: AIエージェント運用をminimal harnessへ縮退し、過剰なcontrol-planeを廃止する #1860 + 実装: Agent/Skill の重複を削減し progressive disclosure へ移行する #1732 を policy authority にすべきで、hook-boundaries.md は少なくとも「known-stale topology reference」と明記しない限り normative reference にできません。

    4. [P1] AC3 は検証になっておらず、「未登録」の意味も広すぎます。 grep -c "hooks.PreToolUse" .claude/settings.json は PreToolUse キーの存在しか見ておらず、問題の2 handler が登録されているかを検証していません。さらに現行 Claude Code では hooks は project .claude/settings.json だけでなく、user settings、local settings、managed policy、plugin、Skill/Agent frontmatter からも導入されます。したがって .claude/settings.json だけを見て証明できるのは **「repo-controlled project hook として未登録」**までです。「現在の runtime で hook が存在しない」とまで書くなら /hooks 等による effective configuration の runtime inventory が必要で、Runtime Verification Applicability: not_applicable とは両立しません。 ([Claude]1)

    5. [P1] 「hook → branch protection/CI/repository permission」への単純置換は、別の誤記になります。 導入: AIエージェント運用をminimal harnessへ縮退し、過剰なcontrol-planeを廃止する #1860/実装: Agent/Skill の重複を削減し progressive disclosure へ移行する #1732 の現在の方針は、safety を live Issue/PR、deterministic executor、repository binding、postcondition readback、実 diff/test、current-head CI、独立 review、人間 stop で構成し、hook を authority にしない、というものです。scope_rollup.run については現在も skill_runtime_command_policy.py に exact command class が存在し、local_main_branch_guard.py にその classifier/allow branch 自体も残っています。問題なのはclassifier が存在しないことではなく、Claude project hook としてその classifier が現在 wiring されていないことです。ここを「branch protection が代わりに enforcement する」と書くのは不正確です。

    6. [P1] pr-reviewer も「禁止理由」と「merge safety」を分離すべきです。 GitHub CLI の gh pr review 自体は approve/comment/request-changes を生成できる正規コマンドであり、GitHub は PR author 自身の approve を拒否します。一方 branch protection は protected branch への merge、required review/status check 等を制御する機構であって、「reviewer が raw gh pr review を呼べない」ことを保証する機構ではありません。よってここは「raw formal review を使わず、reviewer は verdict を caller に返し、orchestrator が通常コメントとして publish する」という behavioral workflow contract を根拠にすべきです。現在の project settings は旧2 hook を持たず、gh pr review 系 Bash 自体は permission surface に存在するため、なおさら「技術的に拒否される」とは書けません。([GitHub CLI]2)

    推奨する reframe

    #2193 は廃棄ではなく in-place 改訂が適切です。Allowed Paths を少なくとも pr-reviewer.md + pr-review-judge/SKILL.md のペアまで広げ、scope-rollup 側は scope-rollup-runner.md + impl-review-loop/steps/preparation.md を同一 consumer surface として扱うのが妥当です。ただし後者は #1601 の disposition を先に確定させるべきです。#1909/#1661 は主にファイル単位の競合ですが、#1601 だけは semantic collision として hard dependency 扱いが必要です。

    訂正文の意味は、pr-reviewer 側では「旧 hook は repo の project PreToolUse に現在接続されておらず、raw formal review を使用しないことは reviewer/orchestrator の behavioral contract である」とするのが正確です。scope-rollup 側では「exact classifier/policy の実装は存在するが、local_main_branch_guard は現在 Claude project PreToolUse に wiring されていない。canonical invocation は supported execution contract と deterministic policy/executor に基づく」と分離すべきです。#1860 の minimal-harness 方針とも整合します。

    Verification も grep -c hooks.PreToolUse では不足です。少なくとも以下のような consumer-wide inventory にし、zero-match を機械的成功条件にするのではなく、残る言及が「classifier existence」「historical note」「active enforcement」のどれかを reviewer が区別する契約にした方がよいです。

    rg -n \
      'local_main_branch_guard|worktree_scope_guard' \
      .claude/agents/pr-reviewer.md \
      .claude/skills/pr-review-judge/SKILL.md \
      .claude/agents/scope-rollup-runner.md \
      .claude/skills/impl-review-loop/steps/preparation.md \
      .claude/settings.json \
      .codex/hooks.json
    
    rg -n \
      'gh pr review|scope_rollup\.run|run_scope_rollup_preflight|skill_runtime_exec' \
      .claude/agents/pr-reviewer.md \
      .claude/skills/pr-review-judge/SKILL.md \
      .claude/agents/scope-rollup-runner.md \
      .claude/skills/impl-review-loop/steps/preparation.md \
      scripts/agent-guards/skill_runtime_command_policy.py
    
    git diff --check

    なお、現在の Claude Code 公式仕様では同一 event に一致する hooks は並列実行され、完了順も保証されません。リポジトリ自身も #1735 でこの仕様を認識済みなので、古い hook-chain の直列実行前提まで hook-boundaries.md から引き継がない方が安全です。([Claude]1)

    したがって現状の #2193 は実装着手不可です。 主要修正は「2 Agent ファイルだけの文言訂正」から「実際の Agent/Skill/caller instruction surface の根拠整合」に変えること、#1601 の precedence を確定すること、そして「project hook 未登録」と「runtime 全体で enforcement 不在」を混同しないことです。これらを直せば、小さな docs-only remediation としてかなり明確になります。

    PR化後に current head で同じ観点を再監査する運用も設定できます。

  2. squne121 commented on Aug 18, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop 終了報告(human_judgment_required)

    対象コメント: #2193 (comment)

    Step 0f preflight (run_refinement_preflight.py) が STATUS: blocked / NEXT_ACTION: human_judgment_required を返したため、Step 1 以降には進まず終了します。

    Blocker: structural_repair_action:structural_human_review_required_items_present

    詳細:

    • Machine-Readable Contract セクションの parent_issue フィールドが、テンプレート照合(.github/ISSUE_TEMPLATE/implementation.yml)上 observed_cardinality: 0(必須値が確認できない)と判定されました。
    • 本文には parent_issue: null および ## Parent Issue に「なし(単独改善)」の記載がありますが、structural repair checker は missing_required_field_without_exact_source(自動導出できる明示ソースがない欠落)として disposition: human_review_required に分類しています。
    • 自動修復候補(insertion)は生成されていますが、disposition が human_review_required のため自動適用対象外です。

    Must Read:

    • .claude/agents/pr-reviewer.md
    • .claude/agents/scope-rollup-runner.md
    • .claude/rules/project-constitution.md
    • .claude/settings.json

    人間判断: parent_issue: null の記法がテンプレート契約上有効かどうか(checker 側の false positive の可能性を含む)を確認し、必要であれば Machine-Readable Contract の記法を修正のうえ refinement loop を再実行してください。

  3. squne121 commented on Aug 18, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop 終了報告(human_escalation・scope change stop condition)

    対象コメント: #2193 (comment)

    実施済みの機械的修正

    Step 0f preflight が検出した structural_repair_action blocker(Machine-Readable Contract の parent_issue: null がテンプレート契約 .github/ISSUE_TEMPLATE/implementation.yml の期待値 "#<parent-issue-number>|none" と型不一致)を parent_issue: "none" へ修正し、controlled issue_content.update transaction で適用済みです(readback 一致確認済み)。修正後、preflight は STATUS: warn / NEXT_ACTION: proceed_with_notes まで解消しました。

    停止理由(スコープ変更停止条件に該当)

    対象 anchor comment は REQUEST_CHANGES / reframe_in_place を推奨する実質的レビューであり、以下を要求しています:

    1. Allowed Paths の拡張: .claude/agents/pr-reviewer.md / .claude/agents/scope-rollup-runner.md に加え、.claude/skills/pr-review-judge/SKILL.md と .claude/skills/impl-review-loop/steps/preparation.md まで訂正対象を広げる必要がある(現在の instruction ownership 構造では、Agent ファイルだけの訂正では実行時に参照される Skill 側に同じ stale claim が残るため)。
    2. 新規の依存関係決定: OPEN Issue 実装:scope_rollup.runをskill_runtime_execのsiblingexactprofileへ統合する #1601(scope-rollup-runner.md / settings.json / local_main_branch_guard.py / hook-boundaries.md の変更を要求)との precedence/dependency を明示的に確定する必要がある。これは同一ファイル競合ではなく契約上の意味衝突。
    3. 検証方式の全面変更: grep -c "hooks.PreToolUse" ベースの AC3 検証を、classifier existence / historical note / active enforcement を区別する consumer-wide inventory 方式へ置き換える必要がある。
    4. Required Design Reference の陳腐化: docs/dev/hook-boundaries.md が実態と乖離しており、policy authority を #1691 単独ではなく #1690 + #1860 + #1732 に変更する必要がある。

    これらは本 skill の「スコープ変更時の停止条件」(## Allowed Paths に新規ディレクトリや別アーキテクチャ層が追加された 等)に該当するため、loop_iteration_approval_gate(承認不要設定)の対象外として停止します。Step 0f preflight の runtime_evidence.route.action: human_escalation / implementation_allowed: false も同じ判定を示しています。

    人間判断が必要な事項

  4. squne121 commented on Aug 19, 2026

    @squne121
    OwnerAuthor

    推奨は、#2193 を reframe_in_place で続行し、#1601 は「#2193 の後続・実装前再レビュー必須」と明示する方針です。別 Issue への分離は勧めません。

    #1690 は既に local_main_branch_guard / worktree_scope_guard の project hook 削除を恒久方針として completed になっており、PR #1691 もその状態で merged です。 さらに #1860 は agent-local instruction/permission を security boundary にせず、live Issue/PR・実 diff/test・current-head CI・独立 review を authority とする方針を固定しています。 #1732 もこの判断を取り込み、現在の project settings に該当2 hook がないことを明示しています。

    一方、#1601 は close/not_planned にするべきではありません。親 #1580 の「scope_rollup.run を skill_runtime_exec sibling profile に統合する」という中核設計にはまだ独立した価値があり、current registry も現在は scope_rollup.run を direct worker に結び付けた旧経路のままです。 ただし #1601 の古い「Claude/Codex guard を canonical allow / legacy deny に揃える」「settings cutover」部分は #1690/#1860 後の authority model と衝突するため、実装前に current main から再 refinement するのが妥当です。#1601 は現在も OPEN かつ disposition comment がありません。

    また、#2193 の主張は「runtime 全体で hook が存在しない」ではなく、**「repo-controlled .claude/settings.json の project PreToolUse には接続されていない」**までに限定するべきです。Claude Code は user/local/managed/plugin、および Skill/Agent frontmatter からも hooks を導入できるためです。([Claude]1) これなら Runtime Verification Applicability: not_applicable を維持できます。

    Issue #2193 の issue-refinement-loop を human escalation 後から再開する

    対象 repository: squne121/loop-protocol

    対象:

    今回の人間判断

    human escalation に対する OWNER decision は以下で確定とする。

    1. 実装: pr-reviewer.md/scope-rollup-runner.md のhook根拠記述を#1691後の実態に合わせて修正する #2193 は別 Issue に分離せず reframe_in_place する。

    2. Allowed Paths を実際の instruction ownership に合わせ、少なくとも以下4ファイルへ拡張する。

      • .claude/agents/pr-reviewer.md
      • .claude/skills/pr-review-judge/SKILL.md
      • .claude/agents/scope-rollup-runner.md
      • .claude/skills/impl-review-loop/steps/preparation.md
    3. 実装: pr-reviewer.md/scope-rollup-runner.md のhook根拠記述を#1691後の実態に合わせて修正する #2193 を 実装:scope_rollup.runをskill_runtime_execのsiblingexactprofileへ統合する #1601 より先に処理する。

    4. 実装:scope_rollup.runをskill_runtime_execのsiblingexactprofileへ統合する #1601 の integrate_sibling_profile という中核 intent は、この作業では not_planned と断定しない。

      • scope_rollup.run を skill_runtime_exec の sibling exact profile に統合する設計自体は fresh review の対象として保持する。
      • 一方、Claude project hook の再 wiring や hook を authorization/security authority とする旧契約は既定事項として引き継がない。
    5. 実装: pr-reviewer.md/scope-rollup-runner.md のhook根拠記述を#1691後の実態に合わせて修正する #2193 では hooks の再登録・hook script の実装修正・settings.json の変更を行わない。

    6. docs/dev/hook-boundaries.md は current .claude/settings.json と topology drift があるため、active topology の normative authority として無条件に使用しない。

    7. 「hook が存在しない」という無限定な runtime claim は禁止する。

      • 言えるのは原則として「repo-controlled .claude/settings.json の project PreToolUse に当該 handler が wiring されていない」まで。
      • user settings / local settings / managed policy / plugin / Skill・Agent frontmatter 等を含む effective runtime 全体について不在を主張する場合は、別途 runtime inventory が必要。
      • 実装: pr-reviewer.md/scope-rollup-runner.md のhook根拠記述を#1691後の実態に合わせて修正する #2193 ではそのような強い runtime claim をしないため、Runtime Verification Applicability: not_applicable を維持してよい。

    最初に SubAgent 調査を行うこと

    root/main session から、少なくとも以下3系統の read-only SubAgent を並列起動すること。

    SubAgent A: instruction ownership auditor

    調査対象:

    • .claude/agents/pr-reviewer.md
    • .claude/skills/pr-review-judge/SKILL.md
    • .claude/agents/scope-rollup-runner.md
    • .claude/skills/impl-review-loop/steps/preparation.md
    • .claude/settings.json

    目的:

    SubAgent B: #1601 / scope-rollup contract auditor

    調査対象:

    目的:

    SubAgent C: verification / configuration-scope auditor

    調査対象:

    目的:

    • project .claude/settings.json の absence と effective runtime absence を区別する。
    • consumer-wide inventory の Verification Commands / AC を設計する。
    • Runtime Verification Applicability: not_applicable を維持可能か確認する。

    SubAgent 運用条件

    • SubAgent は read-only。
    • SubAgent から GitHub Issue/PR/repository への mutation を禁止する。
    • SubAgent 自身による nested SubAgent delegation を禁止する。
    • root session は 全 SubAgent が terminal state に到達するまで必ず待つこと。
    • 一部の SubAgent がまだ実行中の状態で Issue rewrite、comment 投稿、次ステップ移行を開始しないこと。
    • 全結果を root session が独立に照合し、矛盾があれば current main / live GitHub state を authority として解決すること。

    #2193 の reframe 方針

    SubAgent 完了後、issue-refinement-loop の controlled mutation 経路を使って #2193 を更新する。

    raw な場当たり的 gh issue edit で契約を書き換えず、repository が定義する controlled issue update transaction を利用すること。

    Outcome

    Outcome は「旧 hook 名を消すこと」ではなく、以下の意味にする。

    • pr-reviewer consumer surface:
      raw formal gh pr review を使用しないことは reviewer/orchestrator 間の behavioral workflow contract である。
      local_main_branch_guard.sh が現在技術的に拒否していることを根拠にしない。

    • scope_rollup consumer surface:
      exact classifier / policy implementation が repository に存在することと、
      Claude project PreToolUse に wiring されていることを区別する。
      現在 project hook として wiring されていない classifier を active enforcement 根拠として扱わない。

    • branch protection / CI / repository permission は merge/repository safety の重要な境界ではあるが、
      「raw gh pr review を禁止する仕組み」や
      「scope_rollup exact command を allow する仕組み」
      の直接的代替として説明しない。

    Allowed Paths

    以下4ファイルに限定する。

    • .claude/agents/pr-reviewer.md
    • .claude/skills/pr-review-judge/SKILL.md
    • .claude/agents/scope-rollup-runner.md
    • .claude/skills/impl-review-loop/steps/preparation.md

    これ以外の新しい repository path が必要になった場合のみ、新しい scope change stop condition とする。

    今回、人間が明示承認した上記2 Skill path の追加を再び human escalation 理由にしてはならない。

    Required Design References

    normative authority の優先順位を current architecture に合わせる。

    最低限:

    docs/dev/hook-boundaries.md は topology drift が解消されるまで
    known-stale / non-normative for active wiring
    として扱う。

    #1691 単独を policy authority にしない。

    #1601 collision / precedence

    #2193 本文に明示する。

    必要なら #1601 に OWNER disposition comment を controlled GitHub mutation で記録してよい。

    その場合、趣旨は以下とする。

    OWNER_DECISION_V1:
      status: re_review_required_before_implementation
      precedence: "#2193 before #1601"
      retained_candidate:
        - integrate_sibling_profile
      superseded_as_authority:
        - Claude project hook wiring as security/admission authority
        - stale fixed-base/dependency assumptions without current-main readback
        - hook-boundaries.md as unquestioned active-topology SSOT
      policy_authority:
        - "#1690"
        - "#1860"
        - "#1732"
      implementation_allowed_now: false

    ただし #1601 本文全体をこのセッションで機械的に再設計しない。
    #1601 自身の fresh issue-refinement-loop は別の implementation-start prerequisite として残す。

    Acceptance Criteria を再設計する

    少なくとも次を満たすようにする。

    AC1: pr-reviewer consumer surface

    以下2ファイルにおいて、local_main_branch_guard が raw formal review を現在技術的に拒否するという active-enforcement claim が0件。

    • .claude/agents/pr-reviewer.md
    • .claude/skills/pr-review-judge/SKILL.md

    guard 名を歴史説明等で残す場合は、
    historical / not wired as repo-controlled project PreToolUse /
    not the authority for this behavioral contract
    の意味が明確であること。

    AC2: scope-rollup consumer surface

    以下2ファイルで、

    • classifier/policy implementation の存在
    • current project-hook wiring
    • supported/canonical execution contract

    の3概念が混同されていないこと。

    • .claude/agents/scope-rollup-runner.md
    • .claude/skills/impl-review-loop/steps/preparation.md

    local_main_branch_guard.py が存在することだけを、
    Claude project runtime enforcement の証拠にしてはならない。

    AC3: project hook wiring claim

    current .claude/settings.json に
    local_main_branch_guard / worktree_scope_guard
    が project PreToolUse handler として wiring されていないことを確認する。

    この AC から effective runtime 全体での不在を推論しない。

    AC4: ownership consistency

    #1732 の ownership boundary と矛盾せず、
    command / routing details の owner が Skill 側である箇所について Agent だけを修正して stale duplicate を残さない。

    AC5: safety wording

    branch protection / CI / repository permission と、
    behavioral workflow contract / deterministic executor policy の責務を分離して説明していること。

    AC6: #1601 precedence

    #1601 が semantic collision として記録され、
    #2193 before #1601 および
    #1601 requires fresh refinement before implementation
    が明文化されていること。

    Verification Commands

    旧 grep -c "hooks.PreToolUse" 単独検証を廃止する。

    少なくとも以下の consumer-wide inventory を使う。

    rg -n \
      'local_main_branch_guard|worktree_scope_guard' \
      .claude/agents/pr-reviewer.md \
      .claude/skills/pr-review-judge/SKILL.md \
      .claude/agents/scope-rollup-runner.md \
      .claude/skills/impl-review-loop/steps/preparation.md \
      .claude/settings.json \
      .codex/hooks.json
    
    rg -n \
      'gh pr review|scope_rollup\.run|run_scope_rollup_preflight|skill_runtime_exec' \
      .claude/agents/pr-reviewer.md \
      .claude/skills/pr-review-judge/SKILL.md \
      .claude/agents/scope-rollup-runner.md \
      .claude/skills/impl-review-loop/steps/preparation.md \
      scripts/agent-guards/skill_runtime_command_policy.py \
      scripts/agent-guards/skill_runtime_exec.py \
      .claude/skills/issue-refinement-loop/scripts/command_registry.py
    
    rg -n \
      'local_main_branch_guard|worktree_scope_guard' \
      .claude/settings.json
    
    git diff --check

    結果は単純 zero-match 判定にしない。

    各 match を reviewer が以下へ分類すること。

    • active_enforcement_claim
    • classifier_or_policy_existence
    • historical_note
    • explicit_non_wired_note

    PASS 条件:

    • stale active_enforcement_claim = 0
    • classifier_or_policy_existence は runtime wiring と明確に分離
    • historical mention は現在形 enforcement と誤読できない
    • .claude/settings.json に対象2 handler の project PreToolUse wiring がない
    • effective runtime absence を証拠なしで主張していない

    Runtime Verification Applicability

    以下で固定してよい。

    • decision: not_applicable
    • reason:
      repository instruction/documentation の訂正のみであり、
      claim を repo-controlled project configuration に限定するため。
      user/local/managed/plugin/component hooks を含む effective runtime 全体の不存在は本 Issue では主張しない。

    もし refinement 中に
    「effective runtime 全体で hook が存在しない」
    という強い claim が必要になった場合のみ stop し、
    Runtime Verification Applicability の変更と /hooks 等の effective inventory evidence を要求すること。

    issue-refinement-loop を再開する

    #2193 body の controlled rewrite 後:

    1. readback して mutation が意図どおりか確認する。
    2. anchor comment 5334693502 を human-context / review input として保持する。
    3. 今回の OWNER decision を scope-change approval として扱う。
    4. preflight を current body に対して再実行する。
    5. structural blocker / semantic blocker を再評価する。
    6. issue-refinement-loop の review → rewrite → review を継続する。
    7. 機械的に修正可能な refinement blocker は追加承認を求めず修正する。
    8. 各 iteration で必要な SubAgent を root から直接起動してよいが、必ず完了を待つ。
    9. SubAgent の nested delegation は禁止。
    10. 新しい、今回の OWNER decision でカバーされていない architecture/scope change が発生した場合のみ human escalation する。

    終了条件

    このセッションでは repository implementation には着手しない。

    以下のいずれかまで進めて終了する。

    成功

    成功時は最後に以下を報告する。

    停止

    今回の OWNER decision では解けない新規 scope/architecture change、
    または実在する権限・external-service・contract incompatibility が発生した場合のみ停止する。

    単に
    「元の #2193 には Skill 2ファイルが Allowed Paths に無かった」
    「#1601 の precedence が未決定だった」
    という今回すでに解決済みの理由で再度 human escalation してはならない。

    この順序なら、まず誤った operational guidance を小さい #2193 で直し、その後 #1601 の executor 統合を current architecture に合わせて再設計する形になります。#1601 を先に完遂するまで #2193 を止め続ける必要はありません。

  5. squne121 commented on Aug 19, 2026

    @squne121
    OwnerAuthor

    issue-refinement-loop 終了報告(approved)

    対象 anchor comment: #2193 (comment)
    human escalation 終了報告: #2193 (comment)

    OWNER Decision 反映

    2026-08-19 の OWNER decision(reframe_in_place、Allowed Paths を4ファイルへ拡張、#2193 before #1601 precedence)を Issue 本文に反映し、read-only SubAgent 3系統(instruction ownership auditor / #1601 scope-rollup contract auditor / verification scope auditor)の調査結果を踏まえて Outcome / In Scope / AC / Verification Commands / Allowed Paths / Required Design References / #1601 semantic collision セクションを reframe した。#1601 へは OWNER_DECISION_V1 コメントを投稿済み(https://github.com/squne121/loop-protocol/issues/1601)。

    Iteration 数

    Step 4(rewrite)3 iteration(VC baseline-expect annotation 不足 → 修正、rg broad-search-path violation → .claude/settings.json を read-only Allowed Path として追加 → 修正)。最終 iteration で reviewer VERDICT: approve(BLOCKERS: 0)。

    Final Allowed Paths

    • .claude/agents/pr-reviewer.md
    • .claude/skills/pr-review-judge/SKILL.md
    • .claude/agents/scope-rollup-runner.md
    • .claude/skills/impl-review-loop/steps/preparation.md
    • .claude/settings.json(read-only、AC3 検証専用)

    #1601 disposition / precedence

    precedence: #2193 before #1601。#1601 の中核 intent(integrate_sibling_profile)は retained candidate として保持、hook を security/admission authority とする旧契約は superseded。#1601 側に OWNER_DECISION_V1(status: re_review_required_before_implementation)を記録済み。

    Runtime Verification Applicability

    not_applicable(repo-controlled project configuration の記述に限定、effective runtime 全体の不在は主張しない)。

    Remaining Blockers

    なし。

    impl-review-loop への handoff

    可(contract_review.status: go、readiness_status: go、vc_preflight_status: pass、body_sha256: sha256:f7df2b558d32f86db2fa35a646869dd243d0f467741c8535e9a1eeec93000a4b)。

    LOOP_HANDOFF_RESULT_V1:
      status: impl_ready
      routing_action: run_impl_review_loop
      contract_review:
        status: go
        gate_result: fresh_go
        latest_comment_url: null
        generated_at: "2026-08-19T10:21:00Z"
        body_sha256: "sha256:f7df2b558d32f86db2fa35a646869dd243d0f467741c8535e9a1eeec93000a4b"
      metadata:
        title_prefix_ready: true
      label_sync_observation:
        kind: presentation_sync
        result: noop
        detail: "label mutation not performed in this session"
      auto_fixes:
        result: auto_fixed
        required: []
        skipped: []
      blockers: []
      permissions:
        unavailable: []
      generated_at: "2026-08-19T10:21:00Z"
      checked_body_sha256: "sha256:f7df2b558d32f86db2fa35a646869dd243d0f467741c8535e9a1eeec93000a4b"
      checker_exit_code: 0
      missing_sections: []
      missing_contract_keys: []
  6. squne121 commented on Aug 19, 2026

    @squne121
    OwnerAuthor

    implement-issue: 実装完了 (2026-08-19)

    • PR: docs: hook active-enforcement claim を behavioral workflow contract に訂正 #2256
    • Worktree: .claude/worktrees/issue-2193-hook-active-enforcement-claim-fix
    • Branch: worktree-issue-2193-hook-active-enforcement-claim-fix
    • Verification: AC1/AC2/AC3/AC4/AC5 + git diff --check 全 PASS(Verification Commands をそのまま実行)
    • Allowed Paths: 4ファイルのみ変更(.claude/settings.json は read-only・無変更)
    • 後続: PR レビュー(pr-review-judge)→ マージ → post-merge-cleanup
  7. squne121 commented on Aug 19, 2026

    @squne121
    OwnerAuthor

    impl-review-loop: 完了 (2026-08-19T10:50:00Z)

    IMPL_REVIEW_LOOP_RESULT_V1:
      schema_version: 1
      status: draft_pr_ready
      pr_url: "https://github.com/squne121/loop-protocol/pull/2256"
      head_sha: "0a928b2f9e272387a92c97952a7f0da738c7bba2"
      issue_number: 2193
      termination_reason: approved
      merge_ready: true
      iteration: 1
    
    FOLLOW_UP_MATERIALIZATION_RESULT_V1:
      schema_version: 1
      materialized_by: impl-review-loop
      follow_up_issues: []
      note_only_observations: []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    phase/implementation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions