From e142303b3d9a221d7d3cb9045a7f8dc786f82327 Mon Sep 17 00:00:00 2001 From: jbailes Date: Tue, 27 Oct 2026 19:00:32 +0100 Subject: [PATCH] Refuse assistant attribution in every commit and pull request This repository had no attribution gate, so a co-author trailer, a Generated with footer or an assistant author could have merged unchecked. The no-coauthor-trailers job runs aimee's attribution policy (scripts/check-pr-attribution.go over server-go/modules/git/attribution) at a pinned commit on every pull request, push, merge group and dispatch, with no exemptions: every incoming commit's author, committer and message, the pull request's title, body and edit history, and every PR associated with those commits. It runs the policy's own tests first and fails closed on any incomplete read. Pushes are checked on main only. A new branch's first push carries an all-zero "before", which the policy refuses as a range, and that recorded refusal would then fail every later check of the same commit. --- .github/workflows/attribution.yml | 79 +++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 .github/workflows/attribution.yml diff --git a/.github/workflows/attribution.yml b/.github/workflows/attribution.yml new file mode 100644 index 0000000..3dd94e1 --- /dev/null +++ b/.github/workflows/attribution.yml @@ -0,0 +1,79 @@ +name: Attribution + +# No assistant attribution may enter this repository: no co-author trailers, +# "Generated with" footers, assistant session links or assistant identities, in +# any commit, pull request title or body, or their edit history. Every event is +# checked; none is skipped and nothing is exempt. +# +# The policy is aimee's, run from aimee itself (scripts/check-pr-attribution.go +# over server-go/modules/git/attribution) at a pinned commit, so this repository, +# aimee's own gate and aimee's merge executor enforce one implementation. +# Re-pin AIMEE_POLICY_COMMIT when that policy changes. +on: + pull_request: + types: [opened, synchronize, reopened, edited] + # Pushes are checked on main only: a new branch's first push has no + # "before" commit (all zeros), which the policy rightly refuses as a range, + # and that refusal would stick to the commit for good. Branch commits are + # checked by the pull_request run before they can reach main. + push: + branches: [main] + merge_group: + types: [checks_requested] + workflow_dispatch: + inputs: + base_sha: + description: Full base commit SHA to compare + required: true + type: string + head_sha: + description: Full incoming commit SHA to verify + required: true + type: string + +concurrency: + group: attribution-${{ github.event_name }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +env: + AIMEE_POLICY_COMMIT: e9f4c7ec19ec8f1964979d1ab0b8c39db254435b + +jobs: + no-coauthor-trailers: + runs-on: ubuntu-latest + timeout-minutes: 30 + permissions: + contents: read + issues: read + pull-requests: read + checks: read + steps: + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 + with: + repository: RakuenSoftware/aimee + ref: ${{ env.AIMEE_POLICY_COMMIT }} + path: aimee-policy + persist-credentials: false + sparse-checkout: | + server-go/go.mod + server-go/go.sum + server-go/modules/git/attribution + scripts/check-pr-attribution.go + scripts/check-pr-attribution_test.go + - uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff + with: + go-version-file: aimee-policy/server-go/go.mod + cache: false + - name: Test the attribution policy + working-directory: aimee-policy/server-go + run: | + go test ./modules/git/attribution + go test ../scripts/check-pr-attribution.go ../scripts/check-pr-attribution_test.go + - name: Enforce attribution across incoming commits and PR history + working-directory: aimee-policy/server-go + env: + GH_TOKEN: ${{ github.token }} + run: go run ../scripts/check-pr-attribution.go