Skip to main content

Module history

Module history 

Source
Expand description

An entry’s history: one row for every change to it and every use of it, in db_vault_activity (docs/specs/SPEC_VAULT_PARITY_ENTRY_HISTORY_REASONS_AND_IMPORT_2026_11_06.md §5).

A row says who, what, where, under which version of the value, and why (the agent’s own reason), and never holds a value, a tail, a length or a hash of one. Rows are chained: each carries the hash of the one before, and the newest row’s place is also kept in the OS keychain, so a row edited, removed or slipped in by someone with only the database is found. That is evidence for the person, not proof against someone who holds the database and the keychain both.

Structs§

Head
The place in the chain the keychain holds.
VaultChain
Where the chain stands, for the pane.
Why
What an event adds to its row besides what the row already says.

Enums§

Asker
Who is asking for a history.

Constants§

MAX_REASON
MAX_REF
MAX_REFS
An event has at most this many references, each at most MAX_REF characters.
MAX_ROWS
The most rows one history answers with.
MIN_REASON
A reason has at least this many characters, and at most MAX_REASON, on one line.

Functions§

actor_kind
agent, person (the pane) or srv (a sweep, an expiry reminder).
actor_label
The actor as a row keeps it: an agent is written agent:<id>, so a row for an agent named like the person or the system can’t be read as theirs. The person, the system, AgentMux’s own parts (a label with a space, or AgentMux) and a label that already has a kind (drone:<id>) stay as they are, and an older row without the prefix still reads as an agent.
agent_of
The agent a row names, without the kind its actor is written with. A row from before the kind was written has none.
append
Fills in what the history keeps on every row (who kind of actor, the machine, a clean reason and references), appends it to the chain, and notes the chain’s new head. A failure is logged, not raised: a use or a change never fails for want of a history line.
check
Where the chain stands now: the whole table walked, and the keychain’s head compared.
history_for
An entry’s history, newest first: every change and use since it was made. agent is the proven agent asking (None for one that isn’t, which sees what every agent may), or the person’s pane (person, which may see all).
one_line
text on one line, trimmed and clipped to max characters.
refs_of
The references of a row, as a list.
refs_text
The references as the row keeps them: up to MAX_REFS, each on one line, empty ones dropped.
require_reason
The reason an agent gives for using or changing an entry, checked before anything is asked or written: one line of MIN_REASON to MAX_REASON characters. The error is what to tell the agent.
verify_chain
Walks rows (oldest first) and says whether the chain holds, and whether head is a row in it.