Skip to content

Commit d5ba6e8

Browse files
branchseerclaude
andcommitted
refactor(cache): update comments to remove pre-run/post-run key-value framing
The cache key and value are no longer conceptually divided as pre-run vs post-run fingerprints. Update doc comments to describe what each struct contains directly, and remove stale `# Arguments` sections. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 6daa8fa commit d5ba6e8

1 file changed

Lines changed: 6 additions & 15 deletions

File tree

  • crates/vite_task/src/session/cache

crates/vite_task/src/session/cache/mod.rs

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,10 @@ impl CacheEntryKey {
6666
}
6767
}
6868

69-
/// Command cache value, for validating post-run fingerprint after the spawn fingerprint is matched,
70-
/// and replaying the std outputs if validated.
69+
/// Cached execution result for a task.
70+
///
71+
/// Contains the post-run fingerprint (from fspy), captured outputs,
72+
/// execution duration, and explicit input file hashes.
7173
#[derive(Debug, Encode, Decode, Serialize)]
7274
pub struct CacheEntryValue {
7375
pub post_run_fingerprint: PostRunFingerprint,
@@ -187,13 +189,8 @@ impl ExecutionCache {
187189
Ok(())
188190
}
189191

190-
/// Try to hit cache with pre-run fingerprint (spawn + globbed inputs).
192+
/// Try to hit cache by looking up the cache entry key and validating inputs.
191193
/// Returns `Ok(Ok(cache_value))` on cache hit, `Ok(Err(cache_miss))` on miss.
192-
///
193-
/// # Arguments
194-
/// * `cache_metadata` - Cache metadata from plan stage
195-
/// * `globbed_inputs` - Hashes of explicit input files computed from positive globs
196-
/// * `workspace_root` - Workspace root for converting paths and validating fingerprints
197194
#[tracing::instrument(level = "debug", skip_all)]
198195
pub async fn try_hit(
199196
&self,
@@ -207,7 +204,7 @@ impl ExecutionCache {
207204

208205
let cache_key = CacheEntryKey::from_metadata(cache_metadata, workspace_root)?;
209206

210-
// Try to directly find the cache by pre-run fingerprint first
207+
// Try to find the cache entry by key (spawn fingerprint + input config + glob base)
211208
if let Some(cache_value) = self.get_by_cache_key(&cache_key).await? {
212209
// Validate explicit globbed inputs against the stored values
213210
if let Some(mismatch) =
@@ -253,12 +250,6 @@ impl ExecutionCache {
253250
}
254251

255252
/// Update cache after successful execution.
256-
///
257-
/// # Arguments
258-
/// * `cache_metadata` - Cache metadata from plan stage
259-
/// * `globbed_inputs` - Hashes of explicit input files computed from positive globs
260-
/// * `workspace_root` - Workspace root for converting absolute paths to relative
261-
/// * `cache_value` - The cache value to store (outputs and post-run fingerprint)
262253
#[tracing::instrument(level = "debug", skip_all)]
263254
pub async fn update(
264255
&self,

0 commit comments

Comments
 (0)