Typed CBRL (M39): TRLC-style requirement-type declarations — the opt-in types: block. OMITTED when the document declares no types, never defaulted to [], so untyped documents produce byte-identical models. Checked by ./type-check.ts; shapes in ./types.ts.
A source comment attached to the AST node it annotates (Model Text View F5). Trivia, not semantics — see ../comment-trivia.ts. comments? fields are optional and OMITTED when empty, never defaulted to [], so comment-free sources produce byte-identical ASTs.
One typed-field value bound on a requirement — the TRLC field = value assignment, plus where it was authored. A binding whose value is undefined (hand-edited models only — JSON cannot carry the key’s absence differently) is treated as ABSENT: it satisfies nothing, and a required field without a defined-value binding is reported missing.
Property
Type
Required
Description
name
string
yes
Which declared field this binds (verbatim, case-sensitive).
A typed-field VALUE: a string (for string/enum/ref kinds) or a finite number (for number). Anything else found in a (hand-edited or malformed) model is reported as a wrong-type finding, never thrown on.
Typed CBRL (M39): the declared requirement type this requirement conforms to (a CbrlFile.types[].name). Absent ⇒ the requirement is untyped and skips the type check entirely.
Typed CBRL (M39): where the requirement was authored (omitted when unknowable) — the anchor for type findings that have no value to point at (unknown type binding, missing required field).
One requirement-type declaration — the TRLC record type. A requirement binds to one by CbrlRequirement.type === name (verbatim, case-sensitive; first declaration wins when names repeat, which the check pass reports as a warn).
Required field; omitted for optional (the TRLC mandatory/optional axis).
pattern
string
no
Regex SOURCE string (ECMAScript dialect) the value must match IN FULL — the check pass anchors it. Applies to string, enum and ref values. An invalid source never throws: it downgrades to a warn finding and the pattern check is skipped.
enumIds
string[]
no
type: "enum" — the allowed ids. Absent/empty ⇒ unconstrained (warn).
Representative cbrl files committed under samples/cbrl/. Each demo shows three views — pick the one you want: Canvas (rendered through the same SvelteFlow component the IDE uses), Mermaid (a static-flowchart fallback), or Raw JSON. All assets are locally served; no GitHub redirect.
Open the raw JSON in a new tab(demo-01-single-requirement.json). The full source is also expanded in the <details> below this preview.
Demo 1 — minimal CBRL file: a single requirement with one acceptance criterion. The smallest viable CBRL shape.
demo-01-single-requirement.json — Demo 1 — minimal CBRL file: a single requirement with one acceptance criterion. The smallest viable CBRL shape. (expand for full JSON)
demo-01-single-requirement.json
{
"kind": "cbrl-file",
"schemaVersion": "0.1.0",
"requirements": [
{
"kind": "requirement",
"id": "REQ-001",
"description": "A todo can be created.",
"acceptanceCriteria": [
{
"kind": "acceptance-criteria",
"id": "AC-001",
"description": "POST /todos returns 201 with the created todo."
Open the raw JSON in a new tab(demo-02-booking-requirement.json). The full source is also expanded in the <details> below this preview.
Demo 2 — CBRL requirement with multiple acceptance criteria, an involved aggregate, linked story, enforced invariant, and generated event. The canonical 'realistic' example.
demo-02-booking-requirement.json — Demo 2 — CBRL requirement with multiple acceptance criteria, an involved aggregate, linked story, enforced invariant, and generated event. The canonical ‘realistic’ example. (expand for full JSON)
demo-02-booking-requirement.json
{
"kind": "cbrl-file",
"schemaVersion": "0.1.0",
"requirements": [
{
"kind": "requirement",
"id": "BOOK-001",
"description": "A traveler can confirm a booking.",
Open the raw JSON in a new tab(demo-03-aspects-and-access.json). The full source is also expanded in the <details> below this preview.
Demo 3 — CBRL with cross-cutting aspects (@security, @audit) and ACM access rules. Exercises the cross-model integration vocabulary.
demo-03-aspects-and-access.json — Demo 3 — CBRL with cross-cutting aspects (@security, @audit) and ACM access rules. Exercises the cross-model integration vocabulary. (expand for full JSON)
demo-03-aspects-and-access.json
{
"kind": "cbrl-file",
"schemaVersion": "0.1.0",
"requirements": [
{
"kind": "requirement",
"id": "ADMIN-001",
"description": "Admins can manage users.",
"acceptanceCriteria": [
{
"kind": "acceptance-criteria",
"id": "AC-ADMIN-01",
"description": "Admin can list, view, edit, and delete users."
}
],
"testCases": [],
"involvedAggregates": ["User"],
"linkedStories": [],
"aspects": [
{
"name": "security",
"params": {}
},
{
"name": "audit",
"params": {}
}
],
"enforcedInvariants": [],
"generatedEvents": [],
"accessRules": [
{
"kind": "access-rule",
"id": "rule-l9kh2",
"description": "ALLOW view,edit,delete for admin",
The cbrl model is one of the richly-curated records — every downstream surface (CLI, MCP, docs, tests) reads from one record. The pasteable snippet below is the Door 1 anchor a downstream agent should see before touching this model.
Oracle: per-AC behavior tests must fail first and end green; `ctxbrew check --gate` holds provenance (requirement ↔ story ↔ test).
Downstream: `ctxbrew semantics cbrl` · `ctxbrew://semantics/cbrl/v0.3.0` — read the record first.
The full record (every door — anchor template, tool description hint, response annotations, behavior tripwire, and the complete produced-surface list) is served as JSON at: