Commit Graph

314 Commits

Author SHA1 Message Date
cf454f6e40 feat: Add TrialManager and DashboardDB for unified trial management
- Add TrialManager (trial_manager.py) for consistent trial_NNNN naming
- Add DashboardDB (dashboard_db.py) for Optuna-compatible database schema
- Update CLAUDE.md with trial management documentation
- Update ATOMIZER_CONTEXT.md with v1.8 trial system
- Update cheatsheet v2.2 with new utilities
- Update SYS_14 protocol to v2.3 with TrialManager integration
- Add LAC learnings for trial management patterns
- Add archive/README.md for deprecated code policy

Key principles:
- Trial numbers NEVER reset (monotonic)
- Folders NEVER get overwritten
- Database always synced with filesystem
- Surrogate predictions are NOT trials (only FEA results)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 12:20:19 -05:00
f13563d7ab feat: Major update - Physics docs, Zernike OPD, insights, NX journals, tools
Documentation:
- Add docs/06_PHYSICS/ with Zernike fundamentals and OPD method docs
- Add docs/guides/CMA-ES_EXPLAINED.md optimization guide
- Update CLAUDE.md and ATOMIZER_CONTEXT.md with current architecture
- Update OP_01_CREATE_STUDY protocol

Planning:
- Add DYNAMIC_RESPONSE plans for random vibration/PSD support
- Add OPTIMIZATION_ENGINE_MIGRATION_PLAN for code reorganization

Insights System:
- Update design_space, modal_analysis, stress_field, thermal_field insights
- Improve error handling and data validation

NX Journals:
- Add analyze_wfe_zernike.py for Zernike WFE analysis
- Add capture_study_images.py for automated screenshots
- Add extract_expressions.py and introspect_part.py utilities
- Add user_generated_journals/journal_top_view_image_taking.py

Tests & Tools:
- Add comprehensive Zernike OPD test suite
- Add audit_v10 tests for WFE validation
- Add tools for Pareto graphs and mirror data extraction
- Add migrate_studies_to_topics.py utility

Knowledge Base:
- Initialize LAC (Learning Atomizer Core) with failure/success patterns

Dashboard:
- Update Setup.tsx and launch_dashboard.py
- Add restart-dev.bat helper script

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 19:47:37 -05:00
e448142599 docs: Complete README rewrite with current architecture
- Updated to reflect current capabilities (Dec 2025)
- Added architecture diagram showing LLM/FEA/Neural/Dashboard paths
- Documented 20+ physics extractors including Zernike OPD
- Added 8 study insight types
- Updated study organization (by geometry type)
- Added optimization methods table (TPE, NSGA-II, CMA-ES, GNN Turbo)
- Included protocol system overview
- Streamlined project structure section
- Added physics documentation links

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 15:06:15 -05:00
59a435f119 feat: Add debug script for lateral displacement analysis
Adds tests/debug_lateral_discrepancy.py to investigate differences between
Zernike OPD lateral displacement reporting and Simcenter post-processing.

Key findings documented:
- OPD reports sqrt(dx² + dy²) - combined XY magnitude
- Simcenter shows individual components (dx or dy)
- Both are correct, OPD magnitude is more meaningful for optics

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 15:03:32 -05:00
19b4ef3070 feat: Update live tracker Zernike to use OPD method with XYZ displacement views
- Replace Standard (Z-only) extraction with OPD method (X,Y,Z displacement)
- Add toggle buttons to switch between WFE, ΔX, ΔY, ΔZ views
- Show method comparison metrics (OPD vs Standard RMS difference)
- Display lateral displacement statistics (max/RMS)
- Fall back to Standard method if BDF geometry file not found
- Use ZernikeOPDExtractor for more accurate WFE computation (+8-11%)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 21:28:16 -05:00
d19fc39a2a feat: Add OPD method support to Zernike visualization with Standard/OPD toggle
Major improvements to Zernike WFE visualization:

- Add ZernikeDashboardInsight: Unified dashboard with all orientations (40°, 60°, 90°)
  on one page with light theme and executive summary
- Add OPD method toggle: Switch between Standard (Z-only) and OPD (X,Y,Z) methods
  in ZernikeWFEInsight with interactive buttons
- Add lateral displacement maps: Visualize X,Y displacement for each orientation
- Add displacement component views: Toggle between WFE, ΔX, ΔY, ΔZ in relative views
- Add metrics comparison table showing both methods side-by-side

New extractors:
- extract_zernike_figure.py: ZernikeOPDExtractor using BDF geometry interpolation
- extract_zernike_opd.py: Parabola-based OPD with focal length

Key finding: OPD method gives 8-11% higher WFE values than Standard method
(more conservative/accurate for surfaces with lateral displacement under gravity)

Documentation updates:
- SYS_12: Added E22 ZernikeOPD as recommended method
- SYS_16: Added ZernikeDashboard, updated ZernikeWFE with OPD features
- Cheatsheet: Added Zernike method comparison table

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 21:03:19 -05:00
d089003ced feat: Add Insights tab to dashboard for physics visualizations
Dashboard integration for Study Insights module (SYS_16):
- Backend: New /api/insights/ routes for generating and viewing insights
- Frontend: New Insights.tsx page with Plotly visualization
- Navigation: Added Insights tab between Analysis and Results

Available insight types:
- Zernike WFE (wavefront error for mirrors)
- Stress Field (Von Mises stress contours)
- Modal Analysis (natural frequencies/mode shapes)
- Thermal Field (temperature distribution)
- Design Space (parameter-objective exploration)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 13:28:51 -05:00
9aa5f6eb8c chore: Clean up deprecated study folders
Remove old study folders that have been superseded or archived:
- bracket_pareto_3obj
- bracket_stiffness_optimization (V1-V3)
- bracket_stiffness_optimization_atomizerfield
- drone_gimbal_arm_optimization
- m1_mirror_adaptive_V11 through V15
- m1_mirror_zernike_optimization
- simple_beam_optimization
- training_data_export_test
- uav_arm_atomizerfield_test

These studies have been consolidated or are no longer needed.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 13:49:11 -05:00
274081d977 refactor: Engine updates and NX hooks improvements
optimization_engine:
- Updated nx_solver.py with improvements
- Enhanced solve_simulation.py
- Updated extractors/__init__.py
- Improved NX CAD hooks (expression_manager, feature_manager,
  geometry_query, model_introspection, part_manager)
- Enhanced NX CAE solver_manager hook

Documentation:
- Updated OP_01_CREATE_STUDY.md protocol
- Updated SYS_12_EXTRACTOR_LIBRARY.md

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 13:47:21 -05:00
7c700c4606 feat: Dashboard improvements and configuration updates
Dashboard:
- Enhanced terminal components (ClaudeTerminal, GlobalClaudeTerminal)
- Improved MarkdownRenderer for better documentation display
- Updated convergence plots (ConvergencePlot, PlotlyConvergencePlot)
- Refined Home, Analysis, Dashboard, Setup, Results pages
- Added StudyContext improvements
- Updated vite.config for better dev experience

Configuration:
- Updated CLAUDE.md with latest instructions
- Enhanced launch_dashboard.py
- Updated config.py settings

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 13:47:05 -05:00
1612991d0d feat: Add Study Insights module (SYS_16) for physics visualizations
Introduces a new plugin architecture for study-specific physics
visualizations, separating "optimizer perspective" (Analysis) from
"engineer perspective" (Insights).

New module: optimization_engine/insights/
- base.py: StudyInsight base class, InsightConfig, InsightResult, registry
- zernike_wfe.py: Mirror WFE with 3D surface and Zernike decomposition
- stress_field.py: Von Mises stress contours with safety factors
- modal_analysis.py: Natural frequencies and mode shapes
- thermal_field.py: Temperature distribution visualization
- design_space.py: Parameter-objective landscape exploration

Features:
- 5 insight types: zernike_wfe, stress_field, modal, thermal, design_space
- CLI: python -m optimization_engine.insights generate <study>
- Standalone HTML generation with Plotly
- Enhanced Zernike viz: Turbo colorscale, smooth shading, 0.5x AMP
- Dashboard API fix: Added include_coefficients param to extract_relative()

Documentation:
- docs/protocols/system/SYS_16_STUDY_INSIGHTS.md
- Updated ATOMIZER_CONTEXT.md (v1.7)
- Updated 01_CHEATSHEET.md with insights section

Tools:
- tools/zernike_html_generator.py: Standalone WFE HTML generator
- tools/analyze_wfe.bat: Double-click to analyze OP2 files

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 13:46:28 -05:00
Antoine
01a7d7d121 docs: Complete M1 mirror optimization campaign V11-V15
## M1 Mirror Campaign Summary
- V11-V15 optimization campaign completed (~1,400 FEA evaluations)
- Best design: V14 Trial #725 with Weighted Sum = 121.72
- V15 NSGA-II confirmed V14 TPE found optimal solution
- Campaign improved from WS=129.33 (V11) to WS=121.72 (V14): -5.9%

## Key Results
- 40° tracking: 5.99 nm (target 4.0 nm)
- 60° tracking: 13.10 nm (target 10.0 nm)
- Manufacturing: 26.28 nm (target 20.0 nm)
- Targets not achievable within current design space

## Documentation Added
- V15 STUDY_REPORT.md: Detailed NSGA-II results analysis
- M1_MIRROR_CAMPAIGN_SUMMARY.md: Full V11-V15 campaign overview
- Updated CLAUDE.md, ATOMIZER_CONTEXT.md with NXSolver patterns
- Updated 01_CHEATSHEET.md with --resume guidance
- Updated OP_01_CREATE_STUDY.md with FEARunner template

## Studies Added
- m1_mirror_adaptive_V13: TPE validation (291 trials)
- m1_mirror_adaptive_V14: TPE intensive (785 trials, BEST)
- m1_mirror_adaptive_V15: NSGA-II exploration (126 new FEA)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 14:55:23 -05:00
Antoine
d1261d62fd refactor: Major project cleanup and reorganization
## Removed Duplicate Directories
- Deleted old `dashboard/` (replaced by atomizer-dashboard)
- Deleted old `mcp_server/` Python tools (moved model_discovery to optimization_engine)
- Deleted `tests/mcp_server/` (obsolete tests)
- Deleted `launch_dashboard.bat` (old launcher)

## Consolidated Code
- Moved `mcp_server/tools/model_discovery.py` to `optimization_engine/model_discovery/`
- Updated import in `optimization_config_builder.py`
- Deleted stub `extract_mass.py` (use extract_mass_from_bdf instead)
- Deleted unused `intelligent_setup.py` and `hybrid_study_creator.py`
- Archived `result_extractors/` to `archive/deprecated/`

## Documentation Cleanup
- Deleted deprecated `docs/06_PROTOCOLS_DETAILED/` (14 files)
- Archived dated dev docs to `docs/08_ARCHIVE/sessions/`
- Archived old plans to `docs/08_ARCHIVE/plans/`
- Updated `docs/protocols/README.md` with SYS_15

## Skills Consolidation
- Archived redundant study creation skills to `.claude/skills/archive/`
- Kept `core/study-creation-core.md` as canonical

## Housekeeping
- Updated `.gitignore` to prevent `nul` and `_dat_run*.dat`

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-12 11:24:02 -05:00
Antoine
1bb201e0b7 feat: Add post-optimization tools and mandatory best design archiving
New Tools (tools/):
- analyze_study.py: Generate comprehensive optimization reports
- find_best_iteration.py: Find best iteration folder, optionally copy it
- archive_best_design.py: Archive best design to 3_results/best_design_archive/<timestamp>/

Protocol Updates:
- OP_02_RUN_OPTIMIZATION.md v1.1: Add mandatory archive_best_design step
  in Post-Run Actions. This MUST be done after every optimization run.

V14 Updates:
- run_optimization.py: Auto-archive best design at end of optimization
- optimization_config.json: Expand bounds for V14 continuation
  - lateral_outer_angle: min 13->11 deg (was at 4.7%)
  - lateral_inner_pivot: min 7->5 mm (was at 8.1%)
  - lateral_middle_pivot: max 23->27 mm (was at 99.4%)
  - whiffle_min: max 60->72 mm (was at 96.3%)

Usage:
  python tools/analyze_study.py m1_mirror_adaptive_V14
  python tools/find_best_iteration.py m1_mirror_adaptive_V14
  python tools/archive_best_design.py m1_mirror_adaptive_V14

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-12 10:28:35 -05:00
Antoine
70ac34e3d3 feat: Add E11 Part Mass extractor, document pyNastran mass accuracy issue
New E11 Part Mass Extractor:
- Add nx_journals/extract_part_mass_material.py - NX journal using
  NXOpen.MeasureManager.NewMassProperties() for accurate geometry-based mass
- Add optimization_engine/extractors/extract_part_mass_material.py - Python
  wrapper that reads JSON output from journal
- Add E11 entry to extractors/catalog.json

Documentation Updates:
- SYS_12_EXTRACTOR_LIBRARY.md: Add mass accuracy warning noting pyNastran
  get_mass_breakdown() under-reports ~7% on hex-dominant meshes with
  tet/pyramid fill elements. E11 (geometry .prt) should be preferred over
  E4 (BDF) unless material is overridden at FEM level.
- 01_CHEATSHEET.md: Add mass extraction tip

V14 Config:
- Expand design variable bounds (blank_backface_angle max 4.5°,
  whiffle_triangle_closeness max 80mm, whiffle_min max 60mm)

Testing showed:
- E11 from .prt: 97.66 kg (accurate - matches NX GUI)
- E4 pyNastran get_mass_breakdown(): 90.73 kg (~7% under-reported)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 22:15:36 -05:00
Antoine
c1f2634636 docs: Add user guide for proper Atomizer usage and evolution
Comprehensive guide teaching users how to interact with Atomizer so that
the learning system evolves correctly. Covers:

- The right mindset (colleague, not tool)
- Starting sessions with proper context
- Communicating goals, constraints, preferences
- Creating and running optimization studies
- Analyzing and validating results
- Reporting errors effectively
- Contributing to LAC (recording insights, outcomes, workarounds)
- Ending sessions properly to capture learnings

Includes:
- Mermaid diagrams for learning loop and flows
- Good vs bad examples for every interaction type
- Complete example session transcript
- Quick reference card for common patterns
- Golden rules summary

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 22:12:28 -05:00
Antoine
f83dc6839f docs: Add comprehensive architecture overview with Mermaid diagrams
Complete visual guide to understanding Atomizer's architecture including:
- Session lifecycle (startup, active, closing)
- Protocol Operating System (4-layer architecture)
- Learning Atomizer Core (LAC) data flow
- Task classification and routing
- AVERVS execution framework
- Optimization flow with extractors
- Knowledge accumulation over time
- File structure reference

Includes 15+ Mermaid diagrams for visual learning.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 22:05:09 -05:00
Antoine
fc123326e5 feat: Integrate Learning Atomizer Core (LAC) and master instructions
Add persistent knowledge system that enables Atomizer to learn from every
session and improve over time.

## New Files
- knowledge_base/lac.py: LAC class with optimization memory, session insights,
  and skill evolution tracking
- knowledge_base/__init__.py: Package initialization
- .claude/skills/modules/learning-atomizer-core.md: Full LAC skill documentation
- docs/07_DEVELOPMENT/ATOMIZER_CLAUDE_CODE_INSTRUCTIONS.md: Master instructions

## Updated Files
- CLAUDE.md: Added LAC section, communication style, AVERVS execution framework,
  error classification, and "Atomizer Claude" identity
- 00_BOOTSTRAP.md: Added session startup/closing checklists with LAC integration
- 01_CHEATSHEET.md: Added LAC CLI and Python API quick reference
- 02_CONTEXT_LOADER.md: Added LAC query section and anti-pattern

## LAC Features
- Query similar past optimizations before starting new ones
- Record insights (failures, success patterns, workarounds)
- Record optimization outcomes for future reference
- Suggest protocol improvements based on discoveries
- Simple JSONL storage (no database required)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 21:55:01 -05:00
Antoine
3d90097b2b feat: Expand V14 design space bounds based on V13 analysis
Analysis of 258 FEA trials showed best trial (#45) hitting bounds on
5 parameters. Expanded bounds to allow exploration of promising regions:

- lateral_inner_angle: max 28.5 → 30.0° (was at 99.2% of range)
- lateral_inner_pivot: min 9.0 → 7.0 mm (was at 4.6% of range)
- lateral_middle_pivot: min 18.0 → 15.0 mm (was at 7.7% of range)
- whiffle_min: min 35.0 → 30.0 mm (was at 4.0% of range)
- whiffle_outer_to_vertical: min 68.0 → 60.0° (was at 5.3% of range)
- blank_backface_angle: narrowed to 4.1-4.2° (focus on optimal region)

V14 seeds from 496 prior FEA trials (V11+V12+V13) using TPE sampler.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 16:42:34 -05:00
Antoine
48404fd743 feat: Add Zernike wavefront viewer and V14 TPE optimization study
Dashboard Zernike Analysis:
- Add ZernikeViewer component with tabbed UI (40°, 60°, 90° vs 20°)
- Generate 3D surface mesh plots with Mesh3d triangulation
- Full 50-mode Zernike coefficient tables with mode names
- Manufacturing metrics for 90_vs_20 (optician workload analysis)
- OP2 availability filter for FEA trials only
- Fix duplicate trial display with unique React keys
- Tab switching with proper event propagation

Backend API Enhancements:
- GET /studies/{id}/trials/{num}/zernike - Generate Zernike HTML on-demand
- GET /studies/{id}/zernike-available - List trials with OP2 files
- compute_manufacturing_metrics() for aberration analysis
- compute_rms_filter_j1to3() for optician workload metric

M1 Mirror V14 Study:
- TPE (Tree-structured Parzen Estimator) optimization
- Seeds from 496 prior FEA trials (V11+V12+V13)
- Weighted-sum objective: 5*obj_40 + 5*obj_60 + 1*obj_mfg
- Multivariate TPE with constant_liar for efficient exploration
- Ready for 8-hour overnight runs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 21:34:07 -05:00
Antoine
96b196de58 feat: Add Zernike GNN surrogate module and M1 mirror V12/V13 studies
This commit introduces the GNN-based surrogate for Zernike mirror optimization
and the M1 mirror study progression from V12 (GNN validation) to V13 (pure NSGA-II).

## GNN Surrogate Module (optimization_engine/gnn/)

New module for Graph Neural Network surrogate prediction of mirror deformations:

- `polar_graph.py`: PolarMirrorGraph - fixed 3000-node polar grid structure
- `zernike_gnn.py`: ZernikeGNN with design-conditioned message passing
- `differentiable_zernike.py`: GPU-accelerated Zernike fitting and objectives
- `train_zernike_gnn.py`: ZernikeGNNTrainer with multi-task loss
- `gnn_optimizer.py`: ZernikeGNNOptimizer for turbo mode (~900k trials/hour)
- `extract_displacement_field.py`: OP2 to HDF5 field extraction
- `backfill_field_data.py`: Extract fields from existing FEA trials

Key innovation: Design-conditioned convolutions that modulate message passing
based on structural design parameters, enabling accurate field prediction.

## M1 Mirror Studies

### V12: GNN Field Prediction + FEA Validation
- Zernike GNN trained on V10/V11 FEA data (238 samples)
- Turbo mode: 5000 GNN predictions → top candidates → FEA validation
- Calibration workflow for GNN-to-FEA error correction
- Scripts: run_gnn_turbo.py, validate_gnn_best.py, compute_full_calibration.py

### V13: Pure NSGA-II FEA (Ground Truth)
- Seeds 217 FEA trials from V11+V12
- Pure multi-objective NSGA-II without any surrogate
- Establishes ground-truth Pareto front for GNN accuracy evaluation
- Narrowed blank_backface_angle range to [4.0, 5.0]

## Documentation Updates

- SYS_14: Added Zernike GNN section with architecture diagrams
- CLAUDE.md: Added GNN module reference and quick start
- V13 README: Study documentation with seeding strategy

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 08:44:04 -05:00
Antoine
c6f39bfd6c docs: Update protocol docs and method selector improvements
- SYS_12: Add extractor library updates
- SYS_15: Add method selector documentation updates
- method_selector.py: Minor improvements to method selection logic

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 19:10:45 -05:00
Antoine
0e04457539 feat: Implement Agentic Architecture for robust session workflows
Phase 1 - Session Bootstrap:
- Add .claude/ATOMIZER_CONTEXT.md as single entry point for new sessions
- Add study state detection and task routing

Phase 2 - Code Deduplication:
- Add optimization_engine/base_runner.py (ConfigDrivenRunner)
- Add optimization_engine/generic_surrogate.py (ConfigDrivenSurrogate)
- Add optimization_engine/study_state.py for study detection
- Add optimization_engine/templates/ with registry and templates
- Studies now require ~50 lines instead of ~300

Phase 3 - Skill Consolidation:
- Add YAML frontmatter metadata to all skills (versioning, dependencies)
- Consolidate create-study.md into core/study-creation-core.md
- Update 00_BOOTSTRAP.md, 01_CHEATSHEET.md, 02_CONTEXT_LOADER.md

Phase 4 - Self-Expanding Knowledge:
- Add optimization_engine/auto_doc.py for auto-generating documentation
- Generate docs/generated/EXTRACTORS.md (27 extractors documented)
- Generate docs/generated/TEMPLATES.md (6 templates)
- Generate docs/generated/EXTRACTOR_CHEATSHEET.md

Phase 5 - Subagent Implementation:
- Add .claude/commands/study-builder.md (create studies)
- Add .claude/commands/nx-expert.md (NX Open API)
- Add .claude/commands/protocol-auditor.md (config validation)
- Add .claude/commands/results-analyzer.md (results analysis)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 14:52:25 -05:00
Antoine
6cf12d9344 feat: Add NN Quality Assessor with relative accuracy thresholds
The Method Selector now uses relative accuracy thresholds to assess
NN suitability by comparing NN error to problem variability (CV ratio).

NNQualityAssessor features:
- Physics-based objective classification (linear, smooth, nonlinear, chaotic)
- CV ratio computation: nn_error / coefficient_of_variation
- Turbo suitability score based on relative thresholds
- Data collection from validation_report.json, turbo_report.json, and study.db

Quality thresholds by objective type:
- Linear (mass, volume): max 2% error, CV ratio < 0.5
- Smooth (frequency): max 5% error, CV ratio < 1.0
- Nonlinear (stress, stiffness): max 10% error, CV ratio < 2.0
- Chaotic (contact, buckling): max 20% error, CV ratio < 3.0

CLI output now includes:
- Per-objective NN quality table with error, CV, ratio, and quality indicator
- Turbo suitability and hybrid suitability percentages
- Warnings when NN error exceeds physics-based thresholds

Updated SYS_15_METHOD_SELECTOR.md to v2.0 with full NN Quality Assessment documentation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 06:38:25 -05:00
Antoine
3e9488d9f0 feat: Add Adaptive Method Selector for intelligent optimization strategy
The AMS analyzes optimization problems and recommends the best method:
- ProblemProfiler: Static analysis of config (dimensions, objectives, constraints)
- EarlyMetricsCollector: Dynamic analysis from FEA trials (smoothness, correlations)
- AdaptiveMethodSelector: Rule-based scoring for method recommendations
- RuntimeAdvisor: Mid-run monitoring for method pivots

Key features:
- Analyzes problem characteristics (n_variables, n_objectives, constraints)
- Computes response smoothness and variable sensitivity from trial data
- Recommends TURBO, HYBRID_LOOP, PURE_FEA, or GNN_FIELD
- Provides confidence scores and suggested parameters
- CLI: python -m optimization_engine.method_selector <config> [db]

Documentation:
- Add SYS_15_METHOD_SELECTOR.md protocol
- Update CLAUDE.md with new system protocol reference

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 05:51:49 -05:00
Antoine
602560c46a feat: Add MLP surrogate with Turbo Mode for 100x faster optimization
Neural Acceleration (MLP Surrogate):
- Add run_nn_optimization.py with hybrid FEA/NN workflow
- MLP architecture: 4-layer (64->128->128->64) with BatchNorm/Dropout
- Three workflow modes:
  - --all: Sequential export->train->optimize->validate
  - --hybrid-loop: Iterative Train->NN->Validate->Retrain cycle
  - --turbo: Aggressive single-best validation (RECOMMENDED)
- Turbo mode: 5000 NN trials + 50 FEA validations in ~12 minutes
- Separate nn_study.db to avoid overloading dashboard

Performance Results (bracket_pareto_3obj study):
- NN prediction errors: mass 1-5%, stress 1-4%, stiffness 5-15%
- Found minimum mass designs at boundary (angle~30deg, thick~30mm)
- 100x speedup vs pure FEA exploration

Protocol Operating System:
- Add .claude/skills/ with Bootstrap, Cheatsheet, Context Loader
- Add docs/protocols/ with operations (OP_01-06) and system (SYS_10-14)
- Update SYS_14_NEURAL_ACCELERATION.md with MLP Turbo Mode docs

NX Automation:
- Add optimization_engine/hooks/ for NX CAD/CAE automation
- Add study_wizard.py for guided study creation
- Fix FEM mesh update: load idealized part before UpdateFemodel()

New Study:
- bracket_pareto_3obj: 3-objective Pareto (mass, stress, stiffness)
- 167 FEA trials + 5000 NN trials completed
- Demonstrates full hybrid workflow

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-06 20:01:59 -05:00
Antoine
0cb2808c44 feat: Add Phase 2 & 3 physics extractors for multi-physics optimization
Phase 2 - Structural Analysis:
- extract_principal_stress: σ1, σ2, σ3 principal stresses from OP2
- extract_strain_energy: Element and total strain energy
- extract_spc_forces: Reaction forces at boundary conditions

Phase 3 - Multi-Physics:
- extract_temperature: Nodal temperatures from thermal OP2 (SOL 153/159)
- extract_temperature_gradient: Thermal gradient approximation
- extract_heat_flux: Element heat flux from thermal analysis
- extract_modal_mass: Modal effective mass from F06 (SOL 103)
- get_first_frequency: Convenience function for first natural frequency

Documentation:
- Updated SYS_12_EXTRACTOR_LIBRARY.md with E12-E18 specifications
- Updated NX_OPEN_AUTOMATION_ROADMAP.md marking Phase 3 complete
- Added test_phase3_extractors.py for validation

All extractors follow consistent API pattern returning Dict with
success, data, and error fields for robust error handling.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-06 13:40:14 -05:00
Antoine
5fb94fdf01 feat: Add Analysis page, run comparison, notifications, and config editor
Dashboard enhancements:
- Add Analysis page with tabs: Overview, Parameters, Pareto, Correlations, Constraints, Surrogate, Runs
- Add PlotlyCorrelationHeatmap for parameter-objective correlation analysis
- Add PlotlyFeasibilityChart for constraint satisfaction visualization
- Add PlotlySurrogateQuality for FEA vs NN prediction comparison
- Add PlotlyRunComparison for comparing optimization runs within a study

Real-time improvements:
- Replace watchdog file-watching with SQLite database polling for better Windows reliability
- Add DatabasePoller class with 2-second polling interval
- Enhanced WebSocket messages: trial_completed, new_best, pareto_update, progress

Desktop notifications:
- Add useNotifications hook using Web Notifications API
- Add NotificationSettings toggle component
- Notify users when new best solutions are found

Config editor:
- Add PUT /studies/{study_id}/config endpoint with auto-backup
- Add ConfigEditor modal with tabs: General, Variables, Objectives, Settings, JSON
- Prevents editing while optimization is running

Enhanced Pareto visualization:
- Add dark mode styling with transparent backgrounds
- Add stats bar showing Pareto, FEA, NN, and infeasible counts
- Add Pareto front connecting line for 2D view
- Add table showing top 10 Pareto-optimal solutions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 19:57:20 -05:00
Antoine
5c660ff270 feat: Add session management and global Claude terminal
Phase 1 - Accurate study status detection:
- Add is_optimization_running() to check for active processes
- Add get_accurate_study_status() with proper status logic
- Status now: not_started, running, paused, completed
- Add "paused" status styling (orange) to Home page

Phase 2 - Global Claude terminal:
- Create ClaudeTerminalContext for app-level state
- Create GlobalClaudeTerminal floating component
- Terminal persists across page navigation
- Shows green indicator when connected
- Remove inline terminal from Dashboard

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 12:56:34 -05:00
Antoine
fb2d06236a feat: Improve dashboard layout and Claude terminal context
- Reorganize dashboard: control panel on top, charts stacked vertically
- Add Set Context button to Claude terminal for study awareness
- Add conda environment instructions to CLAUDE.md
- Fix STUDY_REPORT.md location in generate-report.md skill
- Claude terminal now sends study context with skills reminder

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 20:59:31 -05:00
Antoine
f8b90156b3 feat: Improve dashboard performance and Claude terminal context
- Add trial limiting (300 max) and reduce polling to 15s for large studies
- Make dashboard layout wider with col-span adjustments
- Claude terminal now runs from Atomizer root for CLAUDE.md/skills access
- Add study context display in terminal on connect
- Add KaTeX math rendering styles for study reports
- Add surrogate tuner module for hyperparameter optimization
- Fix backend proxy to port 8001

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 17:36:00 -05:00
Antoine
9eed4d81eb feat: Add Claude Code terminal integration to dashboard
- Add embedded Claude Code terminal with xterm.js for full CLI experience
- Create WebSocket PTY backend for real-time terminal communication
- Add terminal status endpoint to check CLI availability
- Update dashboard to use Claude Code terminal instead of API chat
- Add optimization control panel with start/stop/validate actions
- Add study context provider for global state management
- Update frontend with new dependencies (xterm.js addons)
- Comprehensive README documentation for all new features

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 15:02:13 -05:00
Antoine
8cbdbcad78 feat: Add Protocol 13 adaptive optimization, Plotly charts, and dashboard improvements
## Protocol 13: Adaptive Multi-Objective Optimization
- Iterative FEA + Neural Network surrogate workflow
- Initial FEA sampling, NN training, NN-accelerated search
- FEA validation of top NN predictions, retraining loop
- adaptive_state.json tracks iteration history and best values
- M1 mirror study (V11) with 103 FEA, 3000 NN trials

## Dashboard Visualization Enhancements
- Added Plotly.js interactive charts (parallel coords, Pareto, convergence)
- Lazy loading with React.lazy() for performance
- Code splitting: plotly.js-basic-dist (~1MB vs 3.5MB)
- Chart library toggle (Recharts default, Plotly on-demand)
- ExpandableChart component for full-screen modal views
- ConsoleOutput component for real-time log viewing

## Documentation
- Protocol 13 detailed documentation
- Dashboard visualization guide
- Plotly components README
- Updated run-optimization skill with Mode 5 (adaptive)

## Bug Fixes
- Fixed TypeScript errors in dashboard components
- Fixed Card component to accept ReactNode title
- Removed unused imports across components

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 07:41:54 -05:00
Antoine
e74f1ccf36 feat: Add single-command dashboard launcher script
- python launch_dashboard.py starts both backend and frontend
- Ctrl+C gracefully shuts down both servers
- Color-coded terminal output for status

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 07:58:27 -05:00
Antoine
75d7036193 feat: Enhance dashboard with charts, study report viewer, and pruning tracking
- Add ConvergencePlot component with running best, statistics, gradient fill
- Add ParameterImportanceChart with Pearson correlation analysis
- Add StudyReportViewer with KaTeX math rendering and full markdown support
- Update pruning endpoint to query Optuna database directly
- Add /report endpoint for STUDY_REPORT.md files
- Fix chart data transformation for single/multi-objective studies
- Update Protocol 13 documentation with new components
- Update generate-report skill with dashboard integration

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 22:01:49 -05:00
Antoine
ec5e42d733 feat: Add M1 mirror Zernike optimization with correct RMS calculation
Major improvements to telescope mirror optimization workflow:

Assembly FEM Workflow (solve_simulation.py):
- Fixed multi-part assembly FEM update sequence
- Use ImportFromFile() for reliable expression updates
- Add DuplicateNodesCheckBuilder with MergeOccurrenceNodes=True
- Switch to Foreground solve mode for multi-subcase solutions
- Add detailed logging and diagnostics for node merge operations

Zernike RMS Calculation:
- CRITICAL FIX: Use correct surface-based RMS formula
  - Global RMS = sqrt(mean(W^2)) from actual WFE values
  - Filtered RMS = sqrt(mean(W_residual^2)) after removing low-order fit
  - This matches zernike_Post_Script_NX.py (optical standard)
- Previous WRONG formula was: sqrt(sum(coeffs^2))
- Add compute_rms_filter_j1to3() for optician workload metric

Subcase Mapping:
- Fix subcase mapping to match NX model:
  - Subcase 1 = 90 deg (polishing orientation)
  - Subcase 2 = 20 deg (reference)
  - Subcase 3 = 40 deg
  - Subcase 4 = 60 deg

New Study: M1 Mirror Zernike Optimization
- Full optimization config with 11 design variables
- 3 objectives: rel_filtered_rms_40_vs_20, rel_filtered_rms_60_vs_20, mfg_90_optician_workload
- Neural surrogate support for accelerated optimization

Documentation:
- Update ZERNIKE_INTEGRATION.md with correct RMS formula
- Update ASSEMBLY_FEM_WORKFLOW.md with expression import and node merge details
- Add reference scripts from original zernike_Post_Script_NX.py

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 16:30:15 -05:00
Antoine
8ee031342a feat: Update environment.yml with PyTorch and add installation guide
- environment.yml: Added PyTorch with CUDA 12.1, PyG (torch-geometric),
  and TensorBoard for neural network training
- INSTALL_INSTRUCTIONS.md: Step-by-step guide for installing Miniconda
  and setting up the Atomizer environment

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-26 16:45:54 -05:00
Antoine
a005a4a98a feat: Add complete requirements and installation scripts
- requirements.txt: Added all dependencies including PyTorch,
  torch-geometric, tensorboard for neural network training

- install.bat: One-click installation script that installs all
  dependencies with proper version constraints

- train_neural.bat: Training script that runs parametric neural
  network training on collected FEA data

Usage:
  1. Double-click install.bat to install dependencies
  2. Double-click train_neural.bat to train on bracket study

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-26 16:42:39 -05:00
Antoine
20cd66dff6 feat: Add parametric predictor and training script for AtomizerField
Rebuilds missing neural network components based on documentation:

- neural_models/parametric_predictor.py: Design-conditioned GNN that
  predicts all 4 optimization objectives (mass, frequency, displacement,
  stress) directly from design parameters. ~500K trainable parameters.

- train_parametric.py: Training script with multi-objective loss,
  checkpoint saving with normalization stats, and TensorBoard logging.

- Updated __init__.py to export ParametricFieldPredictor and
  create_parametric_model for use by optimization_engine/neural_surrogate.py

These files enable the neural acceleration workflow:
1. Collect FEA training data (189 trials already collected)
2. Train parametric model: python train_parametric.py --train_dir ...
3. Run neural-accelerated optimization with --enable-nn flag

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-26 16:33:50 -05:00
Antoine
d5ffba099e feat: Merge Atomizer-Field neural network module into main repository
Permanently integrates the Atomizer-Field GNN surrogate system:
- neural_models/: Graph Neural Network for FEA field prediction
- batch_parser.py: Parse training data from FEA exports
- train.py: Neural network training pipeline
- predict.py: Inference engine for fast predictions

This enables 600x-2200x speedup over traditional FEA by replacing
expensive simulations with millisecond neural network predictions.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-26 15:31:33 -05:00
a4805947d1 feat: Add NX study models and optimization histories
Includes all study folders with NX models for development:
- bracket_stiffness_optimization (V1, V2, V3)
- drone_gimbal_arm_optimization
- simple_beam_optimization
- uav_arm_optimization (V1, V2)
- training_data_export_test
- uav_arm_atomizerfield_test

Contains .prt, .fem, .sim files and optimization databases.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-26 12:19:07 -05:00
2b3573ec42 feat: Add AtomizerField training data export and intelligent model discovery
Major additions:
- Training data export system for AtomizerField neural network training
- Bracket stiffness optimization study with 50+ training samples
- Intelligent NX model discovery (auto-detect solutions, expressions, mesh)
- Result extractors module for displacement, stress, frequency, mass
- User-generated NX journals for advanced workflows
- Archive structure for legacy scripts and test outputs
- Protocol documentation and dashboard launcher

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-26 12:01:50 -05:00
a0c008a593 feat: Add neural loop automation - templates, auto-trainer, CLI
Closes the neural training loop with automated workflow:
- atomizer.py: One-command neural workflow CLI
- auto_trainer.py: Auto-training trigger system (50pt threshold)
- template_loader.py: Study creation from templates
- study_reset.py: Study reset/cleanup utility
- 3 templates: beam stiffness, bracket stress, frequency tuning
- State assessment document (Nov 25)

Usage: python atomizer.py neural-optimize --study my_study --trials 500

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-26 07:53:00 -05:00
e3bdb08a22 feat: Major update with validators, skills, dashboard, and docs reorganization
- Add validation framework (config, model, results, study validators)
- Add Claude Code skills (create-study, run-optimization, generate-report,
  troubleshoot, analyze-model)
- Add Atomizer Dashboard (React frontend + FastAPI backend)
- Reorganize docs into structured directories (00-09)
- Add neural surrogate modules and training infrastructure
- Add multi-objective optimization support

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-25 19:23:58 -05:00
74a92803b7 feat: Add automatic solution monitor disabling for multi-solution workflows
Problem:
When running optimization studies with multiple solutions (e.g., static + modal),
NX opens solution monitor windows for each trial. These windows superpose and cause
usability issues during long optimization runs.

Solution:
- Automatically disable solution monitor when solving all solutions (solution_name=None)
- Loop through all solutions and set "solution monitor" property to False
- Implemented in solve_simulation.py before solve execution (lines 271-295)
- Includes error handling with graceful fallback

Benefits:
- No monitor window pile-up during optimization studies
- Better performance (no GUI overhead)
- No user configuration required - works automatically
- Based on user-recorded journal (journal_monitor_window_off.py)

Documentation:
- Updated docs/NX_MULTI_SOLUTION_PROTOCOL.md with solution monitor control section
- Added implementation details and when the feature activates
- Cross-referenced user's recorded journal

Implementation: optimization_engine/solve_simulation.py
Documentation: docs/NX_MULTI_SOLUTION_PROTOCOL.md
Reference: nx_journals/user_generated_journals/journal_monitor_window_off.py
2025-11-24 10:36:10 -05:00
7837255ba8 feat: Update create-study skill with Phase 1.3 logging and create UAV arm test study
Phase 1.3.1 Complete - Logging Integration:

1. Updated .claude/skills/create-study.md:
   - Added IMPORTANT section on structured logging from Phase 1.3
   - Documents logger import and initialization
   - Lists all structured logging methods (trial_start, trial_complete, etc.)
   - References drone_gimbal_arm as template

2. Created studies/uav_arm_optimization/:
   - Multi-objective NSGA-II study (50 trials)
   - Same type as drone_gimbal_arm but renamed for UAV context
   - Full integration with Phase 1.3 logging system
   - Configuration: minimize mass + maximize frequency
   - Running to validate complete logging system

Benefits:
- All future studies created via skill will have consistent logging
- Production-ready error handling and file logging from day 1
- Color-coded console output for better monitoring
- Automatic log rotation (50MB, 3 backups)

Related: Phase 1.2 (Configuration), Phase 1.3 (Logger), Phase 1.3.1 (Integration)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-24 10:18:20 -05:00
d2c18bb7db feat: Migrate drone_gimbal_arm_optimization to use structured logging system (Phase 1.3.1)
Migrate drone_gimbal_arm study as reference implementation for Phase 1.3 logging system.

Changes:
- Replace all print() statements with logger calls throughout run_optimization.py
- Add logger.trial_start() and logger.trial_complete() for structured trial logging
- Use logger.trial_failed() for error handling with full tracebacks
- Add logger.study_start() and logger.study_complete() for lifecycle logging
- Replace constraint violation prints with logger.warning()
- Create comprehensive LOGGING_MIGRATION_GUIDE.md with before/after examples

Benefits:
- Color-coded console output (green INFO, yellow WARNING, red ERROR)
- Automatic file logging to 2_results/optimization.log with rotation (50MB, 3 backups)
- Structured format with timestamps for dashboard integration
- Professional error handling with exc_info=True
- Reference implementation for migrating remaining studies

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-24 09:39:56 -05:00
3bff7cf6b3 feat: Add structured logging system for production-ready error handling (Phase 1.3)
Implements comprehensive, production-ready logging infrastructure to replace
ad-hoc print() statements across the codebase. This establishes a consistent
logging standard for MVP stability.

## What Changed

**New Files:**
- optimization_engine/logger.py (330 lines)
  - AtomizerLogger class with trial-specific methods
  - Color-coded console output (Windows 10+ and Unix)
  - Automatic file logging with rotation (50MB, 3 backups)
  - Zero external dependencies (stdlib only)

- docs/07_DEVELOPMENT/Phase_1_3_Implementation_Plan.md
  - Complete Phase 1.3 implementation plan
  - API documentation and usage examples
  - Migration strategy for existing studies

## Features

1. **Structured Trial Logging:**
   - logger.trial_start() - Log trial with design variables
   - logger.trial_complete() - Log results with objectives/constraints
   - logger.trial_failed() - Log failures with error details
   - logger.study_start() - Log study initialization
   - logger.study_complete() - Log final summary

2. **Production Features:**
   - ANSI color-coded console output (DEBUG=cyan, INFO=green, etc.)
   - Automatic file logging to {study_dir}/optimization.log
   - Log rotation: 50MB max, 3 backup files
   - Timestamps and structured format for dashboard parsing

3. **Simple API:**
   ```python
   from optimization_engine.logger import get_logger
   logger = get_logger(__name__, study_dir=Path("studies/foo/2_results"))
   logger.study_start("foo", n_trials=30, sampler="NSGAIISampler")
   logger.trial_start(1, design_vars)
   logger.trial_complete(1, objectives, constraints, feasible=True)
   ```

## Testing

- Verified color output on Windows 10
- Tested file logging and rotation
- Confirmed trial-specific methods format correctly
- UTF-8 encoding handles special characters

## Next Steps (Phase 1.3.1)

- Integrate logging into drone_gimbal_arm_optimization (reference implementation)
- Create migration guide for existing studies
- Update create-study skill to include logger setup

## Technical Details

Current state analyzed:
- 1416 occurrences of logging/print across 79 files
- 411 occurrences of try:/except/raise across 59 files
- Mix of print(), traceback, and inconsistent formatting

This logging system provides the foundation for:
- Dashboard integration (structured trial logs)
- Error recovery (checkpoint system in Phase 1.3.2)
- Production debugging (file logs with rotation)

Related: Phase 1.2 (Configuration Validation)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-24 09:27:27 -05:00
155f5a8522 feat: Add configuration validation system for MVP stability (Phase 1.2)
Implements JSON Schema validation for optimization configurations to ensure
consistency across all studies and prevent configuration errors.

Added:
- optimization_engine/schemas/optimization_config_schema.json
  - Comprehensive schema for Protocol 10 & 11 configurations
  - Validates objectives, constraints, design variables, simulation settings
  - Enforces standard field names (goal, bounds, parameter, threshold)

- optimization_engine/config_manager.py
  - ConfigManager class with schema validation
  - CLI tool: python config_manager.py <config.json>
  - Type-safe accessor methods for config elements
  - Custom validations: bounds check, multi-objective consistency, location check

- optimization_engine/schemas/README.md
  - Complete documentation of standard configuration format
  - Validation examples and common error fixes
  - Migration guidance for legacy configs

- docs/07_DEVELOPMENT/Phase_1_2_Implementation_Plan.md
  - Detailed implementation plan for remaining Phase 1.2 tasks
  - Migration tool design, integration guide, testing plan

Testing:
- Validated drone_gimbal_arm_optimization config successfully
- ConfigManager works with drone_gimbal format (new standard)
- Identifies legacy format issues in bracket studies

Standards Established:
- Configuration location: studies/{name}/1_setup/
- Objective direction: "goal" not "type"
- Design var bounds: "bounds": [min, max] not "min"/"max"
- Design var name: "parameter" not "name"
- Constraint threshold: "threshold" not "value"

Next Steps (Phase 1.2.1+):
- Config migration tool for legacy studies
- Integration with run_optimization.py
- Update create-study Claude skill with schema reference
- Migrate bracket studies to new format

Relates to: Phase 1.2 MVP Development Plan

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-24 09:21:55 -05:00
d228ccec66 refactor: Archive experimental LLM features for MVP stability (Phase 1.1)
Moved experimental LLM integration code to optimization_engine/future/:
- llm_optimization_runner.py - Runtime LLM API runner
- llm_workflow_analyzer.py - Workflow analysis
- inline_code_generator.py - Auto-generate calculations
- hook_generator.py - Auto-generate hooks
- report_generator.py - LLM report generation
- extractor_orchestrator.py - Extractor orchestration

Added comprehensive optimization_engine/future/README.md explaining:
- MVP LLM strategy (Claude Code skills, not runtime LLM)
- Why files were archived
- When to revisit post-MVP
- Production architecture reference

Production runner confirmed: optimization_engine/runner.py is sole active runner.

This establishes clear separation between:
- Production code (stable, no runtime LLM dependencies)
- Experimental code (archived for post-MVP exploration)

Part of Phase 1: Core Stabilization & Organization for MVP

Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-24 09:12:36 -05:00