* Share mobile build caches between worktrees
The first `bun run mobile:ios` or `mobile:android` build in a new worktree
compiled all native code and transformed all JavaScript again. These
caches are now in `openbot-mobile-cache.noindex` of the common git
directory, so a new worktree reuses the work of other worktrees.
- Metro: `apps/mobile/metro-cache.js` keeps the transforms in one
namespace for each set of mobile dependencies in `bun.lock` and their
patches, because the Metro cache key does not include the versions of
the Babel plugins. When `bun.lock` or a patch is newer than the install
stamp, Metro warns and does not use the shared cache. A transform that
contains the checkout path, such as a `use dom` component, stays in the
worktree. The launchers keep the cache when React Native or Expo clear
it before a release bundle. EAS builds keep the Uniwind store.
- Xcode: the `xcodebuild` wrapper turns on the compilation cache with
prefix mapping of the checkout path.
- Android: ccache also compiles the CMake projects of the libraries.
`OPENBOT_MOBILE_BUILD_CACHE=<directory>` moves the caches, and `off`
turns them off. The fingerprint and the runtime version do not change:
no changed file is a fingerprint input.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Let knip accept the ccache binary
`scripts/mobile-android.ts` runs `ccache --version` to find out if ccache
is installed. ccache is a system tool, like cmake, so knip must not
report it as an unlisted binary.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Resolve the mobile build cache directory in one place
`scripts/mobile-ios.ts` had a copy of the cache directory rule of
`apps/mobile/metro-cache.js`. It now loads the rule from that file.
A relative `OPENBOT_MOBILE_BUILD_CACHE` now starts at the checkout root.
Before, each process resolved it against its own current directory, so
Metro and Xcode could use different directories.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Load the cache resolver by an absolute path
The `require` of `scripts/mobile-ios.ts` starts at `apps/mobile`, but knip
resolved `./metro-cache.js` from `scripts/` and reported an unresolved
import. An absolute path loads the same file.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* Remove code comments and add the no-comments rule
Remove the comments from first-party code and configuration files:
TS/JS, JSX, CSS, SQL migrations, Swift, Kotlin, Gradle, shell,
Docker, systemd, Nix, YAML, TOML, JSONC and GritQL.
Keep only what a tool reads: license headers, shebangs, compiler
and lint directives, JSDoc types in plain .js files, generated file
headers, GritQL scope lines, the install-server.sh help text and the
openbot-boat-pre-stop marker. Vendored code, fixtures and released
schemas keep their comments.
Add the rule to AGENTS.md, and change the docs that asked for
comments. Add two i18n keys that only comments named to
RELEASED_SOURCE_KEYS.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Keep comments that are data in strings
The benchmark task files in opencode-free-models-bench.ts tell the
model what each function must do. The sample file and HTML page in
the two stories are display content. Put their comments back.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Keep released migrations and mobile native inputs unchanged
check:migrations compares each released migration with v0.73.0 byte
for byte, so restore src/backend/migrations. A change to a native
build input of apps/mobile makes a new runtime version, so restore
those files and the extra fingerprint sources.
List these files and the comment markers that a tool reads in
AGENTS.md. Remove the last requests for comments in
src/renderer/AGENTS.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
- Stop mobile:ios and mobile:android when node_modules is missing. Bun
then resolves expo from its global cache, where @expo/cli is missing.
- Create the Metro file map cache directory. Metro does not create it.
- Keep Xcode DerivedData in ios/DerivedData, not ios/build. CocoaPods
writes codegen output to ios/build/generated.
- Install pods again when their codegen output is missing.
- mobile:android runs a wrapper. A release variant builds native code only
for the ABIs of the connected devices. The local gradle.properties enables
the shared Gradle build cache. ccache removes the worktree path.
- mobile:ios puts an xcodebuild shim first on PATH. It keeps DerivedData in
apps/mobile/ios/build, not in ~/Library/Developer/Xcode/DerivedData.
- Metro keeps its caches in apps/mobile/.expo, not in the temporary directory.