fix(canvas): Multiple fixes for drag-drop, undo/redo, and code generation

Drag-drop fixes:
- Fix Objective default data: use nested 'source' object with extractor_id/output_name
- Fix Constraint default data: use 'type' field (not constraint_type), 'threshold' (not limit)

Undo/Redo fixes:
- Remove dependency on isDirty flag (which is always false due to auto-save)
- Record snapshots based on actual spec changes via deep comparison

Code generation improvements:
- Update system prompt to support multiple extractor types:
  * OP2-based extractors for FEA results (stress, displacement, frequency)
  * Expression-based extractors for NX model values (dimensions, volumes)
  * Computed extractors for derived values (no FEA needed)
- Claude will now choose appropriate signature based on user's description
This commit is contained in:
2026-01-20 15:08:49 -05:00
parent 89694088a2
commit 5c419e2358
30 changed files with 1781 additions and 85 deletions

View File

@@ -4,25 +4,25 @@
"extraction_method": "ZernikeOPD_Annular",
"inner_radius_mm": 135.75,
"objectives_note": "Mass NOT in objective - WFE only",
"total_trials": 1,
"feasible_trials": 1,
"total_trials": 101,
"feasible_trials": 100,
"best_trial": {
"number": 0,
"weighted_sum": 341.40717511411987,
"number": 76,
"weighted_sum": 220.12317796085603,
"objectives": {
"wfe_40_20": 9.738648075724171,
"wfe_60_20": 24.138392317227122,
"mfg_90": 54.09444169121308,
"mass_kg": 102.89579477048632
"wfe_40_20": 7.033921022459454,
"wfe_60_20": 16.109562572565014,
"mfg_90": 32.457279654424745,
"mass_kg": 102.89579477048622
},
"params": {
"lateral_inner_u": 0.4,
"lateral_outer_u": 0.4,
"lateral_middle_pivot": 22.42,
"lateral_inner_angle": 31.96,
"lateral_outer_angle": 9.08
"lateral_inner_u": 0.40304412850085514,
"lateral_outer_u": 0.9043062289622721,
"lateral_middle_pivot": 25.869245488671304,
"lateral_inner_angle": 32.008659765295675,
"lateral_outer_angle": 13.952742709877848
},
"iter_folder": "C:\\Users\\antoi\\Atomizer\\studies\\M1_Mirror\\m1_mirror_flatback_lateral\\2_iterations\\iter1"
"iter_folder": "C:\\Users\\antoi\\Atomizer\\studies\\M1_Mirror\\m1_mirror_flatback_lateral\\2_iterations\\iter77"
},
"timestamp": "2026-01-13T11:01:22.360549"
"timestamp": "2026-01-13T18:41:14.992549"
}

View File

@@ -2,9 +2,9 @@
"meta": {
"version": "2.0",
"created": "2026-01-17T15:35:12.034330Z",
"modified": "2026-01-17T15:35:12.034330Z",
"modified": "2026-01-20T18:24:29.805432Z",
"created_by": "migration",
"modified_by": "migration",
"modified_by": "canvas",
"study_name": "m1_mirror_flatback_lateral",
"description": "Lateral support optimization with new U-joint expressions (lateral_inner_u, lateral_outer_u). Focus on WFE and MFG only - no mass objective.",
"tags": [
@@ -104,10 +104,10 @@
"expression_name": "lateral_outer_angle",
"type": "continuous",
"bounds": {
"min": 8.0,
"max": 17.0
"min": 8,
"max": 17
},
"baseline": 9.08,
"baseline": 10,
"units": "degrees",
"enabled": true,
"description": "Outer lateral support angle",