Finish Line
./build-fast.sh, local cleanup, and relevant CI cache policy use a documented cache strategy that keeps the primary checkout fast while preventing concurrent Every Code agent worktrees from sharing a writable Cargo target directory.
Current Status
State: Follow-up created from stale local branch cleanup review on 2026-06-06.
Source evidence:
- Dirty local worktree:
/Users/cbusillo/.code/working/code/branches/build-cache-strategy
- Branch:
feat/build-cache-strategy, no commits ahead of origin/main, behind current main, with only uncommitted edits.
- Recommendation: port selected ideas onto a fresh branch from current
origin/main, then delete the stale worktree.
Useful ideas to port selectively:
- Add
BUILD_FAST_CACHE_MODE=auto|shared|isolated to build-fast.sh.
- Default the primary checkout to a shared target bucket for warm repeated local builds.
- Default Every Code agent worktrees under
.code/working/*/branches/* and CI to isolated branch/worktree target buckets to avoid concurrent writable target sharing.
- Infer
CODE_HOME from .code/working/.../branches/... paths in build-fast.sh and scripts/local/cleanup-space.sh.
- Consider reading the Rust toolchain from
code-rs/rust-toolchain.toml in .github/workflows/upstream-merge.yml instead of hardcoding it.
- Consider larger or more stable sccache/rust-cache keys for upstream merge validation.
Known risks:
- Do not apply the stale branch wholesale; current
origin/main has newer substrate/docs/build logic.
- The old workflow diff mixed
code-rs/target and codex-rs/target in different env paths, so CI cache changes need deliberate validation.
- Documentation should be updated only after the implemented cache behavior is finalized.
Acceptance Criteria
- Fresh task branch from current main ports the selected cache-mode behavior without unrelated stale diffs.
build-fast.sh documents and validates BUILD_FAST_CACHE_MODE values.
- Agent worktrees get isolated target dirs by default; primary checkout keeps a warm shared bucket by default.
scripts/local/cleanup-space.sh resolves the same inferred cache home as build-fast.sh for .code/working branches.
- Workflow cache changes, if included, keep
code-rs/codex-rs target paths internally consistent.
- Repo-required
./build-fast.sh passes cleanly.
Relationships
Finish Line
./build-fast.sh, local cleanup, and relevant CI cache policy use a documented cache strategy that keeps the primary checkout fast while preventing concurrent Every Code agent worktrees from sharing a writable Cargo target directory.Current Status
State: Follow-up created from stale local branch cleanup review on 2026-06-06.
Source evidence:
/Users/cbusillo/.code/working/code/branches/build-cache-strategyfeat/build-cache-strategy, no commits ahead oforigin/main, behind current main, with only uncommitted edits.origin/main, then delete the stale worktree.Useful ideas to port selectively:
BUILD_FAST_CACHE_MODE=auto|shared|isolatedtobuild-fast.sh..code/working/*/branches/*and CI to isolated branch/worktree target buckets to avoid concurrent writable target sharing.CODE_HOMEfrom.code/working/.../branches/...paths inbuild-fast.shandscripts/local/cleanup-space.sh.code-rs/rust-toolchain.tomlin.github/workflows/upstream-merge.ymlinstead of hardcoding it.Known risks:
origin/mainhas newer substrate/docs/build logic.code-rs/targetandcodex-rs/targetin different env paths, so CI cache changes need deliberate validation.Acceptance Criteria
build-fast.shdocuments and validatesBUILD_FAST_CACHE_MODEvalues.scripts/local/cleanup-space.shresolves the same inferred cache home asbuild-fast.shfor.code/workingbranches.code-rs/codex-rstarget paths internally consistent../build-fast.shpasses cleanly.Relationships