GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — id(world_presentation): parse_surface collapses duplicate JSON keys before its checks — a forbidden version, width, lines, or rows hidden behind a duplicate is accepted · Issue #6491 · developing-today/code

id(world_presentation): parse_surface collapses duplicate JSON keys before its checks — a forbidden version, width, lines, or rows hidden behind a duplicate is accepted #6491

New issue
Copy link
New issue
Copy link
Closed
#8424
Closed
id(world_presentation): parse_surface collapses duplicate JSON keys before its checks — a forbidden version, width, lines, or rows hidden behind a duplicate is accepted#6491
#8424
Copy link
Labels
app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/lowNice to have; do when convenientsource/creatorFiled by the new-issue-creator jobsource/design-architectFiled by the repo design architect jobstatus:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Description

@dezren39
dezren39
opened on Nov 6, 2026
Issue body actions

id(world_presentation): parse_surface collapses duplicate JSON keys before its checks — a forbidden version, width, lines, or rows hidden behind a duplicate is accepted

Summary

parse_surface (pkgs/id/crates/id-core/src/world_presentation.rs:419) is the gate that decides whether a world program's view output is a valid text/1 or screen/1 presentation — the module's contract is that guests never supply terminal escapes, control characters, or unsupported versions, and every presenter (web/world_ws.rs:182, world/actor.rs:1473, world_session/mod.rs:2404, the native shell) trusts its verdict.

It parses the guest document into a serde_json::Value first (world_presentation.rs:420), dispatches on value.get("kind"), and only then converts the already-collapsed value into TextPayload / ScreenPayload (:428, :445). Duplicate JSON keys therefore collapse last-wins before any check runs: the version gate (:431, :448), the width validation in TextSurface::with_width, the control-character rejection, and the screen row/shape checks only ever see the surviving value. A document whose raw form carries a forbidden value is accepted as long as a benign duplicate follows it.

This is the same defect class as #6473 (world::parse_records) and #6474 (world_fixture::decode) in sibling guest-facing parsers; parse_surface is the remaining presentation-path instance. The in-tree tests cannot express it: they build documents via serde_json::json! values (world_presentation.rs tests, fn screen(value: Value)), which cannot represent duplicate keys.

Verified (laptop, origin/main 49797df, probe ~/git/fleet/probe-surface-dup, real id crate, 1 test passed)

Controls — each single-key invalid form is rejected:

  • {"kind":"text","version":99,"lines":["hi"]} → Err (unsupported version)
  • {"kind":"text","version":1,"width":0,"lines":["hi"]} → Err (zero width)
  • {"kind":"text","version":1,"lines":["<ESC>[31mred"]} → Err (control character)
  • {"kind":"screen","version":99,"width":2,"height":1,"rows":["hi"]} → Err
  • {"kind":"screen","version":1,"width":2,"height":1,"rows":["toolong"]} → Err

Duplicate-key forms — every one is accepted (Ok(Some(..))):

  • {"kind":"text","version":99,"version":1,"lines":["hi"]} → Text
  • {"kind":"text","version":1,"width":0,"width":80,"lines":["hi"]} → Text
  • {"kind":"text","version":1,"lines":["<ESC>[31mred"],"lines":["clean"]} → Text
  • {"kind":"screen","version":99,"version":1,"width":2,"height":1,"rows":["hi"]} → Screen
  • {"kind":"screen","version":1,"width":2,"height":1,"rows":["toolong"],"rows":["hi"]} → Screen
  • {"kind":"screen","kind":"text","version":1,"lines":["hi"]} → Text (the kind dispatch itself is last-wins)

Why it matters

  • The version field is the format's compatibility gate: a document that declares an unsupported version anywhere in its raw form is not a v1 document, yet it is admitted as one. Any other reader of the same bytes — a stricter parser, a journal replay, a second implementation — sees a different document than the presenter rendered.
  • The hidden values are exactly the ones this module exists to exclude (control characters/escape bytes, zero width, malformed rows). Acceptance depends on key order in a way no other pkgs/id guest parser permits after id(world): parse_records silently collapses duplicate JSON keys — an oversized value hidden behind a duplicate passes MAX_RECORD_VALUE_BYTES, and the record-count cap is checked after collapse #6473/id(world_fixture): decode accepts duplicate JSON fields in header and event lines — check_keys and the window check only ever see the collapsed last value #6474.
  • parse_surface is the single choke point for guest views on the web, SSH/session, and native-shell presenters, so one fix here closes the presentation path.

Acceptance criteria

  • parse_surface rejects any kind: text / kind: screen document containing a duplicate key at any level it inspects (top level at minimum), instead of collapsing last-wins.
  • Regression tests use raw string literals (not serde_json::json!) covering at least: duplicate version (text and screen), duplicate width, duplicate lines carrying a control character, duplicate rows, and duplicate kind.
  • All previously valid documents still parse identically (existing world_presentation, world_session, sandbox, and native-shell tests green).
  • Related: id(world): parse_records silently collapses duplicate JSON keys — an oversized value hidden behind a duplicate passes MAX_RECORD_VALUE_BYTES, and the record-count cap is checked after collapse #6473, id(world_fixture): decode accepts duplicate JSON fields in header and event lines — check_keys and the window check only ever see the collapsed last value #6474 (same class, sibling parsers), id: text/1 presentation contract — text-only as the main mode, with a text projection for every surface (#2027) #2339 (text/1 presentation contract).

Activity

Next
  1. developing-today commented on Nov 6, 2026

    @developing-today
    developing-todayBot
    on Nov 6, 2026 – with developing.today
    Contributor
    More actions

    CODE-1958

  2. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    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)
    queue/queuedHas a queued queue task
    status/needs-triageNot yet triaged; needs a first look
    on Nov 6, 2026
  3. dezren39 commented on Nov 6, 2026

    @dezren39
    dezren39
    on Nov 6, 2026
    MemberAuthor
    More actions

    🤖 Agent note · filed

    • Agent: new-issue-creator (new-issue-creator-code-b)
    • Session / ID: cron job new-issue-creator-code-b, run 2026-11-06T10:00Z
    • Found via: filed this run
    • Task: Filed after verifying on the laptop @49797dfd49 (probe ~/git/fleet/probe-surface-dup, real id crate, 1 passed): parse_surface parses guest view documents into a serde_json::Value before dispatch/checks, so duplicate keys collapse last-wins — version 99, width 0, control-char lines, and malformed rows hidden behind benign duplicates all parse Ok, while every single-key form is rejected. Same class as id(world): parse_records silently collapses duplicate JSON keys — an oversized value hidden behind a duplicate passes MAX_RECORD_VALUE_BYTES, and the record-count cap is checked after collapse #6473/id(world_fixture): decode accepts duplicate JSON fields in header and event lines — check_keys and the window check only ever see the collapsed last value #6474 in sibling parsers.
    • Expectation: effort s — triage routes the duplicate-key rejection (raw-text scan or strict decoder) plus raw-string regression tests.
    • Links: packet packet-6491-triage.json (repo-health-code-pilot)
  4. dezren39 commented on Nov 6, 2026

    @dezren39
    dezren39
    on Nov 6, 2026
    MemberAuthor
    More actions

    🤖 Agent note · handed off

    • Agent: queue worker (repo-worker-code), lane code-e
    • Session / ID: task 10977
    • Found via: queue claim
    • Task: Handed off task 10977 (triage) for issue id(world_presentation): parse_surface collapses duplicate JSON keys before its checks — a forbidden version, width, lines, or rows hidden behind a duplicate is accepted #6491 to the opencode claimant — execution lane assigned opencode. Fresh check: issue id(world_presentation): parse_surface collapses duplicate JSON keys before its checks — a forbidden version, width, lines, or rows hidden behind a duplicate is accepted #6491 OPEN, no hard-stop labels.
    • Expectation: claimant launches the bound opencode session and drives task 10977 to a terminal state
    • Links: issue id(world_presentation): parse_surface collapses duplicate JSON keys before its checks — a forbidden version, width, lines, or rows hidden behind a duplicate is accepted #6491
  5. dezren39 commented on Nov 6, 2026

    @dezren39
    dezren39
    on Nov 6, 2026
    MemberAuthor
    More actions

    🤖 Agent note · picked up

    • Agent: queue worker (repo-worker-code), lane code-r
    • Session / ID: task 10977
    • Found via: queue claim
    • Task: task 10977 (triage for issue id(world_presentation): parse_surface collapses duplicate JSON keys before its checks — a forbidden version, width, lines, or rows hidden behind a duplicate is accepted #6491) claimed by lane code-r; issue id(world_presentation): parse_surface collapses duplicate JSON keys before its checks — a forbidden version, width, lines, or rows hidden behind a duplicate is accepted #6491 verified OPEN with no hard-stop labels; execution-lane assignment returned opencode, so task 10977 is handed off to the opencode claimant per the worker instruction §1b.
    • Expectation: claimant launches the bound opencode session and drives task 10977 to its terminal state
    • Links: issue id(world_presentation): parse_surface collapses duplicate JSON keys before its checks — a forbidden version, width, lines, or rows hidden behind a duplicate is accepted #6491
  6. dezren39
    added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued queue task
    on Nov 6, 2026
  7. 75 remaining items

  8. dezren39
    added 5 commits that reference this issue on Nov 11, 2026

    fix(id-core): reject duplicate JSON keys in parse_surface (#6491)

    2c9f806

    fix(id-core): restrict duplicate-kind rejection to the top-level obje…

    7c54908

    fix(id-core): consume full map in duplicate-kind scan (#6491)

    2a47b4e

    fix(id-core): restore top-level duplicate-kind scan lost in rebase (#…

    aa60487

    Merge pull request #8424 from developing-today/queue/14443-6491-parse…

    0e71307
  9. dezren39
    closed this as completedin #8424on Nov 11, 2026
  10. developing-today
    added
    status:done
    and removed
    status:in-review
    on Nov 11, 2026
  11. dezren39 commented on Nov 11, 2026

    @dezren39
    dezren39
    on Nov 11, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done — fixed and merged (task 10977, lane code-d)

    • Outcome: PR fix(id-core): reject duplicate JSON keys in parse_surface (#6491) #8424 MERGED (merge commit 0e71307) — issue id(world_presentation): parse_surface collapses duplicate JSON keys before its checks — a forbidden version, width, lines, or rows hidden behind a duplicate is accepted #6491 CLOSED. parse_surface rejects duplicate JSON keys in text/screen documents instead of collapsing them last-wins.
    • Resume work this shift: PR fix(id-core): reject duplicate JSON keys in parse_surface (#6491) #8424 had gone CONFLICTING against main (new TokenSpan struct landed at the insertion point). Rebased onto current main (head aa60487); the conflict resolution initially dropped the top_level_kind_is_duplicated(data) call from the parse_surface condition — Codex's re-review caught exactly that as a new P2 (4540059438); restored in aa60487 with the reviewer's example ({"x":1,"x":2,"kind":"screen","kind":"other"}) added to the regression list.
    • Codex gate: all three findings dispositioned — 4533093004 (fixed d1fdabc, reply 4538206911), 4538239737 (fixed 258ef8a; corrected disposition reply 4540036205 — the earlier reply 4539019448 had posted a file path instead of its text), 4540059438 (fixed aa60487, reply 4540102756). No new findings on the final head.
    • Tests: cargo test -p id-core world_presentation on the laptop — 34 passed, 0 failed (rebased head, including main's new semantic-token tests).
  12. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 11, 2026
  13. dezren39 commented on Nov 11, 2026

    @dezren39
    dezren39
    on Nov 11, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done — already done (task 14983, lane code-d)

    • Task 14983 is the small_fix follow-on packet for issue id(world_presentation): parse_surface collapses duplicate JSON keys before its checks — a forbidden version, width, lines, or rows hidden behind a duplicate is accepted #6491, duplicating triage task 10977, which this same shift resumed and finished: PR fix(id-core): reject duplicate JSON keys in parse_surface (#6491) #8424 MERGED at 2026-11-11T15:59:18Z (merge commit 0e71307), issue id(world_presentation): parse_surface collapses duplicate JSON keys before its checks — a forbidden version, width, lines, or rows hidden behind a duplicate is accepted #6491 CLOSED (verified fresh just now; PR state MERGED re-read in the same pass).
    • No second fix and no competing PR: the acceptance criteria are met by the merged PR — parse_surface rejects duplicate keys in text/screen documents, with raw-string regression tests including the duplicate-kind shapes.
    • Completing task 14983 as already_done naming task 10977 / PR fix(id-core): reject duplicate JSON keys in parse_surface (#6491) #8424 as the canonical work.
  14. dezren39
    added 2 commits that reference this issue on Nov 22, 2026

    feat(id-core): scene/1 WorldSurface kind — validation, projection, co…

    284cee0

    feat(id): audio/1 WorldSurface kind — host validation, text projectio…

    28f7d57
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)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/lowNice to have; do when convenientsource/creatorFiled by the new-issue-creator jobsource/design-architectFiled by the repo design architect 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

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.