Deterministic Context Composition
The process of assembling operational context for an AI-assisted session such that the same verified inputs always produce the same context output — reproducible, governed, and verifiable.
Definition
Deterministic context composition is the process of assembling operational context for an AI-assisted engineering session such that the same verified inputs always produce the same context output. The composed context is reproducible — given the same corpus state and the same composition parameters, the result is identical every time.
This is the primary engineering guarantee that Yanzi provides. It transforms context — historically an implicit, probabilistic, session-dependent quantity — into an explicit, verifiable, governed artifact.
Why It Matters
The default behavior of AI-assisted engineering tools is the opposite of deterministic. Each session composes context implicitly: from the conversation history, from files the model is shown, from the model’s prior training, from implicit inferences about the project. Two engineers running the same task in two different sessions will produce different context compositions, often invisibly.
The consequences compound over time:
- Models make different assumptions about architectural constraints
- Governed decisions are not consistently applied across sessions
- Output repeatability becomes a coincidence rather than a property
Deterministic context composition addresses this at the architectural level. Context is not composed implicitly — it is assembled explicitly from a governed, append-only corpus. The composition is reproducible because the inputs are fixed.
The Composition Process
A deterministic context composition draws from three sources:
- The corpus state: the current set of append-only artifacts in the Yanzi corpus — intent records, checkpoints, captures
- Context Library primitives: Packs, Seeds, Workflows, Rules, and Roles that define the operational context for the session type
- Composition parameters: the specific checkpoint, project, and role being composed for
Given the same corpus state and the same parameters, the composition produces the same result. This is the determinism guarantee.
Relationship to Rehydration
yanzi rehydrate is the CLI command that executes a deterministic context composition. It reads the current corpus state, applies the relevant Context Library primitives, and produces a context document that the AI model can consume at session start.
The rehydrated context is deterministic — not because the AI model is deterministic (it is not), but because the inputs to the model are governed and reproducible.
In Yanzi
Deterministic context composition is the core design principle of Yanzi. Every feature — append-only corpus, checkpoints, Context Library primitives, release certification — exists to support it.