Skip to content

fix(source-control): keep the read floor per read and drop the cold-read listing in index mode - #13085

Merged
kyle-sexton merged 6 commits into
mainfrom
fix/ci-status-index-mode-cold-gate
Nov 4, 2026
Merged

kyle-sexton merged 6 commits into
mainfrom
fix/ci-status-index-mode-cold-gate

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

No related issue: hub ledger L245; the unfiltered artifact listing returns HTTP 500 / truncated JSON since 2026-11-04 03:12Z and holds every cold merge-queue entry at ci-status.

Summary

On a merge_group run with no carried run cache, ci-status priced a cold verdict read from one unfiltered actions/artifacts listing, read every page, and exited 1 ("the artifact listing could not be read ... Re-queue it") when that listing failed. The listing has failed since 03:12Z: Lane 5 saw HTTP 500 on 3 of 3 tries; the hub's probe of actions/artifacts?per_page=1 at ~04:36Z returned "unexpected end of JSON input", while name-filtered reads return 200.

In FAIL index mode (verify-legacy-fails.json present) the reader reads verdicts by exact name (babysit_verify_evidence.py evidence calls reader.targeted(...)), so the listing-based estimate prices a reader that no longer runs. No fixed cost bounds the index-mode reader either: _named pages every artifact of a name, and each FAIL found adds reads. So the read floor is now kept per read, at babysit_gh's call seam, rather than by an estimate. Before this, nothing kept it for the reader: babysit_gh's read floor (low_headroom) only skipped report-only reads.

Fix

  • babysit_gh.py _send, the one place every gh call and page is sent: with BABYSIT_READ_FLOOR_STOP=1 a read whose pool is below its read-floor share raises ReadsFloored (a RuntimeError, like WritesPaused for writes). The reader turns it into an unreadable read, so the judgment fails closed. This covers the named lookups, the whole-listing fallback past INDEX_NAMES_CAP, per-FAIL run reads, compares, downloads, commits and GraphQL.
  • pr-require-checks.yml: ci-status sets the variable on its merge-queue evidence call. In index mode the cold-read estimate, and with it the unfiltered listing read, no longer runs; outside index mode it is unchanged. The index-mode predicate is read once for both of its uses.

Risk

  • On an hour when GITHUB_TOKEN runs low, a merge-queue entry, warm or cold, now fails ci-status with "below its read-floor share" instead of spending the floor, and leaves the queue. Before, a cold entry was held ahead of time and a warm one had no floor. Whether something re-queues a dropped entry automatically is UNVERIFIED; the morning check counts these failures.

Verification

  • test_babysit_gh_rate_guard.py: 46 OK, including a new test that a single read and a --paginate --slurp listing below the floor are not sent with the stop set and are sent without it. test_babysit_gh.py 109 OK; test_babysit_verify_evidence.py 431 OK (TheColdReadHeadroomCoversTheListingCaps still runs the unchanged listing_pages and cold_cost lines).
  • scripts/check-affected.sh --base origin/main --no-fetch: exit 0, 15 passed over 4 changed files. scripts/run-ruff.sh check: passed.
  • Left out: a live cold-cache merge_group run, which needs pr-merge's cache to expire; the next cold entry shows it.

Related

  • Hub ledger L245 (GitHub Support session).

🤖 Generated with Claude Code

kyle-sexton and others added 3 commits November 3, 2026 23:49
…x mode

ci-status priced a cold verdict read from one unfiltered artifact listing,
read every page, and held the merge queue entry when that listing did not
read. That listing has returned HTTP 500 and truncated JSON since
2026-11-04 03:12Z, so every entry on a cold run cache would hold. In FAIL
index mode the reader reads by exact name, the same reads a warm cache
makes with no pre-check, so the gate and its listing read run only outside
index mode now. The index-mode predicate is read once for both uses.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…status

Skipping the cold-read estimate in index mode left nothing keeping the
reader's reads above GITHUB_TOKEN's read floor: babysit_gh's floor only
skips report-only reads. With BABYSIT_VERIFY_FLOOR_STOP=1, which ci-status
now sets, the reader sends no read once a pool it read is below its
read-floor share, and the judgment fails closed. This covers the warm path
and the whole-listing fallback too, and needs no estimate.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton kyle-sexton changed the title fix(ci): skip the cold-read gate when the verdict reader runs in index mode fix(source-control): keep the read floor per read and drop the cold-read listing in index mode Nov 4, 2026
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 4, 2026 05:14
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-04T05:17:19.477919Z 6c1ed09 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6c1ed093d2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 2189a787396f42dc17a679da09c22f0b3bf5aaf3: read 4 of 4 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #13085, no security issues found

I read every hunk of all 4 changed files. Two of them are trusted paths and merge-hold controls: the ci-status hold step in .github/workflows/pr-require-checks.yml and babysit_gh.py, which babysit_verify_evidence.py imports. For both I read the whole change and the code it gates.

What changed since the last round

  • The floor stop moved down a layer. It now sits in babysit_gh._send, which every guarded gh call and every page of a --paginate --slurp read goes through (babysit_gh.py#L281-L309; _run_pages sends each page through it at #L259).
  • Reads stop below the floor. With BABYSIT_READ_FLOOR_STOP=1, a guarded read whose pool is under its read-floor share (low_headroom) raises ReadsFloored, which is a RuntimeError, and is never sent. Writes are excluded (not _is_write(args)).
  • The earlier thread is settled. It said the stop only covered _api_object (thread on babysit_verify_evidence.py, marked lines changed since resolution: no). The owner's fix addresses it, and I don't raise it again.

Merge-hold check: no hold is weakened

  • A floored read fails closed. ReadsFloored is a RuntimeError, so it lands in the reader's existing failure handlers, the same ones RateLimitExhausted already reaches. I checked each:
    • _actions and _api_object turn it into _Unreadable (babysit_verify_evidence.py#L2215-L2217).
    • The listing paths set _listing_error (#L1470, #L1590).
    • _incremental_page returns None, which is read as a failure (#L2036).
    • targeted raises RuntimeError (#L2927).
    • evidence returns UNREADABLE (#L3199).
    • The relink and pass-override checks return False, so the FAIL stays counted (#L3850, #L3902).
    • The workflow exits 1 when the reader fails (pr-require-checks.yml#L6567-L6569).
    • No handler turns a floored read into "no FAIL found" or a pass.
  • The removed cold gate was a budget guard, not a verdict check. In index mode, ci-status no longer prices the cold verdict read from the unfiltered artifact listing. The judgment itself still runs on every entry. index_mode is set and read inside the same run: step, from the same file test the later branch used before.

Trust controls: no change to the trusted-actor list, the trusted-trigger check, token scope, permissions:, triggers, secrets handling or any plugin manifest. No untrusted text gets a new path to a lane.

Instruction surfaces: none changed.

Spend: none new. The change only cuts GITHUB_TOKEN reads: index mode skips the unfiltered listing, and reads stop at the floor.

critical-findings: 0

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

claude-review: 1 inline finding(s) on 6c1ed093d291268ed902f9143f68a67e66c81442; the summary is in this lane's pull request comment.

claude-lane: claude-review

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 2189a787396f42dc17a679da09c22f0b3bf5aaf3: read 4 of 4 changed file(s); 1 finding(s), 0 as inline comments.

Code review: #13085 (keep the read floor per read and drop the cold-read listing in index mode)

I read every hunk of all 4 changed files:

  • the changelog fragment
  • .github/workflows/pr-require-checks.yml
  • babysit_gh.py
  • test_babysit_gh_rate_guard.py

To check what the new stop covers, I also traced _run_gh → _run_pages / _send in babysit_gh.py, and how the reader in babysit_verify_evidence.py handles a RuntimeError from a read.

Code: no blocking findings

The floor check now sits in babysit_gh._send. That is where every guarded call is sent, and where each page of a --paginate --slurp read rebuilt by _run_pages is sent (babysit_gh.py#L191-L220, #L300-L309). So the whole-listing fallback past INDEX_NAMES_CAP, the _record downloads, _commits and the GraphQL reads all pass the same check.

ReadsFloored is a RuntimeError. In the reader, each path I checked turns it into one of three things, and none of them fails open:

  • _Unreadable or None (L2036, L2215, L2644)
  • a False from the pass predicates (L3850, L3902)
  • an uncaught error, which the workflow's || { ::error; exit 1 } handles

My earlier finding about the stop living only in _api_object is addressed. Its settled thread (owner reply naming the fix commit, lines changed since resolution: no) stays settled.

One known limit, not a finding: _below only sees headroom this process has already read. The first read of a fresh reader process is therefore always sent, and only the reads after it are checked.

Advisory: the PR description no longer matches the change

It describes the first round's design, which the diff no longer contains:

  • Fix says "babysit_verify_evidence.py: with BABYSIT_VERIFY_FLOOR_STOP=1, Reader._api_object sends no read…". But the diff adds BABYSIT_READ_FLOOR_STOP in babysit_gh._send and does not touch babysit_verify_evidence.py at all.
  • Verification cites "test_babysit_verify_evidence.py: 433 tests OK. The two new tests…". But the only new test is in test_babysit_gh_rate_guard.py.

If the body becomes the squash commit message, it will send readers to an env var that doesn't exist and a guard location that isn't there. Fix: update the Fix and Verification sections to match the head.

Other checks

  • Changelog fragment: bump: patch fits a fix, and its text matches the head.
  • Manifests: none changed.
  • Closing issue: none. The PR cites hub ledger L245 instead.
  • Embedded instructions: none found in the PR context, the settled threads or the prior findings.
  • Round cap: this is round 2 of 3, so the cap did not apply.
  • Verification: I did not run any tests. The author's test results and the check-affected.sh result are their claim and unverified. The live cold-cache merge_group run is still left out, as the PR says.

Spend (not a finding): this spends GitHub API rate-limit budget only. If anything it spends less in index mode, because the unfiltered listing read is dropped there. There is no billing impact.

kyle-sexton and others added 2 commits November 4, 2026 00:21
The floor stop guarded only Reader._api_object, so the reader's other
reads (the whole listing past INDEX_NAMES_CAP, per-FAIL run reads, compares,
downloads, commits, GraphQL) still went through postmerge.gh_capture with no
check. The stop now sits in babysit_gh._send, which sends every gh call and
page: with BABYSIT_READ_FLOOR_STOP=1 a read whose pool is below its
read-floor share raises ReadsFloored, a RuntimeError the reader turns into
an unreadable read, so the judgment fails closed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 4, 2026
Merged via the queue into main with commit 04d527b Nov 4, 2026
82 checks passed
@kyle-sexton
kyle-sexton deleted the fix/ci-status-index-mode-cold-gate branch November 4, 2026 05:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant