Skip to content

refactor(run): move the JSON helpers out of the task graph module - #964

Merged
wan9chi merged 1 commit into
claude/dry-run-05-verbose-every-inputfrom
claude/dry-run-06-json-helpers
Nov 9, 2026
Merged

wan9chi merged 1 commit into
claude/dry-run-05-verbose-every-inputfrom
claude/dry-run-06-json-helpers

Conversation

@wan9chi

@wan9chi wan9chi commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Motivation

The run plan that vp run --dry-run --json will print (#966) uses the same task IDs, paths, version and $schema copy as vp run --json. Moving that code out of the task graph module first keeps the JSON PR about the new document.

Changes

Code moves into session/json/, with no behaviour change; schemas/task-graph.json and every snapshot are unchanged:

  • from task_graph_json/document.rs: task_id, encode_id_part and Version;
  • from its mod.rs: path_key;
  • from its schema.rs: file_url and the schema materialization, which now takes the artifact as an argument.

Version takes its number as a const parameter, Version<1> for the task graph, since each document has its own format version: a breaking change to one bumps only its own. The output and schema don't change.

The task graph uses the moved code.

🤖 Generated with Claude Code


Note

Low Risk
Pure refactor with tests moved alongside; task graph JSON output and schemas are unchanged per the PR intent.

Overview
Introduces a shared session/json module so multiple vp run JSON outputs can reuse the same task IDs, workspace-relative paths, format version, and $schema materialization logic instead of duplicating it in the task graph code.

The task graph JSON path is rewired to import those helpers: Version becomes a generic Version<N> (still Version<1> for the task graph), and task-graph-specific schema wiring now passes its Artifact into the shared schema_url / materialize helpers. No intended output or schema change—this is structural prep for additional JSON documents (e.g. dry-run run plan).

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

@wan9chi
wan9chi added this pull request to stack #970 November 7, 2026 11:38
@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

fspy benchmark

linux

dynamic/launch             change  +1.22%  [ -4.91% ..  +8.11%]  overhead   +60.27%
dynamic/access             change  +2.00%  [-16.30% .. +22.13%]  overhead   +26.56%
dynamic/access-relative    change  +0.00%  [ -5.71% ..  +6.52%]  overhead   +60.57%
dynamic/access-contended   change  -1.32%  [ -9.20% ..  +8.46%]  overhead   +11.07%
static/launch              change  -0.40%  [ -6.09% ..  +5.03%]  overhead  +201.50%
static/access              change  +0.58%  [-10.95% .. +11.65%]  overhead +1340.54%
static/access-relative     change  +0.00%  [ -3.10% ..  +4.58%]  overhead +1998.10%
static/access-contended    change  -0.55%  [ -7.10% ..  +0.99%]  overhead +1735.44%

macos

dynamic/launch             change  +0.33%  [ -2.15% ..  +3.29%]  overhead  +232.46%
dynamic/access             change  -0.01%  [ -3.21% ..  +2.54%]  overhead    +5.51%
dynamic/access-relative    change  +0.43%  [ -3.32% ..  +2.92%]  overhead  +266.79%
dynamic/access-contended   change  -0.29%  [ -2.79% ..  +2.00%]  overhead    +3.51%

windows

dynamic/launch             change  +0.26%  [ -1.57% ..  +1.68%]  overhead   +30.17%
dynamic/access             change  +0.00%  [ -0.42% ..  +0.42%]  overhead    +1.29%
dynamic/access-relative    change  +0.00%  [ -0.61% ..  +0.61%]  overhead    +1.25%
dynamic/access-contended   change  +0.00%  [ -0.78% ..  +0.61%]  overhead    +1.41%

@wan9chi
wan9chi force-pushed the claude/dry-run-06-json-helpers branch from 005fe37 to 621aa10 Compare November 7, 2026 11:50
@wan9chi
wan9chi force-pushed the claude/dry-run-06-json-helpers branch from 621aa10 to ab924c9 Compare November 7, 2026 12:00
@wan9chi
wan9chi removed this pull request from stack #970 November 7, 2026 14:54
@wan9chi
wan9chi force-pushed the claude/dry-run-06-json-helpers branch from ab924c9 to e341597 Compare November 7, 2026 14:54
@wan9chi
wan9chi added this pull request to stack #973 November 7, 2026 14:55
@wan9chi
wan9chi force-pushed the claude/dry-run-06-json-helpers branch from e341597 to ba7adba Compare November 7, 2026 15:07
@wan9chi
wan9chi removed this pull request from stack #973 November 7, 2026 17:18
@wan9chi
wan9chi force-pushed the claude/dry-run-06-json-helpers branch from ba7adba to 7bca6ab Compare November 7, 2026 17:18
@wan9chi
wan9chi added this pull request to stack #975 November 7, 2026 17:19
@wan9chi
wan9chi force-pushed the claude/dry-run-06-json-helpers branch from 7bca6ab to 0808e4f Compare November 7, 2026 18:38
The run plan that `vp run --dry-run --json` will print uses the same
task IDs, paths, `version` and `$schema` copy as `vp run --json`. Moving
them out of the task graph module first keeps that change about the new
document.

`task_id`, `encode_id_part` and `Version` from
`task_graph_json/document.rs`, `path_key` from its `mod.rs`, and
`file_url` and the schema materialization from its `schema.rs` move to
`session/json/`. Materialization takes the artifact as an argument.
`Version` takes the number as a const parameter, since each document has
its own format version: the task graph's is `Version<1>`, and a breaking
change to one document bumps only its own. The task graph uses the moved
code, and `schemas/task-graph.json` is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wan9chi
wan9chi force-pushed the claude/dry-run-06-json-helpers branch from 0808e4f to e75ba86 Compare November 9, 2026 10:44
@wan9chi
wan9chi merged commit 1d8b2b1 into main Nov 9, 2026
22 checks passed
@wan9chi
wan9chi deleted the claude/dry-run-06-json-helpers 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