Skip to content

docs(agents): add PR bundling rule to cut one-task-one-PR churn - #1408

Merged
BigSimmo merged 8 commits into
mainfrom
claude/pr-bundling-rules-churn-fuaw5a
Jul 30, 2026
Merged

docs(agents): add PR bundling rule to cut one-task-one-PR churn#1408
BigSimmo merged 8 commits into
mainfrom
claude/pr-bundling-rules-churn-fuaw5a

Conversation

@BigSimmo

Copy link
Copy Markdown
Owner

Summary

  • Answers "is there a lot of PR churn, and can we bundle more into a single PR?" — yes on both counts. Every newtask/handoff cycle mints a dedicated claude/<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.
  • Adds a "PR bundling" rule to 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:
    • Every bundled item must be independently low-risk under the repo's own classifier (scripts/pr-policy.mjs — no clinical-risk path, no RAG-ranking-surface path, no auth/privacy/migration/Supabase path).
    • Each item stays its own separately-revertible commit inside the one PR (one PR, multiple commits — never a squashed diff).
    • Each item gets its own bullet in the PR body, so a reviewer (and pr-policy.mjs) can still find any item's own governance/RAG-impact statement.
    • Best candidates: queued docs/branch-review-ledger.md / docs/outstanding-issues.md append-only tasks — no revert risk of their own, always pass the same static gates.
    • Never bundle anything needing its own RAG impact:/Clinical Governance Preflight declaration together with something that doesn't, or anything explicitly scoped "1 PR per work order" (e.g. the maturity backlog, ledger #086).
  • Mirrors the rationale + measured evidence into docs/process-hardening.md (next to the existing "Open PR branch sync" entry it complements).
  • Adds a one-line nudge to .claude/skills/newtask/SKILL.md pointing 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 — clean
  • npm run docs:check-links1378 repo path references resolve
  • npm run check:skillsDatabase skill catalog valid: 33 canonical skills, 8 aliases
  • grep -c "^## Dependency shortcut" AGENTS.md1 (that section's own self-check, unaffected by this edit)
  • Verification not run: 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 own ragRankingPatterns/clinicalRiskPatterns do not match any changed path (AGENTS.md, docs/process-hardening.md, .claude/skills/newtask/SKILL.md).

Risk and rollout

  • Risk: none to runtime or CI enforcement — this is a documentation/policy change only. No script, workflow, or gate behavior changed; the rule is guidance for future sessions, not an automated check.
  • Rollback: revert the commit; nothing depends on it.
  • Provider or production effects: None. No provider-backed command was run.

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

  • This does not change the "1 PR per work order" convention already used for staged rollouts (e.g. docs/maturity-backlog-workorders.md, ledger #086) — those stay deliberately isolated.
  • Bundling saves PR/CI-invocation count, not verification rigor: every bundled item still needs the smallest correct gate run against it before it joins a PR.

Generated by Claude Code

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
@coderabbitai

coderabbitaiBot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 24a5834c-0f39-4af6-bedc-3046d8649b3c

📥 Commits

Reviewing files that changed from the base of the PR and between a4ebe12 and 2d509eb.

📒 Files selected for processing (3)
  • .claude/skills/newtask/SKILL.md
  • AGENTS.md
  • docs/process-hardening.md

Comment @coderabbitai help to get the list of available commands.

@supabase

supabaseBot commented Jul 30, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@BigSimmoClaude

Copy link
Copy Markdown
OwnerAuthor

CI status: ci/circleci: verify failure looks systemic, not from this diff

The only red check right now is the legacy ci/circleci: verify commit status (not part of the required CI / pr-required GitHub Actions aggregate — that one and the other GH Actions checks are green/in-progress). It's currently failing identically across every recently-created open PR I sampled, regardless of diff content:

PRDiffCircleCI jobStatus
#1397docs/branch-review-ledger.md only649failure
#1406docs/ledger only662failure
#1404tests/CSS/CI config668failure
#1403docs/outstanding-issues.md + ledger666failure
#1408 (this PR)AGENTS.md / docs/process-hardening.md / newtask SKILL.md only667failure

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.mjscircleci-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

@BigSimmo
BigSimmo marked this pull request as ready for review July 30, 2026 04:45
@BigSimmo
BigSimmo enabled auto-merge (squash) July 30, 2026 04:46

@chatgpt-codex-connectorchatgpt-codex-connectorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment threadAGENTS.md Outdated
Comment threadAGENTS.md Outdated
claude added 2 commits July 30, 2026 04:58
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

@chatgpt-codex-connectorchatgpt-codex-connectorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment threadAGENTS.md
Comment threadAGENTS.md Outdated
Comment threadAGENTS.md
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

@chatgpt-codex-connectorchatgpt-codex-connectorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment threadAGENTS.md Outdated
Comment thread.claude/skills/newtask/SKILL.md Outdated
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

@chatgpt-codex-connectorchatgpt-codex-connectorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment threadAGENTS.md
claudeand others added 2 commits July 30, 2026 05:14
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
@BigSimmo
BigSimmo merged commit 8629a2b into mainJul 30, 2026
18 checks passed
@BigSimmo
BigSimmo deleted the claude/pr-bundling-rules-churn-fuaw5a branch July 30, 2026 05:20
Sign up for freeto 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.

2 participants

@BigSimmo@claude