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 <martin.vogel.tech@gmail.com>
This commit is contained in:
Martin Vogel
2026-07-26 06:56:11 +02:00
parent 80ea64a7dc
commit 82f36713bb
+11 -1
View File
@@ -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