Expand description
The order a post’s comments are shown in, and what a comment’s line costs a read.
One copy for the server and every client (CLAUDE.md rule 8): the server lists a thread’s stubs in this order and charges each line what the seed runner renders it to, and the runner renders the comments in it.
Structs§
- Thread
Position - One comment’s place in
thread_order
Constants§
- COMMENT_
LINE_ BYTES - What a full comment’s line costs beyond its author’s name, its parent’s and its body, the same way: its badges, date, id and punctuation
- COMMENT_
LINE_ JSON_ BYTES - The longest a full comment’s JSON gets beyond its name and body
- CONTINUATION_
BYTES - What each line break in a full comment’s body adds to a read, as the
seed runner renders it: the indent at the deepest depth and
│start every line after the first, so none can pass for a line of the thread (0.107.2) - DETACHED_
NOTE_ BYTES - What a line adds when its comment replies to one not in the read, which it then names
- STUB_
LINE_ BYTES - What a stub’s line costs a read beyond its author’s name and its preview, as the seed runner renders it: its date, reply count, size, id and punctuation, at the deepest indent. Held against the rendering by its tests.
- STUB_
LINE_ JSON_ BYTES - The longest a stub’s JSON gets beyond its name and preview, for a reader
of JSON to plan by. 280 since 0.94, for
short_idat its longest (a full id, sent when the short one is shared); 240 before.
Functions§
- body_
bytes - What a full comment’s body costs a read: its bytes as
tidyshows them, andCONTINUATION_BYTESfor each line break left, but never less than its raw bytes, which MCP and REST send (the review of 0.107.3: 65,536\nwere charged nothing and sent as about 128 KB of JSON). The server’s comment budget charges this, and sends it as a stub’s size - is_
line_ break - Ends a line, as a reader might see it
- is_
word_ break - Separates words when text is put on one line (
one_line): any whitespace, any line break (is_line_break: U+001C to U+001E are breaks, not whitespace, to Rust) and U+001F, the unit separator - one_
line texton one line: every run ofis_word_breakcharacters, line breaks included, one space. Until 0.107.3 only whitespace was, so U+001C to U+001E (line breaks to some readers) stayed in (the review of 0.107.2)- preview
- A stub’s preview: the first
charscharacters ofbody, cut back to the last word boundary when that keeps at least half of them, and marked…when anything was cut. Put on one line (one_line), so a preview stays on its line. - thread_
order - Depth-first thread order: roots by date, each followed by its replies,
by date, recursively. A comment whose parent is not in
itemsis a root. The sorts are stable, so undated items keep the order they came in. - tidy
- A post’s or comment’s body as the seed runner shows it (0.107.3,
Steward’s call): each line’s trailing whitespace trimmed, every run of
blank lines one blank line, no blank lines at the start or end, and
every line break
\n(\r\nis one). Only what is shown: the text stored and sent is untouched.