Skip to Content
turbo-12f
Architecture

Quality, hygiene, and review roles

Deterministic checks and read-only audits across QC, UI check, Explorer, Deslop, Red team, and Code review before merge policy evaluates a lane.

Explanation

In the default team flow, one qa step per lane runs the checks: the qc tests, then the ui-check screens, then one code-review session, stopping at the first that fails. A blocking finding goes straight back to the Developer as a fix attempt (found_by: qa → engineer at 0 tokens in rules.json). The classic flow runs steps 3 through 7 of every lane as separate steps (qc, ui-check, deslop, red-team, code-review). Release-only explorer and the release-check runs of qc, ui-check and red-team are the same in both flows. Together they verify candidates through caged execution, visual baselines, stack rules, offline scanners, replay recipes, and spec-vs-standards code review.

Build & Visual

QC, UI check & Explorer

Run build, lint, tests, mutation, PNG baselines, and optional UX probes. QC and UI check run inside qa in the team flow.

Hygiene

Deslop

Catch stubs, clones, and narration filler on changed lines only. Runs per lane in classic only.

Security & Review

Red team & Code review

Scan secrets/CVEs, replay live attack recipes, and check rule packs. Red team runs per lane in classic only; Code review runs once inside qa in the team flow.

QC (internal/roles/qc)

internal/roles/qc runs deterministic verification inside the container cage with zero LLM calls. It is the first part of qa in the team flow and the qc step in classic; the release checks run it in both. The Developer's session also runs it on every candidate it hands over, and the lane step reuses a passing result while the worktree still holds that candidate. The steps run in this order:

  1. Static (10m): Runs build, typecheck, and lint, checking worktree cleanliness (qc-tree-clean).
  2. Hygiene & guards: Runs comment-ban (max 100 lines), scenario-text, and test-guard via GuardTests (guard.go) blocking .skip/.only/deletions across JS/TS, Go, Python .py, and Rust .rs.
  3. Unit (UnitLimit): Runs commands.unit bounded by runner.Limit("unit") under runner.DefaultLock().
  4. E2E & capture (15m): Runs Playwright specs (reports/e2e/results.json) and ui-capture (e2e.SettleSeconds = 5). Skipped when an earlier step already failed.
  5. Mutation (20m): Runs StrykerJS on MutateRanges across changed JS/TS source and modified test files. A changed test file with no killed mutant is qc-mutation-kill (blocking); a test file that reaches no mutant is unreached, and surviving mutants are survived, both should-fix. Skipped when an earlier step already failed.

<home>/qc-cache/<key[:2]>/<key>.json caches build, typecheck, lint, and unit for the same tree and command. The cache is local scratch that the host rebuilds on demand, while e2e, ui-capture, and mutation always run fresh. Reports log fixedNotDone notes for whole-unit runs and assertion edits.

Every step records CheckResult coverage (ran, skipped, noop-true) on RoleReport.Checks so ["true"] placeholders surface in review briefs and scorecards.

UI check (internal/roles/uicheck)

internal/roles/uicheck compares settled screen PNGs byte-for-byte with zero LLM calls. It is the second part of qa in the team flow, the ui-check step in classic, and part of the release checks in both. When scenarios name screens, it renders the base commit's shots once and reuses <home>/ui-baselines/<hash24>/shots.jsonl, a local scratch cache keyed by tree, image, capture script, E2E command, and lockfile. A render waits on the ui-baseline-<hash24> lease and may take 15m; a failed render blocks the lane (ui-baseline).

VerdictSeverityMeaning
ui-newnoteNew screen not yet on staging
ui-predictednoteScreen hash changed and s.Screen is in Analyzer's Predicted
ui-unpredictedblockingScreen hash changed unexpectedly (saves before-*.png evidence)
ui-unstyledblocking or should-fixMissing applied stylesheet (blocking on new/changed screens)
ui-overflowshould-fixRendered viewport overflows horizontally
ui-axeshould-fixaxe-core found serious or critical accessibility issues on the shot (advisory, never fails the check)

When a lane finishes, UI check also records sloppiness samples: the pixel difference on screens the plan did not name, axe counts, and one-off styling added to UI source. They are best effort and never block a run; see Metrics.

Open UI check items

Region/pixel diff images (odiff, looks-same), ui-mask regions, and before/after sign-off gallery pairs (D37) remain in NotDone.

Explorer (internal/roles/explorer)

internal/roles/explorer runs on the release lane when qc.explorer is true, probing $APP as a cautious first-time user (qc-explorer.md).

  • Session scope: Runs readonlysession.Run (15m, explore_report) with Playwright Chromium and curl against empty/oversized inputs, unicode, double submits, reloads, 375x812 viewports, and post-signout routes.
  • Deterministic replay: Every finding needs steps, a sh recipe capturing "$SHOTS/<shot>", an expect string, and severity. Go replays each recipe against served.App; only reproducible hits stay actionable.

Deslop (internal/roles/deslop)

internal/roles/deslop runs per lane in the classic flow only; the team flow does not run it. It inspects added and changed lines only (excluding deslop.exclude_paths), runs a deterministic .md em-dash fixer, and runs a 5m read-only audit (deslop-agent.md).

  • Scripted rules (assets/deslop/*/rules.json): Checks typescript (11 rules including Effect DS-A3-swallowed-error), go (8), python (8), rust (8), and Markdown prose via deslop.CheckProse including release PR bodies.
  • Read-only audit (deslop_review): Evaluates fake-success, additive-workaround, over-built (function/inline/delete ladder), and doc-narration, plus adjudicating rule hits (t12 rules judge). Unrun audits log NotDone (Manifesto #15).

Red team (internal/roles/redteam)

internal/roles/redteam runs per lane in the classic flow only; both flows run it in the release checks. It audits commits, dependencies, write routes, and live visitor security without altering worktree code.

CheckMechanism and findings
gitleaks (v8.30.1)Scans commits via synthetic .git with only the factory's own config, so a lane's .gitleaks.toml or .gitleaksignore cannot hide a secret. The config allowlists test fixtures and lower-case dotted key names such as app.settings.v1 for generic-api-key. squashLane retries Tree.Squash if intermediate commits leaked secrets.
osv-scanner (v2.7.1)Scans package-lock.json offline against ~/t12/cache/osv ($T12_OSV_CACHE), filtering Base advisories and reporting new ones as should-fix.
originCheckNeeds a serve command. Serves the commit fresh in its cage and sends each write route (.post/.put/.patch/.delete on Hono or other routers, with mounted base paths, and Effect Platform HttpApiEndpoint) one request from another site and one from the site itself. A route that accepts the foreign write, or answers both alike without refusing, is blocking; a redirect that may have written is should-fix. It also runs on every candidate inside the Developer's session.
Visitor probes (attack.go)On auth/input/data RiskTags, readonlysession.Run (10m, security_check, $0.25 budget) probes $APP via curl; app.Replay promotes confirmed recipe hits to blocking and unconfirmed ones to note. A session that ends on its cost cap is run once more on twice the budget; the release check starts on twice the budget ($0.50).

Open Red team items

Semgrep CE, ZAP passive, and nuclei -dast remain in NotDone.

Code review (internal/roles/codereview)

internal/roles/codereview is the code-review step of each classic lane and the last part of qa in the team flow, where it runs once after the tests and screens pass. It pairs deterministic diff checks (checks.go) with one 10m readonlysession.Run session (code-review.md, tool code_review).

  • Scripted gate (unrequested, invented-dependency): unrequested is a note for each changed file outside PlanFiles, PlanTests, TestGlobs, e2e/, or a lockfile whose manifest the plan names, and the session decides whether it is scope creep (blocking) or required wiring. invented-dependency is blocking: a dependency added to package.json, go.mod, Cargo.toml, or pyproject.toml that the matching lockfile (npm, pnpm, yarn, bun, Go, Python, or Rust) does not pin or resolve.
  • Stack-filtered packs (assets/codereview/*.json): Filters lean (5), security-web (8), tests (4), and typescript (5) via project.StackTagsIn (effect, cloudflare-workers, typescript, javascript, nodejs, go, python, rust).
  • 5-step review protocol: Adjudicates prior_findings, forms 2–4 hypotheses before reading Engineer's summary, checks spec and standards, and emits four-part findings (what, problem, fix, skip) deduplicated across (rule, path, lines) ranges.

Key takeaway

Every quality and security role pairs a cheap script gate with bounded, replay-verified read-only analysis, so unverified claims never block or pass a lane. The team flow keeps the tests, the screens and one review per part; Deslop and Red team per part are classic extras.

Next steps

On this page