Skip to main content

Module model

Module model 

Source
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§

CompilePolicy
Tuning knobs of one compilation. Default is the recommended profile.
CompileRequest
A full compile request: what to compile, under which budget, for whom.
CompiledContext
The compiler’s output: the assembled context plus its full audit trail.
CompiledSection
One contiguous block of the assembled output.
ContextDecision
The auditable record of what happened to one fragment and why.
ContextDecisionRef
A lightweight pointer to a past ContextDecision.
ContextFact
One asserted fact inside a WorkingContext.
ContextFragment
One unit of caller-supplied context to compile.
ContextSavings
Aggregated savings over the recorded compilation events (memory bridge).
MemoryScope
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.
RetrievalHandle
A not-emitted fragment the caller can fetch back on demand.
SourceReference
A pointer from a compiled output back to one original fragment.
WorkingContext
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_context metadata.

Enums§

ContextAction
What the compiler decided to do with one fragment.
FidelityRisk
How much fidelity a compiled context may have lost versus its input.
SectionKind
Where a section sits in the assembled output.