Skip to content

ADR: Style, enforced

ADR: Style, enforced

Status
accepted
Date
2026-09-03
Shipped as
1.0.0.39

Steve asked for the implicit conventions to become enforced standards, so every later change has a rule to build against.

In plain words

This page turns the project's written style rules into four checks that fail the build (a style job in CI), run first because they are the cheapest. A different linter (oxlint) stands in for the usual one (ESLint), which does not run on this TypeScript version.

What that is worth: a developer stops debating formatting in review because the build settles it on every machine, and the organization gets one standard that holds the same on Windows and on the Linux runner.

Context

The written half of this already existed. ADR: App Architecture section shipped docs/app-architecture/STYLE.md (naming, layering, the derive-don't-store principle, the comment rule) and docs/app-architecture/ARCHITECTURE.md (the onion and its dependency direction, the wire contract, the single source of truth), with an .editorconfig carrying the mechanical rules a tool can check.

None of it was load-bearing. .editorconfig is a request to an editor, not a gate, and nothing in CI had an opinion about formatting at all. A rule nobody can fail is a preference.

What the measurement said before anything changed

Three checks were run against the tree as it stood, because adopting a tool that turns out to disagree with the whole codebase is a decision worth making with the number in hand.

dotnet format --verify-no-changes: failed. Not on sloppiness. It wanted three things, and all three were right: whitespace inside a handful of object initialisers, using directives sorted (TheYard.Data before TheYard.Domain), one unused using removed from Ports.cs, and the UTF-8 BOM taken off Program.cs. That last one is worth naming: .editorconfig says charset = utf-8, not utf-8-bom, so the BOM was the file disagreeing with the project's own stated rule. The formatter found a real inconsistency that a human review had walked past for a week.

Prettier: 29 files. Expected, for a codebase that has never had a formatter.

ESLint: refused to run. Not a stale peer range. typescript-eslint has an explicit runtime guard, and this repository is on TypeScript 7:

Error: typescript-eslint does not support TS 7.0.
See https://github.com/typescript-eslint/typescript-eslint/issues/10940

Decision

Four checks, in their own CI job, that fail the build.

Check Owns
dotnet format --verify-no-changes C# whitespace, using order, unused usings
prettier --check TypeScript, TSX, CSS
oxlint --deny-warnings the rules a formatter cannot see
tsc -b types, and unused locals and parameters

The style job runs first and alone because it is the cheapest thing here. A missing semicolon should not cost a browser suite's runtime to discover.

oxlint instead of ESLint, for as long as that is true. ESLint is not available on this TypeScript, and the two ways to pretend otherwise are both worse than picking something else: downgrading TypeScript to suit a linter inverts which one is the tool, and forcing the install past its own guard ships a linter that may silently mis-parse. oxlint carries its own TypeScript parser, so the TypeScript version is not its business. It ran 106 rules over 48 files in 68 milliseconds.

The eslint.config.js that was written first is not in the repository, because a config for a tool that cannot run is a trap for the next person. The upstream issue is linked above; when it closes, this is a swap of one dev dependency.

The linter had to prove it catches things. A tool that runs clean on a clean codebase and a tool that does nothing are indistinguishable from their exit code. Both were checked against a file with four deliberate violations, and the CI checks were each run once against deliberately bad input:

Check clean tree bad input
prettier --check 0 1
oxlint --deny-warnings 0 1
dotnet format --verify-no-changes 0 2

The typecheck already earned its keep. tsconfig.app.json has strict, noUnusedLocals and noUnusedParameters, and tsc -b was already in CI. The linter is not configured to repeat any of that.

What the linter found on its first real run

Three findings, and one of them is the reason to have a linter at all.

Two were the diagram generator writing to the console, which is what a build script is for; the config exempts docs/ and scripts/ the way it exempts tests.

The third was react(set-state-in-effect) in the component that serves these documents. DocDialog held its load failure as a boolean and reset it inside the effect that opens the dialog, which is a synchronous setState in an effect and a second render for no reason. The fix was to hold the nonce that failed rather than a flag saying something did, which makes the flag derivable and deletes the reset:

// The request that failed, not a boolean saying something did. A boolean has
// to be cleared when the next document opens, and clearing it means a
// setState inside the effect that opens the dialog, which starts a second
// render for no reason. Holding the request makes the flag derivable: the
// next one is a different object, so the old failure stops matching by
// itself.
const [failedRequest, setFailedRequest] = useState<DocRequest | null>(null);
const docError = request !== null && failedRequest === request;

Live from src/library/DocDialog.tsx, region derived-error, read from this build at 99df7a8.

That is docs/app-architecture/STYLE.md's own derive-do-not-store rule, violated in the component that serves docs/app-architecture/STYLE.md, found by a tool on its first run. It is the cleanest possible argument for the tool.

What CI found that the same command locally did not

The style job failed on its first run, on dotnet format --verify-no-changes, against a commit where that exact command had just exited 0 on the machine that wrote it. Both machines were right.

.editorconfig said end_of_line = crlf. Git stores LF for every file in this repository and there was no .gitattributes, so the working tree was whatever each machine's core.autocrlf made it: CRLF on Windows, LF on the Linux runner. The rule held on one of the two machines that check it, and which machine you were sitting at decided whether the repository was correctly formatted.

The explanation was tested before it was acted on. One C# file was rewritten with LF endings locally and the same command run again, which is the whole experiment:

endings on disk end_of_line exit
CRLF, a Windows checkout crlf 0
LF, a Linux checkout crlf 2
LF lf 0
CRLF lf 2

Three files changed, and the third is the one worth reading:

  • .gitattributes now declares * text=auto eol=lf, so every checkout gets the same bytes whatever anyone's git is configured to do.
  • .editorconfig says end_of_line = lf, which is what git has stored all along.
  • .prettierrc.json said "endOfLine": "auto", which means "accept whatever the file already has". That is a check that cannot fail, and it is why Prettier had nothing to say about a repository holding two kinds of line ending at once. It says "lf" now, and the working tree was normalized to match in the same commit.

A rule that holds only on the machine that wrote it is the exact thing this record exists to stop, and it survived right up until something ran it somewhere else. That is the argument for enforcing style in CI, made by the enforcement, on its first run, against the record proposing it.

The diagram, and the runtime that is not shipping with it

docs/app-architecture/ARCHITECTURE.md now carries the topology as Mermaid. The point is that it is text: it lives in the file, changes in the same commit as the thing it describes, and appears in a diff when the topology moves. GitHub renders it.

Rendering it in the app was tried and backed out on the number. The dynamic import worked exactly as intended, and the entry chunk went from 289.9 KB to 293.2 KB, so a reader who never opens Architecture pays 3.4 KB. The rest of the measurement is the problem:

before after
npm packages added 112
JavaScript chunks in dist 1 20
largest added chunks 662 KB core, 435 KB cytoscape, 259 KB katex
total lazily loaded about 2.3 MB

That is cytoscape and a maths typesetter, to draw two flowcharts, in a repository that already renders hand-drawn SVG on its own zoomable pages (ADR: Diagram pages). The fences stayed, the dependency went, and the reader in the app gets the source with a line pointing at the drawing.

In the code

The style job (.github/workflows/ci.yml):

# Format drift fails the build rather than getting argued about in review.
# It runs first and on its own because it is the cheapest job here: a style
# failure should not cost the time of a browser suite to discover.
#
# dotnet format checks three things at once against .editorconfig: whitespace,
# using order, and unused usings. Prettier owns the TypeScript and the CSS.
# oxlint owns the rules a formatter cannot see. The typecheck in the frontend
# job already enforces noUnusedLocals and noUnusedParameters, so the linter is
# not asked to repeat it (ADR-028).
style:
  runs-on: ubuntu-24.04
  steps:
    - uses: actions/checkout@v7
      with:
        ref: ${{ inputs.sha || github.sha }}
    - uses: actions/setup-node@v7
      with:
        node-version: 24
        cache: npm
    - uses: ./.github/actions/dotnet
    - run: npm ci
    - run: npm run format:check
    - run: npm run lint
    - run: npm run format:api:check

Live from .github/workflows/ci.yml, region style-job, read from this build at 99df7a8.

Consequences

  • Formatting stops being a review topic. It is also no longer negotiable: the first commit after this one had to be reformatted by Prettier before it could pass, which is the system working.
  • dotnet format reformatted a small number of C# files as a one-off. The diff was checked with git diff --ignore-all-space before it was accepted, and every one of the three suites was run after it.
  • Line endings are now the repository's business rather than each checkout's, and Prettier enforces them instead of accepting them.
  • The Program.cs BOM is gone. The ship gate had a check asserting the BOM was present, added when an encoding-blind PowerShell edit once corrupted a file. That check now asserts the opposite, because the formatter is the thing guarding encoding now.
  • A record can carry a diagram in text from here on, which the records for the database and the event stream will want.
  • One deviation from the brief worth stating: the records stay at docs/ADR-NNN-*.md rather than moving to docs/adr/NNNN-*.md. Twenty-seven files, the served catalog, the sidebar and every cross-reference between them would move for a naming convention, with nothing gained that a reader can see. The numbering and the ordering are what make an index work, and both are already there.

Where it sits

No ring: this is a build and tooling decision about the checks CI runs on formatting and lint, so the onion and SOLID do not apply to it.

Files

Addendum, 2026-10-06 (1.0.3.84): the records moved after all

This record kept the records at docs/ADR-NNN-*.md rather than moving them, because at twenty-seven files the move bought nothing a reader could see. At ninety records beside twenty-eight pages it did: GitHub showed one list of a hundred and eighteen files. From 1.0.3.84 the records live in docs/decisions/, still named ADR-NNN-*.md, so the numbering and the ordering this record valued are unchanged (ADR: The sidebar, the addendum on the folders).

Enforced by

One rule in the rulebook cites this record, each held by a test on every release.

The rule What holds it In the last gate
Nothing this repository ships or serves contains an em dash HouseVoiceTests 10 of 10 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