docs(agents): add PR bundling rule to cut one-task-one-PR churn - #1408
Conversation
Every newtask/handoff cycle mints a dedicated branch+PR, so a single docs/ledger-append line pays the same required-CI bill as a large change. PR #1406 measured 437 PR-triggered CI runs in a ~3-day window with ~40% cancelled and ~12 Production-UI-hours burned on superseded runs. Adds a bundling rule to AGENTS.md scoped to independently low-risk, separately-revertible work (never RAG-ranking-surface or clinical-governance-gated changes), a rationale entry in docs/process-hardening.md, and a nudge in the newtask skill to check for bundle candidates before minting a new branch. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Re9ERtQwJ82ErbAnahAhsa
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in:22 minutes Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
Comment |
This pull request has been ignored for the connected project Preview Branches by Supabase. |
BigSimmo
commented
Jul 30, 2026
CI status: |
| PR | Diff | CircleCI job | Status |
|---|---|---|---|
| #1397 | docs/branch-review-ledger.md only | 649 | failure |
| #1406 | docs/ledger only | 662 | failure |
| #1404 | tests/CSS/CI config | 668 | failure |
| #1403 | docs/outstanding-issues.md + ledger | 666 | failure |
| #1408 (this PR) | AGENTS.md / docs/process-hardening.md / newtask SKILL.md only | 667 | failure |
All report the identical generic "Your tests failed on CircleCI" message — including two PRs whose diff is docs/branch-review-ledger.md only, which should hit .circleci/config.yml's docs-only fast-skip path (ci-change-scope.mjs → circleci-agent step halt) and never reach a real test step at all. That pattern points to a shared/environmental break (dependency install, Docker image pull, or a CircleCI-side issue) rather than anything in any one of these diffs.
This session has no CircleCI API/log access, and this status has no associated GitHub check-run ID to pull logs through, so I can't retrieve the actual failing step directly. What I can confirm locally, against this exact commit (752e8d2): npm run verify:cheap passed clean (Test Files 432 passed (432), Tests 4470 passed | 4 skipped (4474)), plus prettier --check, npm run docs:check-links, and npm run check:skills all green. Nothing in this PR's 3-file documentation diff is the cause.
Treating this as a base-level/systemic failure predating this diff rather than something to chase with a content push. I'll re-check when CircleCI recovers and report back if this PR's check clears on its own or turns out to be diff-specific after all.
Generated by Claude Code
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:3c7cbae849
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Codex review on #1408 caught both, and the first reproduced live minutes later on #1406: pushing a bundled addition to an already-open PR mid-CI-run cancels the in-flight run under cancel-in-progress: true, so it doesn't save an invocation, it restarts one. Clarify to wait for settle or assemble commits before the first push. Second: git revert <sha> for a bundled item only holds pre-merge — a normal squash-merge folds commits into one and deletes the feature branch, so post-merge per-item rollback means reverting hunks of the squash commit by hand. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Re9ERtQwJ82ErbAnahAhsa
…uaw5a' into claude/pr-bundling-rules-churn-fuaw5a
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:4be220d91f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Third Codex pass on #1408 found: (1) the low-risk check didn't exclude operationalRisk paths (package.json/lockfiles, .github/workflows/**, build/test-runner config), which this repo already classifies high-risk elsewhere despite carrying neither the clinical nor RAG flag; (2) a settle-then-push addition can land after this repo's one automatic Codex review already ran against the earlier head; (3) the open-PR-list check needs to respect the standing API/provider confirmation boundary rather than being an unconditional GitHub read. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Re9ERtQwJ82ErbAnahAhsa
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:e078477cbf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Fourth Codex pass on #1408 found two more: (1) worker/index.ts trips neither clinicalRisk nor operationalRisk in scripts/pr-policy.mjs, so the low-risk check would have waved through a production ingestion- worker change — reworked the bullet to also require checking against this repo's own broader PR-risk-detection list (which does name workers/queue processing), with an explicit "default to its own PR when unclear" fallback instead of extending an enumerated list forever. (2) The newtask bundling check lived in a trailing Notes section, after the numbered Steps that already create the worktree and branch — moved it to a "Before you start" section ahead of Steps so it's read before the churn it's meant to prevent. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Re9ERtQwJ82ErbAnahAhsa
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:5ecfd97a1c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Uh oh!
There was an error while loading. Please reload this page.
Fifth Codex finding on #1408: waiting for a target PR's CI to settle before pushing bundled work can lose the race to auto-merge itself — claude/* branches auto-merge on green by this repo's default, so the PR can squash-merge and close in the waiting window before the bundled commit is pushed, silently dropping it. guard-push.mjs's auto-merge sentinel is supposed to catch this but fails open without gh available, which this session's own pushes demonstrated directly. Rule now says to confirm auto-merge isn't armed before using settle-then-push, or disable it first and re-enable after pushing. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Re9ERtQwJ82ErbAnahAhsa
Summary
newtask/handoffcycle mints a dedicatedclaude/<task-slug>branch + PR, so a single docs/ledger-append line pays the same required-CI bill as a large change. Currently-open PR CI testing approach review: flake, waste, and when-to-run matrix #1406 sampled the last 500 CI workflow runs (~3 days of PR traffic, 437 PR-triggered): ~40% cancelled mid-run (mostly superseded by a newer push before Production UI finished), burning roughly 12 Production-UI-hours on runs that never completed.AGENTS.md: before minting a new branch, check whether the task can ride an already-open PR you own, or bundle with other queued low-risk work, instead of opening a new one. Bundling is scoped tightly so it doesn't undermine the reasons this repo currently favors small PRs for risky changes:scripts/pr-policy.mjs— no clinical-risk path, no RAG-ranking-surface path, no auth/privacy/migration/Supabase path).pr-policy.mjs) can still find any item's own governance/RAG-impact statement.docs/branch-review-ledger.md/docs/outstanding-issues.mdappend-only tasks — no revert risk of their own, always pass the same static gates.RAG impact:/Clinical Governance Preflightdeclaration together with something that doesn't, or anything explicitly scoped "1 PR per work order" (e.g. the maturity backlog, ledger#086).docs/process-hardening.md(next to the existing "Open PR branch sync" entry it complements)..claude/skills/newtask/SKILL.mdpointing at the new rule before a session mints a fresh branch.Verification
npm run verify:cheap— exit 0,Test Files 432 passed (432),Tests 4470 passed | 4 skipped (4474)npx prettier --check AGENTS.md docs/process-hardening.md .claude/skills/newtask/SKILL.md— cleannpm run docs:check-links—1378 repo path references resolvenpm run check:skills—Database skill catalog valid: 33 canonical skills, 8 aliasesgrep -c "^## Dependency shortcut" AGENTS.md→1(that section's own self-check, unaffected by this edit)npm run verify:ui— no UI/routing/styling behavior changed.npm run eval:retrieval:quality/check:production-readiness— not applicable; no retrieval, ranking, ingestion, privacy, or Supabase behavior changed.RAG impact: no retrieval behaviour change — no file under
src/lib/rag/**, clinical-search, retrieval-selection, ranking-config, the eval harness, the golden fixture, or the retrieval RPCs is touched;scripts/pr-policy.mjs's ownragRankingPatterns/clinicalRiskPatternsdo not match any changed path (AGENTS.md,docs/process-hardening.md,.claude/skills/newtask/SKILL.md).Risk and rollout
Clinical Governance Preflight
Not applicable — the diff touches only
AGENTS.md,docs/process-hardening.md, and.claude/skills/newtask/SKILL.md. No ingestion, answer generation, search/ranking, source rendering, document access, privacy, production environment, or clinical output behavior is touched.Notes
docs/maturity-backlog-workorders.md, ledger#086) — those stay deliberately isolated.Generated by Claude Code