Repository navigation
gardener: review-tiers check, judgment as a model draft (#1064) - #1071
Merged
Merged
Conversation
- New general check review-tiers: merged pull requests that had less review than their tier asks for. Tiers and waiver words come from options (or the merge gate's own review block); lens comments are read by the gate's own code (fork-ci/actions/pr-queue, installed as gate/). One rate_limit read and one paged GraphQL search per run, cached in the check's cacheDir, so the next run searches only pull requests updated since the day before. - Contract v1 gains cacheDir and dryRun (additive; read with .get()). - Report: a "#N" where is shown (OWNER/REPO#N when the report goes to another repository); well-known token shapes are masked. - Judgment: shown as "Judgment (model draft)", timeoutSeconds bounds the whole answer (a trickling server is cut off), no paid fallback (documented). - Tests: verdicts, override/waiver/exempt, gate review block, budget and partial searches, the cache (runs again, stops half-way, old/empty/newer state, dry run), slow and silent model endpoints; RedCheck mutations. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cluded The installer reads the gardener's gate/ from fork-ci/actions/pr-queue two folders up from the kit; the shared install fixture copied the kit to a folder with nothing beside it, so 7 gardener install tests failed in CI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…is ambiguous) A branch named like a tag or remote printed as heads/<name> and crashed the check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…option Fix round 1 from the lens: - A search cut off by maxPages or the budget now remembers where it stopped (resume point in the cache) and goes on there next run, older pull requests first, until the whole window is read; "partial" is a warning. A page of one second is stepped past; a broken resume point is dropped. - Lenses after the merge that, with those before it, meet the tier clear the warning and leave a "late" note; the fix hint says so. - "No lens at all" (skipped, warn) is counted apart from "a lens kind missing" (short, warn at the top tier, else info). - The "repo" option is refused: the check reads the project's own repo. - The gate's code is part of the cache key; the unused "bot" fact is gone. - With the gate's review block, a pull request with more than 100 files is judged as critical. - A GraphQL page GitHub cannot answer is asked again once with 5 pull requests a page. - The judge's model call is bounded by timeoutSeconds in total: each read waits at most until the deadline. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 2 of #1064 (phase 1: #1068).
What
review-tiers(fork-kit/gardener/checks/review-tiers): merged pull requests that had less review than their tier asks for.rules(globs), aregistryfile in the repository (rows of paths with a tier),unmatched, and per tierrequires(minLenses, named lens regexes with counts). Withouttiersit judges by the merge gate's ownreviewblock.fork-ci/actions/pr-queue: config, lens, review_config, review_glob, review_judge), imported and not copied. The installer copies them into the release asgate/. A comment counts exactly when the gate would take it as a lens, and only if posted by the queue config's lens authors.repooption (a different one is refused), so a#Nin the report always means that repository's PR.review-tiers.skipped(warn) when no lens was posted at all;review-tiers.shortwhen some lens kinds are missing (warn at the top tier or a critical PR, else info);review-tiers.late(info) when the lenses posted after the merge meet the tier, so a review done afterwards settles the warning as the hint says.waivers. Anyone the queue counts for lenses can waive, the PR's own author too; the README says so next towaivers.exemptLabelsandexemptAuthorsskip pull requests.rate_limitread and one paged GraphQL search per run (maxPages, default 8, at most 25; about 10 s a page, sotimeoutSecondsmust cover it). BelowminRemaining(1000) it does not search and judges from the cache. A GraphQL error page is retried once at a quarter of the page size.cacheDir(a private per-check folder in the state folder) anddryRun. Both are additive; checks read them with.get().#Nwhere is shown; when the report goes to another repository it is writtenOWNER/REPO#N, so it never links to the wrong#N.ghp_,github_pat_,sk-,xoxb-,AKIA, private key blocks) are masked in check text and in the judgment.timeoutSecondsbounds the whole answer: before each read the socket timeout is cut to the time left, so neither a trickling nor a stalled server can run past the deadline.Fix round 1 (lens findings)
maxPagesor the budget remembers where it stopped (resume: day, since, before) and the next run continues from there (updated:<=that point, overlapping by one PR; a page that all shares one second steps past it), so every PR is judged within a few runs.partialis now a warn, and the README documentsmaxPagesx 10 s. Test: maxPages 1 over 3 pages judges every PR by the third run.review-tiers.lateinfo instead of the warning.repooption could send one repository's PRs out under another's name): the option is removed and refused.skipped, warn) is counted apart from "a lens kind missing" (short).botfact is dropped. M4: see Judgment above. M5: a GraphQL error page is retried smaller. M6: the README waiver note.State question (runs again, stops half-way, old/empty state)
updated:>=the day before the last full search, then continues any saved resume point. Merged pull requests already in the cache are still judged.Calibration (dry runs on two real repositories)
maxPages8 before fix round 1; the search now resumes across runs, and a busy project can setmaxPagesto about 20.Tests
fork-kit/gardener/testspasses. Each fix has a test that fails without it, andRedCheckmutates each guard (28 mutations in checks, 21 in report):Also run (earlier in this PR):
fork-kit/common/tests/machine_file.test.py27 OK,fork-ci/actions/pr-queue/review_judge.test.py57 OK,.github/scripts/fork-ci-release.test.py98 OK,fork-kit/common/tests/kit_install.test.py189 OK, and the seam check (clean).Two fixes found on the way: the kit tests' fixture now copies the kit in the fork's layout (the installer reads
gate/fromfork-ci/actions/pr-queue), and theworktreescheck reads branches withrefname:lstrip=2, becauserefname:shortprintsheads/<name>when a tag or remote has the same name and the check then crashed.General vs project
maxPagesgo in its own machine-file entry or config. The SkyRPG adapter comes in a separate PR in that repository.🤖 Generated with Claude Code