Expand description
Data model of the context compiler: the request/response value types.
Like crate::model, these are pure data with Serialize/Deserialize +
JsonSchema derives, so the domain types double as the MCP wire types —
no duplicate DTO layer. Invariants the compiler upholds over these shapes:
same request ⇒ byte-identical CompiledContext (determinism), and the
assembled content never exceeds the request’s token budget.
Structs§
- Compile
Policy - Tuning knobs of one compilation.
Defaultis the recommended profile. - Compile
Request - A full compile request: what to compile, under which budget, for whom.
- Compiled
Context - The compiler’s output: the assembled context plus its full audit trail.
- Compiled
Section - One contiguous block of the assembled output.
- Context
Decision - The auditable record of what happened to one fragment and why.
- Context
Decision Ref - A lightweight pointer to a past
ContextDecision. - Context
Fact - One asserted fact inside a
WorkingContext. - Context
Fragment - One unit of caller-supplied context to compile.
- Context
Savings - Aggregated savings over the recorded compilation events (memory bridge).
- Context
Source - The resolved original behind a
ctx://source/<hash>handle (US-002: text sources; US-009 PR2 extends this with the fragment’s inline media, when it carried one).mediais#[serde(default)]: every source stored before PR2, and every text-only fragment since, round-trips withmedia: None— the exact pre-PR2 shape for a caller reading only.content. - Context
Warning - A mechanical heads-up over one decision, surfaced in
CompiledContext::warningsso a caller can check “was anything relevant cut?” without scanning every entry ofdecisionsby hand (V2a-2 quick win). OnlyContextAction::Retrievedecisions at or above the relevance threshold qualify. - Importance
Weights - Usage-driven importance weights of the memory-bridge blend (US-002 of EPIC-P-071): how much a pulled memory’s learned RL confidence and its batch-relative recency tilt the fused similarity ranking.
- Loaded
Working Context - What a working-context lookup returns, on every surface: the MCP
load_working_contexttool AND the Node/Python/WASM bindings. - Media
Ref - Inline media payload attached to a
ContextFragment(US-009, PR1: screenshots/images only).ContextFragment::contentstays the text/caption — often empty for a bare screenshot — while the pixels live here, base64-encoded so the JSON wire never needs a binary frame. - Memory
Scope - Which memories the compiler may pull in alongside the caller’s fragments. Consumed by the memory bridge (US-002); carried in the request shape from the start so the wire contract does not change when it lands.
- Retrieval
Handle - A not-emitted fragment the caller can fetch back on demand.
- Source
Reference - A pointer from a compiled output back to one original fragment.
- Working
Context - The distilled working state of an agent session — small enough to carry
across sessions, structured enough to resume from. Persisted and reloaded
by the memory bridge (US-002) under
type = working_contextmetadata. - Working
Context Index - The per-project index
save_working_contextmaintains solist_working_contextsnever has to scan the whole store: one system fact per project, appended (or refreshed) on every save. The REJECTED alternative was an approximatequery_filteredscan over working-context facts (capped atMAX_RECALL_LIMIT, imprecise) — this index is exact and O(1) to read. - Working
Context Session - One session recorded in a project’s working-context index (V2a-1’s
list_working_contextsquick win).
Enums§
- Context
Action - What the compiler decided to do with one fragment.
- Fidelity
Risk - How much fidelity a compiled context may have lost versus its input.
- Section
Kind - Where a section sits in the assembled output.