Repository navigation
ci: add attribution guard - #117
Merged
Merged
Conversation
Adds a required "Attribution Guard" check that refetches pull request metadata (title, body, head ref, labels, every commit message and author/committer email) on every PR event, including edits and label changes, and audits each push to main. The helper runs from the base commit, falling back to the PR head only while bootstrapping. Local layer: a pre-commit commit-msg hook and a pre-push check of the pushed refs and introduced commits. The pattern block is vendored byte-for-byte from the shared source and pinned by a digest test, and every golden vector is asserted.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the attribution guard: a required
Attribution Guardstatus check plus local commit-msg and pre-push hooks. The owner rule bans tool attribution (co-author trailers, "made with" footers, session links, tool-namespaced refs, tool emails, tool-named labels), not naming a provider or dependency as the subject of a change.Server-side check
.github/workflows/attribution-guard.yml, job nameAttribution Guard.pull_request(opened, reopened, synchronize, edited, labeled, unlabeled, ready_for_review) andpushtomain. Nopull_request_target, no path filters, no skip conditions, no actor exemptions.contents: read,pull-requests: read; every checkout usespersist-credentials: false.mainauditbefore..afteronly, so existing history is not re-judged.Attribution Guardis added as its own required context on themainruleset next torequired-ci. It stays out of therequired-ciaggregate so metadata-only events (edits, labels) re-evaluate it without new commits.Local hooks
commit-msg: pre-commit hook (default_install_hook_types: [commit-msg]), installed byscripts/install_git_hooks.sh. Comment lines and the verbose-diff tail are ignored, as git does.pre-push: the installer's hook feeds git's pushed-ref lines to the guard before the existing gate (it checks each remote ref name and every introduced commit). The pre-commitpre-push-stage hook readsPRE_COMMIT_*refs when present, otherwise the current branch and its unpushed commits.Patterns and tests
Validation
make lock-check,make fmt(no changes),make lint,make type,make prepush-check,make type-completeness,make workflow-lint,make ci-contracts(23 passed),make test-cov(1269 passed, 79.99%). The commit and push of this branch went through the new local hooks.