Skip to content

fix: validate Windows managed updates through the package entry - #351

Merged
hetaoBackend merged 3 commits into
mainfrom
fix/windows-managed-updater
Sep 24, 2026
Merged

hetaoBackend merged 3 commits into
mainfrom
fix/windows-managed-updater

Conversation

@1anZhang

@1anZhang 1anZhang commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Change

The Windows managed updater validates a staged installation by launching the generated mcode.cmd. A Windows Node 24.14.1 reproduction under Wine failed with exit 9009 when the installation path contained spaces. Resolve the installed package's mcode bin entry and invoke it with the current Node executable, retaining launcher-presence and exact-version checks. Collect child output until close before comparing the version.

Keep npm installation on the existing cross-spawn path so the selected npm launcher retains its environment and argument handling. Reuse the package-bin helpers, and keep managed-install detection available from its existing export while removing the resulting import cycle.

Extend the existing Windows contract with real offline npm installations through McodeUpdateService.apply in a path containing Unicode, spaces, ampersands and parentheses. Cover standard npm and custom wrappers with either an external or adjacent npm CLI. The wrapper cases require the wrapper's environment setting to create the launcher and assert that the wrapper ran.

Related to #346. The reported native Windows failure has not been reproduced through the original production helper; the issue's raw Node reproduction bypasses cross-spawn.

Validation

  • Current head: bba5c12.
  • Focused updater tests on macOS: 84 passed, 5 Windows-only tests skipped. Changed TypeScript lint, test syntax and git diff --check passed.
  • Windows Node 24.14.1 x64 under Wine 10: comparison of the baseline, previous PR head and current head confirms that both custom-wrapper layouts preserve the baseline behavior. The previous PR head fails the adjacent-CLI case; the current head passes.
  • Windows Node 24.14.1 x64 under Wine 10: 9/9 passed for installation, version validation, activation, complex paths and rejection/rollback checks.
  • Local pnpm verify, full profile, macOS arm64 / Node 22.22.2, commit bba5c12: PASS, 15 gates (capability suite: 4,585 passed, 14 skipped).
  • Native Windows verification, Node 24.20.0 x64: PASS, 9 gates and 5 Windows tests, including standard npm, a custom wrapper with an external CLI, and a custom wrapper with an adjacent CLI. The logged tests all execute the production install and validation functions.
  • Current-head source verification: PASS on Windows, Linux and macOS, including the required verification aggregate. Performance (basic), CodeQL and release audit also passed.
  • Wine and offline fixture results are not production release or live-service acceptance. Passing the new implementation on Windows does not establish that the original service fails on native Windows.
  • Performance: basic; managed-update validation does not affect the model tool loop or history processing.

Publication and contribution checks

  • I have permission to contribute these changes under the existing licenses applicable to the changed files/packages; existing notices are preserved and no imported material is added.
  • No credentials, account data, real user content, internal source history or private review material is included.
  • Only existing inventoried files are changed. The regression extends the already-declared Windows suite.
  • No shared documentation or capability contract changes are required. Offline and Wine results are identified as such.

Maintainer handoff

Publication scope and licenses are unchanged.

Shared-source port: pending.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@1anZhang 1anZhang added bug Something isn't working cli Standalone mcode: TUI, headless, ACP and source builds/tooling labels Sep 24, 2026
@1anZhang 1anZhang changed the title fix: run Windows managed updates through Node entry points fix: validate Windows managed updates through the package entry Sep 24, 2026
@hetaoBackend
hetaoBackend merged commit 18e7278 into main Sep 24, 2026
14 checks passed
@hetaoBackend
hetaoBackend deleted the fix/windows-managed-updater branch September 24, 2026 06:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working cli Standalone mcode: TUI, headless, ACP and source builds/tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants