Producer contract — Context Window Architecture
CWA
GitHub
The producer contract

Building a tool an assembler can consume.

A producer is anything that emits candidate items into a slot: a retriever, a memory store, an MCP server, a state service, a policy loader. The assembler does not know how a producer works. It knows what the producer hands over. That handover is the contract. This page is a guide; the rules it cites are normative in the Spec.

The minimum item

Eight fields. Without them the assembler cannot place, rank, expire or trace the item, so it is refused at admission (R-2). Emit them on every item, every time, even when the value seems obvious.

{{ f.key }} {{ f.text }}
item.yamla minimum-plus-policy item from a retriever
id: refunds-eu:v17#p4 slot: evidence.knowledge source: policy-corpus source_version: "2026-09-10" authority: reference_only trust: verified freshness: "2026-09-12T15:30:00Z" body: "Pro plans refund in full within 30 days of purchase." # policy fields · SHOULD token_budget: 120 lineage: verbatim injection_risk: untrusted_content eligibility: "rerank ≥ 0.82 · tenant=acme · fresh ≤ 90d" relevance: 0.91

Policy fields and slot defaults

Six more fields describe how an item may be handled. A producer that knows better than the slot default should set them. When it does not, the assembler fills them from the slot's defaults and the trace says so (R-3). These are the defaults the reference assembler ships with.

slotauthoritytierlineageinjection_risk · conflict_policy
{{ d.slot }}{{ d.authority }}{{ d.tier }}{{ d.lineage }}{{ d.rest }}

Producer kinds

Four kinds cover almost everything. Each has one slot it normally feeds, one authority ceiling it may not exceed, and one rule that is most often broken.

Retrieval → evidence.knowledge
Packets with a score, never a blob.

One item per passage, each with its rerank score and source version. The retriever owns rewrite, retrieve, rerank; the assembler owns deduplicate, filter, packetize, budget, attribute. An empty result set is a valid, recorded outcome; do not pad it.

Ceiling authority: reference_only · R-13 · R-12
Memory → interaction.memory
State-vs-memory, as fields.

Every entry carries expires (the TTL), source (the turn it was derived from), lineage: summarised | generated, a revocation reference when the user has contradicted it, and trust: unverified. Expired or revoked entries are not emitted at all; the store filters, not the assembler.

Ceiling authority: generated · R-14 · R-9
State → state.user · state.task
Application-owned. Current or absent.

A state producer reads the database or the workflow engine and emits one item per fact, typed, with as_of set to the read time. It never derives a value from conversation. Claims the user made about themselves go to memory, not state.

Ceiling authority: state · R-8
MCP → capabilities · tool_results · knowledge
Specs to Governance, results to Evidence.

Tool specs become governance.capabilities items with authority: capability. Tool results and resources become evidence.tool_results or evidence.knowledge with authority: observation or reference_only, an as_of, and untrusted by default. A resource that contains imperatives is still evidence.

Ceiling authority: observation · R-15 · R-10
Precomputed variants
Compression variants and reranker scores are the producer's job, computed before assembly and cached by content hash. The assembly step never calls a model (R-18). If your producer can offer a shorter form of an item, emit it as a variant on the item, not as a second item.

Who owns which stage

{{ s.n }} {{ s.name }} {{ s.owner }} {{ s.text }}

Admission failures

Every refusal lands in the trace as excluded[] { item_id, reason }. These are the reasons a producer will see, and what they mean.

{{ f.reason }} {{ f.text }} {{ f.rule }}
Tool

Item linter

Paste one candidate item as JSON. The linter runs the admission checks a conformant assembler runs, cites the rule for each refusal, fills policy fields from slot defaults, and shows the trace line that would result. Nothing leaves your browser.

candidate item · JSON
admission{{ lint.verdict }}
{{ f.mark }} {{ f.text }} {{ f.rule }}
defaults filled · R-3
{{ d }} {{ lint.filledNote }}
trace › {{ lint.traceLine }}
Tool

Trace validator

Paste a trace your assembler emitted. The validator checks the fields required by R-21, notes the recommended fields from R-22, and reports which requirements the trace evidences.

trace · JSON
R-21 required fields{{ tv.verdict }}
{{ f.mark }}{{ f.name }}
R-22 recommended
{{ f.mark }} {{ f.name }}
requirements evidenced
{{ e.rule }}{{ e.text }}