Skip to content

fix(tri): paginate the check-runs that decide "safe to merge", and scope a flag to its call - #3047

Merged
gHashTag merged 1 commit into
masterfrom
loop/paginate-checkruns
Sep 3, 2026
Merged

fix(tri): paginate the check-runs that decide "safe to merge", and scope a flag to its call#3047
gHashTag merged 1 commit into
masterfrom
loop/paginate-checkruns

Conversation

@gHashTag

@gHashTag gHashTag commented Sep 3, 2026

Copy link
Copy Markdown
Owner

A verdict that gates an irreversible action must not stand on a page

tri pr ready answers is this pull request safe to merge, prints VERDICT: safe to merge, and with --merge runs gh pr merge on that verdict. It built the answer from commits/{sha}/check-runs?per_page=100one page, no --paginate. A failing check at position 101 is invisible, the verdict reads safe, and the merge happens.

It does not bite today: 19 check-runs on master against a page of 100. That is the whole character of this class — latent, and one busy branch away.

The cure was already in the same file. prcheck.rs paginates its pulls/{n}/files fetch and says why. Four sibling fetches did not — the shape §437 named, a fix does not travel. All four now paginate.

They are not one defect:

site what a truncated read does
failures_of a red check beyond the page is invisible → safe to merge--merge merges
in_flight pending reads 0, the verdict is not WAIT, the merge proceeds
completed_of a green check reads as never ran → CANNOT TELL about a check that passed
the 15-commit loop a baseline check reads as absent, so a failure looks new

Pagination changed what one of them means

With --paginate a jq '…|length' prints one number per page. The old code did .trim().parse().unwrap_or(0) on it, so two pages of checks would have parsed as nothing and reported zero pending — the exact false "finished" that function's own doc comment was written to prevent, arriving through the cure rather than the disease. The counts are summed instead.

One honest subtraction: the summing helper's first doc comment claimed that skipping an unparseable line differs from counting it as zero. In a sum it does not — a mutation swapping them survived every test, and the claim is removed rather than left standing.

The unit of a flag is the call, not the function

tri gates fetches classified each bounded fetch by reading the enclosing function for guard words. That subject is wrong in both directions, and this pass found both.

False bare. red.rs's fn now holds two fetches and one is_lower_bound, and the guard is applied to a streak returned by a different fetch. The census called the workflow listing guarded on a check that never looks at it.

False complete. Adding --paginate to one of the four fetches in prcheck.rs's ready marked all four complete. A flag is an argument of a CALL — the scan now runs from the site out to the brackets that open and close its own argument list, and a site with no call around it classifies on its own line, borrowing nothing.

A guard string inside a test module is not evidence. fn_spans ends a function at the next top-level fn, so a function LAST in its file swallows every test module after it: red.rs is 253 lines, fn now starts at 134, and two #[cfg(test)] modules at 198 and 223 sit inside its span. Test lines were already excluded from being sites and were not excluded from being evidence — and one of those exclusions without the other is worse than neither.

Where the subject cannot be read, the census asks instead of answering:

    a guard, but two fetches       5   <- which one does it cover?
      issues.rs:622  fn numbers      \
      issues.rs:633  fn numbers       |  the two-branch shape: `if instant.is_some()`
      issues.rs:1279 fn dated         |  choosing between two reads that share one guard
      issues.rs:1290 fn dated        /
      red.rs:140     fn now         <-  the real mis-attribution

Five lines read by hand in a minute to find the one that matters. Stated as a question in the output, folded into neither total.

  • eight clauses mutated, eight killed; one survivor was unobservable in a sum and its doc comment was corrected instead
  • cargo test -p tri534 passed, 0 failed
  • tri pr ready 3043 run end-to-end against the live API after the change
  • skill §468, §469

Refs #2994

…ope a flag to its call

`tri pr ready` answers "is this pull request safe to merge", prints
VERDICT: safe to merge, and with --merge runs `gh pr merge` on that
verdict. It built the answer from commits/{sha}/check-runs?per_page=100 --
one page, no --paginate. A failing check at position 101 is invisible,
the verdict reads safe, and the merge happens.

It does not bite today: 19 check-runs on master against a page of 100.
That is the character of the class -- latent, and one busy branch away.

The cure was already in the same file: prcheck.rs paginates its
pulls/{n}/files fetch and says why. Four sibling fetches did not, which
is the shape section 437 named -- a fix does not travel. All four now
paginate. They are not one defect: failures_of makes a red check beyond
the page invisible and the verdict safe; in_flight lets pending read 0 so
the merge proceeds; completed_of turns a green check into "never ran";
the 15-commit loop makes a baseline check look absent so a failure looks
new.

Pagination changed what one of them means. With --paginate a
`jq '...|length'` prints one number PER PAGE, and the old
`.trim().parse().unwrap_or(0)` would have parsed two pages as nothing and
reported ZERO pending -- the exact false "finished" that function's own
doc comment exists to prevent, arriving through the cure rather than the
disease. The counts are summed.

One honest subtraction: the summing helper's first doc comment claimed
that skipping an unparseable line differs from counting it as zero. In a
sum it does not, a mutation swapping them survived every test, and the
claim is removed rather than left standing.

Separately, `tri gates fetches` classified each fetch by reading the
ENCLOSING FUNCTION, and that subject is wrong in both directions.

False bare: red.rs's `fn now` holds two fetches and one is_lower_bound,
applied to a streak from a different fetch, so the census called the
workflow listing guarded on a check that never looks at it.

False complete: paginating one of the four fetches in prcheck.rs's
`ready` marked all four complete. A flag is an argument of a CALL, so the
scan now runs from the site out to its own argument brackets; a site with
no call around it classifies on its own line and borrows nothing.

And a guard string inside a test module is not evidence. fn_spans ends a
function at the next top-level fn, so a function last in its file
swallows the test modules after it -- red.rs is 253 lines, `fn now`
starts at 134, and two #[cfg(test)] modules sit at 198 and 223 inside its
span. Test lines were excluded from being SITES and not from being
EVIDENCE, and one exclusion without the other is worse than neither.

Where the subject cannot be read the census now asks instead of
answering: "a guard, but two fetches -- which one does it cover?" names
five sites, four of them the benign two-branch shape and one the real
mis-attribution, stated as a question and folded into neither total.

Skill sections 468 and 469.

Refs #2994
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-09-03 19:06:57 UTC

Summary

Status Count
Total Open PRs 13
PRs with Failing Checks 10
PRs with All Checks Green 3
READY 1
FAILING 10
PENDING 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=9b8875f1c9d4 != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

This notebook contains session context, decisions, and artifacts for this work.

@gHashTag
gHashTag merged commit 3e52fb1 into master Sep 3, 2026
36 checks passed
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