Skip to Content
turbo-12f
Architecture

Release and SRE

How lanes enter staging through the serialized merge queue, clear merge policies and proof bisection, and stay monitored after promotion.

Explanation

Merging feature work into staging, validating the combined tree, promoting to main, and watching live traffic all run through deterministic locks, patch-bound approvals, and bounded triage loops.

Step 1

Merge policy

Flag data-loss, auth, licence, delivery, or review diffs before merge.

Step 2

Merge queue

Acquire queue lock, rebase onto staging, recheck if changed, and fast-forward.

Step 3

Release gate

Run staging-wide checks, bisect failures, and require human sign-off for main.

Step 4

SRE watch & triage

Probe live URLs, group errors by fingerprint, file incidents, or roll back.

Serialized merge queue

mergequeue.go guarantees that lanes update staging strictly one at a time without overwriting concurrent work:

  1. Acquire lock: Takes an exclusive flock on merge-queue.lock (LockWait).
  2. Rebase in scratch worktree: Checks out the lane commit inside merge-scratch/ and rebases onto staging.
  3. Recheck if tree changed: Compares rebased res.Tree against the verified tree (checked). If different, Recheck reruns Install and qc.Run without mutation testing.
  4. Compare-and-swap update: Advances staging via git update-ref refs/heads/<staging> <new> <old> (or git merge --ff-only if checked out) and records EvMerged.

Merge policy and patch-bound approvals

Before entering the merge queue, merge-policy (mergepolicy.go) evaluates four diff rules plus the synthetic review check:

RuleTrigger or scopeApprover and autonomy behavior
data-lossmigrations/** lines dropping/renaming tables or columns, or deleting rowsAcceptor approval required, even under turbo
authPaths matching AuthGlobs or "auth" risk tagOperator/approver under review, default, auto (unless policy is "auto"); waived in turbo
licenceNew package.json packages with licenses outside Allow (DefaultLicences)Operator/approver when MatchesWait is active; waived in turbo
deliveryEdits to delivery, watch, or credentials in .t12/config.jsonOperator/approver when MatchesWait is active; waived in turbo
reviewSynthetic check on every lane when resolved autonomy is "review" (PartsWait)Acceptor approval via t12 approve (waits even when policy mode is "auto")

Approvals are bound to git patch-id

Every approval written by t12 approve binds to git patch-id --stable. If Engineer or Merge later alters the patch content, the prior approval lapses automatically and requires fresh review.

From staging to main and SRE watch

Flow
100%
maindefectconflictdrift1. Merge queuelock · overlap wait2. Dry-run deployartifacts/<tree>3. Release gatechecks by tree hash4. Bug bashacceptor or Observer5. Release mergeno-ff into main6. Promotedry-run · 3x retry7. SRE watchprobes · 2s budget8. SRE triageread-only agentRollback once24h cooldownDefect askspends 1 tokenText conflict returnsback to Engineer fix attemptStaging moved guardrefused with zero auto-retry

Lanes serialize into staging, release checks bind to a tree hash before human sign-off, and post-merge SRE probes watch production.

Click any node or press Play

Release checks, bisection, and the release gate

Once all active lanes merge onto staging, the request-level release lane runs in factory.go and gatefor.go:

StageFunctionsBehavior
Staging checksreleaseChecksRuns qc, uicheck, redteam, deploy-dry-run, and optional qc.explorer against staging^{tree}, writing release/<project>/checks/<tree>.json.
Bisect & fixBisect, fixReleaseLocates the culprit merge between main and staging on failure, adds <culprit>-rf<N> via release.AddFixLane, and retries pass < 3.
Four-part gaterelease.Gate, GateForRequires passing staging^{tree} checks, surfacing CheckCoverage noop-true/skipped warnings, carried signoffs.jsonl, no holds.jsonl, zero lapsed sign-offs, and zero Sev-1/Sev-2 bugs.
Main promotiont12 release mergeChecks staging^{tree} stability, merges --no-ff to main, runs RecordOutcomesFor and devops.Promote (DryRunOnly{}, H10), and appends EvDelivered.

SRE watch, triage, and rollback

Post-release checks run through sre (sre.go, triage.go, cli/sre.go) via t12-adapter sre probe --url:

  • Fingerprints (Fingerprint): Normalizes hex strings (<hex>), ports (:<port>), and integers (<n>) before hashing with SHA-256[:16] so duplicate errors collapse to one ID.
  • Thresholds: Marks endpoints down after DownAfter (3) failures, logs responses over SlowAfter (2s) as should-fix, and flags gaps wider than 2 * every as Unwatched.
  • Triage & rollback (t12 sre triage): Classifies failing windows into ProjectDefect (files "Incident found by SRE: ..." via cmdAsk), PlatformOutage (alerts Operators at zero retry tokens), or noise. --rollback calls devops.RollBack inside the 24h RollBackWindow.

Key takeaway

No change reaches main unverified: every lane rebases through a single merge lock, approvals bind to exact patch IDs, and failing staging trees bisect automatically before a human merges.

Next steps

On this page