import Base import ./ordinary_app_schema.bend as SchemaApp import ./ordinary_app_composer.bend as Build import ./event_family_routing.bend as Route import ./world.bend as W import ./ordinary_app_event_family_runtime.bend as App import ./ordinary_app_dump.bend as Dump import ./ordinary_dump_filter.bend as Filter import ./ordinary_app_observation_data.bend as DTO import ./ordinary_app_registration_fields.bend as Records # Reuses the schema-derived dump while preserving the actual family/tick/readers. # Return the App with an optional filtered schema dump. Disabled debug bypasses # dump derivation; enabled uses trusted ordinary count/presentation adapters. # Preserve actual family, tick and registration owners without synchronizing or # acknowledging event readers; opaque value presentation remains caller supplied. def snapshot(~S:Data,~C:Type,~R:Type,~P:Data,~F:Type,~Owners:Type,~Rows:Data,~observe:W.World -> W.World & DTO.Observation,~fold:Owners -> Owners & List<&2,Records.Fields>,~count:C -> List<&2,W.Handle> -> C & List<&2,Maybe<&2,U32>>,~components:C -> U32 -> C & List<&2,Maybe<&2,String>>,~resources:R -> R & List<&2,Maybe<&2,String>>,criteria:Filter.Filter,value:App.Application) -> App.Application & Maybe<&2,Dump.Dump>: match value: case App.Application{schema,Route.Runtime{world,family,tick},owners,recipe,debug}:App.returned(~S,~C,~R,~P,~F,~Owners,~Rows,~observe,~fold,~Maybe<&2,Dump.Dump>,family,tick,Dump.schema_snapshot(~S,~C,~R,~P,~Owners,~Rows,~observe,~fold,~count,~components,~resources,criteria,SchemaApp.Application{schema,Build.Registered{world,owners,recipe,debug}}))