save_design_version
Save a new version of a parametric design, automatically compute a diff from the previous version, and persist a versioned recipe for change tracking.
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).
brief_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
``brief_id`` (read from the parent recipe) is
inherited automatically.
intent_hash: Optional content hash of the brief's derived
intent payload, paired with ``brief_id``. Same
inheritance fall-back as ``brief_id``.
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.
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: "". | |
| brief_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 ``brief_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. | |
| 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 ``brief_id``. Same inheritance fall-back as ``brief_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: "". |