Repository navigation
fix(ci): turn main green by fixing three viewer-count regressions and a stale docs fixture - #4
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CI on
mainhas 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
viewerscount to snapshots:1. The simulator oracle treated presence as room state.
Hub::commandfirst expires stale connections, so a rejected command could dropviewers(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.rsdocumentsviewersas changing without a revision step, so the oracle now compares only the authoritative fields. It destructuresSnapshotexhaustively so a future field has to be classified, and a new unit test pins this.2. Production protobuf made⚠️ 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
viewersmandatory.#[serde(default)]: an absent count decodes as 0, and a count of 0 is omitted (canonical proto3 presence). The existingviewers: 3goldens 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.mdan explicit docs extra, andmorrow doc --sitecorrectly 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