Skip to content

Agentic /review: ground findings against the codebase (tier 2) #1287

Done

Description

@will-lamerton

Follow-up to #1002 and #1099.

#1099 lands /review as a deliberate v1: one client.chat() over a diff, empty tool registry, no file reads. That caps review quality. The system prompt asks the model not to hallucinate issues, but gives it no way to check a finding against the surrounding code.

This issue covers the next tier: a review that can ground its findings.

Shape to settle here:

  • Default /review becomes a find-then-verify loop with a read-only tool profile (git_diff, git_log, read_file, search_file_contents, lsp_get_diagnostics) and a tool-call budget.
  • The current one-shot stays available as /review quick or equivalent.
  • Optional /review deep fans out finder subagents plus an independent per-finding verification pass.
  • Mandatory file:line citation per finding, with a confidence threshold that drops what cannot be verified.

@puri-adityakumar proposed this in detail in #1002 (comment) and wants to work on it. @soumojit-D48 owns #1099. Please coordinate here rather than in the PR so #1099 can land as v1.

Also worth covering: nanocoder review is currently TTY-only, so CLI output cannot be redirected to a file. Teaching the plain shell to dispatch built-in commands would fix that and is a reasonable thing to fold into this work.

Activity

  1. added
    enhancement
    architecture
    area:providers
    on Sep 13, 2026
  2. puri-adityakumar commented on Sep 16, 2026

    @puri-adityakumar
    Contributor

    Hi @will-lamerton, thank you for this. A few questions before I start:

    1. Could you assign Agentic /review: ground findings against the codebase (tier 2) #1287 to me so ownership is official?
    2. OK to ship as 3 stacked PRs (below)?
    3. Is plain-shell dispatch in scope for the first PR, or its own PR? It touches source/plain/shell.ts, which is core plumbing rather than review code, so happy to isolate either way.
    4. Confirming: verifiers can run a cheaper model than finders via the per-subagent model override (reviewModel knob)?

    Plan:

    • Phase 0: spike: prove SubagentExecutor + read-only tool whitelist reviews a real diff productively (done, all checks passed)
    • Phase 1 → PR 1 (default tier): extract resolveReviewTarget() from feat: add /review slash command and nanocoder review CLI command #1099 (v1 behavior unchanged), review-finder + review-verifier subagents with read-only tools + tool-call budget, independent verifier per finding (CONFIRM / REJECT / INSUFFICIENT), tier dispatch (/review → default, /review quick → v1 one-shot), mandatory file:line citations, tests + changeset
    • Phase 2 → PR 2 (deep tier, on PR 1): three isolated finders (bugs / standards / spec), verifier fan-out, dedupe + sectioned report, /review deep, tests + changeset
    • Phase 3 → PR 3 (output + CLI, mostly independent): --output-format json + plain-shell dispatch so nanocoder review > file.md works, tests + changeset

    Benchmark results (catch rate, false positives, citation validity, token cost) will be posted here once the default tier runs.

    Since #1099 hasn't landed yet, PR 1 starts on my fork and rebases onto v1 when it merges. Nothing in the one-shot path or parseReviewCliArgs gets touched.

    @soumojit-D48, would you like to stay involved in this work once #1099 lands, or is handing it over fine? Either works for me.

  3. puri-adityakumar commented on Sep 24, 2026

    @puri-adityakumar
    Contributor

    I tested the current implementation in the TUI and found a few gaps before opening the replacement PR stack:

    • /review quick 1467 fails to fetch an upstream PR when origin points to my fork. A PR URL is not currently understood as a PR target.
    • Quick is intentionally a one-shot, diff-only review. I want to preserve that behavior, while fixing target resolution and clearly showing the reviewed scope and any diff truncation.
    • Default /review runs a finder/verifier pipeline, but the TUI does not show which agent is running or its tool/API calls. When an investigation hits its budget, the result can still look like a clean review. That should be labeled incomplete, not “no issues found.”
    • The review result’s raw Markdown styling also differs from normal chat output.

    On main, /review reports no branch changes, then prints fatal: Needed a single revision.

    Review on main shows no changes followed by a git revision error

    On the feature branch, the finder hits its turn budget after a truncated diff, but the report says “No verified issues found” and displays raw Markdown beside normally rendered chat.

    Grounded review reports no verified issues after budget exhaustion and renders raw Markdown
  4. puri-adityakumar commented on Sep 24, 2026

    @puri-adityakumar
    Contributor

    Following up on the proposed replacement stack above, here is what I intend each PR to contain. I’d appreciate feedback on the boundaries before opening them.

    • Q — Quick fixes: Correct fork/upstream PR lookup, support explicit PR URLs, reject ambiguous or extra target text, and show the resolved scope and truncation. Quick remains one-shot: no finder, verifier, or tool calls.
    • 1 — Foundation: Give default/deep a read-only coordinator for natural requests, remote branches, and PR URLs. Validate and pin the target before review. Add compact live progress that can expand into agent, tool-call, and API-call details.
    • 2 — Grounded default: Bring the finder → citation validation → independent verifier flow onto that foundation. Show incomplete or failed investigations honestly and render the result consistently with the TUI.
    • 3 — Deep: Add the specialist finders and deduplication, reusing the same target, verification, and activity infrastructure.
    • 4 — Headless: Support non-TTY review with final text/JSON on stdout and progress on stderr.

    The branches would be stacked Q → 1 → 2 → 3 → 4, with each PR initially based on the preceding branch. They would merge into upstream main in that order, retargeting the next PR to main after each merge. The existing feat/1287-grounded-review branch remains a reference; I’ll move relevant work selectively rather than merge it wholesale.

  5. added
    area:agent
    area:cli
    and removed
    area:providers
    on Oct 7, 2026
  6. puri-adityakumar commented on Nov 17, 2026

    @puri-adityakumar
    Contributor

    Where this stands

    The /review stack for this issue was planned as 5 PRs: Q → Foundation → Grounded default → Deep → Headless (plan).

    Next steps

    @akramcodez, could you assign this issue to me first? After that, which approach would you prefer:

    1. One larger PR to main that brings back the Foundation along with the remaining stages, or
    2. A feature branch you create, where the remaining stages land one by one and then merge into main together?

    Status

    The implementation and testing for all remaining stages are already done on my side. Once we've decided on the approach, I just need to put it together in that shape, and then it's ready for review and merge.

  7. akramcodez commented on Nov 19, 2026

    @akramcodez
    Member

    Thanks @puri-adityakumar, you're assigned. Please go with the feature branch approach: I'll create feat/1287-grounded-review on the main repo. Open each stage (Foundation, Grounded default, Deep, Headless) as its own PR against that branch so they can be reviewed in small pieces, and we merge the branch into main once all of them are in and tested together.

  8. puri-adityakumar commented on Nov 19, 2026

    @puri-adityakumar
    Contributor

    Hey @akramcodez, all four PRs are up against feat/1287-grounded-review:

    1. feat(review): restore the review foundation that grounded /review builds on #2297 Foundation
    2. feat(review): ground /review findings in the code and verify each one #2298 Grounded
    3. feat(review): add /review deep so one finder's blind spots don't go unreviewed #2299 Deep
    4. feat(review): let nanocoder review run in CI and pipes without a terminal #2300 Headless

    One thing first: the branch is 16 commits behind main. Could you rebase it on main? Once that's done, I'll update the four PRs and rerun the checks.

    Please merge in the order above, since each PR builds on the one before. Once all four are in, the branch can go into main.

    Does that work for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

architecturearea:agentarea:clienhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions