Skip to content

Open Watch Party: the protocol crate, its checks and eight conformance tables - #1462

Merged
GLinnik21 merged 25 commits into
plxnative:mainfrom
PilaScat:feat/owp-protocol
Nov 19, 2026
Merged

GLinnik21 merged 25 commits into
plxnative:mainfrom
PilaScat:feat/owp-protocol

Conversation

@PilaScat

@PilaScat PilaScat commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Third of the four PRs agreed in #1090: the OWP messages and their validation, in a new sans-IO crate plx_owp. Nothing in the application names it yet. The session machine is the fourth PR; the integration and the UX come after, as agreed.

What is in it

rust-modules/owp/, mounted as owp, in a new layer [owp] uses = that names no other layer (docs/module-layers.md). It depends on serde and serde_json only, both already in the graph, names no plx_* crate, and is licensed under Apache-2.0 from its first commit; LICENSING.md says so.

  • json: the reader. A scan rewrites each unpaired surrogate escape to �, and each number too large for a double to 0 padded with spaces. Both keep the length, and the scan records their ordinals. A serde visitor then marks the string or member name, and returns ±Infinity for the number, as the SDKs' decoders do (conformance/vectors/tools/check.go:115). Only tokens that follow the JSON number grammar are rewritten. Member order and duplicates are kept, so the send checks can refuse a repeated name.
    • It is a second reader over serde_json beside ui::rec::strict_json, whose doc now says so. strict_json can't serve: ui sits above owp, and it refuses the surrogates and the overflowing numbers.
  • text, code, relays, media, room, timeline: the checks of SDK.md §3.2, §4, §7.1, §8 and §9.3/§9.7, and the room position of §8.
  • clock: the clock sync of §5, registered in ci/machines.ini (transition, effect PongOutcome).
  • message:
    • the 17 client messages, built from typed values and checked before sending: bounds, the peer ID and token patterns, checkMedia, no repeated member name, 8192 bytes;
    • the 5 relay messages, with the §8 rules for joined, room, pong, error and closed. action in joined.room is an unknown member, as snapshot.schema.json has it.

Your answers in #1090

  • Layer and licence: as above.

  • The reader stays in plx_owp:

    • It fails with "the reader and the scan disagree" when the visitor's count of strings, numbers, marks or infinities differs from the scan's. A scan that broke its input's UTF-8 is an error too.
    • \\ud83d is text, \\ud83d\ude00 marks only the lone low half, and \\\ud83d is an escape. Each has a test.
    • decode returns TooLarge for a message over MAX_RELAY_MESSAGE_BYTES before the scan. The cap is 65536, as agreed in the thread, because SPEC.md §3.1 makes 32768 a floor.
    • Tests on real relay messages: unknown members at two depths, escaped names and values, lone surrogates in a checked and an unknown field, numbers past their range, ext 100 levels deep (read) and 5000 (refused at serde_json's recursion limit), and unknown error codes, closed reasons and action kinds, which stay strings, with U+FFFD for a lone surrogate (SDK.md §8).
  • One choice of mine to check: a relay message of one of the five relay types that repeats a member name at any depth is Malformed(<type>), so the session still answers it by type (SDK.md §8); an unknown type or a non-object stays Ignored. SPEC.md §4 forbids sending a repeated name but says nothing of receiving one. Refusing it means no copy is chosen; TypeScript's JSON.parse would keep the last one.

  • Examples: the 46 files are vendored, and §6 of THIRD-PARTY-NOTICES.md names them.

  • Fuzz: owp_json, in fuzz/ beside the other nine. On any UTF-8 input:

    • json::scanned keeps the length; decode and read don't panic;
    • read never fails with DISAGREEMENT;
    • what serde_json reads, the reader reads too, with no marks. Not "no infinities": without float_roundtrip, serde_json reads 1.79769313486231581e308 as f64::MAX, where the scan rounds it to Infinity as JavaScript does; a json.rs test pins that token;
    • the strings the visitor marks and the numbers it makes infinite are, in document order, the ordinals the scan recorded.

    Seen red first: a visitor that leaves a member name unmarked is found in 6 s, and a scan that skips one byte after a backslash in 3 s. On the code here, 300 s ran 3 897 561 inputs with no crash (coverage 2327). The seeds are the vendored examples, relays.json and six relay messages. fuzz.yml runs it for changes under rust-modules/owp/; the tree grows by 49 MiB, so DISK_NEED stays 3.3.

Vendored data

rust-modules/owp/fixtures/ is copied unchanged from edde746/openwatchparty at d8c3c2abc753. It holds:

  • LICENSE (Apache-2.0);
  • relays.json, also embedded as the public list;
  • the eight tables of this PR;
  • the descriptor.* and setMedia.* examples of spec/examples/.

Its README.md lists each file's upstream path and SHA-256, and THIRD-PARTY-NOTICES.md §6 has the line you asked for.

Lists and certificates

  • UNIT_SUITE and every -p list name the crate. HOSTSIM_SUITE, RUST_INPUTS and test_no_host_staticlib.py's LAYER_CRATES don't, because the app doesn't reach it.
  • ci/check-deps.sh reads it as SRC_OWP in every gate that lists all the split crates, and in MACHINES and FORK_SCOPE.
  • ci/list-caps.ini has the 14 sections check-list-caps.py asked for: 12 protocol limits (format), the display grouping of a room code and the inbound cap (not-a-list).
  • Please review the two certificates. ci/proofs/serde-json-immutable.json and ci/proofs/platform-generated-enums.json are regenerated, and both CERTIFICATE_SHA256 pins are updated.
    • The serde_json one comes from ci/readonly_dependencies.py --produce, run on the cached serde_json-1.0.154.crate, whose SHA-256 matches the lock. The platform one comes from readonly_generated.produce_certificate.
    • Besides the new manifest and the lock, the serde_json certificate takes the current lib_sha256 of ui/src/lib.rs and play-feed/src/lib.rs. Both changed on main after its last regeneration in bc126230.
    • main is merged in at dab26adb. Its re-pin of the platform certificate conflicted with this branch's; both certificates were regenerated on the merged tree.
  • Two Python self-tests pin these lists and change with them: ci/test_transition_arguments.py now counts 11 machines, and ci/test_build_bench.py's fake test build lists plx_owp.

Tests

  • 67 tests in plx_owp.

  • The eight tables pass 516 of 516 cases. every_vendored_table_has_a_runner fails on a table without a runner.

    table cases
    names 50
    code-routing 39
    relay-list 69
    media-check 183
    same-title 31, also run swapped
    room-check 95
    clock-sync 23
    timeline 26
  • Each runner seen red. I broke one rule at a time, and its table failed:

    • the name length;
    • the code length;
    • ws:// in the public list;
    • surrogates in ext;
    • differing episode IDs;
    • the single host;
    • the clock-step slack;
    • the duration cap;
    • the surrogate marks.
  • The descriptor examples: 13 valid pass checkMedia, and 31 invalid fail it. The three with repeated names are among the 31. Only the invalid UTF-8 files are left out, since they can't reach a parsed value.

  • SDK.md §17's own tests that fall here:

    • relay messages of exactly 32768, 40000 and 65536 bytes are read, and one byte more is TooLarge;
    • ints go out without a fraction;
    • out-of-bound values, unpaired surrogates and repeated member names are refused before sending;
    • the embedded list is the vendored relays.json.
  • Every new test was seen failing first: against the old code where it adds a rule, and otherwise under a mutation of the code it guards (an escape skipped one byte short, unpaired text accepted, ints past 2^53, a closed list of error codes or action kinds, a participant with no room for unknown members, an unreadable message made malformed, overflowing numbers left unrewritten). The escapes test is the exception: serde_json decodes them.

  • The review fixes each came with a test seen failing first:

    • a repeated name in ext or ids;
    • 01e400, 1.e400 and -.5e400 refused;
    • action in joined.room;
    • a repeated name tagged with its message type, and ignored in an unknown one.
  • Your review's fixes, each with tests seen failing first:

    • relay_for normalizes the typed code, tested directly and through the table;
    • a received joined keeps only the known members of its descriptor;
    • media::check returns the first rule a descriptor breaks, red under four mutations of the order, the mapping and the direction.
  • The claude review's fixes, each with a test seen failing first, and red under eight mutations of the fixes:

    • a relay URL needs /v1/ws after its host;
    • error and closed strings keep a lone surrogate as U+FFFD, as SDK.md §8 and TypeScript read them;
    • the clock forgets a ping unanswered for 10 s, as TypeScript does;
    • peerId and token are checked before sending;
    • a descriptor with a non-finite number in ext is not sent, as in Swift.

Checks

On daefc2c0, with both reviews fixed, WSL2 x86_64:

  • make check is clean: 35 suites, 22935 passed, 0 failed, 239 ignored, and 143 of 143 steps ok, 135 of them Python.

  • make check-nodef and make lint are clean.

  • cargo check --lib --target armv7-unknown-linux-gnueabi -p plx_owp is clean, except for the usual neon/soft-float notes.

  • python3 ci/check-build-budgets.py --graph stays at 93 packages, because members don't count.

  • make build-bench, base 9f5ff482 against 1d735102, the branch before the merge of main (whose three commits don't touch plx_owp), 3 runs each:

    Scenario Base median (min–max) Branch median
    No-op host test build 0.1 s (0.1–0.1) 0.1 s
    Leaf plx_base cbuf.rs 58.6 s (55.0–59.0) 58.6 s
    Leaf plx_machine landgate.rs 57.6 s (52.9–58.5) 57.6 s
    Leaf plx_platform devcaps.rs 55.1 s (50.2–58.6) 55.6 s
    Leaf plx_gfx overdraw.rs 37.1 s (35.9–37.6) 38.0 s
    Leaf plx_net stream_redirect.rs 51.3 s (48.8–56.9) 51.5 s
    Leaf plx_ui dwell.rs 36.5 s (36.1–37.3) 38.1 s
    Leaf plx_plex retry.rs 50.0 s (49.3–51.5) 49.3 s
    Leaf plx_telemetry window.rs 44.0 s (42.9–44.9) 44.9 s
    Leaf plx_data tape.rs 41.2 s (40.9–41.8) 41.9 s
    Leaf plx_session scripted.rs 31.1 s (30.5–32.1) 30.4 s
    Leaf plx_media units.rs 37.3 s (35.8–38.5) 34.8 s
    Leaf plx_appkit skip_pill.rs 31.4 s (31.2–31.6) 32.1 s
    Leaf plx_screens clock_readout.rs 28.1 s (27.3–28.6) 27.9 s
    Leaf app coldstart.rs 16.8 s (16.4–18.0) 17.0 s
    Hub plx_ui lib.rs 35.6 s (34.5–36.6) 35.4 s
    Leaf plx_base cbuf.rs, incremental 14.7 s (13.8–28.6) 13.9 s
    Hub plx_ui lib.rs, incremental 8.2 s (8.2–8.2) 8.3 s
    Unit suite (default features) 57.4 s (56.2–97.8) 59.7 s
    • Units go from 187 to 188, and the unit suite from 13868 to 13924 tests, the 56 of plx_owp.
    • Five branch medians sit above the base's max, by 0.1 to 0.8 s: overdraw, dwell, tape, skip_pill and the incremental hub. Every scenario rebuilds the same units on both sides (35, 27, 23 … of 187 and 188), and the app doesn't reach plx_owp, so I read those five as noise. Two other scenarios came out below the base's min: scripted and units.
    • In an earlier run, on a5d84423, every branch median was within the base's range or below it.
    • The ARM staticlib row is skipped on both sides, since there is no TV build in this tree.
  • pr-reviewer, first round on the first eight commits, raised 3 MAJOR and 2 MINOR:

    • repeated names reaching the wire: fixed;
    • the second reader beside strict_json: explained above, and strict_json's doc fixed;
    • the build-bench table: here;
    • the number grammar: fixed;
    • action in joined: fixed.
  • doc-claim-auditor raised 6 prose findings, all fixed: the HOSTSIM_SUITE notes, the hook note in docs/agent-reference.md, §6's count, "names only base", a list in ci/build-budgets.json and the examples' wording.

  • Second round, on the changes for your answers:

    • pr-reviewer: 0 BLOCKER, 0 MAJOR, 2 MINOR, both fixed. The repeated-name tag now carries the message type, and the fuzz target no longer compares infinities with serde_json (see Fuzz above).
    • doc-claim-auditor: 4 findings. Three are fixed: CONTRIBUTING.md, TRADEMARKS.md and the README's licence line now name the Apache-2.0 exception. The fourth, PR16's paragraph in docs/hud-plugins.md, lists the targets of that PR. It lacked ws_frame before this branch, so I left it.

Not covered

  • The session, matching, reconcile and party.json: the fourth PR, on the same vectors revision.
  • §3.4's HTTP limits and the relay-list refresh: they need the GET, which comes with the integration.

🤖 Generated with Claude Code

PilaScat and others added 17 commits November 18, 2026 20:05
A new layer [owp] that names only base (docs/module-layers.md). The crate joins
every -p list UNIT_SUITE and the lab check use, and SRC_OWP joins every
check-deps.sh gate that lists all the split crates, MACHINES and FORK_SCOPE.
The app does not depend on it, so it stays out of HOSTSIM_SUITE, RUST_INPUTS
and test_no_host_staticlib.py's LAYER_CRATES.

The crate is licensed under Apache-2.0, like Open Watch Party, so it can be
used on its own; LICENSING.md says so.

The two read-only certificates in ci/proofs are regenerated for the new
manifest and lock, with their CERTIFICATE_SHA256 pins. The serde_json one
also takes the current lib.rs hashes of ui and play-feed, which changed on
main after its last regeneration in bc12623.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Filippo Scatigna <filippo@scatigna.tech>
…bers

serde_json refuses an unpaired surrogate escape and a number too large for a
double, and the vectors hold both. A scan rewrites each such escape to \ufffd
and each such number to 0 padded with spaces, keeping the length, and records
their ordinals. A serde visitor then marks the string or member name
(SDK.md 16.8) and returns the number as +-Infinity, as the SDKs' decoders do.
Member order and duplicates are kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Filippo Scatigna <filippo@scatigna.tech>
…e timeline

The checks of SDK.md 3.2, 4, 7.1, 8 and 9.7, the same-title rule of 9.3 and
the room position of 8. ci/list-caps.ini gets the sections for every protocol
limit of the crate, the clock window and the message size included.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Filippo Scatigna <filippo@scatigna.tech>
SDK.md 5: pings by id, samples whose round trip is 0 to 1000 ms, the clock
step and the window of the 8 newest. ClockSync is in ci/machines.ini, with its
outcome as the effect, so ci/test_transition_arguments.py counts 11 machines.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Filippo Scatigna <filippo@scatigna.tech>
The 17 client messages are built from typed values and checked before sending:
bounds, the descriptor checks and 8192 bytes. The 5 relay messages are read
with the rules of SDK.md 8 for joined, room, pong, error and closed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Filippo Scatigna <filippo@scatigna.tech>
rust-modules/owp/fixtures/ holds files copied unchanged from
edde746/openwatchparty at d8c3c2abc753: the Apache-2.0 LICENSE, relays.json,
the eight tables this crate implements and the descriptor examples of
spec/examples. Its README lists each upstream path and SHA-256, and
THIRD-PARTY-NOTICES.md section 6 names it. Every table has a runner, and a
guard fails on a vendored table without one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Filippo Scatigna <filippo@scatigna.tech>
…nore action in joined

Three review fixes, each with a test seen failing first:
- The reader keeps duplicate member names, so the send checks now refuse a
  descriptor that repeats one at any depth (SDK.md 7.1); the descriptor
  examples with repeated names run as send failures instead of being skipped.
- The scan rewrites an overflowing number only when the token follows the
  JSON number grammar, so 01e400, 1.e400 and -.5e400 stay errors.
- action in joined.room is an unknown member, as snapshot.schema.json has it,
  instead of making the joined malformed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Filippo Scatigna <filippo@scatigna.tech>
The HOSTSIM_SUITE notes in the Makefile and docs/agent-reference.md name
plx_owp among the crates without a hostsim feature, and the hook note says the
release-config hook does not watch owp. THIRD-PARTY-NOTICES.md section 6
counts three components, module-layers.md says owp may name only base and
names no layer crate today, the source_lines list in ci/build-budgets.json
reads right, and strict_json's doc names plx_owp::json as the other reader
that keeps duplicates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Filippo Scatigna <filippo@scatigna.tech>
GLinnik21 asked in plxnative#1090 for an empty uses on [owp], so the crate can later
be used on its own. It already names no plx_* crate; the row and the
paragraph in docs/module-layers.md now say so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Filippo Scatigna <filippo@scatigna.tech>
GLinnik21 asked in plxnative#1090 for a hard failure when the two passes disagree on
the marks. read() now also compares the marks the visitor applies and the
infinities it returns with the scan's, in read_scanned(), which the tests
feed a forged scan. A scan that broke the UTF-8 of its input is an error
instead of an empty text.

The escaped-backslash cases he named have tests: \\ud83d alone, before a
pair, and after an odd run of backslashes. A scan that skips one byte after
a backslash turns them red.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Filippo Scatigna <filippo@scatigna.tech>
GLinnik21 asked in plxnative#1090 for a cap checked before the scan. decode() now
returns TooLarge for a message over MAX_RELAY_MESSAGE_BYTES, 65536 bytes,
without reading it. SPEC.md §3.1 makes 32768 the least a client accepts, and
the Dart and Kotlin SDKs test past it, so the cap is above that floor; the
value is the one proposed in plxnative#1090 and waits for his answer.

The 32768 test now reads messages of exactly 32768, 40000 and 65536 bytes.
ci/list-caps.ini classes the cap as not-a-list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Filippo Scatigna <filippo@scatigna.tech>
GLinnik21 asked in plxnative#1090 for tests on real message parsing as well as the
tables. decode() now has them for unknown members at two depths, escaped
names and values, lone surrogates in a checked field and in an unknown one,
numbers past their range (1e400 and 2^53, and 1e400 inside ext), ext nested
100 levels deep (read) and 5000 (Ignored at serde_json's recursion limit),
and unknown error codes, closed reasons and action kinds, which stay strings.

This commit also carries one rule: a relay message that repeats a member name
at any depth is Malformed("repeated name"). SPEC.md §4 forbids sending one
but says nothing of receiving it; refusing it means no copy is chosen.

Each test was seen red: the repeated names before the rule, the others under
a mutation of the code they guard, except the escapes, which serde_json
decodes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Filippo Scatigna <filippo@scatigna.tech>
GLinnik21 asked in plxnative#1090 for a fuzz target in this PR: same length, no
panic, ordinals agree. owp_json checks, on any UTF-8 input:
- json::scanned, the scan's facts made public for it, keeps the length;
- decode and read do not panic, and read never fails with DISAGREEMENT,
  the error a split between the scan and the visitor gives;
- what serde_json reads, the reader reads too, with no marks;
- the strings the visitor marks and the numbers it makes infinite, in
  document order, are the ordinals the scan recorded.

Seen red: a visitor that leaves a member name unmarked is found in 6 s, a
scan that skips one byte after a backslash in 3 s. The seeds are the vendored
examples and relays.json plus six relay messages; owp.dict holds the message
names, the surrogate escapes and the overflowing numbers.

fuzz.yml runs it for changes under rust-modules/owp and counts ten targets;
the Makefile's disk note and docs/agent-reference.md give its 49 MiB.
DISK_NEED stays 3.3.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Filippo Scatigna <filippo@scatigna.tech>
CONTRIBUTING.md, TRADEMARKS.md and the README's licence line said all of the
project's own code is GPL-3.0-or-later; plx_owp is now Apache-2.0, as
LICENSING.md says. Found by doc-claim-auditor.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Filippo Scatigna <filippo@scatigna.tech>
pr-reviewer: decode returned Malformed("repeated name") before reading type,
so the session could not tell a malformed joined, which SDK.md §8 answers
with leave and a failed join, from a malformed pong, which it ignores; and
an unknown type or a non-object with a repeated name came back Malformed,
where SDK.md says those are ignored. decode now reads type first: a repeated
name gives Malformed(<type>) for the five relay types and Ignored otherwise.
Both tests failed against the previous order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Filippo Scatigna <filippo@scatigna.tech>
pr-reviewer: without float_roundtrip, serde_json reads 1.79769313486231581e308
as f64::MAX, while the scan rounds it correctly to Infinity, as JavaScript
does; the target crashed on it against a correct reader. It now asserts only
that an input serde_json reads has no marks. The token joins the overflow
seed, and a json.rs test pins it as Infinity (red when the scan stops
rewriting overflowing numbers).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Filippo Scatigna <filippo@scatigna.tech>
main's three new commits re-pinned ci/proofs/platform-generated-enums.json
for a doc-only variant of FirstInGroupAnimated; the branch had re-pinned it
for the plx_owp manifest. ci/readonly_generated.py took main's side, and
scripts/plxnative-certs.sh regenerated both certificates and their
CERTIFICATE_SHA256 pins on the merged tree.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Filippo Scatigna <filippo@scatigna.tech>
Copilot AI lite review requested due to automatic review settings November 18, 2026 21:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@GLinnik21 GLinnik21 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 64 KiB pre-scan limit looks good. I ran the 56 crate tests and checked the public API directly. Two behaviors need fixes before the session machine builds on them. I left inline comments on both. Two smaller protocol gaps to keep in view are that the media validator loses the first failed rule required by SDK §9.7, and PingId only represents integer numeric IDs even though SPEC §7.4 permits a string or number. The latter does not affect the integer IDs generated by the SDK clock.

Comment thread rust-modules/owp/src/code.rs Resolved
Comment thread rust-modules/owp/src/message.rs Resolved
PilaScat and others added 3 commits November 18, 2026 23:58
GLinnik21 on plxnative#1462: SDK.md §4.1 has relayFor and formatCode share one
normalizer, and relayFor returns null for an invalid code. relay_for took
the first character as given, so with the embedded list "K" routed to asia
and the valid "k7m-q2x" to nothing. The code-routing runner normalized
before calling it, so the table missed both. relay_for now normalizes and
validates the whole input, the runner passes the code as typed, and the
tests call relay_for directly. The new tests and the table failed against
the previous relay_for.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Filippo Scatigna <filippo@scatigna.tech>
GLinnik21 on plxnative#1462: SDK.md §9.7 says unknown members outside ext are not
checked, not kept and not sent. joined_media returned the checked
descriptor whole, so media.futureField reached Incoming::Joined. It now
returns media::known_members, which drops unknown members at the top level
and in series and file, and keeps ext and every ids namespace whole. The
test failed against the previous joined_media.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Filippo Scatigna <filippo@scatigna.tech>
GLinnik21 on plxnative#1462: SDK.md §9.7 has checkMedia return the first rule a
descriptor breaks, so that an app can trim file.name or ext and check again
(SDK.md:1244). check returned a bool. It now returns Result<(), MediaRule>:
one rule per member, in the order the TypeScript SDK checks them, then the
send-only rules, a repeated name, ext over 1024 bytes and the descriptor
over 4096. The tests did not compile against the bool, and four mutations
of the order, the mapping and the direction turn them red.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Filippo Scatigna <filippo@scatigna.tech>
Copilot AI lite review requested due to automatic review settings November 18, 2026 23:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@PilaScat

Copy link
Copy Markdown
Contributor Author

Thanks for running them. Both inline points are fixed, and answered in their threads. On the two smaller gaps:

  • The first failed rule (§9.7): fixed in d8c9599. media::check now returns Result<(), MediaRule>. There is one rule per member, in the order the TypeScript SDK checks them, then the send-only rules: a repeated name, ext over 1024 bytes and the descriptor over 4096. The tests cover each rule, the first of several, and sizes checked on send only.
  • PingId: left as is. A pong whose id is a non-integral number decodes as Malformed("pong"). The clock sends only 1, 2, 3…, the SDK ignores a pong with an unknown id (SDK.md:251), and a bad pong gives no sample (SDK.md:491), so the session sees the same outcome. If you'd rather PingId held any number, I'll add it.

On d8c9599: make check has 35 suites, 22930 passed and 0 failed. make check-nodef, make lint, the ARM check and the budget (93) are clean. plx_owp has 62 tests.

@GLinnik21

Copy link
Copy Markdown
Collaborator

@claude review

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @GLinnik21's task in 2m 18s —— View job


Review

Nothing blocking in plx_owp from reading it; one small real bug and four nits, all inline. This is a read-only review: cargo and git fetch were denied in this job, so I ran no tests and none of the findings were reproduced.

  • Read the plx_owp sources and the fuzz target

  • Check the three fixes from the last review

  • Check the build/CI wiring — not done (no merge base in this checkout, so I couldn't diff the Makefile, ci/ lists or the two certificates)

  • Run the crate tests — not done (cargo denied)

  • Post findings

  • The three fixes from the last review look right in the code: relay_for normalizes first (code.rs:25), joined_media returns known_members (message.rs:251), and check_shape returns the first broken rule in member order (media.rs:107).

  • valid_url accepts wss://v1/ws — suggestion inline.

  • The certificates and the ci/ lists you asked to have reviewed still need a human or a run with a full checkout.

  • To let me run make test-crate C=plx_owp next time, allow cargo/make and git fetch in --allowedTools.

Comment thread rust-modules/owp/src/relays.rs Resolved

fn valid_action(action: &Json) -> bool {
action.members().is_some()
&& action.get("kind").and_then(Json::as_text).is_some_and(|text| !text.value.is_empty())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

action.kind only has to be non-empty, so "kind":"\ud800" passes as "\u{fffd}", while closed.reason and error.code go through plain_string and refuse it. The room-check table doesn't cover it and I can't see SDK.md from here, so this is a question: should kind also need !text.unpaired?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. SDK.md:433 asks only for a non-empty string, and TypeScript checks no more (messages.ts:136). The difference ran the other way: error and closed refused a lone surrogate, which SDK.md:492-493 doesn't ask for. So a closed whose reason held one was dropped here, while TypeScript ends the party (party.ts:908). Fixed in b31411e: error.code, message, re and closed.reason now take the text with U+FFFD. The test failed against the old decode, and it also pins kind.

Comment thread rust-modules/owp/src/clock.rs Resolved
Comment thread rust-modules/owp/src/message.rs Resolved
Comment thread rust-modules/owp/src/json.rs Resolved
PilaScat and others added 5 commits November 19, 2026 13:45
The review on plxnative#1462: valid_url tested the /v1/ws ending on the whole URL,
so the // of the scheme could supply its slash, and wss://v1/ws (host v1,
path /ws) passed. SDK.md §3.2 wants the ending after a non-empty host. The
ending is now tested on the part after the scheme, as the TypeScript SDK
does (relaylist.ts:43). The new test failed against the previous
valid_url.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Filippo Scatigna <filippo@scatigna.tech>
…reads them

The review on plxnative#1462 asked whether action.kind should refuse an unpaired
surrogate, as error.code and closed.reason did. SDK.md §8 asks of an
action kind only a non-empty string (SDK.md:433), and of an error and a
closed only strings, with code and reason non-empty (SDK.md:492-493). The
TypeScript SDK reads them so (messages.ts:136, party.ts:908). kind stays as
it is. error.code, error.message, error.re and closed.reason now take the
text the reader made, with U+FFFD for the surrogate, where they were
Malformed before: a closed whose reason is "kicked" plus a lone surrogate
ends the party in TypeScript, and was dropped here. The new test failed
against the previous decode; it also pins kind.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Filippo Scatigna <filippo@scatigna.tech>
The review on plxnative#1462: an entry left the clock's map of sent pings only when
its pong arrived, so each ping the relay never answered stayed for the
life of the ClockSync. Each PingSent now first drops the pings sent more
than 10 s before, as the TypeScript SDK does (clock.ts:13 and :22). No
outcome changes: a pong later than LARGEST_RTT_MS was already ignored. The
new test failed against the previous transition.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Filippo Scatigna <filippo@scatigna.tech>
The review on plxnative#1462: resume, transferHost and kick sent peerId and token
unchecked, though the PR says every client message is checked before
sending; only the 8192-byte cap stopped a bad one. They now go through
is_peer_id and is_token, the receive patterns, and fail with
InvalidMessage("peerId") or InvalidMessage("token"). is_token reads the
Json, as is_peer_id does. The participant check of SDK.md §12
(SDK.md:973-974) is the session's. The new test failed against the
previous encode. The 8192-byte test now pads a ping's text id, the one
client string with no bound of its own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Filippo Scatigna <filippo@scatigna.tech>
The review on plxnative#1462: the reader turns a number past a double's range into
an infinity, and a received descriptor may carry one inside ext, where
values are any JSON. Written back, serde_json makes it null, so re-sending
that descriptor would change it without an error. The send check now has
MediaRule::ExtNumber after the repeated name and before the ext size, as
the Swift SDK's checkMedia refuses "a number JSON can't carry"
(Media.swift:296); the receive check is unchanged. Json gains
holds_a_non_finite_number. The new test failed against the previous
check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Filippo Scatigna <filippo@scatigna.tech>
Copilot AI lite review requested due to automatic review settings November 19, 2026 12:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@PilaScat

Copy link
Copy Markdown
Contributor Author

The five points of the claude review are fixed in b6a8a74..daefc2c and answered in their threads. Each new test failed first, and eight mutations of the fixes turn them red.

On daefc2c: make check has 35 suites, 22935 passed and 0 failed. make check-nodef, make lint, the ARM check and the budget (93) are clean. plx_owp has 67 tests.

@GLinnik21
GLinnik21 merged commit bccf03e into plxnative:main Nov 19, 2026
53 checks passed

@GLinnik21 GLinnik21 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@PilaScat
PilaScat deleted the feat/owp-protocol branch November 19, 2026 14:38
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.

3 participants