Question
What is the Convex schema for annotations and their comment threads?
Settled going in: annotations are a discriminated union on kind (correction / link / note / article-level comment) over a shared base that always includes an anchor and an author. Placement is derived, never stored as a kind — an annotation renders inline iff it is promoted and re-anchored successfully; otherwise marginal. Note can never go inline because there is nothing to apply. Promotion to inline requires an elevated Discord role. Corrections render in place with visible community-edit styling. Comments attach to annotations and update live; resolved threads hide by default.
Decide:
- The shared base vs the per-kind payload. A correction carries structured replacement text the renderer applies; a link carries URL plus label; a note carries prose. What else is genuinely common beyond anchor and author?
- How the article-level comment kind fits a union whose base assumes an anchor — is its anchor nullable, is it a separate table, or does it anchor to the article root?
- Promotion state — who promoted, when, is it revocable, does it survive a re-anchor failure and re-attach if a later revision matches again?
- Anchor result storage. Is the resolved anchor for the current revision cached on the annotation, or recomputed on read? This is a cache-invalidation decision and it interacts with the rendering ticket, since inline annotations are baked into the static shell.
- Which revision an annotation is written against, and how detached annotations permalink back to it.
- Comment threads — nested or flat, resolution state, who can resolve, what "hidden by default" means for the query and for the cached render.
- Edit and delete semantics, and what happens to a thread when its parent annotation is deleted.
- Indexes for the queries the rendering ticket will need: all annotations for an article revision, all by an author, all detached.
Blocked on the article schema and the anchor model. Use /domain-modeling.
Question
What is the Convex schema for annotations and their comment threads?
Settled going in: annotations are a discriminated union on kind (correction / link / note / article-level comment) over a shared base that always includes an anchor and an author. Placement is derived, never stored as a kind — an annotation renders inline iff it is promoted and re-anchored successfully; otherwise marginal.
Notecan never go inline because there is nothing to apply. Promotion to inline requires an elevated Discord role. Corrections render in place with visible community-edit styling. Comments attach to annotations and update live; resolved threads hide by default.Decide:
Blocked on the article schema and the anchor model. Use
/domain-modeling.