Skip to main content

Module top

Module top 

Source
Expand description

borg top [--dir DIR] [--once] [--json]: the drones of each collective, one screen.

Local drones come from presence records (presence.rs), remote ones from what the mesh daemon last heard from members (only for a collective that may sync). Drones are designated by start order across both, Borg style: “Two of Five”. --dir shows only the collective DIR routes to; otherwise every collective on this machine that has drones. On a terminal it is a live screen until q (top_live.rs); piped, or with --once, it prints the text once; --json prints the same data for scripts.

Messages (msg.rs): each local drone’s unread count (what its next prompt or tool call shows), and the collective’s last few messages, one line each. A remote drone’s reads are claimed on its node. A sender is named by what its line claims, with the node the mesh checked it against (sender). The messages to the engineer the screen shows some of the text of are acknowledged as theirs when no session runs it, as borg inbox acknowledges what it lists from a terminal (engineer_looks, acknowledge): a drone’s borg top, printed or live, acknowledges nothing; --json acknowledges nothing.

Lesson selection (select.rs): one line per collective once its summary has folded a graded check, or while a policy other than the default (a switch) or the monitor’s revert decides (Selection); --json carries it in full as select. borg status prints the same line, borg web the rest.

borg itself (version_line): one line over the collectives when a newer release exists (update.rs) or a member’s mesh protocol differs from this node’s (protocol.rs), none otherwise. borg status and borg doctor say the rest; --json leaves it out.

Structs§

Budget
An engineer’s budget for the collective (collectives.json budget, select.rs budget_of): the pool tokens its checks may read per session on average, what they read per session, and the price per pool token the policy weighs a larger pool against (select/policy.rs price, λ).
Count
part of whole (a share), named.
Draws
The test’s checks at one k (Test::by_k): uniform draws give each s about ran / (k + 1).
Drone
Estimate
An effect and its interval, as the policy reports them.
Evaluation
The monitor’s weighted estimate (select/policy.rs Monitor), the auto-revert’s evidence, and how far it can be trusted.
Inbox
The messages side of a collective’s screen.
Latency
One harness’s stop check latency against its stop budget, over the stops’ model calls the summary keeps (select/summary.rs Pool::stops, the newest LATENCY_KEEP).
Measurement
What the checks measure for the learned policy without costing the fixed rule any quality: under the fixed default the placebo collects the not-now labels the fixed rule’s own history cannot give (tasks/todo.md, amendment 2026-10-29). Counted over the applies the summary keeps, as labels counts its placebo rows (select/summary.rs Apply, its route and label).
Selection
Lesson selection (select.rs) as the monitor shows it: one line per collective in borg status and borg top, in full on borg web’s Conscience tab (/api/select). Every number is read from the store’s selection summary (select/summary.rs load: its counts, its fit, its monitor) and the policy’s own functions, never refitted here; only shares, the declaration’s difference and the latency quantiles are taken of the summary’s counts. A section the summary does not carry yet is empty, which every surface shows as not measured yet, never as 0. Spend is measured and shown, and priced only under a budget an engineer set for the collective (budget).
Spend
One cost source’s spend over the sessions folded (Selection::sessions).
Test
The randomised question-count test of the learned policy (select/policy.rs choose; docs/delivery.md “The question-count test”), all-time as the summary counts it (select/summary.rs Experiment), never recounted from the log. On a live check, of the k lessons below grade 3 the fixed rule delivers and that may go free, s drawn uniformly in 0..=k are asked and the rest handed over: nothing is withheld.
Yield
The pool’s yield at fill positions from..to (0 first): of the lessons shown there, those applied, and the fitted chance (monotone over positions).

Constants§

COLUMN_NODE_CHARS
Display: the characters of a node key in a drone table’s column (here, and top_live.rs’s NODE column): enough to tell a collective’s few members apart, short enough for the column. A message names its node longer (msg.rs NODE_CHARS), where the key is the one part the mesh checked.
RECENT
Display: how many messages the screen lists.

Functions§

acknowledge
Acknowledges the messages to the engineer among shown, the ones a screen of the store at home put in front of them, as the engineer of the repo at cwd (msg.rs ack_engineer), as borg inbox does for what it lists. done holds the ids an earlier frame of the same screen already passed on, so a live screen asks git for the engineer and reads the log’s seen lines once per new message to an engineer, never on every frame; the ids are recorded whether the write worked or not (best effort, as the inbox’s: unacknowledged, a message holds its sender’s window until it expires). Only for a screen the engineer looks at (engineer_looks); --json is for scripts, not the engineer’s eyes, and acknowledges nothing.
assemble
The drones of the collective stored at home (pure over its inputs, for tests).
column_node
A node key as a drone table’s column shows it: its first COLUMN_NODE_CHARS.
drones
The drones of the collective stored at home as of now; remote ones only if it may sync.
engineer_looks
Whether the engineer is the one looking at a screen of the collectives whose drones are drones: caller (msg.rs caller, the session whose shell runs this command) finds no session over any of them, as borg inbox acknowledges as the engineer only when it finds none. A harness runs a drone’s commands piped, or on a pseudo-terminal where a plain borg top is the live screen (top_live.rs), and in the engineer’s repo, so without this test a drone’s borg top would acknowledge as the engineer what only its model saw: its senders’ windows to the engineer opened, the messages read on every node. A shell naming sessions caller cannot tell apart is a session’s too. Every collective’s drones count, not only those of the one acknowledged in: opencode’s shell names its session only through the drone of its pid, which may be another collective’s.
gather
Every collective to show with its drones, and the line on borg itself over them (version_line, over every collective dir routes to, shown or not) (top_live.rs).
inbox
The messages of the store at home for its drones as of now (one read of the log, one directory listing per local drone that has a message).
judge_length_line
One judge’s effective length as one line (borg status): the budget and whether evidence moved it, the answered share per prompt-size step with what it decided, and the step explored with its chance.
main
message_line
One message as one screen line (without its age): sender -> recipient: text (msg.rs keeps the text on one line, its whitespace collapsed).
recipient
Whom to names, as the screen says it: local (this machine’s sessions), collective (every member’s), the engineer, the drone it is, else the start of the session id (msg.rs short_session). Another node’s local (it never travels, msg.rs stays_here) is named with that node’s short key (msg.rs short_node).
render
One collective’s screen.
render_with
render with the collective’s selection line under it, when borg top shows one (Selection::shown).
resolve
Which drone target names: “local”, “collective” or “all”, a designation (“Two”, “Two of Five”, “2”) or a session id (or a unique prefix of at least 4 characters). Ok(None) is every drone. Live first, then local: an id or prefix that matches a running drone names it over an ended one (which never reads a message), and among those one on this machine over one on another node; a remote drone is named only when none here matches as well (or by its number, which names one drone of all).
selection
The selection of the store whose lessons file is lessons, under policy (select.rs policy).
selection_line
s as one line (borg status, borg top): what decides (the default named as such, a policy opted into by its switch), then the checks folded, how often the policy deviated from the fixed rule, the learned decisions the fixed rule took over per reason (only those that happened), the question-count test (test_line), what the checks measure for the learned policy (placebos), the monitor’s reading (the auto-revert’s evidence) with its weights’ effective number and largest weight, the stops’ latency per harness against its stop budget, and what selection spent per session; a budget and its price only where an engineer set one.
sender
Who sent m, as the screen says it: the drone its (node, by) pair is, else its label (msg.rs sender_label: the name it was sent under, else the start of by); the engineer by email. Every part but the node is the sender’s claim, so a line from another node than here carries that node’s short key (as msg.rs line).
shows_last
Whether a line of total columns, cut to width as cut cuts it (its first width - 1 and …; top_live.rs cuts its lines the same), still shows any of its last last columns: all of them when the line fits, else those before the …. A message’s line ends with its text, and one cut before any of it names only who wrote to whom.
to_json
to_json_with
to_json with the messages side: each local drone’s unread, and the collective’s messages.
unread_cell
A drone’s unread count as the screen shows it: - where this node cannot tell (a remote or ended one).
unread_of
Per live local drone’s session, how many of the already-read all messages were not shown to it (here: this node, msg.rs node).
version_line
The line over the collectives when borg itself needs the engineer, none otherwise: a newer release than this borg (checked, the last release check; ignored while check is off, BORG_UPDATE_CHECK=off), then per store in stores (only one with mesh/) each member nothing syncs with, and each member on an older protocol with what it misses (protocol.rs NOTES). A member on this node’s protocol, even on a newer borg, is no news here (borg status lists it).
wake_cell
A drone’s wake as the screen shows it: on (it listens, the next stop starts its waiter), waiter (its waiter runs), - (it is never woken, or this node cannot tell).
word