GeezerVison is showing github.com — id(world_records): read_records returns replicated records with none of the record caps re-checked — count, key, and value limits are enforced on publish and on admin-history receipt, but not on replica receipt · Issue #6483 · developing-today/code
id(world_records): read_records returns replicated records with none of the record caps re-checked — count, key, and value limits are enforced on publish and on admin-history receipt, but not on replica receipt #6483Descriptionid(world_records): read_records returns replicated records with none of the record caps re-checked — count, key, and value limits are enforced on publish and on admin-history receipt, but not on replica receipt
Summary
Every path that produces or receives a world's structured records enforces the same caps — except one:
world::parse_records (pkgs/id/src/world/mod.rs:1946) bounds a program's published records: at most MAX_RECORDS = 4096 records (:1933), keys 1..=256 bytes with no control characters (MAX_RECORD_KEY_BYTES, :1935), values at most 8192 serialized bytes (MAX_RECORD_VALUE_BYTES, :1937).
- The admin-history client re-checks exactly those caps on receipt:
AdminHistoryBudget::add_record (pkgs/id/src/world_net.rs:565) refuses an empty/over-long/control-character key, a value over MAX_RECORD_VALUE_BYTES, and a count over MAX_RECORDS — receipt does not trust the sender.
world_records::read_records (pkgs/id/src/world_records.rs:207) — the function that reads a (local or replicated) records doc — checks none of them. It inserts every doc entry into the returned Records map: no count limit, no key validation (a key is accepted if it is UTF-8 and its doc key ends in \0; control characters and interior content are unchecked), and no value-size limit (the blob is fetched and deserialized whole).
read_records is the receipt path for replication: world_records::replicate returns its result, and the world mirror command (pkgs/id/src/commands/world.rs:180+) prints it, then in --follow mode re-reads and re-prints the whole set on every remote insert (:191). The doc is single-writer, but the writer is the remote host's author key: a mirror client that accepts a records ticket from a host is trusting that host's software to have run parse_records. A host running modified software (or a compromised author key) can publish a doc that no conforming host would ever produce — tens of thousands of records, keys a conforming program cannot name, values far over the per-record cap — and every mirror client will buffer it all in memory and dump it to the terminal, repeatedly in follow mode. That is exactly the receipt-side trust the admin-history budget refuses to grant its sender.
Evidence
Verified this run on the laptop at origin/main 252d430853 with a probe test added to the world_records test module in a scratch worktree (~/git/fleet/probe-records-read), writing doc entries directly with the doc author (doc.set_bytes, bypassing RecordsStore::reconcile/parse_records — the modified-host position), then calling the real read_records:
- one record whose value is a 9000-byte string (cap 8192),
- one record under a 300-byte key (cap 256),
- one record under a key containing a control character (
bad\u{7}key),
- 4097 additional tiny records (cap 4096 in total).
Probe output: PROBE count=4100 big_len=9000 long_key_present=true control_key_present=true — read_records returned all of it, Ok. (1 probe test passed; the three over-cap classes and the over-count class all reproduce in the one run.)
Code read @252d430853: read_records at world_records.rs:207 loops doc.get_many(Query::all()), skips only entries whose key does not end in \0 or is not UTF-8 (record_key, :54), fetches each blob with get_bytes, and inserts serde_json::from_slice(&bytes) with no size, count, key, or total-bytes check. replicate (:251) returns read_records' result after its settle loop; no caller between the doc and the mirror printer re-validates (commands/world.rs:187 prints the map directly).
Why it matters
The caps are not cosmetic: they are the contract that lets every records consumer (session pages, SSH terminal pages, admin history) bound its memory and output. The replica path is the one consumer that skipped the receipt check, so the cheapest way to make a mirror client allocate and print unbounded data is the path designed for reading someone else's world. Re-checking on receipt is the codebase's own established pattern (AdminHistoryBudget::add_record does it field by field for the same three constants); read_records is the outlier.
Acceptance criteria
read_records refuses (or the receipt path in replicate refuses) a doc whose records exceed MAX_RECORDS in count, whose keys are empty, over MAX_RECORD_KEY_BYTES, or contain control characters, or whose values exceed MAX_RECORD_VALUE_BYTES serialized — with an error naming the offending record key, matching the error style of parse_records/add_record.
- The bound is enforced during the read (a doc with far more entries than the cap fails without first materializing every blob), or any streaming shortcut is explicitly justified in the fix.
- Conforming docs are unchanged: the existing
world_records tests (reconcile round-trips, namespace persistence) still pass, and a doc written by RecordsStore::reconcile from a parse_records-valid set always reads back.
- New tests pin receipt refusal for at least the over-count, over-long-key, control-character-key, and oversized-value shapes (the probe shapes above), plus a valid-doc control.
- The
mirror --follow loop's behaviour on a refusal is defined (error surfaces, not a silent retry spin).
Notes
Activitydeveloping-today commented on Nov 6, 2026 added kind/bugSomething isn't working (prefixed form of the classic bug label) task/triageQueue packet kind: verify, reproduce, and route this item app/idPackage/app: id (pkgs/ or apps/ in this repo) on Nov 6, 2026dezren39 commented on Nov 6, 2026 🤖 Agent note · filed
- Agent: new-issue-creator job (new-issue-creator-code-b)
- Session / ID: new-issue-creator-code-b run 2026-11-06 03:20 CST
- Found via: filed this run
- Task: Filed this verified finding —
read_records (world_records.rs:207) returns replicated records with no MAX_RECORDS / key / value caps re-checked; probe on laptop @252d430853 (direct author writes bypassing reconcile) returned count=4100, a 9000-byte value, a 300-byte key, and a control-character key, all Ok.
- Expectation: effort s; done = receipt-side caps enforced during the read with key-naming errors, regression tests for the four probe shapes, existing world_records tests green.
- Links: queue packet packet-6483-triage.json (repo-health-code-pilot)
dezren39 commented on Nov 6, 2026 🤖 Correction (new-issue-creator-code-b): the first queue packet for this issue was enqueued against a wrong issue number (#6481, a fabricated tool delivery) as task 10953. The correct packet for this issue is task 10963. Task 10953's holder: its payload describes THIS finding (world_records read_records) but names #6481 — please stand down on it in favour of task 10963.
dezren39 commented on Nov 6, 2026 🤖 Agent note · done
Triage verdict: CONFIRMED on current main.
Re-verified fresh this run on origin/main 49797dfd49dae73de5a4236ac0a87e3b643b420e (laptop primary clone, fetched this run):
pkgs/id/src/world_records.rs:207 — read_records loops doc.get_many(Query::all()), skips only entries whose key is not UTF-8 or does not end in \0 (record_key), fetches each blob whole with get_bytes, and inserts serde_json::from_slice(&bytes) — no record-count limit, no key length/control-character check, no value-size check.
- The caps exist and are enforced on the other paths:
pkgs/id/src/world/mod.rs:1933 MAX_RECORDS = 4096, :1935 MAX_RECORD_KEY_BYTES = 256, :1937 MAX_RECORD_VALUE_BYTES = 8192; parse_records enforces them at :1946+ (publish side), and AdminHistoryBudget::add_record (pkgs/id/src/world_net.rs:567) re-checks them on admin-history receipt.
replicate (world_records.rs:251) returns read_records' result, and the mirror command re-reads/prints it at pkgs/id/src/commands/world.rs:193 with no caller-side re-validation — the replica receipt path is exactly as exposed as the issue describes. The probe evidence in the issue body (4100 records, 9000-byte value, 300-byte key, control-character key, all returned Ok) is consistent with this code read.
Routing: follow-on fix enqueued as task 10970 (Fix #6483: enforce MAX_RECORD* caps on replica receipt in world_records::read_records, dedupe_key repo-health:v1:fix:developing-today/code:issue:6483), carrying the issue's acceptance criteria including during-read enforcement, the four refusal test shapes plus a valid-doc control, and defined mirror --follow behaviour on refusal. Issue #6483 stays open for task 10970; its queue/queued label stands for that task.
dezren39 commented on Nov 6, 2026 dezren39 commented on Nov 6, 2026 🤖 Agent note · done
- Agent: queue worker (repo-worker-code), lane code-e
- Session / ID: task 10970
- Found via: queue claim (resume)
- Task: Done — PR id(world_records): enforce MAX_RECORD* caps on receipt in read_records #6495 merged as fc073b5 (issue id(world_records): read_records returns replicated records with none of the record caps re-checked — count, key, and value limits are enforced on publish and on admin-history receipt, but not on replica receipt #6483 closed by the merge). Receipt-side MAX_RECORD* caps now enforced in
world_records::read_records, with the Codex P2 follow-up (delete obsolete keys before additions in RecordsStore::reconcile) included in the merge. Verified fresh this shift: PR MERGEABLE/CLEAN at HEAD 9162ddf, Codex re-review of that commit completed with no findings, and cargo test -p id world_records re-run on the laptop — 13 passed, 0 failed.
- Expectation: none — terminal
- Links: issue id(world_records): read_records returns replicated records with none of the record caps re-checked — count, key, and value limits are enforced on publish and on admin-history receipt, but not on replica receipt #6483 · PR id(world_records): enforce MAX_RECORD* caps on receipt in read_records #6495
dezren39 commented on Nov 6, 2026 🤖 Agent note · already_done (packet number defect)
- Agent: queue worker (repo-worker-code), lane code-e
- Session / ID: task 10953
- Found via: queue claim
- Task: Triage task 10953 names issue fix(pm-stack/aggregator): gate lined-up ref type + guard Today objectives refUrl (#6174) #6481, but its packet title/problem match issue id(world_records): read_records returns replicated records with none of the record caps re-checked — count, key, and value limits are enforced on publish and on admin-history receipt, but not on replica receipt #6483 verbatim. Fresh check: fix(pm-stack/aggregator): gate lined-up ref type + guard Today objectives refUrl (#6174) #6481 is an unrelated merged PR (pm-stack/aggregator, merged 2026-11-06T10:00Z), while issue id(world_records): read_records returns replicated records with none of the record caps re-checked — count, key, and value limits are enforced on publish and on admin-history receipt, but not on replica receipt #6483 with this exact title is CLOSED — fixed by PR id(world_records): enforce MAX_RECORD* caps on receipt in read_records #6495, merged 2026-11-06T10:51:03Z (fc073b5 per prior lane handoff, re-verified fresh this shift). Completing task 10953 as already_done; no new work, no competing PR.
- Expectation: none — terminal
- Links: issue id(world_records): read_records returns replicated records with none of the record caps re-checked — count, key, and value limits are enforced on publish and on admin-history receipt, but not on replica receipt #6483, PR id(world_records): enforce MAX_RECORD* caps on receipt in read_records #6495
dezren39 commented on Nov 11, 2026 🤖 Agent note · done (already_done, re-verified)
- Agent: queue worker (repo-worker-code), lane code-t
- Session / ID: task 10953
- Found via: queue claim (re-claim after earlier handed_off parks)
- Task: Triage task 10953 names issue fix(pm-stack/aggregator): gate lined-up ref type + guard Today objectives refUrl (#6174) #6481, but fix(pm-stack/aggregator): gate lined-up ref type + guard Today objectives refUrl (#6174) #6481 is an unrelated MERGED PR (pm-stack/aggregator, merged 2026-11-06). The packet's actual subject is issue id(world_records): read_records returns replicated records with none of the record caps re-checked — count, key, and value limits are enforced on publish and on admin-history receipt, but not on replica receipt #6483, which is CLOSED — fixed by PR id(world_records): enforce MAX_RECORD* caps on receipt in read_records #6495, merged 2026-11-06T10:51:03Z as fc073b5. Re-verified fresh this shift via gh (issue id(world_records): read_records returns replicated records with none of the record caps re-checked — count, key, and value limits are enforced on publish and on admin-history receipt, but not on replica receipt #6483 state CLOSED, PR id(world_records): enforce MAX_RECORD* caps on receipt in read_records #6495 state MERGED).
- Expectation: none — terminal; completing task 10953 as already_done. No new work, no competing PR.
- Links: issue id(world_records): read_records returns replicated records with none of the record caps re-checked — count, key, and value limits are enforced on publish and on admin-history receipt, but not on replica receipt #6483 · PR id(world_records): enforce MAX_RECORD* caps on receipt in read_records #6495
dezren39 commented on Nov 11, 2026
🤖 Agent note · done (already_done) — with a packet defect recorded
- Agent: repo-worker-code (lane code-d, queue task 14848)
- Packet defect: task 14848 names "issue fix(pm-stack/aggregator): gate lined-up ref type + guard Today objectives refUrl (#6174) #6481", but fix(pm-stack/aggregator): gate lined-up ref type + guard Today objectives refUrl (#6174) #6481 is an unrelated merged PR (aggregator, pm-stack(aggregator): /today render 500s on a lined-up task with a non-GitHub ref — objectives call refUrl unguarded and the section gate never checks linedUp ref #6174). The world_records replica-receipt caps issue is this one — id(world_records): read_records returns replicated records with none of the record caps re-checked — count, key, and value limits are enforced on publish and on admin-history receipt, but not on replica receipt #6483, same title — and the implementing code cites id(world_records): read_records returns replicated records with none of the record caps re-checked — count, key, and value limits are enforced on publish and on admin-history receipt, but not on replica receipt #6483. The packet's dedupe key (
issue:6481) inherits the wrong number.
- Evidence (fresh): issue id(world_records): read_records returns replicated records with none of the record caps re-checked — count, key, and value limits are enforced on publish and on admin-history receipt, but not on replica receipt #6483 CLOSED; PR id(world_records): enforce MAX_RECORD* caps on receipt in read_records #6495 merged. On current main,
pkgs/id/src/world_records.rs read_records re-checks all MAX_RECORD* caps on receipt (count, key bytes + control-character rule, value bytes) with errors naming the offending key, and regression tests cover the over-cap shapes (lines ~644–728). The duplicate-key follow-up id(world_records): read_records collapses duplicate keys inside a replicated value — the #6483 receipt caps measure the collapsed value, so an oversized value hidden behind a duplicate passes, unlike parse_records (#6473) #6634 is also closed.
- Next: none for the work; queue feeders should note the 6481/6483 number collision when deduping this family.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|