Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4c1ee8c

Browse files
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

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,65 @@
22

33
All notable changes to the Toolpath workspace are documented here.
44

5+
## Format simplification — single-root Graph
6+
7+
**Breaking.** `Graph` is now the only root document type. Every `.path.json`
8+
file deserializes to a `Graph`; every `.path.jsonl` file is a single-path
9+
`Graph` at the boundary. The previous three-variant `Document` enum
10+
(`{"Step": …}` / `{"Path": …}` / `{"Graph": …}` envelopes) is removed.
11+
12+
What was a single Step or single Path at the root is now wrapped in a
13+
single-path Graph: `Graph { graph: { id }, paths: [Path { …, steps: [Step] }] }`.
14+
This unifies file shape — one schema, one parser path, no envelope to detect.
15+
16+
### toolpath 0.3.0
17+
18+
- **Remove `Document` enum.** The new root type is `Graph`. All `Graph::*`
19+
helpers (`from_json`, `to_json`, `to_json_pretty`) plus `Graph::from_path`,
20+
`Graph::single_path`, `Graph::into_single_path` cover the previous
21+
`Document` surface and add ergonomic single-path lifts.
22+
- **JSONL.** `Graph::from_jsonl_*` / `Graph::to_jsonl_*` are the file-level
23+
API. They wrap a single inline `Path` as a single-path `Graph`. The
24+
underlying line-streaming machinery on `Path` is unchanged. New
25+
`JsonlError::NotSinglePathGraph` flags multi-path graphs at write time.
26+
27+
### toolpath-git 0.2.0
28+
29+
- `derive` returns `Graph` (was `Document`). A single branch yields a
30+
single-path graph; multiple branches yield a multi-path graph.
31+
32+
### toolpath-dot 0.2.0
33+
34+
- `render(&Graph, …)` replaces `render(&Document, …)`. Single-path graphs
35+
render through the existing path-level layout; multi-path graphs use the
36+
cluster layout. `render_step`, `render_path`, `render_graph` remain.
37+
38+
### toolpath-md 0.3.0
39+
40+
- `render(&Graph, …)` replaces `render(&Document, …)`. Same single-path /
41+
multi-path dispatch.
42+
43+
### toolpath-pi 0.3.0
44+
45+
- `derive_project` returns `Graph` (was `Document::Graph(...)`).
46+
47+
### path-cli 0.6.0
48+
49+
- All commands (`validate`, `render`, `query`, `merge`, `import`, `export`,
50+
`track`, `cache`) read and write `Graph` documents at file boundaries.
51+
- `export claude` / `export gemini` reject multi-path graphs with a clear
52+
error — projection requires exactly one inline path.
53+
- `examples/` rewritten as graph-rooted JSON. `step-NN.json` examples are
54+
now single-path single-step graphs; `path-NN.path.json` are single-path
55+
graphs; `graph-01-release.json` drops its envelope.
56+
- Schema (`schema/toolpath.schema.json`) collapses the root `oneOf` of
57+
three envelopes into a direct `$ref` to the `graph` definition.
58+
59+
### toolpath-cli 0.6.0 (deprecation shim)
60+
61+
- Bumped in lockstep with `path-cli` 0.6.0 (its only dependency). No
62+
behavioral change.
63+
564
## path-cli 0.5.0 + toolpath-cli 0.5.1 + workspace re-alignment
665

766
### path-cli 0.5.0 (new crate name)

0 commit comments

Comments
 (0)