AI Writes Code 10× Faster. Why Doesn't Your Team Ship 10× Faster?
It’s Friday afternoon. With your AI coding assistant, you opened twelve pull requests this week. Your teammates had time to review three. The other nine are sitting in the queue, and so are the dozens your teammates opened. Monday’s standup will be about “unblocking reviews” again. Your manager has read that AI makes engineers ten times more productive and is wondering why the release calendar hasn’t moved.
If that sounds familiar, nobody on your team is doing anything wrong. You’ve hit a structural limit, and once you can see it, you can manage it.
The one-sentence answer. AI made writing code roughly ten times cheaper, but it did little for checking code, deciding to ship it and owning it afterwards, and a team can only ship as fast as its slowest step.
What you’ll get from this post:
- A plain-language picture of why faster coding doesn’t mean faster shipping, using toll booths, supermarket queues and traffic jams instead of formulas.
- Five practical remedies, each with a few small things your team can try this week.
- A simple way to decide when AI-generated work can safely skip line-by-line review.
- An appendix with working code and configuration for engineers who want to build it.
AI produces about 100 changes a day. Human review gets through about 15. The other 85 pile up in front of the gate, every day.
Key terms
A few words come up again and again. Here is what each one means in this post:
| Term | In plain English |
|---|---|
| Change | One piece of work merged into the codebase, usually one pull request (PR). |
| Generation | Writing the change, by a person or an AI agent; think of it as the factory floor. |
| Verification | Checking that the change is correct, safe and fast enough, using tests, scanners and human review; think of it as quality inspection. |
| Review queue | Changes that are ready for review but that nobody has started looking at yet, like customers waiting in line at a checkout. |
| Backpressure | Slowing down the step that produces work when the next step can’t keep up, like a restaurant that stops seating guests when the kitchen is full. |
| Tier | How risky a change is, which decides how much human review it gets, like triage in a hospital emergency room. |
| Evidence packet | A short, machine-readable report attached to a change that lists what every check found, like a lab report attached to a patient’s file. |
| Escape | A bug that slipped past every check and reached real users, like a faulty product that got past the factory inspector. |
| Autonomy level | How much a kind of work is allowed to go ahead without a human reading every line, like the stages from learner permit to full driving licence. |
1. The problem: AI sped up only one part of the job
Here is how one practitioner described it:
AI has made coding more than ten times faster, but human verification has not been freed up, and companies still expect ten times the output. The bottleneck used to be production; it is moving to acceptance.
Shipping one change costs effort in four places:
- Write: producing the code and its tests.
- Verify: making sure it is correct, secure and fast enough.
- Decide: the judgment calls, such as trade-offs, “is this what we wanted?” and “is it safe to release now?”
- Own: living with it afterwards: being on call, fixing incidents, maintaining it.
AI is excellent at the first one. It helps with the others, too (it can summarize a diff or suggest test cases), but someone still has to understand the result, sign off on it and answer the pager at 3 a.m.
Illustrative numbers. Writing drops from 40 units to 4, but verifying, deciding and owning stay the same. The whole change goes from 100 units to 64: about a third cheaper, not ten times cheaper.
Some of those remaining costs even grow with code volume. Treat “AI writes faster” as “the team ships faster,” and the result is predictable: review queues grow, technical debt piles up, review standards quietly slip, and the hardest decisions land on a few senior engineers.
2. Why 10× faster coding gives you only about 1.5× faster shipping
2.1 The narrowest point sets the pace
Picture a highway with ten lanes that funnels into a single toll booth. It doesn’t matter how wide the highway is; cars get through only as fast as the toll booth lets them. Or pour water from a bottle: the narrow neck, not the size of the bottle, decides how fast it flows. That’s where the word bottleneck comes from, and business researchers built a whole management method, the theory of constraints, around it [3].
Software delivery works the same way. Say AI raises how many changes your team can write from 10 to 100 a day, but review only goes from 10 to 15 (reviewers get some AI help, too). Your team now ships 15 changes a day instead of 10. That’s a 1.5× improvement, not 10×. The other 85 changes a day join the queue.
Generation can handle 100 a day and release can handle 40, but review handles only 15, so 15 a day is what gets delivered. The surplus piles up in the review queue.
2.2 A growing queue means a growing wait
The longer the line, the longer each newcomer waits. That’s common sense, and queueing researchers made it precise long ago (it’s known as Little’s law [1]).
Run the numbers from above for one working month. After 20 working days, 2,000 changes have been written, 300 have been reviewed, and 1,700 are waiting. If reviewers work through that backlog at 15 a day, a change written on day 20 would wait about 113 working days, more than five months. In real life, nobody waits that long. The work gets abandoned or rubber-stamped, and both are failures.
Left: AI writes as much as it can. After 20 days there is a 1,700-change backlog. Right: AI is held to what review can handle. Exactly as many changes ship (the gain is 1.5× in both cases), but nothing piles up. This is a simplified model where every change is the same size and nothing is sent back. Real work is messier, so real teams should hold generation below review capacity (Remedy 4 suggests about 75%).
2.3 Busy reviewers make everyone wait much longer
Even when reviewers can keep up on average, how busy they are matters enormously.
Think of a supermarket checkout. If the cashier is busy half the time, you usually walk straight up or wait behind one person. If the cashier is busy 90% of the time, a small burst of shoppers creates a line, and the cashier never has slack time to clear it. Waiting time doesn’t grow evenly as the cashier gets busier; it shoots up near the top. Queueing researchers showed this decades ago [2].
For a review that takes 1 hour:
- When reviewers are 50% busy, a change waits about 1 hour before anyone starts reviewing it.
- When reviewers are 90% busy, it waits about 9 hours.
- If the changes are very uneven in size, as AI output tends to be (a one-line fix next to a 2,000-line feature), the wait at 90% busy grows to about 15 hours.
Average wait before a 1-hour review starts. Above about 80% busy (the shaded danger zone), a small increase in load causes a large increase in waiting. Uneven PR sizes (dashed line) make it worse.
So the goal of “keeping reviewers fully utilized” backfires. It puts the team on the steepest part of the curve.
2.4 Overload feeds on itself
Review isn’t a one-way street. Some changes are sent back for rework and rejoin the same queue. When reviewers are overloaded, they switch between more PRs, give shallower feedback, and reject or miss more. That creates more rework, which adds load, which creates more rework.
It’s like rush-hour traffic. Up to a point, more cars means more people get home. Past that point, cars block each other, and fewer people get home per hour than when the road was quieter. Early internet networks failed in exactly this way, a problem engineers called congestion collapse [4]. They fixed it by having computers slow down when the network signalled it was full [5]. Delivery pipelines need the same kind of brake.
Left: the vicious cycle. Right: useful output rises with incoming work until capacity, then falls.
2.5 Where the time really goes
If you could put a stopwatch on one change from start to finish, what would you see? Here is an illustrative timeline, the kind you can get from tracing tools (each bar is one step, labelled with the name the tracing tool records):
One change, 82 hours from start to production. The AI wrote it in 6 minutes and reworked it in 3: 9 minutes in total, about 0.2% of the time. The change spent 74 hours (about 90%) waiting for a human to look at it, 54 hours in the first wait alone.
Making the AI twice as fast would save four and a half minutes. Halving the review wait would save a day and a half. That’s where the remedies below focus.
3. Remedy 1: Make the specification the thing people review
The problem it solves. If reviewers have to read every line AI writes, review effort grows with the amount of code, and AI can write a lot of code.
The idea. Ask humans to review something much smaller: a short description of what the change must do and what must never happen. Then let machines check the code against it. Think of an acceptance checklist that a machine can run. When you hire a contractor to renovate a kitchen, you don’t inspect every screw; you agree up front that the drawers close, the tap doesn’t leak and the wiring passes code, and then you check those things.
Today, a human reads every line, and that’s the bottleneck. In the target flow, humans state the intent at the start and handle decisions and exceptions at the end. When automated checks fail, the change goes straight back to the AI, without using any human time.
Here is a trimmed example for a change that retries failed payment notifications (webhooks):
id: PAY-221
intent: Retry failed webhook deliveries without double-charging.
owner: jane.doe@example.com # a named human owner; not delegable to the agent
invariants: # things that must always be true
- at_most_one_charge_per_idempotency_key
- retries_le_5
- backoff_is_jittered_exponential
A human can read and approve that in a minute. Each line under invariants becomes an automated test. For example, the “never charge twice” rule is checked by a property-based test: instead of a handful of hand-picked examples, the testing tool invents 10,000 random sequences of successes, timeouts and errors, and checks that no customer is ever charged twice for the same payment. (The full spec and test are in the appendix.)
One warning: this only pays off if the spec is much shorter than the code. If your spec is as long as the implementation, you’ve just moved the bottleneck into a different document. AI can draft specs, but a named human owns each one. For more on this way of working, see Code is Cheap, Show Me the Markdown.
What you can try this week:
- Add three lines to your PR template: Intent (one sentence), Must always be true, Must never happen. Ask the AI to fill them in, and ask reviewers to read those first.
- For your next AI-generated change, write the acceptance criteria before prompting the agent, and paste them into the prompt.
- Pick one important rule in your codebase (“never charge twice,” “never lose a message”) and turn it into an automated test.
4. Remedy 2: Check the work independently and attach the evidence
The problem it solves. If the same AI that wrote the code also says “looks good to me,” you’ve learned very little. And if checks just produce opinions in a comment thread, a human still has to dig through everything.
The idea. A student shouldn’t grade their own exam. Verification should be done by a separate checker that:
- sees only the spec and the code, not the generator’s reasoning (so it can’t be talked into the same mistake);
- ideally uses a different AI model, so the two don’t share the same blind spots;
- produces tests that run, not opinions;
- leaves to ordinary, predictable tools (test runners, security scanners, linters) whatever they can decide, and uses AI only to fill the gaps.
The appendix lists common tools for each kind of check.
Test the tester. How do you know an automated checker is good enough to trust? Plant bugs on purpose and count how many it catches. Use both small automatic code mutations (flipping a < to <=, deleting a line) and replays of real changes that caused past incidents, because made-up bugs tend to be simpler than real ones [12].
Then be honest about how little a small test proves:
Each team planted 100 bugs. Team A’s checker caught 94, but with only 100 tries, its true catch rate could plausibly be as low as about 87%, which is below a 90% bar. Team B’s caught 97 and stays above the bar (about 91.5%) even in the worst plausible case. Team A doesn’t need a lower bar; it needs to plant more bugs to get a clearer answer.
Attach an evidence packet. Every change should carry a short report of what the checks found, like a lab report attached to a patient’s file. The doctor doesn’t redo every blood test; they read the report and focus on the values flagged in red. In the same way, a good evidence packet points the reviewer at, say, “test coverage is slightly below target” and “open question: is 5 retries acceptable for customers on the old plan?” instead of a 2,000-line diff. The packet is written in a machine-readable format (JSON), so it can also feed the automated rules in Remedy 3. (Example in the appendix.)
What you can try this week:
- If you use an AI review bot, make sure it isn’t the same model, with the same context, that wrote the code.
- Ask your CI pipeline to post a short summary comment on every PR: tests passed and failed, new security findings, performance change, open questions.
- Run a mutation-testing tool (for example Stryker, PIT or mutmut) on one module, and see how many planted bugs your current tests catch.
5. Remedy 3: Review in proportion to risk
The problem it solves. When every change gets the same review, a typo fix in the docs waits in the same line as a change to the payment system. Reviewers spend precious attention where it isn’t needed.
The idea. Do what a hospital emergency room does: triage. A sprained ankle and a heart attack don’t get the same treatment or wait in the same line. Sort changes into tiers using two questions: how much damage could this do (one module, or all users, money and data?) and how easily can we undo it (instant rollback, or irreversible?).
| Tier | Typical changes | How they are reviewed |
|---|---|---|
| 1 | Docs, internal clean-ups, isolated utilities | Merge automatically when all checks pass |
| 2 | Ordinary business logic, features behind a feature flag | Evidence packet, and a human spot-checks a sample |
| 3 | Public APIs, data models, core business logic | A human always reviews |
| 4 | Login and permissions, payments, deleting data | Expert review, more than one approver, gradual rollout |
Risk grows upward (more damage possible) and to the right (harder to undo). The arrow shows the cheapest way to save review effort: make a risky change reversible, with a feature flag (an on/off switch in production), a canary release (rolling out to a small slice of users first) and automatic rollback, and it drops from tier 4 to tier 2.
Two rules keep this honest:
- A machine decides the tier from the actual diff, never the AI that wrote the code. If the agent could label its own work “low risk,” it eventually would. Your CI can work out the tier from which files changed, whether a public API or database schema changed, and how big the diff is. Tools like Open Policy Agent (OPA) let you write these rules as code. (Full policy in the appendix.)
- The most dangerous areas never get a discount. Payments, login and anything irreversible stay in the top tiers, even behind a feature flag.
What you can try this week:
- List the folders where a mistake would really hurt (for example
auth/,payments/,billing/) and require an expert reviewer there, using your code host’s CODEOWNERS file. - Agree as a team on what counts as tier 1, and let those changes merge on green checks.
- Before your next risky change, ask: “Could we put this behind a feature flag?” If yes, it may need much less review.
6. Remedy 4: Don’t produce more than you can check (backpressure)
The problem it solves. If AI writes changes faster than reviewers can check them, the extra work doesn’t ship sooner. It just waits in line, goes stale, and makes reviewers slower (Section 2).
The idea. A lift won’t close its doors and go if it’s over the weight limit. A good restaurant stops seating new guests when the kitchen is backed up, because guests who sit down and then wait an hour are worse off than guests who wait at the door for ten minutes. Delivery needs the same thing: backpressure, where a full review queue slows down how much new work AI starts.
Three feedback loops. When the review queue is too long, AI generation slows down. When rework or defects rise, a “circuit breaker” pauses the scale-up. And bugs found in production become new spec cases and tests. At the front, work without acceptance criteria is turned away.
In practice, that means five simple rules:
- No criteria, no AI. Don’t start AI generation for a task that has no owner and no acceptance criteria.
- Cap work in progress. Limit how many AI-generated PRs a team can have open at once.
- Generate a bit less than you can review. Aim for about 75% of review capacity, so reviewers stay out of the danger zone in Section 2.3.
- Pull the brake when quality drops. If rework or post-release failures rise past a set level, stop adding more AI agents until they recover.
- Learn from escapes. Every bug that reaches users becomes a new test or spec rule.
If you run several coding agents in parallel, you can borrow the rule the internet uses to avoid traffic jams [5]: add one agent at a time while things are calm; cut the number in half as soon as the queue backs up. (A ten-line version is in the appendix.)
Two more controls help a lot:
- Keep PRs small. Studies of code review found that reviewers catch far fewer defects once a review goes beyond a few hundred lines, or once they read faster than about 500 lines an hour [6]. AI makes splitting work cheap, so set a size limit per PR and use stacked PRs (a series of small PRs that build on each other).
- Budget reviewer time. Site reliability engineers give each service an “error budget”: a set amount of failure it may spend [9]. Do the same with attention. Give each team a fixed number of reviewer-hours per week for AI-generated work. When the budget is spent, generation pauses. Human attention becomes planned capacity instead of a resource everyone assumes is unlimited.
You can also widen the bottleneck itself: spend part of your AI budget on tools that help reviewers (diff explanations, summaries of behaviour changes), not only on tools that write more code.
What you can try this week:
- Set a limit on open AI-generated PRs per person or per team (start with something like 3 per person), and agree that new agent work waits when you hit it.
- Add a PR size check in CI that warns above about 400 changed lines.
- Look at how many PRs your team actually reviews per week, and plan AI-generated work at about three-quarters of that.
7. Remedy 5: Measure the flow, not the output
The problem it solves. If you measure lines of code written, PRs opened or “percentage of code written by AI,” you reward exactly the behaviour that overloads reviewers. There’s an old rule for this, Goodhart’s law: when a number becomes a target, it stops being a good measure. Count PRs, and you’ll get lots of PRs.
The idea. Measure how smoothly work flows to users and what it costs. A well-tested set of delivery metrics comes from the DevOps Research and Assessment (DORA) program [7]: how often you deploy, how long a change takes to reach production, how often deployments fail, and how quickly you recover. A related framework, SPACE [8] (short for satisfaction, performance, activity, communication and efficiency), reminds you to include the human side: workload and focus.
For the problem in this post, watch these four numbers:
- How long changes wait for review. The time from “ready for review” to the first reviewer comment. If it keeps growing, generation is outrunning review.
- How often shipped changes break things. The share of deployments, especially of AI-written changes, that cause an incident or need a rollback.
- How much gets reworked. The share of reviews that send a change back. A rising rate is the first sign of the vicious cycle in Section 2.4.
- How much reviewer time each change costs. Human review hours per merged change. This is the real price of a change, and AI doesn’t reduce it automatically.
One more risk is new with AI: comprehension debt, code that nobody on the team has ever really understood, because nobody wrote it. It stays invisible until an incident, when the person on call reads the code for the first time at 3 a.m. and recovery takes longer. To reduce it, have the agent write a short walkthrough for every non-trivial PR, and make sure at least two people can explain each critical module without notes.
All of these can be gamed if you look at just one. Read them together, and never use them to rank individuals. (A detailed metrics table, and how to collect these numbers with tracing, are in the appendix.)
What you can try this week:
- Pull the last month of PRs from your code host and compute the median time to first review. Put it on the team dashboard.
- Add one field to your incident template: “Had the responder read this code before the incident?”
- Stop reporting “lines of AI-generated code” or “PRs opened” as success metrics.
8. Earned autonomy: when can AI work skip line-by-line review?
The remedies combine into one mechanism we call earned autonomy. It works like getting a driving licence: you start with an instructor beside you, then drive alone with restrictions, and only after a long clean record do you get a full licence. A crash can cost you points or the licence.
Each category of work (dependency updates, simple create/read/update/delete endpoints, UI text changes, database migrations, …) gets its own autonomy level:
- L0, Suggest: AI drafts, a human writes the code.
- L1, Full review: AI opens the PR, a human reviews all of it.
- L2, Sampled review: the evidence packet is always attached, and a human reviews about one in five changes.
- L3, Auto-merge: changes merge on their own, protected by feature flags, canary releases and automatic rollback when service health drops.
Promotion requires evidence (for example, at least 100 clean changes in a row, or 300 for L3, with no escapes and a checker that catches at least 90% of planted bugs). Any escaped bug or incident drops the category one level automatically. The thresholds are examples. The highest-risk areas (tier 4) never go above L1.
Why so many clean changes? Because a short clean streak proves less than it feels like it does. If 6% of changes in a category had hidden problems, you would still see 50 clean ones in a row about one time in twenty: unlikely, but far from impossible.
After 50 clean changes in a row, the true escape rate could still be as high as about 6%. After 100, about 3%. To be confident it’s under 1%, you need about 300. Statisticians know this as the “rule of three” [13].
Combined with the checker test from Remedy 2, this turns the vague question “can we trust AI code here?” into a clear rule that anyone on the team can audit and explain.
9. Limitations
- The numbers are simplified. The queue figures assume a steady flow of work and interchangeable reviewers. Real teams have specialists and competing priorities, so treat the numbers as showing the direction and rough size of the effect, not as precise predictions.
- Specs are never complete. They capture what someone thought to write down. Problems that cut across the whole system still need human design review.
- Checkers can be fooled. A checker tuned on planted bugs may miss real design mistakes. Always include real past incidents in your test set.
- Any metric can be gamed when someone optimizes it alone.
- Someone has to own it. No tool removes the need for a named human who owns each spec and each high-risk decision.
10. Conclusion
AI changed the cost of writing code. It didn’t change the cost of trust. If checking is the bottleneck, writing even faster just makes the line longer.
The way out is not to make reviewers read faster. It is to give them less to read, better evidence, and a pace they can sustain:
- Review the intent, not every line (Remedy 1).
- Replace opinions with evidence that runs (Remedy 2).
- Spend attention where the risk is (Remedy 3).
- Generate only as fast as you can check (Remedy 4).
- Measure flow and cost, not output (Remedy 5).
- Let each kind of work earn its autonomy with a track record.
The teams that win with AI won’t be the ones that write the most code. They’ll be the ones that can show, at the lowest human cost, that their code deserves trust.
Start here
- Measure your median time to first review this week.
- Add Intent / Must always be true / Must never happen to your PR template.
- Cap open AI-generated PRs per person.
- Add a PR size warning in CI.
- Mark your high-risk folders in CODEOWNERS.
- Have CI post a short evidence summary on every PR.
- Pick one low-risk category (for example, dependency updates) and start counting its clean streak.
Appendix: for engineers who want to build it
Everything below is illustrative and meant as a starting point. Field names and thresholds are examples, not standards.
A.1 The full spec and property test
An illustrative spec for the webhook retry change from Remedy 1:
# specs/pay-221.yaml (illustrative)
id: PAY-221
intent: Retry failed webhook deliveries without double-charging.
owner: jane.doe@example.com # a named human owner (team: payments); not delegable to the agent
contracts:
- openapi: api/webhooks.yaml#/components/schemas/DeliveryAttempt
invariants:
- at_most_one_charge_per_idempotency_key
- retries_le_5
- backoff_is_jittered_exponential
non_functional:
p99_latency_regression_budget_ms: 5 # maximum allowed increase in 99th-percentile (p99) latency
reversibility:
feature_flag: webhook_retry_v2
open_questions:
- Retry cap for merchants on the legacy plan
Invariants become property-based tests that explore input space far beyond hand-written examples (here with Hypothesis):
# tests/test_pay_221.py (illustrative; Ledger and WebhookHandler are the system under test)
from hypothesis import given, settings, strategies as st
events = st.lists(
st.tuples(st.sampled_from(["key-1", "key-2", "key-3"]),
st.sampled_from(["ok", "timeout", "5xx"])),
max_size=50,
)
@given(events)
@settings(max_examples=10_000)
def test_at_most_one_charge_per_idempotency_key(evts):
ledger = Ledger()
handler = WebhookHandler(ledger, max_retries=5)
for key, outcome in evts:
handler.deliver(key, simulated_outcome=outcome)
for key in {k for k, _ in evts}:
assert ledger.charges_for(key) <= 1
Spec compression ratio. Track spec lines divided by implementation lines for each change. If it approaches 1, the spec is only paraphrasing the code, and reviewing the code directly is cheaper.
A.2 Verification layers and tools
| Layer | Technique | Example tools |
|---|---|---|
| Functional | Contract and property-based testing | Pact, Schemathesis, Hypothesis, fast-check, jqwik |
| Test adequacy | Mutation testing | PIT, Stryker, mutmut |
| Security | Static and dynamic application security testing (SAST, DAST), dependency scanning | Semgrep, CodeQL, OWASP ZAP, Trivy |
| Architecture | Policy and dependency rules as code | Open Policy Agent (OPA) with Conftest, ArchUnit, import-linter, dependency-cruiser |
| Reliability | Fault injection | Toxiproxy, Chaos Mesh, LitmusChaos |
| Performance | Load and regression testing | k6, Locust |
| Behavioral | Independent agent exploring scenarios | Verifier agent emitting executable tests |
| Runtime | Service-level objectives (SLOs) and anomaly detection | OpenTelemetry metrics and traces |
When calibrating a verifier, run the planted-bug test separately for each category of work, and track false alarms on clean changes too. Automated mutations under-represent design-level defects [12], so include replays of real historical incidents in every calibration set.
A.3 The evidence packet
Continuous integration (CI) writes the packet and the PR renders it. Humans read the summary; policy engines read the JSON.
{
"change_id": "example-change",
"spec": "PAY-221",
"tier": { "value": 4, "derived_from": ["path:payments/", "public_api_changed"], "reversibility_discount": "not applied: critical path" },
"reversibility": { "feature_flag": "webhook_retry_v2", "auto_rollback": true },
"checks": {
"contract_tests": { "passed": 42, "failed": 0, "generated_from_spec": 3 },
"property_tests": { "invariant": "at_most_one_charge_per_idempotency_key", "examples": 10000, "status": "pass" },
"mutation_score": { "value": 0.78, "threshold": 0.80, "surviving": 4 },
"sast": { "new_findings": 0 },
"perf": { "p99_delta_ms": 1.8, "budget_ms": 5 }
},
"human_questions": ["Is a 5-retry cap acceptable for merchants on the legacy plan?"]
}
Illustrative values. The reviewer’s attention goes to one weak signal (mutation score below threshold) and one open business question, not to the full diff.
A.4 The tier policy as code
The tier is derived from the diff by CI, never declared by the generating agent. Expressed as an OPA policy (Rego v1):
package review.tier
import rego.v1
critical_paths := [`^auth/`, `^payments/`, `^billing/`]
critical if {
some f in input.changed_files
some p in critical_paths
regex.match(p, f)
}
signals contains 4 if critical
signals contains 4 if input.irreversible_ops > 0
signals contains 3 if input.public_api_changed
signals contains 3 if input.schema_migration
signals contains 2 if input.lines_changed > 50
signals contains 1 if true
base := max(signals)
reversible if {
not critical
input.behind_feature_flag
input.auto_rollback_enabled
input.irreversible_ops == 0
}
# Reversible changes outside critical paths drop from tier 3 or 4 to tier 2.
tier := 2 if {
reversible
base >= 3
}
tier := base if not reversible
tier := base if {
reversible
base < 3
}
input is assembled by CI from the diff, CODEOWNERS, migration detectors and API-schema diffing. Critical paths (auth, payments, billing) and irreversible operations (deletes, money movement, outbound messages) are excluded from the reversibility discount by construction.
A.5 Flow control
| Mechanism | Rule | Signal |
|---|---|---|
| Admission control | No AI generation without an owned spec and acceptance criteria | Spec presence |
| Work-in-progress (WIP) limit | Cap open AI-generated changes per team | Open PR count |
| Rate limit | Cap generation at about 75% of review capacity, so reviewers stay out of the danger zone | Review throughput |
| Circuit breaker | Halt scale-up when rework or change failure rate crosses a threshold | Rework ratio, change failure rate (CFR) |
| Feedback | Escaped defects become new spec cases and tests | Incidents |
The number of concurrently running coding agents can follow the additive-increase, multiplicative-decrease (AIMD) rule that TCP uses for congestion control [5]:
def next_concurrency(c: int, wait_p50_h: float, rework_ratio: float,
target_wait_h: float = 4.0, max_rework: float = 0.25) -> int:
"""AIMD controller for the number of concurrently running coding agents."""
if rework_ratio > max_rework or wait_p50_h > 2 * target_wait_h:
return max(1, c // 2) # multiplicative decrease on congestion
if wait_p50_h < target_wait_h:
return c + 1 # additive increase while queue is healthy
return c
A.6 Metrics in detail
Alongside the DORA four keys [7] (deployment frequency, lead time for changes, change failure rate and failed-deployment recovery time), these measures cover verification cost and cognitive load, in the spirit of SPACE [8]:
| Metric | Definition | Source |
|---|---|---|
| Review queue wait (median and 90th percentile, p50/p90) | ready_for_review → first review activity |
Review webhooks |
| Verification cost per change | Human review hours per merged change | Delivery traces |
| Rework ratio | Share of review rounds that request changes | Review events |
| AI-origin change failure rate | Share of deployments of AI-origin changes that fail | Deploy + incident data |
| Review load | Lines reviewed per engineer per week | Version control system (VCS) |
| Context switching | Distinct PRs touched per engineer per day | Review events |
| First-read-in-incident rate | Share of incidents where the responder first read the implicated code during the incident | Postmortem field |
A.7 Delivery observability with OpenTelemetry
Agent observability today typically covers model calls, token usage and tool execution. Running the remedies above requires observing the entire change lifecycle, from intent through generation, verification, human decision and production outcome. That is what produces a timeline like the one in Section 2.5.
Join key. Create one trace per change when the work item is admitted, and persist its W3C traceparent [11] in PR metadata. Agents, CI, review webhooks, deploy tooling and runtime telemetry all attach spans to that trace. This works regardless of where the agents and pipelines run: developer laptops, VMs, hosted CI or Kubernetes.
Human-paced stages like review are not live processes, so emit them after the fact from webhook events with explicit timestamps:
from opentelemetry import trace
from opentelemetry.trace.propagation.tracecontext import TraceContextTextMapPropagator
tracer = trace.get_tracer("delivery.review")
propagator = TraceContextTextMapPropagator()
def on_review_submitted(pr, review):
"""Review webhook handler. Field names on pr/review are illustrative."""
parent = propagator.extract({"traceparent": pr.metadata["traceparent"]})
wait = tracer.start_span(
"review.queue_wait", context=parent,
start_time=pr.last_ready_for_review_ns, # reset each time review is re-requested
attributes={"delivery.change.id": pr.change_id,
"delivery.review.tier": pr.tier},
)
wait.end(end_time=review.first_activity_ns)
active = tracer.start_span(
"review.active", context=parent,
start_time=review.first_activity_ns,
attributes={"delivery.review.decision": review.state,
"delivery.change.ai_origin": pr.ai_origin},
)
active.end(end_time=review.submitted_ns)
Generation spans use the OpenTelemetry GenAI semantic conventions [10] (gen_ai.request.model, gen_ai.usage.input_tokens, gen_ai.usage.output_tokens, …). The delivery.* namespace is a proposed convention, not an existing standard.
With spans joined per change, cross-stage questions become queries. For example, human review cost and rework by generating model (PostgreSQL over an exported span table; assumes one generating model per change):
WITH gen AS (
SELECT DISTINCT trace_id, attributes->>'gen_ai.request.model' AS model
FROM spans WHERE name = 'agent.generate'
)
SELECT gen.model,
count(DISTINCT s.trace_id) AS changes,
sum(s.duration_s) FILTER (WHERE s.name = 'review.active') / 3600.0
/ count(DISTINCT s.trace_id) AS review_hours_per_change,
count(*) FILTER (WHERE s.name = 'agent.rework')::float
/ count(DISTINCT s.trace_id) AS rework_per_change
FROM spans s
JOIN gen USING (trace_id)
GROUP BY gen.model
ORDER BY review_hours_per_change DESC;
Other questions the same data answers:
- Which change categories consume the most human review time?
- Which agents appear efficient but shift cost to downstream stages?
- Which categories meet the bar for reduced review?
- What is the end-to-end time saved, as opposed to coding time saved?
A.8 Reference architecture
All components emit into one trace per change. Escaped defects feed back into the spec repository.
References
- J. D. C. Little, “A Proof for the Queuing Formula: L = λW,” Operations Research, 9(3), 1961.
- J. F. C. Kingman, “The single server queue in heavy traffic,” Mathematical Proceedings of the Cambridge Philosophical Society, 57(4), 1961.
- E. M. Goldratt and J. Cox, The Goal: A Process of Ongoing Improvement, North River Press, 1984.
- J. Nagle, “Congestion Control in IP/TCP Internetworks,” RFC 896, 1984.
- V. Jacobson, “Congestion Avoidance and Control,” ACM SIGCOMM, 1988.
- J. Cohen, Best Kept Secrets of Peer Code Review, SmartBear Software, 2006.
- N. Forsgren, J. Humble and G. Kim, Accelerate: The Science of Lean Software and DevOps, IT Revolution, 2018; and the annual DORA State of DevOps reports.
- N. Forsgren et al., “The SPACE of Developer Productivity,” ACM Queue, 19(1), 2021.
- B. Beyer, C. Jones, J. Petoff and N. R. Murphy (eds.), Site Reliability Engineering, O’Reilly, 2016.
- OpenTelemetry, Semantic Conventions for Generative AI Systems, opentelemetry.io.
- W3C, Trace Context, W3C Recommendation.
- Y. Jia and M. Harman, “An Analysis and Survey of the Development of Mutation Testing,” IEEE Transactions on Software Engineering, 37(5), 2011.
- J. A. Hanley and A. Lippman-Hand, “If Nothing Goes Wrong, Is Everything All Right? Interpreting Zero Numerators,” JAMA, 249(13), 1983.