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.
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.
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.
Deslop
Catch stubs, clones, and narration filler on changed lines only. Runs per lane in classic only.
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:
- Static (
10m): Runsbuild,typecheck, andlint, checking worktree cleanliness (qc-tree-clean). - Hygiene & guards: Runs
comment-ban(max100lines),scenario-text, andtest-guardviaGuardTests(guard.go) blocking.skip/.only/deletions across JS/TS, Go, Python.py, and Rust.rs. - Unit (
UnitLimit): Runscommands.unitbounded byrunner.Limit("unit")underrunner.DefaultLock(). - E2E & capture (
15m): Runs Playwright specs (reports/e2e/results.json) andui-capture(e2e.SettleSeconds = 5). Skipped when an earlier step already failed. - Mutation (
20m): Runs StrykerJS onMutateRangesacross changed JS/TS source and modified test files. A changed test file with no killed mutant isqc-mutation-kill(blocking); a test file that reaches no mutant isunreached, and surviving mutants aresurvived, bothshould-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).
| Verdict | Severity | Meaning |
|---|---|---|
ui-new | note | New screen not yet on staging |
ui-predicted | note | Screen hash changed and s.Screen is in Analyzer's Predicted |
ui-unpredicted | blocking | Screen hash changed unexpectedly (saves before-*.png evidence) |
ui-unstyled | blocking or should-fix | Missing applied stylesheet (blocking on new/changed screens) |
ui-overflow | should-fix | Rendered viewport overflows horizontally |
ui-axe | should-fix | axe-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 andcurlagainst empty/oversized inputs, unicode, double submits, reloads,375x812viewports, and post-signout routes. - Deterministic replay: Every finding needs
steps, ashrecipecapturing"$SHOTS/<shot>", anexpectstring, andseverity. Go replays each recipe againstserved.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): Checkstypescript(11rules including EffectDS-A3-swallowed-error),go(8),python(8),rust(8), and Markdown prose viadeslop.CheckProseincluding release PR bodies. - Read-only audit (
deslop_review): Evaluatesfake-success,additive-workaround,over-built(function/inline/delete ladder), anddoc-narration, plus adjudicating rule hits (t12 rules judge). Unrun audits logNotDone(Manifesto #15).
- 11 rules:
DS-A1-placeholder,DS-A2-fake-success,DS-A3-swallowed-error,DS-A4-additive-workaround,DS-B6-test-literal,DS-B9-owned-module-mock,DS-D13-new-clone,DS-D14-dead-weight,DS-D15-type-laundering,DS-F19-narration-filler,DS-F20-prose-words. - Manifesto tags: Rules map to offline Manifesto IDs (
#2,#5,#6,#8,#15); guardrail proposals add#21. - Promotion & proposals: Per-rule counts live in the
deslop-statsdatabase document (updated by compare-and-swap, so concurrent requests all count). An advisory rule with at least20hits and80%kept gets apromote-blockingproposal; a blocking rule with over25%of at least10judged hits dismissed getsdemote-advisory. Patterns recurring across at least3runs (RecurringRunsMin) get anadd-guardrailproposal. Proposals areproposaldocuments namedguardrail-*.json; an Operator decides them witht12 rules approve|reject, andt12 rules judge --rule ID --verdict confirm|dismissfeeds the counts.
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.
| Check | Mechanism 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. |
originCheck | Needs 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):unrequestedis anotefor each changed file outsidePlanFiles,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-dependencyisblocking: a dependency added topackage.json,go.mod,Cargo.toml, orpyproject.tomlthat the matching lockfile (npm,pnpm,yarn,bun, Go, Python, or Rust) does not pin or resolve. - Stack-filtered packs (
assets/codereview/*.json): Filterslean(5),security-web(8),tests(4), andtypescript(5) viaproject.StackTagsIn(effect,cloudflare-workers,typescript,javascript,nodejs,go,python,rust). - 5-step review protocol: Adjudicates
prior_findings, forms2–4hypotheses before reading Engineer's summary, checksspecandstandards, 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
Planning and build roles
Deep dive into Strategist DAG lane planning and routing, Analyzer repro creation and split plans, and Engineer caged edits, turn limits, and verify gates.
Delivery, operations, and Observer
How DevOps manages bootstraps and dry-run promotions, Release gates and bisects staging, SRE watches live URLs, and Observer resolves waiting items.