From 5f655cbb7661bff4a812fa79c44b6f26ba9ecf25 Mon Sep 17 00:00:00 2001 From: Defame1297 Date: Wed, 25 Nov 2026 11:58:29 +0000 Subject: [PATCH] ci(lint): run every commit-msg hook on a pull request's commits 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 --- .gitea/workflows/lint.yml | 8 ++++---- AGENTS.md | 5 +++-- docs/contributing/ai-assistance.md | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.gitea/workflows/lint.yml b/.gitea/workflows/lint.yml index f7e7ae9..5e0888b 100644 --- a/.gitea/workflows/lint.yml +++ b/.gitea/workflows/lint.yml @@ -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 diff --git a/AGENTS.md b/AGENTS.md index cef360d..43a7fc7 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -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:* control in part: the `refuse-agent-trailers` commit-msg hook refuses `Claude-Session:` - and a `Co-Authored-By:` naming a known agent; review for the rest and for `Assisted-by:`. + *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. diff --git a/docs/contributing/ai-assistance.md b/docs/contributing/ai-assistance.md index b6a7d6b..83fb490 100644 --- a/docs/contributing/ai-assistance.md +++ b/docs/contributing/ai-assistance.md @@ -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:* control in part: the `refuse-agent-trailers` commit-msg hook refuses `Claude-Session:` - and a `Co-Authored-By:` naming a known agent; review for the rest. + *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 -- 2.43.0