Repository navigation
fix(id/web/world): reject wrong-shape invite/view/error frames (#7924) - #8536
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 51 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cf3b0466b3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const malformed: Array<Record<string, unknown>> = [ | ||
| { type: "invite", invite: { capability: { forged: true } } }, | ||
| { type: "invite", invite: { capability: 12345 } }, | ||
| { type: "invite", capability: { forged: true } }, | ||
| { type: "invite", capability: 12345 }, | ||
| ]; |
There was a problem hiding this comment.
Add property-based coverage for frame-shape invariants
For this frame parser, the new suite covers only handcrafted examples, but the repository testing doctrine explicitly requires property tests for parser/state invariants. Add generated JSON frame shapes with an explicit acceptance oracle and verify that rejected frames preserve the capability, sessionStorage, rendered view, and revision state. This would also cover the newly added display-name and base-revision validation branches, which the current examples do not exercise.
AGENTS.md reference: AGENTS.md:L41-L45
Useful? React with 👍 / 👎.
…ew/error (#7924) Codex P1 on PR #8536: the frame parser suite covered only handcrafted examples. Add a fixed-seed generated-shape property test with an explicit acceptance oracle restated from the world.ts validation: 240 generated invite/view/error frames; rejected frames must preserve capability, sessionStorage, rendered view and status semantics, accepted frames apply exactly the named field effects. Coverage guards assert both outcomes per kind plus the display_name and base_view_revision branches.
|
Fixed in 70e8aaa. Added a property-based test to world-frames.test.ts: a fixed-seed PRNG generates 240 invite/view/error frames from a mixed JSON value pool, checked against an explicit acceptance oracle restated from the world.ts validation rules. Rejected frames are asserted to preserve the capability field, sessionStorage, and the rendered view; accepted frames apply exactly the named field effects. Coverage guards assert both outcomes per frame kind and that the display_name and base_view_revision branches are exercised. Suite: vitest run src/world-frames.test.ts — 6 passed. |
|
@codex review |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Fixes #7924.
Session-WS invite/view/error frames in pkgs/id/web/src/world.ts receive() were shape-trusted:
Now, mirroring the snapshot/event rejectFrame() discipline:
Tests (oracle = the frame-shape acceptance in #7924; the FakeWebSocket harness pins persisted sessionStorage, the capability field, rendered view text and status):
Queue: task 14284, lane tmp-code-v.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.