Skip to content

feat(repo): add agent branch rulesets and head-branch check - #363

Merged
tbhb-agent merged 1 commit into
mainfrom
agent/r15-agentrs-rebase
Nov 23, 2026
Merged

tbhb-agent merged 1 commit into
mainfrom
agent/r15-agentrs-rebase

Conversation

@tbhb-agent

Copy link
Copy Markdown
Contributor

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_identity takes an optional third argument, the head branch of the pull request. A commit with agent@tonyburns.net as author or committer then fails unless the branch starts with agent/.
  • repo-checks.yml passes the head ref as that argument and keeps the merge-base range from //lint:pr_merge_base.
  • The baseline adds two ruleset files for consumers. agent-trailers.json requires an agent trailer on commits under agent/**. branch-prefixes.json restricts creation, update and deletion on branches outside agent/, renovate/ and the default branch.
  • Both rulesets start with enforcement turned off in the file. The branch-prefixes.json bypass actor is the placeholder REPLACE_WITH_TBHB_USER_ID.
  • The reference page docs/reference/commit-identity.md describes the new argument and the new exit-2 rule for argument counts.

Decisions

  • The check treats the argument as optional, so existing callers keep working.
  • The rulesets remain off until @tbhb supplies the user id and enables them per repository.

Deviations from the task

Risk

A consumer that enables branch-prefixes.json without 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 flips enforcement.

Verification

  • The baseline manifest test passed, and both ruleset copies match byte for byte.
  • The scenario tests in lint/tests/commit_identity_scenario.bzl cover an agent commit on an agent/ 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

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
@tbhb-agent
tbhb-agent merged commit 22cd74b into main Nov 23, 2026
58 checks passed
@tbhb-agent
tbhb-agent deleted the agent/r15-agentrs-rebase branch November 23, 2026 08:25
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