Repository navigation
feat(review): restore the review foundation that grounded /review builds on - #2297
Conversation
will-lamerton
left a comment
There was a problem hiding this comment.
Thanks @puri-adityakumar. I diffed every restored file against the versions #2032 removed (dfcea49e^): 9 of 12 are byte-identical, so "restored unchanged" holds. The one real change, copyIndexKeepingTime in review-snapshot.ts, is correct. Keeping the real index's mtime on the scratch copy means Git still re-hashes files edited in the same second the index was written, and removing a partial copy on failure safely falls back to an empty index. The new resolver test covers it. The knip.json ignores are temporary and #2298 removes them.
Two notes for the stack, not for this PR:
|
Hey @will-lamerton, quick question on the base branch: |
…CLI (#2417) * feat(review): restore the review foundation that grounded /review builds on (#2297) * feat(review): restore the review foundation * fix(review): catch same-second worktree edits in review snapshots * feat(review): ground /review findings in the code and verify each one (#2298) * feat(review): restore the review foundation * fix(review): catch same-second worktree edits in review snapshots * feat(review): make grounded review the default /review * fix(review): show incomplete reviews as incomplete in the activity line * refactor(review): run review agents on the shared turn engine * fix(review): keep offered text tool calls beside quoted markup and bound unknown context sizes --------- Co-authored-by: akramcodez <[email protected]> * feat(review): add /review deep so one finder's blind spots don't go unreviewed (#2299) * feat(review): restore the review foundation * fix(review): catch same-second worktree edits in review snapshots * feat(review): make grounded review the default /review * fix(review): show incomplete reviews as incomplete in the activity line * feat(review): add /review deep with specialist finders * refactor(review): run review agents on the shared turn engine * fix(review): keep offered text tool calls beside quoted markup and bound unknown context sizes * fix(review): share the diff size limit so deep review and the verifier bound unknown context sizes --------- Co-authored-by: akramcodez <[email protected]> * feat(review): let nanocoder review run in CI and pipes without a terminal (#2300) * feat(review): restore the review foundation * fix(review): catch same-second worktree edits in review snapshots * feat(review): make grounded review the default /review * fix(review): show incomplete reviews as incomplete in the activity line * feat(review): add /review deep with specialist finders * feat(review): run nanocoder review without a terminal * refactor(review): run review agents on the shared turn engine * fix(review): keep offered text tool calls beside quoted markup and bound unknown context sizes * fix(review): share the diff size limit so deep review and the verifier bound unknown context sizes * fix(review): keep the cancelled report and exit code when a headless review is interrupted --------- Co-authored-by: akramcodez <[email protected]> * fix(review): align review specs and docs with main after merge * fix(review): strip ANSI in review specs so they pass with color forced on * fix(review): stop headless quick review passing on empty or partial output --------- Co-authored-by: Aditya Kumar Puri <[email protected]>
Description
Part 1 of 4 for #1287. Targets
feat/1287-grounded-review, as agreed in the issue. Merge order: this PR, then grounded, deep and headless.Problem.
/reviewtoday hands the model a diff in one shot, and nothing checks that what it reports is real. Grounded review (#1287) needs a fixed, read-only view of exactly what is being reviewed before any model call. That groundwork landed in #1768, but #2032 removed it because nothing was using it yet.What this PR does. It brings that foundation back, unchanged except for one bug fix, so the next PR can wire it into
/review./reviewitself behaves exactly as before.source/review/review-request.tsreads what the user asked for: a branch, a PR, recent commits or the working tree.source/review/review-resolver.tsturns that into exact commits before any model call, and asks when the request is unclear.source/review/review-snapshot.tsreads the changed files from Git objects. Working-tree reviews go through a scratch index andgit write-tree, so the real index and files are never touched. PR and remote refs are fetched into one fixed ref per source underrefs/nanocoder/review/and removed afterwards.source/review/review-activity.tsandsource/components/review-activity.tsxrecord each Git,ghand model step (with secrets redacted) for the live view in the next PR.knip.jsonignores these files for now, since only their specs use them. The grounded PR removes those ignores.Bug fix. A working-tree review could miss an edit when the file kept its size and was saved in the same second as the last Git index write. The scratch index was a plain copy with a fresh modified time, so Git trusted its stale file info and skipped the change. The copy now keeps the real index's modified time, so Git re-checks those files. A new test pins all the timestamps to reproduce it; it fails without the fix and passes with it. This also fixed a flaky headless review test in part 4.
Type of Change
Changeset
pnpm changeset) describing this change for the changelogNo changeset here: nothing user-facing changes until the grounded PR, which carries the changeset.
Testing
Automated Tests
.spec.ts/tsxfilespnpm test:allcompletes successfully)Run on macOS, Node 22:
test:format,test:lint,test:types,test:knip,build: pass.test:ava: 11,342 pass, 38 fail. The same 38 fail on plainfeat/1287-grounded-reviewin the same setup, so none come from this PR: 34 incli-value-flags.cli-integration(a React duplicate-key error), 2--acptrust checks that need a trusted checkout, and 2 auto-commit tests.Manual Testing
GMI Cloud (
zai-org/GLM-5.3-Flash) on a small fixture repo:/reviewworks as before.Checklist
No docs change, because there is no user-facing change yet. Logging: each review step is recorded in the review activity store instead of the app log.
Part of #1287.