Skip to content

acm schema (v0.1)

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

PropertyTypeRequiredDescription
type"acm"yes
versionstringyes
projectstringyes
rolesAcmRole[]yes
screensAcmScreenPolicy[]yes
predicatesAcmPredicate[]yes
linksobjectyes
annotationsAcmAnnotation[]yes

TS-core-013 — annotation shape (mirror of AnnotationSchema in acm-validate.ts; kept here so consumers don’t need a zod dependency).

PropertyTypeRequiredDescription
idstringyes
targetType"cell" | "rule"yes
targetIdstringyes
bodystringyes
authorstringyes
createdAtstringyes
resolvedAtstringyes

Shared types for ACM generators

Type: "ALLOW" | "DENY" | "CONDITIONAL"

PropertyTypeRequiredDescription
idstringyes
expressionstringyes
compiledPredicateIRnoCompiled 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.
PropertyTypeRequiredDescription
idstringyes
labelstringyes
inheritsstringno
descriptionstringno
PropertyTypeRequiredDescription
rolestringyes
effectAcmEffectyes
actionsstring[]yes
predicatestringno
PropertyTypeRequiredDescription
screenstringyes
routestringyes
rulesAcmRule[]yes
PropertyTypeRequiredDescription
source"principal" | "resource" | "environment"yes
pathstringyes

Type: "==" | "!=" | "<" | ">" | "<=" | ">="

PropertyTypeRequiredDescription
type"literal"yes
valuestringyes
PropertyTypeRequiredDescription
type"array"yes
valuesstring[]yes

Type: object

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.

↓ download
demo-01-rbac-only.acm.json — Context Studio canvas view

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)
demo-01-rbac-only.acm.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": []
}
↓ download
demo-02-abac-with-predicates.acm.json — Context Studio canvas view

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)
demo-02-abac-with-predicates.acm.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": []
}
↓ download
demo-03-annotations.acm.json — Context Studio canvas view

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)
demo-03-annotations.acm.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"
}
]
}

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.

paste into AGENTS.md / CLAUDE.md
- **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.