Two local hooks turn rules from #258 (items 2 and 4) into controls:
refuse-plugins (language: fail, files: ^plugins/). Its message is the rule: the Collection holds roles only, a plugin needs an ADR in docs/adr/ first, and that ADR's pull request removes this hook. It sits before ansible-lint, because that hook's fail_fast stopped the run before this message showed, which was seen in testing.
It refuses Co-Authored-By: lines naming a known agent: [email protected], a trailer whose whole name is Claude <…>, or Copilot, Cursor, Gemini or Codex.
A human co-author passes, including one whose first name is Claude.
pygrep prints only the hook's name and the matching line, so the name carries the rule.
Docs. The trailer rule's Held by in AGENTS.md and docs/contributing/ai-assistance.md now names the hook as a control in part. Other AI trailers and the presence of Assisted-by: stay held by review.
Where this departs from the issue's wording:
No ci image version edit.scripts/bump_image_versions.py no longer exists. images/AGENTS.md now says a pull request that changes an image input needs no version edit, because next_image_version.py assigns it on main.
No dev-setup.sh change.default_install_hook_types already lists commit-msg, and the script installs it.
No docs edit owed for the roles-only rule.#258 dropped its root clause, so the hook is where the rule lives.
No changelog fragment. This is contributor tooling and consumers don't see it.
Verified
pygrep runs at the commit-msg stage. Checked first in a scratch repo, then here with pre-commit run refuse-agent-trailers --hook-stage commit-msg --commit-msg-filename <f> on 12 messages, all as expected:
Passed: a human Co-Authored-By:, Claude Dupont <[email protected]>, Jane Cursorsmith, Assisted-by: Claude Code.
git commit of a staged plugins/x.py fails with the rule as the message.
This commit's own message passed the new hook through the installed commit-msg hook.
pre-commit run --all-files passes, including check-hooks-apply (it exempts language: fail hooks) and check-useless-excludes.
ansible-test sanity passed through the pre-push hook.
The code-review skill ran both axes (standards and spec). Fixed from its findings:
The Held by lines overclaimed a full control; they now say control in part.
\bclaude\b refused a human co-author named Claude.
The plugins comment repeated the hook's message.
Not verified
CI doesn't re-check the new hook. Lint's "Check Conventional Commits" step (lint.yml:141) runs only conventional-pre-commit per pull request commit. refuse-agent-trailers is therefore skipped by --no-verify, by a clone without scripts/dev-setup.sh, and by commits made through the forge. Adding it to that loop is a one-line workflow change, left out of this pull request for the maintainer to decide.
Agents outside the listed identities pass, for example Devin, aider, Jules or another @anthropic.com address. The issue gave its list as examples. A trailer indented with spaces isn't matched either.
The post-merge ci image build..pre-commit-config.yaml is an image input. The new hooks need no hook environment, but that build runs only on main.
Lint and Build in CI, which run on this pull request.
I confirm third-party material is recorded in NOTICE and REUSE.toml, or there is none.
Assisted-by: Claude Code
## What and why
Closes #272
Two local hooks turn rules from #258 (items 2 and 4) into controls:
- **`refuse-plugins`** (`language: fail`, `files: ^plugins/`). Its message is the rule: the Collection holds roles only, a plugin needs an ADR in `docs/adr/` first, and that ADR's pull request removes this hook. It sits before `ansible-lint`, because that hook's `fail_fast` stopped the run before this message showed, which was seen in testing.
- **`refuse-agent-trailers`** (`language: pygrep`, `--ignore-case`, `commit-msg` stage).
- It refuses `Claude-Session:` lines.
- It refuses `Co-Authored-By:` lines naming a known agent: `[email protected]`, a trailer whose whole name is `Claude <…>`, or Copilot, Cursor, Gemini or Codex.
- A human co-author passes, including one whose first name is Claude.
- `pygrep` prints only the hook's name and the matching line, so the `name` carries the rule.
- **Docs.** The trailer rule's *Held by* in `AGENTS.md` and `docs/contributing/ai-assistance.md` now names the hook as a **control in part**. Other AI trailers and the presence of `Assisted-by:` stay held by review.
Where this departs from the issue's wording:
- **No `ci` image version edit.** `scripts/bump_image_versions.py` no longer exists. `images/AGENTS.md` now says a pull request that changes an image input needs no version edit, because `next_image_version.py` assigns it on `main`.
- **No `dev-setup.sh` change.** `default_install_hook_types` already lists `commit-msg`, and the script installs it.
- **No docs edit owed for the roles-only rule.** #258 dropped its root clause, so the hook is where the rule lives.
- **No changelog fragment.** This is contributor tooling and consumers don't see it.
## Verified
- `pygrep` runs at the `commit-msg` stage. Checked first in a scratch repo, then here with `pre-commit run refuse-agent-trailers --hook-stage commit-msg --commit-msg-filename <f>` on 12 messages, all as expected:
- **Refused:** `Co-Authored-By: Claude <[email protected]>`, `Claude Opus 5.5 <[email protected]>`, `Claude <[email protected]>`, `Claude-Session: …`, GitHub Copilot, Cursor Agent, Gemini, Codex.
- **Passed:** a human `Co-Authored-By:`, `Claude Dupont <[email protected]>`, `Jane Cursorsmith`, `Assisted-by: Claude Code`.
- `git commit` of a staged `plugins/x.py` fails with the rule as the message.
- This commit's own message passed the new hook through the installed `commit-msg` hook.
- `pre-commit run --all-files` passes, including `check-hooks-apply` (it exempts `language: fail` hooks) and `check-useless-excludes`.
- `ansible-test sanity` passed through the pre-push hook.
- The `code-review` skill ran both axes (standards and spec). Fixed from its findings:
- The *Held by* lines overclaimed a full control; they now say control in part.
- `\bclaude\b` refused a human co-author named Claude.
- The plugins comment repeated the hook's message.
## Not verified
- **CI doesn't re-check the new hook.** Lint's "Check Conventional Commits" step (`lint.yml:141`) runs only `conventional-pre-commit` per pull request commit. `refuse-agent-trailers` is therefore skipped by `--no-verify`, by a clone without `scripts/dev-setup.sh`, and by commits made through the forge. Adding it to that loop is a one-line workflow change, left out of this pull request for the maintainer to decide.
- **Agents outside the listed identities pass**, for example Devin, aider, Jules or another `@anthropic.com` address. The issue gave its list as examples. A trailer indented with spaces isn't matched either.
- **The post-merge `ci` image build.** `.pre-commit-config.yaml` is an image input. The new hooks need no hook environment, but that build runs only on `main`.
- **Lint and Build in CI**, which run on this pull request.
---
- [x] I confirm third-party material is recorded in `NOTICE` and `REUSE.toml`, or there is none.
Assisted-by: Claude Code
Claude
added this to the Open to contributors milestone 2026-11-25 09:15:39 +00:00
Defame1297
was assigned by Claude2026-11-25 09:15:39 +00:00
Two local hooks hold rules that review held until now:
- refuse-plugins (language: fail, ^plugins/): the Collection holds roles
only; a plugin needs an ADR first, whose pull request removes the hook.
It runs before ansible-lint so that hook's fail_fast cannot hide it.
- refuse-agent-trailers (pygrep, commit-msg stage): refuses Claude-Session:
and Co-Authored-By: lines naming a known agent identity. A human
co-author passes, including one whose first name is Claude. The hook
name carries the rule, since pygrep prints no other message.
AGENTS.md and ai-assistance.md name the hook as a partial control of the
trailer rule; other AI trailers stay held by review.
Closes#272
Assisted-by: Claude Code
CODEOWNERS rules
requested review from Defame1297 2026-11-25 09:15:40 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What and why
Closes #272
Two local hooks turn rules from #258 (items 2 and 4) into controls:
refuse-plugins(language: fail,files: ^plugins/). Its message is the rule: the Collection holds roles only, a plugin needs an ADR indocs/adr/first, and that ADR's pull request removes this hook. It sits beforeansible-lint, because that hook'sfail_faststopped the run before this message showed, which was seen in testing.refuse-agent-trailers(language: pygrep,--ignore-case,commit-msgstage).Claude-Session:lines.Co-Authored-By:lines naming a known agent:[email protected], a trailer whose whole name isClaude <…>, or Copilot, Cursor, Gemini or Codex.pygrepprints only the hook's name and the matching line, so thenamecarries the rule.AGENTS.mdanddocs/contributing/ai-assistance.mdnow names the hook as a control in part. Other AI trailers and the presence ofAssisted-by:stay held by review.Where this departs from the issue's wording:
ciimage version edit.scripts/bump_image_versions.pyno longer exists.images/AGENTS.mdnow says a pull request that changes an image input needs no version edit, becausenext_image_version.pyassigns it onmain.dev-setup.shchange.default_install_hook_typesalready listscommit-msg, and the script installs it.Verified
pygrepruns at thecommit-msgstage. Checked first in a scratch repo, then here withpre-commit run refuse-agent-trailers --hook-stage commit-msg --commit-msg-filename <f>on 12 messages, all as expected:Co-Authored-By: Claude <[email protected]>,Claude Opus 5.5 <[email protected]>,Claude <[email protected]>,Claude-Session: …, GitHub Copilot, Cursor Agent, Gemini, Codex.Co-Authored-By:,Claude Dupont <[email protected]>,Jane Cursorsmith,Assisted-by: Claude Code.git commitof a stagedplugins/x.pyfails with the rule as the message.commit-msghook.pre-commit run --all-filespasses, includingcheck-hooks-apply(it exemptslanguage: failhooks) andcheck-useless-excludes.ansible-test sanitypassed through the pre-push hook.code-reviewskill ran both axes (standards and spec). Fixed from its findings:\bclaude\brefused a human co-author named Claude.Not verified
lint.yml:141) runs onlyconventional-pre-commitper pull request commit.refuse-agent-trailersis therefore skipped by--no-verify, by a clone withoutscripts/dev-setup.sh, and by commits made through the forge. Adding it to that loop is a one-line workflow change, left out of this pull request for the maintainer to decide.@anthropic.comaddress. The issue gave its list as examples. A trailer indented with spaces isn't matched either.ciimage build..pre-commit-config.yamlis an image input. The new hooks need no hook environment, but that build runs only onmain.NOTICEandREUSE.toml, or there is none.Assisted-by: Claude Code