Skip to content

refactor(hooks): align guard, adapter, and lint names - #119

Merged
furedea merged 1 commit into
mainfrom
refactor/align-hook-vocabulary
Sep 17, 2026
Merged

furedea merged 1 commit into
mainfrom
refactor/align-hook-vocabulary

Conversation

@furedea

@furedea furedea commented Sep 16, 2026

Copy link
Copy Markdown
Owner

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

Copilot AI lite review requested due to automatic review settings September 16, 2026 15:05

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 added a commit that referenced this pull request Sep 17, 2026
## Summary

Stacked on #116. `install_server.sh` read as "install a server";
ADR-0030 and the README call it the server bootstrap, so the script and
everything named after it now say `bootstrap_server`.

| Before | After |
| --- | --- |
| `scripts/agents/install_server.sh` |
`scripts/agents/bootstrap_server.sh` |
| `tests/agents/install_server.bats` |
`tests/agents/bootstrap_server.bats` |
| `INSTALL_SERVER_MACHINE`, `INSTALL_SERVER_ENV` |
`BOOTSTRAP_SERVER_MACHINE`, `BOOTSTRAP_SERVER_ENV` |
| `~/.config/dotfiles/install_server.env` |
`~/.config/dotfiles/bootstrap_server.env` |

Follow-ups: README, the CI bats path, the helper functions in
`tests/agents/test-helper/setup.bash`, and the fake rendered file name
in the bats fixtures (`hook_translation.py` -> `hook_adapter.py`,
matching #119). ADR-0030 keeps its original wording as a point-in-time
record.

No host has created `install_server.env` yet, so the settings file
rename has no migration.

## Verification

- `bats tests/agents/bootstrap_server.bats`: 13 passed
- shellcheck, shfmt, actionlint, autocorrect via lefthook

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

Co-authored-by: Claude Fable 5.1 <[email protected]>
@furedea
furedea force-pushed the refactor/align-hook-vocabulary branch from eaa33af to 270db3a Compare September 17, 2026 03:08
@furedea
furedea force-pushed the refactor/align-hook-vocabulary branch from 270db3a to fcbb1e5 Compare September 17, 2026 03:10
Base automatically changed from refactor/unify-check-module-names to main September 17, 2026 03:12
guard_dangerous_git.py becomes guard_git.py so every guard is named after its target.

The Codex adapter becomes hook_adapter.py, matching the README vocabulary.

The lint hook, its tests, and its messages now say lint/format instead of quality.

Audit log identifiers keep their historical names.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@furedea
furedea force-pushed the refactor/align-hook-vocabulary branch from fcbb1e5 to c4ae059 Compare September 17, 2026 03:12
@furedea
furedea merged commit 3d7713b into main Sep 17, 2026
11 checks passed
@furedea
furedea deleted the refactor/align-hook-vocabulary branch September 17, 2026 03:13
furedea added a commit that referenced this pull request Sep 17, 2026
…ord (#121)

## Summary

Stacked on #119. Two commits that finish the vocabulary of
`verification_session.py` and the `session_*` modules; behavior is
unchanged apart from the CLI words.

### CLI (`90dbf51`)

| Before | After | Why |
| --- | --- | --- |
| `claude\|codex start` | `claude\|codex session-start` | native event
names throughout; `pre` was the only truncated one |
| `claude\|codex pre` | `claude\|codex pre-tool-use` | |
| `claude\|codex stop` | `claude\|codex stop` | unchanged |
| `claude\|codex end` | `claude\|codex session-end` | |
| `check <record>` | `verify <record>` | `check` now means one runner
invocation (`check_*`, receipts); this command runs the whole gate |
| `retry <record>` | `verify --force <record>` | a forced rerun, not a
retry of a failure |

`hooks.json` (8 commands) and the README follow. Retired and malformed
invocations print usage and exit 1 (covered by a new parametrized test).

### Internals (`f0349bb`)

- `session_store.Run` -> `SessionRecord`, variables `run` -> `record`;
the JSON dicts that shared the word are now `baseline` and `receipt`;
`prune_run` / `run_directories` -> `prune_record` / `record_directories`
- `session_gate.stop` -> `gate` (it was named after the event it
serves); `record_skip` -> `save_skip`
- `verification_session.registered_run` -> `registered_record`

`verification_session.py` itself keeps its name: every subcommand is a
lifecycle operation on a registered verification session, and the ADR,
README, and state directory already use that word.

## Verification

- `uv run --frozen pytest`: 967 passed
- ruff format/check, ty, dprint, autocorrect via lefthook

## Rollout

Mac: rebuild (`hooks.json` commands change). Server: `git pull` and
re-run the bootstrap script. Anyone calling `verification_session.py
check` by hand switches to `verify`.

🤖 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