acm schema (v0.1)
The models/acm.json file is validated by the normative JSON Schema published at its canonical URL:
- $id: https://contextbrew.dev/schemas/acm/v0.1/schema.json
- Format version:
0.1.0 - Schema dialect: draft-07
- Validate with:
ctx schema acmor any JSON Schema validator (ajv, VS Code, …)
Root object: AcmFile
Section titled “Root object: AcmFile”| Property | Type | Required | Description |
|---|---|---|---|
type | "acm" | yes | |
version | string | yes | |
project | string | yes | |
roles | AcmRole[] | yes | |
screens | AcmScreenPolicy[] | yes | |
predicates | AcmPredicate[] | yes | |
links | object | yes | |
annotations | AcmAnnotation[] | yes |
Definitions
Section titled “Definitions”AcmAnnotation
Section titled “AcmAnnotation”TS-core-013 — annotation shape (mirror of AnnotationSchema in acm-validate.ts; kept here so consumers don’t need a zod dependency).
| Property | Type | Required | Description |
|---|---|---|---|
id | string | yes | |
targetType | "cell" | "rule" | yes | |
targetId | string | yes | |
body | string | yes | |
author | string | yes | |
createdAt | string | yes | |
resolvedAt | string | yes |
AcmEffect
Section titled “AcmEffect”Shared types for ACM generators
Type: "ALLOW" | "DENY" | "CONDITIONAL"
AcmPredicate
Section titled “AcmPredicate”| Property | Type | Required | Description |
|---|---|---|---|
id | string | yes | |
expression | string | yes | |
compiled | PredicateIR | no | Compiled predicate IR. Optional in the on-disk format — the AcmFileSchema (zod) declares compiled: PredicateIRSchema.optional(), so freshly-loaded or imported predicates may not have it yet. The compilation pass populates it. See acm-validate.ts. |
AcmRole
Section titled “AcmRole”| Property | Type | Required | Description |
|---|---|---|---|
id | string | yes | |
label | string | yes | |
inherits | string | no | |
description | string | no |
AcmRule
Section titled “AcmRule”| Property | Type | Required | Description |
|---|---|---|---|
role | string | yes | |
effect | AcmEffect | yes | |
actions | | yes | |
predicate | string | no |
AcmScreenPolicy
Section titled “AcmScreenPolicy”| Property | Type | Required | Description |
|---|---|---|---|
screen | string | yes | |
route | string | yes | |
rules | AcmRule[] | yes |
AttrRef
Section titled “AttrRef”| Property | Type | Required | Description |
|---|---|---|---|
source | "principal" | "resource" | "environment" | yes | |
path | string | yes |
CompOp
Section titled “CompOp”Type: "==" | "!=" | "<" | ">" | "<=" | ">="
Literal
Section titled “Literal”| Property | Type | Required | Description |
|---|---|---|---|
type | "literal" | yes | |
value | string | yes |
LiteralArray
Section titled “LiteralArray”| Property | Type | Required | Description |
|---|---|---|---|
type | "array" | yes | |
values | | yes |
PredicateIR
Section titled “PredicateIR”Type: object
Sample documents
Section titled “Sample documents”Representative models/acm.json files committed under samples/acm/. 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-rbac-only.acm.json). The full source is also expanded in the <details> below this preview.
Demo 1 — Minimal ACM file with pure RBAC: roles with inheritance, three screens, flat allow/deny rules with no predicates. Exercises roles, screens, rules (with effect + actions), and links.
demo-01-rbac-only.acm.json — Demo 1 — Minimal ACM file with pure RBAC: roles with inheritance, three screens, flat allow/deny rules with no predicates. Exercises roles, screens, rules (with effect + actions), and links. (expand for full JSON)
{ "type": "acm", "version": "0.1.0", "project": "travel-booking-demo", "roles": [ { "id": "traveler", "label": "Traveler", "description": "Default end-user role." }, { "id": "ops", "label": "Ops Engineer", "description": "Internal operator.", "inherits": "traveler" }, { "id": "admin", "label": "Administrator", "description": "Full access.", "inherits": "ops" } ], "screens": [ { "screen": "search", "route": "/search", "rules": [ { "role": "traveler", "effect": "ALLOW", "actions": ["view"] } ] }, { "screen": "booking-detail", "route": "/bookings/:id", "rules": [ { "role": "traveler", "effect": "ALLOW", "actions": ["view"] }, { "role": "ops", "effect": "ALLOW", "actions": ["view", "edit"] }, { "role": "admin", "effect": "ALLOW", "actions": ["view", "edit", "delete"] } ] }, { "screen": "admin-dashboard", "route": "/admin", "rules": [ { "role": "admin", "effect": "ALLOW", "actions": ["view", "edit", "delete"] }, { "role": "ops", "effect": "DENY", "actions": ["delete"] } ] } ], "predicates": [], "links": { "screens": [ { "acmScreen": "search", "scmScreenId": "scm:search" }, { "acmScreen": "booking-detail", "scmScreenId": "scm:booking-detail" }, { "acmScreen": "admin-dashboard", "scmScreenId": "scm:admin-dashboard" } ], "aggregates": [ { "acmScreen": "booking-detail", "dddAggregateId": "ddd:Booking" } ], "requirements": [ { "acmScreen": "search", "cbrlRequirementId": "cbrl:REQ-001" } ] }, "annotations": []}Open the raw JSON in a new tab(demo-02-abac-with-predicates.acm.json). The full source is also expanded in the <details> below this preview.
Demo 2 — ACM with ABAC predicates: resource-owner checks, aspect predicates (@security), and a CONDITIONAL effect. Exercises predicates (with compiled IR), CONDITIONAL effect, and the predicate namespace vocabulary.
demo-02-abac-with-predicates.acm.json — Demo 2 — ACM with ABAC predicates: resource-owner checks, aspect predicates (@security), and a CONDITIONAL effect. Exercises predicates (with compiled IR), CONDITIONAL effect, and the predicate namespace vocabulary. (expand for full JSON)
{ "type": "acm", "version": "0.1.0", "project": "travel-booking-demo", "roles": [ { "id": "traveler", "label": "Traveler" }, { "id": "support", "label": "Customer Support", "description": "Read-only access to bookings they handle." }, { "id": "admin", "label": "Administrator" } ], "screens": [ { "screen": "booking-detail", "route": "/bookings/:id", "rules": [ { "role": "traveler", "effect": "ALLOW", "actions": ["view"], "predicate": "resource.owner_id == principal.id" }, { "role": "traveler", "effect": "ALLOW", "actions": ["edit"], "predicate": "resource.owner_id == principal.id" }, { "role": "support", "effect": "CONDITIONAL", "actions": ["view"], "predicate": "resource.assigned_support_id == principal.id" }, { "role": "support", "effect": "ALLOW", "actions": ["edit"], "predicate": "@security(level: \"low\")" }, { "role": "admin", "effect": "ALLOW", "actions": ["view", "edit", "delete"] } ] }, { "screen": "payment-detail", "route": "/payments/:id", "rules": [ { "role": "traveler", "effect": "ALLOW", "actions": ["view"], "predicate": "resource.booking.customer_id == principal.id" }, { "role": "admin", "effect": "ALLOW", "actions": ["view", "refund"] } ] } ], "predicates": [ { "id": "P-resource-owner", "expression": "resource.owner_id == principal.id", "compiled": { "type": "comparison", "left": { "source": "resource", "path": "owner_id" }, "op": "==", "right": { "source": "principal", "path": "id" } } }, { "id": "P-assigned-support", "expression": "resource.assigned_support_id == principal.id", "compiled": { "type": "comparison", "left": { "source": "resource", "path": "assigned_support_id" }, "op": "==", "right": { "source": "principal", "path": "id" } } }, { "id": "P-customer-via-booking", "expression": "resource.booking.customer_id == principal.id", "compiled": { "type": "comparison", "left": { "source": "resource", "path": "booking.customer_id" }, "op": "==", "right": { "source": "principal", "path": "id" } } }, { "id": "P-aspect-security-low", "expression": "@security(level: \"low\")" } ], "links": { "screens": [ { "acmScreen": "booking-detail", "scmScreenId": "scm:booking-detail" }, { "acmScreen": "payment-detail", "scmScreenId": "scm:payment-detail" } ], "aggregates": [ { "acmScreen": "booking-detail", "dddAggregateId": "ddd:Booking" }, { "acmScreen": "payment-detail", "dddAggregateId": "ddd:Payment" } ], "requirements": [ { "acmScreen": "booking-detail", "cbrlRequirementId": "cbrl:REQ-002" }, { "acmScreen": "payment-detail", "cbrlRequirementId": "cbrl:REQ-005" } ] }, "annotations": []}Open the raw JSON in a new tab(demo-03-annotations.acm.json). The full source is also expanded in the <details> below this preview.
Demo 3 — ACM with the annotation sidecar: cell-level and rule-level annotations (open and resolved). Exercises annotations (id, targetType: cell \| rule, targetId, body, author, createdAt, resolvedAt).
demo-03-annotations.acm.json — Demo 3 — ACM with the annotation sidecar: cell-level and rule-level annotations (open and resolved). Exercises annotations (id, targetType: cell | rule, targetId, body, author, createdAt, resolvedAt). (expand for full JSON)
{ "type": "acm", "version": "0.1.0", "project": "travel-booking-demo", "roles": [ { "id": "traveler", "label": "Traveler" }, { "id": "admin", "label": "Administrator" } ], "screens": [ { "screen": "booking-detail", "route": "/bookings/:id", "rules": [ { "role": "traveler", "effect": "ALLOW", "actions": ["view", "edit"], "predicate": "resource.owner_id == principal.id" }, { "role": "admin", "effect": "ALLOW", "actions": ["view", "edit", "delete"] } ] } ], "predicates": [ { "id": "P-resource-owner", "expression": "resource.owner_id == principal.id" } ], "links": { "screens": [ { "acmScreen": "booking-detail", "scmScreenId": "scm:booking-detail" } ], "aggregates": [ { "acmScreen": "booking-detail", "dddAggregateId": "ddd:Booking" } ], "requirements": [ { "acmScreen": "booking-detail", "cbrlRequirementId": "cbrl:REQ-002" } ] }, "annotations": [ { "id": "ann-001", "targetType": "cell", "targetId": "booking-detail::traveler", "body": "Open question: should travelers be able to edit after 24h post-confirmation?", "author": "Dubravko Krasnjak", "createdAt": "2026-09-01T10:00:00.000Z", "resolvedAt": null }, { "id": "ann-002", "targetType": "rule", "targetId": "booking-detail::admin:ALLOW:delete", "body": "Admin delete is destructive — must trigger the BookingCancelled domain event.", "author": "Dubravko Krasnjak", "createdAt": "2026-08-15T14:00:00.000Z", "resolvedAt": "2026-08-20T09:30:00.000Z" }, { "id": "ann-003", "targetType": "cell", "targetId": "booking-detail::admin", "body": "Confirmed: admins can always delete (no predicate needed).", "author": "Dubravko Krasnjak", "createdAt": "2026-08-10T11:00:00.000Z", "resolvedAt": "2026-08-11T08:00:00.000Z" } ]}What this model produces
Section titled “What this model produces”The acm 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.
- **ACM v0.1.0** — `models/acm.json`. Produces: Cedar/OPA/Cerbos policy code, aspect runtime, gap + compliance reports, matrix PNG export. Oracle: acm_check_coverage: every screen needs a rule; acm_matrix projections must match the authored policies. Downstream: `ctxbrew semantics acm` · `ctxbrew://semantics/acm/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 acm --schema-version 0.1.0 - MCP —
ctxbrew://semantics/acm/v0.1.0 - HTTP —
https://contextbrew.dev/schemas/acm/v0.1/semantics.json
See the schemas overview for the versioning policy and how these files are generated and kept in sync.






