✨ feat(work-rules): only Dependabot opens a pull request from a dependabot/ branch

Merged
AT
1d ago
+150-10

Slice: #591

What: niyam / Work rules refuses a pull request whose head branch starts with dependabot/ unless dependabot[bot] opened it:

✗ #N is from the branch dependabot/…, but only dependabot[bot] opens pull requests from dependabot/ branches, which a review may skip as Dependabot's; push it to a branch of another name

The rule runs before Work rules decides whether the author is an agent, so it binds owners' and forks' pull requests too.

A pull request that dependabot[bot] opened also fails unless dependabot[bot] pushed every commit on it, as GitHub's push record shows. Work rules reads the record the way PR identity does (commitsOf and whoPushed are now exported from src/identity.ts), and it fails closed on any commit the record doesn't credit. This answers Cubic's P2 (https://github.com/veda-hq/niyam/pull/594#discussion_r4679691597): an AthyaBot commit like dc2e64d on 505's branch would now fail. A bump that needs a fix lands through a pull request of its own, as https://github.com/veda-hq/niyam/pull/577 did. Alok widened slice #591 to this on 2026-11-24.

Why: https://github.com/veda-hq/niyam/pull/582 has Cubic skip dependabot/** branches, because Cubic won't review Dependabot's pull requests on niyam's plan and its check is required. Cubic's review ignores match branches, not authors (https://docs.cubic.dev/configure/cubic-yaml). So without this rule, any pull request from such a branch skips the required review. Cubic raised that as a P1 (https://github.com/veda-hq/niyam/pull/582#discussion_r4679365715), and Alok chose to merge 582 and close the gap here.

When it applies: Work rules runs from niyam's released checks.yml@v0.7.19, so this takes effect in niyam at the release that carries it, once onboard moves the pin. Client repositories get it at their next onboard. This pull request releases nothing.

Evidence: the local gate exits 0: pnpm provenance && pnpm typecheck && pnpm lint && pnpm test && pnpm test:scripts && pnpm pins && pnpm pariksha && pnpm hooks:check && pnpm build && pnpm smoke.

  • pnpm test: tests 2196, pass 2196, fail 0. The new tests are under "prWorkRules › a pull request from a dependabot/ branch":
    • Dependabot passes, whatever the case of its login, whether rebased or not.
    • Dependabot's fails when it carries a commit an agent pushed.
    • It reads the record again, then fails closed, naming a commit by a gone account and one not yet recorded.
    • It fails closed with no head repository, no base, or 250+ commits.
    • An agent is refused, though it names a buildable slice.
    • An owner is refused, and so is a fork's author.
    • A branch merely containing "dependabot/" passes.
  • pnpm test:scripts: 138/138 pass.
  • Coverage: src/work.ts 99.35% lines and 97.09% branches; src/identity.ts 100% lines.

🤖 Generated with Claude Code