~/bend-docscommunity

restore_save.bend checks

raw source on the hub · import bendvy-ecs-core@0.1.0.7/restore_save.bend as Restore_save

5 imports
import Base
import ./snapshot_schema.bend as Schema
import ./ordinary_schema.bend as Ordinary
import ./owner_product.bend as Product
import ./decode_data.bend as D

Templates

template resources_join source · line 7 · raw

@-User:Type -> @-Logs:Type -> @logs:Logs -> @observed:Pair(User, List<&2, 0x7e321819d0ff210531780719c7674cef/decode_data.Field>) -> Pair(0x7e321819d0ff210531780719c7674cef/owner_product.Owner<User, Logs>, List<&2, 0x7e321819d0ff210531780719c7674cef/decode_data.Field>)

template resources source · line 12 · raw

@-User:Type -> @-Logs:Type -> @-project:(@_:User -> Pair(User, List<&2, 0x7e321819d0ff210531780719c7674cef/decode_data.Field>)) -> @owner:0x7e321819d0ff210531780719c7674cef/owner_product.Owner<User, Logs> -> Pair(0x7e321819d0ff210531780719c7674cef/owner_product.Owner<User, Logs>, List<&2, 0x7e321819d0ff210531780719c7674cef/decode_data.Field>)

Advanced save projection for Product.Owner<User,Logs>: project only User and return both actual owners. Logs are retained unchanged, not serialized as fields.

template with_events source · line 21 · raw

@-S:Data -> @-C:Type -> @-User:Type -> @-Logs:Type -> @-components:(@_:U32 -> @_:C -> Pair(C, List<&2, 0x7e321819d0ff210531780719c7674cef/decode_data.Field>)) -> @-user:(@_:User -> Pair(User, List<&2, 0x7e321819d0ff210531780719c7674cef/decode_data.Field>)) -> @schema:0x7e321819d0ff210531780719c7674cef/snapshot_schema.Schema<S, C, User, True{}, components, user> -> 0x7e321819d0ff210531780719c7674cef/snapshot_schema.Schema<S, C, 0x7e321819d0ff210531780719c7674cef/owner_product.Owner<User, Logs>, True{}, components, resources(User, Logs, user)>

Affine event logs are runtime state, never ordinary persisted resource entries. Lift a save-eligible user-resource schema over its affine event-log owner. Keep the same declaration inventory/component projection and serialize only user resources; logs remain runtime state and are returned intact by the projection. This does not save readers, retained batches or a replayable event checkpoint. See docs/parity/restore-basic.md for the separate runtime restore boundary.