Expand description
Durable local-review wire types.
A review thread is a comment anchored to a diff line in the /diff
overlay, persisted per (project, branch) so it survives overlay
close and forge restarts. Pure data shapes; the redb persistence
lives in forge-workspace::store::review and the re-anchoring in
forge-agent::env::git_diff.
Re-exports§
use serde::Deserialize;🔒use serde::Deserialize;🔒use serde::Serialize;🔒use serde::Serialize;🔒use crate::session_slot::SessionSlot;🔒
Structs§
- Review
Anchor - Durable, drift-robust location of a review thread, re-resolved to a
positional index against a fresh diff scan on every overlay open;
content_hash+contextlet the resolver re-anchor a moved line or flag itOutdated. - Review
Comment - One comment in a thread;
atis an rfc3339 timestamp.review_idis theReviewSetthat sealed this turn (None= not yet filed);#[serde(default)]loads turns stored before membership moved onto them. Only user turns are ever filed - an agent reply answers a round rather than forming one. - Review
Set - A submitted review: the sealed grouping of the comments filed under
one pass, plus an optional overview. Persisted per
(project, branch).numberis the human-facing 1-based sequence (R1,R2, …) minted as the branch’s review count + 1;idis the stable key turns carry inReviewComment::review_id.created_atis rfc3339. - Review
Thread - A persisted review thread: an anchor plus its comment chain and
lifecycle state;
created_at/updated_atare rfc3339.commitis the sha the thread was authored under (None= whole-diff scope);#[serde(default)]loads pre-scope threads as whole-diff. Review membership lives per-turn onReviewComment::review_id, so one thread can span several rounds of a conversation.
Enums§
- Review
Author - Who wrote a review comment.
- Review
Side - Which side of the diff the anchored line sits on.
- Review
Status - Lifecycle state of a review thread. A worker reply flips
Open->Addressed; only the user everResolveds;Outdatedmarks a thread whose anchored line drifted out from under it.
Constants§
- DOC_
SCOPE_ PREFIX - A doc-scoped thread’s scope:
base_refis this prefix plus the document’s resolved absolute path, so the scope key a thread set is stored under IS the document. - TREE_
SCOPE_ PREFIX - A tree scope’s scope prefix: a seat’s own tree as the scope key, so the files page’s comments follow the SEAT (a worker’s worktree, the lead’s checkout) rather than any branch the tree happens to be on.
Functions§
- doc_
scope_ path - The document’s resolved path a doc scope ref carries, or
Nonefor a branch scope. - doc_
scope_ ref - The scope ref a document’s threads are stored under.
- is_
doc_ scope - Whether a scope ref spells a document rather than a branch. The one predicate: the readers that place threads against a diff and the branch sweep all ask this, so a doc scope is skipped in exactly one place. It takes the ref string, not the anchor, because the sweep has only the stored scope in hand.
- is_
tree_ scope - Whether a scope ref spells a seat’s tree rather than a branch. The one predicate, like its doc-scope sibling: the branch sweep and any reader that must skip tree scopes all ask this.
- tree_
scope_ ref - The scope ref a seat’s tree’s threads are stored under. Built from the
slot’s accessors, never from
display(): that string is for reading, not for parsing or keying. - u64_
from_ 🔒number_ or_ string - Accept a u64 as a JSON number or as its decimal string; anything else is refused rather than rounded.