Expand description
A2UI live-update backbone (Change 20, a2ui-realtime-backbone-from-flint-realtime-fabric).
Scope correction found during implementation: the plan frames this as
“wire flint-realtime-fabric as the SSE/fan-out backbone for A2UI live
updates,” but auditing the existing code first found:
- No A2UI emission call site exists yet.
super::protocol’sA2uiMessage/CreateMessage/ComponentsMessage/DataMessage/DeleteMessageDTOs areDeserialize-only,pub(crate), and referenced nowhere else in the crate (#[expect(dead_code, ...)]on the module confirms they’re contract-validation scaffolding, not a live code path). The orchestrator does not currently create or update A2UI surfaces during a run. - Multi-client fan-out (“convergence”) already exists.
crate::uar::runtime::manager::RunManagerbroadcasts every [NormalizedEvent] to all subscribers of a run via atokio::sync::broadcastchannel (RunManager::subscribe) — multiple SSE clients on the samerun_idalready converge on the same event stream. This module does not need to reimplement that. - The actual gap is durable, replayable fan-out for “late-join
reattach.” A
broadcastchannel has a bounded buffer and no replay-from-start semantics — a client that connects after events have already fired gets nothing before its subscribe point, and a slow client can miss events entirely (RecvError::Lagged). This is exactly the capabilityflint-realtime-fabric(a durable pub/sub broker,frf-sdk-rust’sFrfClient::subscribe(..., Offset::BEGINNING)) is for.
So this module’s real, buildable scope is: (a) a conversion from A2UI
wire messages to StatePatchOps so whenever a future orchestrator
call site does emit A2UI surface changes, they compose with the
existing NormalizedEvent::StatePatch/RunManager broadcast pipeline
for free; and (b) an A2uiReplayBackbone trait with a real, tested
in-process implementation (InMemoryReplayBackbone) for late-join
replay. The flint-realtime-fabric-backed implementation is designed
but not wired as a live Cargo dependency this pass — see “Deferred”
below.
Structs§
- InMemory
Replay Backbone - In-process, single-instance implementation of
A2uiReplayBackbone. Retains the full patch history per run in memory for the process’s lifetime — real and useful for tests and a single-server deployment, but explicitly not durable across process restarts or usable across multiple server instances. That cross-instance/durable case is exactly what theflint-realtime-fabric-backed implementation (deferred, see module docs) is for.
Enums§
- A2ui
Wire Kind - The 4 A2UI v0.9 wire-message kinds, per
docs/protocols/a2ui-profile.mdandsuper::protocol.
Traits§
- A2ui
Replay Backbone - A durable-replay backbone for A2UI state patches, keyed by
run_id. Distinct fromRunManager’s live broadcast: this trait’s job is specifically “can a client that joins after some patches were already published still receive them,” which atokio::sync::broadcastchannel cannot do once its buffer has advanced past a slow/late subscriber.
Functions§
- surface_
message_ to_ state_ patch - Converts a single A2UI wire message into a
StatePatchOprooted at/a2ui/surfaces/{surface_id}, so it can be emitted as aNormalizedEvent::StatePatchand ride the existingcrate::uar::runtime::manager::RunManagerbroadcast/SSE pipeline.