Skip to content

chore: clean up repo, package ARM64 npm targets, and ship Portato installers - #432

Merged
Brooooooklyn merged 1 commit into
mainfrom
chore/repo-cleanup-and-desktop-installers
Nov 28, 2026
Merged

Brooooooklyn merged 1 commit into
mainfrom
chore/repo-cleanup-and-desktop-installers

Conversation

@Brooooooklyn

Copy link
Copy Markdown
Contributor

Summary

Single consolidated commit covering repo cleanup, ARM64 native npm packaging, and desktop release packaging updates for macOS and Windows.

flowchart LR
  A[Repo Cleanup] --> D[Single PR]
  B[ARM64 npm Targets] --> D
  C[Portato Desktop Releases] --> D
  C --> C1["macOS: Portato-<ver>-darwin-arm64.zip"]
  C --> C2["Windows: Portato.exe + win32metadata + AUMID"]
  C --> C3["Windows: Two-pass signed NSIS setup.exe + WinGet nullsoft"]
Loading

1. Repo cleanup

  • Removed legacy scripts/, experiments/, .claude/skills/perf-tracker/, .mlx-agent/workflows/, bench_code_prompt.txt, packages/desktop/spike/, orphaned fixtures/rerank/bge/* (keeping cases.json and manifest.json), and archival docs/research/, docs/validation/, docs/superpowers/specs/, and superseded design specs.
  • Removed unused dependencies/scripts from root, cli, trl, and desktop manifests and synced yarn.lock.
  • Deleted broken tests importing removed scripts/ and fixed dangling references across code, tests, workflows, and docs; rewrote CONTRIBUTING.md and examples/README.md.
  • Moved Rust lib test sharding to .github/scripts/run-rust-lib-shard.ts with pinned Node 26 in _rust-lib-shard.yml, hardened vite.config.ts (Windows paths, **/*.cu.inc fmt ignore), and fixed cargo fmt.

2. ARM64 npm packaging

  • Added packages/core/npm/win32-arm64-msvc (shipping openblas.dll and include/) and enabled both linux-arm64-gnu and win32-arm64-msvc optional dependencies on @mlx-node/core.
  • Updated .github/workflows/ci.yml to verify/upload Windows runtime files and check commit subjects (%s) during release checks.

3. Desktop releases (Portato)

  • macOS: Renamed update ZIP asset from mlx-node-<ver>-darwin-arm64.zip to Portato-<ver>-darwin-arm64.zip (+ .blockmap and latest-mac.yml) while preserving BUNDLE_ID (ai.mlxnode.desktop), updaterCacheDirName, mlx-node data directory, and DMG naming.
  • Windows identity: Renamed packaged executable from mlx-node.exe to Portato.exe, added win32metadata, and set app.setAppUserModelId('ai.mlxnode.desktop') outside Store MSIX.
  • Windows installer: Replaced the portable .zip with a two-pass Authenticode-signed ARM64 NSIS setup installer (Portato-<ver>-win32-arm64-setup.exe, including signed Uninstall.exe):
    • Non-solid zlib compression (< 2 GiB ceiling, fast installs, Komac-compatible).
    • Enforces Windows 11 24H2 (OS build 26100) on ARM64 in .onInit and WinGet MinimumOSVersion: 10.0.26100.0.
    • Refuses to overwrite non-empty non-Portato folders; uses a validated UTF-16LE .portato-manifest.txt for upgrade/uninstall cleanup (preserving user data in %APPDATA%\mlx-node and %USERPROFILE%\.mlx-node, plus any non-manifested files).
    • Scopes running-process shutdown to $INSTDIR PIDs only, sets System.AppUserModel.ID on Start Menu and Desktop shortcuts, and verifies InstallLocation before removing shared shortcuts/ARP entries.
    • Updated WinGet manifests and komac update workflow to nullsoft, added a Windows CI silent install/uninstall smoke test, and preserved the unsigned Microsoft Store .msix workflow artifact.

Verification

  • yarn typecheck & yarn lint (0 warnings, 0 errors)
  • vp test run --project pure-ts --project darwin-ts (371 passed / 8,660 tests, including all 46 desktop test files / 709 tests)
  • cargo fmt --all -- --check, cargo check -p mlx-core --lib --tests, cargo test -p mlx-core --lib marker_sanitizer_list_matches_spec_token_table
  • Workflow YAML validation (ruby -ryaml) & actionlint
  • oxnode packages/desktop/scripts/check-release.ts resolve --manifest packages/desktop/package.json
  • 4 rounds of local Codex adversarial review (gpt-6.2-sol)

Note

Before cutting the next npm release tag, make sure npm Trusted Publishing is configured for @mlx-node/core-linux-arm64-gnu and @mlx-node/core-win32-arm64-msvc.

@coderabbitai

coderabbitai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b7b3e2d8-0d34-4066-953a-ac1db7a4cf9b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-28T04:57:38.823265Z 8c0f1ff PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

…tallers

- Repo cleanup: remove legacy scripts/, experiments/, archival research/validation/spec docs, desktop spike, orphaned BGE fixtures, broken script-importing tests, and unused deps/scripts; fix dangling references, rewrite CONTRIBUTING.md and examples/README.md, move Rust shard runner to .github/scripts/run-rust-lib-shard.ts, and harden vite.config.ts.
- ARM64 npm packaging: add @mlx-node/core-win32-arm64-msvc (with openblas.dll and include/), enable Linux/Windows ARM64 optionalDependencies, and fix CI artifact upload/verification and release version checks.
- Desktop release (macOS & Windows):
  - Rename macOS update ZIP to Portato-<ver>-darwin-arm64.zip while keeping bundle ID ai.mlxnode.desktop and mlx-node data dir.
  - Rename Windows executable to Portato.exe with win32metadata and explicit AppUserModelID outside Microsoft Store MSIX.
  - Replace the Windows portable ZIP with a two-pass Authenticode-signed ARM64 NSIS setup installer (Portato-<ver>-win32-arm64-setup.exe), update WinGet manifests to nullsoft (MinimumOSVersion 10.0.26100.0), add a silent install/uninstall CI smoke test, and keep the unsigned Store MSIX workflow artifact.
@Brooooooklyn
Brooooooklyn force-pushed the chore/repo-cleanup-and-desktop-installers branch from 8c0f1ff to d9ea35c Compare November 28, 2026 05:21
@Brooooooklyn
Brooooooklyn merged commit 8648ce7 into main Nov 28, 2026
20 checks passed
@Brooooooklyn
Brooooooklyn deleted the chore/repo-cleanup-and-desktop-installers branch November 28, 2026 05:47
Brooooooklyn added a commit that referenced this pull request Nov 29, 2026
## Problem

The v0.0.25 Desktop Release ([run
46222864673](https://github.com/mlx-node/mlx-node/actions/runs/46222864673))
failed in `Package Windows ARM64` on both attempts with the same error:

```
Error: EPERM, Permission denied: 'C:\a\mlx-node\mlx-node\packages\desktop\out\.nsis-uninst\.nsis-uninst-stage'
    at rmSync (node:fs:1593:18)
    at buildWindowsUninstaller (packages/desktop/scripts/windows-nsis.ts:763:5)
```

The two-pass NSIS signing code from #432 never ran in a desktop release
before v0.0.25. The `finally` block removes the stage dir about 1 s
after `uninst-gen.exe` exits, and Windows still holds a handle on that
freshly written and executed exe.

npm 0.0.25 is published; only the desktop installers are blocked.

## Fix

```
pre-clean (before each build)   rmSync + retries        → still throws (needs a clean stage)
finally   (after each build)    rmSync + retries        → on failure: warn, continue
```

- `rmSync` gets `maxRetries: 10, retryDelay: 250` (about 14 s with
linear back-off). Node retries `EPERM`/`EBUSY` only with `maxRetries`.
- In the two `finally` blocks, a handle that outlives the retries only
warns. The stage dir is outside `appPath`, and later steps use only the
exact `Uninstall.exe` path (`package-windows.ts:303-325`,
`desktop-release.yml:360-367`), so a leftover dir is never packaged or
signed.

## Verification

- `windows-nsis.test.ts`: 11 passed. Typecheck and format are clean.
- The Windows job uses the `desktop-release` environment (only `main`
and `v*`), so a branch dry run cannot run it. After merge, I will
dispatch a desktop dry run from `main` (`dry_run=true`,
`sign_windows=false`) to prove the Windows packaging, then cut 0.0.26.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Brooooooklyn added a commit that referenced this pull request Nov 29, 2026
… test (#441)

## Summary

The desktop dry run from `main`
([46233085390](https://github.com/mlx-node/mlx-node/actions/runs/46233085390))
failed in "Smoke-test silent NSIS install and uninstall" with
`Uninstall.exe was not self-removed after silent uninstall`. The
installer came with #432, and no CI run reached this step before.

The uninstaller works. The smoke test stopped waiting too early:

```
Uninstall.exe /S  (launcher)
  ├─ copies itself to %TEMP%\~nsuN.tmp\Un.exe
  ├─ starts "Un.exe /S _?=<dir>"
  └─ exits 0 at once            <- the old test watched only this, for 60 s
Un.exe                          <- does the real uninstall (~8,400 manifest entries)
  └─ removes files, ARP key, shortcuts, Uninstall.exe   (~75-80 s at CI speed)
```

- **Smoke test:** it waits for the launcher, then finds its ` _?=` child
by `ParentProcessId`. It waits up to 10 minutes for the child and fails
on a non-zero exit code, with a list of the files left. All the old file
and registry checks still run after that.
- **Uninstaller:** it exits 1 when `Uninstall.exe` is still there after
the final `Delete`. Before, a locked `Uninstall.exe` left the copy
exiting 0, so the failure was silent.

## Verification

I ran the exact step script on a real Windows 11 ARM64 machine, over SSH
(non-interactive, like the runner). The payload was the v0.0.24 app
(7,618 files, 1.86 GB, signatures stripped). A CPU cap made the install
as slow as on CI (~140 s against ~135 s).

| Generator + smoke | Condition | Result |
|---|---|---|
| main + main | CI-speed cap | **FAIL** with the CI error (step 212 s,
CI 196 s); `Un.exe` still running, finished ~78 s after start |
| main + fixed | CI-speed cap | PASS, uninstall 74 s |
| fixed + fixed | CI-speed cap | PASS, uninstall 78 s |
| fixed + fixed | real speed | PASS, uninstall 22 s |
| main + fixed | `Uninstall.exe` held open | the copy exits **0** and
the file stays (silent success) |
| fixed + fixed | `Uninstall.exe` held open | **FAIL**, `Silent NSIS
uninstall failed with exit code 1`, files listed |

- I ruled out a `MessageBox` in silent mode: every box sits under
`${IfNot} ${Silent}`.
- `vp test packages/desktop/__test__/windows-nsis.test.ts`: 14 passed.
The new tests fail when their part of the fix is reverted.
- `yarn typecheck`, lint and `vp fmt --check` pass on the touched files.
- CI cannot run the Windows job from this branch, because the
`desktop-release` environment allows only `main` and `v*` tags. A dry
run from `main` after the merge is the real check.

## Review decisions (no change)

- **The test can miss an `Un.exe` that exits before the first process
query.** It cannot in practice. `Un.exe` deletes about 8,400 manifest
entries, which took 13-22 s at full speed and 75-80 s at CI speed on the
test machine. The process query runs less than 1 s after the launcher
exits. A `Win32_ProcessStopTrace` subscription needs admin rights and
makes the test more complex, for a window that does not occur.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant