dev-loops

A Deep Dive: Coordination Delay and the Waiting Between Actions

AI agents collapsed the time it takes to write code. The hours now leak in the coordination around it — author to reviewer, reviewer to CI, CI back to a human — while work waits to be handed over. dev-loops keeps the next step always known, so whoever is free pulls it from the visible state, and it turns the waiting between actions into something you can measure.

known next step wait states coordination delay
Part 1 · Eliminating coordination delay

The core idea

The Next Step Is Always Known

  • Like a Kanban board. The system computes the next action for any change; whoever is free pulls it from the visible state, so the handoff turns optional.
  • Who acts next? An outer loop reads that next action each cycle and makes one move at a time.
  • The PR's life. An inner loop walks each pull request from first draft to merged, one explicit step at a time.
  • The feedback. A second inner loop tracks every review comment from raised to resolved, so nothing gets lost.
  • When the next action is ambiguous, it stops and asks before acting.

One move per cycle

Start
→
Who acts next?
→
Write the code
Resolve feedback
Ask a human
→back to: who acts next
Who acts next?

Safe pauses

Pauses Only at Safe Boundaries

  • Pause now — it's safe to hand control to a human this instant.
  • Pause at the next clean boundary — finish the step in flight first, then stop.
  • Blocked — a human decision is required before the loop continues.
  • A pull request advances only after its review actually runs. The gate fails closed.

Example

You ask it to stop mid-edit. It tags the request stop_at_next_safe_gate, finishes the step in flight, and pauses the moment that step lands clean. You get a tidy stopping point at a clean boundary.

Mid-flight steering

Change the Rules Mid-Run

  • A hard rule — a constraint the next steps must obey.
  • A preference — a nudge it tries to honor when it can.
  • A question — a clarification it folds into its next move.
  • Stop when safe — wind down at the next clean boundary.

Example

Halfway through, you say "don't touch the auth module." It lands as a hard_constraint the remaining steps must honor; the rule takes effect from the next move on, with progress preserved.

Parallel review

Parallel Reviewers Converge on One Verdict

  • Every reviewer reads the same evidence bundle — the same diff, the same context — so their verdicts are directly comparable.
  • Each looks from a different angle (scope, coverage, threat model) at the same time.
  • The findings merge into one verdict.
  • A single serious finding blocks the merge.

Same evidence in, one verdict out

Evidence bundle
→
Scope
Coverage
Threat model
→
One verdict

Self-healing

The Loop Recovers and Resumes

  • A failed CI check or a fail-closed tool response is detected and recorded on the pull request.
  • The resolver re-derives the next action from authoritative state, and the run resumes from there.
  • Recovery is one of three moves: retry the check, run review→fix→re-review until it converges (round-capped by refinement.maxCopilotRounds), or stop and ask a human.
  • Run progress is preserved through the recovery, so nothing already done gets redone.

Failure detected, one recovery move, resume

Run
→
Fails / fails-closed
→
Re-derive next action
→
Retry the check
Review → fix → re-review
Ask a human
↻resume: progress preserved
Run

Self-improving

Each Change Sharpens the Next

  • Grilling locks a spec before any code moves, so implementation starts from a settled shape.
  • Review runs as fan-out angles — extendable per repo — each reading the same evidence from a different lens.
  • Review→fix rounds tighten the change in flight until it converges.
  • After merge, a retrospective records advisory findings on the change that the conductor can open as new tracked issues, feeding the next grill.

Each merge feeds the next issue

Grill / refine
→
Implement
→
Fan-out angles
→
Review / fix converge
→
Merge
→
Retrospective → follow-ups
↻loop back to: grill / refine
Grill / refine

Verified done

"Done" Means Merged

A human merges

  • Merging is reserved for a human.
  • At the final gate it hands the PR to a contributor.
  • A human always owns the last yes.

"Done" is real

  • The board shows done only when a PR actually merged.
  • It reads the real merge signal from the source of truth.
  • Each task runs in its own isolated workspace.

Green is checked

  • CI-green is verified against the real result.
  • Reads whatever provider posts checks to the PR.
  • It waits for the real result before reporting.

Why a state graph

State Graphs Pin Behavior

  • Steer a workflow with prose alone and its behavior shifts with every model update, longer context, or change in temperature, with no warning.
  • dev-loops runs the workflow on a state graph: the moves are a closed, listable set, so the resolver computes the one next action for any change and surfaces it.
  • That is what makes the next step always known and pullable, and a known set of moves is testable, so a wrong transition is caught in CI.
Part 2 · Make the waiting visible

The delay pattern

One Interrupt Costs Five Transitions

  • A five-minute question costs the switch out, the rebuild, and the recovery on both sides.
  • Every interruption walks the same five steps — notice, switch, rebuild, act, recover — and each one has its own latency.
  • Across a queue of work, repeated interrupts multiply.

What one interrupt actually triggers

Need response
→
Notice
→
Switch
→
Rebuild state
→
Act
→
Recover

Handoff cost

Handoffs Restart Discovery

What the receiver pays for, every time

  • Reconstruct what changed since they last looked.
  • Gather enough context to act with confidence.
  • Confirm who owns it now and what's blocking it.
  • Absorb the round-trip if any of that is unclear.

Why it's worse with mixed actors

  • Ambiguous ownership pauses a human until they ask.
  • Missing context halts an AI agent — it guesses or stops.
  • Every human↔AI swap is one more place the state can drop.
  • More hands speed things up only when the state crosses intact.

The attention bottleneck

Human Attention Routes Every Transition

  • The tools show the wait: GitHub timestamps every transition; a PR timeline reveals exactly how long each gap lasted.
  • The cost is the routing — getting from “ready” to “shipped” runs through human attention.
  • The person who can act is busy, context-switched, or in another timezone, so the wait is structural.
  • When it is available, spending it on mechanical decisions — noticing a status, confirming a CI result — crowds out the judgment-heavy work only a person should do.

Observable state

Four Fields Unblock the Next Actor

The fix is making the state of the work explicit, so picking it up becomes a continuation of work already in motion.

Keep these four current and the next actor — human or agent — starts immediately, with nothing to reconstruct.

State that turns pickup into continuation

  • Who owns it now — no guessing whose move it is.
  • What's blocking it — and what would unblock it.
  • The latest decision — so nobody re-litigates settled ground.
  • The safe next step — the one move that's known to be safe.

The measurement loop

Measure the Wait First

  • Capture the state, and the waits between actors become numbers you can point at.
  • Find the transition that stalls most, change the process there, and check whether the wait actually dropped.
  • Then confirm the change held quality steady, which is the step people skip.

A loop you can actually run

State captured
→
Waits measured
→
Process changed
→
Outcomes verified
↻back to: state captured
State captured

From idea to instrument

The Fields Already Live in the Work

Owner & next step are a board

  • Work moves through visible columns: next up, in progress, done.
  • The column carries the current owner and the safe next step.
  • A deterministic resolver picks the next action and names whose move it is.

Decisions leave a trail

  • Each review gate records its verdict in the open, with the findings behind it.
  • The latest decision is written down for the next actor to read.
  • Pick the work up tomorrow and the reasoning is still there.

Automate only where it's safe

  • The wait at CI is handled by waiting on the real check result from whatever provider posts it.
  • After a merge, finished workspaces are reclaimed and long-done items archived.
  • Automation runs only where the state says continuing is safe.

Why it pays off

Visible State Moves Three Numbers

Quality

  • Fewer wrong resumptions from stale context.
  • Cleaner fix loops.
  • Regressions are easier to trace back.

Waiting time

  • Faster first action after a handoff.
  • Context is already present at pickup.
  • Approvals stop sitting unnoticed.

Throughput

  • Higher flow efficiency.
  • Fewer items stalled in the dark.
  • Less coordination drag per merge.

The takeaway

Keep the Next Step Known, Measure Every Wait

  • Keep the next step always known, so whoever is free pulls it and a handoff, when it happens, is a recorded decision you can see.
  • Make the state explicit, and pickup becomes a continuation of work already under way.
  • Measure the waits, and the biggest stall stops hiding behind your commit history.
  • Automate only where state proves it's safe, and the judgment calls stay with a human.

Keep the next step known so the next actor pulls it, and measure how long the work waits.