Repository navigation
feat(id): bounded raw input token assembler (inert, #787 slice B) - #5512
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 29 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 SummaryThis 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: fcc276a709
ℹ️ 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".
| ]; | ||
|
|
||
| #[test] | ||
| fn plain_text_emits_one_token_per_scalar() { |
There was a problem hiding this comment.
Prefix the new test names with
test_
All 16 new test functions omit the test_ prefix explicitly required by the scoped naming convention in pkgs/id/AGENTS.md. Rename these functions to follow that documented convention; the same correction applies throughout this test module.
AGENTS.md reference: pkgs/id/AGENTS.md:L140-L140
Useful? React with 👍 / 👎.
Slice B of the landed #787 design (
doc/2026-11-01_design_id787.md§4.2 and §6 row B).Part of #787. This is one of six slices and does not close the issue; C–F remain.
What this adds
A new, inert Rust module
pkgs/id/src/input_framing.rs(plus its registration insrc/lib.rs) that turns arbitrary transport chunks into complete logical key tokens:pushcalls andemits one token per complete key, independent of how the transport split the bytes.
Plain text emits one token per Unicode scalar.
transport received, so the durable
Input(Vec<u8>)boundary is untouched.(§4.2 safety defaults). Overlong tokens, invalid UTF-8, incomplete tokens at
EOF/deadline and queue loss are fatal; the caller must close the session, because
a missing prefix cannot be resynchronised.
InputAssemblerper raw connection, so interleavedconnections cannot mix partial tokens.
ReplyFilterseam only:push_filtereddrops recognized control replies whilepreserving key order, for F13.4's demultiplexer to implement in slice E. No filter
is provided that swallows unrecognized keys.
No activation.
world_sshdoes not call the module, the durableInputevent,journal format, guest ABI, browser encoder and lease/negotiation paths are unchanged.
Tests
Coverage follows the §6 done check: every split point and byte boundary of the fixture
corpus, coalesced keys, split probe-reply + key order, cap boundary (exactly 256 passes,
257 fails), unterminated over-cap, deadline, EOF with/without pending bytes, invalid
UTF-8 and overlong forms, malformed escapes, queue loss and interleaved connections.
cargo fmt --all -- --checkpasses. Default-feature targeted crate tests pass (16/16),and
cargo check --all-targetspasses with the crate's default features. The isolatedmodule also passes
clippy-driverwith the crate's Clippy groups and repo-specificallow-list. Both
cargo clippy --libandcargo clippy --lib --all-featurescould notcomplete: they failed with
E0514incompatible-compiler metadata errors in existingdependency artifacts (e.g.
p2panda_core,thiserror,anyhow) before reaching thecrate lint pass.
cargo check --all-targets --all-featuresalso cannot compile in thischeckout because the RustEmbed input
web/disthas not been generated. The--no-default-featurestest variant cannot compile on currentmainbecause ofpre-existing
world/petnamefeature-gated references inchat.rs/invite.rs; thedefault-feature test variant passed.
No automated CI jobs were triggered for this PR.
.github/workflows/id-check.ymlhasonly
scheduleandworkflow_dispatchtriggers (its header still mentions PRs), sopackage-level PR CI coverage is absent on this branch; the required code check was run
locally as described above.
roc-testpasses all 83 Roc expectations.Slice status after this PR