Skip to content

refactor(artifact): materialize into one vp_run folder in the user's temp dir - #974

Open
wan9chi wants to merge 1 commit into
mainfrom
claude/vp-run-temp-dir
Open

wan9chi wants to merge 1 commit into
mainfrom
claude/vp-run-temp-dir

Conversation

@wan9chi

@wan9chi wan9chi commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Motivation

Every caller of vt_materialized_artifact paired user_temp_dir(name) with .at(dir) and chose its own folder name, so vp run spread its helper files over fspy-<uid>, vt_client_napi-<uid> and vp-schemas-<uid> in the system temp dir. The user's own temp folder is part of how an artifact is materialized, so it belongs in the builder, with one name for everything vp run writes there.

Changes

  • artifact.materialize().suffix(…).at_user_temp_dir(prefix) creates the folder that only the current user can write to, with the same checks as before, and materializes the file into it. user_temp_dir is no longer public. .at(dir) stays for tests that use their own folder.
  • Every caller passes vp_run: fspy's preload library, macOS shell and coreutils and Windows DLL, the napi client, and the task graph's JSON Schema. They all go in {temp}/vp_run-{uid} on Unix and {temp}\vp_run on Windows. fspy's SpyImpl::init_in(dir) becomes SpyImpl::init().
  • The RFCs' $schema examples use the new folder.

🤖 Generated with Claude Code


Note

Low Risk
Refactor of temp-dir layout and artifact API with unchanged permission checks; no auth, cache, or task execution logic changes.

Overview
Unifies vp run temp artifacts under a single user-private directory (/tmp/vp_run-{uid} on Linux, {temp}\vp_run on Windows) instead of separate folders per artifact type (fspy-*, vt_client_napi-*, vp-schemas-*).

vt_materialized_artifact gains Materialize::at_user_temp_dir(prefix), which creates the scoped temp folder and materializes there; the public user_temp_dir helper is removed in favor of this builder step. fspy, the NAPI client, and task-graph JSON Schema materialization all pass vp_run; SpyImpl::init_in(dir) becomes SpyImpl::init() on Unix and Windows.

Docs, RFC examples, tests, and the changelog reflect the new $schema paths and the consolidated layout.

Reviewed by Cursor Bugbot for commit f18fca4. Bugbot is set up for automated code reviews on this repo. Configure here.

…temp dir

Every caller of `vt_materialized_artifact` paired `user_temp_dir(name)`
with `.at(dir)` and chose its own name, so `vp run` kept `fspy-<uid>`,
`vt_client_napi-<uid>` and `vp-schemas-<uid>` side by side in the temp
dir.

- `Materialize::at_user_temp_dir(prefix)` creates the user's own folder,
  with the same checks as before, and materializes into it.
  `user_temp_dir` is private.
- fspy, the napi client and the task graph's JSON Schema all use the
  prefix `vp_run`, so everything `vp run` writes there goes in
  `{temp}/vp_run-{uid}` on Unix, `{temp}\vp_run` on Windows. fspy's
  `SpyImpl::init_in(dir)` becomes `init()`.
- The RFCs' `$schema` examples use the new folder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wan9chi
wan9chi added this pull request to stack #975 November 7, 2026 17:19
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown

fspy benchmark

linux

dynamic/launch             change  +0.14%  [ -4.34% ..  +4.42%]  overhead   +60.36%
dynamic/access             change  +1.25%  [ -5.80% ..  +7.90%]  overhead   +21.60%
dynamic/access-relative    change  +0.87%  [ -2.65% ..  +3.55%]  overhead   +71.71%
dynamic/access-contended   change  +0.89%  [ -8.42% ..  +9.55%]  overhead   +48.09%
static/launch              change  +0.45%  [ -4.31% ..  +6.81%]  overhead  +195.79%
static/access              change  +0.48%  [ -1.25% ..  +4.11%]  overhead +1467.00%
static/access-relative     change  +0.68%  [-10.44% .. +17.03%]  overhead +1869.49%
static/access-contended    change  -1.09%  [ -4.02% ..  +0.65%]  overhead +1473.28%

macos

dynamic/launch             change  -0.40%  [ -5.61% ..  +4.82%]  overhead  +253.06%
dynamic/access             change  +0.33%  [ -6.88% .. +18.33%]  overhead    +4.94%
dynamic/access-relative    change  +1.29%  [-15.82% .. +14.99%]  overhead  +235.40%
dynamic/access-contended   change  +2.20%  [ -7.04% .. +14.58%]  overhead    +4.36%

windows

dynamic/launch             change  -0.01%  [ -4.08% ..  +4.51%]  overhead   +26.36%
dynamic/access             change  +0.00%  [ -1.05% ..  +1.41%]  overhead    +1.79%
dynamic/access-relative    change  +0.34%  [ -1.19% ..  +3.40%]  overhead    +1.58%
dynamic/access-contended   change  +0.34%  [ -3.05% ..  +8.60%]  overhead    +1.93%

This branch has not been deployed

No deployments
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