~/bend-docscommunity

owned_event_family_storage.bend checks

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

6 imports
import Base
import ./world.bend as W
import ./world_resource_owner.bend as Resource
import ./owner_product.bend as Product
import ./capabilities.bend as Cap
import ./owned_event_log.bend as Log

Templates

template log_returned source · line 12 · raw

@-S:Data -> @-C:Type -> @-R:Type -> @-P:Type -> @-Rest:Type -> @-E:Data -> @-path:0x296ca5f551e3792cd56cfc8122905b94/owner_product.Lens<R, 0x296ca5f551e3792cd56cfc8122905b94/owned_event_log.Log<P>, Rest> -> @-Out:Type -> @worldRest:0x296ca5f551e3792cd56cfc8122905b94/world_resource_owner.Rest<S, C, R, E> -> @resourceRest:Rest -> @result:Pair(0x296ca5f551e3792cd56cfc8122905b94/owned_event_log.Log<P>, Out) -> Pair(0x296ca5f551e3792cd56cfc8122905b94/world.World<S, C, R, E>, Out)

Trusted engine helpers. Ordinary product declarations bind the canonical log path and matching key route; gameplay receives only its abstract capability. R is the entire heterogeneous resource tree, E the existing Data publication tree. No Type payload or unrelated resource owner is copied or reconstructed.

template log_taken source · line 15 · raw

@-S:Data -> @-C:Type -> @-R:Type -> @-P:Type -> @-Rest:Type -> @-E:Data -> @-path:0x296ca5f551e3792cd56cfc8122905b94/owner_product.Lens<R, 0x296ca5f551e3792cd56cfc8122905b94/owned_event_log.Log<P>, Rest> -> @-Out:Type -> @effect:(@_:0x296ca5f551e3792cd56cfc8122905b94/owned_event_log.Log<P> -> Pair(0x296ca5f551e3792cd56cfc8122905b94/owned_event_log.Log<P>, Out)) -> @worldRest:0x296ca5f551e3792cd56cfc8122905b94/world_resource_owner.Rest<S, C, R, E> -> @result:Pair(Rest, 0x296ca5f551e3792cd56cfc8122905b94/owned_event_log.Log<P>) -> Pair(0x296ca5f551e3792cd56cfc8122905b94/world.World<S, C, R, E>, Out)

template resource_taken source · line 18 · raw

@-S:Data -> @-C:Type -> @-R:Type -> @-P:Type -> @-Rest:Type -> @-E:Data -> @-path:0x296ca5f551e3792cd56cfc8122905b94/owner_product.Lens<R, 0x296ca5f551e3792cd56cfc8122905b94/owned_event_log.Log<P>, Rest> -> @-Out:Type -> @effect:(@_:0x296ca5f551e3792cd56cfc8122905b94/owned_event_log.Log<P> -> Pair(0x296ca5f551e3792cd56cfc8122905b94/owned_event_log.Log<P>, Out)) -> @result:Pair(0x296ca5f551e3792cd56cfc8122905b94/world_resource_owner.Rest<S, C, R, E>, R) -> Pair(0x296ca5f551e3792cd56cfc8122905b94/world.World<S, C, R, E>, Out)

template with_log source · line 21 · raw

@-S:Data -> @-C:Type -> @-R:Type -> @-P:Type -> @-Rest:Type -> @-E:Data -> @-path:0x296ca5f551e3792cd56cfc8122905b94/owner_product.Lens<R, 0x296ca5f551e3792cd56cfc8122905b94/owned_event_log.Log<P>, Rest> -> @-Out:Type -> @effect:(@_:0x296ca5f551e3792cd56cfc8122905b94/owned_event_log.Log<P> -> Pair(0x296ca5f551e3792cd56cfc8122905b94/owned_event_log.Log<P>, Out)) -> @world:0x296ca5f551e3792cd56cfc8122905b94/world.World<S, C, R, E> -> Pair(0x296ca5f551e3792cd56cfc8122905b94/world.World<S, C, R, E>, Out)

template injected source · line 24 · raw

@-E:Data -> @-inject:(@_:Nat -> E) -> @ids:List<&2, Nat> -> List<&2, E>

template published source · line 28 · raw

@-S:Data -> @-C:Type -> @-R:Type -> @-E:Data -> @-inject:(@_:Nat -> E) -> @result:Pair(0x296ca5f551e3792cd56cfc8122905b94/world.World<S, C, R, E>, List<&2, Nat>) -> 0x296ca5f551e3792cd56cfc8122905b94/world.World<S, C, R, E>

template commit_owned source · line 34 · raw

@-S:Data -> @-C:Type -> @-R:Type -> @-P:Type -> @-Rest:Type -> @-E:Data -> @-path:0x296ca5f551e3792cd56cfc8122905b94/owner_product.Lens<R, 0x296ca5f551e3792cd56cfc8122905b94/owned_event_log.Log<P>, Rest> -> @-inject:(@_:Nat -> E) -> @world:0x296ca5f551e3792cd56cfc8122905b94/world.World<S, C, R, E> -> @values:List<&1, P> -> 0x296ca5f551e3792cd56cfc8122905b94/world.World<S, C, R, E>

The transaction adapter calls this after successful canonical ECS finish. One caller batch retains its FIFO; cross-family action order belongs to that adapter, using the existing publication journal, not a regrouping by payload type/family.

template retain source · line 38 · raw

@-S:Data -> @-C:Type -> @-R:Type -> @-P:Type -> @-Rest:Type -> @-E:Data -> @-path:0x296ca5f551e3792cd56cfc8122905b94/owner_product.Lens<R, 0x296ca5f551e3792cd56cfc8122905b94/owned_event_log.Log<P>, Rest> -> @-select:(@_:List<&2, E> -> List<&2, Nat>) -> @world:0x296ca5f551e3792cd56cfc8122905b94/world.World<S, C, R, E> -> @records:List<&2, E> -> Pair(0x296ca5f551e3792cd56cfc8122905b94/world.World<S, C, R, E>, List<&1, 0x296ca5f551e3792cd56cfc8122905b94/owned_event_log.Row<P>>)

The runtime chooses surviving records using its unchanged per-family retention policy, then calls each family's selected path with those records.

template drain source · line 43 · raw

@-S:Data -> @-C:Type -> @-R:Type -> @-P:Type -> @-Rest:Type -> @-E:Data -> @-path:0x296ca5f551e3792cd56cfc8122905b94/owner_product.Lens<R, 0x296ca5f551e3792cd56cfc8122905b94/owned_event_log.Log<P>, Rest> -> @world:0x296ca5f551e3792cd56cfc8122905b94/world.World<S, C, R, E> -> Pair(0x296ca5f551e3792cd56cfc8122905b94/world.World<S, C, R, E>, List<&1, 0x296ca5f551e3792cd56cfc8122905b94/owned_event_log.Row<P>>)

Drain only this log, preserving its next ID and every publication. The outer shutdown drains ALL family logs and clears their publication tree atomically before any reader runs. Clearing shared records here would lose sibling events.

template read source · line 48 · raw

@-S:Data -> @-C:Type -> @-R:Type -> @-P:Type -> @-Rest:Type -> @-E:Data -> @-path:0x296ca5f551e3792cd56cfc8122905b94/owner_product.Lens<R, 0x296ca5f551e3792cd56cfc8122905b94/owned_event_log.Log<P>, Rest> -> @-Request:Type -> @-Projection:Data -> @-Args:Type -> @-Observation:Type -> @-at:(@_:P -> @_:Request -> Pair(P, Projection)) -> @-body:(@-H:Type -> @-read:0x296ca5f551e3792cd56cfc8122905b94/capabilities.Request<H, Request, Projection> -> @_:H -> @_:Args -> Pair(H, Observation)) -> @world:0x296ca5f551e3792cd56cfc8122905b94/world.World<S, C, R, E> -> @id:Nat -> @args:Args -> Pair(0x296ca5f551e3792cd56cfc8122905b94/world.World<S, C, R, E>, 0x296ca5f551e3792cd56cfc8122905b94/owned_event_log.ReadResult<Args, Observation>)

Read only the log at the declaration's path. IDs are local to that family; the ordinary adapter first projects the reader's IDs through the matching key route. Trusted at preserves its owner; the abstract body cannot extract that owner.