FIELD GUIDE № 01 auditai · trigger.dev vol. 1 — pipelines 2026

A PIPELINE IN FIVE ACTS

The life of a question.

A TECHNICAL READING Every question that enters auditai walks the same path: parsed, scored, possibly rewritten, gated, routed, and either written, deferred, or quietly dropped. Twenty-two acts, three guard rails, two backends, one decision. Click any block to read the score.

Stages  A — E · Steps  22
A
STAGE ONE · TASK ENTRY

The arrival

A payload appears at the door. Trigger.dev applies its retry policy, the runtime hydrates configuration, and Zod accepts only what it recognises.

↓   into the pipeline
B
STAGE TWO · runAuditPipeline

The audit proper

Twelve steps in src/audit/run-pipeline.ts — guard rails, media inspection, parallel scoring, conditional improvement, regeneration, and a final routing decision.

APPENDIX TO B10 — B11

The rules in full

B10 evaluates sixteen guardrails; B11 consumes their verdict alongside confidence and composite scores. Below is the complete ledger — what each rule checks, how confidence is computed, which language tiers are eligible for what, and the priority-ordered rules the router uses to pick a decision class.

The sixteen guardrails G1 — G16 · src/guardrails/index.ts

ID Rule What it checks Severity

Confidence formula v1 · src/audit/confidence.ts

s₁ Mean of self-reported per-dimension confidences across all three score samples.
s₂ Sample agreement: 1 − stddev(composite) / 1.5, clamped to [0, 1].
raw 0.5 × s₁ + 0.5 × s₂
−0.02 Skill / difficulty / library bump: penalty applied when all primary low dims are in { skill_alignment, difficulty_fit, library_alignment }.
cap Language-tier ceiling: T2 → 0.92, T3 → 0.85. T1 is uncapped. Tier 4 was retired 2026-06-09 — anything unlisted now defaults to T3.
final max(0, min(raw − bump, tierCap)) — passed to the router as confidence.

Language tiers src/language/tiers.ts

Tier Confidence cap Languages Behavior

Decision routing priority order · src/decision/router.ts

✦   ✦   ✦
C
STAGE THREE · POST-PIPELINE

Two safety ropes

A wire-level payload is composed. Shadow mode and the kill switch then decide whether the audit will be allowed to leave the building.

↓   route by backend
D
STAGE FOUR · BACKEND BRANCH

Two paths diverge

The mongo path is the live writer. It inserts one row into the immutable AuditAIResult ledger, then updates the live Questionnaire doc (post-QV2-retirement, 2026-06-15) — rotating a snapshot on AUTO_REPLACE, recording currentAudit only on every other decision. Portal-driven approvals (/approve with-changes, /approve-suggest) rotate snapshots tagged HUMAN_APPROVED_* when reviewers accept the proposal. The qgateway path remains for legacy reasons and may, on certain rejections, throw to retry.

Path II · backend = "qgateway"
E
STAGE FIVE · RETURN

A verdict, posted

The task hands a small object back to its caller — a decision class, a submitted flag, perhaps a reason — and the run trace closes.

F
STAGE SIX · STEWARDSHIP

Between the audits

The audit-question task runs in isolation. The wider system filters its input, mediates its output through a human review UI, and watches for drift in the data it leaves behind.