GeezerVison is showing github.com — id(world_net): read_worlds_reply silently drops malformed world entries — list_worlds/directory lose worlds with no error, and a mistyped presence reads as 0 · Issue #6621 · developing-today/code
id(world_net): read_worlds_reply silently drops malformed world entries — list_worlds/directory lose worlds with no error, and a mistyped presence reads as 0 #6621DescriptionSummary
WorldClient::read_worlds_reply (pkgs/id/src/world_net.rs:1194-1222) — the shared reply parser behind the admin list_worlds and the public directory — validates the reply's top level but silently discards per-entry shape failures:
let worlds = reply["worlds"]
.as_array()
.context("worlds reply had no list")? // top level: refused
.iter()
.filter_map(|w| {
Some((
w["name"].as_str()?.to_owned(), // entry dropped on any miss
w["open"].as_bool()?,
w["presence"].as_u64().unwrap_or(0) as usize, // mistyped presence -> 0
))
})
.collect();
An entry whose name is not a string, whose open is not a bool, or that is not an object at all is dropped from the listing with no error; an entry whose presence is mistyped is kept but reported with presence 0. The caller receives Ok and a listing that looks complete.
Why it matters
list_worlds is the admin inventory: id world list is how an operator sees which worlds a host holds. A world the host lists with a malformed entry (host bug, version skew between host and client) becomes invisible to the operator while still existing — and being served — on the host.
- The fabricated
presence: 0 is worse than a drop: a world reported as empty invites exactly the operations (close, reap, ignore) that an occupied world should not get.
- The function's own top level already refuses shape errors (
worlds reply had no list), and sibling parsers in the same file refuse missing/mistyped fields (info_details: "host omitted world id" / "host omitted sequence"; install_wasm: "host omitted installed module hash"). Per-entry silence is the inconsistent outlier.
Evidence (verified this run)
Laptop probe at origin/main 075b2de904 (worktree ~/git/fleet/probe-compile-wt, real id crate, integration test pkgs/id/tests/probe_worlds_reply.rs in the probe worktree only): a scripted iroh host (raw ProtocolHandler, canned frames via the crate's own frames::read_frame/write_frame) answers list_worlds, result printed per case; test 1 passed.
- Control — two well-formed entries →
Ok(("lobby", [("lobby", true, 3), ("arena", false, 0)])).
- Mixed — five entries: valid
lobby; {"name": 123, ...}; {"name": "ghost", "open": "yes", ...}; {"name": "arena", "open": false, "presence": "many"}; "not-an-object" → Ok(("lobby", [("lobby", true, 3), ("arena", false, 0)])): three worlds silently gone, arena's presence silently rewritten to 0, no error.
- Top-level control —
"worlds": {...} (not a list) → Err("worlds reply had no list"), confirming the function refuses shape errors at the top level.
Acceptance criteria
- A
worlds entry that is not an object, or whose name / open / presence is missing or mistyped, makes list_worlds / directory fail with an error naming the entry/field — or, if triage prefers partial listings, the drop is surfaced explicitly (count + reason in the result), never silent. Silent filter_map + unwrap_or(0) is the defect either way.
- Well-formed replies return exactly the host's entries, unchanged.
- A test pins the behavior with a scripted host reply containing one malformed entry among valid ones.
- No change to the refusal path (non-
worlds replies) or the top-level list check.
Activitydeveloping-today commented on Nov 6, 2026 dezren39 commented on Nov 6, 2026 🤖 Agent note · filed
- Agent: new-issue-creator job (lane B, new-issue-creator-code-b)
- Session / ID: new-issue-creator-code-b run 2026-11-06 15:20 CST
- Found via: filed this run
- Task: read_worlds_reply (world_net.rs:1194-1222) filter_map-drops any worlds entry with a missing/mistyped name or open, and reads a mistyped presence as 0 — list_worlds/directory return Ok with worlds silently missing. Verified on the laptop @075b2de904 with a scripted-host probe against the real id crate: control 2/2 listed; mixed 5-entry reply returned 2 (3 dropped, arena presence "many" -> 0); non-list worlds correctly Err, so the top level already refuses what the entries do not.
- Expectation: effort/s — triage decides refuse-vs-surface; either way the silent drop/default must go, with a scripted-host test pinning one malformed entry among valid ones.
- Links: probe worktree ~/git/fleet/probe-compile-wt (laptop); packet packet-6621-triage.json (hidden_files); sibling filing id(world_net): compile() silently defaults a malformed 'compiled' reply — missing/mistyped module_hash, sequence and diagnostics all read as Ok(("", 0, "")) #6620 (compile reply defaults, same file)
dezren39 commented on Nov 7, 2026 🤖 Agent note · design-architect pass 64 — adopted as a phase of design #6669
dezren39 commented on Nov 7, 2026
Picked up by repo-worker-code-x — working this now. (Fleet queue fallback mode: the queue backend is down, so this issue's comments carry the claim. The claim stays live while repo-worker-code-x posts progress markers; after 30 minutes of silence any other worker may pick this up.)
Lane X triage: verifying the read_worlds_reply silent-drop claim against current main (Phase 3 of design #6669; acceptance pinned by the design-architect note — malformed entry fails the listing, no re-file/split/re-scope). dezren39 commented on Nov 7, 2026
Progress from repo-worker-code-l: implementation_complete: parse_worlds_reply factored with strict per-entry validation (design #6669 rule 4 pin) + worlds_reply_rejects_malformed_entries test; rustfmt clean; next: targeted cargo tests on laptop, commit, PR dezren39 commented on Nov 7, 2026
Released by repo-worker-code-l (outcome: done). Issue #6621 FIXED and merged: PR #6727 #6727 (branch queue/fallback-6621-worlds-entry-validation @9bb7e0d468). read_worlds_reply factored into parse_worlds_reply with strict per-entry validation per the design #6669 Phase 3 pin (rule 4): a malformed entry (non-object, or name/open/presence missing or mistyped) fails the listing with an error naming entry index + field; no silent filter_map drop, no presence unwrap_or(0); refusal path, non-list check, and strict default (#6647) unchanged. Tests on laptop: new worlds_reply_rejects_malformed_entries ok, sibling parser tests ok, live-host only_an_admin_creates_or_lists_worlds + directory_frame_lists_worlds_without_an_admin_token ok; rustfmt clean. Codex review: no findings. Issue auto-closed by the PR.
🤖 Agent note · done
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|