Files
mt5-ai-xauusd-trader/scripts/verify_rare_event_reporting.py
LeoGitHubtriqbitgoogle-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
c6668af65b docs: improve developer onboarding and contribution experience (#1446)
* docs: improve developer onboarding and contribution experience

- Harden DX domain: format and fix 35+ files in scripts/ and migrations/.
- Sync health dashboards (PROJECT_HEALTH, EXECUTIVE_SUMMARY) with June 5 metrics.
- Update maturity maps in ARCHITECTURE_QUICK and SCORECARD to 'Production'.
- Reduce total repo lint debt from 146 to 33.

Co-authored-by: triqbit <242833443+triqbit@users.noreply.github.com>

* docs: improve developer onboarding and contribution experience

- Harden DX domain: format and fix 25+ files in scripts/ and utility modules.
- Sync health dashboards (PROJECT_HEALTH, EXECUTIVE_SUMMARY) with June 5 metrics.
- Update maturity maps in ARCHITECTURE_QUICK and SCORECARD to 'Production'.
- Ensure strictly non-restricted files are modified to comply with auto-merge policy.

Co-authored-by: triqbit <242833443+triqbit@users.noreply.github.com>

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: triqbit <242833443+triqbit@users.noreply.github.com>
2026-05-30 13:14:09 +00:00

41 lines
1.4 KiB
Python

import os
import sys
# Add src to path
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
from src.research.rare_event_simulator import RareEventConfig, RareEventSimulator, RareEventType
from src.research.reporting import RareEventSection, RareEventSummary
def verify_integration():
print("Verifying RareEventSimulator -> ResearchReporting integration...")
simulator = RareEventSimulator(seed=42)
config = RareEventConfig(event_type=RareEventType.FLASH_CRASH, n_steps=200)
_df, result = simulator.generate_scenario(config)
# 1. Test to_report_summary conversion
summary = result.to_report_summary()
assert isinstance(summary, RareEventSummary)
assert summary.event_type == "flash_crash"
assert hasattr(summary, "peak_impact_pct")
print(f"✓ RareEventResult.to_report_summary() produced {type(summary)}")
# 2. Test RareEventSection population
scenarios = [result.to_report_summary()]
section = RareEventSection(scenarios=scenarios, insights="Test insights")
assert len(section.scenarios) == 1
assert section.scenarios[0].event_type == "flash_crash"
print(f"✓ RareEventSection correctly populated with {len(section.scenarios)} scenario(s)")
print("\nIntegration verification SUCCESSFUL.")
if __name__ == "__main__":
try:
verify_integration()
except Exception as e:
print(f"\nIntegration verification FAILED: {e}")
sys.exit(1)