PR Review Gate
About 12 min read
C7 - The PR-Reviewer Gate: Tiers, QC Layers, Airlocks
(weight: 8%)
This is the domain where a founder decides whether you can touch the brain unsupervised. Anyone can make a change; the question is whether the change can hurt the business if you are wrong, and whether the system catches it before it does.
An operator who ships straight into the live system is trusting their own attention to never slip, and attention always slips eventually. The cost of getting this wrong is not a typo.
It is a bad change merged into the thing the whole team depends on, on a Tuesday, while nobody is watching. Your job here is to prove you build the gate first and put yourself behind it, so that being wrong is cheap instead of catastrophic.
Watch
The main course does not teach this domain. It treats GitHub as a place to save and deploy versions, not as a safety gate, and the closest beat (the agent-team plan-reviewer teammate, from about 7:10 onward in the main video) is about getting the work correct, not about gating a merge.
So for the proprietary heart of this domain, watch the two short pieces below that teach the public primitives, and the one FF piece is recorded by John.
▸ CODEOWNERS (auto-assign a required reviewer to specific paths): How to Add Branch Rules, CodeOwners, Pull Request Templates | Git & Source Control #11. Caveat: filmed for a multi-engineer team.
"Require approvals" / "Require code-owner review" will lock a solo operator out (you cannot approve your own PR). Solo: require a PR before merging, skip the human-approval requirement.
○ Note: these two videos (CODEOWNERS and branch protection) are the same ones listed in C3. If you already watched them there, you can skip re-watching and go straight to the Read and Build sections. They are relisted here so C7 stands on its own.
▸ Branch protection (require a pull request, require a review, protect the main line): GitHub branch rules (protect your git branches). Note the real caveat raised in that video: on a free private repo, branch protection does not actually enforce.
That is why your demo runs on a public sandbox repo. Caveat: filmed for a team on GitHub's older branch-protection screen.
Solo founders: do NOT enable "Require approvals" with "Include administrators," it locks you out of your own main. Solo, use require-a-PR-before-merging + required status checks; GitHub's newer Rulesets is the current mechanism.
▸ For the part where you take an automation live on a schedule inside an airlock, the main course does cover the mechanics. Watch from 2:20:31 to 2:24:01 (deploying with a scheduled cron trigger and a secret), then watch from 2:47:37 onward (Claude Code's native scheduled tasks running on a cadence).
A brief earlier mention is at 1:35:04. Build links as Build & Sell with Claude Code (10+ Hour Course), Build & Sell with Claude Code (10+ Hour Course), and Build & Sell with Claude Code (10+ Hour Course).
▸ [VIDEO: TBD - John records: the FF auto-reviewer live] - the proprietary core of this domain. A real change moving through the three tiers: an in-lane edit auto-merging, a constitution-path change held for a human, and a secret or destructive operation hard-blocked.
The system in motion is the teaching. Until it is recorded, the Read and Build sections below carry it in full.
Read (the principles)
The gate is three tiers, sorted by what a change can cost if it is wrong. Most changes are low-risk and in your lane, so the gate checks them and merges them on its own. Some changes touch the constitution of the business (the CLAUDE.md, the database schema, the skills), so the gate refuses to merge them and hands them to a human.
A few changes are never allowed, ever (a leaked secret, a delete-the-table operation), so the gate blocks them and they stay blocked. Like an airport: most bags go straight through, some get pulled for a hand-check, and a few items never board no matter who is carrying them.
Get this wrong and you have either a gate so strict nobody can work, or a gate so loose a knife gets on the plane.
The fail-asymmetry is the single most important idea in this domain: blocking fails open, auto-merge fails closed. When the part that blocks bad changes crashes, work still flows through (a human can still merge), because a crashed safety check should never freeze the whole business. When the part that auto-merges is uncertain, it disarms itself and merges nothing, because anything unsupervised that is even slightly unsure must wait for a person.
Think of a drawbridge wired so that a power cut drops it down (people can still cross) but a power cut also locks the vault (the dangerous thing stays sealed). The reason is the cost: wrongly holding a good change costs a few minutes of waiting, while wrongly auto-merging a bad change ships an unsupervised mistake into the live system.
You make the cheap mistake easy and the expensive one structurally hard. State this backwards in front of a founder and you have told them you do not understand the gate you are standing behind.
Quality control runs in three layers, and they do different jobs. Layer 1 is you: the operator self-review, where you check your own work against the rubric before anything leaves your hands, because the first line of defense is the person who built it. Layer 2 is the machine: the AI/PR review, the auto-reviewer, fast and tireless, catching secrets, broken structure, things that violate the rules every single time.
Layer 3 is the human reviewer: the one who feels the cringe a machine cannot feel, the copy that is technically fine but would embarrass the brand, the answer that is confidently wrong, the thing aimed at the wrong context, plus the documentation step where, when an error gets through, you write it down so the same mistake cannot recur and the system gets smarter instead of just luckier. Like a kitchen: the cook (operator) checks their own plate first, the thermometer (the machine) confirms the chicken is safe, and the head chef (the human) tastes whether it is actually good and writes the recipe note so next week's cook does not repeat last week's mistake.
The trap is believing the machine replaces the human; it does not. A bot that passes a deliverable does not mean a founder would be proud to send it.
The auto-reviewer is a containment device, not a measure of trust. A setup note worth getting right, because people look for the wrong thing here: the starter template (ff-aios-starter) already ships our pr-review.yml workflow, so you do not wire the reviewer from scratch and there is no stock Claude GitHub App to install. You simply set your own ANTHROPIC_API_KEY as a repository secret and the shipped workflow uses it; /install-github-app is not part of this flow.
You build the airlocks first, and only then do you add people behind them, one at a time. The first operator runs for a few weeks before you add the second, the second is onboarded from written documentation rather than a verbal hand-down, and you watch the first few changes from each person closely.
The lane is the safety model: define the role and the scope before you place a person in it, so that even a brand-new operator, even one being injected or socially engineered, can only touch what their lane allows. Like giving a new hire a keycard that opens three doors instead of the whole building; you are not insulting them, you are containing the blast radius while trust is still being earned.
Add people faster than the airlocks can hold them and the first bad change has the whole building to wreck.
CODEOWNERS is narrowed to the catastrophic-only. It is the list of paths the gate must always escalate to a human, so you point it at the constitution (the brain file, the database schemas, the skills) and you leave the everyday in-lane work to auto-merge. The mistake operators make is gating everything, which buries the founder in approvals until they stop reading them, and a rubber-stamp review is no review at all.
Like a fire alarm: if it goes off for burnt toast it goes off for nothing. Gate the few things that can truly burn the house down, and let the rest flow.
Anything that runs on a schedule goes live inside an airlock with a kill-switch. A scheduled automation runs with the least privilege it needs (a scoped key, never the master key), under a spend cap so a runaway loop cannot drain the account, with an obvious off-switch, and pointed at a sandbox resource until you have watched it behave. You arm the auto-merge only after the system has run in a safe bake mode; the default is off.
Like test-firing an engine bolted to the bench with a big red stop button in reach before you ever put it in the plane. Skip the kill-switch and the airlock and your first runaway run is also your first emergency, with no way to stop it cleanly.
Build (your sandbox artifact)
Everything here is synthetic and sandbox-only. Nothing real, ever: no real client paths, no real keys, no real names, no live system. You build in your own disposable copy of the template. You will produce three things, all named on the convention:
▸ AIOS_CERT_C7_[FirstName]_GateBrief.md - a short brief, in your own words, that teaches the three tiers (with one concrete example change from your own lane for each), the fail-asymmetry and the why behind it, the three QC layers correctly placed (Layer 1 operator self-review, Layer 2 the auto-reviewer / AI/PR review, Layer 3 the human reviewer), and a CODEOWNERS reasoning note listing three paths you would gate to a human and three you would let auto-merge in your lane, with a one-line reason for each.
▸ AIOS_CERT_C7_[FirstName]_Tier2Demo - a branch in your public sandbox repo, with branch protection turned on (require a pull request, require a review from code owners) and a CODEOWNERS file, plus a pull request you open inside a gated path so the platform itself holds it.
▸ AIOS_CERT_C7_[FirstName]_ScheduledRun (Part C, optional stretch, does not affect your pass) - one scheduled automation that runs on a cadence against a sandbox resource, behind a scoped key, a spend cap, and a kill-switch you can flip on camera. This is optional enrichment only: doing it adds nothing to your score and skipping it costs you nothing. Do it if you want the reps, leave it if you do not.
One thing to be clear about so this does not read as contradicting itself: the Tier-2 demo DELIBERATELY turns on "require a review from code owners" to trigger the solo self-lockout on purpose, because that is how you SHOW the block actually holding a PR you cannot self-merge. A real solo working repo does the opposite: it uses "require a pull request + required status checks" (NOT "require approvals" / "require code-owner review"), so you are never locked out of your own main. The demo proves the gate; the working setup keeps you operating.
Public-repo hygiene (this is itself a security gate, not a formality). Branch protection only enforces for free on a PUBLIC repo, so this demo goes public, which means the contents go public forever. Before you make ANY repo public, do one of two things: create a SEPARATE, CLEAN public demo repo built from scratch with only synthetic content, OR verify the entire history is fully synthetic (remember a key or a real detail in git history is public even after you delete it in a later commit).
NEVER flip an existing repo public if it ever contained real data, keys, internal links, or client-like details, not even once, not even in an old commit. When in doubt, start a fresh clean repo rather than flipping an existing one.
Prove (record it + how it is judged)
Record one continuous, face-on-camera screen-share Loom, around 6 to 9 minutes, narrating your decisions in your own words the whole way (teach it, do not read it aloud).
Walk it in this order:
- Open your GateBrief and teach the three tiers, giving one concrete change from your own lane for each: an in-lane edit (Tier 1), a constitution or CODEOWNERS path (Tier 2), a secret or a destructive operation (Tier 3).
- Explain the fail-asymmetry in your own words, both directions and the why: blocking fails open (a crashed checker still lets a human merge), auto-merge fails closed (any uncertainty disarms it), because wrongly blocking costs minutes while wrongly auto-merging ships an unsupervised mistake.
- Walk the three QC layers, say out loud that operator self-review is Layer 1, the auto-reviewer (AI/PR review) is Layer 2 (machine), and the human reviewer is Layer 3, and name one thing only Layer 3 (the human) can catch.
- Read your CODEOWNERS reasoning note: three paths you would gate and three you would let auto-merge in-lane, and why each lands where it does.
- Switch to GitHub and show your public sandbox repo's branch protection settings and your CODEOWNERS file.
- Open the Tier2Demo branch, show the pull request you opened inside the gated path, and show the live merge box reading "Review required, merging is blocked." Say out loud why this is the Tier 2 hold: a constitution-level change cannot self-merge; the platform holds it for a human.
- If you did Part C (optional stretch, no score impact): show your ScheduledRun, fire one run live against a sandbox resource, show the output, then hit the kill-switch on camera and confirm it is off.
Your Loom must show:
▸ Face on camera, one continuous take, your own narration throughout (no reading a script aloud).
▸ All three tiers explained with a correct own-lane example for each (in-lane to Tier 1, CODEOWNERS to Tier 2, secret or destructive to Tier 3).
▸ The fail-asymmetry stated the right way round (blocking fails open, auto-merge fails closed) and the why (the asymmetric cost).
▸ The three QC layers named, with operator self-review at Layer 1, the auto-reviewer (AI/PR review) correctly placed at Layer 2, the human reviewer at Layer 3, and one Layer-3-only (human) catch named.
▸ Your CODEOWNERS reasoning note read aloud: three gated paths and three in-lane paths, with reasoning.
▸ Branch protection settings and the CODEOWNERS file shown on a public repo.
▸ The live "Review required, merging is blocked" merge box on the Tier 2 pull request.
▸ If Part C (optional stretch, does not affect your pass): one live scheduled run against a sandbox resource, plus the kill-switch turning it off.
What good looks like: you sound like someone who built the gate and put themselves behind it on purpose. The examples are from your own lane, not lifted from this doc.
You state the fail-asymmetry the right way and you can explain why the cheap mistake is the one you let happen. You treat the auto-reviewer as Layer 2 (the machine), sitting between your own Layer 1 self-review and the Layer 3 human reviewer, not as a replacement for the human.
And you can show the platform itself holding a change you are not allowed to merge alone, which is the whole point: the system protects the business even from you on your worst day.
Rest stop
That is the gate. You now understand why being wrong should be cheap, and you have shown a real platform holding a change you cannot self-merge. Your progress is saved. This is a clean place to stop and come back for the capstone, where all of it runs together in one session.