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_ssh): the /records drain never validates its cursor — a non-string next_after silently ends the listing as if complete, and a non-advancing cursor re-requests the same page ~18,700 times · Issue #6615 · developing-today/code

id(world_ssh): the /records drain never validates its cursor — a non-string next_after silently ends the listing as if complete, and a non-advancing cursor re-requests the same page ~18,700 times #6615

New issue
Copy link
New issue
Copy link
Closed
#6739
Closed
id(world_ssh): the /records drain never validates its cursor — a non-string next_after silently ends the listing as if complete, and a non-advancing cursor re-requests the same page ~18,700 times#6615
#6739
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/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Description

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

id(world_ssh): the /records drain never validates its cursor — a non-string next_after silently ends the listing as if complete, and a non-advancing cursor re-requests the same page ~18,700 times

Evidence (verified this run, laptop primary @ origin/main 2bb307550b)

pkgs/id/src/world_ssh.rs, the Some("records") arm of the SSH world-session frame handler:

  • :1014 — let after = value["next_after"].as_str().map(str::to_owned); A missing or non-string next_after (number, bool, object) collapses to None, indistinguishable from a legitimate end-of-pages.
  • :1018-1035 — continuation is decided purely by records_prefix.is_some() && after.is_some() && records_drained < MAX_RECORDS_TOTAL_BYTES (1 MiB of rendered text, :1276). The only stop marker is truncated = after.is_some() && records_drained >= MAX_RECORDS_TOTAL_BYTES (:1027). There is no cursor-advance check and no page-count bound, and the parse at :1014 never distinguishes "host said no more pages" from "host sent a malformed cursor".
  • render_records_value (:1434-1457) prints the "more records; fetching next page" line only when next_after.is_some(), so the silent-stop case renders exactly like a complete listing.

Probe (laptop ~/git/fleet/probe-ssh-records/probe.py, exact transliteration of :1010-1040 + render_records_value):

  • Case A — one page {records: {a: 1}, sequence: 7, next_after: 123} → 0 continuations, no truncation note: the drain ends and the partial listing is presented as complete.
  • Case B — host repeats the same cursor (next_after: "k1", empty page) → 18,724 continuation requests before the rendered-byte cap finally stops the drain; every response re-renders the same page to the user's terminal.
  • Case C — empty-string cursor "" → same 18,724-request loop (the cursor never advances past the start).

Contrast with the sibling consumers

The world_net consumers of the same host pages validate exactly this:

  • WorldClient::records (world_net.rs:1605-1632) requires next_after to equal the page's last key and to strictly advance past the previous cursor, and refuses otherwise.
  • admin_event_history (world_net.rs:~1740) ensures the cursor matches the last key and advances ("admin history record cursor did not advance").

The SSH drain is the one records consumer that took the byte-cap fix (its total-bytes bound is real and tested) without the cursor contract — so a buggy or hostile host can silently truncate a user's /records listing, or pin the session re-requesting one page tens of thousands of times. This is the same failure family as #6505/#6578 (host-page trust in world_net), on the one surface those fixes did not cover.

Why it matters

/records over SSH is an operator's view of a world's structured state. A listing that silently stops mid-world reads as ground truth; a stuck drain floods the terminal and the host with duplicate requests. Both outcomes come from one unvalidated host value.

Acceptance criteria

  • A records frame whose next_after is present but not a string is treated as a malformed page (error / visible truncation notice), never as a clean end-of-pages.
  • A next_after that does not strictly advance past the cursor that produced the page stops the drain with a visible notice instead of re-requesting.
  • A page-count bound complements the rendered-byte bound (or the advance check makes the count bound unnecessary — say which, in the code).
  • Tests cover: non-string next_after, repeated cursor, empty-string cursor, and a normal multi-page drain still completing; oracle = the world_net cursor contract (id(world_net): WorldClient records paging trusts host pages — no record caps re-checked, no ordering/cursor validation, a non-advancing next_after loops forever #6505/id(world_net): record_pages still loops forever on empty pages with an advancing cursor — the #6505 RecordsBudget checks records, not pages, and a non-string next_after silently ends the read #6578 behavior).

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
    source/creatorFiled by the new-issue-creator job
    priority/normalOrdinary priority (the default)
    queue/queuedHas a queued queue task
    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-2021

  3. dezren39
    added
    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:v1
    state: filed
    Found via: filed this run (new-issue-creator-code-a)
    Summary: world_ssh /records drain (world_ssh.rs:1014-1035) never validates next_after — non-string cursor silently ends the listing as complete; non-advancing cursor re-requests the same page 18,724 times before the rendered-byte cap stops it. Verified on laptop @ origin/main 2bb3075, probe ~/git/fleet/probe-ssh-records/probe.py. Sibling world_net consumers (records, admin_event_history) already enforce the advance contract (#6505/#6578 family).
    Queue: packet packet-6615-triage.json prepared; enqueue attempted this run (queue backend PostgREST timeout outage ongoing since ~18:11Z — see backlog entry).

  5. dezren39
    added a parent issue on Nov 6, 2026
    • Design: complete, bounded, or say so — one pagination contract for the repo's paged reads #6622
  6. dezren39
    added
    source/design-architectFiled by the repo design architect job
    on Nov 6, 2026
  7. dezren39 commented on Nov 6, 2026

    @dezren39
    dezren39
    on Nov 6, 2026
    MemberAuthor
    More actions

    🤖 Agent note · design-architect pass 63 — adopted as a phase of design #6622

    • Design: Design: complete, bounded, or say so — one pagination contract for the repo's paged reads #6622 — complete, bounded, or say so (one pagination contract for the repo's paged reads). Doc: files/designs/code-pagination-contract.md in the keep-the-four-repos-healthy goal workspace. Audit at origin/main 075b2de90
    • This issue is Phase 1 (cursor validity in pkgs/id's host-page consumers), with the other Phase 1 issues (id(world_net): record_pages still loops forever on empty pages with an advancing cursor — the #6505 RecordsBudget checks records, not pages, and a non-string next_after silently ends the read #6578, id(world_net): admin_event_history treats a non-string or missing next_after as end-of-pages — the admin export, and fixtures recorded from it, silently truncate while complete stays true #6600). Linked as a sub-issue of Design: complete, bounded, or say so — one pagination contract for the repo's paged reads #6622 (verified in its sub_issues list)
    • Decision recorded on Design: complete, bounded, or say so — one pagination contract for the repo's paged reads #6622 that binds this phase: a present-but-non-string cursor is a malformed reply, refused — never defaulted to end-of-pages; only the protocol's terminator (null, and absence only where the sender may omit the key) ends a read. This extends Design: validate it where you read it — one validated-and-bounded contract for the fleet proxy's frame and peer values #6582's present-but-invalid rule to page cursors
    • For triage: do NOT re-file, re-scope or split this issue as a standalone — record the phase structure instead. No new packet from the architect: this issue already carries its own queue lifecycle
  8. dezren39 commented on Nov 7, 2026

    @dezren39
    dezren39
    on Nov 7, 2026
    MemberAuthor
    More actions

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

    🤖 Agent note · picked up

    • Agent: queue worker (repo-worker-code), lane code-l
    • Session / ID: repo-queue-worker-shift-l run, 2026-11-06 19:58 CST (fallback mode; issue id(world_ssh): the /records drain never validates its cursor — a non-string next_after silently ends the listing as if complete, and a non-advancing cursor re-requests the same page ~18,700 times #6615 is the task)
    • Found via: fallback scan of queue/queued issues (backend down: fleet queue health HTTP 503 PGRST002; fallback protocol followed manually via gh CLI)
    • Task: triage verification of the world_ssh /records drain cursor claims against current main (code read at pkgs/id/src/world_ssh.rs records arm + sibling world_net cursor contract); confirm or refute, route the fix on this issue if confirmed
    • Expectation: effort s; done = verdict comment posted with fresh line-level evidence + fix routed as task/small-fix + queue/queued (or refutation with evidence)
    • Links: pkgs/id/src/world_ssh.rs
  9. dezren39
    removed
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued queue task
    on Nov 7, 2026
  10. 13 remaining items

  11. dezren39
    added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    queue/queuedHas a queued queue task
    on Nov 7, 2026
  12. dezren39 commented on Nov 7, 2026

    @dezren39
    dezren39
    on Nov 7, 2026
    MemberAuthor
    More actions

    🤖 Agent note · picked up

    • Agent: queue worker (repo-worker-code), lane code-x — FALLBACK MODE (queue backend down; the fallback claim marker on this issue is the claim of record)
    • Session / ID: cron repo-queue-worker-shift-x run 2026-11-06 20:39 CST; fallback worker id repo-worker-code-x (issue id(world_ssh): the /records drain never validates its cursor — a non-string next_after silently ends the listing as if complete, and a non-advancing cursor re-requests the same page ~18,700 times #6615 is the task in fallback mode)
    • Found via: fallback scan — next claimable item in scan order after id(world_net): compile() silently defaults a malformed 'compiled' reply — missing/mistyped module_hash, sequence and diagnostics all read as Ok(("", 0, "")) #6620 (fixed & merged by this lane, PR fix(id/world_net): refuse a malformed compiled reply instead of defaulting its fields (#6620) #6718); lane code-l's claim on id(world_ssh): the /records drain never validates its cursor — a non-string next_after silently ends the listing as if complete, and a non-advancing cursor re-requests the same page ~18,700 times #6615 was released (triage done) at 2026-11-07T03:06:46Z, no live claim on fresh read
    • Task: small_fix — the world_ssh /records drain never validates its cursor (world_ssh.rs:1014 + continuation :1019-1032, triaged CONFIRMED by lane code-l against 4844f23). Implement per the routed acceptance: present-but-non-string next_after = malformed page with a visible notice; non-advancing cursor stops the drain with a visible notice; page bound or advance-check rationale in code; tests for non-string / repeated / empty-string cursors + a normal multi-page drain. Oracle: the world_net cursor contract (records / admin_event_history advance rules).
    • Expectation: s — done = PR opened (and merged under the standing criteria) with the cursor validation + tests, or a park/block with a precise reason.
    • Links: fallback claim marker: id(world_ssh): the /records drain never validates its cursor — a non-string next_after silently ends the listing as if complete, and a non-advancing cursor re-requests the same page ~18,700 times #6615 (comment) · triage verdict: lane code-l note on this issue · sibling fix this shift: PR fix(id/world_net): refuse a malformed compiled reply instead of defaulting its fields (#6620) #6718 (id(world_net): compile() silently defaults a malformed 'compiled' reply — missing/mistyped module_hash, sequence and diagnostics all read as Ok(("", 0, "")) #6620)
  13. dezren39 commented on Nov 7, 2026

    @dezren39
    dezren39
    on Nov 7, 2026
    MemberAuthor
    More actions

    Progress from repo-worker-code-x: implementation_complete: worktree ~/git/fleet/fb-6615-records-cursor (laptop), branch queue/fb-6615-records-cursor — the records arm now judges next_after through a factored records_cursor() against the cursor that produced the page (new records_after session state): present-but-non-string = Malformed (drain stops, "[records truncated: host sent a malformed next-page cursor]"), non-advancing/repeated/empty = Stalled (drain stops, "[records truncated: host cursor did not advance]"), advancing = continuation as before; code comment records why the advance rule makes a separate page-count bound unnecessary beside the byte cap. New unit test records_cursor_must_be_a_string_that_advances. Diff: 1 file, +130/-1. Next: targeted tests, commit, push, PR.

  14. dezren39
    added a commit that references this issue on Nov 7, 2026

    Merge pull request #6739 from developing-today/queue/fb-6615-records-…

    27bc7d5
  15. dezren39
    closed this as completedin #6739on Nov 7, 2026
  16. dezren39
    added
    status:done
    and removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    status/triagedTriaged and routed (see agent note)
    on Nov 7, 2026
  17. dezren39 commented on Nov 7, 2026

    @dezren39
    dezren39
    on Nov 7, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done (fixed & merged — PR #6739)

    • Agent: queue worker (repo-worker-code), lane code-x — FALLBACK MODE (queue backend down; fallback claim markers on this issue are the claim of record)
    • Session / ID: cron repo-queue-worker-shift-x run 2026-11-06 20:39 CST; fallback worker id repo-worker-code-x (issue id(world_ssh): the /records drain never validates its cursor — a non-string next_after silently ends the listing as if complete, and a non-advancing cursor re-requests the same page ~18,700 times #6615 is the task in fallback mode)
    • Found via: fallback scan, claim marker on this issue (after lane code-l's CONFIRMED triage routed the fix here)
    • Task: small_fix — the world_ssh /records drain never validates its cursor

    Outcome: FIXED & MERGED

    • PR: fix(id/world_ssh): validate the /records drain cursor instead of trusting next_after (#6615) #6739 — MERGED at 2026-11-07T03:37:46Z, merge commit 27bc7d5c8a22ac27ccd0af5089dda0267b4fb853; branch queue/fb-6615-records-cursor, commit a4dde7a48b. This issue auto-closed on merge (Closes #6615).
    • Change (pkgs/id/src/world_ssh.rs, +130/-1): the records frame arm now judges each page's next_after through a factored records_cursor() against the cursor that produced the page (new records_after session state, set on continuation, reset at drain start / on error / at drain end): absent/null → complete (unchanged); strictly advancing string → next page (unchanged); present-but-non-string → drain stops with [records truncated: host sent a malformed next-page cursor]; non-advancing (repeat / backwards / empty first cursor) → drain stops with [records truncated: host cursor did not advance]. A comment at the site records why the advance rule makes a separate page-count bound unnecessary beside the existing rendered-byte bound (every continuation moves forward through the host's key space; the byte total still caps size).
    • Tests (laptop, pkgs/id, ssh feature — world_ssh is feature-gated): new records_cursor_must_be_a_string_that_advances passes (absent/null End, normal multi-page advance chain, non-string Malformed shapes, empty/repeated/backwards Stalled); full cargo test --lib --features ssh world_ssh: 37 passed / 0 failed.
    • Codex gate: PR fix(id/world_ssh): validate the /records drain cursor instead of trusting next_after (#6615) #6739 carried no Codex review findings at merge (0 reviews / 0 review comments via API); nothing undispositioned.
    • Acceptance: all four criteria met — malformed cursor = visible truncation notice, never clean end-of-pages; non-advancing cursor stops the drain with a visible notice; advance-check rationale stated in code in lieu of a page-count bound; tests cover non-string / repeated / empty-string cursors and a normal multi-page drain, oracle = the world_net cursor contract.
  18. dezren39 commented on Nov 7, 2026

    @dezren39
    dezren39
    on Nov 7, 2026
    MemberAuthor
    More actions

    Released by repo-worker-code-x (outcome: done). Fixed & merged via PR #6739 (merge commit 27bc7d5): the /records drain now validates next_after via records_cursor() against the producing cursor — non-string cursors stop the drain with a malformed-cursor notice, non-advancing cursors stop it with a did-not-advance notice, advancing cursors continue as before; new unit test passes and the full world_ssh suite passes 37/37 on the laptop (ssh feature). Issue auto-closed by the PR.

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/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.