~/bend-docscommunity

restore_runtime.bend checks

raw source on the hub · import 0x67fd5084c1da4adc13317822045bb11f/restore_runtime.bend as Restore_runtime

17 imports
import Base
import ./change_tick.bend as Tick
import ./restore_public.bend as Public
import ./restore_schema.bend as Schema
import ./restore_data.bend as R
import ./restore_prepare.bend as Prepare
import ./restore_apply.bend as Apply
import ./restore_world.bend as Adapter
import ./snapshot_data.bend as Snapshot
import ./decode_data.bend as D
import ./world.bend as W
import ./event_family_routing.bend as Route
import ./event_family_runtime.bend as Family
import ./ordinary_owned_event_family_reader.bend as Reader
import ./owned_event_family_maintenance.bend as Maintenance
import ./owned_event_family_catalog.bend as Catalog
import ./owner_product.bend as Product

Templates

template packed source · line 19 · raw

@-S:Data -> @-C:Type -> @-User:Type -> @-Logs:Type -> @-E:Data -> @-F:Type -> @-EventOwners:Type -> @-Receipt:Type -> @-State:Type -> @-Custom:Data -> @-stage:(@_:State -> @_:0x67fd5084c1da4adc13317822045bb11f/restore_data.Position -> @_:0x67fd5084c1da4adc13317822045bb11f/decode_data.Field -> Pair(State, 0x67fd5084c1da4adc13317822045bb11f/restore_data.Dispatch<Custom>)) -> @-release:(@_:State -> State) -> @-clear:(@_:C -> @_:0x67fd5084c1da4adc13317822045bb11f/world.Handle<S> -> Pair(C, List<&2, 0x67fd5084c1da4adc13317822045bb11f/restore_data.Change<S>>)) -> @-insert:(@_:C -> @_:0x67fd5084c1da4adc13317822045bb11f/owner_product.Owner<User, Logs> -> @_:State -> @_:List<&2, 0x67fd5084c1da4adc13317822045bb11f/restore_data.Binding<S>> -> @_:0x67fd5084c1da4adc13317822045bb11f/change_tick.Tick -> Pair(Pair(C, 0x67fd5084c1da4adc13317822045bb11f/owner_product.Owner<User, Logs>), State)) -> @-emit:(@_:0x67fd5084c1da4adc13317822045bb11f/restore_data.Change<S> -> E) -> @-retain:(@_:Logs -> @_:List<&2, E> -> Pair(Logs, Receipt)) -> @-drain:(@_:Logs -> Pair(Logs, Receipt)) -> @-clearStreams:(@_:F -> F) -> @-catalog:0x67fd5084c1da4adc13317822045bb11f/owned_event_family_catalog.Catalog<E, Logs, F, Receipt, retain, drain, clearStreams> -> @-sync:(@_:F -> @_:Nat -> @_:List<&2, E> -> F) -> @-Recovery:Type -> @-commit:(@_:State -> State) -> @-takeRecovery:(@_:State -> Pair(State, Recovery)) -> @synchronize:Bool -> @family:0x67fd5084c1da4adc13317822045bb11f/event_family_runtime.State<E, F, EventOwners> -> @tick:Nat -> @receipt:Maybe<&1, Receipt> -> @observed:Pair(0x67fd5084c1da4adc13317822045bb11f/world.World<S, C, 0x67fd5084c1da4adc13317822045bb11f/owner_product.Owner<User, Logs>, E>, Pair(0x67fd5084c1da4adc13317822045bb11f/restore_public.Owner<S, C, 0x67fd5084c1da4adc13317822045bb11f/owner_product.Owner<User, Logs>, State, Custom, stage, release, clear, insert, Recovery, commit, takeRecovery>, Pair(0x67fd5084c1da4adc13317822045bb11f/restore_public.Outcome<S, Custom>, Recovery))) -> Pair(0x67fd5084c1da4adc13317822045bb11f/event_family_routing.Runtime<S, C, 0x67fd5084c1da4adc13317822045bb11f/owner_product.Owner<User, Logs>, E, 0x67fd5084c1da4adc13317822045bb11f/event_family_runtime.State<E, F, EventOwners>>, Pair(0x67fd5084c1da4adc13317822045bb11f/restore_public.Owner<S, C, 0x67fd5084c1da4adc13317822045bb11f/owner_product.Owner<User, Logs>, State, Custom, stage, release, clear, insert, Recovery, commit, takeRecovery>, Pair(0x67fd5084c1da4adc13317822045bb11f/restore_public.Outcome<S, Custom>, Pair(Recovery, Maybe<&1, Receipt>))))

template finished source · line 23 · raw

@-S:Data -> @-C:Type -> @-User:Type -> @-Logs:Type -> @-E:Data -> @-F:Type -> @-EventOwners:Type -> @-Receipt:Type -> @-State:Type -> @-Custom:Data -> @-stage:(@_:State -> @_:0x67fd5084c1da4adc13317822045bb11f/restore_data.Position -> @_:0x67fd5084c1da4adc13317822045bb11f/decode_data.Field -> Pair(State, 0x67fd5084c1da4adc13317822045bb11f/restore_data.Dispatch<Custom>)) -> @-release:(@_:State -> State) -> @-clear:(@_:C -> @_:0x67fd5084c1da4adc13317822045bb11f/world.Handle<S> -> Pair(C, List<&2, 0x67fd5084c1da4adc13317822045bb11f/restore_data.Change<S>>)) -> @-insert:(@_:C -> @_:0x67fd5084c1da4adc13317822045bb11f/owner_product.Owner<User, Logs> -> @_:State -> @_:List<&2, 0x67fd5084c1da4adc13317822045bb11f/restore_data.Binding<S>> -> @_:0x67fd5084c1da4adc13317822045bb11f/change_tick.Tick -> Pair(Pair(C, 0x67fd5084c1da4adc13317822045bb11f/owner_product.Owner<User, Logs>), State)) -> @-emit:(@_:0x67fd5084c1da4adc13317822045bb11f/restore_data.Change<S> -> E) -> @-retain:(@_:Logs -> @_:List<&2, E> -> Pair(Logs, Receipt)) -> @-drain:(@_:Logs -> Pair(Logs, Receipt)) -> @-clearStreams:(@_:F -> F) -> @-catalog:0x67fd5084c1da4adc13317822045bb11f/owned_event_family_catalog.Catalog<E, Logs, F, Receipt, retain, drain, clearStreams> -> @-sync:(@_:F -> @_:Nat -> @_:List<&2, E> -> F) -> @-Recovery:Type -> @-commit:(@_:State -> State) -> @-takeRecovery:(@_:State -> Pair(State, Recovery)) -> @schema:0x67fd5084c1da4adc13317822045bb11f/restore_schema.Schema<S, C, 0x67fd5084c1da4adc13317822045bb11f/owner_product.Owner<User, Logs>, State, Custom, stage, release, clear, insert, Recovery, commit, takeRecovery> -> @family:0x67fd5084c1da4adc13317822045bb11f/event_family_runtime.State<E, F, EventOwners> -> @tick:Nat -> @receipt:Receipt -> @result:0x67fd5084c1da4adc13317822045bb11f/restore_apply.ApplyResult<S, C, 0x67fd5084c1da4adc13317822045bb11f/owner_product.Owner<User, Logs>, E, State, Custom> -> Pair(0x67fd5084c1da4adc13317822045bb11f/event_family_routing.Runtime<S, C, 0x67fd5084c1da4adc13317822045bb11f/owner_product.Owner<User, Logs>, E, 0x67fd5084c1da4adc13317822045bb11f/event_family_runtime.State<E, F, EventOwners>>, Pair(0x67fd5084c1da4adc13317822045bb11f/restore_public.Owner<S, C, 0x67fd5084c1da4adc13317822045bb11f/owner_product.Owner<User, Logs>, State, Custom, stage, release, clear, insert, Recovery, commit, takeRecovery>, Pair(0x67fd5084c1da4adc13317822045bb11f/restore_public.Outcome<S, Custom>, Pair(Recovery, Maybe<&1, Receipt>))))

template drained source · line 27 · raw

@-S:Data -> @-C:Type -> @-User:Type -> @-Logs:Type -> @-E:Data -> @-F:Type -> @-EventOwners:Type -> @-Receipt:Type -> @-State:Type -> @-Custom:Data -> @-stage:(@_:State -> @_:0x67fd5084c1da4adc13317822045bb11f/restore_data.Position -> @_:0x67fd5084c1da4adc13317822045bb11f/decode_data.Field -> Pair(State, 0x67fd5084c1da4adc13317822045bb11f/restore_data.Dispatch<Custom>)) -> @-release:(@_:State -> State) -> @-clear:(@_:C -> @_:0x67fd5084c1da4adc13317822045bb11f/world.Handle<S> -> Pair(C, List<&2, 0x67fd5084c1da4adc13317822045bb11f/restore_data.Change<S>>)) -> @-insert:(@_:C -> @_:0x67fd5084c1da4adc13317822045bb11f/owner_product.Owner<User, Logs> -> @_:State -> @_:List<&2, 0x67fd5084c1da4adc13317822045bb11f/restore_data.Binding<S>> -> @_:0x67fd5084c1da4adc13317822045bb11f/change_tick.Tick -> Pair(Pair(C, 0x67fd5084c1da4adc13317822045bb11f/owner_product.Owner<User, Logs>), State)) -> @-emit:(@_:0x67fd5084c1da4adc13317822045bb11f/restore_data.Change<S> -> E) -> @-retain:(@_:Logs -> @_:List<&2, E> -> Pair(Logs, Receipt)) -> @-drain:(@_:Logs -> Pair(Logs, Receipt)) -> @-clearStreams:(@_:F -> F) -> @-catalog:0x67fd5084c1da4adc13317822045bb11f/owned_event_family_catalog.Catalog<E, Logs, F, Receipt, retain, drain, clearStreams> -> @-sync:(@_:F -> @_:Nat -> @_:List<&2, E> -> F) -> @-Recovery:Type -> @-commit:(@_:State -> State) -> @-takeRecovery:(@_:State -> Pair(State, Recovery)) -> @schema:0x67fd5084c1da4adc13317822045bb11f/restore_schema.Schema<S, C, 0x67fd5084c1da4adc13317822045bb11f/owner_product.Owner<User, Logs>, State, Custom, stage, release, clear, insert, Recovery, commit, takeRecovery> -> @prepared:0x67fd5084c1da4adc13317822045bb11f/restore_data.Prepared<State, Custom> -> @observed:Pair(0x67fd5084c1da4adc13317822045bb11f/event_family_routing.Runtime<S, C, 0x67fd5084c1da4adc13317822045bb11f/owner_product.Owner<User, Logs>, E, 0x67fd5084c1da4adc13317822045bb11f/event_family_runtime.State<E, F, EventOwners>>, Receipt) -> Pair(0x67fd5084c1da4adc13317822045bb11f/event_family_routing.Runtime<S, C, 0x67fd5084c1da4adc13317822045bb11f/owner_product.Owner<User, Logs>, E, 0x67fd5084c1da4adc13317822045bb11f/event_family_runtime.State<E, F, EventOwners>>, Pair(0x67fd5084c1da4adc13317822045bb11f/restore_public.Owner<S, C, 0x67fd5084c1da4adc13317822045bb11f/owner_product.Owner<User, Logs>, State, Custom, stage, release, clear, insert, Recovery, commit, takeRecovery>, Pair(0x67fd5084c1da4adc13317822045bb11f/restore_public.Outcome<S, Custom>, Pair(Recovery, Maybe<&1, Receipt>))))

template roomed source · line 30 · raw

@-S:Data -> @-C:Type -> @-User:Type -> @-Logs:Type -> @-E:Data -> @-F:Type -> @-EventOwners:Type -> @-Receipt:Type -> @-State:Type -> @-Custom:Data -> @-stage:(@_:State -> @_:0x67fd5084c1da4adc13317822045bb11f/restore_data.Position -> @_:0x67fd5084c1da4adc13317822045bb11f/decode_data.Field -> Pair(State, 0x67fd5084c1da4adc13317822045bb11f/restore_data.Dispatch<Custom>)) -> @-release:(@_:State -> State) -> @-clear:(@_:C -> @_:0x67fd5084c1da4adc13317822045bb11f/world.Handle<S> -> Pair(C, List<&2, 0x67fd5084c1da4adc13317822045bb11f/restore_data.Change<S>>)) -> @-insert:(@_:C -> @_:0x67fd5084c1da4adc13317822045bb11f/owner_product.Owner<User, Logs> -> @_:State -> @_:List<&2, 0x67fd5084c1da4adc13317822045bb11f/restore_data.Binding<S>> -> @_:0x67fd5084c1da4adc13317822045bb11f/change_tick.Tick -> Pair(Pair(C, 0x67fd5084c1da4adc13317822045bb11f/owner_product.Owner<User, Logs>), State)) -> @-emit:(@_:0x67fd5084c1da4adc13317822045bb11f/restore_data.Change<S> -> E) -> @-retain:(@_:Logs -> @_:List<&2, E> -> Pair(Logs, Receipt)) -> @-drain:(@_:Logs -> Pair(Logs, Receipt)) -> @-clearStreams:(@_:F -> F) -> @-catalog:0x67fd5084c1da4adc13317822045bb11f/owned_event_family_catalog.Catalog<E, Logs, F, Receipt, retain, drain, clearStreams> -> @-sync:(@_:F -> @_:Nat -> @_:List<&2, E> -> F) -> @-Recovery:Type -> @-commit:(@_:State -> State) -> @-takeRecovery:(@_:State -> Pair(State, Recovery)) -> @schema:0x67fd5084c1da4adc13317822045bb11f/restore_schema.Schema<S, C, 0x67fd5084c1da4adc13317822045bb11f/owner_product.Owner<User, Logs>, State, Custom, stage, release, clear, insert, Recovery, commit, takeRecovery> -> @state:State -> @+input:0x67fd5084c1da4adc13317822045bb11f/snapshot_data.Snapshot -> @family:0x67fd5084c1da4adc13317822045bb11f/event_family_runtime.State<E, F, EventOwners> -> @tick:Nat -> @+floor:U32 -> @observed:Pair(0x67fd5084c1da4adc13317822045bb11f/world.World<S, C, 0x67fd5084c1da4adc13317822045bb11f/owner_product.Owner<User, Logs>, E>, Bool) -> Pair(0x67fd5084c1da4adc13317822045bb11f/event_family_routing.Runtime<S, C, 0x67fd5084c1da4adc13317822045bb11f/owner_product.Owner<User, Logs>, E, 0x67fd5084c1da4adc13317822045bb11f/event_family_runtime.State<E, F, EventOwners>>, Pair(0x67fd5084c1da4adc13317822045bb11f/restore_public.Owner<S, C, 0x67fd5084c1da4adc13317822045bb11f/owner_product.Owner<User, Logs>, State, Custom, stage, release, clear, insert, Recovery, commit, takeRecovery>, Pair(0x67fd5084c1da4adc13317822045bb11f/restore_public.Outcome<S, Custom>, Pair(Recovery, Maybe<&1, Receipt>))))

template prepared source · line 34 · raw

@-S:Data -> @-C:Type -> @-User:Type -> @-Logs:Type -> @-E:Data -> @-F:Type -> @-EventOwners:Type -> @-Receipt:Type -> @-State:Type -> @-Custom:Data -> @-stage:(@_:State -> @_:0x67fd5084c1da4adc13317822045bb11f/restore_data.Position -> @_:0x67fd5084c1da4adc13317822045bb11f/decode_data.Field -> Pair(State, 0x67fd5084c1da4adc13317822045bb11f/restore_data.Dispatch<Custom>)) -> @-release:(@_:State -> State) -> @-clear:(@_:C -> @_:0x67fd5084c1da4adc13317822045bb11f/world.Handle<S> -> Pair(C, List<&2, 0x67fd5084c1da4adc13317822045bb11f/restore_data.Change<S>>)) -> @-insert:(@_:C -> @_:0x67fd5084c1da4adc13317822045bb11f/owner_product.Owner<User, Logs> -> @_:State -> @_:List<&2, 0x67fd5084c1da4adc13317822045bb11f/restore_data.Binding<S>> -> @_:0x67fd5084c1da4adc13317822045bb11f/change_tick.Tick -> Pair(Pair(C, 0x67fd5084c1da4adc13317822045bb11f/owner_product.Owner<User, Logs>), State)) -> @-emit:(@_:0x67fd5084c1da4adc13317822045bb11f/restore_data.Change<S> -> E) -> @-retain:(@_:Logs -> @_:List<&2, E> -> Pair(Logs, Receipt)) -> @-drain:(@_:Logs -> Pair(Logs, Receipt)) -> @-clearStreams:(@_:F -> F) -> @-catalog:0x67fd5084c1da4adc13317822045bb11f/owned_event_family_catalog.Catalog<E, Logs, F, Receipt, retain, drain, clearStreams> -> @-sync:(@_:F -> @_:Nat -> @_:List<&2, E> -> F) -> @-Recovery:Type -> @-commit:(@_:State -> State) -> @-takeRecovery:(@_:State -> Pair(State, Recovery)) -> @schema:0x67fd5084c1da4adc13317822045bb11f/restore_schema.Schema<S, C, 0x67fd5084c1da4adc13317822045bb11f/owner_product.Owner<User, Logs>, State, Custom, stage, release, clear, insert, Recovery, commit, takeRecovery> -> @runtime:0x67fd5084c1da4adc13317822045bb11f/event_family_routing.Runtime<S, C, 0x67fd5084c1da4adc13317822045bb11f/owner_product.Owner<User, Logs>, E, 0x67fd5084c1da4adc13317822045bb11f/event_family_runtime.State<E, F, EventOwners>> -> @result:0x67fd5084c1da4adc13317822045bb11f/restore_data.Prepared<State, Custom> -> Pair(0x67fd5084c1da4adc13317822045bb11f/event_family_routing.Runtime<S, C, 0x67fd5084c1da4adc13317822045bb11f/owner_product.Owner<User, Logs>, E, 0x67fd5084c1da4adc13317822045bb11f/event_family_runtime.State<E, F, EventOwners>>, Pair(0x67fd5084c1da4adc13317822045bb11f/restore_public.Owner<S, C, 0x67fd5084c1da4adc13317822045bb11f/owner_product.Owner<User, Logs>, State, Custom, stage, release, clear, insert, Recovery, commit, takeRecovery>, Pair(0x67fd5084c1da4adc13317822045bb11f/restore_public.Outcome<S, Custom>, Pair(Recovery, Maybe<&1, Receipt>))))

template run source · line 52 · raw

@-S:Data -> @-C:Type -> @-User:Type -> @-Logs:Type -> @-E:Data -> @-F:Type -> @-EventOwners:Type -> @-Receipt:Type -> @-State:Type -> @-Custom:Data -> @-stage:(@_:State -> @_:0x67fd5084c1da4adc13317822045bb11f/restore_data.Position -> @_:0x67fd5084c1da4adc13317822045bb11f/decode_data.Field -> Pair(State, 0x67fd5084c1da4adc13317822045bb11f/restore_data.Dispatch<Custom>)) -> @-release:(@_:State -> State) -> @-clear:(@_:C -> @_:0x67fd5084c1da4adc13317822045bb11f/world.Handle<S> -> Pair(C, List<&2, 0x67fd5084c1da4adc13317822045bb11f/restore_data.Change<S>>)) -> @-insert:(@_:C -> @_:0x67fd5084c1da4adc13317822045bb11f/owner_product.Owner<User, Logs> -> @_:State -> @_:List<&2, 0x67fd5084c1da4adc13317822045bb11f/restore_data.Binding<S>> -> @_:0x67fd5084c1da4adc13317822045bb11f/change_tick.Tick -> Pair(Pair(C, 0x67fd5084c1da4adc13317822045bb11f/owner_product.Owner<User, Logs>), State)) -> @-emit:(@_:0x67fd5084c1da4adc13317822045bb11f/restore_data.Change<S> -> E) -> @-retain:(@_:Logs -> @_:List<&2, E> -> Pair(Logs, Receipt)) -> @-drain:(@_:Logs -> Pair(Logs, Receipt)) -> @-clearStreams:(@_:F -> F) -> @-catalog:0x67fd5084c1da4adc13317822045bb11f/owned_event_family_catalog.Catalog<E, Logs, F, Receipt, retain, drain, clearStreams> -> @-sync:(@_:F -> @_:Nat -> @_:List<&2, E> -> F) -> @-Recovery:Type -> @-commit:(@_:State -> State) -> @-takeRecovery:(@_:State -> Pair(State, Recovery)) -> @owner:0x67fd5084c1da4adc13317822045bb11f/restore_public.Owner<S, C, 0x67fd5084c1da4adc13317822045bb11f/owner_product.Owner<User, Logs>, State, Custom, stage, release, clear, insert, Recovery, commit, takeRecovery> -> @runtime:0x67fd5084c1da4adc13317822045bb11f/event_family_routing.Runtime<S, C, 0x67fd5084c1da4adc13317822045bb11f/owner_product.Owner<User, Logs>, E, 0x67fd5084c1da4adc13317822045bb11f/event_family_runtime.State<E, F, EventOwners>> -> @input:0x67fd5084c1da4adc13317822045bb11f/snapshot_data.Snapshot -> Pair(0x67fd5084c1da4adc13317822045bb11f/event_family_routing.Runtime<S, C, 0x67fd5084c1da4adc13317822045bb11f/owner_product.Owner<User, Logs>, E, 0x67fd5084c1da4adc13317822045bb11f/event_family_runtime.State<E, F, EventOwners>>, Pair(0x67fd5084c1da4adc13317822045bb11f/restore_public.Owner<S, C, 0x67fd5084c1da4adc13317822045bb11f/owner_product.Owner<User, Logs>, State, Custom, stage, release, clear, insert, Recovery, commit, takeRecovery>, Pair(0x67fd5084c1da4adc13317822045bb11f/restore_public.Outcome<S, Custom>, Pair(Recovery, Maybe<&1, Receipt>))))

Restore typed snapshot through the retained schema Owner and actual family runtime. Complete preparation and capacity admission precede log drain/World cleanup. Early refusal retains runtime and returns no drain receipt; owned constructor recovery and rejected input remain explicit in Public.Outcome. After admission, drain actual affine logs via the complete typed catalog and clear stream/publication state, then apply canonical cleanup/fresh spawning and saved-key-to-handle bindings. Pending closures are dropped without execution and Pending allocator marks abandoned; saved keys are not restored live identities. Return actual restore Owner, constructor recovery and optional drain Receipt with runtime. Success synchronizes restored publications at the next family tick; this is not a full runtime reset: registration/Local/capture/reader owners remain subject to the existing retained-runtime contract. No payload is copied into a detached recovery value or silently disposed by a fabricated host destructor. See docs/parity/restore-basic.md for the complete runtime omissions/boundary.