Repository navigation
feat(repo): add agent branch rulesets and head-branch check - #363
Merged
Merged
Conversation
Generated-by: LLM harness=codex;model=openai:gpt-6.2-sol Generated-by: LLM effort=high;harness=codex:0.171.0;model=openai:gpt-6.2-sol;session=sha-256-64:92305effc45e4135;surface=exec
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.
Why
Agent commits belong on
agent/branches, and other branches should have none. Rulesets can enforce the branch rule and the trailer rule on GitHub's side. The commit identity check can enforce the same branch rule in CI.Behavior change
//lint:commit_identitytakes an optional third argument, the head branch of the pull request. A commit withagent@tonyburns.netas author or committer then fails unless the branch starts withagent/.repo-checks.ymlpasses the head ref as that argument and keeps the merge-base range from//lint:pr_merge_base.agent-trailers.jsonrequires an agent trailer on commits underagent/**.branch-prefixes.jsonrestricts creation, update and deletion on branches outsideagent/,renovate/and the default branch.branch-prefixes.jsonbypass actor is the placeholderREPLACE_WITH_TBHB_USER_ID.docs/reference/commit-identity.mddescribes the new argument and the new exit-2 rule for argument counts.Decisions
Deviations from the task
Risk
A consumer that enables
branch-prefixes.jsonwithout replacing the placeholder gets a ruleset with a bypass actor that doesn't exist. No other repository enables the files until it syncs the baseline and flipsenforcement.Verification
lint/tests/commit_identity_scenario.bzlcover an agent commit on anagent/branch, an agent commit on another branch, and a call without the branch.Opened-by: LLM effort=medium;harness=claude-code:2.1.330;model=anthropic:claude-sonnet-5-5;session=sha-256-64:debb814921f029ad;surface=cli
Generated-by: LLM harness=codex;model=openai:gpt-6.2-sol
Generated-by: LLM effort=high;harness=codex:0.171.0;model=openai:gpt-6.2-sol;session=sha-256-64:92305effc45e4135;surface=exec
Assisted-by: LLM effort=medium;harness=claude-code:2.1.330;model=anthropic:claude-sonnet-5-5;session=sha-256-64:debb814921f029ad;surface=cli