Expand description
Content-addressed distributed evaluation for remote stream realization.
This crate is the EvalFabric / realize transport layer for SIM streams: the
location-transparent eval surface that server and agent code target to place
work and exchange streams, rather than reaching for transport-specific APIs.
It turns StreamValue packet spines into kernel chunk events or existing
server stream frames, and turns event or frame buffers back into lazy stream
spines. It stays in library space: it does not add server frame kinds or
kernel object hooks.
Content-addressed evaluation treats a fleet as a store of immutable eval
replies. ContentServeFabric answers a request only if this node already
holds its ContentKey. ContentAddressedFabric presents local and peer
cassettes as one EvalFabric: it checks the local EvalCassette, asks
peers that hold the content id, computes on a home site when no holder has
the reply, and records every successful reply so this node becomes a holder
too. There is no routing table; the lookup question is simply “who holds
content id X.” HoldingIndex is a grow-only gossip index of holders.
Because content never mutates, a holder fact is never invalidated and the
index needs no consensus. Recovery is EvalCassette::from_ledger replay.
The FleetRelayFabric design names the explicit-routing alternative for
small, statically known fleets.
The surface has four families:
- Control plane:
StreamControland its frame round-trip carry open, next, push, close, cancel, stats, metadata, and fault actions between peers. - Frame codec:
stream_to_framesand thestream_frames_to_*family encode a stream into bounded server frames and decode them back, applyingStreamFrameLimits. - Placement:
ServerPlacementRequestandserver_placement_stream_framesplace a fragment on a site underPlacementResourceLimits, with sensitive inputs redacted byredact_placement_expr. - Realize requests:
stream_realize_requestandrealize_stream_eventsbridge a stream to the realize event surface. - Relay surfaces:
RelayFabriccarries a surface session as a remoteEvalFabricnode.ContentKeygives each stableEvalRequesta deterministic identity,EvalCassettestores successful replies in an effect-ledger-backed cache,LedgeredRelayFabricadds cache-first cassette replay and write-through around any inner fabric, andContentAddressedFabricresolves work from any holder by content id. Capability policy stays with the inner fabric and is not weakened by caching.
Structs§
- Content
Addressed Fabric - Content-addressed lookup fabric over local and peer cassettes.
- Content
Key - Content-addressed identity for an
EvalRequest. - Content
Peer - A peer that may hold content in its local cassette.
- Content
Serve Fabric - Read side of the content-addressed store for one node.
- Effect
Ledger Cassette - A kernel
EffectLedgeradapter forEvalCassette. - Eval
Cassette - An
EffectLedger-backed cache of content-addressed eval replies. - Held
Content - A claim that one node holds one content id in its cassette.
- Holding
Index - A grow-only index of which nodes hold which content ids.
- Ledgered
Relay Fabric - A cache-first
EvalFabricthat records successful replies in a cassette. - Placement
Resource Limits - Resource bounds enforced on a server placement before and during execution.
- Relay
Fabric - A remote or relayed
EvalFabricnode carrying a surface session. - Server
Placement Request - Server placement request carried through stream-fabric server frames.
- Stream
Frame Limits - Resource bounds applied while encoding a stream into server frames.
Enums§
- Placement
Capability - Capability a peer must hold to place work across the stream fabric.
- Relay
Status - The connection state of a
RelayFabriclink. - Stream
Control - Control-plane operation exchanged over remote stream-fabric frames.
Traits§
- Eval
Cassette Ledger - Append and replay surface used by
EvalCassette.
Functions§
- cassette_
to_ stream_ frames - Re-encodes a recorded
StreamCassetteback into server frames. - event_
buffer_ to_ stream - Folds a buffer of run events into a pull-based
StreamValue. - expr_
chunk_ event - Builds a chunk event whose payload is the interned data packet
(kind expr). - expr_
to_ stream_ chunk_ frame - Compatibility helper. New code should call
sim_lib_server::stream_chunk_frame_from_exprdirectly. - ledgered_
relay_ fabric_ value - Wraps
innerandcassetteas an opaque runtime value. - placement_
capability_ names - Returns the kernel capability names for every
PlacementCapability. - placement_
host_ device_ capability - Returns the capability required to reach a host device during placement.
- placement_
remote_ render_ capability - Returns the capability required to render a fragment remotely.
- placement_
run_ node_ on_ lan_ peer_ capability - Returns the capability required to run a placed node on a LAN peer site.
- placement_
run_ node_ on_ server_ capability - Returns the capability required to run a placed node on the server site.
- realize_
placed_ stream_ events - Realizes a placed fragment on
siteand returns its output envelopes. - realize_
stream_ events - Drains a stream into the events of one realized run.
- redact_
placement_ expr - Returns a copy of
exprwith sensitive placement data redacted. - refused_
profile_ diagnostic_ kind - Returns the diagnostic kind marking a transport profile refused over frames.
- remote_
error_ diagnostic_ kind - Returns the diagnostic kind marking a remote-side error surfaced locally.
- remote_
frame_ to_ event - Converts a single remote server frame into a run event, if it carries one.
- server_
buffered_ preview_ profile - Returns the server buffered-preview output profile.
- server_
placement_ frame_ operation_ symbols - Returns the request, result, and refusal placement operation symbols.
- server_
placement_ refusal_ diagnostic_ kind - Returns the diagnostic kind emitted when server placement is refused.
- server_
placement_ refusal_ symbol - Returns the operation symbol for a server placement refusal data frame.
- server_
placement_ request_ symbol - Returns the operation symbol for a server placement request data frame.
- server_
placement_ result_ symbol - Returns the operation symbol for a server placement result data frame.
- server_
placement_ stream_ frames - Places a fragment on the server site and encodes the exchange as frames.
- server_
render_ return_ profile - Returns the server render-return output profile.
- server_
site_ symbol - Returns the site symbol naming the server placement target.
- stream_
chunk_ frame_ to_ expr - Compatibility helper. New code should call
sim_lib_server::stream_frame_to_exprdirectly. - stream_
control_ cancel_ symbol - Returns the operation symbol for the cancel control action.
- stream_
control_ close_ symbol - Returns the operation symbol for the close control action.
- stream_
control_ fault_ symbol - Returns the operation symbol for the fault control action.
- stream_
control_ frame_ from_ control - Encodes a
StreamControlinto a server stream-chunk frame. - stream_
control_ from_ frame - Decodes a server stream-chunk frame back into a
StreamControl. - stream_
control_ metadata_ symbol - Returns the operation symbol for the metadata control action.
- stream_
control_ next_ symbol - Returns the operation symbol for the next control action.
- stream_
control_ open_ symbol - Returns the operation symbol for the open control action.
- stream_
control_ operation_ symbols - Returns every stream-fabric control operation symbol, one per variant.
- stream_
control_ push_ symbol - Returns the operation symbol for the push control action.
- stream_
control_ required_ capability - Returns the capability required to perform
control. - stream_
control_ stats_ symbol - Returns the operation symbol for the stats control action.
- stream_
frames_ to_ cassette - Decodes server frames into a replayable
StreamCassette. - stream_
frames_ to_ events - Decodes server frames into stream metadata plus a buffer of run events.
- stream_
frames_ to_ stream - Decodes a buffer of server frames back into a lazy
StreamValue. - stream_
limit_ diagnostic_ kind - Returns the diagnostic kind marking a stream truncated by a fabric limit.
- stream_
realize_ request - Builds a realize request that observes a term as an event stream.
- stream_
to_ frames - Encodes a stream into server frames with default envelope, profile, limits.
- stream_
to_ frames_ with_ envelope - Encodes a stream into server frames under a caller-supplied frame envelope.
- stream_
to_ frames_ with_ limits - Encodes a stream into server frames, enforcing every fabric resource bound.
- stream_
to_ frames_ with_ profile - Encodes a stream into server frames under a caller-chosen transport profile.