save_design_version
Saves a new parametric design version, computes a diff from the previous version, and records provenance to track changes and warn about lost features.
Instructions
Save a new version of a parametric design.
Automatically computes a unified diff from the previous version,
increments the version number, and persists a versioned recipe
sidecar (``~/.kiln/designs/<design_id>/.kiln_recipe.vN.json``).
On Kiln Pro a save also fingerprints the mesh, warns when features
are lost between versions, and writes a ``.kiln.json`` provenance
sidecar that travels with the STL.
Args:
design_id: Identifier grouping versions of the same design.
scad_source: Full OpenSCAD source code for this version.
prompt: The natural-language prompt that produced this version.
parameters: Parametric values used for generation.
notes: Free-text notes for this version.
provenance: Context on how this version was created.
Recommended keys: ``tools_used``, ``change_summary``,
``source_files``.
stl_path: Path to the output STL file. When given, the
version's mesh is fingerprinted and the reply warns if
features were lost since the parent version.
parent_version_id: Which earlier version the mesh
fingerprint is compared against. Omitted, the most
recent existing version is the parent (and the source
diff always uses that one).
goal_id: Optional saved-goal id from ``design_session``.
When supplied, the new version's recipe records the
link so the audit's "matches what you asked for" gate,
the brief failure_history wiring, and the
``compare_design_versions`` intent diff all join back
to the goal. When omitted, an earlier version's
``goal_id`` (read from the parent recipe) is
inherited automatically.
intent_hash: Optional content hash of the brief's derived
intent payload, paired with ``goal_id``. Same
inheritance fall-back as ``goal_id``.
gcode_path: Optional sliced file of this version (G-code, or
a 3MF carrying a sliced plate). The slicer's own time
estimate in it is kept on the version, and the reply's
``print_time`` says it ("About 3h 1m, the slicer's
estimate."). A file stating no time keeps nothing. A
``slicer_estimate`` in ``provenance`` is never kept: the
estimate is read from the file. The person's own speed
ranges the file was sliced with (``speed_by_height``) are
kept the same way, from Kiln's record of that slice on
this computer, and the reply's ``sliced_speeds`` says
them; a ``speed_by_height`` in ``provenance`` is never
kept.
Returns:
The saved version record including version number, diff, and
parent information. Pro users also get provenance,
mesh_fingerprint, and mesh_diff with regression warnings.
A version saved with ``stl_path`` and a goal (named here or
inherited) joins that goal in the person's Kiln account:
``saved_goal`` says whether it did, with the goal's
``safety_notes`` when it holds any, and for a model with
separate parts ``motion`` says whether a stage plays it. A
version that could not join says why in ``saved_goal``; it
is saved here either way.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"design_id": "<design_id>",
"scad_source": "<scad_source>"
},
"name": "save_design_version"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| notes | No | Free-text notes for this version. Default: "". | |
| prompt | No | The natural-language prompt that produced this version. Default: "". | |
| goal_id | No | Optional saved-goal id from ``design_session``. When supplied, the new version's recipe records the link so the audit's "matches what you asked for" gate, the brief failure_history wiring, and the ``compare_design_versions`` intent diff all join back to the goal. When omitted, an earlier version's ``goal_id`` (read from the parent recipe) is inherited automatically. Default: "". | |
| stl_path | No | Path to the output STL file. When given, the version's mesh is fingerprinted and the reply warns if features were lost since the parent version. Default: "". | |
| design_id | Yes | Identifier grouping versions of the same design. | |
| gcode_path | No | Optional sliced file of this version (G-code, or a 3MF carrying a sliced plate). The slicer's own time estimate in it is kept on the version, and the reply's ``print_time`` says it ("About 3h 1m, the slicer's estimate."). A file stating no time keeps nothing. A ``slicer_estimate`` in ``provenance`` is never kept: the estimate is read from the file. The person's own speed ranges the file was sliced with (``speed_by_height``) are kept the same way, from Kiln's record of that slice on this computer, and the reply's ``sliced_speeds`` says them; a ``speed_by_height`` in ``provenance`` is never kept. Default: "". | |
| parameters | No | Parametric values used for generation. | |
| provenance | No | Context on how this version was created. Recommended keys: ``tools_used``, ``change_summary``, ``source_files``. | |
| intent_hash | No | Optional content hash of the brief's derived intent payload, paired with ``goal_id``. Same inheritance fall-back as ``goal_id``. Default: "". | |
| scad_source | Yes | Full OpenSCAD source code for this version. | |
| parent_version_id | No | Which earlier version the mesh fingerprint is compared against. Omitted, the most recent existing version is the parent (and the source diff always uses that one). Default: "". |