Skip to content
Toolkit

ADR-0110: A comment targets a link row, and an outsider is answered with absence

Status: Accepted · Date: 2026-08-30 · Track: 006 phase 04

Context

Comments are the first thing this track stores. Presence is ephemeral by construction (ADR-0107) and the live canvas carries no payload at all (ADR-0108); a comment is a document in its own right, so it gets a table — and a table raises questions the two event surfaces never had to answer.

  1. What does a comment attach to? The charter says "a resource", and this product has six public ones (008) plus blocks inside a biolink.
  2. What does a member of another workspace see? Every other route in this tree answers 404 for a resource outside the caller's workspace, but nothing had written that down as a rule with a reason.
  3. Who may delete one? The role matrix (ADR-0006) gates DELETE on a workspace resource to admin and owner, by URL prefix.
  4. Where do notifications go? The charter's answer is "the existing path", and the failure mode is a second notification system growing beside the first because it was easier than reaching the first.

Decision

1. A comment targets a links row, not a (resource_type, resource_id) pair. links already holds every public resource this product serves and already carries workspace_id, so the target and the tenant are one fetch and one foreign key. A type-tagged pair would need validating against a registry on every write, and a mistyped type would address nothing, silently. Blocks are a second column on the same table when the slice that renders them lands — not a second addressing scheme.

workspace_id is denormalised onto the comment anyway, and both it and link_id are taken from the link the handler fetched and proved, never from the request body. A row whose workspace disagrees with its link's is the one state this table must not be able to reach.

2. Threading is one level, enforced in the database. A comment starts a thread or replies to one that does; a trigger refuses anything deeper. The handler checks the same thing first so the refusal is a 4xx with a sentence rather than a database exception surfacing as a 500 — and it checks something the trigger cannot: that the parent is on this resource, in this workspace, which is a tenancy question rather than a depth one.

3. An outsider is answered with absence — 404, never 403 — on every route. 403 is an answer. It says the thing exists and you may not have it, which turns any endpoint taking a numeric id into a membership oracle: iterate the ids, read the statuses, learn the shape of somebody else's workspace. Absence is the only reply that discloses nothing, and it is the same reply an id that never existed gets.

The one deliberate exception is inside the workspace: a member who tries to delete another member's comment gets 403. They are already reading that comment in the list, so hiding it now would hide nothing and only confuse. The absence rule protects a tenant boundary; it is not a house style for every refusal.

4. DELETE is gated in the handler, and comments is deliberately absent from deleteGatedPrefixes. The matrix's blanket rule would stop a member deleting their own comment, which is the one deletion every commenter expects to have. The rule here is narrower and needs to see the author: your own comment, or anyone's if you are admin or owner.

5. Notifications go out through CreateBatch — the same call the admin broadcast makes — to every member but the author, with the comment's own text as the description. A notification that paraphrases loses the only thing it carries; it is clipped by runes rather than bytes, because half a character is not a shorter string.

6. comments is closed to API-token principals (deny-by-default in scopeByPrefix, recorded there). A comment is signed: it stores a user_id, renders a member's name, and notifies the workspace. A token is a credential one member minted, not a member — and a thread of remarks attributed to someone who did not write them is a worse failure than a missing integration.

Consequences

  • The event is comment.changed on the workspace channel, carrying no comment and an origin — presence's and the canvas's shape, third time, which is now this track's settled form for a workspace surface.
  • Names are resolved through the workspace roster in SQL (a LEFT JOIN on workspace_members), so ADR-0109's disclosure rule is inherited by construction rather than restated: an author who has left renders unnamed.
  • Whether comments are plan-gated stays charter Blocker 4, an owner decision. The surface ships ungated around it; a capability key added later gates the write path without moving anything here.
  • Comment resolution, mentions and approval chains stay out of scope (charter): this is threads, not a review system.

Source: docs/decisions/0110-a-comment-targets-a-link-row-and-an-outsider-is-answered-with-absence.md

Library