From 82b238afebb122ce65fbaa55bea2037a81a67a82 Mon Sep 17 00:00:00 2001 From: repo-worker-tmp-code-b Date: Thu, 12 Nov 2026 15:54:40 -0600 Subject: [PATCH] docs(pagination): land the #6622 contract statement in the Phase 1-3 systems' docs (#6623) --- infra/cargo-target-janitor/README.md | 19 +++++++++++++++++++ infra/github-backup/README.md | 19 +++++++++++++++++++ pkgs/cold-store-reaper/README.md | 19 +++++++++++++++++++ .../crates/fleet-dispatch-test/src/lib.rs | 19 +++++++++++++++++++ pkgs/id/crates/id-worlds/src/world_net.rs | 19 +++++++++++++++++++ 5 files changed, 95 insertions(+) diff --git a/infra/cargo-target-janitor/README.md b/infra/cargo-target-janitor/README.md index 2d0d696909..4cf558861e 100644 --- a/infra/cargo-target-janitor/README.md +++ b/infra/cargo-target-janitor/README.md @@ -63,6 +63,25 @@ numeric `~/git/fleet/target-` ad-hoc targets. violating the safety exclusions. A maximum of 20 exact target paths is handled per run, so subsequent hourly runs continue eligible cleanup. +## Pagination contract (design #6622, closing inventory #6623) + +A paged read is complete, bounded, or says so (design #6622, closing +inventory #6623): +1. The cursor is validated where read — its type first (where the + protocol's terminator is null, a present-but-non-string cursor is + malformed, never end-of-pages) and its progress second (the + cursor must advance under the protocol's rule). +2. The volume is bounded — every page loop carries a page, result, + or byte bound whose breach is an error naming the listing. +3. Truncation is never silent — a read that stops short either + paginates to completion (or counts via the source's own total), + fails closed, or marks the truncation explicitly in its output. + +This tool's liveness reads carry the fail-closed form: the +claimed-task and open-PR-branch reads paginate to completion and +raise on a full page at the cap (`MAX_PR_PAGES`) rather than +presenting a page as the set (#6618). + ## Run and schedule From the laptop: diff --git a/infra/github-backup/README.md b/infra/github-backup/README.md index 28e435bedb..3fd2d743cd 100644 --- a/infra/github-backup/README.md +++ b/infra/github-backup/README.md @@ -97,6 +97,25 @@ The seven rules, in operator language: previously planned entries, marks them retained in the report, and still exits non-zero. +## Pagination contract (design #6622, closing inventory #6623) + +A paged read is complete, bounded, or says so (design #6622, closing +inventory #6623): +1. The cursor is validated where read — its type first (where the + protocol's terminator is null, a present-but-non-string cursor is + malformed, never end-of-pages) and its progress second (the + cursor must advance under the protocol's rule). +2. The volume is bounded — every page loop carries a page, result, + or byte bound whose breach is an error naming the listing. +3. Truncation is never silent — a read that stops short either + paginates to completion (or counts via the source's own total), + fails closed, or marks the truncation explicitly in its output. + +This system's readers carry it as: the `queue_events` drain's +page/event bounds (bin/drain_queue.py, #6572) and +`inventory_owner`'s advancing-cursor validation with its +`MAX_INVENTORY_PAGES` hard bound (bin/ghb_common.py, #6532/#6840). + ## Components | Path | What | diff --git a/pkgs/cold-store-reaper/README.md b/pkgs/cold-store-reaper/README.md index 9ce3b8ccef..62787cc7a6 100644 --- a/pkgs/cold-store-reaper/README.md +++ b/pkgs/cold-store-reaper/README.md @@ -40,6 +40,25 @@ Drive web UI for "the same" cold store) are **invisible to this app** and must never be wired in by ID. If `state.json` is lost, `ensure-folders` finds the existing tree again by name — it does not duplicate it. +## Pagination contract (design #6622, closing inventory #6623) + +A paged read is complete, bounded, or says so (design #6622, closing +inventory #6623): +1. The cursor is validated where read — its type first (where the + protocol's terminator is null, a present-but-non-string cursor is + malformed, never end-of-pages) and its progress second (the + cursor must advance under the protocol's rule). +2. The volume is bounded — every page loop carries a page, result, + or byte bound whose breach is an error naming the listing. +3. Truncation is never silent — a read that stops short either + paginates to completion (or counts via the source's own total), + fails closed, or marks the truncation explicitly in its output. + +This system's listings carry it as: `list_backups` and +`s3_list_objects` validate continuation-token progress (repeated +tokens are refused) under the shared `LIST_MAX_PAGES` / +`LIST_MAX_RESULTS` bounds (cold_store.py, #6602). + ## Credentials No real credential values live in this repo, ever. The operator keeps the diff --git a/pkgs/fleet/crates/fleet-dispatch-test/src/lib.rs b/pkgs/fleet/crates/fleet-dispatch-test/src/lib.rs index d103af385a..77896d6730 100644 --- a/pkgs/fleet/crates/fleet-dispatch-test/src/lib.rs +++ b/pkgs/fleet/crates/fleet-dispatch-test/src/lib.rs @@ -1,6 +1,25 @@ //! fleet-dispatch-test — the dispatch-test domain of the fleet //! multicall binary (design: developing-today/code#6580). //! +//! ## Pagination contract (#6622) +//! +//! A paged read is complete, bounded, or says so (design #6622, closing +//! inventory #6623): +//! 1. The cursor is validated where read — its type first (where the +//! protocol's terminator is null, a present-but-non-string cursor is +//! malformed, never end-of-pages) and its progress second (the +//! cursor must advance under the protocol's rule). +//! 2. The volume is bounded — every page loop carries a page, result, +//! or byte bound whose breach is an error naming the listing. +//! 3. Truncation is never silent — a read that stops short either +//! paginates to completion (or counts via the source's own total), +//! fails closed, or marks the truncation explicitly in its output. +//! +//! The scan carries it as: `fetch_all_pages` reads each list to +//! completion under `MAX_PAGES`, past which the read errors instead +//! of presenting a page-bound count as exact; the queued-runs term +//! counts via the source's `total_count` (#6605). +//! //! An explicit-dispatch CI test surface over GitHub Actions: //! //! fleet dispatch-test scan count active Actions jobs in each diff --git a/pkgs/id/crates/id-worlds/src/world_net.rs b/pkgs/id/crates/id-worlds/src/world_net.rs index bf46810442..0134454336 100644 --- a/pkgs/id/crates/id-worlds/src/world_net.rs +++ b/pkgs/id/crates/id-worlds/src/world_net.rs @@ -35,6 +35,25 @@ //! `WorldClient` method against these rules is recorded on issue //! #6670. A lax extraction found later is filed as a follow-up //! issue, not patched silently and not defaulted around. +//! +//! ## The pagination contract (#6622) +//! +//! A paged read is complete, bounded, or says so (design #6622, closing +//! inventory #6623): +//! 1. The cursor is validated where read — its type first (where the +//! protocol's terminator is null, a present-but-non-string cursor is +//! malformed, never end-of-pages) and its progress second (the +//! cursor must advance under the protocol's rule). +//! 2. The volume is bounded — every page loop carries a page, result, +//! or byte bound whose breach is an error naming the listing. +//! 3. Truncation is never silent — a read that stops short either +//! paginates to completion (or counts via the source's own total), +//! fails closed, or marks the truncation explicitly in its output. +//! +//! This module's readers carry it as: `record_pages` (typed +//! string-or-null cursor, last-key match, empty-page refusal, +//! advance check, `RecordsBudget`) and `admin_event_history` +//! (typed cursor parse, missing-key refusal, `AdminHistoryBudget`). use std::collections::HashMap; use std::sync::{