Bind checked filesystem follows to shared Streams sessions

Merged
VA
5d ago
+601-58

Filesystem snapshot-and-follow queries call StreamProvider::follow_checked, but hosted Rust gRPC/HTTP and browser providers returned Unsupported. These adapters now implement that operation through the shared Streams session or browser publication cache. An invalid history anchor fails during registration; history replacement during delivery terminates the affected follow.

The native client requires the server's exact history confirmation before granting channel data credit. Older peers that omit confirmation fail only that follow with Unsupported. Movement and reconnection subscribe from the last yielded sequence and commit together, fencing stale or buffered deliveries.

Restacked with signed normal merges through main c86b6568ff1fe46655b9c00c82103d253f4dd458, including #679's pool-owned initialization/idle cleanup and #687's abandonment fence. Both checked-follow and native registration models are preserved; private callers use the synchronous cached-pool API. #579 has no remaining source diff. README edits remain separate in #677.

Decisions

  • Application and UI state remains files in volumes, folded through snapshot plus cursor queries. The existing provider history precondition is transport control: a file cannot atomically verify a remote immutable prefix and install its subscription. No harness service, store, application message or actor socket is added.
  • Checked registration returns startup errors before returning a cursor so callers can replace an incompatible snapshot. It never falls back to unchecked history or a per-stream connection. Preserve main's startup-error handling for all pending follows.
  • The last yielded sequence and preceding commit share the existing cursor mutex and generation fence. Its lock order is non-nesting and the real lock is modeled. Receipt and buffering do not advance the consumed cut.
  • Browser checked follows register publication interest before refreshing and validating immutable memory history, then reuse affected-subscription dispatch. No polling or per-follower IndexedDB refresh is introduced.

Validation

  • Windows lb.ps1 cargo check --locked -p acyclic-stream --features local,http --lib --tests passes in 5.28 s after acquiring its build slot.
  • Linux bs.ps1 batch at this restack: 22 native session tests pass in 3.04 s, 2 HTTP session/TLS checks in 0.05 s, and the public gRPC provider conformance check passes in <0.01 s.
  • 11 real pool/cache models and properties pass in 7.97 s, including the new abandonment schedule and its negative control. The 36 standalone models/properties passed in 0.33 s at the immediately preceding restack; their source and included production helpers are unchanged by the #687 merge, so that built result is reused. All negative controls remain active. No schedule bound is added.
  • The checked tests cover wrong-anchor startup failure, an older peer with no confirmation and zero data sent, healthy siblings, queued-record movement, reconnect and replacement after registration. HTTP checked and ordinary follows share one connection and Session.
  • The production Progress model races consumption against generation fencing and subscription capture. Broken variants read the commit before fencing or reuse the original snapshot anchor; both fail. A 128-case shrinking property asserts the cursor equals the fold of only current-generation deliveries over up to 32 events.
  • The request/confirmation decoder is unchanged from #647. Its checked_follow cargo-fuzz target, five checked-in seeds and shrinking round-trip/confirmation properties cover the production codec used here. This adapter adds no wire field or decoder.
  • Earlier browser validation at the pre-restack head passed nine publication/follow checks in 0.69 s and strict library Clippy with local,http. Those checks are historical, not rerun at this restack.

Current shared-bb1 diagnostic samples (128 records after 16 warmups):

Transportp50p99
MemoryStream1.662 us32.469 us
Loopback gRPC104.677 us153.541 us
HTTP over shared Session26.290 us36.855 us

The gRPC and HTTP probes assert one Session and one connection. These are unpaired local measurements, not a deployed-service result or a before/after speedup. Runtime suites are all below 10 seconds. Current log: /home/var/log/buildbox/2026-10-16T092913262Z-3320456.log; unchanged standalone-model results: /home/var/log/buildbox/2026-10-16T092152725Z-3309668.log.

Live steps

  • #679 and #687 are merged and included in this restack. #644 follows this PR in the remaining stack.
  • Cloud main at f314aef61661debe8a3be16301e8b73cd2301dd8 explicitly rejects checked guards, non-ALL delivery and non-follow channel kinds in svc/streams/src/session/transport.rs. Cloud needs the atomic guard and exact Opened echo, with propagation through node fan-in. An unsupported peer receives an explicit per-channel error.
  • Deployed-service p50/p99 still requires a capable deployed endpoint and benchmark credentials. #644 qualifies the local 10k-agent workload separately. Browser qualification and the pending Linux sanitizer campaign are not claimed by this restack.
  • gc-client owns viewport interests and ClientViews folding; gc-query owns materialized file heads and snapshot-at-cursor. This change provides their transport binding.