# Review ladder

How much a person reviews before agents act: the ladder from Advise to Full delegation. Each rung says what happens at it. A rung the account or the person's role doesn't allow stays visible, locked, with its reason, so the whole range is legible.

- Registry name: `review-ladder` (`@candor/review-ladder`)
- Tier: Pro. Installing it needs a Pro, Premium or Team licence key: the person runs `npx candor-ui key <key>` themselves; never ask for the key in chat or write it to a file.
- Docs: https://candor.themethodic.com/docs/review-ladder

## Install

```bash
npx candor-ui add review-ladder
```

Run `npx candor-ui@latest init` once first (https://candor.themethodic.com/get-started.md). Without the CLI: `npx shadcn@latest add @candor/review-ladder`.
It brings in: locale, work, utils.
npm packages: lucide-react@^1.67.0.

## Example

```tsx
"use client"

import * as React from "react"
import type { ReviewLevel } from "@/lib/work"
import { ReviewLadder } from "@/components/review-ladder"

export default function Example() {
  const [level, setLevel] = React.useState<ReviewLevel>("R3")
  return <ReviewLadder className="max-w-2xl" value={level} onChange={setLevel} locked={{ R5: "Acme's policy keeps Production changes at R4 or below." }} />
}
```

## <ReviewLadder>

Props:

- `value: ReviewLevel`: The current review level, R1 (Advise) to R5 (Full delegation).
- `onChange?: ((level: ReviewLevel) => void) | undefined`: Makes the rungs choosable; called with the level picked.
- `locked?: Partial<Record<ReviewLevel, string | undefined>> | undefined` (default `{}`): Reasons a level can't be chosen.
- `className?: string | undefined`

## Strings (`reviewLadder`)

The fixed words, English by default. Override any of them under `reviewLadder` in `<LocaleProvider strings={{ reviewLadder: { … } }}>`; the table is exported as `reviewLadderStrings`.

- `label`: Review level
- `R1`: Advise
- `R1Detail`: Agents explain what to do. You make the change.
- `R2`: Draft
- `R2Detail`: Agents prepare the change as a diff. You apply it.
- `R3`: Build & hold
- `R3Detail`: Agents build and test in a test environment. Nothing ships until you sign off.
- `R4`: Ship with a window
- `R4Detail`: Agents ship after tests pass, inside a window you set, with rollback ready.
- `R5`: Full delegation
- `R5Detail`: Agents ship on their own. You see everything after.

## Rules for using Candor UI

- Components take plain typed data. Never pass model output as HTML or render it as a link; messages are typed blocks.
- A control that can't be used says why: wrap it in `<Locked reason="…">`, don't just disable it.
- Don't show a value you don't have: leave it out (it renders as —) rather than guess. An estimate is labelled as one.
- Nothing is pre-selected in a decision a person makes, and the agent is named from your app's data, never from model output.
- Your app's words go in `LocaleProvider` (fixed strings) and `TermsProvider` (nouns); entity kinds and agent roles in `EntityKindsProvider` and `AgentRolesProvider`.
