Architecture

Three operating planes.
Calibrated for 2026 frontier models.

AgentFlow 2.0 separates supervisory steering, worktree execution, and recursive self-improvement so no agent inside an execution loop can grade its own work, rewrite its own test oracle, or burn frontier compute in degraded context.

Three planes. One portable core.

AgentFlow does not replace your coding CLI, git repository, or OpenRig daemon. It governs how they coordinate, how effort is calibrated to context depth, and how evidence is verified before work advances.

Read the modular architecture specification ↗

2026 Frontier Model & Effort Calibration

High effort in deep context degrades.
Calibrate effort to the turn.

2026 frontier models (`GPT-6.1 Sol`, `GPT-6 Astra`, `Gemini 4 Argon`, `Claude Opus 4.6`, `Claude Sonnet 4.6`, `Grok 4.7`) reason deeply—but running `effort: high` inside a polluted >80k-token tool history causes over-mutation and instruction drift. AgentFlow enforces an explicit Effort-Degradation Guard.

AgentFlow 2.0 capability profiles, model routing, and effort calibration
Capability Profile & Seat2026 Model Routing ExamplesEffort-Degradation Guard & Context Law
architect-lead
orch.arch / steer.lead
gpt-6.1-sol, claude-opus-4-6, gemini-4-argonDefault `effort: medium` for orchestration and planning; escalates to `effort: high` strictly in clean context (<40k tokens) for Phase 2 Architecture Councils.
deep-reasoning
dev.build / rev.review
gpt-6-astra, claude-sonnet-4-6, gemini-4-argonClamped to `effort: medium` during persistent worktree execution (Composite Phase 3–5 pass) to prevent mid-loop over-thinking. Phase 6 security audits use clean-context `effort: high`.
lightweight / scout
dev.qa / eval.tester / L2
gemini-3.8-flash, gpt-6-mini, claude-haiku-4-5, grok-4.7-fastClamped to `effort: low` for deterministic test execution, black-box surface probing, and bounded read-only L2 subagent discovery.
decider port
steer.decider
d3-flash (fallback: gemini-3.8-flash, gpt-6-mini)Deterministic-first, `effort: low` structured classification invoked only after code invariants pass or when `reworkRounds > 2` trips the Epoch Circuit Breaker.

Why clamp persistent builders to `effort: medium`? Empirical traces show that frontier models running at `effort: high` after dozens of tool calls second-guess passing tests and widen scope. Keeping persistent seats at `medium` and spawning fresh, clean-context L2 subagents or Council bursts at `high` delivers higher first-pass acceptance at a fraction of the token cost.

Multi-harness resilience & Four-Eyes

Survive quota exhaustion.
Never grade your own homework.

AgentFlow inspects installed CLIs and provider capabilities dynamically, combining Two-Level Platform Fallback with cross-family reviewer dispatch.

Claude CodeCodex (GPT-6)Agy (Gemini 4)PiGrokOpenRig (S2)Manual

Two-Level Platform Fallback

If a provider hits a rate limit or outage at a phase boundary, Level 1 downgrades to the fallback model tier on the same platform; Level 2 fails over to an orthogonal platform against the exact same git worktree.

Dynamic Four-Eyes Dispatch

Phase 6 (`rev.review`) automatically selects an available model family orthogonal to the Phase 4 builder (`Anthropic` ↔ `OpenAI` ↔ `Google`) to eliminate correlated model blind spots.

Sticky Builder Return Affinity

When Phase 5 QA or Phase 6 Review requests rework (`reworkRounds ≤ 2`), the slice returns to the exact `dev.build` seat and `.worktrees/<branch>` checkout that authored the code, preserving warm context.

Read execution targets and fallback rules ↗

Plane 3 · Closed-Loop Recursive Self-Improvement

Turn execution friction into
human-gated policy upgrades.

Most agent setups repeat the same mistakes across sessions. AgentFlow 2.0 includes a 5-stage Closed-Loop RSI pipeline that observes real runs and proposes reviewable improvements to `.agentflow/` rules and skills.

01 / PROBE & EMIT

Out-of-band surface evaluation

`eval.tester` and `surface-reader.mjs` inspect live CLI, API, UI, and docs surfaces without access to builder internals, emitting structured defect and friction envelopes via `intake-emitter.mjs`.

02 / EXTRACT & AUDIT

Session trace & boundary analysis

`session-extractor.mjs` and `audit-traces.mjs` scan `.agent-runs/` and transcript JSONL logs for rework spirals (`reworkRounds > 2`), path-ownership denials, and high-effort context degradation.

03 / SYNTHESIZE & GATE

Human-approved policy diffs

`synthesize-refinements.mjs --propose` drafts targeted updates to skills, Consequence Floor regexes, or seat prompts. Changes are applied (`--apply`) only after explicit human review.

Extensible by design

Change the method.
Keep the governance contract.

Teams can customize analysis methods, engineering conventions, and composition profiles without weakening path ownership or acceptance gates.

Canonical roles + Lean 4-Seat projection

Nine canonical responsibilities (`agentflow:product-manager` through `agentflow:pr-readiness`) project cleanly onto `S0` (Single-CLI), `S1` (Multi-CLI), or `S2` (OpenRig 4-Seat Default Squad: `orch.arch`, `dev.build`, `dev.qa`, `rev.review`).

Methods and skills for bounded specialist work

Orchestrator, collaborator, steerer, scanner, designer, migrator, maintainer, and auditor skills guide role execution without mutating phase ownership.

Profiles and extension packs

Select minimal, standard, GitHub, or Cockpit profiles. Tune complexity thresholds, consequence-floor patterns, and council composition through versioned configuration.

Explore methods and extension contracts ↗

Non-negotiable invariants

Strict path ownership.
Cryptographic oracle pins.

Autonomy requires hard boundaries enforced by deterministic code before any model or decider is consulted.

Path ownership enforcement

`pm.*` writes only `.agentflow/**` and `goals/**`. `steer.*` has `allow: []` (zero file writes). `dev.test-eng` cannot edit `src/**`. Violations are rejected at commit and gate checks.

Phase 3 Oracle Digest Pin

Builders (`dev.build*`) are denied write access to `tests/oracles/**` and `tests/**/oracles/**`. Phase 3 pins the SHA-256 oracle digest before Phase 4 implementation begins.

Transactional adoption & rollback

Adoption previews exact file actions, binds a freshness token, writes lockfile v2 last, and refuses to overwrite modified project-owned files on rollback.

Ready to inspect it locally?

Run adaptive onboarding
on your repository.