-
Notifications
You must be signed in to change notification settings - Fork 0
Agent Roles
Implementation: LoopEngine class
The orchestrator owns the complete loop, enforces invariants, delegates stages, and decides whether to continue, ship, or hand off.
- Load durable loop state
- Validate budgets and permissions
- Select the next legal state transition
- Delegate to one role at a time
- Require verifier evidence before completion
- Detect repeated/no-progress cycles
- Persist state after every transition
- Enforce terminal conditions
Role name: "discoverer"
Builds a compact, evidence-backed working set before planning.
- Goal, repository/project state, memory, constraints, available tools
- Relevant files/systems
- Existing tests and quality gates
- Current failures/blockers
- Prior attempts from memory
- Dependencies and external assumptions
- Unknowns that materially affect correctness
Role name: "planner"
Converts discovery evidence into a finite, testable execution plan.
Every step must include:
- action, scope, preconditions, expected result
- validation, rollback, mutation risk, responsible agent
- Prefer smallest vertical slice
- Do not create speculative work
- Separate mandatory work from optional improvements
- Define a concrete stop condition before execution
Role name: "executor"
Implements an approved plan in an isolated workspace.
- Execute only approved steps
- Use worktree/branch isolation for concurrent changes
- Record commands/actions and resulting evidence
- Use idempotency keys for external mutations
- Never self-certify completion
Role name: "verifier"
Independently determines whether acceptance criteria are satisfied.
- Deterministic tests/build/type checks
- Security and policy checks
- Behavioral/integration checks
- Evidence consistency
- Regression checks
Return PASS, FAIL, or INCONCLUSIVE per criterion.
Role name: "reviewer"
Performs independent engineering review after implementation and verification.
- Correctness, security, reliability, performance
- Maintainability, backward compatibility, observability
- Operational cost, test adequacy, scope discipline
blocking, major, minor, note
Role name: "repairer"
Resolves verifier/reviewer findings using the smallest bounded change.
- Repair only evidenced failures
- Do not redesign unrelated components
- Track repair attempt number
- Compare new failure against prior failures
- Stop and escalate on repeated no-progress patterns