Skip to content

Event Publishing Model

Executive Summary

Event Publishing Model defines how Algosure modules publish events. Source Domains publish their own domain events, application services publish use-case events where appropriate, and integration boundaries publish integration events after external observations are interpreted by the owning Domain.

Why This Exists

Publishing rules protect source ownership. Events must not be published by generic infrastructure, analytics, notifications, AIOS, or integration components on behalf of Domains unless the owning module accepts the fact.

Owner

The owner is the Chief Product Officer and Enterprise Architect.

Business Value

Governed publishing prevents duplicate facts, accidental ownership transfer, hidden coupling, and unreliable process coordination.

Publishing Flow

sequenceDiagram
    participant API as API Boundary
    participant App as Application Service
    participant Domain as Source Domain
    participant Store as Module-Owned Persistence
    participant Outbox as Outbox Boundary
    participant Mesh as Event Mesh

    API->>App: Execute tenant-scoped command
    App->>Domain: Apply business behavior
    Domain-->>App: Produce domain event
    App->>Store: Persist owned state
    App->>Outbox: Record event with metadata
    Outbox->>Mesh: Publish event reliably

Publisher Responsibilities

Responsibility Requirement
Own event meaning Publisher owns the business fact and event compatibility.
Use past tense Published event names must describe facts that happened.
Include metadata Publisher provides required event metadata.
Preserve tenant context Publisher ensures tenant and organization context are present where applicable.
Publish after valid state change Domain events should reflect accepted business state, not failed attempts.
Use outbox when reliability matters Important events should be recorded alongside state changes.

Publishing Rules

Rule Meaning
Source Domain publishes source fact Compliance publishes compliance facts; Bid publishes bid facts; Billing publishes billing facts.
Application events are owned by use-case boundary Workflow-level facts are published by the application service that owns the use case.
Integration observations are interpreted first External observations become events only after an owning module accepts their business meaning.
AIOS does not publish source-domain facts AIOS may publish AI task facts through Intelligence but cannot publish Compliance, Bid, or Funding facts.
Notification publishes delivery facts only Notification owns delivery lifecycle events, not source business completion.
Analytics publishes analytical facts only Analytics owns projections, reports, and insight events, not operational source facts.

Non-Implementation Boundary

This document does not define event APIs, Spring event classes, transaction configuration, outbox implementation, broker publication, or queue topology.