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 — Design: a duplicate key is a parse error — one duplicate-key refusal contract for pkgs/id's checked JSON gates · Issue #6520 · developing-today/code

Design: a duplicate key is a parse error — one duplicate-key refusal contract for pkgs/id's checked JSON gates #6520

New issue
Copy link
New issue
Copy link
Closed
6 / 66 of 6 issues completed
Closed
Design: a duplicate key is a parse error — one duplicate-key refusal contract for pkgs/id's checked JSON gates#6520
6 / 66 of 6 issues completed
Copy link
Assignees
dezren39
Labels
app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/mMedium: expected under 1 day of workepicMeta-issue grouping multiple items (org Project Type=Epic)epic/id-programReprioritization program epic (2026-11-12)kind/designA design proposal (design-architect): multi-step, phased, decision-bearingmeta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/highImportant and time-sensitivesource/design-architectFiled by the repo design architect jobstatus/triagedTriaged and routed (see agent note)status:done
Milestone
ID platform program

Description

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

A duplicate key is a parse error — one duplicate-key refusal contract for pkgs/id's checked JSON gates

Design-architect pass 61 (2026-11-06), audit at origin/main 6046e1d7b.
Full design doc: files/designs/code-duplicate-json-keys.md in the
keep-the-four-repos-healthy goal workspace.

Problem

pkgs/id's checked JSON gates parse first and validate second, and
every parse they use — serde_json::Value, BTreeMap, map-shaped
derived decodes — collapses duplicate object keys last-wins. The
checks therefore run on a collapsed document that is not the document
as written: a forbidden value placed first, hidden behind a benign
duplicate, passes the version gate, the size cap, the count cap, the
control-character refusal and the canonical-form check.

Six filings in three days are one defect: #6473 (parse_records —
oversized value and the MAX_RECORDS count both checked post-collapse),
#6474 (world_fixture::decode — check_keys/check_window see only
the surviving world/fixture/sequence; the header records
object collapses twice), #6491 (parse_surface — even the kind
dispatch is last-wins), #6499 (parse_wants — version, subscription
cap, entry id/cap all read from the collapsed map), #6501 (session
frames — landed via PR #6508), #6504 (Registry::load —
validate_persisted checks the collapsed registry). Decode shapes
even disagree in-tree: #6504's struct decode collapsed a duplicate
world that #6501's sibling derived paths refused. Outside the crate
the stance is already refusal: #6384 (deploy.py) and #6390 (atlas-eval),
both closed.

The contract

A duplicate key is a parse error. A checked JSON gate in pkgs/id
never validates, counts, stores or forwards a collapsed document.

  1. Refusal, naming the key — in the gate's own error vocabulary,
    with the surface's context (fixture line, publications file).
  2. Every depth — not only levels with checked fields: what a gate
    forwards/stores/compares onward is the collapsed Value, so a
    deeper duplicate is the same ambiguity one step later; and no
    serializer can emit a duplicate key, so no legitimate producer is
    affected. This pin supersedes id(world_caps): parse_wants collapses duplicate JSON keys before its checks — a forbidden version, cap, id, or list size hidden behind a duplicate is accepted #6499's checked-positions-only
    scoping for args interiors (its required refusals are subsumed).
  3. One mechanism — promote fix(id): refuse duplicate JSON keys in world_session first/joined frames (#6501) #6508's landed
    parse_json_without_duplicate_keys (world_session/mod.rs:880:
    every-depth refusal, duplicate JSON object key "k") into one
    shared home in id-core and route every phase through it;
    struct-first gates parse through it and convert. Serde's derived
    duplicate-field behaviour is never the defence (fields-only,
    inconsistent, absent on Value/BTreeMap paths).
  4. Checks see the written document — no check's own logic changes;
    duplicate-free documents parse identically.

Phases (adopt the origins — no parallels)

  • Phase 1 — records and fixtures: 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.
  • Phase 2 — guest documents in id-core: 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 + id(world_caps): parse_wants collapses duplicate JSON keys before its checks — a forbidden version, cap, id, or list size hidden behind a duplicate is accepted #6499
    (independent of Phase 1; the helper promotion lands with whichever
    of Phases 1–2 goes first).
  • Phase 3 — the persisted registry: id(publications): Registry::load collapses duplicate JSON keys before validate_persisted — an empty world, non-canonical path, or duplicate placement hidden behind a duplicate key is silently restored at boot #6504 (independent).
  • Phase 4 — closing inventory + contract statement (new issue,
    gated on Phases 1–3): every serde_json parse site in pkgs/id +
    crates/ dispositioned gate/not-a-gate with reasons; required
    dispositions for signed-object JSON, self-produced files, and
    non-JSON decoders (see the design doc's open questions).

#6501 is cited as the landed embodiment, not a phase. Open questions
stay in the design doc.

🤖 Filed by the repo design architect (fleet) — origins verified with
laptop probes by their filers; audit and pins are this pass's, against
origin/main 6046e1d7b.

Acceptance criteria

  • One duplicate-key refusal contract is specified for every checked JSON gate in pkgs/id: duplicates are refused at parse time, before any validation runs — no gate ever validates a collapsed (last-wins) document.
  • Every parse site named in the audit (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, 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, id(world_caps): parse_wants collapses duplicate JSON keys before its checks — a forbidden version, cap, id, or list size hidden behind a duplicate is accepted #6499, id(publications): Registry::load collapses duplicate JSON keys before validate_persisted — an empty world, non-canonical path, or duplicate placement hidden behind a duplicate key is silently restored at boot #6504, and the already-landed id(world_session): first-frame and joined-frame parsers collapse duplicate JSON keys before their checks — a hidden first type/world/capability value is never seen, and the sibling session paths reject the same bytes #6501 shape) is inventoried and dispositioned under the contract, with the implementation phases attached to this epic as native sub-issues (the Phase 4 of #6520 — closing JSON-parse inventory: disposition every serde_json parse site in pkgs/id against the duplicate-key refusal contract #6521 pattern).
  • The contract names its oracle: for each gate, a duplicate-key input carrying a forbidden first value is refused, with regression coverage at the parse seam.

Sub-issues

Collapse Sub-issuesSub-issues

6 of 66 of 6 Issues completed
Loading 6 sub-issues

Activity

Next
  1. dezren39
    added
    status/needs-triageNot yet triaged; needs a first look
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    epicMeta-issue grouping multiple items (org Project Type=Epic)
    kind/designA design proposal (design-architect): multi-step, phased, decision-bearing
    on Nov 6, 2026
  2. developing-today commented on Nov 6, 2026

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

    CODE-1976

  3. dezren39
    added
    source/design-architectFiled by the repo design architect job
    on Nov 6, 2026
  4. dezren39
    added sub-issues on Nov 6, 2026
    • 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
    • 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
    • id(world_caps): parse_wants collapses duplicate JSON keys before its checks — a forbidden version, cap, id, or list size hidden behind a duplicate is accepted #6499
    • id(publications): Registry::load collapses duplicate JSON keys before validate_persisted — an empty world, non-canonical path, or duplicate placement hidden behind a duplicate key is silently restored at boot #6504
    • Phase 4 of #6520 — closing JSON-parse inventory: disposition every serde_json parse site in pkgs/id against the duplicate-key refusal contract #6521
  5. dezren39 commented on Nov 6, 2026

    @dezren39
    dezren39
    on Nov 6, 2026
    MemberAuthor
    More actions

    🤖 Agent note · design-architect pass 61 — design filed

    • Agent: repo design architect (dedicated code job, pass 61)
    • Task: Originate one design for developing-today/code from the duplicate-JSON-key collapse family, on pass 60's recorded trigger (a third collapse surface files — four more filed: 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, id(world_caps): parse_wants collapses duplicate JSON keys before its checks — a forbidden version, cap, id, or list size hidden behind a duplicate is accepted #6499, id(world_session): first-frame and joined-frame parsers collapse duplicate JSON keys before their checks — a hidden first type/world/capability value is never seen, and the sibling session paths reject the same bytes #6501, id(publications): Registry::load collapses duplicate JSON keys before validate_persisted — an empty world, non-canonical path, or duplicate placement hidden behind a duplicate key is silently restored at boot #6504)
    • Design: this issue. Full doc: files/designs/code-duplicate-json-keys.md in the keep-the-four-repos-healthy goal workspace; register entry added in files/potential-projects.md (status: proposed)
    • Contract: a duplicate key is a parse error — refusal naming the repeated key, at every depth, through one shared mechanism (the parse_json_without_duplicate_keys helper landed by PR fix(id): refuse duplicate JSON keys in world_session first/joined frames (#6501) #6508 for id(world_session): first-frame and joined-frame parsers collapse duplicate JSON keys before their checks — a hidden first type/world/capability value is never seen, and the sibling session paths reject the same bytes #6501, promoted to id-core); checks see the document as written
    • Phases (sub-issues, verified in this issue's sub-issue list, count=6): Phase 1 = 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, Phase 2 = 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 + id(world_caps): parse_wants collapses duplicate JSON keys before its checks — a forbidden version, cap, id, or list size hidden behind a duplicate is accepted #6499, Phase 3 = id(publications): Registry::load collapses duplicate JSON keys before validate_persisted — an empty world, non-canonical path, or duplicate placement hidden behind a duplicate key is silently restored at boot #6504, Phase 4 = Phase 4 of #6520 — closing JSON-parse inventory: disposition every serde_json parse site in pkgs/id against the duplicate-key refusal contract #6521 (new closing inventory, gated on Phases 1–3, triage packet → pilot task 11167 queued)
    • Embodiment, not a phase: id(world_session): first-frame and joined-frame parsers collapse duplicate JSON keys before their checks — a hidden first type/world/capability value is never seen, and the sibling session paths reject the same bytes #6501, landed 2026-11-06 via PR fix(id): refuse duplicate JSON keys in world_session first/joined frames (#6501) #6508 (merge 6046e1d7b)
    • Audit base: origin/main 6046e1d7b; all five open origins re-verified OPEN with their defects present at the cited sites this pass
  6. dezren39
    added
    priority/highImportant and time-sensitive
    effort/mMedium: expected under 1 day of work
    on Nov 6, 2026
  7. 32 remaining items

  8. dezren39 commented on Nov 11, 2026

    @dezren39
    dezren39
    on Nov 11, 2026
    MemberAuthor
    More actions

    Triage verdict — real, partially implemented; keep epic open

    Checked fetched origin/main 10d1088 (2026-11-11 UTC). The shared every-depth helper is pkgs/id/crates/id-core/src/json_unique.rs:13; parse_records (pkgs/id/src/world/mod.rs:1982), fixture header/event (pkgs/id/src/world_fixture.rs:573,621), and parse_wants (pkgs/id/crates/id-core/src/world_caps.rs:838) use it. #6473, #6474 and #6499 are closed; fixes include #6561, #7702 and #7623/#7627. #6523 was fixed by #6996.

    Remaining phase 2: #6491 is open, with no linked PR; pkgs/id/crates/id-core/src/world_presentation.rs:435 still parses directly into Value using serde_json::from_str, allowing duplicate collapse before kind dispatch/checks. Fix under #6491: use the shared duplicate-refusing mechanism with explicit duplicate errors, including ambiguous kind and nested values, while preserving legacy non-JSON/non-screen fallback; test forbidden-first duplicates and duplicate-free controls. Simply treating duplicate errors like other parse errors and returning Ok(None) would not satisfy refusal.

    Phase 3 correction: #6504 is closed with regression tests in #6557. Its earlier assertion that known struct fields collapse was corrected: serde derived deserialization rejects those duplicates. However pkgs/id/src/publications.rs:372 still directly decodes the struct rather than the shared every-depth helper; the epic’s stronger requirement for unknown/nested duplicate keys and one mechanism is not established by closing #6504. Include this precise distinction in the #6521 inventory and disposition/follow-up; do not claim the original known-field exploit remains.

    Closing phase: #6521 remains open and explicitly gated on #6491. It must inventory all production JSON parse sites and document signed objects, self-produced files, non-JSON boundary and fixture double-collapse, with follow-ups for uncovered gates. Existing phase issues should carry the work, not a duplicate filing. No tests were run for this read-only triage; conclusions derive from source and linked issue/PR history.

    agent-note:v1 · triage · task 11205 · disposition: real-and-current, epic remains open pending #6491 and #6521.

  9. dezren39 commented on Nov 11, 2026

    @dezren39
    dezren39
    on Nov 11, 2026
    MemberAuthor
    More actions

    Lane code-b, task 14815 completed as triaged, naming the triage of record: task 11205's verdict on this issue (checked at main 10d1088, 2026-11-11). Spot-verified fresh this shift: #6491 and #6521 both still OPEN, and pkgs/id/crates/id-core/src/world_presentation.rs (~:435) still parses directly into Value via serde_json::from_str — the phase-2 gap the verdict names is still live. Per that verdict the phase issues (#6491, then #6521 gated on it) carry the remaining work; no duplicate follow-on packet is filed from this task.

    • Links: task 14815, task 11205, issue Design: a duplicate key is a parse error — one duplicate-key refusal contract for pkgs/id's checked JSON gates #6520, 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, issue Phase 4 of #6520 — closing JSON-parse inventory: disposition every serde_json parse site in pkgs/id against the duplicate-key refusal contract #6521
  10. dezren39
    added
    status/triagedTriaged and routed (see agent note)
    epic/id-programReprioritization program epic (2026-11-12)
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    work/assignedQueue worker lifecycle state
    on Nov 11, 2026
  11. dezren39
    added this to the ID platform program milestone on Nov 12, 2026
  12. github-actions
    assigned
    dezren39
    on Nov 12, 2026
  13. dezren39 commented on Nov 17, 2026

    @dezren39
    dezren39
    on Nov 17, 2026
    MemberAuthor
    More actions

    agent-note:v1
    Agent: repo-worker-code / any-f
    state: done (triaged — all phases landed, closing the epic) (task 18492, lane any-f)
    issue: #6520

    Verdict: the contract is fully implemented — every phase and sub-issue is closed; closing the epic as completed

    Bulk-intake re-triage (2026-11-16 reload), verified fresh 2026-11-17 against the acceptance criteria:

    • Every parse site named in the audit is dispositioned and closed: 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 (parse_records), 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 (world_fixture::decode), 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 (parse_surface), id(world_caps): parse_wants collapses duplicate JSON keys before its checks — a forbidden version, cap, id, or list size hidden behind a duplicate is accepted #6499 (parse_wants), id(publications): Registry::load collapses duplicate JSON keys before validate_persisted — an empty world, non-canonical path, or duplicate placement hidden behind a duplicate key is silently restored at boot #6504 (Registry::load) — all CLOSED, and id(world_session): first-frame and joined-frame parsers collapse duplicate JSON keys before their checks — a hidden first type/world/capability value is never seen, and the sibling session paths reject the same bytes #6501, the landed embodiment the contract was promoted from, is CLOSED.
    • Phase 4 (closing inventory + contract statement) exists as Phase 4 of #6520 — closing JSON-parse inventory: disposition every serde_json parse site in pkgs/id against the duplicate-key refusal contract #6521 and is CLOSED with status:done.
    • All six are attached to this epic as native sub-issues (verified in the sub-issue list), satisfying the inventory criterion in the Phase 4 of #6520 — closing JSON-parse inventory: disposition every serde_json parse site in pkgs/id against the duplicate-key refusal contract #6521 pattern the issue itself specified.
    • The 2026-11-11 triage verdict ("real, partially implemented; keep epic open") is superseded: at that check the phases were still landing; they have all since closed.

    Nothing remains open under this epic, and unlike a design-record issue, this epic's own acceptance is completable and complete. The design doc remains at files/designs/code-duplicate-json-keys.md in the goal workspace. The stale task/triage label comes off with this close.

  14. dezren39
    removed
    task/triageQueue packet kind: verify, reproduce, and route this item
    on Nov 17, 2026
  15. dezren39
    closed this as completedon Nov 17, 2026
  16. developing-today
    added
    status:done
    on Nov 17, 2026
  17. 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

  • @dezren39
    dezren39

Labels

app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/mMedium: expected under 1 day of workepicMeta-issue grouping multiple items (org Project Type=Epic)epic/id-programReprioritization program epic (2026-11-12)kind/designA design proposal (design-architect): multi-step, phased, decision-bearingmeta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/highImportant and time-sensitivesource/design-architectFiled by the repo design architect jobstatus/triagedTriaged and routed (see agent note)status:done

Type

No type

Projects

No projects

    Milestone

    • ID platform programNo due date

    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.