Login
View Ticket
Login
Ticket Hash: 79609c8d36b9dcccee9788d1b860d160c637e965
Title: Localized file review: highlight a range in a tracked file and attach an anchored comment (human + agent)
Status: Active Type: feature
Severity: Normal Priority: medium
Subsystem: ui Resolution:
Last Modified: 2026-09-20 14:43:17
51.7 days ago
Created: 2026-07-07 00:08:59
127.3 days ago
Version Found In:
Description:
Requested capability: open a TRACKED FILE in the web UI and leave LOCALIZED review feedback — select/highlight a line or character range and attach a comment anchored to that span. Like GitHub PR inline comments or a document markup/annotation layer. The existing "Repo review" (render_repo_review) is a repo-LEVEL dashboard (status/timeline/unversioned/tasks/freshness) — it has no file-level inline annotation. This is a new feature.

Use cases: - Human reviews an agent-produced change or doc and drops precise feedback ("this line is wrong") instead of prose in a forum thread. - Docs-freshness: highlight a stale paragraph + comment (ties to ticket 5667eb44). - A session/agent READS localized comments as targeted instructions (fix the highlighted span) and can WRITE review comments back.

Design points to settle: - Anchor: file path + revision (blob UUID or check-in) + range (line span and/or char offset). Anchor to the blob UUID so a comment stays valid as other parts change; when the underlying text moves/changes, RE-ANCHOR or flag the comment OUTDATED (GitHub-style), never silently mis-point. - Storage: Fossil-native (state belongs in the repo DB) — a per-repo review table or forum-backed thread with structured metadata (file+rev+range+author+body+resolved). No external service. - UI: render the file (with syntax/markdown), select a range to open a comment box, show existing comments inline + in a side list; resolve/reply. Reachable from Repo review and from a file/diff view. - Roles: humans and agent sessions both create/read; comments are addressable so a session can be told "address review comment <id>". - CONSTRAINT: no inline <script> (CSP script-src self) — all highlight/selection/comment JS must live in the chat.js asset (see csp-no-inline-scripts).

Enforceable acceptance: - Open a tracked file at a revision; select a range; save a comment; it persists across reload and lists in a review view with author + range + timestamp. - Changing the file re-anchors the comment or marks it outdated (never mis-points to unrelated text). - An agent session can enumerate localized comments for a file and act on a specific one; can post one back. - Fossil-native storage; CSP-compliant (JS in chat.js, zero inline script).

Relates to: Repo review (extend it), docs-freshness audit (5667eb44), the session dev/review loop.

User Comments:
added on 2026-07-07 23:47:27:
SCOPE REFINED: range-anchored review comments. Select a line range in the repo file view and attach a comment anchored to (artifact uuid, start-end lines) — anchoring to the immutable artifact means it survives later commits; the UI notes when the file has newer versions. Storage: one technote (or ticket comment) per review note with a structured header. Render: highlight + margin marker in the file view, plus a per-file and per-project review list. Agents get a post_review_note tool so session reviews land in the same surface humans use. Sequence after M2 UI units drain.