Skip to content

decision schema (v0.1)

The models/decisions.json file is validated by the normative JSON Schema published at its canonical URL:

PropertyTypeRequiredDescription
kind"decision-file"yes
schemaVersion"0.1.0"yes
decisionsDecisionBlockAst[]yes

One decision <id> "<statement>" \{ … \} block. All value fields are optional except id + decision (the statement) — a projection omits absent record fields so round-trips stay canonical.

PropertyTypeRequiredDescription
kind"decision"yes
idstringyesThe decision's handle in text (the DB uuid in serialized records).
decisionstringyesThe statement — what was decided.
questionstringnoThe question that was decided (card headline, spec §5.1).
typestringnoDecisionType — architectural | spec | product | process | tactical.
statusstringnoDecisionStatus — proposed | under_review | accepted | superseded | rejected.
decidedAtstringnoISO-8601 timestamp (quoted — lossless).
decidedBystringnoAuthor display name or stakeholder uuid (quoted).
consultedstring[]noConsulted reviewers / personas.
rationalestringno
alternativesobject[]no
supersedesstringnoHandle of the decision this one supersedes.
affectsstring[]nofacetRefs (affects …).
contextstring[]nocontextRefs (context …).
tagsstring[]no

Representative models/decisions.json files committed under samples/decision/. 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.

↓ download
demo-01-simple-adr.dec.json — Context Studio canvas view

Demo 1 — Minimal decision record: a single ADR with statement, question, type, status, decidedBy, rationale, and a single rejected alternative.

demo-01-simple-adr.dec.json — Demo 1 — Minimal decision record: a single ADR with statement, question, type, status, decidedBy, rationale, and a single rejected alternative. (expand for full JSON)
demo-01-simple-adr.dec.json
{
"kind": "decision-file",
"schemaVersion": "0.1.0",
"decisions": [
{
"kind": "decision",
"id": "ADR-002-auth-system",
"decision": "Use Logto (OIDC) as the auth system for both web and CLI.",
"question": "Which identity provider should we standardize on?",
"type": "architectural",
"status": "accepted",
"decidedAt": "2026-05-15T10:00:00.000Z",
"decidedBy": "Dubravko Krasnjak",
"consulted": ["security-team", "platform-team"],
"rationale": "Logto is self-hostable, supports OIDC out of the box, and exposes a JS SDK that integrates cleanly with SvelteKit 2. Avoids the lock-in of Auth0/Clerk while keeping operational complexity lower than rolling our own.",
"alternatives": [
{
"option": "Auth0",
"rejectedBecause": "Vendor lock-in; expensive at scale; no on-prem option."
}
],
"tags": ["adr", "auth", "platform"]
}
]
}
↓ download
demo-02-multiple-alternatives.dec.json — Context Studio canvas view

Demo 2 — Decision with multiple alternatives and consulted reviewers. Exercises the alternatives array (multiple rejected options) and consulted list.

demo-02-multiple-alternatives.dec.json — Demo 2 — Decision with multiple alternatives and consulted reviewers. Exercises the alternatives array (multiple rejected options) and consulted list. (expand for full JSON)
demo-02-multiple-alternatives.dec.json
{
"kind": "decision-file",
"schemaVersion": "0.1.0",
"decisions": [
{
"kind": "decision",
"id": "ADR-005-canvas-library",
"decision": "Use @xyflow/svelte (Svelte Flow) for visual modeling canvases across DDD/USM/C4.",
"question": "Which graph/canvas library should we standardize on for visual modeling?",
"type": "architectural",
"status": "accepted",
"decidedAt": "2026-06-10T14:30:00.000Z",
"decidedBy": "Dubravko Krasnjak",
"consulted": ["frontend-team", "design-system-team", "platform-team"],
"rationale": "@xyflow/svelte is the native Svelte port of React Flow; same data model and features (custom nodes/edges, viewport controls, minimap) but compiled to Svelte 5 with runes. Eliminates the React-only constraint while keeping the rich ecosystem of the xyflow family.",
"alternatives": [
{
"option": "React Flow inside a React island",
"rejectedBecause": "Two rendering systems in one app; bundle size; double hydration."
},
{
"option": "D3.js custom implementation",
"rejectedBecause": "Months of work to reach parity with xyflow; we'd reinvent minimap + dnd + edges."
},
{
"option": "JointJS / GoJS",
"rejectedBecause": "Commercial licensing on GoJS; JointJS lacks the Svelte-native API."
}
],
"tags": ["adr", "frontend", "visualization"]
}
]
}
↓ download
demo-03-superseded-decisions.dec.json — Context Studio canvas view

Demo 3 — Supersession chain: ADR-001 is superseded by ADR-001-v2 (a re-decision with refined rationale). Exercises supersedes (forward link to the decision that replaces this one), status: 'superseded'.

demo-03-superseded-decisions.dec.json — Demo 3 — Supersession chain: ADR-001 is superseded by ADR-001-v2 (a re-decision with refined rationale). Exercises supersedes (forward link to the decision that replaces this one), status: ‘superseded’. (expand for full JSON)
demo-03-superseded-decisions.dec.json
{
"kind": "decision-file",
"schemaVersion": "0.1.0",
"decisions": [
{
"kind": "decision",
"id": "ADR-001-typescript-fullstack",
"decision": "Adopt TypeScript full-stack monolith (SvelteKit 2 + Drizzle ORM) instead of Phoenix/Elixir.",
"question": "What runtime + framework for the application layer?",
"type": "architectural",
"status": "superseded",
"decidedAt": "2026-04-01T09:00:00.000Z",
"decidedBy": "Dubravko Krasnjak",
"rationale": "Initial decision: single language across web/CLI/MCP reduces context-switching. SUPERSEDED — see ADR-001-v2 (now also pins Bun runtime and explicitly defers Elixir services to specific high-throughput paths only).",
"tags": ["adr", "platform", "superseded"]
},
{
"kind": "decision",
"id": "ADR-001-v2-typescript-fullstack",
"decision": "Confirm TypeScript full-stack monolith (SvelteKit 2 + Bun + Drizzle ORM); restrict Elixir services to event-driven hot paths.",
"question": "Confirm and refine the runtime + framework decision after Phase 0 spike.",
"type": "architectural",
"status": "accepted",
"decidedAt": "2026-07-20T11:00:00.000Z",
"decidedBy": "Dubravko Krasnjak",
"consulted": ["platform-team", "recipe-server-team"],
"rationale": "After 3 months of building, SvelteKit 2 + Bun + Drizzle is the right default. Elixir/Phoenix stays for the recipe server (which needs long-lived connections, ETS, and supervised processes). The split is 'JS for IO-bound, Elixir for state-bound' — not a one-language-or-the-other choice.",
"alternatives": [
{
"option": "Re-evaluate Elixir/Phoenix for the full stack",
"rejectedBecause": "Three months of TS code would be discarded; no concrete evidence the Elixir path would be better."
}
],
"supersedes": "ADR-001-typescript-fullstack",
"affects": ["web", "cli", "recipe-server"],
"tags": ["adr", "platform"]
}
]
}
↓ download
demo-04-mixed-statuses.dec.json — Context Studio canvas view

Demo 4 — Mixed-status decision log: one accepted, one under review, one rejected, one proposed. Exercises all status values, all type values, and the affects/context cross-reference fields.

demo-04-mixed-statuses.dec.json — Demo 4 — Mixed-status decision log: one accepted, one under review, one rejected, one proposed. Exercises all status values, all type values, and the affects/context cross-reference fields. (expand for full JSON)
demo-04-mixed-statuses.dec.json
{
"kind": "decision-file",
"schemaVersion": "0.1.0",
"decisions": [
{
"kind": "decision",
"id": "DEC-001-c4-promotion",
"decision": "Promote C4 from a research artifact to a first-class model (parser + generator + UI).",
"question": "Should C4 architecture modeling join the canonical model set?",
"type": "spec",
"status": "accepted",
"decidedAt": "2026-08-05T10:00:00.000Z",
"decidedBy": "Dubravko Krasnjak",
"rationale": "C4 fills a gap the existing models don't cover (architecture abstractions across containers/components). Adding it doesn't replace SIM — they overlap on 'service' but C4 carries the Person/System/Container/Component vocabulary SIM lacks.",
"affects": ["c4", "sim"],
"tags": ["c4", "models"]
},
{
"kind": "decision",
"id": "DEC-002-event-bus-tech",
"decision": "Pending — choose between NATS JetStream and Kafka for the event bus.",
"question": "Which event bus should the platform standardize on?",
"type": "architectural",
"status": "under_review",
"decidedAt": "TBD",
"decidedBy": "TBD",
"rationale": "Spike in progress; benchmark numbers due 2026-09-30.",
"affects": ["bus", "worker"],
"tags": ["infra", "events"]
},
{
"kind": "decision",
"id": "DEC-003-graphql-adoption",
"decision": "Do NOT adopt GraphQL — REST + JSON over HTTP is sufficient.",
"question": "Should the API layer adopt GraphQL?",
"type": "spec",
"status": "rejected",
"decidedAt": "2026-06-25T16:00:00.000Z",
"decidedBy": "Dubravko Krasnjak",
"rationale": "GraphQL adds tooling, schema management, and N+1 risk that the use case doesn't justify. REST + OpenAPI gives the SDK-generation we need without the extra layer.",
"alternatives": [
{
"option": "GraphQL",
"rejectedBecause": "Tooling cost > benefit for current API surface."
}
],
"tags": ["api", "rejected"]
},
{
"kind": "decision",
"id": "DEC-004-cli-distribution",
"decision": "Proposed — ship the CLI as a Bun-compiled single binary + npm package.",
"question": "How should we package and distribute the `ctxbrew` CLI?",
"type": "product",
"status": "proposed",
"decidedAt": "TBD",
"decidedBy": "Dubravko Krasnjak",
"rationale": "Two channels: a single static binary for power users (curl → chmod +x) AND the npm package for JS-ecosystem integration. Both share the same generator pipeline so docs/tests stay in sync.",
"affects": ["cli-web", "cli-rust"],
"tags": ["cli", "distribution"]
}
]
}

The decision 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.

paste into AGENTS.md / CLAUDE.md
- **Decision v0.1.0** — `models/decision.json`.
Produces: Decision records (log/timeline), ADR bundles generated from model deltas (adr-from-delta).
Oracle: every promoted model change carries its decision; `ctxbrew timeline` reads the why back in order.
Downstream: `ctxbrew semantics decision` · `ctxbrew://semantics/decision/v0.1.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:

  • CLI — ctxbrew semantics decision --schema-version 0.1.0
  • MCP — ctxbrew://semantics/decision/v0.1.0
  • HTTP — https://contextbrew.dev/schemas/decision/v0.1/semantics.json

See the schemas overview for the versioning policy and how these files are generated and kept in sync.