Expand description
What made an agent’s next call, for the per-task token ledger
(docs/specs/SPEC_TOKEN_ANALYSIS_PER_KANBAN_TASK_2026_11_22.md section 4.6): the kind of the event before the call
in the same transcript, from a fixed set. Counts only: the set holds no text, path or value.
user,broadcast,agent,service,schedule,task,supervisor,system: the message the call answers, by the origin srv stamped on it (amx.origin.kind,message_origin.rs). Never read from the text.tool:<name>: the call follows a tool’s result; the name is the tool’s (Read,Bash,Tasks), found from thetool_usethe result answers.toolwhen that call is not known (it was before srv started counting).rebuilt: after a compaction boundary, until a message with a fresh origin: the calls that rebuild the context.subagentis the ledger’s own: a subagent’s calls follow the parent’s stream and never change this state.- empty: nothing seen yet (srv started, or the zone is new).
The same state counts two waste signals, as counts (take_waste): a read-only tool called again with the same
target, and a compaction. A target is kept as a hash only, in memory, and dropped when the file is edited or the
context is compacted (a read after either is not a repeat).
The state is in memory: after a restart the first call of a zone is empty until the next event.
Structs§
Functions§
- wants
- Whether
linecan change the state: a substring test, so most lines cost nothing.