Skip to content

refactor(hooks): name the check modules by responsibility - #118

Merged
furedea merged 1 commit into
mainfrom
refactor/unify-check-module-names
Sep 17, 2026
Merged

furedea merged 1 commit into
mainfrom
refactor/unify-check-module-names

Conversation

@furedea

@furedea furedea commented Sep 16, 2026

Copy link
Copy Markdown
Owner

Summary

Stacked on #117. Behavior-preserving rename so the Stop gate uses one vocabulary: session_* for session state, check_* for the helpers that plan, run, and interpret one check.

Before After Responsibility
agents/hooks/lib/verification_selection.py check_selection.py select Invocations from changed paths
agents/hooks/lib/verification_output.py check_evidence.py interpret runner output as Evidence
agents/hooks/lib/session_checks.py check_execution.py execute one check with a bounded budget
tests/agents/hooks/test_verification_selection.py test_check_selection.py
tests/agents/hooks/test_verification_output.py test_check_evidence.py

verification_* was the prefix of the standalone runner removed in #117; session_checks.py never depended on session state. Follow-ups: imports in session_gate.py and check_execution.py, the related_test_extensions.json key (check_*.py, now also mapping to the gate tests that exercise execution), test_verification_rule.py, and the deptry first-party list.

verification_session.py (provider-facing entry point) and the related_test_*.json / RUN_RELATED_TESTS_* names stay: they are documented, deployed names.

Verification

  • uv run --frozen pytest: 961 passed
  • deptry, vulture, ruff format/check, ty, dprint via lefthook

Rollout

Mac: rebuild. Server: git pull and re-run install_server.sh.

🤖 Generated with Claude Code

Copilot AI lite review requested due to automatic review settings September 16, 2026 14:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@furedea
furedea added this pull request to stack #122 September 16, 2026 15:56
@furedea
furedea force-pushed the refactor/unify-check-module-names branch from 7557327 to ed8e231 Compare September 17, 2026 03:08
Base automatically changed from chore/remove-legacy-verification-runner to main September 17, 2026 03:10
The Stop gate mixed session_* state modules with verification_* helpers left from the old runner.

Name the helpers by what they do: check_selection, check_evidence, and check_execution.

session_checks.py never depended on session state, so it joins the check family.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@furedea
furedea force-pushed the refactor/unify-check-module-names branch from ed8e231 to f93ac8d Compare September 17, 2026 03:10
@furedea
furedea merged commit b70fa72 into main Sep 17, 2026
11 checks passed
@furedea
furedea deleted the refactor/unify-check-module-names branch September 17, 2026 03:12
furedea added a commit that referenced this pull request Sep 17, 2026
## Summary

Stacked on #118. Behavior-preserving renames that finish the vocabulary
cleanup of the hooks.

| Before | After | Why |
| --- | --- | --- |
| `agents/hooks/guard_dangerous_git.py` | `guard_git.py` | every guard
is `guard_<target>`, like `guard_command` and `guard_file`; the danger
judgement stays in `git_safety.py` |
| `agents/codex/hooks/hook_translation.py` | `hook_adapter.py` | the
README calls these files Codex hook adapters |
| `tests/agents/hooks/test_dangerous_git_contract.py` |
`test_guard_git.py` | |
| `tests/agents/codex/test_hook_translation_cli.py` |
`test_hook_adapter_cli.py` | |
| `tests/agents/hooks/test_quality_cli.py` | `test_lint_format_cli.py` |
one word for the lint hook |

`lint_format.py` used three words for one concept (`lint_format` in the
file name and `hooks.json`, `lint/format` in the Codex status message,
`Quality check` in its output and in one test file). Its messages now
read `Lint/format failed` / `Lint/format unavailable`, and the tests
alias the module as `lint_format`. Audit log identifiers such as
`guard_dangerous_git.sh` are historical labels and stay unchanged.

Follow-ups: `hooks.json` (11 hook commands), the adapter import and
usage text, `related_test_extensions.json` keys and targets,
`test_verification_rule.py`, `agent_hook.bats`, and the deptry
first-party list. The fake `hook_translation.py` filename inside the
`install_server` bats fixtures is left for a later PR because #116 edits
those files.

## Verification

- `uv run --frozen pytest`: 961 passed
- `bats tests/agents/agent_hook.bats`: rendered harness exposes
`.codex/hooks/hook_adapter.py`
- `deptry`, `vulture`, ruff format/check, ty, dprint via lefthook

## Rollout

Mac: rebuild (hook commands change names). Server: `git pull` and re-run
`install_server.sh`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Fable 5.1 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants