Repository navigation
fix: honor pytest testpaths and bootstrap bats on servers - #116
Merged
Merged
Conversation
Discovery walked the whole worktree and only pruned .venv and node_modules. Snapshot copies under .cache or experiments were collected and failed with import mismatches. Honor testpaths from pyproject.toml, drop changed tests outside them, and prune cache dirs. Explicit project mappings still run as written. Co-Authored-By: Claude Fable 5.1 <[email protected]>
A missing runner counts as a failure, so servers without bats blocked Stop in .bats projects. Install bats-core from its release archive under its own prefix and link it beside the tools. Co-Authored-By: Claude Fable 5.1 <[email protected]>
This was referenced Sep 16, 2026
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
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]>
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.
Summary
fix(hooks): Python verification honorstestpathsdeclared inpyproject.toml, drops changed tests that live outside those paths, and prunes common cache and build directories (.cache,build,dist,target,.tox,__pycache__,.pytest_cache,.ruff_cache,.mypy_cache) by default. Explicit.agents/hooks/rules/related_test_extensions.jsonmappings still run as written.feat(agents):scripts/agents/install_server.shinstalls bats-core 1.13.0 underBATS_PREFIX(default~/.local/share/bats-core) and links it intoBIN_DIR, because the Stop gate treats a missing runner as a failure.Why
On a shared server the Stop hook collected snapshot copies of tests under
.cache/andexperiments/next to the real suite (238 import mismatches, 8 ImportErrors) and reported bats as unavailable, so every Stop was blocked without any regression in the project.Verification
uv run --frozen pyteston the verification-related tests: 196 passed (3 new selection cases; Red observed for the two behavior changes first)bats tests/agents/install_server.bats: 13 passedRollout
Mac: rebuild. Server:
git pulland re-runinstall_server.sh.🤖 Generated with Claude Code