Reference assembler — Context Window Architecture
CWA
GitHub
Reference assembler

In progress. No release yet.

A reference implementation of the specification: admission, fitting, placement by profile, and the trace. It exists to prove the spec is buildable and to give conformance tests something to run against. This page tracks its status against every requirement and will grow into the API documentation once the API settles.

Status: in progress Spec target: v2 draft Language: Python first, others after conformance Updated: 2026-09-15
Conformance matrix

{{ counts }}

One row per requirement. A row moves to implemented only when a test in the conformance suite exercises it and passes. Producer-side rules (R-13, R-14, R-15) are checked by the admission layer, so they appear here too.

rulekeywordsummarystatus
{{ r.id }} {{ r.kw }} {{ r.summary }} {{ r.status }}
Intended API · subject to change

One call in, payload and trace out.

The shape follows the scaffold's assemble.py. Producers are called before assembly; the assembler receives items, never producers. Nothing in assemble() calls a model (R-18).

cwa/assembler.pydraft
from cwa import Item, Profile, Budget, assemble result = assemble( items=items, # list[Item], from your producers profile=Profile.load("policy-first-chat/v1"), budget=Budget(input=8192, reserved_output=1200), route_policy=policy, # matrix overrides, thresholds ) result.payload # rendered per profile wrap rules result.trace # dict, R-21 fields; result.trace_json() result.refused # bool · reason in trace.refused

Tell us what it must do.

The assembler is being built against real routes. If yours has a constraint the spec does not cover, open an issue before the API freezes.

Repository How to contribute