Skip to main content

Module projection

Module projection 

Source
Expand description

L2 Projection observer pipeline.

L0 emits deterministic events; L2 turns those events into denormalized read-model rows that PG (or another store) serves to higher layers. This module exposes: the Projection trait, a ProjectionRouter that dispatches EventRecords by TypeCode, a ProjectionStore abstraction, an in-memory store, and active / passive / draining lifecycle transitions.

The PG-backed store, the L0 observer bridge, and the kernel_projection_state chain-anchored view route through the trait surface.

Structs§

ActivityProjection
Activity read-model row — ActivityRecord + optional Extension-target shell marker.
ActorProjection
Actor-facing read-model row — ActorProfile + optional UserBinding.
CrossShellActivityFanout
Read-only fanout projection for CrossShellActivity. Stores cross-shell notifications keyed by the target shell — never touches the source shell’s rows, preserving shell isolation (E-act-2 RA tier).
EntryProjection
Entry read-model row — EntryCore + body metadata + depth cache.
InMemoryProjectionStore
In-memory ProjectionStore — intended for tests and Tier-0 dev runs.
ProjectionContext
Per-dispatch context carried alongside an EventRecord. The 'i lifetime reserves the slot that binds to the L0 Effect<'i, Authorized> borrow, and also scopes the optional manifest snapshot reference.
ProjectionCursor
(u64, Tick) pair tracking the last event applied.
ProjectionRouter
Event-stream dispatcher. Matches incoming events to registered projections by TypeCode, enforces dedup + gap detection via Projection::last_applied, and propagates observer state transitions.
SpaceProjection
Space read-model row — SpaceConfig + parent-chain cache + membership.

Enums§

ObserverState
Observer worker lifecycle (active-passive HA).
ProjectionError
Projection-side failure taxonomy.
PromotionDecision
Outcome of an auto-promote policy evaluation.

Constants§

HF2_HEALTH_QUORUM_MIN
Minimum number of KMS health channels that must report Healthy for the after_60min auto-promote policy to clear its guardrail. Matches the default 2-of-3 quorum — operators that provision more channels can re-tune via a future manifest field.

Traits§

Projection
L2 projection worker. Each implementor owns a read-model view that is kept in sync with the L1 event stream for a specific set of TypeCodes.
ProjectionStore
Storage abstraction for projection rows. An in-memory implementation ships with this crate; PG-backed storage plugs in at the L2 service layer.