fix(core): avoid recompiling on Git index changes
Touching the builder checkout’s Git index currently reruns agent-relay-node’s build script and recompiles the core and its consumers, although the index does not affect any embedded metadata. Watch only HEAD and its active ref, preserving correct revision changes for branch and detached checkouts.
The regression test compiles and executes the real build script against a temporary external Git checkout. It covers staging-only changes, commits on a branch and detached HEAD, and explicit release versions that bypass development changelog parsing. It rejects the original index watcher.
Validation:
- Standalone build-script regression test passes; rustfmt and git diff checks pass.
- Cargo
--timingsand fingerprint logging confirm the original invalidation path:.git/index→ public node library → private desktop library → executable.
Controlled local release benchmark (macOS, Rust 1.95.0, CARGO_INCREMENTAL=0, --locked --offline --release --timings, fixed version 2026.11.999):
| Input change | Before | After | Recompiled after |
|---|---|---|---|
Touch only builder .git/index | 78.693s | 0.317s | None (272 fresh artifacts) |
| No input change | 0.441s (original Git dependency) | 0.148s | None |
The before/after index measurements use the same local dependency path, target directory, desktop snapshot 17c4b47d3b507b74632a415e95d49b79aae1931a, and public source 31eac487; only this build-script patch differs, with a seed build before each measurement. The desktop snapshot is an in-flight review tree, not landed main. The original Git dependency independently reproduced the index-only rebuild in 65.813s. These are single-run diagnostic measurements; host load varies. This is a local warm-build improvement, not a measured fresh-run CI release speedup. No runtime behavior or metadata contract changes.
![Autofix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.