Entity model overview
The five registry types that constitute the Fabric ontology — and how they relate.
Fabric's "entities" are not database rows. They are typed identifiers in registries. Five registries make up the ontology surface:
| Registry | Holds | Source |
|---|---|---|
| Object types | PascalCase names (Vehicle) | packages/platform/objects/index.ts |
| Subject types | Strings used by event subjectType | packages/platform/events/index.ts |
| Event types | PascalCase past-tense names | packages/platform/events/index.ts |
| Action IDs | <namespace>.<verb> strings | packages/platform/actions/index.ts |
| Policy IDs | <id>.v<version> strings | packages/platform/policies/index.ts |
A FabricModule populates these registries at app startup. Nothing else is allowed to write to them at runtime.
How they relate
Object types
A registered object type is a string the platform recognizes as a kind of entity. Validation rule: PascalCase alphanumeric (/^[A-Z][a-zA-Z0-9]*$/). Every event's subjectType must reference a registered subject type (which usually equals an object type).
The platform pre-registers a small set of cross-industry governance types and zero industry types. See built-ins.
Action IDs
Format: <namespace>.<snake_case_verb> — e.g. lending.accept_offer. Validation regex: /^[a-z][a-z0-9-]*\.[a-z][a-z0-9_]*$/.
Two stability rules:
- An action ID is permanent. Renaming it breaks every audit log row, every policy reference, every projection that filtered on it.
- The action's
versionfield is for implementation changes (handler logic, schema). The ID itself is immutable.
Event types
Format: PascalCase past-tense fact (OfferAccepted, LeadIngested). Registered via FabricModule.eventTypes. Schema versioning is per-event-type with an integer eventSchemaVersion on each envelope.
Policy IDs
Format: <id>.v<integer> — e.g. lending.credit_pull_consent.v1. The version is part of the ID. A new version is a new policy. Old invocations remain bound to whichever version evaluated them.
State machines
Registered per entityType. A state machine is a graph of (from, to, causedByAction) transitions plus an optional guard predicate. The runtime calls validateTransition before atomic action handlers run.
States carry a StateClass:
type StateClass =
| "initial"
| "active"
| "action_required"
| "waiting"
| "terminal"
| "exception";Used by UI to render badges and by reporting to compute funnel/conversion metrics.
See also
- Built-in entities — the fixed set the platform pre-registers.
- Extending with vertical types — adding your own.
- Invariants — state-machine and registry constraints.