Skip to content

id(web): world-contract tests red on main — #805 view_revision contract field never reached the TS test fixtures #4103

Closed

Description

@dezren39

Problem

pkgs/id/web's test suite is red on main: all 3 failures in src/world-contract.test.ts come from the shell contract's server view frame gaining a required view_revision field that the TypeScript test fixtures never adopted.

  • pkgs/id/contract/shell-contract.v1.json (revision 4) — server frame view declares "view_revision": "u64" (required; base_view_revision is the optional one). The field arrived in d488f32 ("revisioned JSON ScreenPatch view frames — id: F12.11 delta and binary frames (screen patches, resume tokens) #805 Phase 1"), which updated the Rust host (pkgs/id/src/world_session/mod.rs:2154-2204 sends it on every view frame) and the Rust contract tests (pkgs/id/src/shell_contract/tests.rs:146 sends view_revision: 0) — but not the web tests.
  • pkgs/id/web/src/world-contract.test.ts — the view frames at :33 and :70 and the recorded-flow frames behind :330 carry no view_revision, so the TS checker (correctly, per the contract) rejects them:
    • shell contract validator > accepts the frames a joined shell sends — checkServerFrame({type: "view", sequence: 1, data: …}) returns not-ok.
    • shell contract validator > accepts u64 values at and above 2^53, like the Rust checker (#1441) — the view frame with sequence: 2**53… returns not-ok (the u64 case is collateral of the same missing field, not a u64 regression).
    • web shell conformance > sends only contract frames, in the right phases, across every flow — violation socket 0 frame 4 (server): viewneeds fieldview_revision``.
  • Related surface to check while fixing: pkgs/id/web/src/world.ts:31-32 types view_revision?: number as optional on the client side, while the contract makes it required on every host view frame — triage should decide whether the client type should match the contract or the optionality is deliberate (older hosts).

Verified this run (2026-11-01)

Why it matters

A permanently red suite trains everyone to ignore it — the next real conformance regression in the TS shell-contract checker (the browser-side twin of src/shell_contract.rs) will land unnoticed, the same failure mode as the aggregator's red-main baseline (#4023). The drift pattern is also the recurring one for this contract: a revision lands on the Rust side and the TS port's fixtures lag one revision behind.

Acceptance criteria

  • bun run test in pkgs/id/web passes for src/world-contract.test.ts (the 3 tests above) on main, with the fixtures sending contract-valid view frames (including view_revision).
  • The fix does not weaken the contract: view_revision stays required in shell-contract.v1.json unless triage determines the field itself was mis-declared — in which case the JSON, the Rust tests, and the host are changed together instead.
  • Triage records a decision on world.ts:31 (view_revision?: number optional vs the contract's required).
  • No other test in the web suite regresses (the id(web): search-panel test expects aria-label 'Replace all' but implementation renders 'Replace all matches' — full web suite red on main #3243 search-panel failure is pre-existing and out of scope).

Activity

  1. added
    kind/testTest coverage, test infrastructure, or test-only fixes
    task/triageQueue packet kind: verify, reproduce, and route this item
    source/creatorFiled by the new-issue-creator job
    priority/normalOrdinary priority (the default)
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    effort/sSmall: expected under 2 hours of work
    on Nov 2, 2026
  2. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · state: filed

  3. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  4. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed on Nov 2, 2026
  5. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    Triage verdict — ALREADY FIXED on current main (queue task 5993)

    Re-checked fresh this shift instead of trusting the packet (the packet predates a relevant commit):

    🤖 Agent note · done

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

Metadata

Metadata

Assignees

Labels

app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/testTest coverage, test infrastructure, or test-only fixespriority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobtask/triageQueue packet kind: verify, reproduce, and route this item

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions