Skip to main content

Module provider

Module provider 

Source
Expand description

A provider’s session file read against the store (SPEC_HISTORY_COMPACT_FORM_ONLY_2026_11_23.md section 5.2).

The provider CLI writes its own record of a conversation. AgentMux cannot rebuild that file from the store, so it stays until its session ends; at the end it is removed only after a proof, for that session, that the store holds what the file holds. This module is the proof’s pure half: it turns a record of either side into the items it carries (a text, a thinking block, a tool call, a tool result, a summary), and matches a file’s records against the store’s items, record by record and in order. super::provider_end does the file work around it.

What a match means: every item of the provider record is in the store, with equal content, at a position after the previous record’s items. Content is compared exactly, after the one change the store makes by design (a value srv holds secret is replaced by its mark, on the provider side too: record). Timestamps, the amx stamp and cost totals are not compared; the provider’s own timestamp and ids are kept in the sidecar (sidecar_fields).

A record with no items (a snapshot, a queue operation, a line that is not JSON) never matches: it is imported as it is. So the proof can only fail to find a match, never find a wrong one, and what it does not match is kept.

Structs§

Item
What one record carries, by content: a 128-bit digest of the kind and the exact text.
Matcher
Matches records, in order, against a StoreIndex.
Record
One line of a provider file.
StoreIndex
The store’s items, in line order, for one session.

Functions§

items_of
The items one record (a provider line, or a stored line) carries, in order.
record
Read one line of a provider file.
sidecar_fields
The fields of a record’s own that the store’s line does not carry: its ids and chain (uuid, parentUuid), its sidechain and request ids, version, slug, working directory, branch, timestamp, and the message’s id, model and usage; and a tool result’s toolUseResult when it holds text the matched result does not. The sidecar keeps them.