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 the client_model version bump in labkit's go.mod, or a cgroup collector that only the release notes describe. The diff itself changes CI, docs, a build script, go.mod versions and go.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.mod other than the versions of modules it already requires. That includes the go line, indented or not, a new or removed requirement, and a replace.
  • Where every changed file counts. If the module has C, assembly, SWIG, Fortran or .syso files, a //go:embed, or a quoted C in its non-test Go, then every changed file counts. Unchanged source can read any file through those, and a quoted C catches cgo's import "C" however it is written.
  • Why go.mod versions don't count.
    • bump already checks that the consumer's go.mod moves only this module.
    • From Go 1.17, a consumer's go.mod lists every module its build selects, so a version in the dependency's go.mod selects nothing new.
  • Fails closed.
    • Only an explicit false skips the judge, and only after the checksum and red-flag checks pass.
    • A missing, null or garbled built goes to the judge path. With no answer from the judge, that path raises the tier to medium.
  • 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.mod versions, and all three are labelled keep.
    • 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 go line, 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_tier and decide_labels already share a step. They are now packed as one script, so they share one loader and one deflate dictionary.
  • DecideLabels.main runs in an ensure, so a bump is still labelled severe when keep_higher_tier raises, as it was when a ; separated them. A spec forces keep_higher_tier to raise and checks the labels.
  • bin/compile's script takes run:, the steps whose main it calls, and refuses a name it wasn't given.
  • The loader calls Zlib.inflate, which is Zlib::Inflate.inflate under a shorter name, on every Ruby a runner may have.

4. Eval.

  • The saved upstream output in deps-pilots and deps-upstream gains built, as the fetch writes it now.
  • For zoekt-1059, 1068 and 1073, and for zoekt-1068-upstream, the route becomes skip and the saved stdout becomes empty.
  • undocumented-change and text-for-the-judge plant a Go hunk on labkit releases that changed no Go, so their saved built is set to true by hand, as the fetch would set it. The suite's header says so.
  • The scorecard reads built: false as a new unbuilt outcome, which a keep case 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 touches keep_higher_tier or decide_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.yml and 72 off flows/mr-risk.yml.

Validation

  • make check fails only on main'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/SelectByKind in src/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-pilots cases that save upstream output.

    • The output matches the saved files byte for byte, built included.
    • Only zoekt-1059, 1068 and 1073 are unbuilt.
  • 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" or import /**/ "C";
    • a changed go line that is indented, or that hides behind a decoy line in an unknown block.
  • Screening, two passes per case, deps-upstream and 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/main against 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's flows/deps.yml.

  • deps-upstream, 72 sessions:

    • zoekt-1068-upstream is unbuilt in all three passes, and es-indexer-871-upstream is judged low in all three. Both are labelled low and approved.
    • Every case labelled raise, check or incomplete goes 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-863 is labelled medium in all three passes, against high on main. 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 a low reaches it. The classifier's prompt and component are byte-identical in both flows.
      • Four more passes each gave main M1 H3 and this branch M2 H2.
      • In !99 (closed)'s B3 rerun the split went the other way: main M2 H1, !99 (closed) H3.
      • Both tiers label the bump for a person to approve. Its label is high.
    • In one pass, zoekt-1039's classifier answered low. raise_below_one raised it to medium, the label all three of main's passes give it.

Known limits

  • Consumers below Go 1.17. Their go.mod need not list every module the build selects. So a dependency's go.mod that raises another module's version can raise what the consumer builds, without touching the consumer's go.mod. It shows only in the consumer's go.sum, which the model reads. The judge rates a version bump low as 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.Caller paths into the module cache. This can't happen in a binary built from the module, but it can under the consumer's go test or go run.
  • Headroom. With !95 (closed), !96 (merged) and !101 (closed), flows/deps.yml has about 22 bytes left. The gem and npm upstream work will need room of its own.

🤖 Generated with Claude Code

Merge request reports

Loading
Loading