# 2.2.0 This release covers `stim` and `@stim-cli/cache-s3`; `@stim-cli/cache-s3` has no changes beyond its version, but its peer range on `stim` moves to `^2.2.0`, so upgrade `stim` with it or keep the 2.1.x provider. It turns automatic engine and Stim Host updates off by default and keeps automatic updates within the engine's major, ships the Godot project plugin inside `stim`, removes discovered worktrees by the registered-worktree rules, makes what the home-folder scan and other tools' folders find report-only, and drops two checks gc made before deleting dependency trees. Every commit since v2.1.0 has an entry below. The Desktop changes noted below ship with the next Stim Desktop release. ## New - **Stim ships the Godot project plugin, and `plugins` turns on a shipped plugin by name.** An entry of the machine setting `plugins` is now a plugin shipped with Stim, by its package name (`@stim-cli/plugin-godot`) or its short name (`godot`), or a plugin directory by absolute path as before. A shipped plugin that is not named stays off. On a machine with no `plugins` entries, `stim settings set plugins '["godot"]' --scope machine` turns this one on; with existing entries, add `"godot"` to the list and keep them, because `settings set` replaces the whole list. It recognises a folder holding `project.godot`, and `stim android` builds it with `godot --headless --path {root} --export-debug Android {output}` (`--export-release` for a release build). The project needs an export preset named `Android` with `package/unique_name` set and `arm64-v8a` on, and `rendering/textures/vram_compression/import_etc2_astc=true` in `project.godot`; the machine needs Godot 4 on `PATH` with the matching Android export template, and the Android SDK, JDK and debug keystore paths in Godot's editor settings; a release build takes its keystore from the `Android` export preset. A name Stim does not ship is written with a warning, and `stim plugin list` and `stim doctor` report it as rejected and name the plugins Stim ships. An entry that declares a project id an earlier entry already holds is rejected, so naming `godot` and a directory with the same id keeps whichever comes first. The build copies each `packages/plugin-` to `dist/plugins/`, and the release check refuses a `stim` tarball without the Godot manifest. Fixes [#6663](https://github.com/appandflow/stim/issues/6663); refs [#6599](https://github.com/appandflow/stim/issues/6599). [62592cea8](https://github.com/appandflow/stim/commit/62592cea824886a9976ddb3c9461b1cd16ec8077) - **Automatic engine updates stay within the engine's major.** stimd reads the channel's tags and published versions with one `npm view stim@ dist-tags versions --json` and moves to the channel's newest release when it is in the engine's major, otherwise to the newest release of the engine's major on that channel (stable releases only on `latest`). It records a newer major it leaves alone, and the crash-loop hold only counts bad builds of the target's major. `stim engine status` and the `stim guide` STATUS block name a newer release they know of (`stim is available on public npm (running )`), add `A new major requires a manual update.` for a new major, and add `Set engine.autoUpdate to on to opt into same-major updates.` while the setting is not `on`. `stim engine status` reads cached observations without a network call; `stim guide` checks public npm with a two second timeout and caches the answer per channel for a day. A person's `stim engine update` still follows the channel's tag across a major. (Desktop: when Stim Desktop needs a newer engine than the installed one, it still moves the engine whatever `engine.autoUpdate` says, at once for an engine it installed and behind Update Engine otherwise, but now to exactly the version it names instead of the channel's newest, so it never moves past that version, and the move leaves no pin. It runs the installed engine's `engine-select --release --set-by update:desktop`, refuses when its packaged engine lacks the guarded promotion and sends you to the command line, and shows a refused, busy or staged update in its server status. Ships with the next Stim Desktop release.) Fixes [#6681](https://github.com/appandflow/stim/issues/6681). [19936bcb0](https://github.com/appandflow/stim/commit/19936bcb06207086c5e3e12d825b776c333bd582) - **A discovered worktree is removed by the registered-worktree rules.** A linked worktree Stim found rather than created goes once it is finished and clean, as a registered one does, when no process runs from it, no agent session is in it and no tracked file is marked `assume-unchanged` or `skip-worktree`, at every pressure level. Removal no longer walks its files for recent writes, git-ignored ones included, no longer waits for `idle.dormantDays`, and no longer keeps a worktree inside a dot-folder of its repository, such as `.claude/worktrees` in the main checkout, as another tool's: a clean one with no commits of its own goes once its git writes are older than `gc.worktreeGraceMinutes`. A dirty discovered worktree is still kept and never archived, and any change to a tracked file keeps it. Removing any finished worktree, registered or discovered, now keeps it when the rescue walk finds a nested `.git` directory or gitfile outside `node_modules` (`it contains a nested Git checkout at `). The source walk still gates the dormant build outputs of a checkout with no Stim record. Fixes [#6683](https://github.com/appandflow/stim/issues/6683). [41f65bb7c](https://github.com/appandflow/stim/commit/41f65bb7c9fb6e403435cf96d7bfeefef249617f) - **What the home-folder scan and other tools' folders find is report-only.** At every `maintenance.autoDiscover` setting, maintenance and `stim gc` no longer reduce the build outputs or dependencies of, or remove, a checkout because the weekly home-folder scan found it or because it is a linked worktree in `~/.codex/worktrees`, unless another route such as `maintenance.managedFolders` reaches it. `stim doctor` lists the scan's finds that no other route reaches, with the command that adds their folder to `maintenance.managedFolders`. `maintenance.autoDiscover` now covers only the folders next to registered checkouts and the linked worktrees of known repositories. A recorded scan path no longer keeps a plain Node worktree. Fixes [#6684](https://github.com/appandflow/stim/issues/6684). [1ded9b40c](https://github.com/appandflow/stim/commit/1ded9b40cb81c01ce14babef6b32002a3f7872e1) - **gc checks only the same path before deleting a main checkout's dependencies.** A main checkout's `node_modules` or Pods is kept when a linked worktree that git lists has a symlink at the same relative path that resolves into the tree. gc no longer walks each linked worktree two directory levels deep for other links, and no longer keeps the tree when that walk passed 2,000 entries or met an unreadable directory. `stim worktree warm` never links a worktree's dependencies into the source, so a link elsewhere is a hand-made layout; that worktree needs a reinstall after the deletion. Fixes [#6682](https://github.com/appandflow/stim/issues/6682). [958e78562](https://github.com/appandflow/stim/commit/958e78562989cf226eb45db9449408edbee4c52b) - **gc no longer samples dependency trees of unknown size for hard links.** A `node_modules` or Pods tree whose private size is unknown was kept when most sampled files were hard links into a pnpm store outside it. Such a tree now follows its step's rule for any tree of unknown size: the dormant step takes an idle linked worktree's tree after the measured ones, and the 7-day source rule keeps a source checkout's tree. pnpm relinks a deleted tree from its store on the next install. The `.links.json` and `.native.json` records an earlier Stim wrote beside the size cache are removed by gc's stale status-cache sweep once the measured folder is gone. Fixes [#6685](https://github.com/appandflow/stim/issues/6685). [4aaa38c1f](https://github.com/appandflow/stim/commit/4aaa38c1f56a3599da02f2844bf65820017ff6fb) ## Removed (breaking) - **Stim no longer updates the engine or Stim Host by itself unless you turn it on.** `engine.autoUpdate` now defaults to `off`, and an unset setting reads as `off`. Until now the default, `auto`, moved an engine that Stim Desktop installed or a service runs to the newest release on its channel (once a day, when Desktop connected, when a phone needed a newer engine, and during a crash hold), and stimd replaced an older Stim Host in `~/Applications` at each start. Under `off` stimd does neither and makes no update check, including on a newer phone's hello; the phone keeps its update card. `stim engine status` names an installed Stim Host older than the one the running build pins, and the setting under which stimd installs it at its next start. `on` updates every engine and Stim Host; `auto` keeps its earlier meaning. A machine that already set `on`, `auto` or `off` keeps it. Stim Desktop still moves an engine that is older than it needs (see New). Fixes [#6681](https://github.com/appandflow/stim/issues/6681). [19936bcb0](https://github.com/appandflow/stim/commit/19936bcb06207086c5e3e12d825b776c333bd582) - **`maintenance.autoDiscover` no longer reaches the home-folder scan's finds or `~/.codex/worktrees`** (see New), and in the `discovery` field of `stim doctor --json` the group kind `reduce-only` is now `scan`. [1ded9b40c](https://github.com/appandflow/stim/commit/1ded9b40cb81c01ce14babef6b32002a3f7872e1) - **Cleanup keeps less.** A finished, clean discovered worktree no longer waits for `idle.dormantDays` and is removed even inside `.claude/worktrees`; a main checkout's dependency tree is no longer kept for a link at another path in a linked worktree or for an incomplete link scan; and a dependency tree of unknown size is no longer kept because its files are hard links (see New). [41f65bb7c](https://github.com/appandflow/stim/commit/41f65bb7c9fb6e403435cf96d7bfeefef249617f) [958e78562](https://github.com/appandflow/stim/commit/958e78562989cf226eb45db9449408edbee4c52b) [4aaa38c1f](https://github.com/appandflow/stim/commit/4aaa38c1f56a3599da02f2844bf65820017ff6fb) ## Fixes - **gc keeps a main checkout's dependencies when it cannot check a linked worktree.** The same-path link check treated a path it could not inspect, such as one under a folder that denies access, as no link, so the tree could be deleted. gc now keeps the tree when it cannot inspect that path (`could not inspect in the worktree `) or resolve its symlink, and when git lists a locked worktree, such as one on an unmounted volume, whose Git metadata it cannot verify (`could not verify Git metadata for the locked worktree `). A missing entry, a link into another tree and an absent unlocked worktree still let cleanup go ahead. Fixes [#6709](https://github.com/appandflow/stim/issues/6709). [93b9c9a7d](https://github.com/appandflow/stim/commit/93b9c9a7dcb1970601ec716ac0064d1847944258) - **A failed Git mirror setup no longer leaves an offloaded build's claims behind.** When preparing a build worker's Git mirror failed, the repository, build-slot and engine claims stayed pending, the next service start could refuse that engine claim and leave the worker offline, and a partly initialized Git directory could block a retry. The worker now cleans its owned simulators first, then initializes Git, transfers the files and checks the project path before any project tool runs. A failure there returns `mirror-prepare` (`Cannot prepare the worker's Git mirror: `), and the host releases the claims once the worker's process group has exited. An owned, partial Git directory is initialized in place. Mirror Git commands ignore inherited Git config, templates and repository paths, disable hooks and automatic maintenance, and refuse a mirror with a `commondir`. A failure in the native source indexing that follows keeps the claims, because Git can run clean filters configured in the mirror. Fixes [#6706](https://github.com/appandflow/stim/issues/6706). [76c763e61](https://github.com/appandflow/stim/commit/76c763e616fb2cd527779629e7336de0e4dd1b30) - **A shipped plugin's files are part of the build id.** The build copies every file of a shipped plugin, not only its `package.json`, and `dist/shipped-plugins-digest.mjs` hashes them, so a change to them changes the build id; the publish check and the incoming build self-test verify the digest. A shipped plugin whose `package.json` is not named `@stim-cli/plugin-` is reported as a rejected `plugins` entry. A lint rule refuses a computed `import()` outside the three files that load Stim code. No shipped plugin holds code yet. Fixes [#6701](https://github.com/appandflow/stim/issues/6701). [6c9e2f9f7](https://github.com/appandflow/stim/commit/6c9e2f9f7d0eb218c10605991a531988527e8c80) - **Internal only:** what a project type declares about its outputs is read through one seam ([43cfec166](https://github.com/appandflow/stim/commit/43cfec16623317a8c57f00ff1dbdb1bf15125f44), Fixes [#6674](https://github.com/appandflow/stim/issues/6674) and [#6679](https://github.com/appandflow/stim/issues/6679)), the Exact ledger and cleaner run through project output members ([f413b8485](https://github.com/appandflow/stim/commit/f413b8485ed46b5d193ae66364f17575b6a76121), Fixes [#6694](https://github.com/appandflow/stim/issues/6694) and [#6698](https://github.com/appandflow/stim/issues/6698)), and the internal iOS plugin members may return promises ([46a2880fb](https://github.com/appandflow/stim/commit/46a2880fb73c6c6ddddea21216a244983445d1ac), Fixes [#6702](https://github.com/appandflow/stim/issues/6702)). Refs [#6599](https://github.com/appandflow/stim/issues/6599). No shipped behavior changes. - **Test only:** [ed989cd66](https://github.com/appandflow/stim/commit/ed989cd663403d74ad2645bd959feaf3a6b1827f) removes an unused import from `gc-dependencies.test.ts` that failed lint and the Windows typecheck. Fixes [#6696](https://github.com/appandflow/stim/issues/6696). ## Docs - The README banner shows the current tagline, "Orchestrate fast builds and devices for coding agents". Fixes [#6711](https://github.com/appandflow/stim/issues/6711). [f996dcc6f](https://github.com/appandflow/stim/commit/f996dcc6fec9401108bc62ebbcead2efb305202d) ## Migration notes - **To keep automatic engine and Stim Host updates,** run `stim settings set engine.autoUpdate auto --scope machine` for the 2.1.0 behavior, or `stim settings set engine.autoUpdate on --scope machine` to update every engine. The setting moves the machine engine that stimd follows, not a global npm install: with only `npm i -g stim`, run `stim engine install` first or keep updating the npm package yourself. Automatic updates stop at the engine's major either way; run `stim engine update` to move to a new major. - **To keep cleanup on checkouts only the home-folder scan reached,** add their folder to `maintenance.managedFolders`; `stim doctor` prints the command. Worktrees under `~/.codex/worktrees` are not scan results and `stim doctor` does not list them: find them with `stim gc --dry-run` and add their folder to `maintenance.managedFolders` yourself. Adding a folder also makes its finished, clean linked worktrees eligible for automatic removal, which 2.1.0 did not do through the scan or `~/.codex/worktrees` and which deletes their git-ignored files, such as a `.env` or a local database. Copy those files out first, or set `maintenance.removeFinishedWorktrees` to `false` if you want only build outputs and dependencies cleaned. - **A worktree another tool keeps in your repository, such as `.claude/worktrees`,** is now removed once finished and clean with nothing running from it. Commit or push work there you want to keep, and copy any git-ignored file you need, such as a `.env` or a local override, to the main checkout or outside the repository before upgrading: removal deletes ignored files, even recently edited ones, and git cannot restore them. - **A worktree whose `node_modules` you linked by hand into the main checkout's tree at another path** needs a reinstall after gc deletes the main checkout's dependencies. - **Scripts that read the `discovery` group kind from `stim doctor --json`** should match `scan` instead of `reduce-only`.