Agent roles
How the thirteen role packages under internal/roles and the internal/observer loop combine 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.
- 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.
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, while Orchestrator stays pure script.
Click any node or press PlayContainment modes across roles
| Mode | Roles and timeouts | Workspace access |
|---|---|---|
| No workspace tools | context, strategist plan (3m), sre triage (10m), observer (5m) | NoCommands: true (JSON tool output only; context uses Settings(nil, nil)) |
Read-only (guardTree) | deslop (5m), redteam (10m), codereview (10m), strategist route (3m), explorer (15m) | readonlysession.Run (confine: true, optional allow_read) reverts edits on exit |
| Scoped write cage | analyzer (15m), engineer (20m), devops (bootstrap only) | analyzer writes TestGlobs; engineer uses a Docker lane cage; devops writes CI YAML |
Intake and routing
| Role | Package | Trigger | Key deterministic guard | Details |
|---|---|---|---|---|
| Context creator | internal/roles/context | t12 ask, UI | Verbatim quote check, zero open points, 25 lint rules | Context and specs |
| Strategist | internal/roles/strategist | t12 run, splits, errors | rules.json table, DAG partition check, Tasks fallback | Strategist |
Build and check
| Role | Package | Trigger | Key deterministic guard | Details |
|---|---|---|---|---|
| Analyzer | internal/roles/analyzer | Lane step 1 | FinalSchema(), diffCap, reproFailsOnBase | Analyzer |
| Engineer | internal/roles/engineer | Lane step 2 | Docker lane cage, turn-cap, 7 verify.go gates | Engineer |
| QC | internal/roles/qc | Lane step 3, release | Sequential build–mutation + ui-capture (qc-cache) | QC |
| UI check | internal/roles/uicheck | Lane step 4, release | Settled PNG SHA-256 baselines, overflow/unstyled rules | 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 | Lane step 5 | Stack packs (ts, go, python, rust), .md fixer, t12 rules judge | Deslop |
| Red team | internal/roles/redteam | Lane step 6, release | gitleaks, offline osv-scanner, originCheck (Hono/Effect), replayed probes | Red team |
| Code review | internal/roles/codereview | Lane 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, dry-run, merge | Pure Go: InstallTimeoutRetries, DryRunOnly{} promotions | 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 | sre step, watch, triage | t12-adapter sre probe, fingerprints, 24h RollBack | Release and SRE |
| Observer | internal/observer | t12 ui loop (10s) | NoCommands: true, 9-kind priority via UI handlers | 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.
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 Strategist DAG 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, enforces 25 lint rules, and exports OpenSpec files plus SRS, Plain, and UAT views.