codebase-memory-mcp icon indicating copy to clipboard operation
codebase-memory-mcp copied to clipboard

fix(install): accept flat Windows release archives without payload wrapper (#1257)

Open skbs-eng opened this issue 4 months ago • 1 comments

Fixes #1257

Problem

install.ps1's archive namespace check strictly required codebase-memory-mcp.payload.exe to exist as a separate entry in the release zip. In release builds where codebase-memory-mcp.exe is packaged as a flat standalone binary without a separate *.payload.exe entry (such as the v0.9.0 windows-arm64 and windows-amd64 UI archives), install.ps1 aborted with: \rror: unsafe or incomplete release archive: archive must contain exactly one codebase-memory-mcp.payload.exe\

Fix

  • Updated install.ps1 archive layout validation to require codebase-memory-mcp.exe, LICENSE, install.ps1, and THIRD_PARTY_NOTICES.md, while allowing codebase-memory-mcp.payload.exe to be optional (0 or 1 instance).
  • If codebase-memory-mcp.payload.exe is missing from the extracted archive, install.ps1 stage-copies codebase-memory-mcp.exe to codebase-memory-mcp.payload.exe in the temporary directory prior to executing the launcher installation.
  • Updated ests/test_windows_bundle_contract.sh static contract checks to reflect the updated archive bounds.

Validation

  • Verified with python contract test script (\ est_windows_bundle_contract.sh).
  • Tested \install.ps1\ archive extraction against both 4-file (flat layout) and 5-file (pair layout) zip archives.

skbs-eng avatar Jul 25 '26 08:07 skbs-eng

Thank you for the contribution and for validating both Windows archive layouts. This is now triaged as a high-priority Windows installation bug for 0.9.1-rc. Current main already contains an overlapping fix for #1257, so review will determine whether this branch still contains any distinct work. Our community PR queue is currently quite full, so it may take a little time before we can complete that review. We are doing our best to support community contributions and will return with code-grounded feedback as capacity opens.

DeusData avatar Jul 28 '26 19:07 DeusData

Thank you — your diagnosis of #1257 was correct, and I am sorry this sat long enough for the ground to move under it.

The reason I am closing rather than asking for a rebase is that a rebase would leave nothing to apply. #1257 was fixed on main by a more radical route: the launcher/payload pair is gone entirely. Windows now ships one binary, install.ps1 has no payload concept left in it (the allowlist is an exact four-entry set), and package-release.sh zips precisely those four members. The commit that did it is a54ea95, with b0eae97 and afd67c5 following on. Your PR's hunks anchor to code that no longer exists, which is why GitHub shows it as conflicting, and #1257 is already closed.

One thing I want to flag honestly, because it is useful feedback rather than criticism: the shim relaxed the archive guard from an exact allowlist to a range check, and softened the contract test's assertion from an equality to a bound. That guard exists specifically to stop an attacker-controlled extra member riding along in a release archive, so even as a compatibility measure it would have traded away a little more than it gained. Nothing about it was careless — it is simply the kind of trade worth naming out loud when the thing being loosened is a security guard.

Genuinely appreciated: you found a real packaging break and reported it precisely. Closing as already fixed.

DeusData avatar Jul 30 '26 23:07 DeusData