feat: フック検出対象を副作用持ち4関数に縮小しソフトガードとして再定義 (v0.33.0) - #62
Merged
Conversation
- Narrows enforce-skill-usage.sh to guard only 4 side-effect helpers: codex_run_exec, codex_run_review, codex_save_session_state, codex_save_thread - Removes broad speculative patterns (source/HELPERS=/CODEX_PROMPT) to reduce false positives - Tightens marker detection: only line-start 'export CODEX_SKILL_CONTEXT=1' bypasses guard - Adds test cases 18-22 covering new behaviors (substring bypass blocked, multiline export allowed) - Updates block message to document soft-guard purpose and not-a-security-boundary intent - Adds Sunset criteria section to docs/bash-usage.md - Syncs enforce-skill-usage.md description and detection logic Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
PreToolUse フックの検出対象を副作用持ちヘルパー 4 関数に縮小し、マーカー判定を厳格化、フックの位置づけを「内部 API の偶発的誤用を防ぐソフトガード」として再定義します(Plan 007、v0.33.0)。
背景
「このフックは過剰ではないか」という問題提起を受け、Claude(廃止派)と Codex(存続派)による Devil's Advocate レビュー(3 ラウンド)を実施しました。評決は CONDITIONAL — 即時全廃は否決、ただし以下の条件での縮小存続が合意されました。本 PR はその承認条件 6 項目の実装です。
HELPERS=等)の検出は誤検知リスクと維持コストだけを生む議論の完全ログ:
tmp/devils-advocate/20260612-120332-24936.md(ローカル)変更内容
hooks/enforce-skill-usage.sh
codex_run_exec/codex_run_review/codex_save_session_state/codex_save_threadの実行位置検出のみに。source /HELPERS=/$HELPERS/CODEX_PROMPTの広域パターン 6 本を削除export CODEX_SKILL_CONTEXT=1のみ認識(echo 内などの言及ではバイパス不可)hooks/test-enforce-skill-usage.sh(17 → 22 ケース)
HELPERS=・CODEX_PROMPT・純粋変換のパイプ実行)の期待値を反転ドキュメント
docs/bash-usage.md: Detection Patterns 表を 1 行に集約、Sunset criteria(全廃を再検討する 3 条件)を新設hooks/enforce-skill-usage.md: 検出ロジック記述と description をソフトガード定義に同期バージョン
検証
Sunset 条項
以下のいずれかが観測された場合、フック全体の廃止を再検討します(docs/bash-usage.md に成文化済み):
🤖 Generated with Claude Code