feat(cache): integrate runner-aware IPC reports#407
Conversation
|
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. |
There was a problem hiding this comment.
💡 Codex Review
For cached tasks whose input/output are fully explicit (no { auto: true }), this branch never starts the IPC server or injects VP_RUN_NODE_CLIENT_PATH. Runner-aware calls like getEnv(..., { tracked: true }) and disableCache() therefore silently no-op, even though tracked envs are independent cache inputs and do not require fspy. In that configuration a build can produce output from an env value obtained through the client, then incorrectly hit the cache after the env changes because no report was collected.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // own parent env (not the task's filtered `all_envs`), so a | ||
| // tool can ask for vars the user never declared and have | ||
| // them fingerprinted via the tool's `tracked: true` flag. | ||
| let env_map: FxHashMap<Arc<OsStr>, Arc<OsStr>> = std::env::vars_os() |
There was a problem hiding this comment.
Serve IPC env lookups from the spawned environment
This captures only the runner process environment, but the actual child environment is spawn_execution.spawn_command.all_envs plus prefix envs and runtime injections. When a task uses a command prefix or other planned env override (for example FOO=prod node ... while the parent has FOO=dev or no FOO), getEnv('FOO') returns the parent value/None instead of what the spawned tool sees, so runner-aware tools can compute outputs from the wrong value and record the wrong post-run fingerprint.
Useful? React with 👍 / 👎.
b3a5cfa to
1ba9f54
Compare
0286cc8 to
9ae15ff
Compare
d2b5429 to
3c2c82d
Compare
07c0122 to
f256aae
Compare
3c2c82d to
1d4b087
Compare
1d4b087 to
fa9255d
Compare
58b706e to
a92c611
Compare
2858cb8 to
a587ced
Compare
70fab43 to
b293a61
Compare
a587ced to
8c46da5
Compare
b293a61 to
9abf3f6
Compare
8c46da5 to
a5cc208
Compare
9abf3f6 to
514e25c
Compare
a5cc208 to
4a3e31d
Compare
Replaces the previous PR's placeholder with the real `vite_task_server::serve(...)` call: per-task IPC server, napi addon embedded into the runner binary and materialized to disk on first use, `VP_RUN_NODE_CLIENT_PATH` injected into the child so the JS wrapper can `require()` it. Cache integration: `Reports` collected from the IPC drive `PostRunFingerprint` and the cache-update path — - `ignore_input` reads → excluded from input fingerprint - `ignore_output` writes → excluded from output archive - `tracked_envs` (single name) + `tracked_env_globs` → folded into the post-run fingerprint so a value change misses the cache - `disable_cache` → skips the cache-update path entirely (`ToolRequested`) - IPC server bind/runtime failure → `IpcServerError` cache disable End-to-end coverage via the `ipc_client_test` fixture set: one fixture per API method, each exercising the real Rust ↔ JS path and asserting the right cache behaviour. Adds `vtt` (test-only) helpers `grep_file` and `stat_file` that the fixtures need. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
514e25c to
4c0ac3d
Compare
4a3e31d to
9db3dd2
Compare
|
Superseded by restructured 2-PR stack:
|

Replaces the previous PR's placeholder with the real
vite_task_server::serve(...)call: per-task IPC server, napiaddon embedded into the runner binary and materialized to disk on
first use,
VP_RUN_NODE_CLIENT_PATHinjected into the child so theJS wrapper can
require()it.Cache integration:
Reportscollected from the IPC drivePostRunFingerprintand the cache-update path —ignore_inputreads → excluded from input fingerprintignore_outputwrites → excluded from output archivetracked_envs(single name) +tracked_env_globs→ folded intothe post-run fingerprint so a value change misses the cache
disable_cache→ skips the cache-update path entirely(
ToolRequested)IpcServerErrorcache disableEnd-to-end coverage via the
ipc_client_testfixture set: onefixture per API method, each exercising the real Rust ↔ JS path and
asserting the right cache behaviour. Adds
vtt(test-only)helpers
grep_fileandstat_filethat the fixtures need.Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com