Skip to content

fix(eliza-harness): resolve shared alpha cache dirs via XDG_CACHE_HOME - #2405

Open
NubsCarson wants to merge 1 commit into
developfrom
fix/eliza-harness-xdg-cache-home
Open

NubsCarson wants to merge 1 commit into
developfrom
fix/eliza-harness-xdg-cache-home

Conversation

@NubsCarson

Copy link
Copy Markdown
Collaborator

Summary

Makes @repo/eliza-harness resolve shared eliza checkout, pack, and QA state directories under $XDG_CACHE_HOME/alpha (falling back cleanly to ~/.cache/alpha when XDG_CACHE_HOME is unset, blank, or relative), and adds XDG_CACHE_HOME to turbo.json's globalPassThroughEnv:

  • Why: vibestack-remote (vibestack/remote/depot.ts) sets XDG_CACHE_HOME=<depot>/cache on remote Boat sandboxes specifically because Boat drops files added under ~/.cache when a box stops or is snapshotted. Previously, packages/eliza-harness/src/{checkout,pack,qa}.ts hardcoded path.join(os.homedir(), ".cache/alpha/..."), causing every Boat box to build eliza into ephemeral $HOME/.cache/... instead of the persistent depot cache, and turbo.json stripped XDG_CACHE_HOME inside Turbo tasks.
  • Changes (5 files):
    • packages/eliza-harness/src/checkout.ts: add alphaCacheDir(overrideEnv, ...segments) (honors non-blank explicit override env var first, then absolute trimmed XDG_CACHE_HOME, else ~/.cache), and wire checkout() through it.
    • packages/eliza-harness/src/pack.ts and packages/eliza-harness/src/qa.ts: route packRoot() and qaState() through alphaCacheDir() so shared checkouts, packs, and QA state stay colocated under $XDG_CACHE_HOME/alpha (preserving eliza-pin --prune sibling eliza-pack discovery and macOS default ~/.cache/alpha behavior).
    • turbo.json: add "XDG_CACHE_HOME" to globalPassThroughEnv alongside "ALPHA_ELIZA_DIR" and "QUINT_HOME" so Turbo tasks (test, build, typecheck, etc.) receive the depot XDG_CACHE_HOME without altering cache keys.
    • packages/eliza-harness/test/harness.test.ts: add unit test verifying default ~/.cache fallback, trimmed absolute XDG_CACHE_HOME, blank/whitespace/relative XDG_CACHE_HOME fallback, blank explicit override fallback, and explicit ALPHA_ELIZA_DIR/ALPHA_ELIZA_PACK_DIR/ALPHA_QA_STATE precedence.
  • Follow-up (kept separate to avoid root package.json / vibestack.json hash churn in this PR): adding a committed remote config (provision running pnpm eliza keyed on provisionInputs: ["**/vibestack/src/doctor.ts", "eliza.lock.json"]) plus optional upstream lalalune/vibestack remote.cacheDirs fingerprinting and depot GC will bake prebuilt .eliza checkouts into shared Boat templates automatically.

Verification

  • Boat (vibestack-remote) end-to-end pnpm eliza: cloned and built pinned eliza@8dc9b2db6def directly into $XDG_CACHE_HOME/alpha/eliza-vibestack/8dc9b2db6def (inside the Boat depot cache) and linked .eliza to it.
  • pnpm --filter @repo/eliza-harness typecheck and build: PASS
  • pnpm --filter @repo/eliza-harness test (direct): 3/3 files, 24/24 tests PASS
  • pnpm exec turbo run test --filter=@repo/eliza-harness --force (through Turbo with XDG_CACHE_HOME passthrough): 3/3 files, 24/24 tests PASS
  • eslint --max-warnings 0 (4 .ts files), jscpd --threshold 0 (0 clones), madge --circular (0 cycles), knip --workspace packages/eliza-harness, pnpm no-bun, and git diff --check: ALL PASS

Resolve shared eliza checkout, pack, and QA cache paths via trimmed absolute XDG_CACHE_HOME with fallback to ~/.cache when unset, blank, or relative, while keeping explicit ALPHA_ELIZA_DIR, ALPHA_ELIZA_PACK_DIR, and ALPHA_QA_STATE overrides highest priority.

Also add XDG_CACHE_HOME to turbo.json globalPassThroughEnv so Turbo tasks on remote Boat sandboxes see the persistent depot cache home instead of falling back to ephemeral ~/.cache, and add unit tests covering override and fallback behavior.
Copilot AI balanced review requested due to automatic review settings December 4, 2026 20:43
@NubsCarson
NubsCarson requested a deployment to turbo-cache-read December 4, 2026 20:43 — with GitHub Actions In progress

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@NubsCarson
NubsCarson requested a deployment to turbo-cache-read December 4, 2026 21:00 — with GitHub Actions Pending
@NubsCarson
NubsCarson requested a deployment to turbo-cache-read December 4, 2026 21:00 — with GitHub Actions Pending
@NubsCarson
NubsCarson requested a deployment to turbo-cache-read December 4, 2026 21:00 — with GitHub Actions Pending
@NubsCarson
NubsCarson requested a deployment to turbo-cache-read December 4, 2026 21:00 — with GitHub Actions Pending

This branch is pending to be deployed

1 pending deployment
turbo-cache-read — df83154b Pending Dec 4, 2026 by NubsCarson via selftest-c #1634
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants