~/bend-docscommunity

ordinary_recovery_resource.bend checks

raw source on the hub · import 0x67fd5084c1da4adc13317822045bb11f/ordinary_recovery_resource.bend as Ordinary_recovery_resource

12 imports
import Base
import ./recovery_use.bend as Use
import ./world.bend as W
import ./owner_product.bend as Product
import ./ordinary_recovery_declaration.bend as D
import ./ordinary_recoverable_array_resource.bend as F
import ./ordinary_recoverable_component_capture.bend as Existing
import ./recoverable_array.bend as A
import ./recoverable_array_owner.bend as AO
import ./recovery_journal.bend as Journal
import ./world_resource_owner.bend as WR
import ./ordinary_schema.bend as Schema

Templates

template Ops source · line 17 · raw

@-S:Data -> @-P:Type -> @-identity:0x67fd5084c1da4adc13317822045bb11f/ordinary_schema.Resource<S, Array<P>> -> @H:Type -> Type

Canonical World resource target and generated recovery path; no caller inverse. Nominal recoverable Array<P> resource capability family with whole-array replace and bounded element swap. P may be arbitrary affine Type; this does not provide automatic inverses for unrelated resource mutations.

template target source · line 20 · raw

@-S:Data -> @-C:Type -> @-E:Data -> @-Capture:Type -> @-P:Type -> 0x67fd5084c1da4adc13317822045bb11f/owner_product.Lens<0x67fd5084c1da4adc13317822045bb11f/owner_product.Owner<0x67fd5084c1da4adc13317822045bb11f/world.World<S, C, Array<P>, E>, Capture>, Array<P>, Pair(Capture, 0x67fd5084c1da4adc13317822045bb11f/world_resource_owner.Rest<S, C, Array<P>, E>)>

Advanced trusted lens selecting the Array<P> World resource while retaining capture and the rest of World. No live owner is copied or exposed.

template empty source · line 22 · raw

@-Capture:Type -> @-P:Type -> @unit:Unit -> List<&1, 0x67fd5084c1da4adc13317822045bb11f/recoverable_array.Record<P>>

template replaced source · line 23 · raw

@-S:Data -> @-C:Type -> @-E:Data -> @-Capture:Type -> @-P:Type -> @-All:Type -> @-Rest:Type -> @-path:0x67fd5084c1da4adc13317822045bb11f/owner_product.Lens<All, List<&1, 0x67fd5084c1da4adc13317822045bb11f/recoverable_array.Record<P>>, Rest> -> @result:Pair(0x67fd5084c1da4adc13317822045bb11f/owner_product.Owner<0x67fd5084c1da4adc13317822045bb11f/world.World<S, C, Array<P>, E>, Capture>, List<&1, 0x67fd5084c1da4adc13317822045bb11f/recovery_journal.Action(0x67fd5084c1da4adc13317822045bb11f/owner_product.Owner<0x67fd5084c1da4adc13317822045bb11f/world.World<S, C, Array<P>, E>, Capture>, All)>) -> 0x67fd5084c1da4adc13317822045bb11f/ordinary_recoverable_array_resource.Frame<0x67fd5084c1da4adc13317822045bb11f/owner_product.Owner<0x67fd5084c1da4adc13317822045bb11f/world.World<S, C, Array<P>, E>, Capture>, All>

template replace source · line 30 · raw

@-S:Data -> @-C:Type -> @-E:Data -> @-Capture:Type -> @-P:Type -> @-All:Type -> @-Rest:Type -> @-path:0x67fd5084c1da4adc13317822045bb11f/owner_product.Lens<All, List<&1, 0x67fd5084c1da4adc13317822045bb11f/recoverable_array.Record<P>>, Rest> -> @frame:0x67fd5084c1da4adc13317822045bb11f/ordinary_recoverable_array_resource.Frame<0x67fd5084c1da4adc13317822045bb11f/owner_product.Owner<0x67fd5084c1da4adc13317822045bb11f/world.World<S, C, Array<P>, E>, Capture>, All> -> @incoming:Array<P> -> 0x67fd5084c1da4adc13317822045bb11f/ordinary_recoverable_array_resource.Frame<0x67fd5084c1da4adc13317822045bb11f/owner_product.Owner<0x67fd5084c1da4adc13317822045bb11f/world.World<S, C, Array<P>, E>, Capture>, All>

Replace the whole Array<P> resource in the shared recovery journal. Consumes incoming array and returns frame; commit recovers the displaced array, rollback restores it and recovers the replacement. Capture and other World owners remain siblings, not independent copies.

template swapped source · line 33 · raw

@-S:Data -> @-C:Type -> @-E:Data -> @-Capture:Type -> @-P:Type -> @-All:Type -> @-Rest:Type -> @-path:0x67fd5084c1da4adc13317822045bb11f/owner_product.Lens<All, List<&1, 0x67fd5084c1da4adc13317822045bb11f/recoverable_array.Record<P>>, Rest> -> @result:0x67fd5084c1da4adc13317822045bb11f/recoverable_array_owner.Attempt<0x67fd5084c1da4adc13317822045bb11f/owner_product.Owner<0x67fd5084c1da4adc13317822045bb11f/world.World<S, C, Array<P>, E>, Capture>, All, P> -> 0x67fd5084c1da4adc13317822045bb11f/ordinary_recoverable_array_resource.Attempt<0x67fd5084c1da4adc13317822045bb11f/ordinary_recoverable_array_resource.Frame<0x67fd5084c1da4adc13317822045bb11f/owner_product.Owner<0x67fd5084c1da4adc13317822045bb11f/world.World<S, C, Array<P>, E>, Capture>, All>, P>

template swap source · line 40 · raw

@-S:Data -> @-C:Type -> @-E:Data -> @-Capture:Type -> @-P:Type -> @-All:Type -> @-Rest:Type -> @-path:0x67fd5084c1da4adc13317822045bb11f/owner_product.Lens<All, List<&1, 0x67fd5084c1da4adc13317822045bb11f/recoverable_array.Record<P>>, Rest> -> @frame:0x67fd5084c1da4adc13317822045bb11f/ordinary_recoverable_array_resource.Frame<0x67fd5084c1da4adc13317822045bb11f/owner_product.Owner<0x67fd5084c1da4adc13317822045bb11f/world.World<S, C, Array<P>, E>, Capture>, All> -> @index:U32 -> @incoming:P -> 0x67fd5084c1da4adc13317822045bb11f/ordinary_recoverable_array_resource.Attempt<0x67fd5084c1da4adc13317822045bb11f/ordinary_recoverable_array_resource.Frame<0x67fd5084c1da4adc13317822045bb11f/owner_product.Owner<0x67fd5084c1da4adc13317822045bb11f/world.World<S, C, Array<P>, E>, Capture>, All>, P>

Attempt one Array<P> resource element swap. Out-of-bounds returns Refused with incoming P and unchanged journal; success records the displaced owner. Receipt recovery follows the enclosing commit/rollback, not immediate copying.

template grant source · line 45 · raw

@-S:Data -> @-C:Type -> @-E:Data -> @-Capture:Type -> @-P:Type -> @-identity:0x67fd5084c1da4adc13317822045bb11f/ordinary_schema.Resource<S, Array<P>> -> @-All:Type -> @-Rest:Type -> @-path:0x67fd5084c1da4adc13317822045bb11f/owner_product.Lens<All, List<&1, 0x67fd5084c1da4adc13317822045bb11f/recoverable_array.Record<P>>, Rest> -> @unit:Unit -> 0x67fd5084c1da4adc13317822045bb11f/ordinary_recoverable_array_resource.Write<S, P, identity, 0x67fd5084c1da4adc13317822045bb11f/ordinary_recoverable_array_resource.Frame<0x67fd5084c1da4adc13317822045bb11f/owner_product.Owner<0x67fd5084c1da4adc13317822045bb11f/world.World<S, C, Array<P>, E>, Capture>, All>>

Advanced closed grant builder for canonical resource and recovery paths. Gameplay receives typed replace/swap; it does not author inverses or journals.

template declaration source · line 51 · raw

@-S:Data -> @-C:Type -> @-E:Data -> @-Capture:Type -> @-P:Type -> @-identity:0x67fd5084c1da4adc13317822045bb11f/ordinary_schema.Resource<S, Array<P>> -> 0x67fd5084c1da4adc13317822045bb11f/ordinary_recovery_declaration.Declaration<S, 0x67fd5084c1da4adc13317822045bb11f/owner_product.Owner<0x67fd5084c1da4adc13317822045bb11f/world.World<S, C, Array<P>, E>, Capture>, List<&1, 0x67fd5084c1da4adc13317822045bb11f/recoverable_array.Record<P>>, Ops(S, P, identity), grant(S, C, E, Capture, P, identity)>

Declare recoverable Array<P> resource operations using its ordinary resource identity. Supplies complete access/use metadata and generated recovery path; performs no resource mutation or allocation of payload values. Supported domain and receipts: docs/parity/recovery.md.