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.
Architecture
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.
Out-of-rig supervisory control (`steer.lead`) + Grounded Decider Port (`d3-flash`). Governs goals, epoch circuit-breaker unfreezes, defect triage (`accept_and_register`), and merge gates with zero code write access (`allow: []`).
steer.lead + Grounded Decider Port + deterministic invariants firstPortable policy core driving S0 (Single-CLI), S1 (Multi-CLI Orthogonal Four-Eyes), or S2 (OpenRig Lean 4-Seat Squad: `orch.arch`, `dev.build`, `dev.qa`, `rev.review`) in isolated `.worktrees/<branch>` with L2 ephemeral subagents.
L1 governance seats + L2 ephemeral subagents + Composite Phase 3–5 passOut-of-band `eval.tester` prober, `surface-reader`, `intake-emitter`, `session-extractor`, and `audit-traces` feeding `synthesize-refinements` behind an explicit human approval gate.
Telemetry extraction + boundary violation audit + human-gated refinementsVersioned provider ports (`Claude Code`, `Codex`, `Agy`, `Pi`, `Grok`, `OpenRig`, `Manual`) and durable source ports (`GitHub` + optional `Cockpit` view) with Two-Level Platform Fallback.
Capability inspection + SHA-256 receipts + worktree continuityAgentFlow 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
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.
| Capability Profile & Seat | 2026 Model Routing Examples | Effort-Degradation Guard & Context Law |
|---|---|---|
architect-leadorch.arch / steer.lead | gpt-6.1-sol, claude-opus-4-6, gemini-4-argon | Default `effort: medium` for orchestration and planning; escalates to `effort: high` strictly in clean context (<40k tokens) for Phase 2 Architecture Councils. |
deep-reasoningdev.build / rev.review | gpt-6-astra, claude-sonnet-4-6, gemini-4-argon | Clamped 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 / scoutdev.qa / eval.tester / L2 | gemini-3.8-flash, gpt-6-mini, claude-haiku-4-5, grok-4.7-fast | Clamped to `effort: low` for deterministic test execution, black-box surface probing, and bounded read-only L2 subagent discovery. |
decider portsteer.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
AgentFlow inspects installed CLIs and provider capabilities dynamically, combining Two-Level Platform Fallback with cross-family reviewer dispatch.
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.
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.
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.
Plane 3 · Closed-Loop Recursive Self-Improvement
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.
`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`.
`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.
`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
Teams can customize analysis methods, engineering conventions, and composition profiles without weakening path ownership or acceptance gates.
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`).
Orchestrator, collaborator, steerer, scanner, designer, migrator, maintainer, and auditor skills guide role execution without mutating phase ownership.
Select minimal, standard, GitHub, or Cockpit profiles. Tune complexity thresholds, consequence-floor patterns, and council composition through versioned configuration.
Non-negotiable invariants
Autonomy requires hard boundaries enforced by deterministic code before any model or decider is consulted.
`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.
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.
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?