Repository navigation
docs: hook active-enforcement claim を behavioral workflow contract に訂正 - #2256
Conversation
#2193) local_main_branch_guard.sh/.py・worktree_scope_guard.sh は PR #1691 (commit f971a95) で .claude/settings.json の hooks.PreToolUse から 削除済みだが、pr-reviewer.md・pr-review-judge/SKILL.md・ scope-rollup-runner.md・impl-review-loop/steps/preparation.md の4ファイルは これらが raw `gh pr review` や scope_rollup.run 逸脱形状を現在も technically block しているという現在形の active-enforcement claim を 含んでいた。classifier/policy 実装の存在(skill_runtime_command_policy.py)と project-hook wiring の有無、canonical execution contract を区別し、 behavioral workflow contract / executor 側の自己規律として記述し直す。 Co-Authored-By: Claude Sonnet 5 <[email protected]>
Preview URL✅ verified live assets: https://squne121.github.io/loop-protocol/pr-2256/ The preview will be removed when this PR is closed. |
impl-review-loop verdict (2026-08-19)Mergeability: mergeable=MERGEABLE, merge_state_status=CLEAN (verified via Evidence Check: AC1-AC6 independently re-verified against live Issue #2193 body Verification Commands at this head. Allowed Paths compliance confirmed (only the 4 target files changed; Blockers: none Non-blockers: none verdict: APPROVE
reviewed_head_sha: "0a928b2f9e272387a92c97952a7f0da738c7bba2"
blockers: []
warnings: [] |
結論PR #2256 は 中心となる訂正――「 敵対的レビュー findings
中心訂正の検証結果
しかも現在 wiring されている 外部仕様とも一致します。Claude Code の
#1601 との semantic collision も処理されています。OWNER decision は CI も reviewed head 推奨 dispositionverdict: APPROVE
reviewed_head_sha: 0a928b2f9e272387a92c97952a7f0da738c7bba2
blockers: []
warnings:
- "Out-of-scope の hook/Codex 資産に stale wiring claim が残存。別 Issue で repository-wide sweep を推奨"
- "`executor 側の自己規律` は caller/orchestrator/Skill behavioral contract と表現するとより厳密"
- "current wiring の現在形コピーは将来 drift し得るため、不変の authority statement を主文にすることを推奨"このPR自体は止める必要はありません。 高品質化するなら、#2256 を再拡張するより、残存 topology drift を別 Issue に切り出すのがスコープ・OWNER decision・#1860 minimal-harness 方針のいずれにも整合します。 head が更新された場合だけ、このレビューを current-head に対して再実行する運用もできます。 |
…s.json 主張)を実態に合わせて修正する (#2268) * fix: stale hook wiring claim(PreToolUse/.codex/hooks.json 主張)を実態に合わせて修正する (#2262) #2193/#2256 で確立した「hook は技術的強制ではなく Agent/Skill 側の behavioral contract として記述する」方針を repo 全体の残存箇所へ適用する。 - .claude/hooks/local_main_branch_guard.sh: project .claude/settings.json PreToolUse に登録されていない実態に合わせ、wrapper existence / project wiring / workflow authority を分離して記述 - .codex/hooks/local_main_branch_guard.sh: .codex/hooks.json が SessionEnd/SubagentStop の passive recorder のみである実態に合わせて修正 - .codex/rules/default.rules: worktree_scope_guard が .codex/hooks.json に wiring されていない実態に合わせてコメント修正 - docs/dev/hook-boundaries.md: 固定 PreToolUse 実行順序の節を除去し project settings 宣言ベースの記述へ置換。hook_boundaries_manifest_v1 から local_main_branch_guard/worktree_scope_guard の active PreToolUse entry を 除去し、agent 判断表・Codex parity 節の stale claim も修正 - tests/test_hook_boundaries_doc.py: manifest 修正に伴い drift-free assertion へ更新(#1690 の暫定 known-exception を解消) Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix: hook-boundaries.md の gh CLI 5分類テーブル欠落を修正 (#2262) AC6 修正で hook_boundaries_manifest_v1 の local_main_branch_guard PreToolUse entry を削除した際、同ブロック内にあった無関係な gh CLI コマンド5分類(#1124)テーブルと allow 条件2節も誤って 削除されていた。PreToolUse wiring とは独立した guard 内部の 分類ロジックとして「## 3. agent 判断表」節末尾に復元する。 Co-Authored-By: Claude Sonnet 5 <[email protected]> * fix: check_hook_boundaries drift 空集合への追随と probe scripts 記述復元(#2262 iteration 3) CI python-test-core の 4 件の失敗を修正する。 - docs/dev/hook-boundaries.md に probe scripts (git_ref_probe.py / git_worktree_probe.py) が DETERMINISTIC_CHECKER_ALLOWLIST に登録済みである旨の 記述を、gh CLI 5分類節(PreToolUse 未登録の behavioral contract として独立)に 復元する。AC6 の manifest entry 削除で消えていた #1197 由来の記述を、stale wiring claim を再導入しない形で回復する。 - AC6 の manifest entry 削除により check_hook_boundaries.py の drift が旧 #1690 既知 2 件から空集合へ変わったため、これを hard-code していた .claude/hooks/tests/test_generate_session_manifest_from_hook.py と .claude/hooks/tests/test_local_main_branch_guard.py の期待値を空集合へ更新する。 Scope Delta: 上記 2 テストファイルおよび shim である scripts/agent-guards/tests/test_local_main_branch_guard.py を Allowed Paths に 追加(Issue #2262 本文で記録済み)。 * fix: hook-boundaries.md 見出しの日本語比率不足を解消(#2262 iteration 4) CI PR Body Japanese Check が docs/dev/hook-boundaries.md の見出し「### deterministic_checker_command と probe scripts(#1197)」 (ratio=0.043, jp=1, total=23)を per-block 閾値 0.1 未満として fail させていた。 見出しに日本語プロースを追加し「登録範囲」という語を補って閾値を満たすよう修正した。 identifiers(deterministic_checker_command / probe scripts / #1197)の意味は変更していない。 * fix: OWNER REQUEST_CHANGES対応 — .codex/rules/default.rules 残存3件と広域 sweep で見つかった active claim を修正 (#2262) PR #2268 への OWNER REQUEST_CHANGES (comment 5355203571) の fix_delta 対応。 P1 (merge blocker): - .codex/rules/default.rules: git worktree remove / git branch -d / force-rename branch の3 justification に残っていた「worktree_scope_guard が arbitrate/deny する」 という現在形の因果主張を、非 wiring 実態(.codex/hooks.json は SessionEnd/SubagentStop passive recorder のみ)に合わせて修正 - 意味ベースの repository-wide sweep(arbitrates/denies/wired/block される 等)で 以下の active claim を追加検出し修正: - .claude/skills/post-merge-cleanup-executor/SKILL.md(Scope Delta) - docs/dev/agent-skill-boundaries.md(Scope Delta) - docs/dev/session-recording-policy.md(Scope Delta。#783 由来の 「active PreToolUse handlers」節見出し・prose を historical 化) - docs/dev/hook-boundaries.md(既存 Allowed Paths 内。§12/§12c/§12d の 「block される」現在形記述を behavioral contract 表現へ修正) - docs/dev/hook-boundaries.md §9: 5 handler の positive list 列挙を削除し、 hook_boundaries_manifest_v1 + check_hook_boundaries.py を authority とする negative invariant 表現に統一 P2: - docs/dev/hook-boundaries.md §3: 「project PreToolUse behavioral contract」の qualifier を local_main_branch_guard / worktree_scope_guard の2行に限定 分類結果(要約): 上記 active claim 修正箇所以外の worktree_scope_guard / local_main_branch_guard 言及は、explicit-negative(既に #1691 未wiring と明記) または historical/code-reference(テストファイル名・import文・classifier registry コード等)であり、追加の active claim は見つからなかった。 Scope Delta: 元 Issue #2262 の Allowed Paths に含まれない .claude/skills/post-merge-cleanup-executor/SKILL.md / docs/dev/agent-skill-boundaries.md / docs/dev/session-recording-policy.md を OWNER 指摘に基づき追加編集した。 --------- Co-authored-by: Claude Sonnet 5 <[email protected]>
Summary
local_main_branch_guard.sh/.py・worktree_scope_guard.shは PR #1691(commitf971a95d)により.claude/settings.jsonのhooks.PreToolUseから既に削除されていますが、以下4ファイルは rawgh pr reviewやscope_rollup.runの逸脱形状を現在も technically block しているという現在形の active-enforcement claim を残していました。.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本 PR はこれら4ファイルの該当記述を、hook による現在の技術的強制ではなく behavioral workflow contract / executor 側の自己規律として説明する記述に訂正します。classifier/policy 実装の存在(
skill_runtime_command_policy.py)と、current project-hook wiring の有無、canonical/supported execution contract という3概念を明確に区別しました。mutation policy・実行手順・command_id/argv 定義など、他の記述には影響を与えていません。Checks
rg -n 'local_main_branch_guard' .claude/agents/pr-reviewer.md .claude/skills/pr-review-judge/SKILL.md→ 0 match(AC1 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→ 全 match が classifier/policy existence と wiring 不在の区別を明示(AC2 PASS)rg -n -e 'local_main_branch_guard' -e 'worktree_scope_guard' .claude/settings.json→ exit code 1 / no match(AC3 PASS。repo-controlled project PreToolUse への未 wiring のみを証明し、effective runtime 全体での不在は主張しない)pr-reviewer.md/scope-rollup-runner.md)と Skill側(pr-review-judge/SKILL.md/impl-review-loop/steps/preparation.md)の両方で同じ stale claim パターンが解消済み(AC4 PASS)gh pr review/scope_rollup.run/run_scope_rollup_preflight/skill_runtime_execの各 match は behavioral workflow contract / deterministic executor policy の文脈で使用されており、branch protection / CI / repository permission の代替としては記述していない(AC5 PASS)git diff --check→ クリーン(構文健全性 PASS)Schema Change Applicability
_RESULT_V*契約、CLI 引数シグネチャ等)のフィールド構造・キー集合・型定義には一切変更を加えていません。Schema Consumer Inventory
N/A
reason: schema 自体を変更していないため、新規 consumer inventory の追加はありません。
Safety Claim Matrix
pr-reviewer.md/pr-review-judge/SKILL.mdに rawgh pr reviewを現在 technically block するという active-enforcement claim が残っていないrg -n 'local_main_branch_guard' .claude/agents/pr-reviewer.md .claude/skills/pr-review-judge/SKILL.md(no match)scope-rollup-runner.md/impl-review-loop/steps/preparation.mdで classifier/policy existence・project-hook wiring・canonical execution contract の3概念が混同されていないgit diff --checkクリーン + diff 内の変更行が active-enforcement claim の文言のみに限定されていることを目視確認.claude/settings.jsonを変更していない(read-only 参照のみ)git status --short(.claude/settings.jsonが変更ファイル一覧に含まれない)local_main_branch_guard.py/.sh、worktree_scope_guard.sh)自体、docs/dev/hook-boundaries.mdは変更していないgit status --short(Allowed Paths 4ファイルのみ変更)Notes
f971a95d)、調査: PreToolUse hook chain(local_main_branch_guard/worktree_scope_guard)の繰り返し誤ブロックを踏まえ無効化・縮小・現状維持の方針を決定する #1690・導入: AIエージェント運用をminimal harnessへ縮退し、過剰なcontrol-planeを廃止する #1860・実装: Agent/Skill の重複を削減し progressive disclosure へ移行する #1732(Required Design References)#1601との semantic collision: precedence#2193 before #1601。#2193の完了を#1601の実装完了待ちにしません。#1601は実装着手前に current main /#1690/#1860/#1732を基準とした fresh な issue-refinement-loop 再実行を要します(Issue 本文の該当セクション参照)。.claude/hooks/local_main_branch_guard.sh/worktree_scope_guard.shの.claude/settings.json再登録、hook script 自体の実装修正、.claude/settings.jsonの変更、docs/dev/hook-boundaries.mdの変更、scope_rollup.runのskill_runtime_exec.py統合実装(#1601の scope)、hooks 全体の再設計。decision: not_applicable(repository instruction/documentation の訂正のみであり、claim を repo-controlled project configuration の記述に限定するため)。