Repository navigation
Description
Problem
records.read declares its arguments in pkgs/id/crates/id-core/src/world_caps.rs:264-276 (at origin/main d2c2a05b5e): optional prefix and after, both ArgumentType::String. But parse_wants only bounds the serialized args size (world_caps.rs:798-805) — it never validates argument values against that schema — and the handler in pkgs/id/src/world/actor.rs:924-925 reads both fields with .and_then(serde_json::Value::as_str):
let prefix = args.get("prefix").and_then(serde_json::Value::as_str);
let after = args.get("after").and_then(serde_json::Value::as_str);A supplied non-string value therefore collapses to None — exactly the same as omitting the argument. The sibling handlers in the same match do not do this: chat.say (actor.rs:965), schedule.at (actor.rs:997-1001), and schedule.cancel (actor.rs:1031) all reject a wrong-typed required argument with CapError::bad_args(). And #7892 covers the same silent-default pattern for chat.history's count. records.read's two string arguments are the unfiled remainder.
Verified behavior (laptop probe, origin/main d2c2a05)
Probe: ~/git/fleet/probe-records-shape-20261108 (laptop worktree at origin/main; in-module test reusing the WorldActor::for_test + result-capture pattern of records_read_pages_fit_the_result_event_that_delivers_them, pkgs/id/src/world/tests.rs). The program publishes records count=1, other=2, zebra=3; records.read granted. Probe test probe_records_read_shape_trusted_prefix_after: 1 passed.
Controls — valid string arguments scope the page exactly as documented:
{"prefix": "co"}→ ok, records =[count].{"after": "count"}→ ok, records =[other, zebra].
Malformed — every one returns ok with the full unscoped page instead of bad_args:
{"prefix": 123}→ ok, records =[count, other, zebra]— the prefix filter silently disappears.{"prefix": null}→ ok, records =[count, other, zebra].{"after": 123}→ ok, records =[count, other, zebra]— pagination silently restarts from the beginning.{"after": {"x": 1}}→ ok, records =[count, other, zebra].
Why it matters
For prefix this is a scope-widening silent failure, not just a hidden typo: a program that asks for one prefix subtree (e.g. because it is only meant to see that subtree, or to keep the page byte-bounded) receives every published record in the world, key-ordered from the start, up to the page byte cap. A serialization mismatch in a guest program (a number-typed config value, a null from a host bridge) silently escalates a scoped read into a whole-world read and the caller cannot tell — the result is indistinguishable from a legitimately unscoped read. For after, a mistyped cursor silently restarts pagination, so a paging loop can repeat the first page forever instead of erroring. The declared argument contract (world_caps.rs) says these are strings; the handler should enforce it the way its sibling handlers already do.
Acceptance criteria
- A supplied non-string
prefixorafter(at least number,null, object, array, and boolean cases) is rejected withbad_args, rather than treated as omitted. - An omitted
prefix/afterstill returns the unscoped / from-the-start page, exactly as today. - Valid string
prefix/afterbehavior is unchanged, including the byte-bounded page andnext_aftercontract (id(world): records.read cap pages can exceed the result_event size cap — admitted 768 KiB pages are replaced by result_too_large above 64 KiB #4888). - Add a world-level regression test exercising malformed
prefix/afterthrough the request path (theWorldActor::for_testpattern used by the existingrecords.readtests), plus the valid-string controls.
Evidence
- Code:
pkgs/id/src/world/actor.rs:924-925(prefix/afterread viaas_str,None= omitted) at origin/maind2c2a05b5e30af0f663625348995d591c79ebd5e; schemapkgs/id/crates/id-core/src/world_caps.rs:264-276;parse_wantssize-only checkworld_caps.rs:798-805. Contrastactor.rs:965,actor.rs:997-1001,actor.rs:1031(sibling handlers reject wrong types withbad_args). - Probe:
~/git/fleet/probe-records-shape-20261108/pkgs/id/src/world/tests.rstestprobe_records_read_shape_trusted_prefix_after(laptop, @d2c2a05b5e): controls scoped correctly; all four malformed cases returned ok with the full[count, other, zebra]page.cargo test --lib probe_records_read_shape_trusted_prefix_after→ 1 passed. - Dedup: id(world): reject invalid chat.history count types #7892 covers
chat.historycountonly (different cap, different argument, numeric default) — title/keyword searches forrecords.read+ prefix/bad_args/malformed return no filing for these arguments; id(world): records.read cap pages can exceed the result_event size cap — admitted 768 KiB pages are replaced by result_too_large above 64 KiB #4888 (closed) covered page-size vs result-event cap, not argument types.
Activity
developing-today commentedon Nov 9, 2026
CODE-2341
dezren39 commentedon Nov 9, 2026
🤖 Agent note · filed
dezren39 commentedon Nov 11, 2026
state: triaged
task: 14252
lane: code-u
outcome: inline_triage_and_pickup
Inline triage (§1c) by lane code-u for task 14252 / issue #7899:
Proceeding to the fix in this same claim.
dezren39 commentedon Nov 11, 2026
kind: parked
task: 14252
lane: code-u
pr: #8518
state: PR #8518 open at head 9d575fe; task parked as a CI wait (ready-condition ci/pr 8518).
What landed
execute_records_readnow rejects a present-but-non-stringprefix/afterwithbad_args, following the same idiom asexecute_chat/execute_schedule_at; omitted arguments behave exactly as before.records_read_rejects_a_non_string_prefix_or_afterthrough the request path: number/null/object/array/boolprefixand number/null/objectafterallbad_args; omitted / string-prefix / string-after controls return the same pages as before. Verified the test fails on the pre-fix code.cargo test --lib --features world world::— 280 passed, 0 failed; rustfmt clean.Resume
When PR #8518's checks complete: read the Codex review on head 9d575fe and disposition any findings, merge the PR, confirm #7899 auto-closed, then complete task 14252.
fix(world): records.read rejects a non-string prefix/after with bad_a…
dezren39 commentedon Nov 11, 2026
agent-note:v1
state: done
task: 14252
lane: any-b
summary: PR #8518 merged (squash, merge commit 3cad9f8) at head 9d575fe; issue #7899 auto-closed. Codex review completed with no findings on that head. Prior verification stands: world suite 280 passed, regression test oracle-sensitive (fails pre-fix, passes post-fix). Remaining PR checks were cancelled/queued in the fleet runner backlog; merge followed standing merge authority (CI runs on main).
next: none for task 14252