Skip to content

ADR: One traffic cop for main

ADR: One traffic cop for main

Status: accepted, 2026-11-19, at 1.0.5.99. Lanes stop picking version numbers. A lane pushes ready/<lane>-<sha8>, and the Gate run's first job, the traffic cop, gives it its number when it lands. gate/* closes once main carries the cop.

Reading list

  1. ADR: The version comes from the changelog: one version, one commit on main, one changelog line, and the addendum on the fill at the claim that this record moves into the gate.
  2. ADR: The gate runs where the memory is: the gate the cop now leads, its promote and its rule that green code sends no failure email.
  3. ADR: CodeRabbit, one rung at a time: the review the gate waits for, now of the lane's own commit.
  4. ADR: A pull request of AI-written code is sized to the gate: what one gate costs, and so what a lost gate costs.

In plain words

Several AI coding sessions build this site at once, and each finished piece of work has to pass one gate before it goes live. Every version gets a number, one above the last. Until today each session picked its own number on its own machine before it reached the gate. On 18 November two sessions finished about the same time and both picked 1.0.5.93. The gate told each of them "taken" only after the fact, so for over an hour they kept trying again with the same number. Five gate runs were spent and none of them shipped. To Steve, watching, the waiting sessions looked as if they were asking him something.

The fix works like a traffic cop at a single-lane bridge. Sessions no longer pick a number. A finished session parks its work on a branch named ready/ and leaves the number blank. The gate takes branches one at a time, and only then does the cop look at what is live, write in the next number, and run every check. A version that passes goes live. A version that fails is set aside, and its session can read why on its own branch, so the next one in line never waits behind it. Two sessions that finish in the same second still get two numbers, one after the other, because only the cop hands numbers out.

What that is worth: no gate run is spent on a number fight, nobody has to referee, and the order things went live in is written down by the one process that decided it.

One traffic cop for main: three lanes each push a ready branch; the ready queue holds them, oldest first; the traffic cop takes one and assigns main plus one; the full gate runs build, tests, quality and CodeRabbit; a pass ships to main and the version goes live, a fail is logged and skipped and the lane sees why on its branch; either way the cop takes the next ready branch

A preview. Open the traffic cop in a new page to zoom in and follow it.

Context

The race, measured from the Gate runs of 18 November (times CST). Main was on 1.0.5.92. Two lanes each picked 1.0.5.93 on their own machines and pushed:

Pushed Branch Gate run Ended
13:00 gate/1.0.5.93-code1118b-395e780b 44375787267 13:15, red
13:20 gate/1.0.5.93-adminfix1118-352343c4 44379423201 13:39, red
13:42 gate/1.0.5.93-code1118b-cc6a6719 44383075318 13:59, red
14:03 gate/1.0.5.93-adminfix1118-1d28f0b0 44386900736 14:16, red
14:20 gate/1.0.5.93-adminfix1118-3c1e47b5 44390065861 14:41, red
14:44 gate/1.0.5.93-zfix1118-983f125a 44394248691 15:22, green

Five runs on one number across an hour and forty minutes, and in the end a third lane shipped 1.0.5.93. Three pull requests from adminfix1118's branches, #115, #117 and #118, stayed open and red. The lock and the gate's number job could only say "taken" once a lane had already picked, because the pick happened on the laptop before the gate.

The queue. Since 1.0.5.87 gate.yml has set concurrency: group: gate, queue: max. GitHub's workflow syntax documents queue with two values: single, the default, which keeps one pending run, and max, which keeps up to a hundred. Runs in a group go first in, first out by the time each started waiting, and the page adds that the order is not guaranteed because start times vary. On 18 November it was never put to the test: each of the six runs above started the second it was created (run_started_at equal to created_at), because each push came after the run before it had ended, so the queue never held two. The collision was in the number, not in the queue. The first ready pushes of 19 November are the first reading of the order, and are recorded in this record's addendum.

Steve, 19 November, 06:45: "ADRs going to be created for the rules we set". So every rule the cop sets is one numbered line below, and each has a row in the rules table with the test that holds it.

Decision

The cop is gate.yml extended, not a second workflow: one writer to main. Its rules:

  1. A lane never picks a version or a record number. The lane's one commit leaves three placeholders where the numbers go: an at sign, VER, an at sign for the version (the changelog's top line and the subject); the same with DATE for the date; the same with ADR for a new record's number (its file name and its text). The cop fills all three at landing with scripts/fill_version.sh. A branch whose changelog top line is already a number is skipped.
  2. One commit per ready branch. The cop rebases exactly one commit onto main. A branch of two commits is skipped, with the reason.
  3. A lane rebases onto main before it pushes, and proves its run exists. A push runs the gate.yml inside the pushed commit. A branch cut before main's last gate.yml change would run an old gate, so the cop skips a branch whose gate.yml differs from main's unless changing gate.yml is that commit's own work. A branch cut before the cop existed starts no run at all, so a lane confirms that a Gate run names its branch.
  4. The number is assigned inside the gate's group, one run at a time. The cop lifts the lane's changelog line out, gives the changelog, the quality ratchet and the version card main's side, rebases the rest onto main, puts the line back on top of main's newest and fills. A conflict anywhere else is the lane's. Every later job tests that filled commit, handed on as a git bundle in the run's filled artifact. That works for every version, workflow changes included, and needs no write in the first job.
  5. A lane watches its branch to landed or skipped. The cop posts on the lane's own commit, as the status named cop: "landed as , main ", "green as , needs a hand promote", "red gate: ; ", or "skipped: ", each linked to its run. One of the checks a red gate status can name is landing, the landing check promote.sh runs on the commit the results were folded into, before main moves: "red gate as : landing; : " (ADR-098, the addendum of 1.0.5.233). On anything but landed the lane fixes, rebases and pushes a new ready branch itself. Nobody retries for it. The after-roll deletes a ready branch only once landed is there to read. A ready branch names no version, so the next promote's line-stop takes an after-roll named for one as proof of main only when its reads ran, and a red one joins the site's list of what the gate caught under its branch's name.
  6. Order in the queue is GitHub's and is not promised. No sweep reorders it, because a run cannot reorder GitHub's queue anyway. Two pushes seconds apart that start swapped still land as N and N+1 with no collision.
  7. Red means a check failed. A skip tested nothing, so its run ends green with a notice and the failing status on the lane's commit. Steve gets a red Gate email only for a red gate.
  8. No lane takes the gate lock. The number is the cop's, so scripts/gate_lock.sh and theyard-gate.lock guard nothing for a ready branch. The lock is kept only for a hand promote, where it stops two promotes from running at once.
  9. A version that changes a workflow is pushed with PROMOTE_TOKEN. The secret is a fine-grained personal token, "theyard-promote", scoped to SteveStout/TheYard only, with Contents and Workflows read and write. It expires on 19 November 2027. The promote job checks out with it whenever it exists, so every promote is that token's push, and the push itself starts Deploy, Deploy Render and CI on main. promote.sh sets by_push for every version the token pushes, so the run never calls the deploys a second time and each commit rolls once. When the secret is missing or expired, a version that changes a workflow still runs the whole gate, ends green, and its commit reads "needs a hand promote". The hand steps are in CLAUDE.md, Shipping.
  10. gate/ is closed once main carries the cop.* The cop refuses a gate/* push red, pointing at ready/, once origin/main's gate.yml has the ready/* trigger. Until then gate/* took the old path. That is how this version shipped, as the last gate/* claim.

Consequences

  • Lanes no longer wait on each other's numbers, and a red version never holds the line behind it.
  • What stops being true: the claim, the number picked on the laptop, the lock taken by every lane, and the number job.
  • What stays true: one commit on main per gate, every check on every version, and main moving only by promote.sh's fast-forward.
  • From 1.0.5.233 the commit main moves to is tested as it lands: the tests that read the eight files promote.sh folds into the commit run on the folded commit before the fast-forward (ADR-098, the addendum of 1.0.5.233, "main only moves to a commit tested as it lands").
  • The cost: every ready branch is rebased by a machine. A conflict outside the changelog comes back to the lane as a skip, never as a guess.
  • A rotated or expired PROMOTE_TOKEN turns workflow versions into hand promotes until it is replaced. Every other version still lands on its own.

Where it sits

Outside the rings: the ship's path to main. It is a job of the gate, a script beside the fill, and a status on each lane's commit.

Files

Addendum, 2026-11-20 (1.0.5.122): the queue's first reading, the race and the red main

The queue, read. On 19 November eleven ready runs went through the gate's group, and every one started in the order it was pushed, first in, first out, each holding the group alone. The start that counts is each run's cop job, not the run's own run_started_at: a pending run's run_started_at equals its created_at, so it says nothing about when the run left the queue. Pushed and cop started, UTC: the fail proof 14:33:09 and 14:33:12; cop1118-e4b902df 14:33:11 and 14:42:27; jhfix1119 14:35:05 and 14:51:40; green1119 14:41:52 and 14:59:32; code1118e-2a93b6c5 14:42:12 and 15:09:05; commentline1119 14:46:18 and 15:19:08; then code1118e-3923f20b 14:50:06, hunter1119 14:50:11 and cop1118-222191f0 15:20:06, in that order behind them. No swap was seen, so no sweep was built (rule 6 stands).

The race, proven. The first two ready branches pushed within a minute of each other on a green main, both cut from c807f400 (1.0.5.101): ready/code1118e-127f68d8 at 15:52:34Z and ready/crosspost1119-5cce6c07 at 15:53:06Z, 32 seconds apart. The first run's cop started 15:52:38Z and landed 1.0.5.102 at 058fec49 by 16:03:52Z; the second's cop started 16:03:54Z, two seconds after the first run ended, and landed 1.0.5.103 at 96474e4f by 16:22:49Z. Its line-stop took the after-roll named for ready/code1118e-127f68d8 as the proof of 058fec49. N and N+1, in push order, with no human step and no collision. The pair before it (green1119-dbc62a40 and code1118e-2a93b6c5, 20 seconds apart) also started in push order but went red on the bug below, so it proves the order and not the landing.

The red main. 1.0.5.100, the first ready landing, folded the fail proof's red run into data/gate-reds.json under its branch's name, ready/cop1118-failproof-4de7ed19, where every other row holds a version. GateRedsTests holds each row to four numbers, so CI on main went red at 17701ea1, the after-roll went red, and every ready run behind it failed that one test. jhfix1119, a waiting lane, reported it. 1.0.5.101 (c807f400, Fixes-main: 17701ea1) fixed it: a red ready run is kept under the version its cop job gave it, read back from the cop's own status, a red run with no such status is left out, and the status names the failing test on its first line. Rule 5's last clause is replaced by that: a red ready run joins the list under the version the cop gave it, never under its branch's name.

The correction. The Context above gives "(run_started_at equal to created_at)" as the evidence that each 18 November run started the second it was created. That parenthetical is not evidence, for the reason in the first paragraph. The claim stands on the times themselves: each of the six pushes came after the run before it had ended, so the queue never held two.

Addendum, 2026-11-20 (1.0.5.122): the counts are the fill's

S3's index column was skipped twice on 19 November, both times "the rebase onto main conflicts in README.md docs/built-with-ai/BUILT-WITH-AI.md": ready/code1118e-3923f20b at 15:26Z on main 17701ea1 (1.0.5.100) and ready/code1118e-31f196df at 16:55Z on main 3a756ec0 (1.0.5.105). Every landing rewrites README.md's suite line and Built with AI's gate line with its xUnit and Vitest figures, and the lane had written its new Playwright count on the same two lines, so any version that landed between the push and its turn made a real conflict. A version that adds a record meets the same wall on the record count in words, which README.md states four times and How this was built and Built with AI once each: two such lanes in one queue, and the second is skipped.

So the counts the public face states are written at landing, by the fill, on the tree it numbers: scripts/fill_version.sh writes the record count in words from the records the commit carries, and the Playwright count from the specs' test( lines, both read the way PublicFaceTests reads them, which keeps holding them. A lane leaves those words as main has them. Its unfilled commit reads one record or one browser test short in PublicFaceTests until the cop fills it, the same as the version card, and nothing it edits sits on a line the next landing rewrites. CLAUDE.md, Shipping, tells lanes so, and FillVersionScriptTests holds the fill.

Enforced by

11 rules in the rulebook cite this record, each held by a test on every release.

The rule What holds it In the last gate
A lane never picks a version or a record number: its one commit leaves the version, date and record placeholders, the cop fills them at landing, and a ready branch whose top line is already a number is skipped CopScriptTests 20 of 20 passed
A ready branch is one commit off main, and a branch of two commits is skipped green with the reason CopScriptTests 20 of 20 passed
A ready branch carrying a gate.yml older than main's is skipped and told to rebase, unless changing gate.yml is its own commit's work CopScriptTests 20 of 20 passed
The number is assigned inside the gate's group, one run at a time: two ready branches cut from one main land as N and N+1, the second's changelog line lifted over the first's, and every job tests the filled commit CopScriptTests, GateWorkflowTests, PromoteScriptTests 194 of 194 passed
A lane reads landed, a hand promote owed, a red gate or a skip on its own commit, and the after-roll deletes a ready branch only once landed is there GateWorkflowTests, GateReviewWaitTests 100 of 100 passed
The queue's order is GitHub's and is not promised: every pending gate run is kept in line and none is cancelled GateWorkflowTests 74 of 74 passed
Red means a check failed: a rebase conflict outside the changelog, two commits or a workflow change with no token ends the run green with a notice CopScriptTests 20 of 20 passed
No lane takes the gate lock: the ready path claims nothing, and the lock is kept only for a hand promote GateWorkflowTests 74 of 74 passed
With PROMOTE_TOKEN every promote is that token's push and the push is the roll, so each commit rolls once; without it a workflow change ends green needing a hand promote PromoteScriptTests 100 of 100 passed
gate/* takes the old path until main's gate.yml carries the ready trigger, and is refused red after CopScriptTests 20 of 20 passed
The fill writes the record count in words and the Playwright count into README.md, How this was built and Built with AI from the tree it numbers, so a lane never edits them and two versions never conflict on them FillVersionScriptTests, PublicFaceTests 68 of 68 passed
Store

The Yard, home

Steven StoutStaff .NET engineerRemote

Production .NET that stays up. Built with AI, measured on every version.

Steven Stout

Hi, I'm Steve. I build the systems that make delivery boring in the best way, then coach people inside them.

  • 200+

    production releases, none took the platform down

    Conway Investment Research, 2019 to 2024. Sole engineer for the first three years on a live financial advisory platform.

    See how
  • 50%

    shorter release cycle

    Storee Construction, 2024 to 2026. Four ASP.NET applications onto one .NET 10 platform on Azure, with a four-person team I hired and mentored.

    See how

01Verified

Steven Stout

A real person, and the work is mine.

  • Identity

    Checked by LinkedIn, not by me.

    LinkedIn verified my government ID.

  • Running system

    You are looking at it.

    Version 1.0.5.273 is live. Nothing ships unless it passes the automated gates first.

That's who I am. Here's how I work.

02Strengths

Ten strengths, each with the proof beside it. The numbers match my resume and LinkedIn, and the live ones are read from this site as you look.

  • 01

    Keeps production alive

    200+ releases on a live financial platform, and none took it down. Sole engineer for the first three years.

    See the Conway work

  • 02

    Simplifies messy systems

    Four ASP.NET applications onto one .NET 10 platform on Azure, and a release cycle 50% shorter.

    See the Storee work

  • 03

    Marries dev and infrastructure

    Blue-green releases at Storee that flipped in about 5 seconds with nobody signed out, and Azure Front Door at two employers.

    See this site's cloud

  • 04

    Designs data that holds up

    White-label clients on one shared database, the isolation built into the data, and no cross-client issues.

    See the Conway work

  • 05

    Keeps AI-written code honest

    15 quality numbers that may only improve: 273 releases in a row with none worse.

    See the quality numbers

  • 06

    Resourceful

    $30,000+ cut from Azure and vendor spend at Conway. This site's Azure bill is public, resource by resource.

    See the bill

  • 07

    Builds people up

    Hired and mentored a four-person team. 13 colleagues recommend me by name.

    Read the recommendations

  • 08

    Takes ideas to production

    This site: designed, built and run solo, with 352 versions measured through one gate.

    How it was built

  • 09

    Writes clearly

    Posts on real engineering problems, in plain words.

    Read the blog

  • 10

    Owns decisions

    153 decision records, each with its tradeoff and the call I made.

    See the decision records

Built with AI. Gated so quality never slides.

Steven Stout’s showcase: a used-vehicle auction on .NET and React, built and run by one engineer, live on Azure, with its decisions written down.

No quality number has gotten worse at any release since 1.0.5.1 on 10 November: 273 releases in a row.

One engineer, an AI agent and a gate that checks 15 quality numbers on every release. 352 versions measured, with every result public, the worst days included.

82 releases in the last 7 days, each through the same gate.

Async methods with no CancellationToken, may only fall

11091.0.3.1391.0.5.2731.0.4.115, the ratchet
Every number, on the Quality page

TheYard, right nowLive

Answering in

unread

02505007501,000

server time at p95, the usual five minutes of the last day.

Azure this month

unread

the bill, by resource, read from Azure. The Admin tab shows every line.

Since the last roll

unread

 

rolled in place by the pipeline, behind one gate.

People who have visited

unread

30 days agotoday

Scanners, my own tools' and my own reads left out.

03Start here

04Where teams are heading

How I see engineering with AI, and the setup on this site that backs it.

AI-augmented teams · Architecture and ownership

AI writes more of the code. Someone still has to own what ships.

Teams are going to be heavily AI-augmented. That moves the senior job toward architecture and technical ownership: deciding what to build in pieces small enough to verify, and owning what ships.

  • Task tracking will get automated too. Judgment stays human: seeing a design fail at scale before it does.
  • On this site the AI's first design held the whole catalogue in memory. I caught it when the App Service plan hit 82 per cent and moved the work to the store.

What the AI wrote, what I decided

07Tech stack

  •    
  •    
  •    

Read from the build, never typed by hand

What TheYard runs on

What we use, where it runs, its AWS twin, the version as built, and the file that proves it.

Cloud patterns, not one vendor: every Azure piece in this stack has a named AWS twin. Mapped, not yet run on AWS.

  • .NET 1114 projects
  • React 19.3TypeScript 7.0
  • Azure9 Bicep files
  • 11GitHub Actions workflows
The whole stack, with the file that proves each line

The last release the gate stopped was 1.0.5.258 on 2 December, at its browser 1 of 2 job.

08How it is built

09How it is run

10Who and why

Next step

11What has to work, where is it today, and what does success look like?

Book 20 minutes opens an email to me with those three questions in it, and I answer with a time.

Book 20 minutes

Your email app should have opened with this message. If it did not, copy it and send it from any mailbox.

Or message me on LinkedIn