docs: Consolidate documentation and fix protocol numbering (partial)

Phase 2 of restructuring plan:
- Rename SYS_16_STUDY_INSIGHTS -> SYS_17_STUDY_INSIGHTS
- Rename SYS_17_CONTEXT_ENGINEERING -> SYS_18_CONTEXT_ENGINEERING
- Promote Bootstrap V3.0 (Context Engineering) as default
- Archive old Bootstrap V2.0
- Create knowledge_base/playbook.json for ACE framework
- Add OP_08 (Generate Report) to routing tables
- Add SYS_16-18 to protocol tables
- Update docs/protocols/README.md to version 1.1
- Update CLAUDE.md with new protocols
- Create docs/plans/RESTRUCTURING_PLAN.md for continuation

Remaining: Phase 2.8 (Cheatsheet), Phases 3-6

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-07 08:52:07 -05:00
parent 18c221a218
commit b8a04c62b8
17 changed files with 1568 additions and 623 deletions

View File

@@ -1,7 +1,7 @@
# Atomizer Protocol Operating System (POS)
**Version**: 1.0
**Last Updated**: 2025-12-05
**Version**: 1.1
**Last Updated**: 2026-01-06
---
@@ -22,13 +22,19 @@ protocols/
│ ├── OP_03_MONITOR_PROGRESS.md
│ ├── OP_04_ANALYZE_RESULTS.md
│ ├── OP_05_EXPORT_TRAINING_DATA.md
── OP_06_TROUBLESHOOT.md
── OP_06_TROUBLESHOOT.md
│ ├── OP_07_DISK_OPTIMIZATION.md
│ └── OP_08_GENERATE_REPORT.md
├── system/ # Layer 3: Core specifications
│ ├── SYS_10_IMSO.md
│ ├── SYS_11_MULTI_OBJECTIVE.md
│ ├── SYS_12_EXTRACTOR_LIBRARY.md
│ ├── SYS_13_DASHBOARD_TRACKING.md
── SYS_14_NEURAL_ACCELERATION.md
── SYS_14_NEURAL_ACCELERATION.md
│ ├── SYS_15_METHOD_SELECTOR.md
│ ├── SYS_16_SELF_AWARE_TURBO.md
│ ├── SYS_17_STUDY_INSIGHTS.md
│ └── SYS_18_CONTEXT_ENGINEERING.md
└── extensions/ # Layer 4: Extensibility guides
├── EXT_01_CREATE_EXTRACTOR.md
├── EXT_02_CREATE_HOOK.md
@@ -56,6 +62,8 @@ Day-to-day how-to guides:
- **OP_04**: Analyze results
- **OP_05**: Export training data
- **OP_06**: Troubleshoot issues
- **OP_07**: Disk optimization (free space)
- **OP_08**: Generate study report
### Layer 3: System (`system/`)
Core technical specifications:
@@ -65,6 +73,9 @@ Core technical specifications:
- **SYS_13**: Real-Time Dashboard Tracking
- **SYS_14**: Neural Network Acceleration
- **SYS_15**: Method Selector
- **SYS_16**: Self-Aware Turbo (SAT) Method
- **SYS_17**: Study Insights (Physics Visualization)
- **SYS_18**: Context Engineering (ACE Framework)
### Layer 4: Extensions (`extensions/`)
Guides for extending Atomizer:
@@ -130,6 +141,8 @@ LOAD_WITH: [{dependencies}]
| Analyze results | [OP_04](operations/OP_04_ANALYZE_RESULTS.md) |
| Export neural data | [OP_05](operations/OP_05_EXPORT_TRAINING_DATA.md) |
| Fix errors | [OP_06](operations/OP_06_TROUBLESHOOT.md) |
| Free disk space | [OP_07](operations/OP_07_DISK_OPTIMIZATION.md) |
| Generate report | [OP_08](operations/OP_08_GENERATE_REPORT.md) |
| Add extractor | [EXT_01](extensions/EXT_01_CREATE_EXTRACTOR.md) |
### By Protocol Number
@@ -142,6 +155,9 @@ LOAD_WITH: [{dependencies}]
| 13 | Dashboard | [System](system/SYS_13_DASHBOARD_TRACKING.md) |
| 14 | Neural | [System](system/SYS_14_NEURAL_ACCELERATION.md) |
| 15 | Method Selector | [System](system/SYS_15_METHOD_SELECTOR.md) |
| 16 | Self-Aware Turbo | [System](system/SYS_16_SELF_AWARE_TURBO.md) |
| 17 | Study Insights | [System](system/SYS_17_STUDY_INSIGHTS.md) |
| 18 | Context Engineering | [System](system/SYS_18_CONTEXT_ENGINEERING.md) |
---
@@ -160,3 +176,4 @@ LOAD_WITH: [{dependencies}]
| Version | Date | Changes |
|---------|------|---------|
| 1.0 | 2025-12-05 | Initial Protocol Operating System |
| 1.1 | 2026-01-06 | Added OP_07, OP_08; SYS_16, SYS_17, SYS_18; Fixed SYS_16 duplication |

View File

@@ -0,0 +1,276 @@
# OP_08: Generate Study Report
<!--
PROTOCOL: Automated Study Report Generation
LAYER: Operations
VERSION: 1.0
STATUS: Active
LAST_UPDATED: 2026-01-06
PRIVILEGE: user
LOAD_WITH: []
-->
## Overview
This protocol covers automated generation of comprehensive study reports via the Dashboard API or CLI. Reports include executive summaries, optimization metrics, best solutions, and engineering recommendations.
---
## When to Use
| Trigger | Action |
|---------|--------|
| "generate report" | Follow this protocol |
| Dashboard "Report" button | API endpoint called |
| Optimization complete | Auto-generate option |
| CLI `atomizer report <study>` | Direct generation |
---
## Quick Reference
**API Endpoint**: `POST /api/optimization/studies/{study_id}/report/generate`
**Output**: `STUDY_REPORT.md` in study root directory
**Formats Supported**: Markdown (default), JSON (data export)
---
## Generation Methods
### 1. Via Dashboard
Click the "Generate Report" button in the study control panel. The report will be generated and displayed in the Reports tab.
### 2. Via API
```bash
# Generate report
curl -X POST http://localhost:8003/api/optimization/studies/my_study/report/generate
# Response
{
"success": true,
"content": "# Study Report: ...",
"path": "/path/to/STUDY_REPORT.md",
"generated_at": "2026-01-06T12:00:00"
}
```
### 3. Via CLI
```bash
# Using Claude Code
"Generate a report for the bracket_optimization study"
# Direct Python
python -m optimization_engine.reporting.markdown_report studies/bracket_optimization
```
---
## Report Sections
### Executive Summary
Generated automatically from trial data:
- Total trials completed
- Best objective value achieved
- Improvement percentage from initial design
- Key findings
### Results Table
| Metric | Initial | Final | Change |
|--------|---------|-------|--------|
| Objective 1 | X | Y | Z% |
| Objective 2 | X | Y | Z% |
### Best Solution
- Trial number
- All design variable values
- All objective values
- Constraint satisfaction status
- User attributes (source, validation status)
### Design Variables Summary
| Variable | Min | Max | Best Value | Sensitivity |
|----------|-----|-----|------------|-------------|
| var_1 | 0.0 | 10.0 | 5.23 | High |
| var_2 | 0.0 | 20.0 | 12.87 | Medium |
### Convergence Analysis
- Trials to 50% improvement
- Trials to 90% improvement
- Convergence rate assessment
- Phase breakdown (exploration, exploitation, refinement)
### Recommendations
Auto-generated based on results:
- Further optimization suggestions
- Sensitivity observations
- Next steps for validation
---
## Backend Implementation
**File**: `atomizer-dashboard/backend/api/routes/optimization.py`
```python
@router.post("/studies/{study_id}/report/generate")
async def generate_report(study_id: str, format: str = "markdown"):
"""
Generate comprehensive study report.
Args:
study_id: Study identifier
format: Output format (markdown, json)
Returns:
Generated report content and file path
"""
# Load configuration
config = load_config(study_dir)
# Query database for all trials
trials = get_all_completed_trials(db)
best_trial = get_best_trial(db)
# Calculate metrics
stats = calculate_statistics(trials)
# Generate markdown
report = generate_markdown_report(study_id, config, trials, best_trial, stats)
# Save to file
report_path = study_dir / "STUDY_REPORT.md"
report_path.write_text(report)
return {
"success": True,
"content": report,
"path": str(report_path),
"generated_at": datetime.now().isoformat()
}
```
---
## Report Template
The generated report follows this structure:
```markdown
# {Study Name} - Optimization Report
**Generated:** {timestamp}
**Status:** {Completed/In Progress}
---
## Executive Summary
This optimization study completed **{n_trials} trials** and achieved a
**{improvement}%** improvement in the primary objective.
| Metric | Value |
|--------|-------|
| Total Trials | {n} |
| Best Value | {best} |
| Initial Value | {initial} |
| Improvement | {pct}% |
---
## Objectives
| Name | Direction | Weight | Best Value |
|------|-----------|--------|------------|
| {obj_name} | minimize | 1.0 | {value} |
---
## Design Variables
| Name | Min | Max | Best Value |
|------|-----|-----|------------|
| {var_name} | {min} | {max} | {best} |
---
## Best Solution
**Trial #{n}** achieved the optimal result.
### Parameters
- var_1: {value}
- var_2: {value}
### Objectives
- objective_1: {value}
### Constraints
- All constraints satisfied: Yes/No
---
## Convergence Analysis
- Initial best: {value} (trial 1)
- Final best: {value} (trial {n})
- 90% improvement reached at trial {n}
---
## Recommendations
1. Validate best solution with high-fidelity FEA
2. Consider sensitivity analysis around optimal design point
3. Check manufacturing feasibility of optimal parameters
---
*Generated by Atomizer Dashboard*
```
---
## Prerequisites
Before generating a report:
- [ ] Study must have at least 1 completed trial
- [ ] study.db must exist in results directory
- [ ] optimization_config.json must be present
---
## Error Handling
| Error | Cause | Solution |
|-------|-------|----------|
| "No trials found" | Empty database | Run optimization first |
| "Config not found" | Missing config file | Verify study setup |
| "Database locked" | Optimization running | Wait or pause first |
| "Invalid study" | Study path not found | Check study ID |
---
## Cross-References
- **Preceded By**: [OP_04_ANALYZE_RESULTS](./OP_04_ANALYZE_RESULTS.md)
- **Related**: [SYS_13_DASHBOARD](../system/SYS_13_DASHBOARD.md)
- **Triggered By**: Dashboard Report button
---
## Version History
| Version | Date | Changes |
|---------|------|---------|
| 1.0 | 2026-01-06 | Initial release - Dashboard integration |