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_fixture): decode accepts duplicate JSON fields in header and event lines — check_keys and the window check only ever see the collapsed last value · Issue #6474 · developing-today/code

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

New issue
Copy link
New issue
Copy link
Closed
#7702
Closed
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
#7702
Copy link
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 jobsource/design-architectFiled by the repo design architect jobstatus:donetask/triageQueue packet kind: verify, reproduce, and route this item

Description

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

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

Summary

world_fixture::decode (pkgs/id/src/world_fixture.rs:558) is documented as "Parse a fixture, refusing anything it cannot replay faithfully", and its field discipline is strict on purpose: check_keys (:1284) requires exactly the expected fields per line — no unknown ones, none missing — and check_window (:1350) requires sequenced events to be contiguous and within the header's sequence. But both the header (decode_header, :1106) and every event line (decode_event, :1195) are first parsed with serde_json::from_str::<Value> (:1108, :1199), and serde_json's Value object is last-wins for duplicate keys. By the time check_keys runs, a duplicated field has already collapsed to one — so a line that names the same field twice with different values is accepted, and the value that survives is whichever came last:

# Line shape Result today What should happen
1 header with "world":"first","world":"second" Ok, world_id = "second" an ambiguous header is refused — the fixture names two worlds
2 header with "fixture":99,"fixture":1 Ok (version check sees 1) the version gate (:1124) must see the duplication, not just the surviving value: as written, an unsupported version is hidden in plain sight
3 chat event with "sequence":99,"sequence":1 under a header at sequence 1 (complete) Ok the window check (check_window) validates the collapsed sequence; the raw line claimed an out-of-window sequence first and is not a faithful record of any session
4 header records object with a repeated record key collapsed once by the Value parse, then re-serialized (:1170) and collapsed again inside parse_records refused at the first parse (see companion issue for the parse_records side)

This is the same silent-discard class as #6390 (atlas-eval duplicate results key) and #6384 (deploy.py duplicate registry keys): in a format whose whole purpose is faithful replay (verify replays a fixture twice and compares records after every event), an ambiguous line must be a parse error, not a coin the parser flips silently.

Evidence

Verified this run on the laptop at origin/main 252d430853 with a probe integration test against the real id crate (~/git/fleet/probe-records-dup/pkgs/id/tests/probe_fixture_dup.rs, worktree ~/git/fleet/probe-records-dup @252d430853):

  • Control: minimal valid fixture (header, current_sequence 0, complete, no events) decodes, world_id = "w".
  • Case 1: duplicate world → Ok, world_id = "second".
  • Case 2: duplicate fixture version (99 then 1) → Ok.
  • Case 3: duplicate event sequence (99 then 1) → Ok; the window check passes on the surviving value.

Probe result: 1 passed (all three bug cases reproduce; control behaves).

Code read @252d430853: decode_header at world_fixture.rs:1106 parses serde_json::from_str(line) into a Value, then check_keys over the collapsed map (:1132); decode_event at :1195 does the same per event line (:1199, check_keys at :1209/:1225/:1243/:1263); scalar fields are then read with u64_field/string_field/bool_field from the collapsed map. No duplicate detection in either function. The in-tree tests exercise check_keys for unknown/missing fields, which duplicates structurally evade.

Why it matters

Fixtures are the determinism oracle for world programs: verify's verdict is only meaningful if the fixture text denotes exactly one session. A fixture format that silently resolves contradictory fields lets a hand-edited or corrupted fixture (the exact inputs decode's strictness exists to catch — unknown fields, gaps, blank lines are all refused) replay as a different session than the one its text first describes, and lets the version gate be satisfied by a line that also declares an unsupported version. Every other strictness rule in this decoder is defeated the same way if the field it checks can be duplicated.

Acceptance criteria

  • decode refuses any header or event line whose JSON object contains a duplicate field, with an error naming the line and the repeated field (line context follows the existing "fixture line {n}" convention).
  • All three shapes above are refused; the version, world, and sequence checks operate on a document known to name each field at most once.
  • Valid fixtures are unchanged: the existing world_fixture tests (encode/decode round-trips of every kind, window checks, key checks) still pass, and encode output always decodes.
  • New tests pin duplicate-field refusal for the header and for at least one event kind.
  • The header records field: a repeated record key inside it is refused here as a duplicate field of the records object (not merely by whatever parse_records does after re-serialization) — coordinate with the companion parse_records issue so the two fixes agree on where nested duplicates are caught.

Activity

Next
  1. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/triageQueue packet kind: verify, reproduce, and route this item
    status/needs-triageNot yet triaged; needs a first look
    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-1951

  3. dezren39
    added
    source/creatorFiled by the new-issue-creator job
    priority/normalOrdinary priority (the default)
    queue/queuedHas a queued queue task
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    on Nov 6, 2026
  4. 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 new-issue-creator-code-b, run 2026-11-06 02:50 CST (2026-11-06T08:50Z)
    • Found via: filed this run
    • Task: Filed after verifying on the laptop (probe ~/git/fleet/probe-records-dup, real id crate, probe_fixture_dup 1 passed): world_fixture::decode parses header/event lines into a serde_json Value before check_keys/check_window run, so duplicate fields collapse last-wins — dup world (second wins), dup version 99 hidden by 1, and dup event sequence 99 hidden by 1 all decode Ok; control decodes.
    • Expectation: effort s–m — triage routes the fix: duplicate-field refusal in decode_header/decode_event naming line + field; companion 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) covers the gate the header records field feeds — the two fixes should agree on where nested records duplicates are caught.
    • Links: probe worktree ~/git/fleet/probe-records-dup @252d430853; companion 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; body evidence in the issue.
  5. dezren39
    added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued queue task
    on Nov 6, 2026
  6. 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-i
    • Session / ID: task 10941
    • Found via: queue claim
    • Task: Triage for issue 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 — verify and route the world_fixture fixture decode duplicate-field gap
    • Expectation: effort s; done = verdict posted on issue 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 and a fix task enqueued if confirmed
    • Links: task 10941
  7. 161 remaining items

    Load more actions
  8. dezren39
    added a commit that references this issue on Nov 10, 2026

    Merge pull request #7702 from developing-today/queue/12995-6474-world…

    c2420df
  9. dezren39
    closed this as completedin #7702on Nov 10, 2026
  10. developing-today
    added
    status:done
    on Nov 10, 2026
  11. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 10, 2026
  12. dezren39 commented on Nov 10, 2026

    @dezren39
    dezren39
    on Nov 10, 2026
    MemberAuthor
    More actions

    🤖 Agent note · MID-SHIFT FALLBACK — lane code-b, task 12995 (issue #6474).

    The broker heartbeat for task 12995 returns 'task 12995 is not claimed by repo-worker-code' (exit 5) despite a live 45-minute lease — the same mid-shift claim loss this lane hit on task 14211 this shift. Per runbook §0b this task switches to the GitHub fallback: fallback claim on issue #6474 as repo-worker-code-b, terminal via fallback release. Work state at switch: PR #7702 head 30d8516 (current main merged in, one-file world_fixture duplicate-key fix), targeted world_fixture tests running on the laptop. Next: test result, then merge PR #7702 if green.

  13. dezren39 commented on Nov 10, 2026

    @dezren39
    dezren39
    on Nov 10, 2026
    MemberAuthor
    More actions

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

  14. dezren39
    added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 10, 2026
  15. dezren39 commented on Nov 10, 2026

    @dezren39
    dezren39
    on Nov 10, 2026
    MemberAuthor
    More actions

    Progress from repo-worker-code-b: targeted_tests_running: cargo test world_fixture on laptop

  16. dezren39 commented on Nov 10, 2026

    @dezren39
    dezren39
    on Nov 10, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done (fixed_merged) — lane code-b, task 12995 (small_fix, issue #6474).

    PR #7702 is MERGED (merge commit c2420df) and issue #6474 is CLOSED. Verified fresh: the fix is on origin/main — pkgs/id/src/world_fixture.rs imports parse_json_without_duplicate_keys (line 21) and both decode_header (line 573) and decode_event (line 621) parse through it — and the PR head this lane pushed (30d8516, current main merged into the PR branch) is an ancestor of origin/main. Targeted tests verified by this lane on the laptop against that head: cargo test -p id --lib world_fixture — 29 passed, 0 failed, including decode_refuses_duplicate_fields_in_the_header_and_events. No Codex findings existed on the PR. (The merge landed while this lane was verifying, after the broker claim was lost mid-shift and the task switched to the GitHub fallback — see the MID-SHIFT FALLBACK note; terminal is recorded via fallback release.)

  17. dezren39 commented on Nov 10, 2026

    @dezren39
    dezren39
    on Nov 10, 2026
    MemberAuthor
    More actions

    Released by repo-worker-code-b (outcome: done). task 12995 fixed_merged: PR #7702 merged c2420df, fix verified on origin/main (world_fixture.rs:573/621), targeted tests 29 passed locally, issue #6474 closed

  18. dezren39
    removed
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 10, 2026
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 jobsource/design-architectFiled by the repo design architect jobstatus:donetask/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

      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.