# Review rounds: persistence, delta view, resolved status, note replies

Review is not one-shot: the user reviews, the agent addresses comments, and the user re-reviews. This ADR adds the state and semantics that make that loop work, across sessions.

- **On-disk state.** User comments and the last-reviewed HEAD persist to `<gitdir>/code-eye/state.json` (`review-state.ts`). This un-defers the disk persistence ADR-0004 postponed; the store lives inside the git dir so it never pollutes the working tree and is worktree-safe. The pi extension seeds its session `CommentStore` from disk on first open; the MCP server reseeds on every tool call. Saves are best-effort and must not break review close. Persisted comments whose commit no longer exists (rebase/amend) are pruned on load (`pruneComments`); working-tree comments always survive.
- **"Δ since last review" item.** When `lastReviewedHead` exists and `git diff <sha>` is non-empty, the first review item becomes a delta of the working tree against that commit (`CommitEntry.since`), replacing the plain "Uncommitted changes" entry (the delta is a superset of it, and two `sha: null` items would collide as comment anchors). It covers both new commits and uncommitted edits in one view. An invalid `since` (rebased away) silently falls back to the normal list.
- **Resolved status.** User comments carry `status: "open" | "resolved"` (default open). Resolved comments persist and render dimmed, but `formatCommentsForAgent` excludes them — refining ADR-0002: only *open* user comments re-trigger the agent. A comment whose line still resolves but changed text stays inline with a `line changed` hint. A comment whose anchor is gone, or whose parent agent note disappeared, moves to the web surface's **Unresolved conversations** section with its original file, line, and captured code. Open and resolved detached comments stay visible there so the user can resolve or reopen them; agent edits never silently resolve human feedback.
- **Replies to agent notes.** User comments may carry `replyTo` (an agent note id) and `kind: "question" | "adopt"`. `replyTo` is part of the comment key, so a reply never collides with a line comment on the same line. Replies are user comments, so they flow back to the agent through the unchanged ADR-0002 channel — this is how the user asks questions about a note or asks the agent to apply its suggestion.
- **Suggestions stay read-only.** Walkthrough stops may carry `suggestion` (replacement code) and `severity` (high/medium/low). Suggestions are display-only in the review UI; adopting one creates a `kind: "adopt"` reply containing the code, and the agent applies it itself. The review tool never writes to the working tree (explicit product decision).
- **Stale notes.** Agent notes whose anchor no longer resolves against the current diff render greyed ("code changed") and drop out of note navigation, on both surfaces.

Rejected: applying suggestions directly from the review UI (violates the read-only review surface; the agent has better context to apply its own fix); per-comment threading beyond one reply level (replies flat under the note is enough for the review loop).
