Skip to content

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

Merged
wan9chi merged 1 commit into
mainfrom
claude/vp-run-temp-dir
Nov 9, 2026
Merged

wan9chi merged 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 Unix permission checks; only effect is new paths for materialized helpers and $schema file URLs.

Overview
vp run now materializes every on-disk helper—fspy preload/interpose DLL, macOS shell binaries, the NAPI client, and JSON Schemas for vp run --json—into one per-user temp folder (e.g. /tmp/vp_run-1000 on Linux) instead of separate trees like fspy-*, vt_client_napi-*, and vp-schemas-*.

vt_materialized_artifact gains materialize().at_user_temp_dir(prefix), which creates the same user-only temp directory checks as before and writes the content-addressed file there. user_temp_dir is no longer public; SpyImpl::init_in(dir) is replaced by SpyImpl::init() everywhere. RFC examples and the changelog reflect the new vp_run paths in $schema URLs.

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

@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.07%  [-12.49% .. +14.50%]  overhead   +64.47%
dynamic/access             change  +1.09%  [-10.32% .. +15.60%]  overhead   +14.40%
dynamic/access-relative    change  +0.38%  [-16.83% .. +24.61%]  overhead   +65.53%
dynamic/access-contended   change  -5.58%  [-30.72% .. +14.87%]  overhead    -0.90%
static/launch              change  -1.46%  [-11.75% .. +11.99%]  overhead  +189.31%
static/access              change  -0.91%  [-17.71% ..  +8.63%]  overhead +1157.96%
static/access-relative     change  +2.33%  [-13.00% .. +17.92%]  overhead +1719.04%
static/access-contended    change  -1.58%  [-14.93% ..  +8.71%]  overhead +1263.54%

macos

dynamic/launch             change  +0.39%  [ -3.34% ..  +4.90%]  overhead  +245.60%
dynamic/access             change  -0.35%  [ -2.72% ..  +3.45%]  overhead    +3.60%
dynamic/access-relative    change  +0.00%  [ -5.93% ..  +4.40%]  overhead  +251.04%
dynamic/access-contended   change  +0.44%  [ -3.14% ..  +4.93%]  overhead    +2.87%

windows

dynamic/launch             change  -0.67%  [ -3.83% ..  +3.41%]  overhead   +31.97%
dynamic/access             change  +0.00%  [ -0.42% ..  +0.43%]  overhead    +1.50%
dynamic/access-relative    change  +0.20%  [ -0.62% ..  +1.02%]  overhead    +1.67%
dynamic/access-contended   change  +0.20%  [ -0.40% ..  +0.81%]  overhead    +1.22%

…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 force-pushed the claude/vp-run-temp-dir branch from f18fca4 to cd55770 Compare November 9, 2026 10:43
@wan9chi
wan9chi merged commit bdd201d into main Nov 9, 2026
23 checks passed
@wan9chi
wan9chi deleted the claude/vp-run-temp-dir branch November 9, 2026 11:29
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