Skip to content

feat(review): add plannotator-tui-review, the data side of code review - #150

Merged
backnotprop merged 2 commits into
mainfrom
feat/review-crate
Nov 15, 2026
Merged

backnotprop merged 2 commits into
mainfrom
feat/review-crate

Conversation

@backnotprop

Copy link
Copy Markdown
Contributor

Adds crates/plannotator-tui-review, a library with the data side of code review: everything except the screen. The app doesn't use it yet; the review screen comes in a follow-up PR. It has no dependency on diffs-rs, ratatui or the binary.

What it does:

  • Capture: runs git for four scopes (uncommitted, staged, branch since its merge base, one commit) with fixed flags, so a user's diff settings can't change the patch. Untracked files are included through a temporary index copy (GIT_INDEX_FILE); the real .git/index is never written. Patches over 8 MiB are refused with a message.
  • Notes: CodeAnnotation uses the browser's field names, plus an optional author for notes from Pi. Our own fields sit under one plannotator_tui key.
  • Keeping notes on their lines: after the agent edits, each note is "still there", "moved" (only when exactly one place matches its text and context), "not in the diff", or "outdated". Nothing is dropped.
  • Storage: <data dir>/clients/plannotator-tui/reviews/<project>/<scope>-<8hex>/review.json, rewritten atomically.
  • Export: the browser's exportReviewFeedback text, plus the highlighted lines (up to 40), so the agent sees deleted lines too.

Tests: 53. The export tests compare against output from running Plannotator's own export code on the same notes. The git tests use real temporary repos and skip with a message if git is missing.

Not done here: wiring into the binary, the review screen, the Herdr launcher, and adding the crate to the publish lists.

Scope capture from git (temporary index for untracked files, 8 MiB guard,
uncommitted-to-branch fallback), the browser's CodeAnnotation record,
pure re-anchoring (still there / moved / not in the diff / outdated),
review.json storage with sends and archiving, and the agent feedback in
the browser's exportReviewFeedback format.
@backnotprop
backnotprop added this pull request to the merge queue Nov 15, 2026
Merged via the queue into main with commit 904d5b1 Nov 15, 2026
3 checks passed
@backnotprop
backnotprop deleted the feat/review-crate branch November 15, 2026 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant