Commit 4c1ee8c
committed
feat!: simplify toolpath format to single Graph root
Remove the `Document` enum and the `{"Step":…}` / `{"Path":…}` /
`{"Graph":…}` envelope. Every `.path.json` file is a `Graph` at the root;
every `.path.jsonl` file is a single-path `Graph` at the file boundary.
What was a bare Step or Path is now wrapped in a single-path Graph —
one schema, one parser path, no envelope to detect.
Why: the three-variant root pushed discriminator logic into every
consumer (CLI commands, renderers, schema, fixtures, docs). Collapsing
to a single root type makes file shape uniform and removes a class of
"which kind is this?" branching across the workspace.
Public API changes (pre-1.0 = potentially breaking):
- toolpath 0.2.0 → 0.3.0 — Document enum removed; new helpers on Graph
(`from_json`/`to_json`/`to_json_pretty`, `from_path`, `single_path`,
`into_single_path`) plus JSONL on Graph (`Graph::from_jsonl_*` /
`to_jsonl_*` wrap a single inline Path; new `JsonlError::NotSinglePathGraph`)
- toolpath-git 0.1.3 → 0.2.0 — `derive` returns Graph
- toolpath-dot 0.1.2 → 0.2.0 — `render` takes &Graph (single-path graphs
use the path layout, multi-path use the cluster layout)
- toolpath-md 0.2.0 → 0.3.0 — `render` takes &Graph (same dispatch)
- toolpath-pi 0.2.0 → 0.3.0 — `derive_project` returns Graph
- toolpath-cli 0.5.0 → 0.6.0 — file format change end-to-end
CLI: `validate`, `render`, `query`, `merge`, `import`, `export`, `track`,
`cache` all read/write Graph at file boundaries. `export claude` and
`export gemini` reject multi-path graphs with a clear error.
Examples: `step-NN.json` are now single-path single-step graphs;
`path-NN.path.json` are single-path graphs; `graph-01-release.json`
drops its envelope. JSONL fixtures regenerated.
Schema: `schema/toolpath.schema.json` collapses the root `oneOf` of
three envelopes into a direct `$ref` to the `graph` definition.
Docs: RFC.md, docs/RFC-jsonl.md, README.md, CHANGELOG.md, and per-crate
READMEs all updated.
Tests: workspace fully green (cargo build, cargo test --workspace,
cargo clippy --workspace -- -D warnings). Render-md snapshot tests for
step examples regenerated under the new single-path-graph rendering.1 parent d3ba98b commit 4c1ee8c
65 files changed
Lines changed: 2217 additions & 2052 deletions
File tree
- crates
- path-cli
- examples
- src
- bin
- tests
- snapshots
- toolpath-cli
- toolpath-codex
- src
- tests
- toolpath-dot
- src
- toolpath-gemini/tests
- toolpath-git
- src
- toolpath-md
- src
- toolpath-opencode/src
- toolpath-pi
- src
- tests
- toolpath
- src
- docs
- examples
- schema
- site/_data
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
5 | 64 | | |
6 | 65 | | |
7 | 66 | | |
| |||
0 commit comments