Replies

A reply is a comment on an article, published in the replier's own feed. This article says what makes an entry a reply, how relays find the replies to an article, how clients merge and show them, and how the reference's reader, window and commands do it. NETWORK.md 4.2 ("Replies") and 4.10 are the rules; the user guide's "Reply to an article" is the short version.

The entry

An article entry (kind 1) whose reply-to (bytes 76 to 107) is not all zeros is a reply to the article whose blob ID that is. The reply-to names the exact text answered, the blob, not an entry: whichever feed published it, and whatever that feed publishes later. Two entries of the same text, in one feed or in two, share their replies.

A reply is otherwise an ordinary article, and may itself be replied to, so replies form threads. The reply-to is valid whatever it holds: an entry is not invalid because nobody holds an entry for that blob, or because the blob is not an article. Only kind 1 is a reply: an attachment's reply-to (kind 5) names the article it is part of.

The field has been in every entry since the first revision and is signed like the rest, so nothing changes in the layout or the verification. Relays and clients of earlier revisions store, pass on and verify a reply like any article entry, and a reader that does not know replies shows it as an ordinary article of the replier's feed.

Relays: the reply index

A relay indexes each article entry with a non-zero reply-to under its reply-to, as it stores the entry, from a client or a peer. Replies come from any feed (no listed profile is needed), and the article answered need not be held.

The Replies message

MessageDirectionLayout
Repliesclient to relay0Ah, req (4), target (32), c (1), cursor (c bytes)
Replies replyrelay to client8Ah, req, status (1), count (1), then per result: length (2), entry; then c (1), cursor

The target is the article's blob ID. Results are complete entries with their signatures, in the order the relay stored them, oldest first, at most 16 a page. Pages and cursors are exactly as for a find ("Profiles, names and search", Search): c 0 asks for the first page; a reply that does not end the list carries the relay's own cursor (1 to 64 bytes), sent back unchanged only to that relay; a cursor it cannot continue from (malformed, for another target, or its last result has left the index) is refused (status 3, count 0), and the client starts again. Replies stored after a page come in a later page.

An all-zero target is refused (status 3, count 0). A Replies the relay carries out has status 1, count 0 when it holds none; status 2 is not used. A relay of an earlier revision ignores the message, as any unknown type: a client counts a relay that has not answered in its usual time as one that answered nothing, and does not report it as failed.

Clients

A client asks all its connected relays and merges as for a find of articles (scope 2): it verifies every entry and drops invalid ones, ones that are not article entries and ones whose reply-to is not the target; keeps one per feed and seq; merges by rank (each relay's first result in the order of the client's relays, then each one's second, and so on); and keeps the first 16. More pages are asked for and merged as for a find. A Replies that no relay answered and at least one refused is refused.

Whose replies to show is the client's choice: anyone can reply to anything, and nothing but its signature vouches for a reply. A client shows a reply's feed as any feed, the key beside the name. To say what a reply answers it shows the title of an article entry it holds for that blob, and that entry's feed; holding none, a link to the article by its blob ID, fetched as any article link.

The local node

A node for readers (LOCAL.md) reuses Replies (0Ah, 8Ah), paged like its Find (the node's own cursor, the next 16 of its merged replies), when its Hello reply's flags have bit 1 set. A Replies that no relay answered is refused like a Find. Article (2Ch, reply ACh: req, status, then if 1 a record) gives the record of an article entry the node holds whose blob is id, of any size, from its own state; status 2 if none. A node that does not know it ignores it, and the reader shows the link alone. terse node answers both; the Go reader's node does not.

The reader

At the top of an article that is a reply, a line "In reply to “title” by name (short key)" when the host holds the answered article's entry, else "In reply to terse:" and the short ID. It is a link: Tab reaches it, Enter or a click opens the article, Esc comes back.

Under the article, "Replies (n)", asked of the relays (content op 17h) when the article opens; "n+" when the relays have more. First the replies of the feeds you follow and your own: each title is a link, with a line of the feed's name, short key and date; with none, "None from the feeds you follow." Then "From others (m)": the replies of other feeds, folded. O, or Enter or a click on that line, shows them; O again hides them. "More replies" asks for the next page. Last, a note that R writes a reply: R opens the host's F10 Publish page with "In reply to" filled in (op 19h). A host without that page (headless terse run, a reader-only host) refuses, and the status row says to use terse feed publish --reply-to (with the article's terse:<id>).

The window's Publish page

F10, page 3, has an optional field "In reply to", below Title: the article answered, as its terse: link, its blob ID or a feed address, / and an entry number (fetched from the relays if not held). Left empty, the article is not a reply. The preview starts with "In reply to “title” by name (short key)", or the link; the question is "Publish the reply “title” (size)?", with "in reply to …" on its second line.

Commands

terse feed publish <file> --title <t> --reply-to <article> [--dry-run]: <article> is terse:<blob id>, a blob ID (64 hex digits), or <feed address>/<seq> such as 3fa9…[email protected]/12, an entry fetched from the relays if it is not held (it must be an article). It prints a note in reply to “Title” (#seq of abc123…def456), or in reply to terse:<id> when no entry for the blob is held.

terse replies [--pages <n>|--all] <article> lists the replies the relays hold, merged, 16 a page, each line as terse feed list prints an entry. A note replies to “Title” by Name (abc123…def456, #seq) comes first when the article's entry is known; terse: no replies found when there are none; when there are more it says so and names --pages n+1. --all is at most 64 pages.

terse feed list marks a reply [reply to abc123…def456] after its title: the short form of the blob it answers.

Not yet

Planned: a signed list, published by an article's author, of the replies to it that readers should hide; and vouching, feeds whose replies a reader shows because feeds its user follows vouch for them (NETWORK.md section 8).

How a program asks for replies, shows what one answers and lets its user write one is in "Content: replies".