GeezerVison is showing github.com — Phase 4 of #6622 — closing pagination inventory: disposition every paginated loop in the repo against the complete/bounded/honest contract · Issue #6623 · developing-today/code
Phase 4 of #6622 — closing pagination inventory: disposition every paginated loop in the repo against the complete/bounded/honest contract #6623DescriptionPhase 4 of #6622 — closing pagination inventory: disposition every paginated loop in the repo against the complete/bounded/honest contract
Phase 4 (closing inventory) of design #6622 — complete, bounded, or say so: one pagination contract for the repo's paged reads (design doc: files/designs/code-pagination-contract.md in the keep-the-four-repos-healthy goal workspace; audit at origin/main 075b2de90).
Scope
GATED on Phases 1–3 of #6622 (#6578 + #6600 + #6615 cursor validity; #6572 + #6532 + #6602 volume bounds; #6605 + #6618 completeness honesty) — do not start the inventory until they have landed; keep this issue status/blocked until then.
Inventory every paginated loop in the repo — every place code follows a cursor/token/page parameter across requests, or reads a list it presents as complete — and disposition each one against the contract's three rules (cursor validated where read: type + progress; volume bounded with a named-listing error; truncation never silent: complete, fail-closed, or explicitly marked): conforms (name the guard), filed (a follow-up issue, if a gap is found), or deliberately local/unbounded (the reason named). The inventory covers at least: the pkgs/id page consumers beyond Phase 1's three (any other next_after/records/history readers, and the sender side in world_session); github-backup's remaining page followers beyond Phase 2's two (clone/fetch/reconcile loops); cold-store-reaper's remaining listings beyond list_backups/s3_list_objects; the aggregator/projector page and cursor reads; fleet crates' list reads beyond dispatch-test's scan (including the queue brokers' list paths); and the operator scripts under infra/ and bin/ that page GitHub or PostgREST.
Land the contract's final statement form: confirm each Phase 1–3 system carries the three-rule statement in its module docs (or the nearest equivalent), in the terms recorded on #6622.
Required dispositions (name each one explicitly in the closing evidence)
Acceptance criteria
- An inventory (posted on this issue or landed in docs) lists every paginated loop above with a disposition and file:line evidence.
- The four required dispositions (a)–(d) are each answered explicitly.
- Any gap found is filed as its own issue and linked; no gap is fixed silently inside the inventory.
- The contract statement's final form is present in the Phase 1–3 systems' docs, and design Design: complete, bounded, or say so — one pagination contract for the repo's paged reads #6622 is commented with the closing evidence.
Filed by the design architect as Phase 4 of #6622. Triage: record the gating on Phases 1–3, keep status/blocked until they land, and do not re-scope the contract — the decisions are recorded on #6622. Activitydeveloping-today commented on Nov 6, 2026 dezren39 commented on Nov 6, 2026 🤖 Agent note · design-architect pass 63 — Phase 4 filed this pass
- 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 4 (closing pagination inventory), 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, count=9). GATED on Phases 1–3 (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 + 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, github-backup(drain): queue_events pagination has no page/event bound — a Worker page stream with fresh cursors and list_complete=false loops forever, accumulating events and never acking #6572 + github-backup(ghb_common): inventory_owner paginates forever when a page says hasNextPage with a null/empty endCursor — the reconcile sweep hangs re-fetching page 1 instead of raising #6532 + cold-store-reaper(listings): list_backups and s3_list_objects have no page/result bound — a fresh-token page stream loops forever, accumulating rows #6602, fleet(dispatch-test): scan counts only the first GitHub page — in-progress runs, per-run jobs, workflows and forks past 100 are silently invisible, so active undercounts and a busy home can be chosen #6605 + cargo-target-janitor: both deletion-safety liveness reads are single-page — queue_claims caps at 1000 rows and open_pr_branches at 500 PRs, so a claimed task or open-PR worktree past the page silently loses its never-delete protection #6618) — it carries
status/blocked; keep it blocked until they land
- Enqueue status (honest): the architect's triage-packet enqueue for this issue was attempted this pass, but the queue broker's PostgREST reads timed out on the attempt and on the dedupe re-read, so the task's existence is unverified — it may have committed. This issue carries
queue/queued so fleet-monitor safety-net reconciliation is the re-enqueue route. Do not enqueue a second packet for Phase 4 of #6622 — closing pagination inventory: disposition every paginated loop in the repo against the complete/bounded/honest contract #6623 from any surface without a dedupe check first; the next design-architect pass (64) is charged with verifying whether a live pilot task exists once the queue responds
- For triage: record the gating, keep
status/blocked until Phases 1–3 land, and do not re-scope the contract — the decisions are recorded on Design: complete, bounded, or say so — one pagination contract for the repo's paged reads #6622
dezren39 commented on Nov 6, 2026 Intake review
🤖 Agent note · filed
Related: Phase 4 of the pagination-contract design #6622; gated on its Phases 1–3 as the body states.
Notes: Body already contains a complete Acceptance criteria section, kind/enhancement and source/design-architect; I added only priority/normal + effort/l + meta/enriched. Status stays status/blocked per the filing instruction — do not start the inventory until Phases 1–3 land.
Risks: Premature start would inventory loops that Phases 1–3 are still changing.
Suggested approach: Leave blocked until the gating phases land, then run the inventory exactly as scoped. dezren39 commented on Nov 7, 2026 🤖 Agent note · design-architect pass 64 — #6623 task verification attempted, queue still down
developing-today commented on Nov 7, 2026
Picked up by repo-worker-code-c — 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-c posts progress markers; after 30 minutes of silence any other worker may pick this up.) dezren39 commented on Nov 13, 2026
state: done (closing inventory)
lane: code-b (Muse queue lane), task 15331
audit base: origin/main 50b51a4
Closing pagination inventory — Phase 4 of #6622
Every paginated loop in the scoped areas, dispositioned against the contract's three rules (cursor validated where read: type + progress; volume bounded with a named-listing error; truncation never silent). Method: grep sweeps for cursor/page/token followers across pkgs/id, infra/github-backup, pkgs/cold-store-reaper, pm-stack/aggregator + pm-stack/projector (+ legacy pkgs/pm-*), pkgs/fleet/crates, and the operator scripts under infra/ and bin/, then a read of each loop site. Line numbers are at the audit base above.
pkgs/id
| Loop |
Evidence |
Disposition |
record_pages — world_net.rs:1836 |
cursor type strict (match at :1879-1895: null/absent ends, string continues, any other type bails "must be a string or null"); last-key equality (:1900-1905); strict advance (:1924-1929); empty page carrying a cursor refused (:1906-1921); volume via RecordsBudget validation of every record (:1868-1873) |
conforms (#6578) |
admin_event_history — world_net.rs:2035, cursor parse :2006 |
missing next_after key bails (:2025); type string-or-null; strict begin-frame validation (:1950) |
conforms (#6600) |
SSH /records drain — world_ssh.rs:1427-1445, records_cursor :1918 |
present-but-non-string next_after is a malformed page; advance required; total bound (test :4260); truncation surfaces as a notice on an operator surface |
conforms (#6615) |
execute_records_read — world/actor.rs:1944 |
sender/producer: one page bounded by MAX_RECORDS_RESULT_PAGE_BYTES; next_after = last included key or null (:1993); non-string prefix/after is bad_args (:1951-1962) |
conforms (sender — see (c)) |
session records senders — world_session/mod.rs:1166, :1245; type world_session/types.rs:379 |
typed frame field next_after: Option<String>, always serialized as string-or-null |
conforms (sender — see (c)) |
web paginate() — pkgs/id/src/web/routes.rs:1568-1587 |
producer over a fully materialized list: per_page clamped to MAX_PER_PAGE (200), total computed and rendered ("51-100 of 300", templates.rs) |
conforms (producer; completeness stated via total; no follower loop) |
caps page wrapper — id-caps/src/world_caps.rs:750 |
serialized next_after page budget is the byte cap the actor read cites |
conforms (supporting bound) |
github-backup
| Loop |
Evidence |
Disposition |
read_all_queue_pages — bin/drain_queue.py:108-148 |
seen-cursor guard (:145-147); non-string/empty cursor raises (:143-144); MAX_QUEUE_PAGES (:132) and MAX_QUEUE_EVENTS (:140) fail closed before any ack |
conforms (#6572) |
inventory_owner — bin/ghb_common.py:187-289 |
MAX_INVENTORY_PAGES bound (:273); endCursor under hasNextPage must be a non-empty, advancing, unseen string (:279-289); malformed connection raises (:235-238) |
conforms (#6532) |
clone_all.py:218 while pending or inflight |
local work-queue over the plan; each iteration completes a clone job; no remote cursor |
deliberately local (not a page loop) |
reconcile.py:45, ghb_common.py:651 depth() walks |
local parent-chain walks with visited-guard sets over in-memory plan data |
deliberately local (not page loops) |
fetch_mirrors.py:47 while start > 0 |
local fail-streak walk over an in-memory dates list |
deliberately local (not a page loop) |
manifest.py |
no page following found (single local plan/state reads) |
nothing to disposition |
cold-store-reaper
| Loop |
Evidence |
Disposition |
list_backups — cold_store.py:1367-1431 |
LIST_MAX_PAGES / LIST_MAX_RESULTS bound (:1382-1385); repeated token refused (:1426) |
conforms (#6602) |
s3_list_objects — cold_store.py:1978-2015 |
same bounds (:1993); a truncated page must return a usable advancing token or the listing aborts (:2008-2013) |
conforms (#6602) |
_folder_id Drive probe — cold_store.py:868 |
single pageSize: 1 existence probe; its result is never presented as a listing |
deliberately local |
get_backup Drive lookup — cold_store.py:1585-1590 |
single exact-name (name =) lookup, takes the match; not a listing presented as complete |
deliberately local |
worker/, scripts/ |
grep for pageToken/continuation followers found no other listing loops |
nothing further |
Aggregator / projector (pm-stack; legacy pkgs/pm-* have no page followers)
| Loop |
Evidence |
Disposition |
pageEvents — aggregator/src/events.ts:549-590 |
producer over an in-memory snapshot: limit clamped 1..100; cursor strictly decoded (shape + finite dates, :534-547); nextCursor null iff exhausted; /api/events.json also carries pagination.total |
conforms (producer). Invalid cursor → first page is deliberate and documented (:549, "it never becomes a filter") — an operator-UI choice, recorded here explicitly |
freshness listAfter tick — aggregator/src/freshness-delivery.ts:281-320 |
one store page per SSE tick (not a tight loop); cursor only advances (Math.max, :319); a too-old cursor gets an explicit reset frame instead of silent loss |
conforms |
registry-view — aggregator/src/registry-view.ts:159-177 |
offset/limit slice of a fully materialized list; response carries remainingAfterPage |
conforms (producer; remainder stated) |
hot list — projector/src/server.ts:311-326, cursor parse :101 |
producer: cursor is decimal-digits-only else null; limit clamped by parseLimit (:83-101); sweep pins its high-water (:313); next_cursor = last seq |
conforms (producer) |
Fleet crates
| Loop |
Evidence |
Disposition |
fetch_all_pages / get_list — fleet-dispatch-test/src/lib.rs:443-465, :375-380 |
pages to a short page; MAX_PAGES breach errors "refusing to present a truncated count as exact" (:458-460); total_count used where offered (:483) |
conforms (#6605) |
queue list — fleet-queue/src/client.rs:1656-1695, list_pages :983-995 |
--limit validated 1..=500 (:952-962) and fetched in exact pages; a short page stops. The limit is the caller's explicit window (operator listing; queue totals are reported by health, never implied by list) |
conforms |
fallback marker read find_comment_on_issue — fleet-queue/src/client.rs:4055-4090 |
per_page=100 × MAX_PAGES=10; past the bound it errors comments_list_unbounded — a truncated listing never proves a marker absent |
conforms |
| other fleet crates (search, registry, proxy, secrets, config, dispatch) |
grep for per_page/page followers across pkgs/fleet/crates/*/src found no other remote page-follower loops; their list reads are single bounded store queries |
nothing further |
Operator scripts (infra/, bin/)
| Loop |
Evidence |
Disposition |
janitor queue-claims + PR reads — infra/cargo-target-janitor/bin/cargo_target_janitor.py:483, :562-578 |
offset/page loops bounded by MAX_PR_PAGES; truncated protection set stops cleanup (fail closed) |
conforms (#6618) |
yard-reaper claims + PR reads — infra/yard-reaper/bin/yard_reaper.py:513, :603 |
the same two reads, same MAX_PR_PAGES bound |
conforms (#6618 family) |
paperwork issue-search scan — infra/fleet-paperwork/fleet_paperwork.py:403 |
for page in range(1, 11) — the Search API's 1000-result ceiling, stated in its docstring |
conforms |
paperwork installations() :262-283 and assert_repo_in_scope() :312-339 |
while True GitHub page loops with no page bound (short-page / server total_count termination only) |
GAP — filed as #9150 |
infra/worktree-reaper, bin/*.mjs |
grep found no GitHub/PostgREST page followers |
nothing further |
Required dispositions
- (a) github-backup shape filings. github-backup(drain): a non-dict or id-less queue event crashes the whole drain — the #3331 poison pill one level up (event shape itself is never checked) #6575 is CLOSED via PR fix(github-backup/drain): drop non-dict or id-less queue events instead of crashing (#6575) #8412 (merged 69b339e): malformed queue events are drain-dropped and counted, a parsed-shape fix in Design: parsed is not validated — one shape contract at every JSON trust boundary #3068's estate. github-backup(reconcile): a non-dict JSON line in clone-status.jsonl crashes the failed-clone report path — _clone_status_entries tolerates unparseable lines but not valid non-dict ones #6606 is CLOSED via PR fix(github-backup/reconcile): ignore non-dict clone-status lines via shared reader contract (#6606) #6715 (merged 348f900):
ghb_common.clone_status_record states the clone-status line shape, in Design: a mirror is what it can prove — one validity, outcome and alarm contract for the github-backup estate mirror #3282's estate. Both are dispositioned as filed-and-fixed follow-ups in their own estates; this contract claims neither — confirmed.
- (b) The Phase 3 (audit) of #3282 — closing state-access inventory + contract statement for infra/github-backup #3283 cross-reference. Phase 3 (audit) of #3282 — closing state-access inventory + contract statement for infra/github-backup #3283 (closed 2026-11-08) inventories github-backup state access — which state each tool reads/writes and under what contract. This inventory covers the pagination axes (cursor type, progress, volume, completeness) of the same systems' page loops. The two audits divide by property, not by file: the drain and
inventory_owner appear in both, for different questions, so no loop is re-covered for the same property and none is dropped.
- (c) Sender-side cursor emission. For the id worlds protocol, both senders always emit
next_after as string-or-null: the session sender's typed frame (world_session/types.rs:379; mod.rs:1166, :1245) and the actor's JSON sender (world/actor.rs:1993, an Option<String> flattened into the reply object). A receiver-side refusal therefore never meets a legitimate non-string cursor — no sender gap, nothing to file. For github-backup / cold-store / fleet, the senders are the GitHub, Drive, and S3 APIs themselves; their cursor types are the APIs' own, and the receivers validate as tabled above.
- (d) Pin verification. Phase 1 landed cursor-type refusal as recorded on Design: complete, bounded, or say so — one pagination contract for the repo's paged reads #6622, pinned by
world_net.rs tests: test_records_client_rejects_mistyped_cursor (:3032), test_records_client_rejects_empty_page_with_cursor (:3050), test_records_client_rejects_stuck_cursor (:2984), admin_event_history_cursor_requires_a_string_or_null_next_after (:5020) with property invariants (:5081). Phase 3 landed cargo-target-janitor: both deletion-safety liveness reads are single-page — queue_claims caps at 1000 rows and open_pr_branches at 500 PRs, so a claimed task or open-PR worktree past the page silently loses its never-delete protection #6618 as fail-closed-or-complete, pinned by janitor tests test_queue_claims_fails_closed_when_pages_never_end (test_cargo_target_janitor.py:302) and test_open_pr_branches_fails_closed_when_pages_never_end (:410), with at-cap boundary controls (:277, :405). Both pins confirmed — never page-as-set.
Contract statement — final form
Landed by PR #9149 in the Phase 1–3 systems' module docs: world_net.rs (pkgs/id), ghb_common.py (github-backup), cold_store.py (cold-store-reaper), fleet-dispatch-test/src/lib.rs. The cargo-target janitor already carried the nearest equivalent in its README (:39-42: both liveness reads paginated to completion; a read that cannot complete within its page bound stops cleanup — a truncated protection set is treated as an unavailable source, never as ground truth), so it is cited rather than edited.
Result: every paginated loop in scope is dispositioned; the single gap found is filed as #9150; no gap was fixed silently inside this inventory. dezren39 commented on Nov 13, 2026
state: done (fixed_merged)
lane: code-b (Muse queue lane), task 15331
Phase 4 of #6622 is complete. The closing inventory is posted on this issue (comment 6840425061) with every paginated loop in scope dispositioned with file:line evidence, the four required dispositions (a)–(d) answered explicitly, and the pins verified. The contract's final statement form landed via PR #9149 (MERGED 36dbc47) in the Phase 1–3 systems' module docs; the janitor README already carried the equivalent and is cited. The single gap found — fleet-paperwork's two unbounded page loops — is filed as #9150 and is the family's remaining open item. Closing evidence was also commented on design #6622 (comment 6840425615).
Closing this issue as complete; #6622 itself stays open for its own closing pass by its owner.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|