Agent roles
How the team flow's five members map onto the thirteen role packages under internal/roles and the internal/observer loop, each combining deterministic scripts with bounded LLM sessions.
Every automated step in turbo-12f wraps its LLM session inside a Go script shell. Go builds prompts from embedded files, confines workspace permissions, validates structured outputs or test results afterward, and writes a RoleReport.
What the Go shell guarantees
- Bounded context: Prompts receive explicit trees, scopes, findings, or diff hunks, and every session that works in a worktree starts with the list of its files, so it opens paths instead of guessing them.
- Deterministic verdicts: Exit codes, diff checks, SHA-256 baselines, and replays compute
Pass/Fail/Blocked. - Least-privilege tools: Each role gets only the read/write surface its step requires.
What the LLM session does
- Bounded reasoning: Clarifies specs, plans lanes, writes tests/code, or audits diffs.
- Structured exit: Finishes via schema-checked tool calls (
analyzer_plan,engineer_done,code_review). - Never self-certifies: Agents cannot mark their own work passed or waive gates.
The team and its packages
A conversation runs one of two flows (orchestrator.Flow, chosen from the project's flow preference). The default, team, groups the role packages into the members of a small development team; each part costs three agent sessions (plan, build, review), and a failed check is routed by rules alone.
| Team member | Lane steps | Packages it drives | Agent sessions per part |
|---|---|---|---|
| Product Owner | None: talks with the person before any part exists | internal/roles/context | None per part (it runs during the conversation) |
| Tech Lead | Splits the conversation into parts, then analyze | internal/roles/strategist (Route, Split), internal/roles/analyzer | One plan |
| Developer | engineer | internal/roles/engineer | One build, plus fix attempts |
| QA | qa: tests, then screens, then one review; stops at the first that fails | internal/roles/qc, internal/roles/uicheck, internal/roles/codereview | One review, on three times the budget of a single classic reviewer |
| DevOps | merge-policy, merge, deploy-dry-run | internal/mergepolicy, internal/mergequeue, internal/roles/devops | None (scripts) |
The classic flow runs the same packages as eleven separate steps and adds deslop, red-team, and sre to every lane, plus a Strategist session (strategist.Decide) for failures no rule routes. Both flows share the release checks (qc, uicheck, redteam, deploy-dry-run, optional qc.explorer), the record, the cages, the merge queue, and sign-off. See ADR 0006 for the measurement that made team the default.
All role packages
While design.md groups the system into 11 logical roles, the codebase splits quality into qc, uicheck, and explorer plus release, totaling 13 packages under internal/roles/ alongside layer-5 internal/orchestrator.
Script shell around every agent core
Deterministic script shells wrap model sessions across thirteen role packages under internal/roles, grouped here by the team flow member that drives them, while Orchestrator stays pure script.
Click any node or press PlayContainment modes across roles
| Mode | Roles and timeouts | Workspace access |
|---|---|---|
| No commands | context, strategist plan (3m), sre triage (10m), observer (5m) | NoCommands: true denies bash for strategist plan, sre and observer. context runs in an empty scratch folder with no built-in tools; observer reads only the evidence files staged for the item |
Read-only (guardTree) | codereview (10m, also QA's review), deslop (5m), redteam (10m), strategist route (3m), explorer (15m) | readonlysession.Run (confine: true, optional allow_read) reverts edits on exit |
| Scoped write cage | analyzer (15m), engineer (20m, plus 15m for each check of a candidate) | analyzer writes TestGlobs; engineer uses a Docker lane cage |
devops, release, and qc run no LLM session. devops bootstrap writes the starter template, .t12/ config, and the CI workflow into a fresh repository on the host.
Intake and routing
| Role | Package | Trigger | Key deterministic guard | Details |
|---|---|---|---|---|
| Context creator (Product Owner) | internal/roles/context | t12 ask, UI | Verbatim quote check, zero open points, 25 lint rules, mock UI contrast check | Context and specs |
| Strategist (Tech Lead's split) | internal/roles/strategist | t12 run, splits; failures only in classic | rules.json table, DAG partition check, Tasks fallback | Strategist |
Build and check
| Role | Package | Trigger | Key deterministic guard | Details |
|---|---|---|---|---|
| Analyzer (Tech Lead) | internal/roles/analyzer | Lane step 1 | FinalSchema(), diffCap, reproFailsOnBase | Analyzer |
| Engineer (Developer) | internal/roles/engineer | Lane step 2 | Docker lane cage, turn-cap, 7 verify.go gates, QC, screen and origin checks on each candidate inside the session | Engineer |
| QC (QA) | internal/roles/qc | qa first check; classic step 3; release | Sequential build–mutation + ui-capture (qc-cache) | QC |
| UI check (QA) | internal/roles/uicheck | qa second check; classic step 4; release | Settled PNG SHA-256 baselines, overflow/unstyled rules, advisory axe-core findings | UI check |
| Explorer | internal/roles/explorer | Release (qc.explorer) | Fresh served.App replay of Playwright/curl recipes | Explorer |
Security and review
| Role | Package | Trigger | Key deterministic guard | Details |
|---|---|---|---|---|
| Deslop | internal/roles/deslop | classic step 5 | Stack packs (typescript, go, python, rust), .md fixer, t12 rules judge | Deslop |
| Red team | internal/roles/redteam | classic step 6; release | gitleaks, offline osv-scanner, originCheck on a freshly served app, replayed probes | Red team |
| Code review (QA) | internal/roles/codereview | qa last check; classic step 7 | unrequested / invented-dependency gate, stack-filtered packs | Code review |
Delivery and operations
| Role | Package | Trigger | Key deterministic guard | Details |
|---|---|---|---|---|
| DevOps | internal/roles/devops | confirm, deploy-dry-run, merge | Pure Go: empty-repo bootstrap, InstallTimeoutRetries, promotions that stay DryRunOnly{} until a hosting account is connected | DevOps |
| Release | internal/roles/release | release lane, gate, merge | Pure Go: tree-pinned ledgers, proof Bisect, --no-ff merge | Release and SRE |
| SRE | internal/roles/sre | classic sre step, t12 sre watch, triage | t12-adapter sre probe, fingerprints, 24h RollBack | Release and SRE |
| Observer | internal/observer | t12 ui loop (10s) | NoCommands: true, 9-kind priority, acts with the opener's rights | Observer |
Key takeaway
Every role isolates AI judgment inside a Go harness: scripts supply exact context, enforce workspace confinement, and compute the final RoleReport verdict. The team flow decides only how many of those harnesses a part passes through.
Deep-dive guides by stage
Context and specs
3-part readiness gate, ISO 29148 traits, 25 lint rules, and OpenSpec views.
Planning and build roles
Strategist DAG planning, Analyzer repros and splits, and Engineer verify gates.
Quality, hygiene, and review roles
QC pipeline, UI baselines, Explorer, Deslop rules, Red team replays, and Code review.
Delivery, operations, and Observer
DevOps bootstrap, Release gates, SRE monitoring, and Observer's 9-kind loop.
Request lifecycle and orchestration
End-to-end execution from ask and confirm through the team flow's dependency-ordered lanes, capacity scheduling, autonomy modes, and failure recovery ladders.
Context and specs
How Context creator decides readiness via a 3-part Go gate, ingests existing GitHub repositories, multi-issue tickets, and image attachments, draws the mock UI, enforces 25 lint rules, and exports OpenSpec files plus SRS, Plain, and UAT views.