Skip to Content
turbo-12f
Architecture

Agent roles

How the thirteen role packages under internal/roles and the internal/observer loop combine deterministic scripts with bounded LLM sessions.

Explanation

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

Flow
100%
Script shell · validates & decidesAgent core · typed JSON onlyaskJSONaskJSONaskJSONaskJSONOrchestratorL5pure script spineContext & Strategist shellspec lint · routing rulesContext & Strategist coreinterviewer · judge · splitAnalyzer & Engineer shellworktree · fail-on-base · capAnalyzer & Engineer coreplan JSON · blind fixQC, Deslop & Review shelltests · rules · merge_policyExplorer, Red team & Reviewprobe · clean · hypothesesDevOps, Release & SRE shellbootstrap · gate · probesDevOps & SRE coreCI fix · error triage

Deterministic script shells wrap model sessions across thirteen role packages under internal/roles, while Orchestrator stays pure script.

Click any node or press Play

Containment modes across roles

ModeRoles and timeoutsWorkspace access
No workspace toolscontext, 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 cageanalyzer (15m), engineer (20m), devops (bootstrap only)analyzer writes TestGlobs; engineer uses a Docker lane cage; devops writes CI YAML

Intake and routing

RolePackageTriggerKey deterministic guardDetails
Context creatorinternal/roles/contextt12 ask, UIVerbatim quote check, zero open points, 25 lint rulesContext and specs
Strategistinternal/roles/strategistt12 run, splits, errorsrules.json table, DAG partition check, Tasks fallbackStrategist

Build and check

RolePackageTriggerKey deterministic guardDetails
Analyzerinternal/roles/analyzerLane step 1FinalSchema(), diffCap, reproFailsOnBaseAnalyzer
Engineerinternal/roles/engineerLane step 2Docker lane cage, turn-cap, 7 verify.go gatesEngineer
QCinternal/roles/qcLane step 3, releaseSequential build–mutation + ui-capture (qc-cache)QC
UI checkinternal/roles/uicheckLane step 4, releaseSettled PNG SHA-256 baselines, overflow/unstyled rulesUI check
Explorerinternal/roles/explorerRelease (qc.explorer)Fresh served.App replay of Playwright/curl recipesExplorer

Security and review

RolePackageTriggerKey deterministic guardDetails
Deslopinternal/roles/deslopLane step 5Stack packs (ts, go, python, rust), .md fixer, t12 rules judgeDeslop
Red teaminternal/roles/redteamLane step 6, releasegitleaks, offline osv-scanner, originCheck (Hono/Effect), replayed probesRed team
Code reviewinternal/roles/codereviewLane step 7unrequested / invented-dependency gate, stack-filtered packsCode review

Delivery and operations

RolePackageTriggerKey deterministic guardDetails
DevOpsinternal/roles/devopsconfirm, dry-run, mergePure Go: InstallTimeoutRetries, DryRunOnly{} promotionsDevOps
Releaseinternal/roles/releaserelease lane, gate, mergePure Go: tree-pinned ledgers, proof Bisect, --no-ff mergeRelease and SRE
SREinternal/roles/sresre step, watch, triaget12-adapter sre probe, fingerprints, 24h RollBackRelease and SRE
Observerinternal/observert12 ui loop (10s)NoCommands: true, 9-kind priority via UI handlersObserver

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

On this page