Skip to content

v2.3.0

Latest

Choose a tag to compare

@janicduplessis janicduplessis released this 02 Dec 19:37
· 54 commits to main since this release
c273ef0

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.3.0, so upgrade stim with it or keep the 2.2.x provider. It moves Exact apps to the exact plugin that ships inside stim (off until plugins names it), lets project plugins build and run iOS apps, build on a build machine and clean their outputs, keeps an idle workspace's build outputs and raises idle.minutes to 60, counts package.json install scripts in the native build-cache key, and adds opt-in Claude Code worktree hooks to stim doctor. Every commit since v2.2.0 has an entry below. This release skipped the manual QA and native compatibility stage at the maintainer's request. The Desktop change noted below ships with the next Stim Desktop release.

New

  • Project plugins can build and run an iOS app through stim ios. A kinds.project 2 manifest can declare targets.ios and a module inside the plugin directory. Stim loads the module in a fresh worker only for selected iOS runs, plans, builds and doctor checks. Startup and each member call have separate 30-second limits. The worker isolates the module's lifetime and shares Stim's OS permissions. Stim drains outstanding host.exec calls at operation exit; children the module spawns directly fall outside that cleanup. Unrelated commands, Android-only doctor and built-in project folders leave the module unloaded; the whole-folder exclusion includes Android-only projects and macOS Xcode containers. Version 1 and manifest-only Android targets keep their existing behavior. stim/plugin exports ProjectPluginModule, ProjectPluginHost and ProjectPluginIos. The module's ios object needs only build and result; every other member has a default stated on its type, and build receives the selected scheme, from --scheme or the ios.scheme setting. When the module fails to load or its ios object has the wrong shape, the remedy points at stim doctor --platform ios from the project folder, which loads it; when a member fails, the remedy names it. stim status shows the plugin on the project: line for iOS-only and iOS plus Android plugin folders, as it already did for Android-only plugins, still without loading plugin code. Fixes #6680, #6717 and #6716. 0bf083ebe 6413d45f5 983060314
  • Project plugin manifests declare outputs, caches and headroom. A kinds.project 2 manifest can declare outputs (Cargo-shaped build folders beside its markers), caches (tool caches under the home folder that the disk ladder reports) and headroomGb (the GB a cold iOS or Android build writes). Stim reads them from every plugin it ships, turned on in plugins or not, and from the plugin directories plugins names, without loading any module: the Cargo cleaner keeps a declared folder whole and a target/ holding its use record, warm leaves out a folder with notCopied, discovery recognises a folder holding a shipped plugin's markers, and a plugin build takes the plugin's headroom. In a folder of a shipped plugin that is off, the STIM_NO_PROJECT refusal and stim doctor print the stim settings set plugins command that turns it on. stim/plugin exports ProjectPluginOutput and ProjectPluginCache. Fixes #6739. 2c31b65c0
  • A plugin shipped with Stim can build its iOS projects on a build machine. Its module's ios object may declare offload (ProjectPluginIosOffload in stim/plugin): plan and check are required, and tools, source, project and env have defaults stated on the type. The build machine's job loads the plugin from the client's Stim build it runs, for the offer, the build request and the build, and needs no plugins setting. A plugin loaded from a directory keeps building on the client. A machine that lacks a plugin's toolchain reports the problem code plugin. Fixes #6741. 1fce547fb
  • A project plugin's module can clean the build folders its manifest declares. The object createProjectPlugin returns may give outputUse(dir), the last use of each Cargo profile from the project's own records, and cleanOutput(dir, { dryRun }), the project's own cleaner (ProjectPluginOutputUse and ProjectPluginOutputClean in stim/plugin). For a plugin plugins turns on, stimd's cleanup passes and stim gc load the module in a fresh worker for each call, only for a target/ holding the declared use record or for the idle declared folder beside its project, and never in a built-in project folder. Startup and outputUse have 30 seconds, and each cleanOutput call 240. A whole delete reads the plugin's records even when it dates no other use. A module that fails, runs past its limit or returns the wrong shape before cleaning keeps the folder; one that fails during the clean can leave part of it removed. A shipped plugin that is off stays data only. Fixes #6768. 11bb43e5a
  • An iOS project plugin can name the tool that runs its build, and a plugin shipped with Stim can code its doctor findings. The optional ios.buildTool string is what stim ios prints in compiling Debug with <tool> and a failed build's report, in place of the module path. A finding from ios.doctor() may carry code (ProjectPluginFinding.code in stim/plugin), a lowercase letter then lowercase letters, digits and hyphens, at most 64 characters; stim doctor --json keeps it for a plugin shipped with Stim and drops it for a plugin loaded from a directory. doctor() and the host.exec calls it awaits share one 30-second member limit. stim status appends , app: <bundle id> to a plugin project's project: line when the workspace record holds a bundle id, from the plugin's bundleId() or from the app a local stim ios run built. Fixes #6767. 402a48d17
  • stim doctor offers Claude Code worktree hooks that create and remove worktrees with Stim. When Claude Code is in use for the checkout (it has a .claude/ folder, or doctor runs with CLAUDECODE=1) and Stim's hooks are not in .claude/settings.local.json, doctor adds the note claude-worktree-hooks-missing, claude-worktree-hooks-stale when a hook's checkout, node or stim path no longer exists, or claude-worktree-hooks-unreadable when a settings file cannot be parsed. stim doctor --fix writes the WorktreeCreate and WorktreeRemove hooks only after a yes in a terminal, so an agent's run only reports. The write keeps the file's other keys and mode (new files are 0600), leaves a file git tracks alone, and adds the file to .git/info/exclude when git does not ignore it. When the checkout's or project folder's settings, or the user settings, already have a worktree hook Stim did not write, doctor reports claude-worktree-hooks-foreign, names the file, and writes nothing. The hook runs stim worktree claude-hooks create|remove with absolute node and stim paths: create runs stim worktree add -b worktree-<name> <checkout>.worktrees/<name> at the source checkout's HEAD, beside the checkout, and prints only the path; remove runs stim worktree remove without --force and keeps a worktree with uncommitted or unpushed work. macOS and Linux only. With the hooks configured, the Claude desktop app creates no worktree for a session Claude starts or forks. Delete the two entries to turn the hooks off. Refs #6788. fa3ff212e
  • An idle workspace keeps its build outputs. After idle.minutes without activity, or 2 minutes under memory pressure, stimd stops the dev server and shuts down the owned devices but no longer deletes the workspace's build outputs, so the next stim ios or stim android after a break rebuilds warm. The outputs go when the workspace goes dormant (idle.dormantDays, 1 day), when they pass maintenance.workspaceOutputsMaxGb, or when disk runs short on their volume; under disk pressure the idle stage still deletes the outputs it finds on a short volume. On Windows, where Stim cannot list the processes in a checkout, a stopped workspace's outputs go only under disk pressure or over the cap. stim guide lifecycle says so, and so does the Automatic Maintenance footer in Stim Desktop's preferences (ships with the next Stim Desktop release). Fixes #6721 and #6735. fad3b401a b3339c373
  • idle.minutes defaults to 60. A workspace now goes idle after an hour without activity instead of 15 minutes. Memory pressure still stops an idle workspace after 2 minutes. While a volume is critically short of disk, a workspace on it still stops after 15 minutes, or after idle.minutes when that is lower, so its build outputs can be reclaimed. idle.dormantDays is unchanged. A value you set still wins (see Migration notes). Fixes #6734. 002f664cd
  • stim gc --dry-run previews the idle stage the next daemon pass runs. With daemon.mode on, a dry run at normal pressure lists each workspace the next stimd tick would stop as an idle-stage row (outcome: 'kept', 0 bytes, in a plain-output block The next daemon tick, not stim gc, stops N idle workspaces:). The rows count toward no dry-run total and do not set actionable. The cached report Stim Desktop reads carries them too; the JSON change is additive. An acting stim gc at normal still leaves the idle stage to stimd. The idle pass's would-idle detail now names the threshold and the last activity (no activity for 20 minutes (idle.minutes is 15; last: stim command)). Fixes #6722. 0cac9252b

Removed (breaking)

  • Exact apps need the exact plugin turned on. Stim no longer bundles its Exact integration: Exact apps are served by @stim-cli/plugin-exact (short name exact), which ships inside the stim package and stays off until plugins names it. Turn it on once per machine with stim settings set plugins '["exact"]' --scope machine, or add exact to the list if plugins already names other plugins. plugins has no environment override, so a CI host that runs stim ci build on an Exact app needs that command first. Until then stim ios, stim android and stim start in an Exact app refuse with STIM_NO_PROJECT and print that command, and cleanup keeps the app's target/ whole instead of handing it to Exact's cleaner. A build machine needs no setting: the plugin comes with the Stim build the job runs. With the plugin on, Exact apps build, run, plan, offload and clean as before, with these differences: stim status prints project: Exact (plugin @stim-cli/plugin-exact), app: <bundle id> in place of app: <bundle id> (exact); stim android and stim start use the plugin wording (The plugin @stim-cli/plugin-exact builds the Exact project at <root> for iOS only.); a build machine that lacks part of Exact's toolchain reports the problem code plugin (plugin-tools in candidates) instead of exact (exact-tools), and its probe simulator is named stim-build-exact-<job>; the build machine's messages about the second checkout name its Exact checkout instead of exact2; Exact's cleaner reports a clean that ends without a report as it exited with <code> and wraps an unreadable ledger in the plugin wording; with the plugin off, stim status labels the app (bare) and detects no iOS platform; and an Exact folder is no longer a built-in project folder, so another iOS plugin whose markers it also holds may load there. Two cases do not build as before even with the plugin on: a folder whose root Stim also recognizes as a built-in project (a Package.swift, a Gradle project with its wrapper, or a macOS Xcode project) no longer selects Exact for iOS, because a plugin module never loads in a built-in project folder; and a project whose own stim dependency is 2.2.x and calls the Stim API (plan, build, run) for an Exact app refuses with STIM_NO_PROJECT and a remedy to upgrade the stim package in that caller. Fixes #6738 and #6773. 184793c36
  • The project plugin API is version 2 (PROJECT_API_VERSION). This Stim reads a kinds.project 1 manifest as before, except that outputs, caches and headroomGb in its stimPlugin.project block now need kinds.project 2, so a version 1 manifest that carries one of them is rejected. An older Stim refuses a kinds.project 2 manifest and asks for stim engine update. 0bf083ebe
  • Hosted Android installs need Android build-tools 29.0.0 or newer on the hosting machine. Before installing on a hosted emulator, Stim reads the APK with aapt2 dump badging instead of the legacy aapt, which failed on some valid APKs such as Godot's default-renderer build. When aapt2 is missing or cannot read the APK, the install refuses before installing anything with a message that names aapt2 dump badging and the 29.0.0 requirement, the build-tools version it used, and the cause. Fixes #6671. c217b4db9

Fixes

  • package.json install scripts count in the native build-cache key. A new package.json#install-scripts fingerprint row hashes the text of the scripts an install runs (install, prepare and prepublish with their pre and post scripts, and every script those call by name through npm, pnpm, yarn or bun), from the app's package.json and the one at the install root. Before, "postinstall": "patch-package && npm run setup:native" and plain patch-package gave the same key, so a step that downloads or generates a native library could reuse an artifact built before that step existed. The row reads script text only, and finding called scripts is best effort: forms such as pnpm --filter app setup or npm-run-all are not followed. Declare files a script runs in extraSources, and reinstall after editing an install script. A warm build machine reinstalls only when the lockfile, install command or Node major changes, so after a script-only edit it can build with its old node_modules under the new key, and the client caches that app. Until #6779 is fixed, reinstall locally after such an edit and build with stim ios --no-build-cache --remote-build local (or the same stim android flags). A changed row reports package.json install scripts changed under package-scripts. FINGERPRINT_SCHEMA moves from 2 to 3, so every React Native or Expo project gets one cold build per fingerprint after upgrading (a native Gradle project with android.artifactInputs keeps its own key), and STIM_BUILD_COMPAT moves from 6 to 7, so a machine on 2.3.0 and one on an older Stim no longer reuse each other's completed artifacts. A script-only edit also reruns expo prebuild on an untracked CNG ios/ or android/. Fixes #6765. 2a8851953
  • patch-package can be one step of a plain postinstall chain. A postinstall such as patch-package && npm run skia:install-libs no longer makes the fingerprint uncertain (and stim ios refuse with STIM_NO_FINGERPRINT once ios/ exists). The script is split on && and ; (only && on Windows) and accepted when exactly one segment is a patch-package [flags] call and no other mentions patch-package or --patch-dir; steps before it must be plain words and cannot cd, pushd or source. Fixes #6758. 74303625c
  • stim doctor names what to fix on its first and last lines. The result line under the header and the closing line both name the findings to fix, so head or tail alone shows whether a build is blocked; the closing line drops the "costs time" advice when there are only notes, and a passing run ends with Doctor (<target>): PASS, 0 findings., where the target is all platforms without --platform A command with a --platform option that gets an extra ios or android operand (stim doctor ios) now ends its arity error with Pass a platform as --platform ios., or with --platform takes one platform; leave it out to check every platform. when --platform was already given. When doctor is due for both platforms, the stim guide agent STATUS block lists stim doctor --platform ios and stim doctor --platform android. Fixes #6790 and #6797. 64ab57cc7 f06fe381c
  • A doctor run in the main checkout counts for its linked worktrees. stim guide agent in a new linked worktree no longer reports doctor as never run minutes after stim doctor ran in the main checkout: per platform, a current run of either the worktree or the main checkout clears the due line, and stim status reports the newer of the two. A run in one linked worktree does not cover a sibling. Fixes #6787. ec6bbcf39
  • stim worktree remove names a Claude Code worktree lock and prints an unlock that works from inside the worktree. For a lock Claude Code wrote, the refusal names the session or subagent and its pid (Claude Code session <id> (pid <pid>) has it locked while it works there.), and from inside the worktree the hint is git worktree unlock <absolute worktree path>, which Claude Code's guard allows. A lock with any other reason still refuses, and now shows that reason. Stim does not unlock by itself. Fixes #6786. b5f2c00ec
  • Disk pressure is measured on the Metro cache volume. A Metro cache moved to its own volume with caches.metroCache or STIM_METRO_CACHE now raises pressure for that volume, and the ladder trims or empties the Metro stores there. Fixes #6727. 0beed2f14
  • Predictive sweeps keep whole Cargo targets and skip the dormant stage. A forecast alone no longer deletes a stopped registered workspace's whole Exact or tagged Cargo target/ (rung 3 still trims it), or the owned simulator or emulator of a workspace idle 10 minutes. Measured disk pressure and a forced stim gc --pressure high or critical still delete an eligible whole target and run the dormant stage. Fixes #6728 and #6753. 1de6dd731
  • stim gc --dry-run lists a stopped registered workspace's Cargo target that the matching acting run deletes, and the action log says why a selected target stayed. Fixes #6729. 6b5239b31
  • The idle pass dry run counts focused-device use and the reboot grace, so stim gc --dry-run, stim gc --pressure <level> --dry-run and daemon.mode report no longer list as idle a workspace the acting tick keeps running. A workspace whose simulators cannot be listed shows as failed in the preview. The focused-device reading is also timed from when the probe returns, for the acting tick too. Fixes #6725. 2a79f35ad
  • A measured stim gc applies the critical-disk idle cap to a volume that turned critical during the run, not only when the run started at critical. The resource-model harness reads a critical-disk stop correctly and reports a usage error without a stack trace. Fixes #6740. 31e79b844
  • The maintenance.cargoTargetMaxGb description and stim guide cleanup no longer say critical pressure removes Exact's idle build units, a sweep that no longer exists; an unreachable delete branch is removed. No behavior change. Fixes #6662. 0907ba59a
  • Doctor's Claude Code hooks check reads the source checkout asynchronously, so a doctor report requested through the Stim API no longer runs git worktree list as a synchronous child. Refs #6788. fc9cc4956
  • Plugin commands keep output they wrote just before exiting. A project plugin's host.exec call could return success with empty or partial stdout when its process exited before Stim read the pipe, most often on Linux. Exact then read its pinned exact2 checkout as "not at commit" and refused with exact-tools. Stim now gives stdout and stderr up to a second to close after the exit before it cleans them up, which is enough for the command's own output in normal runs. Output still unread at that deadline is lost, and a process that left the command's process group and keeps writing to its stdout can add what it writes in that second (#6816). Fixes #6803. e4be4fe6f, a741bbeeb
  • Repository only: the next channel publishes the newest commit on main that passed its gate instead of waiting for main's head to pass, and a later push to main no longer cancels an earlier commit's CI run. No package change. Fixes #6800. 9aad9242e
  • Test only: bd07a4162 quotes the cache path the ladder test expects on Windows (refs #6599), d5260d466 stubs the Stim Host helper restart log in service-helper.test.ts (Fixes #6736), 5c4194142 runs the dormancy half of the idle-stop output test off Windows only (refs #6721), and 24a5a1d90 gives the stimd contact test ticks a loaded macOS runner does not outlast (refs #6813).

Docs

  • The Stim skill loads right after a worktree is created or entered, with any tool, before the first typecheck, lint or test, so an agent warms the worktree before TypeScript resolves the source checkout's packages. Refs #6788. caeb3936b
  • The Godot plugin docs, in stim guide api and the programmatic API page, name the release-signing environment variables GODOT_ANDROID_KEYSTORE_RELEASE_PATH, _USER and _PASSWORD (Godot 4.1 or later), the Godot 4.6 and 4.7 black screen on Stim's Android emulator with the Forward+ or Mobile renderer and its two workarounds (display/window/frame_pacing/android/enable_frame_pacing=false, or the Compatibility renderer), and why the plugin has no iOS target. stim guide cleanup states that build-output cleanup keeps a Godot project's .godot/, since it holds export_credentials.cfg and editor state; removing a finished linked worktree still deletes the whole folder. Fixes #6781. 2d45b4b6e

Migration notes

  • Exact apps: run stim settings set plugins '["exact"]' --scope machine on every machine and CI host that runs Exact apps, or add "exact" to an existing plugins list, because settings set replaces the whole list. A project that calls the Stim API for an Exact app also upgrades its own stim dependency to 2.3.0. An Exact app whose root also holds a Package.swift, a Gradle project or a macOS Xcode project needs its own folder. Scripts that match app: <bundle id> (exact) in stim status, or the exact and exact-tools build-machine problem codes, should match project: Exact (plugin @stim-cli/plugin-exact) and plugin / plugin-tools.
  • Expect one cold native build per React Native or Expo project after upgrading, from the fingerprint schema change. Going back to 2.2.x in a workspace with an untracked generated ios/ or android/ that 2.3.0 prebuilt refuses with STIM_PREBUILD_FAILED; keep any native edits, move that folder aside and run 2.2.x again so it regenerates it. Update build machines and their clients together so they keep reusing each other's artifacts across the STIM_BUILD_COMPAT change.
  • Project plugins: a plugin that declares kinds.project 2 needs Stim 2.3.0 or later; keep kinds.project 1 for plugins older Stims must load.
  • To keep the 15-minute idle stop, run stim settings set idle.minutes 15 --scope machine.
  • Hosted Android: install Android build-tools 29.0.0 or newer on hosting machines.
  • Claude Code worktree hooks are opt-in: nothing changes until a person accepts stim doctor --fix. Once installed, every Claude Code worktree of that checkout goes through Stim, and the Claude desktop app creates no worktree for a session Claude starts or forks. Delete the two hook entries from .claude/settings.local.json to turn them off.