Skip to content
M31A

12-Stage Autonomy Loop

The 12-stage execution lifecycle, loop detector, and 10-dimensional budget model.


Missions are orchestrated deterministically by the AutonomyController across a 12-stage execution lifecycle.

The 12-Stage Execution Lifecycle

  1. Intake & Validation: Ingests mission intent, resolves effective profile, validates invariants.
  2. Context Compilation: Gathers repository AST, workspace baseline commit, security policies.
  3. Plan Generation: Consults planning model to generate a candidate task DAG.
  4. DAG Reconciliation: Reconciles candidate plan with existing petgraph TaskGraph.
  5. Topological Scheduling: Selects ready tasks whose dependencies are satisfied.
  6. Agent Dispatch: Instantiates specialized agent role state machine.
  7. Two-Phase Reservation: Pre-allocates tokens, memory, and step quotas before execution.
  8. Tool Execution & Policy Gate: Evaluates tool proposals through 11-stage policy gate.
  9. Post-Execution Settlement: Reconciles actual consumed resources and logs telemetry.
  10. Evidence-Based Verification: Runs cargo test, clippy, and syntax checks.
  11. Checkpointing: Captures atomic two-phase snapshot committing staged artifacts.
  12. Completion Gating: Evaluates completion criteria and produces signed report.

The 5 Autonomy Modes

ModeMutations Permitted?Approval Behavior (ASK)Primary Use Case
PlanNo (Strictly Read-Only)Denied immediatelyArchitecture planning, DAG generation
SafeRequires ApprovalPauses mission; awaits confirmationSensitive repos, unfamiliar codebases
AssistedInside WorkspacePauses only for external side effectsStandard interactive pairing (default)
AutonomousInside WorkspacePauses only on explicit policy vetoSelf-directed refactoring and features
UnattendedInside WorkspaceConverts ASK to DENY fail-closedHeadless CI/CD evaluation runners

10-Dimensional Resource Budget Enforcer

M31A clamps execution across 10 hard resource bounds: wall-clock seconds, concurrent agents, agent decision steps, model invocations, token usage, financial cost ($USD), process CPU time, memory bytes (cgroups memory.max), artifact disk storage, and task retries.