feat(cache): runner-aware auto output tracking + ignore consumption#431
Draft
wan9chi wants to merge 1 commit into
Draft
feat(cache): runner-aware auto output tracking + ignore consumption#431wan9chi wants to merge 1 commit into
wan9chi wants to merge 1 commit into
Conversation
Member
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
wan9chi
added a commit
to voidzero-dev/vite-plus
that referenced
this pull request
Jun 7, 2026
Repoints the vite-task git deps to the tip of the split stack (voidzero-dev/vite-task#431, the auto-output-track branch), whose crates tree is identical to the prior pin plus the runner env-change message refinement. Regenerates the two snapshots whose `VITE_*` cache-miss line now renders as "envs changed" (matching manual env config) instead of "tracked env glob 'VITE_*' changed". 🤖 Generated with [Claude Code](https://claude.com/claude-code)
68fb22e to
770f000
Compare
wan9chi
added a commit
that referenced
this pull request
Jun 11, 2026
… command (#436) ## Motivation The planning context's env map — the full session environment, typically hundreds of entries — was copied at every boundary it crossed during planning: - once into `PlanContext` per plan (`plan_query`), - once **per `&&`-item** by `PlanContext::duplicate` (each command gets a scoped context), - once more per `&&`-item into `ScriptCommand::envs` for program lookup and plan-request callbacks, - and once per spawn into `all_envs`. Of these, only the last one does real work — the spawn env is filtered in place by `EnvFingerprints::resolve`. Every other copy duplicates an almost-always-identical map just to hand it to the next stage, and the cost scales with task count × command count, not with actual env changes. The immediate trigger is the upcoming runner-aware caching work (#430/#431): it saves each spawn's **full env context** into the plan (`SpawnCommand::full_envs`) so `getEnv`/`getEnvs` and tracked-env validation resolve against the plan rather than the live process env. Without sharing, that would add yet another full map copy per spawn; with this change it costs a pointer. ## Approach Wrap the map in `Arc` with copy-on-write semantics: - Duplication and hand-off points (`duplicate`, `ScriptCommand::envs`, `PlanContext::new`) share the map — O(1). - The two mutation points pay for a copy only when they change something: `prepend_path` once per task node (package `.bin` PATH prepend), and `add_envs` only when a command actually has prefix envs — an empty prefix set is guarded so it doesn't break sharing. - The per-spawn `all_envs` clone remains, with a comment marking it as the one place the map's contents are genuinely copied. No behavior change; `Session` already held the map in an `Arc`, so its call sites are untouched. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
770f000 to
7f96b4e
Compare
Completes runner-aware caching on top of the IPC infra: - `output: None` resolves to auto inference again, so fspy-written files are archived and restored on a cache hit (auto output restoration). - `ignoreInput`/`ignoreOutput` reported over IPC are now applied: vite excludes its out dir and write-then-read temp files from the input fingerprint and read-write overlap check, so `vite build` caches and restores `dist/` without manual `!`-glob exclusions. - Re-adds the e2e coverage: ignoreInput keeps the cache valid, ignoreOutput allows a read-write overlap, and vite build caches and restores its outputs end-to-end. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
7f96b4e to
12d0ba9
Compare
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.

PR 2 of 2 — splits #410 into a Graphite stack.
Stack:
mainCompletes runner-aware caching on top of the IPC infra from #430. This PR's tree is identical to the original #410 tip.
output: Noneresolves to auto inference again, so fspy-written files are archived and restored on a cache hit (auto output restoration).ignoreInput/ignoreOutputreported over IPC are now applied: vite excludes its out dir and write-then-read temp files from the input fingerprint and read-write overlap check, sovite buildcaches and restoresdist/without manual!-glob exclusions.🤖 Generated with Claude Code