Materialize exact reactive state on demand

This commit is contained in:
Meta Vens 2026-07-19 12:33:03 +01:00
commit 0ef59b50c2
18 changed files with 164 additions and 7 deletions

View file

@ -528,6 +528,11 @@ shared-file mapping, or network from observed locality and available adapters.
Body bytes never become subscription snapshot payload. Either subscription may
legitimately start with `HasValue == false`; it remains active until the provider
publishes the exact record, avoiding a startup retry loop or broad snapshot.
`CultNetDatabaseSubscriptionServer.DemandChanged` exposes the exact requested
record and schema set as well as optional body negotiation. A provider can
therefore materialize a computed record only while it has consumers. The watch
is installed before demand is announced, so the first publication travels as a
normal live change and does not require a bootstrap snapshot.
### Client Prediction

View file

@ -920,6 +920,18 @@ stream demand merely by existing.
and server disposal all update the same typed demand projection. Stable peer
identity, not per-message wrapper identity, keys subscription lifetime.
Exact reactive document demand carries the requested record and schema set even
when no hot body is involved. Providers may use that demand to materialize
computed documents lazily; the subscription watch exists before activation is
reported, so frame zero is delivered on the live path. Dynamic state is not
forced back through a broad snapshot merely because the record did not exist at
subscribe time.
The client installs the declared delivery mode before sending the subscription.
A provider may publish synchronously from demand activation, so a live change
can correctly precede the empty bootstrap acknowledgement without briefly
becoming durable replica state.
`CultMesh.SubscribeLiveBodyAsync(...)` is the narrow public construction path.
Its `CultMeshLiveBodySubscription` names only the logical body, consumer, and
subscription lifetime. `CultMeshLiveBody` owns the ephemeral latest-publication