Repository navigation
v2.1.0
This release covers stim and @stim-cli/cache-s3. It pins Stim Host 0.2.1, which stimd now brings an installed Stim Host up to on its own, adds project plugins that can recognise and build a project type Stim does not bundle, makes cleanup treat dependency folders and git-ignored worktree files as disposable, and lets stim gc --dry-run answer from a report stimd keeps fresh. Every commit since v2.0.0 has an entry below. The Desktop changes noted below ship with the next Stim Desktop release, and the phone app ships through its own workflow.
New
- Stim Host keeps itself current. stimd installs the Stim Host this version pins over an older one in
~/Applicationseach time it starts, with the same download, SHA-256 and Developer ID checks asstim service install, and retries hourly after a failure (logged ashost_update_failed). It never installs Stim Host on a Mac that has none and never downgrades.engine.autoUpdateset tooffturns this off. From Stim Host 0.2.1 on, the helper exits when its bundle is replaced, so launchd starts the new binary. 9c2c3b5b6 - Stim Host's helper restarts a bloated fseventsd. fseventsd joins the Apple services the opt-in helper restarts, and the helper now measures each service's memory as the larger of its RSS and its physical footprint, so a service whose memory is mostly compressed or swapped still counts. Restarting fseventsd makes file watchers such as Metro, Watchman and Spotlight rescan once. This ships in Stim Host 0.2.1. Fixes #6600. ad81368d4
- A
projectplugin kind recognises a project type Stim does not bundle, such as a Godot game, from a plugin'spackage.jsonalone (stimPlugin.kinds.projectand astimPlugin.projectblock withid,nameandmarkers). The new machine settingpluginslists plugin directories by absolute path. A folder that holds every marker is a project root:stim worktree addandwarmregister it,stim statusnames the type (project: Godot (plugin stim-plugin-godot)), andstim ios,android,macosandstartrefuse withSTIM_NO_PROJECTnaming it, except for the Android build below. Stim never imports the plugin's code. Bundled integrations keep a folder they also serve.stim plugin list,stim plugin test,stim doctorandstim settings set pluginsreport a manifest Stim does not accept. The kind is experimental: its contract and integer may change in a minor release.stim/pluginexportsPROJECT_API_VERSION,ProjectPluginManifestandrunProjectContract. Refs #6599. 808fea14f - A project plugin can declare an Android build.
stimPlugin.project.targets.android.buildholds adebugargument list, an optionalreleaseone and"output": "apk". In a folder the plugin recognises,stim androidruns that list in the project root with no shell, with{root}and{output}as its only placeholders and an executable that is an absolute path or a name onPATH(on Windows a.exe), then installs the APK on the workspace's emulator and launches it as a native process.stim ios,macosandstartstill refuse there. The build is never cached and never offloaded, and only an emulator this machine owns is a target. A bundled integration that builds the same folder keeps the build.stim/pluginexportsProjectPluginAndroidTargetandProjectPluginCommand. Refs #6599. eb2a797e7 - Dependency folders are deleted without a check for hand edits. Maintenance and
stim gcdelete thenode_modulesandPodsof idle workspaces, and finished or discovered worktrees that hold them, without looking inside. Make a library fix a committed patch (pnpm patch, yarn patch, patch-package or a Podfilepost_installhook). An unfinishedpnpm patchedit folder is still copied to$STIM_HOME/rescuedfirst. The new machine settingmaintenance.cleanAutoDiscoveredDependencies(defaultfalse, envSTIM_MAINTENANCE_CLEAN_AUTO_DISCOVERED_DEPENDENCIES) governs checkouts that onlymaintenance.autoDiscoverfound: while it is off, theirnode_modulesandPodsstay as long as the checkout does. Their build outputs and finished worktrees are cleaned either way. This replaces the hand-edit rules that #6608 and #6620 refined earlier in this release (pnpm'snode_modules/.package-map.json, iOS build outputs inPodsandnode_modules). Fixes #6638, #6603 and #6616. 7cab41806 9a208c7c6 b8109f969 - Git-ignored files in a linked worktree are disposable. A finished linked worktree is no longer kept because a git-ignored file in it is missing from the main checkout or differs there. An ignored file that exists only in a worktree, such as a
.envcreated there, is deleted with the finished worktree: keep what matters in the main checkout or outside the repository. A discovered worktree's recent write to an ignored file still counts as activity. A registered worktree has no file scan, so a finished one goes oncegc.worktreeGraceMinuteshas passed even if an ignored file changed minutes before. Writes inside.docusaurusand.pnpm-storeno longer count as activity. Tracked changes, untracked files git does not ignore and unpushed commits still keep a worktree. Fixes #6643 and #6652. 19292c0d9 b7311874a a1f371a60 maintenance.discoverRootsis nowmaintenance.managedFolders. The 2.0.0 name is still read while the new one is unset, andstim settings get,setandunsetaccept it. Asetthrough either name storesmaintenance.managedFoldersand removes the old key. When both are set, the new one wins andstim settingsandstim doctorreport the old one as not read. An older Stim that shares the Stim home reads only the old key, so update every Stim that shares it before setting the new one. Fixes #6644. eabbe775estim gc --dry-runanswers from the gc report stimd keeps fresh. stimd refreshes the shared report in$STIM_HOME/gc/report-cache.jsonwhiledaemon.modeis on and pressure is normal: after 15 minutes when cleanup state changed, and at least hourly. A dry run first measures the pressure level, then prints the cached report with its age, and--jsonaddsmeasured(from:cacheorscan,at,parts). A report older than an hour still answers, and stderr names--refresh.stim gc --dry-run --refreshmeasures again in its own process, as does a dry run with no cached report or one read at another pressure level, and names each part on stderr as it lands.--pressuremeasures in process and leaves the cache alone.--refreshwithout--dry-runrefuses withSTIM_BAD_ARG. An actingstim gcand every deletion still read each candidate fresh. stim-server reads the same file and sweeps only when it is missing or Desktop asks for a fresh one; while its own sweep runs, a Desktop report read also carries the parts read so far. (Desktop: shows those parts over the last complete report; ships with the next Stim Desktop release.) Fixes #6612 and #6613. 1fb5443b2 1c03227fa- Long-running commands report progress on stderr. An acting
stim gcprints one line per phase of the stimd pass (level,discover,measure,plan,dormant,ladder) and a closinggcline (finished: N actions taken, X freed in T), in--jsonmode too. A request that joins a pass already under way prints a line saying so, then that pass's lines from that point; a pass stimd started on its own prints no phase lines, only its actions.stim engine install,useandupdateprint their fetch and self-test steps, andstim remote updateprints a line when it starts waiting on the remote machine. Fixes #6669. 63e1eff59
Removed (breaking)
status --jsonno longer carriesdependencyEdits, andstim doctorno longer reports edited dependency folders, because cleanup no longer looks for hand edits (see New). The field was optional and is now never present. Install records under$STIM_HOME/dependency-installs/are no longer written or pruned; existing files stay. 7cab41806stim gcno longer keeps the workspace it runs from. A gc pass, acting or dry run, plans the same work from any directory, so the checkout you run it in can lose itsnode_modulesandPodsor, as a finished worktree, be removed, like any other. Everything that keeps a workspace in use still does: running dev servers and devices, live claims, agent sessions, running Stim commands and any process working in it, idle and dormant periods, recent use and pins. An acting pass runs its child processes from stimd's directory.stim start,iosandandroidstill keep the workspace they build. 1fb5443b2stim gcno longer lists or stops the current Expo project's orphaned EAS sessions.orphanedEasSessionsingc --jsonis always empty. Listing every Expo project's sessions would take a network scan per project. gc still cleans the local EAS ledger entries it can prove are stale. 1fb5443b2- Cleanup keeps less. Hand edits inside
node_modulesandPods, and git-ignored files that exist only in a finished linked worktree, are now deleted with them (see New). 7cab41806 19292c0d9
Fixes
- On Windows, a fresh install of Stim no longer picks up cross-spawn 7.1.0, which runs
npmand other batch shims by their bare name in a way that makes npm look for its own files in the current directory (Cannot find module ...\node_modules\npm\bin\npm-prefix.js). Stim pins cross-spawn 7.0.6 until upstream fixes it. Fixes #6659. ccc4078ee - On Windows, a native build in a worktree that
stim worktree addorwarmfilled from a source checkout is stored in the build cache again. The carriednode_moduleskeeps the source checkout's file times, so the warm has to compare the worktree's install inputs with the source's, and Git for Windows checkspackage.json, the lockfile and patches out with CRLF line endings, so that comparison failed and every build printed... changed after the last install; the build will be installed but not cached. The warm now compares these files without regard to line endings. Fixes #6633. 23a490683 - Stim pins Stim Host 0.2.1, and the fseventsd memory advice now names
stim service install --helperinstead ofsudo killall fseventsd. A Mac with Stim Host installed moves to 0.2.1 the next time stimd starts, unlessengine.autoUpdateisoff;stim service installinstalls it either way. A helper registered before 0.2.1 keeps running its old binary until a reboot orsudo launchctl kickstart -k system/dev.stim.host.helper. The helper's restart line instim statusshows the larger of RSS and footprint as memory. (Desktop: the preferences copy names fseventsd and says "2 GB of memory"; ships with the next Stim Desktop release.) Fixes #6601 and #6604. 6b364af97 - A lock left with an unrecorded child is recovered after a reboot. A claim whose owner died before recording the child it started kept its workspace "in use" until removed by hand. It now reads as free when its owner is gone and the owner's process token records an earlier boot. Within one boot, when a boot id cannot be read, and on Windows nothing changes. Fixes #6618. 79f2cc714
- Stim Desktop's cleanup report answers from stimd's cached gc report. On a Mac with many projects the report timed out at 60 s every time. stim-server now answers a gc report read at once with the last good report and when it was measured, or
pendingduring a first sweep, runs at most one sweep with a 15 minute budget, and keeps the report in$STIM_HOME/gc/report-cache.jsonacross stimd restarts. Phone machine details read the same report. (Desktop: polls without forcing a new sweep; ships with the next Stim Desktop release.) Fixes #6606. aaa3efabe - gc reports ask git each question once. A report no longer drops its shared git reads between sweeps, merge state is shared per run, a repository's worktrees share one
git worktree list, and the source walk asksgit check-ignoreonce per depth. On a Mac with 258 registered projects,stim gc --dry-run --jsonwent from 6,617 git calls to 2,685. Fixes #6615. eb523efa9 stim gcnames macOS swap as one disk user (swap, 60 files in /System/Volumes/VM) instead of one row per 1 GB swap file. Fixes #6607. 54e0d07c7- A finished worktree with a detached HEAD is removed when a merged pull request holds that HEAD. It was kept forever as
unpushed, because the merged pull request lookup needed a branch. gc and maintenance now look the commit up on GitHub: aMERGEDpull request of this repository whose head equals or contains HEAD waives the unpushed commits, andstim worktree removewaives them while HEAD still equals that head. A failed or missingghwaives nothing. Fixes #6645. 2800e2ae4 - Native and plugin APKs are checked with
aapt2instead ofaapt, which refused Godot's Android exports with the default renderer (attribute is not an integer value). The Android SDK build-tools needaapt2, which every release since 26.0.0 includes. Fixes #6668. a22670068 - Internal only: the built-in Exact iOS integration runs through an internal plugin interface, locally and for offloaded builds, with no behavior change (e0e746f58, aa0130939). Fixes #6642 and #6649; refs #6599.
- Test only: f804232b3 covers Exact behaviors that had no test (Fixes #6640), b5bf00f67 covers the Exact behaviors of machine-wide cleanup (Fixes #6664), and 1c3c1fda6 keeps git auto maintenance off across the worktree-add integration tests (Fixes #6621). No shipped behavior changes.
Migration notes
- Rename
maintenance.discoverRootswhen every Stim that shares the Stim home runs 2.1.0:stim settings set maintenance.managedFolders '["/path/to/folder"]' --scope machinewith the same list moves the value and removes the old key. Leaving the old key alone keeps working. - Commit library fixes as patches. An edit inside
node_modulesorPodsis deleted once the workspace is idle. - Move files you want to keep out of a worktree's git-ignored files, such as a
.envcreated only in a worktree, before the worktree is finished. - To keep a checkout from cleanup, pin it with
stim settings set maintenance.keep truein it;stim gcno longer spares the checkout you run it from. Usestim gc --dry-run --refreshwhen you need numbers newer than the cached report. - Scripts that read
orphanedEasSessionsfromgc --jsonget an empty list; stop remote EAS sessions with eas-cli. - A Stim Host helper registered before 0.2.1 needs one reboot or
sudo launchctl kickstart -k system/dev.stim.host.helperto run the new helper.