Comment on the sentence, then send the link
← All posts

Comment on the sentence, then send the link


A comment on a whole document is a second chat. A note such as “The pricing section is vague” forces the next reviewer to search for the intended sentence, and once they find it the section has been rewritten and the comment refers to nothing. The difficult problem is not leaving a comment. Rather, it is ensuring that the comment remains attached to the correct words after the document changes underneath it.

The sentence

Consider the diagram from the previous post. One sentence in it is the one a reviewer should answer.

The agent holds one MCP URL.

That is the whole claim. Highlighting it and leaving the note keeps the thread on these words when the surrounding boxes change.

The agent stack, with the sentence the review is about

What an anchor actually is

ShareCube stores two values for each thread, namely the quoted text and its character range in the body. The quote is the identity of the comment, and the range is a hint for finding it rapidly. Over MCP, the same operation is create_comment with an anchor. Here start and end are offsets into the current body, and if the quote appears more than once, occurrenceIndex determines which occurrence is meant.

{
  "body": "This is the line I would send a reviewer. The comment should stay on this sentence when the diagram around it changes.",
  "anchor": {
    "quote": "The agent holds one MCP URL.",
    "start": 5897,
    "end": 5925,
    "occurrenceIndex": 0
  }
}

We published that diagram to a ShareCube project and placed this exact thread on that sentence. The offsets in our request differed from the stored body. The server then corrected them to the stored text and kept the quote. This is the reason for storing the quote and not only the range (the words are the truth, and the numbers are a cache).

The review sentence, with the thread open beside the diagram

Mentions use a person id rather than a display name ([@Name](mention://user/…)). Unresolved @text is plain text, and it triggers no notification. This behaviour is by design. A mention is a notification, and a notification should not be triggered because a string happens to resemble a name.

Orphaned is a signal, not a failure

A thread is open, resolved, or orphaned. Orphaned means that the quote no longer matches the body. Most tools handle this case by either deleting the comment or silently reattaching it to any text currently at that offset, and both approaches lose information. The first discards the review. The second attaches “this claim is wrong” to a sentence in which nobody made a claim.

ShareCube keeps the thread and marks it. An orphaned comment records that the words a reviewer commented on were edited, which is precisely the edit to inspect. Resolve it when the wording is fixed, and reopen it if it was not.

The same logic also applies in the other direction. Each content save creates a new version, and when an agent updates a document it passes the version id it read. If a human saved in between, the write is refused instead of overwriting the human’s edit. The agent then reloads, re-applies the change, and saves. The comment anchors survive the version. Additionally, version history can restore a previous body, which writes a new current version rather than deleting the ones after it.

Who can do what

The roles are the standard four (Viewer, Commenter, Editor, Owner). Viewers read threads, Commenters write them, and Editors publish and can moderate the threads of other users. A public share link can still be view-only, and an admin can cap how public the org is allowed to be. Comments only work in Preview, because Source is for editing and a highlight in raw markdown is not a stable anchor.

Agents have the same surface over MCP (list_comments, create_comment, resolve_comment). The useful case is an agent that publishes a document and then leaves review notes on the sentences it is least certain of. Thus, the human opens the link and starts at the correct place.

The handoff

The agent returns console_url after it publishes. The reviewer comments on the sentence, resolves the thread, and sends share_url once the visibility is as intended. Access, however, follows that setting, that is, a share path does not bypass a private artifact.

That is the loop we wanted in June. The file leaves the chat, the comment stays on the words, and the link is all that a stranger needs.


Comment anchors, mentions, and resolve are covered in the ShareCube guide.