Report Git errors when red-green cannot build a side #3251

Merged
merzleckeier merged 2 commits from upstream-pr/3251 into main 2026-12-03 15:39:11 +00:00
merzleckeier commented 2026-12-02 22:33:51 +00:00 (Migrated from github.com)

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.py used 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. With merge.verifySignatures=true, an unsigned synthetic branch reproduced a false red 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

  • Regression failed on 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.
  • Linux 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.
  • In a separate local combination with #3203, #3224, #3227 and #3245: 44 passed, one Windows-only skip. The PR itself has no dependencies.
  • git diff --check and the clean-room file check passed. The PR merges cleanly with main at 16243cd6e.

GPUs tested: n/a.

AI-assisted: OpenAI Codex with a separate read-only GPT-6.2 Sol review.

Checklist

  • Merges cleanly with current main.
  • One topic.
  • No game data, keys or decryption.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5615907283 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3251). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-02T22:33:51Z. --- Claimed in the coordination issue as [TEST-RED-GREEN-GIT-APPLY-ERROR](https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7360776789). ### What and why `red_green.py` used 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. With `merge.verifySignatures=true`, an unsigned synthetic branch reproduced a false `red 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 - Regression failed on `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. - Linux `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. - In a separate local combination with #3203, #3224, #3227 and #3245: 44 passed, one Windows-only skip. The PR itself has no dependencies. - `git diff --check` and the clean-room file check passed. The PR merges cleanly with `main` at `16243cd6e`. GPUs tested: n/a. AI-assisted: OpenAI Codex with a separate read-only GPT-6.2 Sol review. ### Checklist - [x] Merges cleanly with current `main`. - [x] One topic. - [x] No game data, keys or decryption.
fiestorra commented 2026-12-02 22:47:11 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-02T22:47:11Z.


VERIFY-3251 — Windows nativo: red then green en su commit propio

Own commit 3da59c5e0 — scripts/red_green.py (+18/−6), tests/test_red_green.py (+15)
Branch carries the same long stack as its neighbours (frame.rs, the launcher exit codes, …); this review is of the commit above

Ran at the branch head

python -I tests/test_red_green.py      Ran 41 tests in 85.4s — OK

Negative control: scripts/red_green.py from the parent of 3da59c5e0 (the file, the technique that works when a commit sits on others that touch the same lines):

FAIL: test_a_rejected_merge_does_not_run_the_base_as_green
Ran 41 tests — FAILED (failures=1)

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 git locally and pass here.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7361158569 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3251#issuecomment-7361158569). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-02T22:47:11Z. --- ## VERIFY-3251 — Windows nativo: `red then green` en su commit propio | | | |---|---| | Own commit | `3da59c5e0` — `scripts/red_green.py` (+18/−6), `tests/test_red_green.py` (+15) | | Branch | carries the same long stack as its neighbours (`frame.rs`, the launcher exit codes, …); this review is of the commit above | **Ran at the branch head** ``` python -I tests/test_red_green.py Ran 41 tests in 85.4s — OK ``` **Negative control**: `scripts/red_green.py` from the **parent of `3da59c5e0`** (the file, the technique that works when a commit sits on others that touch the same lines): ``` FAIL: test_a_rejected_merge_does_not_run_the_base_as_green Ran 41 tests — FAILED (failures=1) ``` **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 `git` locally and pass here. Written with an AI assistant.
merzleckeier commented 2026-12-02 22:49:42 +00:00 (Migrated from github.com)

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/head at 3da59c5e0 and upstream main at 16243cd6. The merge base is b83ad5433. git log 16243cd6..3da59c5e0 lists exactly one commit, and git diff --name-only 16243cd6...3da59c5e0 lists scripts/red_green.py and tests/test_red_green.py. The frame changes from #3204 and the exit propagation from #3210 already landed on main; 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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7361212067 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3251#issuecomment-7361212067). Originally posted by [merzleckeier](https://github.com/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/head` at `3da59c5e0` and upstream `main` at `16243cd6`. The merge base is `b83ad5433`. `git log 16243cd6..3da59c5e0` lists exactly one commit, and `git diff --name-only 16243cd6...3da59c5e0` lists `scripts/red_green.py` and `tests/test_red_green.py`. The frame changes from #3204 and the exit propagation from #3210 already landed on `main`; 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.
aegish-zagi commented 2026-12-03 04:54:46 +00:00 (Migrated from github.com)

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 conflicts
Tests 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)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7368175053 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3251#issuecomment-7368175053). Originally posted by [aegish-zagi](https://github.com/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 3da59c5e086470a201e9344b375d9fa5fe97827c | merged cleanly with current main (d9b618f10) in a scratch worktree, no conflicts Tests 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)
merzleckeier commented 2026-12-03 05:01:45 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-03T05:01:45Z.


Thanks @aegish-zagi. I reproduced the same 0 instead of 2 on 3da59c5e by supplying an inherited Git config value of merge.verifySignatures=false. That overrides the fixture’s local setting and allows the real merge to succeed.

3ffe8d08 passes --verify-signatures directly 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 current main still 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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7368297266 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3251#issuecomment-7368297266). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-03T05:01:45Z. --- Thanks @aegish-zagi. I reproduced the same `0 instead of 2` on `3da59c5e` by supplying an inherited Git config value of `merge.verifySignatures=false`. That overrides the fixture’s local setting and allows the real merge to succeed. `3ffe8d08` passes `--verify-signatures` directly 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 current `main` still 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.
DeadlyChirp commented 2026-12-03 05:47:49 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by DeadlyChirp on 2026-12-03T05:47:49Z.


Independent Windows verification on PR head 3ffe8d08eda0117d1c5e0dd6587142404fcc82c3 and current main d9b618f10150f275c30088e4769c1acbf1d8d689:

  • On a scratch merge of current main with this PR, py -3.12 -I tests/test_red_green.py ran 41 tests — OK.
  • The focused regression passes on the PR head: py -3.12 -I tests/test_red_green.py Python.test_a_rejected_merge_does_not_run_the_base_as_green — 1 OK.
  • Red control: I put the PR test file next to the scripts/red_green.py from current main and ran that same focused test. It fails as expected: AssertionError: 0 != 2; the fixture's git merge --verify-signatures is rejected, but current main reports red then green and 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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7369123262 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3251#issuecomment-7369123262). Originally posted by [DeadlyChirp](https://github.com/DeadlyChirp) on 2026-12-03T05:47:49Z. --- Independent Windows verification on PR head `3ffe8d08eda0117d1c5e0dd6587142404fcc82c3` and current `main` `d9b618f10150f275c30088e4769c1acbf1d8d689`: - On a scratch merge of current `main` with this PR, `py -3.12 -I tests/test_red_green.py` ran **41 tests — OK**. - The focused regression passes on the PR head: `py -3.12 -I tests/test_red_green.py Python.test_a_rejected_merge_does_not_run_the_base_as_green` — **1 OK**. - Red control: I put the PR test file next to the `scripts/red_green.py` from current `main` and ran that same focused test. It fails as expected: `AssertionError: 0 != 2`; the fixture's `git merge --verify-signatures` is rejected, but current `main` reports `red then green` and 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.
lixonik commented 2026-12-03 06:34:19 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-12-03T06:34:19Z.


Windows native verification (red -> green) -- PASS on head 3ffe8d08e (merged cleanly via git merge --no-ff onto main d9b618f10).

Checks (Windows 10 x64, Python 3.12, PowerShell 5.1)

  • python -I scripts/check_no_game_data.py -> PASS
  • Green:
    • python -I tests/test_red_green.py -v -> Ran 41 tests in 73.418s / OK
  • Red (reverted scripts/red_green.py to main d9b618f10, keeping the PR's tests):
    • tests/test_red_green.py -> Ran 41 tests in 74.612s / FAILED (failures=1) (exit 1)

AI-assisted: yes (Antigravity -- Gemini 4 Neon).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7369984691 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3251#issuecomment-7369984691). Originally posted by [lixonik](https://github.com/lixonik) on 2026-12-03T06:34:19Z. --- **Windows native verification (`red -> green`) -- PASS** on head `3ffe8d08e` (merged cleanly via `git merge --no-ff` onto `main` `d9b618f10`). ### Checks (Windows 10 x64, Python 3.12, PowerShell 5.1) - `python -I scripts/check_no_game_data.py` -> **PASS** - **Green:** - `python -I tests/test_red_green.py -v` -> **Ran 41 tests in 73.418s / OK** - **Red** (reverted `scripts/red_green.py` to `main` `d9b618f10`, keeping the PR's tests): - `tests/test_red_green.py` -> **Ran 41 tests in 74.612s / FAILED (failures=1)** (exit `1`) AI-assisted: yes (Antigravity -- Gemini 4 Neon).
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!3251
No description provided.