Skip to content

id: shell contract test fails on main — join.device_input null disagreement between contract and host #12703

Closed

Description

@dezren39

Problem

On current main, the id-worlds lib test shell_contract::tests::the_contracts_required_fields_are_exactly_what_the_host_requires fails:

assertion `left == right` failed: join.device_input: the contract and the host disagree about null
  left: true
 right: false

at crates/id-worlds/src/shell_contract/tests.rs:316.

Evidence

Reproduced on pristine main twice on 2026-11-22, independent of any in-flight change:

  • In a lane worktree based on fc72fada01c (full cargo test -p id-worlds --lib: 910 passed, this 1 failed).
  • In a clean worktree of origin/main at bff67fda367, running only this test: FAILED with the identical assertion.

So the shell contract (web/src/shell-contract.ts) and the host's join-frame requirements disagree about whether join.device_input may be null — one side changed without the other. The contract test is doing its job; the disagreement itself is the defect to reconcile: decide which side is authoritative for device_input nullability, align the other, and the test goes green without being weakened.

Found during #12648 verification (lane AQ); unrelated to that change — no enqueue from that lane, this filing is the record.

Activity

  1. developing-today commented on Nov 22, 2026

    @developing-today
    Contributor
  2. dezren39 commented on Nov 22, 2026

    @dezren39
    MemberAuthor

    Lane BA claiming #12703. Premise: issue open, no live claim by another worker (only comment is the developing-today[bot] Kaneo link). Reproducing the named test on current main in a laptop worktree first; diagnosis (contract vs host vs test for join.device_input nullability) before any fix.

  3. dezren39 commented on Nov 22, 2026

    @dezren39
    MemberAuthor

    Completion record — fixed by PR #12710, merged 7fc0ab9b58b326b0210b0fcc418a6c267398b89c; this issue auto-closed as completed.

    Which side was wrong: the contract declaration. The host has accepted join.device_input: null since the field existed, and still does; the contract document misstated it.

    Evidence:

    • Host: device_input: Option<serde_json::Value> with #[serde(default)] in crates/id-worlds/src/world_session/types.rs, landed in fix(id): validate forms against presenter input #12281 (a264773, 2026-11-22 14:57Z). Serde maps explicit null to None, identical to absent; all consumers treat the two alike (descriptive session metadata, not an authority grant).
    • Contract: the field was declared hours later in da4617d (19:49Z, fixing a web-unit red) with "nullable": false, copied from the neighboring bool fields — but bools genuinely reject null while Option<_> fields do not. Every other Option-typed field in the contract is declared nullable (resume_token, screen_subscribe region/event_classes, the u64? shorthand on join.after).
    • Fix: one line in pkgs/id/contract/shell-contract.v1.json — device_input now "nullable": true. No wire change (host behavior untouched), no revision bump — da4617d's own declaration fix set the precedent that correcting the document to match the host does not bump revision, and the protocol itself is unchanged.

    Verification:

    • Failing-first on pristine main @ 1402855: the named test FAILED with the filed assertion verbatim (join.device_input: the contract and the host disagree about null, left: true, right: false, tests.rs:316).
    • With the fix (laptop, nix develop inside pkgs/id): cargo test -p id-worlds --lib → 911 passed, 0 failed.
    • Web consumers of the same JSON: bunx vitest run src/world-contract.test.ts src/screen-codec.test.ts src/world-program.test.ts → 33 passed, 0 failed.

    No remainder.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions