Simplified cache architecture for VEX Source Control speed
The target is not more caches; it is fewer slow paths and deterministic reuse.
In-memory + fs locality cache
Keep metadata indexes, recent object lookups, and CLI transaction state in hot memory, with bounded spill to local filesystem.
Fast npm cache plane
Use package-lock + platform/toolchain fingerprinted caches so repeated installs in repo subtrees are near-zero-cost.
Py cache plane
Persist pycache and interpreter-specific wheel state in a deterministic namespace keyed by python version and dependency graph.
Build result cache
Store compiled outputs keyed by inputs, command options, toolchain, and env digests to avoid rebuilding unchanged targets.
VFS materialization cache
Serve directory listings and file reads from a FUSE mount, fetching cold blobs on demand and preserving hot working sets locally.
Performance target
Fastest path = no repeated parsing, no repeated downloads, no repeated compile output, no repeated index scans. Cache layers must answer the same request across agents in under-human latency.
FUSE-based VFS target
Repository mounted as a working tree
The planned VFS mode mounts a VEX workspace as a normal filesystem path. Directory structure and metadata can be answered from compact indexes, while file contents are materialized only when a process opens them. That keeps clone time and disk use tied to the active working set instead of the full repo size.
Cold remote, hot local
Remote object storage remains the durable source of truth. The local mount keeps recently read blobs, write overlays, and path indexes close enough for editors, agents, search, tests, and build tools to behave like they are operating on a fully checked-out tree.
Cache orchestration model
Simplified Bazel-like graph
Model tasks as a directed graph of inputs, outputs, and command edges. Cache every node with explicit signatures.
Remote + local fallback
Prefer remote artifact reads for shared CI nodes and local SSD for developers; promote misses to local quickly.
Output-aware invalidation
Invalidations only when relevant signature fields change, not on broad branch events.
Mount-aware prefetch
Use path history, build graph hints, and editor access patterns to hydrate likely-next files without blocking first paint of the tree.
Cache key proposal
cache_key = hash( workspace_path, command, input_digests, tool_versions, env_profile, lockfile_digest, node_platform, python_abi )
Cache targets
- • Virtual filesystem directory listings, file metadata, and hydrated blob chunks.
- • JS/NPM workspace artifacts (per lockfile/platform).
- • Python bytecode and wheel state.
- • Turbo outputs and dist artifacts.
- • Binary helper caches for local tools (e.g., JJ, Rust toolchains).
- • Object-presence indexes for upload/download acceleration.