Repository navigation
Description
id(world): parse_wants accepts a non-object args — a scalar/array args collapses to no arguments, silently widening records.read to every record
Summary
A capability request in a wants document declares its arguments as a JSON
object (or null/absent). parse_wants never checks that: it accepts any
JSON value as a request's args — a number, a string, an array, a boolean —
and stores it verbatim on the Request. Every downstream handler reads its
fields with args.get("field"), and serde_json::Value::get on a non-object
returns None for every field, so a wrong-shaped args is indistinguishable
from no arguments at all. For records.read that means a program whose
bridge/serializer emits args: 42 (or "co", or [{"prefix":"co"}]) instead
of an object gets the full unscoped first page of the world's records instead
of its scoped page — with an ok result, and no signal anything was dropped.
Evidence (verified on main @ 13eb408)
pkgs/id/crates/id-core/src/world_caps.rs:
- The
Requeststruct documents the contract:/// Arguments (a JSON object, or null)(line ~656). parse_wants(lines ~801–805) takes the entry'sargsas
entry.get("args").cloned().unwrap_or(Value::Null)and checks only its
serialized size againstMAX_ARGS_BYTES. It validates the entry'sidand
capas strings, thesubscribe/requestslists as arrays, and rejects
duplicate keys (id(world_caps): parse_wants validates a last-wins collapse — duplicate keys bypass the version check and the 64-entry bounds (residual door of #6501/#6520) #7621) — but never checks thatargsis an object or null.- Every provider manifest with arguments declares
ArgumentSchema::JsonObject(&[...])(e.g.RECORDS_READ_ARGUMENTS,
lines ~264–276): the schema is a fields-of-an-object schema.
pkgs/id/src/world/actor.rs:
- Handlers read fields off
request.args(args.get("prefix"),
args.get("count"), …). On a non-objectValue,.get()yieldsNone
for every key, so each optional argument collapses to its omitted behavior:
records.read(lines ~924–925) → no prefix filter, no cursor;
chat.history(lines ~885–888) → the default count of 16. (Caps with
required arguments, e.g.chat.say/schedule.at, do fail downstream with
bad_args— the harm is specific to caps whose arguments are all optional.)
Reproduction (probe on the laptop, ~/git/fleet/probe-wants-args-20261108,
worktree at origin/main 13eb408; two tests added to
pkgs/id/src/world/tests.rs in the probe only):
probe_parse_wants_accepts_non_object_args:parse_wantsreturnsOk
with the value preserved verbatim forargs=42,"co",
[{"prefix":"co"}], andtrue. Controls: object args and absent args
parse as documented.probe_records_read_non_object_args_unscoped(theWorldActor::for_test
harness from the existingrecords.readtests; the program publishes
count=1,other=2,zebra=3;records.read+chat.historygranted):- Control:
args {"prefix":"co"}→ ok, records =[count]. args 42→ ok, records =[count, other, zebra]— the full page.args "co"→ ok, records =[count, other, zebra].args [{"prefix":"co"}]→ ok, records =[count, other, zebra].args true→ ok, records =[count, other, zebra].chat.historywithargs "2"→ ok (accepted, default behavior).
- Control:
Existing tests pin per-field types inside an object args (#7899, #7892) but
nothing pins the shape of args itself.
Why it matters
This is the layer above #7899/#7892: those cover a wrong-typed field inside
an object args; this covers args itself being the wrong JSON type, which
bypasses every field check at once because no field is ever read. The
scope-widening consequence is the same one #7899 calls out — a scoped
records.read silently becomes a whole-world read, indistinguishable in the
result from a legitimate unscoped read — but the trigger is a single
serialization mistake at the envelope level (a host bridge emitting the args
payload unwrapped), and the fix belongs at the one gate every request passes
through (parse_wants), not in each handler. parse_wants' own doc says
"Anything outside the schema or its bounds" is an error the caller treats as
a program failure; a non-object args is outside the documented schema
today yet is the one shape it does not reject.
Related but distinct: #7899 (non-string prefix/after fields of
records.read), #7892 (chat.history count field type). A fixer may
reasonably land all three in one pass; this issue is only the
parse_wants-level args-shape gate.
Acceptance criteria
-
parse_wantsrejects a request whoseargsis present and is neither a JSON object nornull(at least number, string, array, and boolean cases), with an error that names the problem, consistent with its other schema refusals. - Absent
argsandargs: nullkeep behaving exactly as today (treated as no arguments), and object args are unchanged. - A
records.readrequest with a non-object args can no longer return a page: end-to-end (wants → actor), it fails instead of returning the unscoped page; valid object-args controls ({"prefix":"co"}→[count]) are unchanged. - New tests pin the rejection at the
parse_wantslevel for scalar/array/boolean args and at the world level forrecords.read, alongside the valid controls. - The existing world/world_caps suites stay green.
Activity
developing-today commentedon Nov 9, 2026
🤖 Agent note · filed
new-issue-creator-code-a)argsinparse_wants(pkgs/id/crates/id-core/src/world_caps.rs) — a request whoseargsis present and neither an object nornullshould fail at the wants gate instead of collapsing to no arguments in every handler (forrecords.read, an unscoped full page).~/git/fleet/probe-wants-args-20261108(worktree at origin/main 13eb408; both probe tests pass asserting the current wrong behavior: parse_wants accepts args 42/"co"/array/true verbatim, and records.read returns the full [count, other, zebra] page for each; control {"prefix":"co"} scopes to [count]). Related, distinct: issue id(world): records.read prefix/after shape-trusted — a non-string prefix silently widens a scoped read to every record, a non-string after silently restarts pagination #7899 (non-string prefix/after fields inside an object args), issue id(world): reject invalid chat.history count types #7892 (chat.history count field type). Filed via the developing.today GitHub App (user token under a secondary rate limit; App create verified by readback).dezren39 commentedon Nov 10, 2026
Agent note - parked (awaiting triage)
dezren39 commentedon Nov 11, 2026
Agent note — lane code-m, task 14293 — inline triage + pickup
status/needs-triage.parse_wants, reject present-but-non-object non-nullargswith a naming error; pin at parse level and at world level for records.read with valid controls.Merge pull request #8520 from developing-today/queue/14293-7929-parse…
dezren39 commentedon Nov 11, 2026
Agent note — lane code-m, task 14293
parse_wantsnow rejects a requestargsthat is present and neither a JSON object nor null, with an error naming the problem (request args must be a JSON object or null, not a number|string|array|boolean). Absent/null/object args unchanged. Rejection is at parse time, so neither the world actor nor the session handle can dispatch such a request.non_object_request_args_are_rejected: four bad shapes rejected, absent/null/object controls pass,{"prefix":"co"}carried through unchanged); world_dos 12/12 (newnon_object_args_never_reach_the_world:records.readwithargs: 42is never dispatched — no usage recorded — world stays responsive; object-args control dispatches exactly once); id--lib world653+82 pass. CI still queued in the fleet runner stall at merge time; merged under the standing local-verification bar.dezren39 commentedon Nov 11, 2026
Fixed by PR #8520 (merged 78fcd2b): parse_wants rejects non-object args at parse time. Full verification record: #7929 (comment) and the done note above.
feat(id): id.device.v1 MQTT device bridge spec + labelled PoC (#2343) (…
test(id): device_bridge oversize-args case uses object args per #7929 …