Skip to content

feat(cache): integrate runner-aware IPC reports#407

Closed
branchseer wants to merge 1 commit into
feat/runner-execute-refactorfrom
feat/runner-cache-integration
Closed

feat(cache): integrate runner-aware IPC reports#407
branchseer wants to merge 1 commit into
feat/runner-execute-refactorfrom
feat/runner-cache-integration

Conversation

@branchseer
Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
Member Author

branchseer commented May 28, 2026

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.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

if metadata.input_config.includes_auto || metadata.output_config.includes_auto {

P2 Badge Start IPC even when auto file tracking is disabled

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()
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@branchseer branchseer force-pushed the feat/runner-cache-integration branch from b3a5cfa to 1ba9f54 Compare May 28, 2026 08:02
@branchseer branchseer force-pushed the feat/runner-execute-refactor branch 2 times, most recently from 0286cc8 to 9ae15ff Compare May 28, 2026 08:05
@branchseer branchseer force-pushed the feat/runner-cache-integration branch 2 times, most recently from d2b5429 to 3c2c82d Compare May 28, 2026 08:09
@branchseer branchseer force-pushed the feat/runner-execute-refactor branch 2 times, most recently from 07c0122 to f256aae Compare May 28, 2026 08:29
@branchseer branchseer force-pushed the feat/runner-cache-integration branch from 3c2c82d to 1d4b087 Compare May 28, 2026 08:29
@branchseer branchseer changed the title feat(runner): wire up the IPC server + cache integration + first-party e2e feat(cache): integrate runner-aware IPC reports May 28, 2026
@branchseer branchseer force-pushed the feat/runner-cache-integration branch from 1d4b087 to fa9255d Compare May 28, 2026 09:07
@branchseer branchseer force-pushed the feat/runner-execute-refactor branch 2 times, most recently from 58b706e to a92c611 Compare May 28, 2026 09:09
@branchseer branchseer force-pushed the feat/runner-cache-integration branch 2 times, most recently from 2858cb8 to a587ced Compare May 28, 2026 09:11
@branchseer branchseer force-pushed the feat/runner-execute-refactor branch 2 times, most recently from 70fab43 to b293a61 Compare May 28, 2026 09:57
@branchseer branchseer force-pushed the feat/runner-cache-integration branch from a587ced to 8c46da5 Compare May 28, 2026 09:57
@branchseer branchseer force-pushed the feat/runner-execute-refactor branch from b293a61 to 9abf3f6 Compare May 28, 2026 10:13
@branchseer branchseer force-pushed the feat/runner-cache-integration branch from 8c46da5 to a5cc208 Compare May 28, 2026 10:13
@branchseer branchseer force-pushed the feat/runner-execute-refactor branch from 9abf3f6 to 514e25c Compare May 28, 2026 10:43
@branchseer branchseer force-pushed the feat/runner-cache-integration branch from a5cc208 to 4a3e31d Compare May 28, 2026 10:43
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>
@branchseer branchseer force-pushed the feat/runner-execute-refactor branch from 514e25c to 4c0ac3d Compare May 28, 2026 11:46
@branchseer branchseer force-pushed the feat/runner-cache-integration branch from 4a3e31d to 9db3dd2 Compare May 28, 2026 11:46
@branchseer
Copy link
Copy Markdown
Member Author

Superseded by restructured 2-PR stack:

@branchseer branchseer closed this May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant