Skip to main content

Module lines

Module lines 

Source
Expand description

The transcript line rule, shared by the output.idx indexer and the per-file line counter (Phase 5a-2, SPEC_AGENT_PANE_BOUNDED_LIVE_WINDOW_MIGRATION_2026_09_23.md §6.3.7).

A line is the bytes between two \n (the last one may be unterminated). It is counted unless it is blank: from_utf8_lossy(line).trim() is empty, so \r (CRLF) and Unicode whitespace are blank, and invalid UTF-8 is not. This is the reader’s addressing (String::lines() filtered on !trim().is_empty()); line k of a file is the k-th counted line. Both users call is_blank_line, so they can’t drift apart.

Structs§

LineCount 🔒
Where a file’s line counter stands after appending bytes.

Functions§

count_all 🔒
The counter for a whole file’s content.
count_append 🔒
The counter after appending data at byte offset at to a file whose counter was before. open_tail is the file’s bytes from before.tail_start to at — the unterminated last line, empty when the file ends with \n — because appended bytes continue that line and can change whether it is blank.
is_blank_line 🔒
Whether line (without its \n) is blank under the reader’s rule.