Skip to content

pr-text: fail AI attribution on every ready PR, and in added patch files - #22

Open
RyanTheTide wants to merge 1 commit into
mainfrom
hygiene/pr-text-attrib-v2
Open

RyanTheTide wants to merge 1 commit into
mainfrom
hygiene/pr-text-attrib-v2

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

Replaces #21. Same tree as #21 @16a55591 (approved there); only the commit message changed: it quoted an example trailer, and this check failed it.

What: close the gaps that let AI attribution merge after the 11-24 ban (merged-PR audit 2026-12-01, section 6): attribution in the title, body, the author's commits or lines added to *.patch/*.diff files now fails on every ready PR, whatever its age. Tested:/Risk: structure stays warn-only for PRs opened before 2026-11-25; drafts still only warn. Also catches a trailer folded into a sentence. Commits authored before the cutoff are skipped (no force push, so they can't be fixed).

Tested: no runtime change (CI only). bash .github/aurora/pr-text-test.sh: 30/30 ok (8 new). Ran the new script on real PR text: fails linux#3374 and mesa#1307 (bodies) and fedora-aurora#575 (wine-sve-guard.patch added line, via the workflow's jq filter); passes mesa#937 and aura#391 (prose quoting the trailer).

Risk: two-way · none (no runtime change). Older open PRs that still carry attribution in their body will go red on their next edit/push; the B1-HYGIENE lane is scrubbing those bodies now.

Not yet: pr-text isn't a required status on any main ruleset, so a red check still doesn't block a merge. Making it required is an owner call.

The 2026-12-01 merged-PR audit found 31 PRs merged after the 11-24 ban
with AI attribution in the body, and Assisted-by lines shipped inside
packages/*.patch files (alarm-aurora#495, fedora-aurora#575). Most were
opened before 2026-11-25, where every finding was a warning.

- AI attribution in the title, body, commits or added patch lines now
  fails on any ready PR, whatever its age. Tested:/Risk: structure stays
  warn-only for PRs opened before the cutoff; drafts still only warn.
- An attribution trailer folded into the end of a sentence is
  caught; inline-code quotes still pass.
- Lines a PR adds to *.patch/*.diff files are checked.
- Commits authored before the cutoff are not checked (they cannot be
  rewritten without a force push).

Tests: pr-text-test.sh 30/30; the new script fails linux#3374,
mesa#1307 and fedora-aurora#575 and passes mesa#937 and aura#391.

Signed-off-by: Ryan Murray <[email protected]>

@aurora-silicon-review aurora-silicon-review Bot 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.

Verdict: FIX at 16bc2a5

Failure: the new INLINE_RE is matched against commit messages and the title without strip_code. A commit or title that only mentions the trailer, even inside backticks, now fails. Main passes these inputs. That contradicts the commit's own claim that "inline-code quotes still pass", and it is the same trap that failed #21. I ran pr-text.sh at the head and at main with a good body plus each of these inputs:

COMMITS_FILE line: Drop the `Assisted-by: LLM` trailer that fix.patch carried.
  main: PASS   head: FAIL  "AI attribution in commit 111111111111: 'Drop the `Assisted-by: LLM` trailer ...'"
COMMITS_FILE line: Removes the Assisted-by: AI lines from the carried patches.
  main: PASS   head: FAIL
PR_TITLE: hygiene: drop `Assisted-by: LLM` trailers
  main: PASS   head: FAIL  "AI attribution in the title: ..."

The code paths are grep -i -E "^[0-9a-f]*: (${ATTRIB_RE#^}|.*$INLINE_RE)" (commits) and printf '%s\n' "$title" | grep -i -E "$ATTRIB_RE|$INLINE_RE" (title), and neither goes through strip_code. Every scrub PR from the B1-HYGIENE lane that names what it removes in its commit or title goes red. The fix is to run the commit lines and the title through the same inline-code strip as the body before INLINE_RE, or to match INLINE_RE only after a sentence end ([.!?][[:space:]]+assisted-by...), and add a self-test for each case.

Failure: patch-file lines go through all of ATTRIB_RE, including the prose rule generated (with|by) .*(claude|codex|chatgpt|gpt|gemini|copilot|llm|cursor|...) with the [[:space:]>*_-]* lead-in. Ordinary C comments in a shipped patch therefore fail:

PATCH_LINES_FILE: packages/u-boot/0003-gpt.patch: + * Generated by sgdisk from the GPT header of the stub.
  head: FAIL  "AI attribution added to packages/u-boot/0003-gpt.patch: ..."
PATCH_LINES_FILE: packages/mutter/0002-cursor.patch: + * Generated by the cursor renderer for each frame.
  head: FAIL

gpt/cursor/llm are plain substrings (no word boundary), and patch files are code, not PR prose. For patch lines, check only the trailer-shaped alternatives (assisted-by:, and co-authored-by/signed-off-by/... with an AI name), or put word boundaries on the names.

Checked:

  • pr-text-test.sh at the head: 30/30 ok.
  • The enforce logic: a ready new PR folds attribution into the errors. A ready old PR gets warnings for structure and errors for attribution, then exits 1. A draft only warns. Under set -u the ${arr[@]+...} expansions are safe when the arrays are empty.
  • No false positive for "Claude" as a name (Thanks to Claude Dupont ... Co-authored-by: Claude Dupont <[email protected]> passes), for "AI accelerator" in a title, or for "Apple's AI accelerator; generated by an ANE compiler" in the body.
  • The workflow jq keeps only + lines that are not +++ from *.patch/*.diff and strips the outer +. The script's sed strips the inner +.
  • select(.commit.author.date >= env.SINCE) compares ISO-8601 Z strings as text, which sorts correctly.
  • No AI attribution in this PR's body or commit.

Follow-ups:

  • False negatives: a mid-sentence Done. Co-Authored-By: Claude Opus 5.5 <[email protected]> still passes (INLINE_RE only covers assisted-by). So do "Made with Claude Opus 5.5." and "Assisted by Claude." (no colon).
  • A patch line that removes an attribution (-Assisted-by: ... inside the patch) is flagged as "added", because - is in the ATTRIB_RE lead-in class.
  • The author-date filter trusts commit.author.date, which the author sets (--date, or a cherry-pick of an old commit). A new commit dated before 2026-11-25 skips the commit check.
  • Carried upstream patches that keep a genuine upstream Assisted-by: trailer will fail. That may be the intent; say so in pr-structure.md.

@aurora-silicon-review
aurora-silicon-review Bot requested review from satchlj and removed request for DjDeveloperr December 1, 2026 14:52
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.

1 participant