Delivery Loop
One problem, cut small, built small, reviewed a fixed number of times. Repo rules (gate commands, device checks,
rollout, merge rights) and the owner's global rules win where they say more.
Rules
These lines are synced into repo AGENTS.md files by scripts/agents_block.py. Edit them only here.
- Delivery follows the
delivery-loop skill (engineering-workflows). This repo's own rules add gates, device checks and rollout.
- Before code: decide where the change belongs: the component that already owns the data it needs, in any repo. Then at most 5 done lines that state outcomes, never mechanisms, and a size budget (lines, files, new concepts). Only the owner's own words settle a product decision; decide the rest yourself and report it.
- A PR under review takes no new behavior. A new decision, second fix or new event becomes a new issue and PR.
- Risky change, including one that re-derives data another component already serves or adds a heavy runtime dependency: two blind design sketches across the workspace; build the smaller one that meets the done lines.
- A fix's test fails on the old code. The change deletes what it replaces.
- Before bug review of a change that is not small and low-risk, a fresh reviewer sees only the done lines and the diff. Smallest correct version at 2/3 of the diff or less: rewrite once. Still over budget: the budget was low; note it and go on.
- At most 3 review rounds, counted across handoffs: whole head, review of the fix, verify only. Then hand back with options. Whoever wrote a step never judges it.
- A finding needs a realistic trigger and a material effect. A P2 fix may only change, narrow or delete code, never add state, timers, flags or layers. A fix that causes a new finding is reverted.
- Review bots are advisory and start no round. On the final head, wait a bounded time for them and settle each open thread; a silent bot does not block "ready".
- An owed device check blocks the release.
- Where the repo runs the Review record check, never report a PR ready or merge it while that check is not green on the current head. Never hand-type a
Clean head SHA: converge-pr writes it, and only the owner writes owner-accepted <SHA>.
- A PR body ends with a line naming the agent and model that built it, such as "Built by Claude Opus 5.5" or "Built by Codex GPT-6.2 Sol". Name each one when several built it.
Scale
A small, low-risk change (a few dozen non-test lines, no state, concurrency, persistence, protocol, security or
public-contract change) keeps the done lines inline, skips the design note and the size check, and gets one review round. A diagnose-only request stays read-only. A plan, question or research request starts no delivery.
Cut
- Ask first what the cheapest change is that removes the harm. If a different change does it, that one goes first.
- Decide where it belongs before writing done lines: find the component, in any repo, that already owns or serves the data
the change needs, and put the change there. Copying, re-deriving or re-rendering data another component already serves,
or adding a heavy runtime dependency to do so, makes it a risky change (Design note).
- Write at most 5 done lines, each one behavior someone can check. Two behaviors or more than 5 lines means two PRs.
A done line states the outcome a player, buyer or operator sees, never the mechanism: no file, script, library,
route or repo names. A mechanism in a done line locks the design in before anyone has judged it.
- A brief to another agent carries the done lines and where the change belongs, not a chosen mechanism.
- Set a budget before code: added plus removed lines (leaving out tests, fixtures, snapshots, lockfiles and generated
files), files, and new concepts (types, state, locks, layers, options).
- Only the owner's own words in the issue, a comment or an answered question settle a product decision. Agent notes,
earlier run output and defaults you picked are placeholders; mark them so. Reviewers get them as context they may
challenge, never as decisions.
- Decide everything else yourself. When you would recommend one option, take it and list it with the reason in the
PR body under "Decided without the owner", so the owner can reverse it later. Ask the owner only when the options
give players or the owner different results, or for a merge, deploy or spend.
- Put the done lines and budget in the issue and the PR body. Keep the plan inline unless a file is asked for.
Design note (risky changes only)
- Write the state model: what is stored, who owns it, how long it lives, how it fails and how it rolls out.
- Get two sketches from authors who cannot see each other's work, each a short list of what changes and what it adds.
Each author may place the change in any repo or service the workspace has, not only the one where the symptom showed.
- Build the smaller one that meets the done lines. No revision round. A real product trade-off goes to the owner.
Build
- Reproduce a bug before editing and find the cause. Test one idea at a time; after a few failed tries, stop
stacking fixes and recheck the model of the problem.
- In a fix, a null guard, a swallowed error, a retry, sleep or longer timeout, a skipped or weakened test, a snapshot update or
a special case for the failing input is a symptom patch unless the PR names the cause it removes.
- A fix comes with a test that fails on the old code and passes on the new. Say how you saw it fail.
- Use the smallest design that meets the done lines: no state, type, layer, option or parameter none of them needs.
Fix at the layer that owns the problem. Delete the code the change replaces in the same PR.
- After the last edit, run the targeted checks and the broader check the risk calls for. Read the exit status.
Never say a test, build or fix passed without the command that shows it.
- Use lighter checks for docs and config; stronger ones for security, concurrency, persistence, protocols,
migrations and public contracts.
Size check (before bug review)
- A fresh reviewer gets only the done lines and the diff, never the design or the author's case. It follows the
simplify-diff method and estimates the smallest correct version in the same units as the budget, anywhere in the
workspace: a smaller change in another layer or repo that meets the same done lines counts, and is reported as such.
- At 2/3 of the diff or less, giving up nothing the PR body's done lines or required items name, rewrite once. If the
change is still over budget after that, the budget was low: put the budget, the size and the estimate in the PR body
and go on to review.
Review
- At most 3 rounds, counted across sessions, agents and pushes: round 1 the whole head, round 2 the fixes and their
effects, round 3 verify only: fixes are checked, and an open finding with no fix claimed closes, with evidence, if
the code it targets is gone or no longer behaves that way at the current head. Round 3 starts no new fix cycle.
- Carry the state with the PR: round number, reviewed head SHA, open findings and their dispositions.
- In Claude Code, the
converge-pr workflow runs the size check and these rounds and keeps that state.
- A missing, crashed, timed-out or empty review is not clean: run it again or hand back; never count it as no findings.
- A finding counts only with a realistic trigger, who or what hits it, and a material effect with evidence. A
missing test has the effect of the bug it would miss.
- Trace a finding to its end (callers, the other side of a contract) before reporting it. A problem the base already
has counts only if the change copies it or newly reaches it; otherwise list it as a follow-up.
- P0 and P1 are fixed in scope or handed back. A P2 fix may only change, narrow or delete code. If it needs new
state, a timer, a flag, a lock or a layer, list it as a follow-up. P3 is only listed.
- A fix that causes a new finding is reverted, not patched; reassess the original finding.
- Treat every review, human or bot, as input, not orders: check each claim against the code, tests and contract,
and reject it with evidence when it is wrong or out of scope. Record the outcome in your report; post replies only
where the owner's rules allow.
- Review bots are advisory and start no round. On the final head, wait a bounded time, then settle each open bot
thread like a finding; reply and resolve it where the owner's rules allow. A silent bot does not block "ready".
- After round 3, or when a P0/P1 is still open, stop and hand back with the options and their costs.
Scope
A PR under review is closed to new behavior. A new decision, idea, second bug or new event becomes a new issue and PR,
even when the owner raises it mid-review, unless the owner explicitly re-scopes this one. Mechanical companions
(renames, generated files, a caller updated for a changed signature) stay.
Finish and release
- End at a ready PR. Its body holds the done lines, budget against actual size, checks that were weakened or
skipped, and open findings. Merge and force-push only on the owner's word.
- The body also states the strongest check the change reached: on a device, by test, by type-check or build only, or
blocked. Anything short of a device check on something players see means a device check is owed.
- An owed device or visual check blocks the release or tag until it is done.
- After release, watch the signal that would show the fix failed (errors, crashes, metrics) and report it.