Author SHA1 Message Date
Defame1297 5f655cbb76 ci(lint): run every commit-msg hook on a pull request's commits
Build / build (pull_request) Successful in 44s
Lint / lint (pull_request) Successful in 3m18s
Molecule / molecule (pull_request) Successful in 8s
The Lint step gave each commit's message only to conventional-pre-commit,
so refuse-agent-trailers ran nowhere in CI: --no-verify, a clone without
dev-setup.sh or a commit made through the forge passed it unseen. The
step now runs every commit-msg hook, and the trailer rule's held-by
names the Lint check.

Assisted-by: Claude Code
2026-11-25 11:58:29 +00:00
Defame1297 b32e56c10a Merge pull request 'chore(deps): update git.rkdr.net/mortis/ci docker tag to v0.2.43' (#366) from renovate/git.rkdr.net-mortis-ci-0.x into main
Reviewed-on: #366
Reviewed-by: Defame1297 <[email protected]>
2026-11-25 10:26:37 +00:00
renovate-bot 1fded69ee8 chore(deps): update git.rkdr.net/mortis/ci docker tag to v0.2.43
renovate/stability-days Updates have met minimum release age requirement
Gitea release key / check (pull_request) Successful in 48s
Build / build (pull_request) Successful in 1m0s
Lint / lint (pull_request) Successful in 2m28s
Molecule / molecule (pull_request) Successful in 16m9s
2026-11-25 10:09:24 +00:00
Defame1297 4ec685b4f6 Merge pull request 'ci(pre-commit): refuse a plugins/ directory and agent co-author trailers' (#365) from ci/272-refuse-plugins-and-agent-trailers into main
Images / image (0.1, Dockerfile, ubuntu:24.04@sha256:9c7f200c07e3d4a03e7249d2c16bf66a51120fb876aa2242cf31451412543289, molecule-ubuntu2404, images/molecule-ubuntu2404) (push) Successful in 12s
Images / image (0.1, Dockerfile, ubuntu:26.04@sha256:d66b366dac61b575bee2aef07e9c26e8070096fbe84a3d4d3eb0da069b5d76db, molecule-ubuntu2604, images/molecule-ubuntu2604) (push) Successful in 13s
Images / image (0.2, images/ci/Dockerfile, ubuntu:26.04@sha256:d66b366dac61b575bee2aef07e9c26e8070096fbe84a3d4d3eb0da069b5d76db, ci, ) (push) Successful in 6m26s
Reviewed-on: #365
Reviewed-by: Defame1297 <[email protected]>
2026-11-25 10:01:59 +00:00
Defame1297 aba119ddd2 ci(pre-commit): refuse a plugins/ directory and agent co-author trailers
Build / build (pull_request) Successful in 19s
Molecule / molecule (pull_request) Successful in 1m9s
Lint / lint (pull_request) Successful in 2m6s
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
2026-11-25 09:14:01 +00:00
7 changed files with 34 additions and 12 deletions

No files matched your search

+1 -1
View File
@@ -28,7 +28,7 @@ jobs:
timeout-minutes: 30
# The ci image (images/ci, built by image.yml): tag for the release, digest enforced.
container:
image: git.rkdr.net/mortis/ci:0.2.42@sha256:6dc6906aaf407ccff74adcaade5dc7a810cb3ffcc1a6caa9df26b94dfe1632f7
image: git.rkdr.net/mortis/ci:0.2.43@sha256:373c3ba69e3cdccdf6acf96d9c1cbfa173d2db0fbda441f4256eb46bd3ce6b99
env:
PIP_DISABLE_PIP_VERSION_CHECK: "1"
steps:
+1 -1
View File
@@ -44,7 +44,7 @@ jobs:
# The ci image (images/ci, built by image.yml), at the pin of lint.yml: tag for the
# release, digest enforced. Only its /opt/venv Python (with PyYAML) is used here.
container:
image: git.rkdr.net/mortis/ci:0.2.42@sha256:6dc6906aaf407ccff74adcaade5dc7a810cb3ffcc1a6caa9df26b94dfe1632f7
image: git.rkdr.net/mortis/ci:0.2.43@sha256:373c3ba69e3cdccdf6acf96d9c1cbfa173d2db0fbda441f4256eb46bd3ce6b99
steps:
# The container has no Node, so JavaScript actions such as actions/checkout
# cannot run; clone with git and the job token.
+5 -5
View File
@@ -31,7 +31,7 @@ jobs:
# The tag says which release, the digest is what is enforced (bump both together
# when image.yml publishes a new version).
container:
image: git.rkdr.net/mortis/ci:0.2.42@sha256:6dc6906aaf407ccff74adcaade5dc7a810cb3ffcc1a6caa9df26b94dfe1632f7
image: git.rkdr.net/mortis/ci:0.2.43@sha256:373c3ba69e3cdccdf6acf96d9c1cbfa173d2db0fbda441f4256eb46bd3ce6b99
env:
PIP_DISABLE_PIP_VERSION_CHECK: "1"
PRE_COMMIT_HOME: /opt/pre-commit
@@ -127,8 +127,9 @@ jobs:
fi
"$GITLEAKS" git --verbose --redact --log-opts="origin/main..$SHA"
# commit-msg stage hooks do not run under --all-files.
- name: Check Conventional Commits
# commit-msg stage hooks do not run under --all-files, so each commit's message is given to
# every commit-msg hook (Conventional Commits, refuse-agent-trailers); --no-verify skips them locally.
- name: Check commit messages
if: github.event_name == 'pull_request'
env:
SHA: ${{ github.event.pull_request.head.sha }}
@@ -138,6 +139,5 @@ jobs:
for sha in $(git rev-list --no-merges "origin/main..$SHA"); do
git log -1 --format=%B "$sha" > "$MSG_FILE"
echo "Checking $sha"
pre-commit run conventional-pre-commit --hook-stage commit-msg \
--commit-msg-filename "$MSG_FILE"
pre-commit run --hook-stage commit-msg --commit-msg-filename "$MSG_FILE"
done
+1 -1
View File
@@ -53,7 +53,7 @@ jobs:
env:
# The tools and collections molecule runs with: the image Lint and Build use.
CI_IMAGE: >-
git.rkdr.net/mortis/ci:0.2.42@sha256:6dc6906aaf407ccff74adcaade5dc7a810cb3ffcc1a6caa9df26b94dfe1632f7
git.rkdr.net/mortis/ci:0.2.43@sha256:373c3ba69e3cdccdf6acf96d9c1cbfa173d2db0fbda441f4256eb46bd3ce6b99
# Used by the scenarios as `image: ${MOLECULE_IMAGE}`; set it the same way to run
# one locally.
MOLECULE_IMAGE: >-
+21
View File
@@ -114,6 +114,16 @@ repos:
require_serial: true
stages: ['pre-push']
# SECURITY.md's accepted risks rest on the Collection shipping roles only. It sits before
# ansible-lint, whose fail_fast would otherwise hide this message.
- id: refuse-plugins
name: Refuse a plugins/ directory
description: refuse any file under plugins/
entry: the Collection holds roles only; a plugin needs an ADR in docs/adr/ first, and that ADR's pull request removes this hook
language: fail
files: ^plugins/
stages: ['pre-commit']
- id: ansible-lint
name: ansible-lint
description: ansible-lint production profile, offline
@@ -136,6 +146,17 @@ repos:
files: (?i)(^|/)(\.claude/)?claude(\.local)?\.md$
stages: ['pre-commit']
# Agent tools write these trailers by default. pygrep prints only the hook's name and the
# matching line, so the name carries the rule. Claude is also a person's name, so it matches
# only as a trailer's whole name ("Claude <"); a human Co-Authored-By: stays allowed.
- id: refuse-agent-trailers
name: "Agent work carries Assisted-by: <tool>[:<model>], never an agent Co-Authored-By: or a session link (docs/contributing/ai-assistance.md)"
description: refuse Claude-Session and Co-Authored-By lines naming a known agent identity
entry: '^(claude-session:|co-authored-by:\s*claude\s*<|co-authored-by:.*(noreply@anthropic\.com|\b(copilot|cursor|gemini|codex)\b))'
language: pygrep
args: [--ignore-case]
stages: [commit-msg]
- repo: meta
hooks:
- id: check-hooks-apply
+3 -2
View File
@@ -46,8 +46,9 @@ held: by a control (a named hook or check), by review, or aspirational (checked
`Co-Authored-By:` for an agent, a session link or any other AI trailer**
([ai-assistance.md](docs/contributing/ai-assistance.md)).
*Reason:* AI assistance is disclosed (principle 7), and an agent is not an author (principle 1).
*Held by:* review; the exclusion becomes a control when the commit-msg hook that refuses these
trailers lands (#272).
*Held by:* control in part: the `refuse-agent-trailers` commit-msg hook, re-run by the Lint
check, refuses `Claude-Session:` and a `Co-Authored-By:` naming a known agent;
review for the rest and for `Assisted-by:`.
- **On conflict with a shared rule delivered by apm, this repository's `AGENTS.md` wins.**
*Reason:* this repository's rules are reviewed here, for this repository.
*Held by:* aspirational.
+2 -2
View File
@@ -33,8 +33,8 @@ contributor docs are held by review until an offline link check exists. Terms su
History is not rewritten.
*Reason:* a co-author trailer makes the tool an author, and a session link is private and points
outside this repository.
*Held by:* review until the commit-msg hook that refuses these trailers lands (issue #272); then
control.
*Held by:* control in part: the `refuse-agent-trailers` commit-msg hook, re-run by the Lint
check, refuses `Claude-Session:` and a `Co-Authored-By:` naming a known agent; review for the rest.
## What agents may do