~/bend-docscommunity

ordinary_owned_event_declaration.bend checks

raw source on the hub · import bendvy-ecs-core@0.1.0.0/ordinary_owned_event_declaration.bend as Ordinary_owned_event_declaration

4 imports
import Base
import ./owner_product.bend as Product
import ./capabilities.bend as Cap
import ./owned_event_journal.bend as Frame

Types

type Description source · line 18 · raw

Data

Detached metadata listing owned event-domain names and whether it is opaque. Names describe provisioned publication uses; they do not grant access or prove that a hand-authored builder targets the named log. Canonical constructors supply this metadata together with their typed operational bindings.

type Declaration source · line 41 · raw

@-S:Data -> @-State:Type -> @-Recovery:Type -> @-Ops:(@_:Type -> Type) -> @-builder:Builder(State, Recovery, Ops) -> Type

Static publisher declaration carrying a recovery constructor and access names; State, Recovery, Ops and builder keep its operational route typed. Canonical ordinary-owned-event-family-write.declaration supplies the matching log/recovery paths. Payloads may be arbitrary affine Type values; this is not a Data-event stream reader and does not duplicate payloads for multiple readers. Legacy Declaration has opaque metadata. Described adds operational-domain metadata; automatic App publisher registration requires a complete description. Classic publisher registration remains available for the legacy form. Raw constructors/builders are trusted administration, not a gameplay permission API. See docs/parity/affine-events.md for ownership and qualified publication bounds.

Definitions

def pair_description source · line 22 · raw

@left:Description -> @right:Description -> Description

Combine metadata left first, preserving duplicate names and propagating opacity from either side. This does not combine live logs or publish payloads.

def complete source · line 28 · raw

@value:Description -> Bool

Report whether the description is nonopaque. This is the automatic App metadata-admission test, not validation of arbitrary builders or runtime log existence. Use canonical declarations rather than asserting trusted metadata.

Templates

template Builder source · line 12 · raw

@-State:Type -> @-Recovery:Type -> @-Ops:(@_:Type -> Type) -> Type

Canonical event declarations compose heterogeneous payload grants with one ordered journal. Builder remains erased until the full recovery tree is known. Raw constructors/builders are trusted engine administration, not gameplay. Advanced erased builder for an owned-event publication grant family. Specializes the journal recovery path only after the complete heterogeneous recovery product is known. Gameplay receives abstract emission grants rather than constructing runtime journal paths or retaining raw payload aliases.

template empty source · line 47 · raw

@-S:Data -> @-State:Type -> @-Recovery:Type -> @-Ops:(@_:Type -> Type) -> @-builder:Builder(State, Recovery, Ops) -> @value:Declaration<S, State, Recovery, Ops, builder> -> @_:Unit -> Recovery

Consume a declaration and obtain its fresh recovery-owner constructor. It initializes the finish-time recovery accumulator; it does not copy payloads, publish an event, retire a log entry or execute cleanup.

template access source · line 54 · raw

@-S:Data -> @-State:Type -> @-Recovery:Type -> @-Ops:(@_:Type -> Type) -> @-builder:Builder(State, Recovery, Ops) -> @value:Declaration<S, State, Recovery, Ops, builder> -> List<&2, String>

Consume a declaration and return its Registry access strings in stored order. These are metadata, not a reader cursor, payload owner or substitute for the builder's schema-bound publication grant.

template description source · line 61 · raw

@-S:Data -> @-State:Type -> @-Recovery:Type -> @-Ops:(@_:Type -> Type) -> @-builder:Builder(State, Recovery, Ops) -> @value:Declaration<S, State, Recovery, Ops, builder> -> Description

Consume a declaration and obtain its detached event-use description. Legacy Declaration yields an opaque description; Described yields the supplied one. This operation does not read logs, advance readers or publish events.

template PairOps source · line 67 · raw

@-L:(@_:Type -> Type) -> @-R:(@_:Type -> Type) -> @H:Type -> Type

Operation-family alias for left/right emission grants on the same opaque journal stage. Its order matches the recovery product produced by both.

template pair_empty source · line 68 · raw

@-L:Type -> @-R:Type -> @-left:(@_:Unit -> L) -> @-right:(@_:Unit -> R) -> @unit:Unit -> 0x296ca5f551e3792cd56cfc8122905b94/owner_product.Owner<L, R>

template pair_grant source · line 69 · raw

@-S:Data -> @-State:Type -> @-L:Type -> @-R:Type -> @-LOps:(@_:Type -> Type) -> @-ROps:(@_:Type -> Type) -> @-left:Builder(State, L, LOps) -> @-right:Builder(State, R, ROps) -> @-All:Type -> @-Rest:Type -> @-path:0x296ca5f551e3792cd56cfc8122905b94/owner_product.Lens<All, 0x296ca5f551e3792cd56cfc8122905b94/owner_product.Owner<L, R>, Rest> -> @unit:Unit -> 0x296ca5f551e3792cd56cfc8122905b94/capabilities.Bundle<LOps(0x296ca5f551e3792cd56cfc8122905b94/owned_event_journal.Stage<State, All>), ROps(0x296ca5f551e3792cd56cfc8122905b94/owned_event_journal.Stage<State, All>)>

template both source · line 84 · raw

@-S:Data -> @-State:Type -> @-L:Type -> @-R:Type -> @-LOps:(@_:Type -> Type) -> @-ROps:(@_:Type -> Type) -> @-leftBuilder:Builder(State, L, LOps) -> @-rightBuilder:Builder(State, R, ROps) -> @-left:Declaration<S, State, L, LOps, leftBuilder> -> @-right:Declaration<S, State, R, ROps, rightBuilder> -> Declaration<S, State, 0x296ca5f551e3792cd56cfc8122905b94/owner_product.Owner<L, R>, PairOps(LOps, ROps), pair_grant(S, State, L, R, LOps, ROps, leftBuilder, rightBuilder)>

Compose owned-event declarations for the same schema and staged State. The body receives Cap.Bundle{left, right}; recovery is the corresponding Product.Owner<LeftRecovery, RightRecovery>. Access/domain lists remain left first, with duplicates; opaque metadata on either side remains opaque. One shared staged journal preserves actual emission order across families, not declaration grouping. The publisher commits payload owners only on success; on abort it publishes none and returns staged owners through the typed recovery product, preserving each family's order. The declaration itself executes none of these actions. No owner restored by another required ECS rollback may also be returned as recovered event data, and no automatic IO finalizer is implied. Use ordinary-owned-event-family-write.declaration for each canonical leaf and ordinary-owned-event-family-publisher for execution. Reader projection, retention and retirement use their separate owned-event APIs.

template identity_take source · line 86 · raw

@-R:Type -> @value:R -> Pair(Unit, R)

template identity_put source · line 87 · raw

@-R:Type -> @unit:Unit -> @value:R -> R

template identity source · line 90 · raw

@-R:Type -> 0x296ca5f551e3792cd56cfc8122905b94/owner_product.Lens<R, R, Unit>

Advanced builder lens selecting the complete recovery owner with Unit rest. It threads the owner rather than copying it; it does not publish or abort events.

template root_grant source · line 95 · raw

@-S:Data -> @-State:Type -> @-Recovery:Type -> @-Ops:(@_:Type -> Type) -> @-builder:Builder(State, Recovery, Ops) -> Ops(0x296ca5f551e3792cd56cfc8122905b94/owned_event_journal.Stage<State, Recovery>)

Advanced publisher projection: instantiate builder at the full recovery owner and return its emission operations. The runner supplies the opaque journal stage; gameplay does not construct raw paths, expose stored owners or decide publication by invoking this projection outside the publisher protocol.