You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Route high-churn local build targets, caches, temp output, and runner scratch for Codex Lab development to /Volumes/Developer-Artifacts, without moving existing artifacts today.
This plan makes local development, spawned worktrees, and Every Code agent sessions use predictable artifact locations while preserving safe fallback behavior for contributors who do not have the volume mounted.
Related context: #22 covers CI/local speed observations. This issue owned local high-churn artifact routing.
Non-Goals
No move to /Volumes/Docker-External.
No migration of existing artifact trees.
No requirement that ordinary contributors have /Volumes/Developer-Artifacts mounted.
No committed machine-specific absolute paths in shared repo config.
No tracked .npmrc or global package-manager config mutation.
Completed Policy
Use /Volumes/Developer-Artifacts/local/codex-lab/ as the local root for rebuildable high-churn data owned by this repo when CODEX_LAB_DEVELOPER_ARTIFACTS_ROOT is configured and writable.
Shared or reusable cache candidates:
Cargo shared local target for human/main checkout workflows by default.
Bazel disk, repo contents, and repository caches via generated local user.bazelrc.
pnpm store, npm cache, temp output, and optional sccache through opt-in sourceable local env.
Isolated mutable output candidates:
Worktree/agent Cargo targets via CODEX_LAB_CARGO_TARGET_SCOPE=worktree|agent and optional CODEX_LAB_CARGO_TARGET_KEY.
External agent process Cargo targets keyed by agent thread id.
Exec harness Cargo target and output/report roots.
Safety posture:
Missing artifact volume remains a visible fallback, not a hard requirement for normal contributors.
Cleanup remains dry-run by default.
Cleanup only deletes known rebuildable paths and uses physical path bounds for custom exec-harness output and artifact temp paths.
Add opt-in local artifact environment #204 PR checks: ci 58s, exec-harness 44s, codex-lab-app 26s, Codespell, cargo-deny. Post-merge main: ci 1m13s, cargo-deny 1m29s, Codespell 26s.
Local focused validation for the final state included tools/codex-exec-harness/test_local_cleanup.py, scripts/local unit tests, bash -n, shfmt -d, git diff --check, and a live artifact-env.sh probe for pnpm/npm/temp/sccache env behavior.
Focused read-only review agents reviewed each implementation slice. Findings on target key escaping, inherited Cargo target overrides, Unix test portability, cleanup traversal, and artifact temp deletion bounds were fixed before merge.
Background auto-review did not produce findings for the later slices because the broad review scope exceeded configured background size limits; there was no detached finding to apply.
Final State
just local-speed-status now reports all planned high-churn categories and candidate artifact paths.
just local-cleanup-space remains dry-run by default and covers known rebuildable local paths with keep flags for shared caches/temp.
just local-artifact-setup --apply can generate the ignored local user.bazelrc and prepare package/temp artifact directories when the artifact root is mounted.
eval "$(just local-artifact-env)" is the opt-in shell path for pnpm/npm/temp and optional sccache routing. This intentionally avoids tracked .npmrc changes or global config mutation.
Main checkout codex-rs/target symlink can remain a local guardrail, not the worktree strategy.
Closed
All acceptance criteria for this local artifact-routing plan are satisfied in repo-owned tooling. Future changes, if desired, should be new issues rather than reopening this plan:
Observing real-world agent/worktree cache behavior after several PRs.
Enabling sccache automatically for a specific workflow or host class.
Moving any caches/runners to /Volumes/Docker-External, which was explicitly out of scope here.
Goal
Route high-churn local build targets, caches, temp output, and runner scratch for Codex Lab development to
/Volumes/Developer-Artifacts, without moving existing artifacts today.This plan makes local development, spawned worktrees, and Every Code agent sessions use predictable artifact locations while preserving safe fallback behavior for contributors who do not have the volume mounted.
Related context: #22 covers CI/local speed observations. This issue owned local high-churn artifact routing.
Non-Goals
/Volumes/Docker-External./Volumes/Developer-Artifactsmounted..npmrcor global package-manager config mutation.Completed Policy
Use
/Volumes/Developer-Artifacts/local/codex-lab/as the local root for rebuildable high-churn data owned by this repo whenCODEX_LAB_DEVELOPER_ARTIFACTS_ROOTis configured and writable.Shared or reusable cache candidates:
user.bazelrc.sccachethrough opt-in sourceable local env.Isolated mutable output candidates:
CODEX_LAB_CARGO_TARGET_SCOPE=worktree|agentand optionalCODEX_LAB_CARGO_TARGET_KEY.Safety posture:
Merged Implementation
Route local Cargo recipes through artifact root #200 merged as
8769813b8f03a0a887c845c0810c6ca4355b6205.justrecipes throughscripts/local/cargo-build-env.sh.app-server-test-clientcross-platform with Unix/Windows recipe bodies.just local-speed-statusto show Cargo, worktree, exec-harness, Bazel, Node, optional sccache, temp, runner, and remote compile host status.CARGO_TARGET_DIRwhen locating the builtcodexbinary.Add scoped local cargo targets for worktrees #201 merged as
2673316bdf889c2e5b534941154fcdd5e05a70d1.CODEX_LAB_CARGO_TARGET_SCOPE=shared|worktree|agentand optionalCODEX_LAB_CARGO_TARGET_KEYtoscripts/local/cargo-build-env.sh...cannot escape theworktreesnamespace.Route external agent cargo targets by thread #202 merged as
54e587778e86664eff17a05539667d2fb075a47b.CODEX_LAB_CARGO_TARGET_SCOPE=agentandCODEX_LAB_CARGO_TARGET_KEY=<thread_id>for external agent child processes.CARGO_TARGET_DIR/CODEX_LAB_CARGO_TARGET_DIRfrom external agent child env so scope/key routing cannot be shadowed.Route exec harness output to local artifacts #203 merged as
935873a735906763f560123e133565e77f5c1d13.scripts/local/exec-harness-env.sh.just exec-harness-testto consume those exports in one shell invocation.scripts/local/setup-artifacts.shto dry-run or generate ignored localuser.bazelrcrouting.Add opt-in local artifact environment #204 merged as
f980ff9429f19e6d78799aad56f73825a4795fdb.scripts/local/artifact-env.shfor pnpm store, npm cache, temp output, and optional sccache routing under the artifact root.just local-artifact-env.setup-artifacts.shdry-run/apply output to advertise/provision the opt-in local env paths.just local-speed-statuswithout mutating active env.--keep-artifact-temp.Validation Evidence
ci1m01s,exec-harness43s, Codespell, cargo-deny. Post-merge main:ci1m00s,cargo-deny1m35s, Codespell.ci1m08s,exec-harness15m37s,codex-lab-app11m42s, Codespell, cargo-deny. Post-merge main:ci1m02s,cargo-deny1m29s, Codespell 22s.ci1m02s,exec-harness43s, Codespell, cargo-deny. Post-merge main:ci1m04s,cargo-deny1m36s, Codespell 23s.ci58s,exec-harness44s,codex-lab-app26s, Codespell, cargo-deny. Post-merge main:ci1m13s,cargo-deny1m29s, Codespell 26s.tools/codex-exec-harness/test_local_cleanup.py,scripts/localunit tests,bash -n,shfmt -d,git diff --check, and a liveartifact-env.shprobe for pnpm/npm/temp/sccache env behavior.Final State
just local-speed-statusnow reports all planned high-churn categories and candidate artifact paths.just local-cleanup-spaceremains dry-run by default and covers known rebuildable local paths with keep flags for shared caches/temp.just local-artifact-setup --applycan generate the ignored localuser.bazelrcand prepare package/temp artifact directories when the artifact root is mounted.eval "$(just local-artifact-env)"is the opt-in shell path for pnpm/npm/temp and optional sccache routing. This intentionally avoids tracked.npmrcchanges or global config mutation.codex-rs/targetsymlink can remain a local guardrail, not the worktree strategy.Closed
All acceptance criteria for this local artifact-routing plan are satisfied in repo-owned tooling. Future changes, if desired, should be new issues rather than reopening this plan:
sccacheautomatically for a specific workflow or host class./Volumes/Docker-External, which was explicitly out of scope here.