Skip to content

fix(ci): turn main green by fixing three viewer-count regressions and a stale docs fixture - #4

Merged
niklas-heer merged 4 commits into
mainfrom
fix/sim-ci
Nov 9, 2026
Merged

niklas-heer merged 4 commits into
mainfrom
fix/sim-ci

Conversation

@niklas-heer

@niklas-heer niklas-heer commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

CI on main has been red since 2026-09-20 (both "Rust workspace" jobs), which also blocks the 0.2.0 release PR (#2). There were four separate causes. Each failure hid the next, because the job stops at its first failing step.

Three come from ae38aa1, which added the live viewers count to snapshots:

1. The simulator oracle treated presence as room state. Hub::command first expires stale connections, so a rejected command could drop viewers (16→0 and 1→0 in the two failing seeds) while revision and tasks stayed the same. The oracle compared whole snapshots and reported "rejected or duplicate command changed authoritative state". wire.rs documents viewers as changing without a revision step, so the oracle now compares only the authoritative fields. It destructures Snapshot exhaustively so a future field has to be classified, and a new unit test pins this.

2. Production protobuf made viewers mandatory. ⚠️ This is a production behavior change, please review. Decoding rejected any snapshot without field 6, and encoding always emitted the field. The frozen network-codecs equivalence oracle, which checks that production keeps the bytes of 46 measured fixtures, caught this. It was never seen, because that benchmark had also stopped compiling. Protobuf now matches JSON's #[serde(default)]: an absent count decodes as 0, and a count of 0 is omitted (canonical proto3 presence). The existing viewers: 3 goldens are unchanged, and a new golden covers the absent case. The oracle itself is untouched.

3. The message-path benchmark compared whole snapshots between server and client. Clients using the frozen CBOR/protobuf adapters, which predate viewers, always see 0. The benchmark now compares authoritative state, as its per-command oracle already does.

One is independent:

4. A stale docs-site fixture. 511f721 made docs/README.md an explicit docs extra, and morrow doc --site correctly rejects a missing input. The xtask fixture never got the file. It has it now, and the test asserts that its page is published.

No check was skipped or weakened. Validation, run locally: cargo xtask check, the network-codecs and message-path test and clippy commands, and the language-comparison oracles from the workflow all pass. Failures 1 and 2 reproduced before their fixes.

Not changed: binary decode still doesn't reject negative viewers (the client's snapshot validation does). That was already the case before this PR.

Created with Claude Opus 5.5 in Claude Code.

🤖 Generated with Claude Code

niklas-heer and others added 4 commits November 9, 2026 23:43
Since ae38aa1 the hub stamps the live viewer count on every snapshot
copy. Hub::command first expires stale connections, so a rejected or
duplicate command could change `viewers` while the room's revision and
tasks stayed identical, and the simulator reported "rejected or
duplicate command changed authoritative state". This failed two
scenario tests on every CI run since 2026-09-20.

The protocol documents `viewers` as presence that changes without a
revision step. Compare the authoritative fields instead, destructuring
Snapshot exhaustively so a future field must be classified. The
end-of-run convergence check uses the same comparison, because a client
legitimately holds the viewer count of its last snapshot.

Validated with cargo test -p morrow-sim and cargo xtask check.

Co-Authored-By: Claude <noreply@anthropic.com>
511f721 made docs/README.md an explicit documentation extra, so the
docs task now passes it to `morrow doc --site`, which rejects a missing
input. The fixture that models the repository layout never gained the
file, so the test failed; CI did not reach it because the simulator
tests failed first. Add the file and assert its page is published.

Co-Authored-By: Claude <noreply@anthropic.com>
ae38aa1 added `viewers` to snapshots and made the protobuf field
mandatory on decode, so production rejected every snapshot encoded
without it as Malformed, and it always emitted the field. JSON already
treats a missing count as zero (`#[serde(default)]`, "absent from older
persisted records"); protobuf now does the same: an absent field decodes
as zero, and a zero count is omitted, which is canonical proto3
presence and keeps viewer-less snapshot bytes unchanged.

This restores the network-codecs equivalence oracle, which checks that
production protobuf keeps the bytes of all 46 frozen measured fixtures.
That benchmark also stopped compiling at ae38aa1; its frozen schema
predates the count, so its snapshots carry the default.

Validated with cargo test -p morrow-web-protocol, the network-codecs
test and clippy commands from CI, and cargo xtask check.

Co-Authored-By: Claude <noreply@anthropic.com>
The final client/server check compared whole snapshots. Clients using
the frozen CBOR and protobuf adapters, which predate the live viewer
count, always observe zero viewers while the server reports one, so the
CBOR run failed even though tasks and revision matched. Compare the
authoritative fields, as the per-command oracle already does, with
exhaustive destructuring so a future field must be classified.

Co-Authored-By: Claude <noreply@anthropic.com>
@niklas-heer niklas-heer changed the title fix(ci): turn main green by fixing a simulator oracle and a stale docs fixture fix(ci): turn main green by fixing three viewer-count regressions and a stale docs fixture Nov 9, 2026
@niklas-heer
niklas-heer merged commit 7290dce into main Nov 9, 2026
5 checks passed
@niklas-heer
niklas-heer deleted the fix/sim-ci branch November 9, 2026 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant