Repository navigation
test(hooks): map agent-config sources to the tests their names miss - #12
Merged
Merged
Conversation
The Stop verification hook selects tests by file name unless the project declares related_test_extensions.json. agent-config had none since the split from dotfiles, so changes to rule JSON, settings, and shared hook libraries missed consumers such as tests/test_command_permission_sync.py. Port the dotfiles mapping to the tests/ layout, drop entries for files that stayed in dotfiles, and add the agent-config-only consumers (herdr ownership, worktree cleanup, shell inspection, entry points, skill assets). A contract test checks that every pattern matches a repository file, every target exists, and representative sources select the tests their names do not match. Refs #8 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Drop the agents/hooks/*.py and agents/codex/hooks/*.py patterns: fnmatch lets * cross directories, so they claimed every hook module for test_python_runtime and suppressed the full-suite fallback for sources without their own mapping. Name the rendered entry points instead. Add consumers that read or load the mapped sources (codex config and herdr ownership for settings and hooks.json, replay and provider tests for the guards, verification status/reuse/lock tests for the check modules, audit and suppression tests for the input parsers), and drop targets that never read the source. Only count index paths that still exist when checking that patterns match repository files. Refs #8 Co-Authored-By: Claude Opus 5.5 <[email protected]>
test_hook_lock_wait.py runs Stop verification through session_gate.selected_checks(), which reads related_test_defaults.json. Refs #8 Co-Authored-By: Claude Opus 5.5 <[email protected]>
7 tasks
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.
概要
Stop 検証フックは,プロジェクトに
.agents/hooks/rules/related_test_extensions.jsonがなければファイル名だけでテストを選ぶ.agent-config は dotfiles から分かれて以来この表を持たず,ルール JSON や設定,共有のフック用ライブラリを変えてもtests/test_command_permission_sync.pyのような名前の合わないテストが選ばれなかった.Refs #8(実装計画: #8 (comment) の test-map レーン)
変更内容
.agents/hooks/rules/related_test_extensions.jsonを追加8e61ceb^)の表をtests/agents/...からtests/...へ読み替えたnix/**,zsh/,herdr/など)と,消費するテストがないflake.nix・flake.lock・.gitignoreの項目は外したagents/hooks/*.pyとagents/codex/hooks/*.pyは外した.fnmatch の*は/もまたぐため,lib/配下の未対応モジュールまでtest_python_runtime.pyだけに割り当て,全体テストへのフォールバックを止めていた.代わりに描画される entry point を個別に対応させたshell_inspection,herdr_grammar,replay,provider アダプタ,検証の状態・再利用・ロック待ち,explain-visuallyスキルの assets などagents/AGENTS.md→test_guard_file.py,secret_*JSON →test_verification_rule.pyなど)は外したtests/test_related_test_extensions.pyを追加check_selection.language_planが名前で一致しないテストを選ぶ確認
uv run --frozen pytest:2530 passed(初回コミット時点)ruff check,ruff format --check,ty check:問題なしall-greenpassレビュー
test_hook_lock_wait.py)も対応した計画との差分
なし.
tests/bootstrap_server.batsは描画済みのsettings.jsonを読むが,bootstrap レーンの範囲なので表には入れていない🤖 Generated with Claude Code