02 · Your first finding

Write the kind of code an assistant produces when it is told to make a type error go away. It compiles, the tests pass, and Redline names five problems in it: four a checker can prove, and one only a reviewer would notice.

About 8 minutesNeeds GitHubFiles after this step ↗Pull request #2 ↗

✓

You will learn

  • How to review a change on your machine before you push
  • How to read a finding: severity, rule id, problem
  • How to run the same review inside Claude Code, Copilot or Cursor
  • What the gate does with a broken rule at observe

Write some plausible code

The directory from step 00 holds users; now they have to arrive from somewhere, as JSON. Start a branch:

terminal
$ git checkout -b feat/load-user

Open src/users.ts and keep everything in it. Below the closing } of UserDirectory, leave one blank line, then add this. The blank line keeps your line numbers the same as the ones on this page:

src/users.ts — add at the end
// TODO: handle retries
export function loadUser(raw: string) {
  // @ts-ignore
  return JSON.parse(raw) as unknown as User
}

export type Payload = unknown

export function requireUser(directory: UserDirectory, id: string, requester: User): User {
  const user = directory.find(id)
  if (!user) throw new Error(`${requester.email} asked for user ${id}, which does not exist`)
  return user
}

Look at it for a moment before reading on. Would you have caught all of it in a review on a busy afternoon? It compiles, because @ts-ignore tells the compiler to look away and as unknown as User tells it to trust whatever comes back. pnpm test still passes.

Review it

Redline reviews your diff against main. Git only diffs files it tracks. src/users.ts already is, so staging it is optional here, but it is the habit that saves you on a new file:

terminal
$ git add src/users.ts
$ pnpm redline review

profile javascript-typescript — rules in scope: core, typescript
src/users.ts:20
  Redline/HIGH [core/untracked-todo]: this TODO carries no ticket reference, so nothing will bring anyone back to it.
src/users.ts:22
  Redline/BLOCKER [core/type-checker-suppression]: a type-checker suppression needs an inline explanation AND a ticket reference on the same line.
src/users.ts:23
  Redline/BLOCKER [core/unsafe-assertion]: a double assertion overrides the type checker with no stated reason.
src/users.ts:26
  Redline/HIGH [typescript/unknown-type-alias]: this alias names `unknown`, so it reads as a contract it is not.
4 finding(s)

The messages are shortened here; your terminal prints each in full, with the fix. No model was called: these four rules are decided by a checker, so the result is the same every time. A new file you forgot to git add is not in the diff at all; if nothing else changed, the review stops with there is nothing to review — the diff is empty.

!

Four, not five, and that is the point. Line 30 is missing, and it is the worst line in the file. The terminal runs only the rules a checker can decide, and no checker can tell that requester.email is a customer's email address. Finding it takes a model: run /redline-review in your assistant, in the next tab. With no assistant, review --engine api calls a model from the terminal, given an API key.

Wouldn't ESLint catch this?

Four of the five, yes, with the right configuration, and you should run it. None of these rules is on in a default setup:

LineRedlineESLint
20core/untracked-todono-warning-comments flags every TODO, with a ticket or without
22core/type-checker-suppression@typescript-eslint/ban-ts-comment, configured to require a description
23core/unsafe-assertion@typescript-eslint/no-unsafe-type-assertion, not in the recommended set
26typescript/unknown-type-aliasNo rule; a custom no-restricted-syntax selector
30core/customer-data-in-logsNothing. A linter sees a string, not a customer's email address.

Line 30 is the kind of rule most of the standard is made of: missing auth checks, races, personal data where it should not be. They need a reviewer, so Redline gives every assistant the same reviewer's brief. And the rules reach the assistant before it writes, in AGENTS.md and its siblings, where a linter only reports after the code exists.

Reading a finding

Every finding has the same three parts, in the same order:

one finding
Redline/BLOCKER [core/unsafe-assertion]: a double assertion overrides the type checker with no stated reason.
  • Severity. BLOCKER must not merge. HIGH is a deliberate trade-off a reviewer acknowledges. SUGGESTION is optional.
  • Rule id, in brackets. It is stable, it is what you look up in the next step, and it is how the organisation counts which rules earn their place.
  • The problem, and how to fix it, in a sentence or two.
New term Deterministic rule

A rule a program can decide on its own, with no model: a @ts-ignore is either there or it isn't. Most of the standard needs judgement and is applied by a model. The deterministic share runs in your terminal and in the gate, and always gives the same answer. More in Deterministic rules.

Push it anyway

On GitHub, open a pull request with the findings still in it, to see what the pipeline does:

terminal
$ git add src/users.ts
$ git commit -m "feat: load a user from JSON"
$ git push -u origin feat/load-user
$ gh pr create --title "feat: load a user from JSON" --body-file .github/pull_request_template.md

On GitHub, fill in the ## Launch readiness checklist honestly. One item is false: Input validated at boundaries touched by this change, because this code skips validation. Leave that box unticked. Step 03 makes it true, and you tick it then.

terminal
$ gh pr checks

✓  test                                                       compiles, tests pass
X  redline-gate / Deterministic policy                        the same four findings
X  redline-gate / PR checklist                                one box, honestly unticked
✓  redline-gate / ADR required for significant changes
✓  redline-gate / Dependency review
✓  redline-gate / Secret scan (diff)
✓  redline-gate / gate                                        passes, with a warning

Open redline-gate / gate: its log says why it passed with two red jobs. checklist and policy are the ids of the PR checklist and Deterministic policy jobs:

terminal
# from the log of redline-gate / gate

Warning: Process checks failed: checklist
policy. This repository is at rung 'observe', which reports and does not block. The findings
are recorded either way.

That is observe doing its job: the findings are visible on the pull request and recorded, and nothing is blocked yet.

Notice what the gate did not see: line 30. The Deterministic policy job runs the same checker as your terminal, and the gate calls no model, so the email address in the error goes unremarked. In a pull request, that rule is applied by the review in your assistant before you push, and by a human reviewer. Step 07 adds a GitHub ruleset that also asks Copilot to review every pull request, when your plan includes it.

ℹ

A local review always exits 0 and is never recorded. It is a mirror, not a gate: nothing on your machine can block you.

Leave this pull request open. Step 03 fixes the code on this branch and merges it.

Check your understanding

The Deterministic policy job failed, but the gate passed. Why?