Report Git errors when red-green cannot build a side #3251
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3251"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-02T22:33:51Z.
Claimed in the coordination issue as TEST-RED-GREEN-GIT-APPLY-ERROR.
What and why
red_green.pyused the absence of unmerged files as evidence that Git had applied the cherry-pick or merge. Git can reject an operation without leaving unmerged files. Withmerge.verifySignatures=true, an unsigned synthetic branch reproduced a falsered then green: Git refused the merge and the unchanged base passed under the same test name.Check the Git command first. If it fails, unmerged paths still produce the existing conflict verdicts. Other failures report the Git error and exit 2, using the existing worktree cleanup.
Tested
main(b83ad5433) with exit 0. With this fix the checker reports the signature rejection, exits 2 and never starts the green tests. The synthetic repository still enforces the signature policy.python3 -I tests/test_red_green.py -v: 40 passed, one Windows-only skip. The targeted regression also passed with Windows Python and MinGit under Wine.git diff --checkand the clean-room file check passed. The PR merges cleanly withmainat16243cd6e.GPUs tested: n/a.
AI-assisted: OpenAI Codex with a separate read-only GPT-6.2 Sol review.
Checklist
main.Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-02T22:47:11Z.
VERIFY-3251 — Windows nativo:
red then greenen su commit propio3da59c5e0—scripts/red_green.py(+18/−6),tests/test_red_green.py(+15)frame.rs, the launcher exit codes, …); this review is of the commit aboveRan at the branch head
Negative control:
scripts/red_green.pyfrom the parent of3da59c5e0(the file, the technique that works when a commit sits on others that touch the same lines):The new test bites, and it is the sharpest of the four red-green pull requests tonight: the fixture makes Git itself refuse the merge (
merge.verifySignatures=true), and asserts the tool exits 2 with the Git error and does not print "green side…" — because with two tests of the same name, the base's test would pass as if it were the green one, which is the worst verdict this tool can give: a fix that is not there, reported as verified.What the change is: when a side cannot be built, the Git error is reported instead of the run going on to measure the wrong tree.
The pattern of tonight, and it is worth a sentence
Four of the pull requests I verified are hardening
red_green.py(#3224, #3227, #3245, #3251), and each one closes a way the verdict can lie: a skipped subtest, a mutation the tool could not rewrite, a skipped test counted as passing, and now a refused merge read as green. I have been using this tool all night to judge other people's work — these four are the reason its answers can be trusted.Eighth stacked branch, same advice as #3245: isolate the first-parent commit.
What I could not test: the same situations inside the real workflow, with a token and a runner; the tests build the repositories with
gitlocally and pass here.Written with an AI assistant.
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-02T22:49:42Z.
Thanks for running all 41 tests on native Windows and confirming the parent-file control. I rechecked the branch ancestry using GitHub’s
refs/pull/3251/headat3da59c5e0and upstreammainat16243cd6. The merge base isb83ad5433.git log 16243cd6..3da59c5e0lists exactly one commit, andgit diff --name-only 16243cd6...3da59c5e0listsscripts/red_green.pyandtests/test_red_green.py. The frame changes from #3204 and the exit propagation from #3210 already landed onmain; the heads of #3224 and #3227 are absent from this branch. The native run therefore verifies this PR’s single change on its published base.Imported from ubiquitarianism/leonida. Originally posted by aegish-zagi on 2026-12-03T04:54:46Z.
VERIFY-3251 — FAIL (one of the PR's own new tests fails on the PR)
PR #3251 | head
3da59c5e08| merged cleanly with current main (d9b618f10) in a scratch worktree, no conflictsTests run: tests/test_red_green.py (python -I, stdlib unittest), 41 tests
Green on PR: FAILED (failures=1, skipped=3) — MEASURED. The failure is test_a_rejected_merge_does_not_run_the_base_as_green, a test this PR adds: it expects red_green to exit 2 when the merge of a side is rejected, but red_green exited 0 with verdict 'red then green' (the synthetic merge it expected to be rejected went through in this environment).
Red on main: main's pristine suite is 40 tests OK (skipped=3) — MEASURED; with the PR's test file copied onto main code the same new test fails the same way (failures=1, skipped=3), so the failure is in the PR's new test/behaviour pair, not a merge-with-main regression.
The other 40 tests pass on the PR; the Git-error reporting itself was not exercised by a failing test beyond this case — READ IN CODE.
Platform: Linux, Python 3.12.3, no GPU
AI-assisted: yes (Muse Wonder, Muse by Meta)
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-03T05:01:45Z.
Thanks @aegish-zagi. I reproduced the same
0 instead of 2on3da59c5eby supplying an inherited Git config value ofmerge.verifySignatures=false. That overrides the fixture’s local setting and allows the real merge to succeed.3ffe8d08passes--verify-signaturesdirectly to the fixture’s real Git merge. The full Linux suite ran 41 tests with one platform skip under that inherited override, and the focused regression passed with Windows Python and MinGit under Wine. The same fixture on currentmainstill reproduces the false green after Git rejects the merge. The independent reviewer confirmed that Git exited 128 and that the production script is byte-identical to the prior head. Fresh CI is starting. AI-assisted with OpenAI Codex (GPT-6.2) and GPT-6.2 Sol.Imported from ubiquitarianism/leonida. Originally posted by DeadlyChirp on 2026-12-03T05:47:49Z.
Independent Windows verification on PR head
3ffe8d08eda0117d1c5e0dd6587142404fcc82c3and currentmaind9b618f10150f275c30088e4769c1acbf1d8d689:mainwith this PR,py -3.12 -I tests/test_red_green.pyran 41 tests — OK.py -3.12 -I tests/test_red_green.py Python.test_a_rejected_merge_does_not_run_the_base_as_green— 1 OK.scripts/red_green.pyfrom currentmainand ran that same focused test. It fails as expected:AssertionError: 0 != 2; the fixture'sgit merge --verify-signaturesis rejected, but currentmainreportsred then greenand exits 0. The PR reports the Git failure and exits 2.All branches and merge inputs were synthetic temporary Git repositories. No game data or GPU used. AI-assisted with OpenAI Codex.
Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-12-03T06:34:19Z.
Windows native verification (
red -> green) -- PASS on head3ffe8d08e(merged cleanly viagit merge --no-ffontomaind9b618f10).Checks (Windows 10 x64, Python 3.12, PowerShell 5.1)
python -I scripts/check_no_game_data.py-> PASSpython -I tests/test_red_green.py -v-> Ran 41 tests in 73.418s / OKscripts/red_green.pytomaind9b618f10, keeping the PR's tests):tests/test_red_green.py-> Ran 41 tests in 74.612s / FAILED (failures=1) (exit1)AI-assisted: yes (Antigravity -- Gemini 4 Neon).