fix(cache): exclude untrackedEnv names from tracked bulk env queries - #693
Open
simulacre7 wants to merge 1 commit into
Open
fix(cache): exclude untrackedEnv names from tracked bulk env queries#693simulacre7 wants to merge 1 commit into
simulacre7 wants to merge 1 commit into
Conversation
A tracked `getEnvs` query was validated against the full unfiltered parent environment, so a broad query (an empty prefix matches every variable) cache-missed whenever any ambient variable changed — on GitHub Actions, per-run variables like ACTIONS_ORCHESTRATION_ID made such tasks miss every run (voidzero-dev#505). `untrackedEnv` already declares variables non-build-affecting for spawn-env filtering (passed through, not fingerprinted). Apply the same contract to bulk queries: names matching the task's untracked patterns are excluded from the recorded match-set and from both sides of validation, while the runner still serves them to the tool. Filtering the stored side too lets entries recorded before this change keep hitting. Explicit single-name `getEnv` reads stay fingerprinted: naming a variable is a direct dependency declaration. Also add ACTIONS_* to DEFAULT_UNTRACKED_ENV next to GITHUB_*/RUNNER_*. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #505
Problem
A
trackedbulk env query (getEnvs) was validated against the full unfiltered parent environment, so a broad query — an empty prefix matches every variable — cache-missed whenever any ambient variable changed. On GitHub Actions, per-run variables likeACTIONS_ORCHESTRATION_IDmade such tasks miss every run.Where the fix belongs (answering the issue's question)
The issue asked whether to validate against the filtered env the task received. I didn't do that: the runner serves
getEnv/getEnvsfrom the unfiltered plan env context by design (CacheMetadata::unfiltered_envs), and validation must stay consistent with what served the original request — switching both to the filtered view would change what values tools see (e.g. Vite's env loader would stop seeing undeclared ambientVITE_*vars).Instead, this extends the existing
untrackedEnvcontract to bulk queries. For spawn-env filtering,untrackedEnvalready means "passed through, but not fingerprinted". Bulk queries now honor the same declaration:untrackedEnvpatterns are excluded from the stored match-set (collect_tracked_env_queries).PostRunFingerprint::validate). Filtering the stored side too lets entries recorded before this change keep hitting instead of forcing a one-time miss. The untracked config participates in the spawn fingerprint, so the pattern set at validation time matches the one at record time.getEnvreads stay fingerprinted: naming a variable is a direct dependency declaration by the tool, unlike a broad sweep.Also adds
ACTIONS_*toDEFAULT_UNTRACKED_ENVnext toGITHUB_*/RUNNER_*— that's the family the reproduction'sACTIONS_ORCHESTRATION_IDbelongs to.Test plan
fingerprint.rs: current-side exclusion, stored-side exclusion (pre-change entries), and a contrast test that a genuinely tracked match change still misses.fetch_envs_tracked_query_ignores_untracked_namesin theipc_client_testfixture: ambient noise matchinguntrackedEnvappears/changes → cache hit; tracked match changes → miss (snapshot shows the runner still serving the noise variable on the miss).ipc_client_testcases: 21/21 pass unchanged (no snapshot churn).cargo test(workspace): all 15 test binaries pass.cargo clippy -p vt -p vt_graph --all-targetsclean,cargo fmt --checkclean.vp, which bundles vite-task as a git dependency, so I couldn't point it at this branch directly. The new e2e case models the same mechanism (broad tracked query + volatile ambient variable).🤖 Generated with Claude Code