3. Explain and fix
A finding is only useful if you can find out why the rule exists. Ask Redline about the rule, fix the code, and re-run the review until it has nothing to say.
Ask what the rule means
Pass the id in the brackets of any finding:
$ npx redlinegate@latest explain core/unsafe-assertion BLOCKER core/unsafe-assertion No unsafe assertions (`as unknown as X`, force casts) used to silence an error. Where one is genuinely required, the justification is a `SAFETY:` comment on the same line or the line above, stating why the assertion holds (`// SAFETY: payload parsed by the schema above`). Any other comment does not count. decided by a checker, with no model call defined in standards/core.md:87 applies to every file — the core standard is not scoped by stack reaches javascript-typescript, web-react, web-nextjs, … every profile
It tells you three things a finding alone does not: the full rule, whether a checker or a model decides it, and where it is written down in the organisation's standards. A rule you disagree with has an owner and a place to change it, not just a reviewer to argue with. explain --list prints every rule id with its severity.
Fix the code
Replace src/user.ts with this. The parsed JSON is checked by a type predicate before it is returned as a User, so there is nothing left to assert or suppress. The TODO and the alias for unknown are gone.
type User = { id: string; name: string }
function isUser(value: unknown): value is User {
return (
typeof value === 'object' &&
value !== null &&
'id' in value &&
typeof value.id === 'string' &&
'name' in value &&
typeof value.name === 'string'
)
}
export function loadUser(raw: string): User {
const parsed: unknown = JSON.parse(raw)
if (!isUser(parsed)) throw new Error('payload is not a User')
return parsed
}
Adding // SAFETY: … above the assertion would also silence core/unsafe-assertion. That is meant for the rare assertion that is genuinely correct, not for this one, where the comment would be false.
Re-run the review
$ git add src/user.ts $ npx redlinegate@latest review profile javascript-typescript — rules in scope: core, typescript no findings
Run /redline-review in your assistant again as well. The checker is satisfied; the model reviews the rest of the standard.
Every rule, with examples: Standards.