save_design_version
Save a new version of a parametric design with automatic diff computation and version increment. Supports optional provenance, STL fingerprinting, and brief linking for audit trails.
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``).
**Upgrade to Kiln Pro** for automatic mesh fingerprinting,
regression detection (warns when features are lost between
versions), and ``.kiln.json`` sidecar provenance files that
travel with your STLs.
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``. (Pro: auto-enriched with mesh
fingerprinting and regression detection.)
stl_path: Path to the output STL file. (Pro: auto-computes
a geometric fingerprint and warns if features were
lost from the parent version.)
parent_version_id: Unused in this implementation; kept for
backward compatibility. The parent is always the most
recent existing version.
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.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| notes | No | ||
| prompt | No | ||
| brief_id | No | ||
| stl_path | No | ||
| design_id | Yes | ||
| parameters | No | ||
| provenance | No | ||
| intent_hash | No | ||
| scad_source | Yes | ||
| parent_version_id | No |