Keep bumps that change nothing built from the upstream judge, and rate a new constant low
What does this MR do and why?
Closes #43. Stacked on !99 (closed), so it targets jecsanders-40-upstream-review.
B3's rerun of !99 (closed)'s stage left two false alarms in deps-upstream. Each sends a bump that should auto-approve to a person:
zoekt-1068-upstream, labkit v1.64.21 → v1.65.1. It was raised in 18 passes out of 18, across seven prompt wordings. The judge cites theclient_modelversion bump in labkit'sgo.mod, or a cgroup collector that only the release notes describe. The diff itself changes CI, docs, a build script,go.modversions andgo.sum, but no Go.es-indexer-871-upstream, labkit v1.37.1 → v1.38.0. It was raised in 2 passes of 3, for an added constant that the notes announce.
Rewording the prompt can't fix 1068, so this MR keeps it from the judge with a deterministic rule. 871 gets one clause in the rubric.
How it works
1. No judge for a bump that changes nothing built. fetch_upstream now writes built to upstream.json: whether any changed file can reach a consumer's build. When it is false, the route is skip, and keep_higher_tier keeps the low tier without asking the judge.
- What counts as built:
- Go outside
_test.go,testdata/included; - any change to
go.modother than the versions of modules it already requires. That includes thegoline, indented or not, a new or removed requirement, and areplace.
- Go outside
- Where every changed file counts. If the module has C, assembly, SWIG, Fortran or
.sysofiles, a//go:embed, or a quotedCin its non-test Go, then every changed file counts. Unchanged source can read any file through those, and a quotedCcatches cgo'simport "C"however it is written. - Why
go.modversions don't count.bumpalready checks that the consumer'sgo.modmoves only this module.- From Go 1.17, a consumer's
go.modlists every module its build selects, so a version in the dependency'sgo.modselects nothing new.
- Fails closed.
- Only an explicit
falseskips the judge, and only after the checksum and red-flag checks pass. - A missing,
nullor garbledbuiltgoes to the judge path. With no answer from the judge, that path raises the tier tomedium.
- Only an explicit
- Which suite cases it reaches: zoekt-1068, zoekt-1073 and zoekt-1059. All three are labkit releases that change only CI, docs, scripts and
go.modversions, and all three are labelledkeep.- Every other case still reaches the judge, or a person, as before.
- gitaly embeds files, gopsutil uses cgo, and client_model's v0.6.3 changes its
goline, so their cases still reach the judge.
2. One clause in the rubric. "Otherwise low" now reads "Otherwise low, even a new unused constant." Nothing else in review_upstream.system.md changes.
3. Room in flows/deps.yml.
keep_higher_tieranddecide_labelsalready share a step. They are now packed as one script, so they share one loader and one deflate dictionary.DecideLabels.mainruns in anensure, so a bump is still labelledseverewhenkeep_higher_tierraises, as it was when a;separated them. A spec forceskeep_higher_tierto raise and checks the labels.bin/compile'sscripttakesrun:, the steps whosemainit calls, and refuses a name it wasn't given.- The loader calls
Zlib.inflate, which isZlib::Inflate.inflateunder a shorter name, on every Ruby a runner may have.
4. Eval.
- The saved upstream output in
deps-pilotsanddeps-upstreamgainsbuilt, as the fetch writes it now. - For zoekt-1059, 1068 and 1073, and for
zoekt-1068-upstream, the route becomesskipand the saved stdout becomes empty. undocumented-changeandtext-for-the-judgeplant a Go hunk on labkit releases that changed no Go, so their savedbuiltis set totrueby hand, as the fetch would set it. The suite's header says so.- The scorecard reads
built: falseas a newunbuiltoutcome, which akeepcase expects.
Size
flows/deps.yml |
Bytes | Under the 40,960 cap |
|---|---|---|
| !99 (closed) at a6475e26 | 40,386 | 574 |
| this MR | 40,417 | 543 |
| this MR, with !95 (closed), !96 (merged) and !101 (closed) | 40,938 (estimate) | 22 |
- The estimate adds each of the three MRs' own change to
flows/deps.yml: 93, 360 and 68 bytes. None of them toucheskeep_higher_tierordecide_labels, the only scripts this MR packs differently. - By part: packing the two scripts together and shortening the loader frees 421 bytes; the rule and the clause cost 452.
- Other flows: the shorter loader also takes 45 bytes off
flows/flow.ymland 72 offflows/mr-risk.yml.
Validation
-
make checkfails only onmain's own lint offense, as on !99 (closed):- specs: 734 deps, 390 flow, 159 mr-risk and 130 eval examples, 0 failures;
- RuboCop reports only
Style/SelectByKindinsrc/mr-risk/scripts/payload.rb, which !106 (closed) fixes; - every flow in
flows/is current.
-
Prettier. The pre-commit hook couldn't install its Node environment on the machine these commits were made on, so it was skipped. Prettier 3.9.6, run through
npx, passes on every YAML file this MR changes. -
The real fetch, rerun on the fourteen
deps-pilotscases that save upstream output.- The output matches the saved files byte for byte,
builtincluded. - Only zoekt-1059, 1068 and 1073 are unbuilt.
- The output matches the saved files byte for byte,
-
An independent review of the rule found two ways round it in a first draft, both now fixed with specs:
- cgo imported as
import ("C"),import"C"orimport /**/ "C"; - a changed
goline that is indented, or that hides behind a decoy line in an unknown block.
- cgo imported as
-
Screening, two passes per case,
deps-upstreamand zoekt-1038, before the full run. With this clause, every run was as expected (18 of 18). With "a new unused string constant" instead, zoekt-1039 was raised once, so that wording was dropped. -
B3, the full run.
git:origin/mainagainst this branch, three passes per case, with !104 (closed)'s scorecard merged into a scratch tree. 294 Duo sessions, and 8 more to rerun one case. The flow it scored is byte-identical to this branch'sflows/deps.yml. -
deps-upstream, 72 sessions:zoekt-1068-upstreamis unbuilt in all three passes, andes-indexer-871-upstreamis judgedlowin all three. Both are labelledlowand approved.- Every case labelled
raise,checkorincompletegoes to a person in every pass. - Judge as expected is 27/27, fetch as expected 9/9, and approvable cases approved 15/15.
- All 24 judge answers are one JSON object naming a tier.
- Nothing ends less cautious than on
main, and the stage lowers no run.
-
deps-pilots, 222 sessions:- No run approves a case that has to go to a person.
- Judge as expected is 9/9: zoekt-1038 is judged
medium, and zoekt-1073 and zoekt-1059 are unbuilt and approved. Fetch as expected is 24/24. The stage lowers no run. es-indexer-863is labelledmediumin all three passes, againsthighonmain. It is the one case the scorecard lists as less cautious. This MR doesn't cause it:- The classifier answered
medium, and the stage skipped the case, since only alowreaches it. The classifier's prompt and component are byte-identical in both flows. - Four more passes each gave
mainM1 H3 and this branch M2 H2. - In !99 (closed)'s B3 rerun the split went the other way:
mainM2 H1, !99 (closed) H3. - Both tiers label the bump for a person to approve. Its label is
high.
- The classifier answered
- In one pass, zoekt-1039's classifier answered
low.raise_below_oneraised it tomedium, the label all three ofmain's passes give it.
Known limits
- Consumers below Go 1.17. Their
go.modneed not list every module the build selects. So a dependency'sgo.modthat raises another module's version can raise what the consumer builds, without touching the consumer'sgo.mod. It shows only in the consumer'sgo.sum, which the model reads. The judge rates a version bumplowas well, so the stage didn't catch this before either. - Code that reads its own module's files at run time, for example through
runtime.Callerpaths into the module cache. This can't happen in a binary built from the module, but it can under the consumer'sgo testorgo run. - Headroom. With !95 (closed), !96 (merged) and !101 (closed),
flows/deps.ymlhas about 22 bytes left. The gem and npm upstream work will need room of its own.