Expand description
The result pipeline: shrink order and the envelope’s three attachments, assembled in one place. Order is the law: offload always precedes truncation; plain truncation is the no-CAS fallback and never stores. The three attachment sentences are defined here once — changing them changes window bytes and passes through the SPEC.
The law reads tee → sieve → offload / truncation:
an exec result arrives with its command key, is pinned and sieved
by sieve through the same site the offload uses, and what the
sieve left enters the three arms below as the result.
Re-exports§
pub use adviser::Adviser;pub use adviser::Ask;pub use adviser::Consultation;
Modules§
- adviser
- The window’s adviser: three typed questions, one recorded answer, and the deterministic strategy that answers when no adviser does.
- connector
- One MCP server’s answer as the model reads it (
crates/runtime/spec/Pipeline.lean§8-27-10): text that fits passes untouched, text that does not is stored whole and replaced by a window the model pages withread, a PNG picture is stored in the content store and travels as an attachment, with a line of text where it stood, and a sound is stored there too and named by its locator in a line of its own. - exec
- One
execresult as the model reads it.
Structs§
- Pack
Context - Everything one packaging decision needs; all injected, nothing sampled.
- Packaged
- The packaged result: window text plus the events the caller appends
(
result_offloadedwhen the pipeline stored an original). - Sieve
Request - An
execresult’s command identity, and the two things the sieve needs from the run: its filter table and its history. When this is present,resultis the command’s output text, not a JSON envelope.
Functions§
- exit_
code_ in - The code an
execresult says its command ended with. The key and the rule that a code is written only when there is one aretools::exec::outcome’s; this is the one reader of that key, so a command a signal stopped reads asNonerather than as a number. - package
- Packages one tool result for the window. Shrink order: the sieve first when a command key came with the result and a site exists; then intact when it fits; offload when the result must leave whole or is large enough to be worth storing; shortening otherwise. Then the envelope: clock line, one-time net notice, steer.
- pinned_
original - Where the whole of one tool result was stored, read from the first
account it carries (
crates/runtime/spec/Turn.lean§8-51(b)). The first, because the pipeline writes the sieve’s account before a later store’s, and the sieve’s original is what the command wrote;Nonewhen the result carries no account this build can read.