Skip to content

Partition overridden Metro cache roots by app - #94

Merged
janicduplessis merged 1 commit into
mainfrom
codex/issue-75-cache-root-segment
Aug 29, 2026
Merged

Partition overridden Metro cache roots by app#94
janicduplessis merged 1 commit into
mainfrom
codex/issue-75-cache-root-segment

Conversation

@janicduplessis

@janicduplessis janicduplessis commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator

Description

STIM_CLI_METRO_CACHE and machine-level caches.metroCache currently bypass the app-name segment, causing configured roots to become one flat Metro store. This makes per-app reporting and pruning impossible.

Closes #75.

Solution

  • Treat both Metro overrides as parent roots and append the same sanitized app name used by the default layout.
  • Keep environment, machine-config, and default resolution aligned across @stim-cli/core, @stim-cli/metro, and the CLI's bare and Expo start paths.
  • New named registrations carry a versioned metro-named-v1 layout marker. They replace only an exact unmarked legacy flat Metro record; if an older package registers that parent afterward, current gc suppresses it only when a marked child proves the migration. Marked stores are preserved when they later become another override parent and remain visible but report-only while a marked child exists. Canonical and symlinked child relationships are handled safely. Existing root-level files are left untouched for manual cleanup.
  • Document the new contract and migration in the package docs, shipped skill, and guide.

Test plan

  • Cover default, machine-config, environment-precedence, relative-config rejection, and name-sanitization contracts.
  • Verify standalone and CLI layout markers, marked/unmarked replacement, both mixed-version registration orders, nested current parent/child discovery, real and symlinked-child gc --delete --older-than safety, and unrelated same-root/ancestor preservation.
  • Run pnpm run format:check, pnpm run lint, pnpm run build, pnpm run typecheck, pnpm run knip, pnpm run test:runtime, and pnpm test (2,273 passing).
  • Run pnpm run test:e2e (12 passing).
  • Run all four native cache harness variants with --dry-run; no full native device build was performed.

@janicduplessis
janicduplessis force-pushed the codex/issue-75-cache-root-segment branch from b0bcb98 to 7502f4b Compare August 29, 2026 04:52
@janicduplessis
janicduplessis marked this pull request as ready for review August 29, 2026 04:53
@janicduplessis
janicduplessis merged commit 56f1647 into main Aug 29, 2026
5 checks passed
@janicduplessis
janicduplessis deleted the codex/issue-75-cache-root-segment branch August 29, 2026 04:54
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.

Metro store: a cache-root override drops the per-app partition, so gc cannot prune per app

1 participant