You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
gui: cone endDiameter silently stripped on open/plan/save (.wind 1.1 data loss) #344
The desktop GUI silently drops the shipped mandrelParameters.endDiameter field (schemaVersion 1.1, cones/frustums) when opening, planning, or saving a .wind file. A cone file opened in the GUI is planned/exported as a cylinder with no warning, and Save rewrites the file with endDiameter deleted — silent data loss.
Root cause
The GUI plans/saves from a reserialized internal project model, not the raw file bytes, and the internal model never carried endDiameter:
fiberpath_gui/src/lib/schemas.ts:38-40 — MandrelParametersSchema = z.object({ diameter, windLength }) only. Zod z.objectstrips unknown keys by default, so endDiameter is discarded on load.
fiberpath_gui/src/types/converters.ts:58 — internal mandrel type is { diameter, wind_length }; the mandrel mapping at :71-73 (project → wind) and :134-135 (wind → project) round-trips only diameter/windLength.
fiberpath_gui/src/services/file-operations.svelte.ts:25-26 (saveWindFile(... JSON.stringify(projectToWindDefinition(document)))) and :87-88 (planWind(JSON.stringify(projectToWindDefinition(document)))) — both operate on the reserialized model, so the dropped field never reaches the backend planner or the saved file.
Impact
Open a 0.10.0 cone .wind → Export G-code ⇒ planned as a cylinder (wrong toolpath), no error.
Open a cone .wind → Save ⇒ endDiameter removed from the file (data loss).
Scope
This is independent of and predates the VK/Stage-3b work; it affects the already-shipped cone feature. The Stage 3b Phase 1 GUI guard (in #326 / its PR3) mitigates by blocking plan/save when a loaded file carries mandrel fields the model can't represent (covering both endDiameter and the upcoming profile) — but the underlying converters/schema gap is this bug and should be tracked/fixed on its own.
Fix direction
Thread endDiameter through the GUI project model + Zod schema + both converter directions (mirroring the engine), OR generalize the guard into a real fix. Add a GUI round-trip test that a cone .wind survives open→save byte-for-byte on the mandrel fields.
Activity
feat(gui): round-trip Von Kármán profile + frictionLambda (#345)