Skip to content

Substrate Contract

Every plugin in HoloMUSH is a consumer of the substrate. This page is the reference inventory of the surfaces plugins can rely on. For the rules that govern the plugin–substrate relationship and why they exist, see Substrate contract invariants; for the procedure to declare and register emit types, see Register plugin emit types.

Canonical detail lives in the design spec: Substrate Contract Design Spec.

Substrate primitives plugin authors can rely on

Section titled “Substrate primitives plugin authors can rely on”

These surfaces are stable for the lifetime of the spec. You do not need to implement them; the substrate provides them turn-key.

PrimitiveWhat it doesWhere it lives
JetStream event busDurable per-stream delivery, replay, history fallback, ULID identity, JetStream-seq orderinginternal/eventbus/Publisher, Subscriber, HistoryReader interfaces
Crypto envelopePer-event-type sensitivity enforcement, KEK/DEK rotation, AuthGuard fence, INV-50 downgrade fenceinternal/plugin/event_emitter.go, internal/plugin/sensitivity_fence.go
Manifest emit-type validation (INV-S5)Startup-time fail-fast when manifest declared set does not equal code-registered setinternal/plugin/manager.go::loadPlugin
ABAC enginePolicy evaluation, attribute resolution wiring, default-deny postureinternal/access/access.Engine interface
Focus coordinatorPer-connection subscription state, multi-tab visibility, restore-on-reconnectinternal/grpc/focus/, pkg/plugin/focus_client.go
Plugin host RPCs (Go + Lua parity)Emit, QueryHistory, JoinFocus/LeaveFocus/PresentFocus, PluginAuditService.AuditEventpkg/plugin/ (Go SDK), internal/plugin/hostfunc/ (Lua hostfuncs)
Per-plugin storageIsolated Postgres schema + role, embedded migration runner, search_path scopinginternal/store/, plugin’s migrations/
Audit projectionHost ack-and-skip for plugin-owned subjects; dispatch to plugin’s AuditEvent RPCinternal/eventbus/audit/

For the full substrate inventory with path:line citations, see §1 of the substrate-contract spec.

eventkit and groupkit SDKs (named, not yet built)

Section titled “eventkit and groupkit SDKs (named, not yet built)”

pkg/plugin/eventkit/ and pkg/plugin/groupkit/ are co-designed in the substrate-contract spec but their code lands only after N=2 validation (see Substrate contract invariants). Today, plugins implement event-replay, group-membership, and focus-wire patterns inline (scenes-bespoke, channels-bespoke).

SDKLocationPrimitives (planned)Who can use it
eventkitpkg/plugin/eventkit/replay (ABAC-filtered history fan-out), cryptoemit (call-site sensitivity assertion)Any plugin emitting ABAC-gated sensitive events
groupkitpkg/plugin/groupkit/membership, focuswire, groupabacUses with explicit member-of-entity state (scenes, channels)

Specs:

ADRs (theme:social-spaces):