Lintro AI Review (standard local pass)
Run lintro's own AI diff review (lintro review) on the branch. Since 2026-08-02
(owner instruction) this is a standard third local pre-push pass alongside
coderabbit and greptile, not just a fallback — and when those two are rate-limited
or down, the lintro pass is the AI review of record for the push.
When to use
- As part of the default pre-push review set (
coderabbit + greptile + this).
- CodeRabbit and/or Greptile are rate-limited, erroring, or otherwise unavailable.
- You want an AI pass on the branch diff (or working tree) right now.
At final merge, bot threads that did get posted on the PR must still be triaged;
a local lintro pass doesn't resolve GitHub threads.
Two correctness rules (do not skip)
- Use released lintro via
uvx, never uv run lintro. The reviewer engine must be
stable and independent of the working tree — especially when the branch is itself
modifying lintro's AI/provider layer (you must not review half-migrated code with
itself). Floor is >=0.94.7: that release carries both the CLI auth-mode
detection (#1859, subscription OAuth works) and the CLI stdout error surfacing
(#1836).
- Enable AI locally behind a
skip-worktree guard. Many repos (incl. py-lintro)
ship .lintro-config.yaml with no ai: block or ai.enabled: false. Flip it on
locally in a way that cannot be staged or committed.
Steps
Enable AI locally without commit risk — only if the project config has AI
disabled (grep -A2 '^ai:' .lintro-config.yaml; skip this step if already
enabled: true / review: true):
git update-index --skip-worktree .lintro-config.yaml
Then merge this ai: mapping into .lintro-config.yaml (append/merge the block —
the rest of the project config stays as-is, so --with-lint keeps working):
ai:
enabled: true
review: true
provider: cursor
model: cursor-grok-4.5-high
Preflight the engine — Cursor + Grok 4.5 is the standard reviewer (owner
instruction, 2026-08-11):
- Provider is
cursor, model is cursor-grok-4.5-high (Cursor's Grok 4.5 id —
confirm with cursor-agent models if it errors), via --transport cli. Verify the
CLI exists with cursor-agent --version.
- Workspace trust is required once per directory, or lintro's invocation dies
with "Workspace Trust Required". Grant it non-interactively from the repo/worktree
root:
cursor-agent -p 'Reply with exactly: ok' --trust --model cursor-grok-4.5-high --output-format text — trust persists for subsequent runs.
- Fallbacks, in order, only when
cursor-agent is missing or erroring (say so in
the report): logged-in claude CLI with --transport cli and no ANTHROPIC_API_KEY
in the environment (OAuth session, subscription billing; lintro ≥0.94.7 handles
--bare detection); then ANTHROPIC_API_KEY with either transport; then
OPENAI_API_KEY with ai.provider: openai and --transport api. Each fallback
also updates the step-1 yaml's ai.provider to the matching engine (e.g.
anthropic for Claude, openai for OpenAI) and fixes or removes ai.model so
the provider never sees cursor-grok-4.5-high (removing it uses the provider
default) — then reruns uvx; the review command reads the config, not the
fallback list.
- No engine available → run the step-5 teardown first (it is mandatory whenever
step 1 ran), then STOP and report which credential/binary is missing.
Run the review against the fresh base (a stale local main reviews the wrong
diff), including lint:
base="$(git symbolic-ref --quiet --short refs/remotes/origin/HEAD 2>/dev/null | sed 's@^origin/@@' || echo main)"
git fetch --quiet origin "$base"
uvx --from 'lintro[ai]>=0.94.7' lintro review --base "origin/$base" --with-lint --transport cli --timeout 600
- Swap
--transport cli for api per the step-2 outcome. CLI-transport turns run the
whole review in one claude invocation — pass --timeout 600 (the 60s default is
API-stream-sized and will kill a CLI turn; #1900).
- Omitting
--depth/--strictness uses the project's configured review defaults.
For a heavier final pass, add --strictness thorough --depth 3 (more spend).
Triage — fix real findings; note any you dismiss and why, as you would in a
CR/Greptile thread.
Tear down the local toggle so it can never land (un-skip first, then restore):
git update-index --no-skip-worktree .lintro-config.yaml
git checkout .lintro-config.yaml
Relationship to coderabbit / greptile
Default pre-push flow runs all three where available:
commit → [greptile ‖ coderabbit ‖ lintro-review] → pr
When CR/Greptile are rate-limited, do not wait for their reset — the lintro pass
(plus whichever of the other two ran) is the pre-push review of record. Still triage any
bot threads that get posted on the PR afterward.
Notes
- Do not run the project's test suite while the step-1
ai.enabled: true toggle is
active. It leaks into config/doctor tests and fails them (a false red that looks
like a code defect). Tear the toggle down (step 5) before running any tests, or don't
run tests during a review.
- Review exit code 2 means "no review was produced" (missing credential, provider
unreachable, quota); the JSON error envelope names the kind. Since 0.94.1 the CLI's
stdout error detail is surfaced — read it before diagnosing.
- If
--transport cli fails on a flag the installed claude doesn't accept, that's live
signal for the AI CLI-transport contract tests (py-lintro #1614) — report it.
1---2name: lintro-review3description: AI branch review using lintro's own `lintro review` — a standard local pre-push pass alongside the coderabbit and greptile CLIs, and the review of record when those are rate-limited or unavailable. Use when asked for a lintro review, an interim/fallback AI review, or as part of the default pre-push review set.4---56# Lintro AI Review (standard local pass)78Run **lintro's own** AI diff review (`lintro review`) on the branch. Since 2026-08-029(owner instruction) this is a **standard third local pre-push pass** alongside10`coderabbit` and `greptile`, not just a fallback — and when those two are rate-limited11or down, the lintro pass is the AI review of record for the push.1213## When to use1415- As part of the default pre-push review set (`coderabbit` + `greptile` + this).16- CodeRabbit and/or Greptile are rate-limited, erroring, or otherwise unavailable.17- You want an AI pass on the branch diff (or working tree) right now.1819At **final merge**, bot threads that did get posted on the PR must still be triaged;20a local lintro pass doesn't resolve GitHub threads.2122## Two correctness rules (do not skip)23241. **Use released lintro via `uvx`, never `uv run lintro`.** The reviewer engine must be25 stable and independent of the working tree — especially when the branch is itself26 modifying lintro's AI/provider layer (you must not review half-migrated code with27 itself). Floor is **`>=0.94.7`**: that release carries both the CLI auth-mode28 detection (#1859, subscription OAuth works) and the CLI stdout error surfacing29 (#1836).302. **Enable AI locally behind a `skip-worktree` guard.** Many repos (incl. py-lintro)31 ship `.lintro-config.yaml` with no `ai:` block or `ai.enabled: false`. Flip it on32 locally in a way that cannot be staged or committed.3334## Steps35361. **Enable AI locally without commit risk** — only if the project config has AI37 disabled (`grep -A2 '^ai:' .lintro-config.yaml`; skip this step if already38 `enabled: true` / `review: true`):3940 ```bash41 git update-index --skip-worktree .lintro-config.yaml42 ```4344 Then merge this `ai:` mapping into `.lintro-config.yaml` (append/merge the block —45 the rest of the project config stays as-is, so `--with-lint` keeps working):4647 ```yaml48 ai:49 enabled: true50 review: true51 provider: cursor52 model: cursor-grok-4.5-high53 ```54552. **Preflight the engine — Cursor + Grok 4.5 is the standard reviewer (owner56 instruction, 2026-08-11):**57 - **Provider is `cursor`, model is `cursor-grok-4.5-high`** (Cursor's Grok 4.5 id —58 confirm with `cursor-agent models` if it errors), via `--transport cli`. Verify the59 CLI exists with `cursor-agent --version`.60 - **Workspace trust is required once per directory**, or lintro's invocation dies61 with "Workspace Trust Required". Grant it non-interactively from the repo/worktree62 root: `cursor-agent -p 'Reply with exactly: ok' --trust --model cursor-grok-4.5-high63 --output-format text` — trust persists for subsequent runs.64 - **Fallbacks, in order, only when `cursor-agent` is missing or erroring** (say so in65 the report): logged-in `claude` CLI with `--transport cli` and no `ANTHROPIC_API_KEY`66 in the environment (OAuth session, subscription billing; lintro ≥0.94.7 handles67 `--bare` detection); then `ANTHROPIC_API_KEY` with either transport; then68 `OPENAI_API_KEY` with `ai.provider: openai` and `--transport api`. Each fallback69 also updates the step-1 yaml's `ai.provider` to the matching engine (e.g.70 `anthropic` for Claude, `openai` for OpenAI) and fixes or removes `ai.model` so71 the provider never sees `cursor-grok-4.5-high` (removing it uses the provider72 default) — then reruns `uvx`; the review command reads the config, not the73 fallback list.74 - **No engine available** → run the step-5 teardown first (it is mandatory whenever75 step 1 ran), then STOP and report which credential/binary is missing.76773. **Run the review** against the *fresh* base (a stale local `main` reviews the wrong78 diff), including lint:7980 ```bash81 base="$(git symbolic-ref --quiet --short refs/remotes/origin/HEAD 2>/dev/null | sed 's@^origin/@@' || echo main)"82 git fetch --quiet origin "$base"83 uvx --from 'lintro[ai]>=0.94.7' lintro review --base "origin/$base" --with-lint --transport cli --timeout 60084 ```8586 - Swap `--transport cli` for `api` per the step-2 outcome. CLI-transport turns run the87 whole review in one `claude` invocation — pass `--timeout 600` (the 60s default is88 API-stream-sized and will kill a CLI turn; #1900).89 - Omitting `--depth`/`--strictness` uses the project's configured review defaults.90 For a heavier final pass, add `--strictness thorough --depth 3` (more spend).91924. **Triage** — fix real findings; note any you dismiss and why, as you would in a93 CR/Greptile thread.94955. **Tear down** the local toggle so it can never land (un-skip **first**, then restore):9697 ```bash98 git update-index --no-skip-worktree .lintro-config.yaml99 git checkout .lintro-config.yaml100 ```101102## Relationship to coderabbit / greptile103104Default pre-push flow runs all three where available:105106```text107commit → [greptile ‖ coderabbit ‖ lintro-review] → pr108```109110When CR/Greptile are rate-limited, do **not** wait for their reset — the lintro pass111(plus whichever of the other two ran) is the pre-push review of record. Still triage any112bot threads that get posted on the PR afterward.113114## Notes115116- **Do not run the project's test suite while the step-1 `ai.enabled: true` toggle is117 active.** It leaks into config/doctor tests and fails them (a false red that looks118 like a code defect). Tear the toggle down (step 5) before running any tests, or don't119 run tests during a review.120- Review exit code 2 means "no review was produced" (missing credential, provider121 unreachable, quota); the JSON error envelope names the kind. Since 0.94.1 the CLI's122 stdout error detail is surfaced — read it before diagnosing.123- If `--transport cli` fails on a flag the installed `claude` doesn't accept, that's live124 signal for the AI CLI-transport contract tests (py-lintro #1614) — report it.