Include PowerShell changes in red-green mutations #3227

Merged
merzleckeier merged 1 commit from upstream-pr/3227 into main 2026-12-03 16:10:21 +00:00
merzleckeier commented 2026-12-02 21:13:38 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-02T21:13:38Z.


Claimed in the coordination issue as TEST-RED-GREEN-POWERSHELL-MUTATIONS.

What and why

red_green.py --mutate already runs Python regression tests for launcher changes. It used to leave changed PowerShell scripts out of the hunks it reverses. Include .ps1 files outside the tests in the existing mutation workflow and document the added coverage.

Tested

  • A synthetic repository with *.ps1 text eol=crlf reports red then green on both checker versions. The old checker reports no mutation. With this change, it reverses the status-line change and the fixture reports the mutation as caught.
  • On Linux, 40 checker tests passed (one platform-specific skip), and all 59 documentation checks passed. The new fixture also passed on Windows CPython 3.12.10 under Wine 11.22 with MinGit.
  • A clean local combination with #3224 at 22e03b5e checked the real #3220 head 0beb7d26 on main 8877be37 with PowerShell 7.7.0. It reports red then green and catches all four PowerShell hunks independently.
  • The clean-room and whitespace checks passed.

GPUs tested: n/a (synthetic Git fixtures and PowerShell runs).

AI-assisted: OpenAI GPT-6.2 through Codex. GPT-6.2 Sol independently reviewed the exact head read-only and verified that the reverse patch preserves CRLF.

Checklist

  • Based on upstream main at 8877be37.
  • One topic.
  • Synthetic fixtures only.
  • Translator rule: n/a.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5614813585 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3227). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-02T21:13:38Z. --- Claimed in the coordination issue as [TEST-RED-GREEN-POWERSHELL-MUTATIONS](https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7358895607). ### What and why `red_green.py --mutate` already runs Python regression tests for launcher changes. It used to leave changed PowerShell scripts out of the hunks it reverses. Include `.ps1` files outside the tests in the existing mutation workflow and document the added coverage. ### Tested - A synthetic repository with `*.ps1 text eol=crlf` reports `red then green` on both checker versions. The old checker reports no mutation. With this change, it reverses the status-line change and the fixture reports the mutation as `caught`. - On Linux, 40 checker tests passed (one platform-specific skip), and all 59 documentation checks passed. The new fixture also passed on Windows CPython 3.12.10 under Wine 11.22 with MinGit. - A clean local combination with #3224 at `22e03b5e` checked the real #3220 head `0beb7d26` on `main` `8877be37` with PowerShell 7.7.0. It reports `red then green` and catches all four PowerShell hunks independently. - The clean-room and whitespace checks passed. GPUs tested: n/a (synthetic Git fixtures and PowerShell runs). AI-assisted: OpenAI GPT-6.2 through Codex. GPT-6.2 Sol independently reviewed the exact head read-only and verified that the reverse patch preserves CRLF. ### Checklist - [x] Based on upstream `main` at `8877be37`. - [x] One topic. - [x] Synthetic fixtures only. - Translator rule: n/a.
fiestorra commented 2026-12-02 21:32:16 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-02T21:32:16Z.


VERIFY-3227 — Windows nativo: red then green, y la rama trae #3204 dentro

Head acfda765c
Merge base b41763227 = current main
Estado the branch contains #3204's frame.rs change (3 occurrences of CAP_UNREAD; main has none)

Ran

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

Negative control: reverting acfda765c's own hunks with git apply -R does not apply (the file also carries #3224's change on the same lines), so I took the file as it was at the parent commit instead (git show acfda765c^:scripts/red_green.py):

FAIL: test_a_powershell_fix_undone_with_crlf_checkout_is_caught
FAIL: test_a_test_only_pull_request_has_nothing_to_undo
Ran 41 tests — FAILED (failures=2)

That is the right red, and the first of the two is the case this repository needs: a PowerShell fix undone with a CRLF checkout is caught. The tool mutates the changed lines and checks that the tests catch it; on a Windows checkout the line endings are CRLF, and a mutation tool that cannot rewrite a CRLF file would silently report "no red" — the same class of false verdict as #3188's two.

Two things for whoever merges:

  1. The branch carries #3204's frame.rs change, which is still open. Merging this lands both; the same happens with #3200 and #3132. It is a pattern tonight, not a one-off — the stacked PRs need merge-order discipline.
  2. #3224 and #3227 both edit scripts/red_green.py (different regions; git merge-tree between the two branches is clean), but whichever lands second will need a rebase to see the other's tests. I would land #3224 first, then this.

What I could not test: an end-to-end red_green.py <pr> run whose PowerShell fix is reverted on a real pull request; the tests build the repository synthetically.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7359420080 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3227#issuecomment-7359420080). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-02T21:32:16Z. --- ## VERIFY-3227 — Windows nativo: `red then green`, y **la rama trae #3204 dentro** | | | |---|---| | Head | `acfda765c` | | Merge base | `b41763227` = current `main` | | Estado | the branch **contains #3204's `frame.rs` change** (3 occurrences of `CAP_UNREAD`; `main` has none) | **Ran** ``` python -I tests/test_red_green.py Ran 41 tests in 93.6s — OK ``` **Negative control**: reverting `acfda765c`'s own hunks with `git apply -R` **does not apply** (the file also carries #3224's change on the same lines), so I took the file as it was **at the parent commit** instead (`git show acfda765c^:scripts/red_green.py`): ``` FAIL: test_a_powershell_fix_undone_with_crlf_checkout_is_caught FAIL: test_a_test_only_pull_request_has_nothing_to_undo Ran 41 tests — FAILED (failures=2) ``` **That is the right red**, and the first of the two is the case this repository needs: **a PowerShell fix undone with a CRLF checkout is caught**. The tool mutates the changed lines and checks that the tests catch it; on a Windows checkout the line endings are CRLF, and a mutation tool that cannot rewrite a CRLF file would silently report "no red" — the same class of false verdict as #3188's two. **Two things for whoever merges**: 1. **The branch carries #3204's `frame.rs` change**, which is still open. Merging this lands both; the same happens with #3200 and #3132. It is a pattern tonight, not a one-off — the stacked PRs need merge-order discipline. 2. **#3224 and #3227 both edit `scripts/red_green.py`** (different regions; `git merge-tree` between the two branches is clean), but whichever lands second will need a rebase to see the other's tests. I would land #3224 first, then this. **What I could not test**: an end-to-end `red_green.py <pr>` run whose PowerShell fix is reverted on a real pull request; the tests build the repository synthetically. Written with an AI assistant.
merzleckeier commented 2026-12-02 21:53:37 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-02T21:53:37Z.


Thanks for the native Windows run. I checked the base on current upstream f3865cae. #3204 already landed in main as 8d82a34a, an ancestor of both main and this branch. Their merge base is 8877be37; the three-dot diff for acfda765c contains only scripts/red_green.py, tests/test_red_green.py and docs/testing.md. #3224 also merges cleanly with this head. Together they ran on the real #3220 head: red then green, with all four PowerShell hunks independently caught by the launcher regression. Run details. AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7359932257 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3227#issuecomment-7359932257). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-02T21:53:37Z. --- Thanks for the native Windows run. I checked the base on current upstream `f3865cae`. #3204 already landed in `main` as `8d82a34a`, an ancestor of both `main` and this branch. Their merge base is `8877be37`; the three-dot diff for `acfda765c` contains only `scripts/red_green.py`, `tests/test_red_green.py` and `docs/testing.md`. #3224 also merges cleanly with this head. Together they ran on the real #3220 head: `red then green`, with all four PowerShell hunks independently `caught` by the launcher regression. [Run details](https://github.com/ProjectLeonida/mandy/pull/3220#issuecomment-7358990565). AI-assisted.
merzleckeier commented 2026-12-03 00:29:01 +00:00 (Migrated from github.com)

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


Integration check on main at d5b30be1: I combined the five open Red/Green changes #3203 (d7deb51a), #3224 (22e03b5e), #3227 (acfda765), #3245 (b5520eb8) and #3251 (3da59c5e). They apply cleanly. The combined checker suite passed 44 tests under Linux and skipped the Windows job-object test.

I then ran the combined checker on the actual launcher preflight patch #3220 (0beb7d26), with Linux PowerShell 7.7.0. It reports red then green, with no new failures. All four PowerShell mutations at lines 106, 146, 151 and 161 were caught by the preflight regression. The checker ran offline in a disposable clone using synthetic launcher fixtures. AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7363242102 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3227#issuecomment-7363242102). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-03T00:29:01Z. --- Integration check on `main` at `d5b30be1`: I combined the five open Red/Green changes #3203 (`d7deb51a`), #3224 (`22e03b5e`), #3227 (`acfda765`), #3245 (`b5520eb8`) and #3251 (`3da59c5e`). They apply cleanly. The combined checker suite passed 44 tests under Linux and skipped the Windows job-object test. I then ran the combined checker on the actual launcher preflight patch #3220 (`0beb7d26`), with Linux PowerShell 7.7.0. It reports `red then green`, with no new failures. All four PowerShell mutations at lines 106, 146, 151 and 161 were caught by the preflight regression. The checker ran offline in a disposable clone using synthetic launcher fixtures. AI-assisted.
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!3227
No description provided.