Skip to content

refactor(cache): rename execute cache_base_path to workspace_root#434

Merged
wan9chi merged 1 commit into
mainfrom
refactor-cache-workspace-root
Jun 9, 2026
Merged

refactor(cache): rename execute cache_base_path to workspace_root#434
wan9chi merged 1 commit into
mainfrom
refactor-cache-workspace-root

Conversation

@wan9chi

@wan9chi wan9chi commented Jun 9, 2026

Copy link
Copy Markdown
Member

Why

crates/vite_task had two unrelated fields both named cache_base_path, which was a trap for anyone reading across the cache code:

  • In session/mod.rs, it meant the cache directory — the parent of all vN schema-version subdirs.
  • In execute/mod.rs, it meant the workspace root — the directory that relative paths stored in cache entries (inputs, outputs, archives) are resolved against. It is literally set to self.workspace_path.

Same name, opposite halves of the cache machinery (where the cache lives vs. what cached paths point at).

What

This PR renames the execute one to workspace_root, naming it for the value it actually holds and disambiguating it from the cache directory. The doc comment is updated to spell out the role. All 10 references (the ExecutionContext field and the execute_spawn parameter it feeds) are renamed.

The session field was renamed to cache_root in the parent PR (#433), so after both PRs the two concepts read clearly:

Field Where Meaning
cache_root session parent of all vN cache dirs
cache_path session this build's versioned dir (…/v13)
workspace_root execute dir that cached relative paths anchor to
cache_dir execute where cache files (db, archives) are stored

Pure rename + doc tidy; no behavior change. cargo check -p vite_task passes.

🤖 Generated with Claude Code

wan9chi commented Jun 9, 2026

Copy link
Copy Markdown
Member Author

@wan9chi wan9chi marked this pull request as ready for review June 9, 2026 15:58
@wan9chi wan9chi force-pushed the refactor-cache-workspace-root branch from 8fda062 to a22c31b Compare June 9, 2026 15:59
@wan9chi wan9chi changed the base branch from fix-cache-per-version-dir to graphite-base/434 June 9, 2026 16:00
@wan9chi wan9chi force-pushed the graphite-base/434 branch from 1d5bc23 to 7ed8c9d Compare June 9, 2026 16:01
@wan9chi wan9chi force-pushed the refactor-cache-workspace-root branch from a22c31b to 69fa227 Compare June 9, 2026 16:01
@graphite-app graphite-app Bot changed the base branch from graphite-base/434 to main June 9, 2026 16:01
The ExecutionContext field (and the execute_spawn parameter it feeds) was
named `cache_base_path` but holds the workspace root that relative paths in
cache entries anchor to. Rename it to `workspace_root`, matching the value it
is given (self.workspace_path) and disambiguating from the session's
`cache_root`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@wan9chi wan9chi force-pushed the refactor-cache-workspace-root branch from 69fa227 to 1171b9e Compare June 9, 2026 16:01
@wan9chi wan9chi merged commit 5fda98a into main Jun 9, 2026
18 checks passed

wan9chi commented Jun 9, 2026

Copy link
Copy Markdown
Member Author

Merge activity

@wan9chi wan9chi deleted the refactor-cache-workspace-root branch June 9, 2026 16:06
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.

1 participant