From 82f36713bb7e9c9b2ebfd6fc0b43baa297d522b1 Mon Sep 17 00:00:00 2001 From: Martin Vogel Date: Sun, 26 Jul 2026 06:56:11 +0200 Subject: [PATCH] fix(guards): stage a fresh portable pair for the immediate-reinstall check The immediate-reinstall guard reused the portable pair from work/portable-install, whose adjacent launcher the earlier managed installs consume. Managed install then refuses correctly -- 'requires a verified adjacent codebase-memory-mcp.exe launcher' -- so the guard was failing on the product behaving as designed rather than on the contract it protects. Reproduced by running the install command directly (exit 1, that exact error) and confirmed identical on origin/main, so this was never a regression from this branch. Stages its own pair, leaving the assertions untouched. Signed-off-by: Martin Vogel --- tests/windows/test_windows_launcher.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/windows/test_windows_launcher.py b/tests/windows/test_windows_launcher.py index 9183f5afb..1a1d346c0 100644 --- a/tests/windows/test_windows_launcher.py +++ b/tests/windows/test_windows_launcher.py @@ -1566,8 +1566,18 @@ def main(): source_launcher, source_payload, launcher, env, cache, work ) assert_failed_uninstall_restores_state(launcher, managed_dir, env) + # Stage a FRESH portable pair: the earlier managed installs consume the + # launcher sitting beside work/portable-install's payload, and a managed + # install legitimately refuses a payload with no verified adjacent + # launcher ("managed install requires a verified adjacent + # codebase-memory-mcp.exe launcher"). Reusing the consumed pair made this + # guard fail on the product's correct behaviour rather than on the + # immediate-reinstall contract it exists to protect. + _, reinstall_payload = copy_portable_pair( + source_launcher, source_payload, work / "portable-reinstall" + ) assert_uninstall_immediate_reinstall_safe( - launcher, managed_dir, portable_payload, env + launcher, managed_dir, reinstall_payload, env ) print("\nGREEN: permanent Windows launcher contract honored.") return 0