Skip to Content

Modules

The generated repository inventory lists module IDs, services, settings, defaults, readiness, and capability counts from moduleRegistry.

Ownership

A module definition lives beside its domain implementation and binds its functional service factories, capabilities, and availability metadata. The API runtime uses createModuleRuntime to bind every declared factory exactly once with its concrete stores and infrastructure dependencies. Missing or unknown service bindings fail at the composition boundary.

Code-owned readiness states whether that implemented journey is available in an application. A persisted workspace setting controls enablement. The module service combines both; a setting cannot make incomplete behavior ready.

Module IDs and modules.<id>.enabled setting keys are derived from the registry. Adding a definition does not require editing parallel schema unions. Capabilities outside a switchable module must be listed explicitly as always-on. API tests require every capability to be classified exactly once.

GET /v1/modules returns the effective matrix. Applications use it for navigation, actions, data fetching, and direct-route guards. Module-owned API operations enforce the same setting through endpoint policy.

The AI module owns Dawn conversations and actions. It does not own the patient, notes, messaging, or scheduling capabilities that Dawn may invoke.

Failure modes

  • Ready and enabled resolves to enabled.
  • Ready and disabled resolves to disabled.
  • Not ready resolves to unavailable, regardless of the setting.
  • A module-owned request fails with module_disabled or module_unavailable before domain work.
  • Duplicate module IDs or capability ownership fail while loading the registry.
  • A capability that is unclassified or both module-owned and always-on fails validation.
  • Malformed capability IDs and non-functional service bindings fail while defining the module. API tests reject unknown or unbound capabilities.
  • Missing or unknown service dependencies fail while composing the module runtime.
  • Registry changes require pnpm inventory:generate; drift fails pnpm inventory:check.
Last updated on