restore_save.bend checks
raw source on the hub · import bendvy-ecs-core@0.1.0.2/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, 0xb2b0f04555daca474f0f77d0966945c9/decode_data.Field>) -> Pair(0xb2b0f04555daca474f0f77d0966945c9/owner_product.Owner<User, Logs>, List<&2, 0xb2b0f04555daca474f0f77d0966945c9/decode_data.Field>)
template resources source · line 12 · raw
@-User:Type -> @-Logs:Type -> @-project:(@_:User -> Pair(User, List<&2, 0xb2b0f04555daca474f0f77d0966945c9/decode_data.Field>)) -> @owner:0xb2b0f04555daca474f0f77d0966945c9/owner_product.Owner<User, Logs> -> Pair(0xb2b0f04555daca474f0f77d0966945c9/owner_product.Owner<User, Logs>, List<&2, 0xb2b0f04555daca474f0f77d0966945c9/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, 0xb2b0f04555daca474f0f77d0966945c9/decode_data.Field>)) -> @-user:(@_:User -> Pair(User, List<&2, 0xb2b0f04555daca474f0f77d0966945c9/decode_data.Field>)) -> @schema:0xb2b0f04555daca474f0f77d0966945c9/snapshot_schema.Schema<S, C, User, True{}, components, user> -> 0xb2b0f04555daca474f0f77d0966945c9/snapshot_schema.Schema<S, C, 0xb2b0f04555daca474f0f77d0966945c9/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.