Skip to content

id(world_net): info_details reads a mistyped 'active_module_hash' as Ok(None) — a malformed module_info reply reports "no module" for a world that has one #6633

Closed

Description

@dezren39

Problem

WorldClient::info_details in pkgs/id/src/world_net.rs (reply handling at :1473 on main 075b2de904) reads the module_info reply's active module hash with a bare optional coercion:

let active_module_hash = reply["active_module_hash"].as_str().map(str::to_owned);

as_str() returns None for every non-string value, so a present-but-mistyped active_module_hash (number, bool, array, object) is silently read as None — the exact value that legitimately means "this world has no installed module". The host's ServerFrame::ModuleInfo (pkgs/id/src/world_session/types.rs:330-336) always serializes this field as either a string or null, so a non-string, non-null value can only be corruption, a version-skewed host, or a hostile/buggy peer — and the client should say so instead of inventing "no module".

The same reply is otherwise strict, which is the in-function oracle:

  • world_id missing/mistyped → error ("host omitted world id", :1469-1472)
  • current_sequence missing/mistyped → error ("host omitted sequence", :1474-1476)
  • a non-null active_module_provenance that fails to decode → error ("host sent invalid module provenance", :1477-1482)

Only the hash field collapses malformed → absent.

Why it matters

Consumers trust None as a factual statement about the world:

  • id world download (pkgs/id/src/commands/world.rs:214-216) turns the coerced None into the operator-facing claim "world has no installed module to download" — wrong diagnosis for a world that does have a module, sending debugging in the wrong direction.
  • capture_world_state (pkgs/id/src/commands/world.rs:1148) bakes module_hash: info.active_module_hash into the captured WorldState manifest — a mistyped reply is recorded as a manifest with no module, the same class of fabricated capture state as the manifest seed issue (id(world_net): manifest_state silently drops a mistyped seed — a present-but-malformed seed reads as the capability-only None and is captured as seed 0 #6626, different field/function).
  • id world info JSON output (commands/world.rs:665) prints "active_module_hash": null, indistinguishable from a genuinely module-less world.

Evidence (verified this run)

Probe on the laptop against main 075b2de904, real id crate with a scripted iroh host (~/git/fleet/probe-compile-wt/pkgs/id/tests/probe_info_reply.rs, test probe_info_reply_shapes):

  • control, string hash "abc123" → Ok(Some("abc123"))
  • control, null hash → Ok(None) (the legitimate no-module case)
  • mistyped hash 123 / true / ["abc"] / {"h":"abc"} → all Ok(None) — silently conflated with no-module
  • oracle in the same reply: mistyped non-null active_module_provenance: 123 → Err("host sent invalid module provenance")

Dedup: gh search issues for active_module_hash / info_details / module_info in this repo returns no issue covering info_details reply validation. Neighbours are distinct functions/fields: #6620 (compile() reply defaults), #6621 (read_worlds_reply entries), #6624 (caps() report), #6625 (policy_request reply), #6626 (manifest_state seed), #6632 (create_world flag).

Acceptance criteria

  • info_details errors when active_module_hash is present and neither a string nor null, with an error naming the malformed field.
  • A string hash still returns Some(hash); null (and a genuinely absent field, for older hosts) still returns None.
  • Regression tests with a scripted host (or equivalent) covering: string, null, absent, and at least number/object mistyped shapes.
  • No host-side change; ServerFrame::ModuleInfo serialization is unchanged.

Activity

  1. developing-today commented on Nov 6, 2026

    @developing-today
    Contributor
  2. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    source/creatorFiled by the new-issue-creator job
    priority/normalOrdinary priority (the default)
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    on Nov 6, 2026
  3. dezren39 commented on Nov 6, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · filed

    • Agent: new-issue-creator-code-b (Lane B)
    • Session / ID: cron new-issue-creator-code-b, run 2026-11-06T22:20Z
    • Found via: filed this run
    • Task: info_details in pkgs/id/src/world_net.rs coerces a present-but-mistyped active_module_hash to None (the legitimate no-module value); verified with a scripted-host probe against the real id crate on the laptop @075b2de904 — string control Some, null control None, number/bool/array/object mistypes all Ok(None), mistyped provenance in the same reply Err (the strict oracle).
    • Expectation: effort/s — presence-then-type check in one function plus scripted-host regression tests; done when mistyped hashes error and string/null/absent behavior is unchanged.
    • Links: probe ~/git/fleet/probe-compile-wt/pkgs/id/tests/probe_info_reply.rs (laptop)
  4. dezren39 commented on Nov 7, 2026

    @dezren39
    MemberAuthor

    Picked up by repo-worker-code-a — 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-a posts progress markers; after 30 minutes of silence any other worker may pick this up.)

  5. added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    and removed on Nov 7, 2026
  6. 1 remaining item

  7. dezren39 commented on Nov 7, 2026

    @dezren39
    MemberAuthor

    Progress from repo-worker-code-a: verified + reproduced-by-inspection: production fix for #6633 already landed on main via repo-keeper snapshot 4ecb351 (world_net.rs parse match at :1481, verified fresh at origin/main 207e612), but its regression test does not compile (inject_json nonexistent, json! unimported — tracked also as #6640/#6643). Working it in laptop worktree ~/git/fleet/fb-6633 on branch queue/6633-info-details-active-module-hash: factor reply parsing into a testable helper, rewrite the test against it, no production behavior change.

  8. dezren39 commented on Nov 7, 2026

    @dezren39
    MemberAuthor

    Progress from repo-worker-code-a: implementation_complete: factored parse_module_info_reply out of info_details (no behavior change) and rewrote info_details_rejects_malformed_active_module_hash against it (string/null/missing controls + number/bool/array/object errors) in laptop worktree ~/git/fleet/fb-6633, branch queue/6633-info-details-active-module-hash. Targeted cargo test running on the laptop now. Note: first patch attempt via the laptop-agent daemon path appeared to apply but did not persist on the real filesystem (verified via LAPTOP_SSH_REAL=1); re-applied and verified via real SSH.

  9. added and removed on Nov 7, 2026
  10. dezren39 commented on Nov 7, 2026

    @dezren39
    MemberAuthor

    Progress from repo-worker-code-a: pr_opened stage: branch queue/6633-info-details-active-module-hash pushed at ff406ef; targeted test passes on laptop and full id lib-test target compiles again (cargo test --lib --no-run exit 0). Opening the PR now.

  11. dezren39 commented on Nov 7, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · design-architect pass 64 — cited as the embodiment in design #6669

  12. dezren39 commented on Nov 7, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

  13. dezren39 commented on Nov 7, 2026

    @dezren39
    MemberAuthor

    Released by repo-worker-code-a (outcome: done). Done: production fix for #6633 was already on main (repo-keeper snapshot 4ecb351); this shift repaired its non-compiling regression test by factoring WorldClient::parse_module_info_reply (no behavior change) and rewriting the test against it — PR #6675 merged (779336f), closing #6633, #6640 and #6643. Laptop verification: targeted test passes, full id lib-test target compiles; Codex zero findings; PR CI stayed QUEUED (runner backlog).

  14. dezren39 commented on Nov 7, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · closure evidence (from #6670 Phase 4, disposition (b))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/idPackage/app: id (pkgs/ or apps/ in this repo)kind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobstatus:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions