joule-moq-relay, co-performance §7.3: count each author's audience inputs in its chain's order #462

Merged
dcharlot merged 3 commits from fix/floor-input-chain-order into main 2026-10-25 05:18:18 -04:00

2026-10-25

Transaction Science
wai.live.coperformance §7.3: a relay counts an author's inputs in its chain's order
All checks were successful
joule-moq-room room service / joule-moq-room · does this change touch it (pull_request) Successful in 6s
joule-moq-web browser client / joule-moq-web · does this change touch it (pull_request) Successful in 6s
joule-code conformance gate / Build + round-trip C1-C4 vectors (pull_request) Successful in 2m45s
joule-code conformance gate / joule-moq-ingest, every target (pull_request) Successful in 2m58s
standards workspaces build + test / which workspaces this change touches (pull_request) Successful in 37s
WAI conformance / does this change touch it (pull_request) Successful in 16s
joule-code conformance gate / joule-moq-relay, every target (pull_request) Successful in 3m56s
WAI energy receipts / does this change touch it (pull_request) Successful in 8s
repository checks / lockfiles, advisories, tests in CI, workflow hygiene, spec and section references, public text (pull_request) Successful in 4m28s
joule-moq-room room service / joule-moq-room, every target (pull_request) Successful in 1m50s
WAI conformance / quantum core and corpus under wasm32-wasip2 (wasmtime) (pull_request) Successful in 2m20s
WAI conformance / v2 vocabulary · manifests validate as stated (pull_request) Successful in 50s
WAI conformance / cross-arch byte-equality · linux (pull_request) Successful in 28s
standards workspaces build + test / joule-code-rs (joule-code/joule-code-rs, joule-code-rs, linux-arm64, true) (pull_request) Successful in 4m49s
WAI conformance / delivery telemetry · CMCD and CMSD against an independent library (pull_request) Successful in 16s
WAI conformance / cross-arch byte-equality · linux-arm64 (pull_request) Successful in 41s
WAI conformance / C2PA manifest emission · signed, read back, validated (pull_request) Successful in 1m48s
WAI energy receipts / energy receipts · linux (pull_request) Successful in 9m31s
WAI conformance / cargo-class corpora · linux (pull_request) Successful in 19m2s
WAI energy receipts / energy receipts · linux-arm64 (pull_request) Successful in 11m28s
WAI conformance / cargo-class corpora · linux-arm64 (pull_request) Successful in 22m25s
joule-moq-web browser client / joule-moq-web · browser end-to-end (macos) (pull_request) Successful in 17m27s
standards workspaces build + test / macOS energy backends (pull_request) Successful in 11m2s
WAI conformance / cargo-class corpora · macos (pull_request) Successful in 15m3s
WAI conformance / cross-arch byte-equality · macos (pull_request) Successful in 21s
WAI conformance / independent verifiers · claims, JWP, key discovery and integer payloads (Python) (pull_request) Successful in 53m43s
WAI conformance / codec wrappers · fuzz smoke, text decode limits, C entry points, provenance, the semantic path (pull_request) Successful in 50s
WAI energy receipts / energy receipts · macos (pull_request) Successful in 5m40s
The relay MUST count an author's inputs in the order of the author's chain (live-events
§6.2), as a verifier does, never in the order they reach it: one chain's records can reach it
on several streams, one for each group. It decides an input once it has received every record
of the chain below it and decided every input among them; it holds an input that arrives
ahead of a gap for a bound of its own, refuses one whose gap has not filled by then as
input_out_of_order and counts the chain from the record after it; and it refuses as
input_out_of_order an input that arrives after a later input of its author was forwarded.

The reason is the relay's alone, as window_committed is (§8, now naming both): a verifier
holds each chain in order and counts each input where §9.2 step 4 meets it, so §10, the
corpus, wai-rs and co_performance_verify.py are unchanged. §12 notes that an author leaving a
gap in its own chain holds up only its own inputs, for no longer than the bound. CHANGELOG.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 04:08:59 -04:00
Transaction Science
joule-moq-relay: count each author's audience inputs in its chain's order, not in arrival order
Each group of a member's events track rides a stream of its own, and the relay reads each
stream in a task of its own, so two inputs sent back to back reached the floor in either
order. The floor counted them as they came: with a limit of one, it could forward a member's
second input (seq 1) and refuse its first (seq 0), leaving subscribers with seq 1 and a gap at
seq 0, the opposite of what a verifier counting in chain order decides.

The floor now keeps each author's chain as it has received it (the first seq it lacks, the
seqs above it, and the inputs waiting) and decides an input once it holds every record of the
chain below it and no input below it waits. Floor::events_filter is async: an input ahead of a
gap waits, with the rest of its stream, until the gap fills or the floor's hold runs out
([floor] hold_ms, 2 000 by default). One whose hold runs out is refused input_out_of_order,
whichever object of its author's finds it so, and the chain is counted from the record after
it. An input that arrives after a later input of its author was forwarded is refused
input_out_of_order too. Floor::events_step is the synchronous step, tested with explicit
instants; Floor::waiting counts the inputs held.

Tests: tests/floor.rs sends a member's seq 1 first, waits until the relay holds it, then
sends seq 0: seq 0 forwarded, seq 1 refused input_over_limit; and seq 1 alone, refused
input_out_of_order no sooner than the hold, after which a late seq 0 is forwarded. Unit tests
cover a chat between two votes, an object whose records are out of seq order, the chain
counted from after a refused input, and an input whose stream is gone. The hardened test
from Train D is kept; its config gains `..FloorConfig::default()`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 03:56:05 -04:00