quality-gate-swift
The Gate and the Mirror — mechanical enforcement and institutional judgment for software you can trust.
$ git commit -m "session loop"
✗ concurrency cancellation-checkpoint-after-loop
commit blocked · 1 error
$ git commit -m "session loop"
✓ 33 checkers · 0 errors · 0 warnings — committed
How mechanical enforcement and institutional judgment build software you can trust.
Every line of code is an act of trust. The developer trusts that the function they’re calling does what its name says. The team trusts that the test suite catches regressions. The organization trusts that what ships reflects its standards.
Most of the time, that trust is unearned — not because people are careless, but because the mechanisms meant to enforce standards (documentation, code review, checklists, good intentions) are voluntary. They work when people remember to follow them, and fail silently when they don’t.
This series is about two systems that, together, replace unearned trust with mechanical certainty and institutional memory.
The Gate
quality-gate-swift is a modular, AST-powered static-analysis tool for Swift. It reads the tree, not the text: every rule walks the SwiftSyntax abstract syntax tree, so it understands scope, type context, and control flow. That precision is what lets it block rather than merely warn — 33 checkers, 1,700+ tests, zero regex, held to its own standard on every commit.
The Gate posts walk through every checker: what it catches, the real bug that motivated it, how it’s detected, and how it dogfoods itself.
The Mirror
A gate tells you no. It doesn’t tell you why you said yes the last time you overrode it. The Institutional Judgment System is the other half: a feedback loop that captures the reasoning behind every override, exemption, and calculated risk — and feeds that institutional memory back into the next gate run. Nothing is silent; everything is recorded, dated, and human-inspectable.
The Mirror posts are, frankly, the more interesting half — because they’re where the influence of Ray Dalio’s Bridgewater shows up as working code: Dalio’s five-step loop (Goals → Problems → Diagnosis → Design → Doing) mapped onto every failure; believability-weighting as a per-writer track record; radical transparency as “recorded, never silent.” Principles, turned into algorithms, turned into a machine.
Where to start
Filter by family below — or start with the two anchor posts: A Gate, Not a Linter for the philosophy of mechanical enforcement, and The Mirror for how the judgment system learns. Everything here dogfoods itself: this very site is a node in the corpus.
Prefer to read it all at once? Download the book — The Gate and the Mirror (.epub).
"DocCoverageChecker: Undocumented Public APIs, Ranked by How Much They Matter"
Aug 25, 2026
2 min read
"PrivacyManifestChecker: The App Store Rejection You Can Catch at Commit Time"
Aug 14, 2026
2 min read
"ComplexityAnalyzer: Cognitive Load, and the Cost That Hides in the Call Graph"
Aug 11, 2026
2 min read
"ProcessSafetyAuditor: The 64 KB Pipe Deadlock It Caught in Its Own Author's Code"
Aug 10, 2026
2 min read
"UnreachableCodeAuditor: Dead Code, and the 1,064 False Positives It Taught Me to Kill"
Aug 9, 2026
2 min read