Expand description
Turning graph facts into lines an assistant reads.
Everything here is generic over what is being rendered: the digests in this
module’s siblings share the line budget, the number formatting, the path
shortening, and — above all — sanitize, which every string that came
out of the graph must pass through before it reaches a rendered line.
Constants§
- DEFAULT_
EXPLORE_ BYTES - What a default
explorereply may cost, in bytes. - EMPTY_
BRIEF - The one line a store with nothing in it at all gets as a session opens:
what is missing, and the command that fixes it. The same answer
EMPTY_MAPgives, for the same reason — there is nothing to be central in, and no point naming a way to reach an empty graph. - EMPTY_
MAP - The one line a store with nothing in it gets: what is missing, and the command that fixes it.
- MAX_
BRIEF_ BYTES - Longest session brief, in bytes.
- MAX_
CONTEXT_ LINES - Longest
render_contextdigest, in lines. Wider than the others because it quotes source. - MAX_
MAP_ LINES - Longest digest any
repographtool may print, in lines. - MAX_
TOOL_ LINES - Longest digest every other tool here prints, in lines.
- MIXED
- What a set of files with no shared directory is called.
- SEP
- Separator between the items of a one-line list.
Functions§
- age
- A duration in seconds as one coarse unit:
45s,12m,3h,20d. Negative input — a clock that ran backwards — reads as0s. - basename
- The last
/-separated segment of a key:src/core/db.rs→db.rs. - cap_
bytes - Keep whole lines while they fit in
maxbytes, dropping the rest. - cap_
lines - Keep at most
maxlines, dropping the rest. - cluster_
name - What to call a set of files.
- common_
dir_ prefix - The longest directory prefix every key shares,
/-joined. Empty when the keys share no leading directory at all. - dir_
components - The directory segments of a key:
src/core/db.rs→["src", "core"]. A key with no/has none. - plural
nofword, pluralised by adding ans.1 file,2 files.- quarter_
index - The quarter a timestamp falls in, counted from year 0 so that subtracting one index from another gives a number of quarters.
- quarter_
label - A quarter index as its label:
2026Q3. - render_
brief - Render a
BriefReportas the block a session opens with: at mostMAX_BRIEF_BYTESbytes, byte-identical for the same report. - render_
context - Render a
ContextReportas the digest an assistant reads: at mostMAX_CONTEXT_LINESlines, byte-identical for the same report. - render_
explore - Render an
ExploreReportin no more thanbudget_bytes. - render_
impact - Render an
ImpactReport: at mostMAX_TOOL_LINESlines. - render_
map - Render a
RepoMapas the digest an assistant reads: at mostMAX_MAP_LINESlines, byte-identical for the same map. - render_
owners - Render an
OwnersReport: at mostMAX_TOOL_LINESlines. - render_
why - Render a
WhyReport: at mostMAX_TOOL_LINESlines. - sanitize
- Replace every ASCII control character (
0x00-0x1fand0x7f, tabs and newlines included) with a space, so a value read out of the graph cannot forge a line break, a section header, or a terminal escape sequence. - short_
names - Shorten keys to their filenames, keeping the full path for any filename that would otherwise appear twice.
- thousands
1204→1,204. Groups of three, ASCII digits only.- top_
tokens - The
npath segments most keys carry, ignoringprefix. - ymd
- A Unix timestamp as a calendar date in UTC:
2026-09-04.