09 · Earn a stricter rung

Your gate is required, and a pull request with a BLOCKER finding still merges. In this step you merge one yourself, clean it up, find out why the gate let it through, and see what it takes to make the gate stop the next one.

About 15 minutesNeeds GitHubFiles after this step ↗Pull request #15 ↗

✓

You will learn

  • Why a BLOCKER finding can still merge today
  • What a rung is, and why going up needs proof
  • What a blocking rung feels like, on a practice branch

1. Make the mistake

Someone on your team needs a quick value and silences the type checker to get it. One line, an @ts-ignore with no reason:

terminal
$ git checkout -b feat/legacy-id
$ cat > src/legacy.ts <<'EOF'
// @ts-ignore
export const legacyId: number = JSON.parse("1")
EOF
$ git add src/legacy.ts
$ git commit -m "feat: add legacy id"
$ git push -u origin feat/legacy-id
$ gh pr create --title "feat: add legacy id" --body-file .github/pull_request_template.md
$ gh pr checks --watch

✓  test
X  redline-gate / Deterministic policy
✓  redline-gate / PR checklist
✓  redline-gate / ADR required for significant changes
✓  redline-gate / Dependency review
✓  redline-gate / Secret scan (diff)
✓  redline-gate / gate

Tick the ## Launch readiness boxes as usual. The Deterministic policy job caught it:

terminal
# from the Deterministic policy job

src/legacy.ts:1
  Redline/BLOCKER [core/type-checker-suppression]: a type-checker suppression needs an inline explanation AND a ticket reference on the same line. Without one, nobody knows what it hides or when it can go.

The standard says a BLOCKER must not merge. Now try to merge it, the way a busy teammate would:

terminal
$ gh pr merge --squash
$ git checkout main
$ git pull
$ cat src/legacy.ts

// @ts-ignore
export const legacyId: number = JSON.parse("1")

It merged. Nobody bypassed anything, nobody was an admin, and the gate you made required in step 07 was green the whole time. A BLOCKER is on main.

2. Clean it up

The fix is a parse that needs no suppression. Make it, and check it on your machine before pushing:

src/legacy.ts
export const legacyId = Number.parseInt("1", 10)
terminal
$ git checkout -b fix/legacy-id
$ cat > src/legacy.ts <<'EOF'
export const legacyId = Number.parseInt("1", 10)
EOF
$ git diff > fix.diff
$ pnpm redline policy --diff-file fix.diff
$ rm fix.diff

no deterministic findings — 53 rule(s) evaluated with no model call
terminal
$ git commit -am "fix: parse legacy id without silencing the type checker"
$ git push -u origin fix/legacy-id
$ gh pr create --title "fix: parse legacy id without silencing the type checker" --body-file .github/pull_request_template.md
$ gh pr checks --watch
$ gh pr merge --squash
$ git checkout main
$ git pull

main is clean again, but only because you noticed. Nothing stops the same mistake tomorrow. Two pull requests and a cleanup, for one line the gate had already found.

3. Why the gate let it through: the rung

A rung is how strict the gate is about review findings. Think of a ladder: every repository starts on the bottom step, and each step up makes the gate stricter.

RungWhen a rule is broken, the gate…
observereports it and stays green. You are here: that is why your BLOCKER merged.
block-blockerturns red on a BLOCKER finding.
block-highturns red on a BLOCKER or a HIGH finding.

Do not mix this up with step 07. --blocking decided whether a red gate stops the merge. The rung decides what turns the gate red. You have the first; this step is about the second.

4. Try to turn it up

The obvious fix is one command. Try it:

terminal
$ pnpm redline init --rung block-blocker --no-commit

  ▲ enforcement stays at observe — cannot move to block-blocker:
  ▲ 20 reviewed pull requests are needed and 0 have been recorded — a perfect
    rate over a handful is a coincidence, not evidence
  ▲ the seeded corpus has never been scored for this stack, so there is no
    evidence the reviewer catches known defects at all
  ▲ the clean corpus has never been scored, so nothing shows the reviewer stays
    quiet on correct code
  ▲ too few findings have fired to compute an acted-on rate

Redline refuses, and no flag or admin gets past it. The rung stays at observe. To see why, think about what happens when the reviewer is wrong.

Reviewers make mistakes. Sometimes a rule fires on code that is perfectly fine: a false positive.

  • At observe, a false positive costs someone a minute to read and ignore.
  • At a blocking rung, it stops a correct change from merging. Do that a few times, and the team stops trusting the gate and starts looking for ways around it.

So Redline only lets you go up when you can show the findings are worth blocking on. It asks for proof of three things:

  1. Enough history: the gate has reviewed enough pull requests to judge it fairly.
  2. People act on the findings: most of them were actually fixed, not ignored.
  3. The reviewer is accurate: tested on sample code with planted bugs, it catches all of them, and it says nothing about code that is fine.
To reachPull requests reviewedFindings fixedReviewer accuracy
block-blocker2060%catches every planted BLOCKER, zero false positives
block-high5080%the same

The proof must be less than 90 days old, and you climb one rung at a time. Going back down is always allowed.

New term Seeded corpus

Code with known defects planted in it, beside correct code that looks similar. Scoring the reviewer against it answers two questions a handful of real pull requests cannot: does it catch every known BLOCKER, and does it stay quiet on code that is fine? See Seeded corpus.

New term Acted-on rate

Of the findings the gate raised, the share someone fixed. A rule people keep ignoring is either wrong or badly explained, and blocking on it would only teach people to work around the gate.

5. Record what you really have

You do have some evidence. Count your merged pull requests:

terminal
$ gh pr list --state merged --json number --jq length

9

Nine, from steps 01 to 09; the throwaway pull requests you closed do not count. Every finding the gate raised on them was fixed: step 02's in step 03, and today's in your cleanup. Record that on a branch, with where the figures came from:

terminal
$ git checkout -b chore/evidence
$ pnpm redline evidence record --sample-size 9 --acted-on-rate 1 --source "the 9 merged pull requests of the Learn path; every finding was fixed"

recorded.

rung         observe
seed recall  not measured
acted on     100%
sample       9 pull request(s)
false pos.   not measured
recorded     <today> (0 day(s) ago) — the 9 merged pull requests of the Learn path; …

not yet eligible for block-blocker:
  - 20 reviewed pull requests are needed and 9 have been recorded — a perfect rate over a handful is a coincidence, not evidence
  - the seeded corpus has never been scored for this stack, so there is no evidence the reviewer catches known defects at all
  - the clean corpus has never been scored, so nothing shows the reviewer stays quiet on correct code

what block-blocker asks for:
  sample size      >= 20 reviewed pull requests
  seed recall      >= 100%
  acted-on rate    >= 60%
  false positives  <= 0
  measured within  90 days

The report is the to-do list for the next rung. Run pnpm redline evidence any time to see it again. --source is required: a figure with no source is just a claim. A real team takes these figures from its metrics over a few weeks of normal work, not from a count by hand. The record lives in .redline.json, so it is reviewed like any other change. Merge it:

terminal
$ git add .redline.json
$ git commit -m "chore: record review evidence from the Learn path"
$ git push -u origin chore/evidence
$ gh pr create --title "chore: record review evidence from the Learn path" --body-file .github/pull_request_template.md
$ gh pr checks --watch
$ gh pr merge --squash
$ git checkout main
$ git pull

6. Feel a blocking rung, on a practice branch

You cannot earn block-blocker in a tutorial, but you can see what it does. On a branch you will never merge, record practice figures that meet the bar, raise the rung, and make step 1's mistake again:

terminal
$ git checkout -b try/rung
$ pnpm redline evidence record --sample-size 20 --acted-on-rate 0.8 --seed-recall 1 --false-positives 0 --source "PRACTICE ONLY: made-up figures to see a blocking rung; never merged"
$ pnpm redline init --rung block-blocker --no-commit
$ cat > src/legacy.ts <<'EOF'
// @ts-ignore
export const legacyId: number = JSON.parse("1")
EOF
$ git add -A
$ git commit -m "chore: practice a blocking rung"
$ git push -u origin try/rung
$ gh pr create --title "Do not merge: practice a blocking rung" --body-file .github/pull_request_template.md
$ gh pr checks --watch
$ gh pr view --json mergeStateStatus

recorded.
…
  ▲ enforcement: observe -> block-blocker
…
✓  test
X  redline-gate / Deterministic policy
✓  redline-gate / PR checklist
✓  redline-gate / ADR required for significant changes
✓  redline-gate / Dependency review
✓  redline-gate / Secret scan (diff)
X  redline-gate / gate
{"mergeStateStatus":"BLOCKED"}

Tick the launch-readiness boxes again. The gate's log:

terminal
# from the gate job

Error: Redline gate failed: policy

Same line as step 1, same finding. This time the gate is red and the merge button is disabled. That is the whole point of the ladder: the mistake you had to clean up by hand is stopped before it lands.

This works on the branch because the pull request changes the rung in .github/workflows/redline.yml, and a pull request runs its own copy of that file. It is the same gap step 07 warned about, used on purpose here. Close the pull request without merging, so the made-up figures never reach main:

terminal
$ gh pr close
$ git checkout main
!

Never record figures you did not measure on a real repository. The --source and the pull request that adds it are the audit trail. Made-up evidence makes the gate block on findings nobody has shown to be right, which is exactly the harm the ladder exists to prevent.

Going down is always allowed

A demotion needs no evidence. If a rung is blocking good work, step down first and investigate after. A gate people resent gets worked around, and then it protects nothing. You are at observe already, so there is nothing to run now; on a higher rung it is one command, through a pull request like any other change:

terminal
$ pnpm redline init --rung observe

Check your understanding

A team's 30 pull requests show a 90% acted-on rate, but the seeded corpus has never been scored. Can it move to block-blocker?