Skip to content

The per-repository adoption roadmap moves one codebase’s delivery loops up Dan Shapiro’s Autonomy Ladder one rung at a time—from L1 to L4, and selectively L5—only when Git, CI, and pull-request artifacts prove each gate holds. It gives a tech lead owning one repository an exact sequence of harness changes, promotion evidence, and rollback rules.

Your organization targets L3 across pilot repositories this quarter, yet eight engineers configure agents privately, CI varies by habit, and review queues are stretching. Promoting a whole repository on a calendar schedule fails because routine dependency bumps and payment integrations carry completely different risk profiles.

One codebase runs at several autonomy levels simultaneously. Dependency bumps backed by contract tests can safely operate at L4 while payment work beside them stays at L2. The one map defines a loop as a repeatable class of change with its own trigger, named owner, and verification oracle, rated by what a human inspects before merge. Climbing loop by loop maps directly onto the six Software Factory stations—Intent, Harness, Loop, Graph, Verification, and Release—so critical code never blocks safe automation.

Choose the pilot repository and record a baseline

Section titled “Choose the pilot repository and record a baseline”

Verify four invariants before promoting any loop:

  • Reproducible local typecheck, lint, test, and build commands passing on the default branch.
  • Branch protection with required status checks and a named release approver.
  • Zero production credentials accessible to agent sessions.
  • At least five merged PRs per month in the pilot loop so 30 days yields real evidence.

Run npx @wondelai/harness-audit (automated harness audit) at the repo root to catch missing files, weak CI gates, or unprotected test paths across all six stations. Then capture five 90-day baseline metrics per loop from Git history: median lead time (opened to merged), first-pass CI success, median review rounds, median PR size, and revert or change-failure rate (metrics frameworks). Shorter lead time counts only when change-failure rate stays at or below baseline.

Register loops and risk-class caps in loops.yaml

Section titled “Register loops and risk-class caps in loops.yaml”

Commit loops.yaml at the repository root and require a matching CI-checked loop: PR label so audits filter cleanly:

# loops.yaml (excerpt)
- loop: dependency-bumps
owner: anna-kowalska # named engineer, never a team alias
risk_class: low # low | medium | high | critical
level: L3
oracle: tests/contract (CODEOWNERS protected, agent_can_edit_oracle: false)
baseline: { lead_time_days: 2.4, change_fail_rate: 0.03 }
next_transition: { to: L4, exit_criterion: "30d evidence bundles; 20 clean reads" }

risk_class caps autonomy regardless of model quality: critical paths (auth, money, data migrations) cap at L3 in year one, high-risk loops enter L4 only with governance sign-off, and only low-risk loops reach L5 (governance and autonomy). Holding a sensitive loop at L3 is disciplined engineering.

Each loop climbs one rung at a time. Tailor these starting thresholds inside loops.yaml alongside your transformation roadmap:

TransitionRepository changesGo: promotion evidenceStop: roll back one rung whenSign-off
L1 → L2Shared AGENTS.md core, thin adapters, secret deny rulesWhole loop uses committed core; zero secrets in transcriptsAny secret or production credential enters a sessionTech lead
L2 → L3Verification commands in AGENTS.md, Plan Mode, isolated worktrees, required CI, PR size capAgent runs local loop before PR; 30-day first-pass CI >= baselineReview wait or PR size climbs 4 weeks, or failure rate > baselineTech lead
L3 → L4Executable criteria, protected oracle (CODEOWNERS + hooks/sandboxes), CI evidence bundle, automated PR review, rollback drill100% evidence bundles for 30 days; 20 shadow/sampled reads with zero missesProduction escape in loop, unauthorized oracle edit, or PR lacking bundleService owner + CTO/delegate
L4 → L5Low-risk auto-merge, progressive delivery with auto-rollback, production signal creating intentrisk_class: low, independent oracle owner, full quarter at L4 within baselineAny high-severity incident traced to an unread changeCTO + security

L1 → L2 starts with one shared instruction core covered in shared team context.

Moving from L2 to L3: unattended work with diff review

Section titled “Moving from L2 to L3: unattended work with diff review”

At L3, reviewers inspect finished diffs. Ensure every diff arrives small, isolated, and pre-verified:

  1. Commit literal verification commands in AGENTS.md (typecheck, lint, test, build) and require agents to execute them before reporting done.
  2. Require Plan Mode before multi-file edits and keep specs or plans on the branch (the artifact chain).
  3. Isolate every task in its own checkout (Git worktree or cloud VM) so parallel agents never collide on files, ports, or state (Git worktrees).
  4. Enforce CI as required branch checks so red runs block merges deterministically.
  5. Enforce a PR size cap (for example, 400 changed lines excluding lockfiles). DORA’s AI Capabilities Model (Google Cloud, December 2025) emphasizes small batches because AI easily generates massive blocks that overwhelm review and testing.

Invocation differs by tool while gates remain identical: Claude Code runs headless worktrees with explicit tool allowlists and hooks, Codex runs inside workspace-write sandboxes with worktrees or Cloud environments, and Cursor pairs Plan Mode with Worktrees or Cloud Agents.

Moving from L3 to L4: spec and evidence replace diff reading

Section titled “Moving from L3 to L4: spec and evidence replace diff reading”

Budget the most time for L3 → L4, where safety depends on separating the verification oracle from the authoring agent:

  1. Write machine-runnable acceptance criteria turning stories into failing checks before coding (acceptance criteria).
  2. Protect the oracle structurally with CODEOWNERS on test directories, .github/, and loops.yaml, backed by hooks or sandbox deny rules (protecting the oracle, oracle strength).
  3. Enforce a CI-checked evidence bundle proving spec delta, criterion-to-check results, touched oracle files, and command output (the evidence bundle).
  4. Layer automated PR review (Claude Code Review, Codex GitHub review, or Cursor Bugbot) on every PR (agent PR review).
  5. Transfer trust in stages through shadow, random 1-in-5 sampled, and evidence-only review (trust transfer).
  6. Drill the rollback in staging and record recovery time before signing off.

For strictly low-risk L4 → L5 loops, add conditional auto-merge, progressive delivery with automatic rollback (review and ship), and closed-loop triage opening scoped intents through the same merge gates (automation), validated with a synthetic breach drill.

DORA’s 2025 report (Google Cloud, September 2025) found AI adoption improved throughput alongside a persistent negative relationship with delivery stability. Verify four signals at every promotion:

  • 30-day level distribution: report merged change shares per rung—never average the repo into one number.
  • Paired stability guardrail: compare per-loop revert and change-failure rates against baseline.
  • Random 10-PR audit: sample ten merged PRs and verify every required artifact holds up.
  • Automated harness audit: run npx @wondelai/harness-audit --ci to confirm repository controls match the claimed rung (harness audit guide).

Failure modes when climbing the ladder per repository

Section titled “Failure modes when climbing the ladder per repository”
  • Choosing a trivial pilot loop. Typo fixes prove nothing. Recovery: pick a production-relevant loop with real tests and regular volume.
  • Promoting the whole repository at once. Recovery: scope every promotion strictly to one entry in loops.yaml.
  • Letting the agent edit its own oracle. Recovery: demote to L3, lock test/CI paths via CODEOWNERS and hooks or sandboxes, and restart the 30-day clock.
  • Outrunning the review queue after L3. Recovery: enforce the PR size cap, halt parallel dispatch, and stabilize the review queue.
  • Turning artifacts into empty paperwork. Recovery: delete unread template fields and fail CI on missing command results.
  • Locking gates inside one vendor UI. Recovery: keep AGENTS.md, loops.yaml, CODEOWNERS, and CI checks in Git so every tool faces identical enforcement.

Verify current CLI flags, worktrees, and cloud execution options in Claude Code docs, OpenAI Codex docs, and Cursor docs.

Did this guide help you?

One tap, no sign-in.

not at all a lot