Skip to content

Latest commit

 

History

History
35 lines (27 loc) · 2.03 KB

File metadata and controls

35 lines (27 loc) · 2.03 KB

Fix Report - AstraGuard

[2026-03-14] - Sensors Simulation Verification

Changes/Observations:

  • Verified sensors.py:
    • Confirmed continuous execution via asyncio loops.
    • Validated range-based data generation for Power, Traffic, and Environment sensors.
    • Confirmed chaos_coordinator correctly cycles through NORMAL, BLACKOUT_CRASH, and HAZMAT_FIRE scenarios.
    • Identified that post_data is currently in mock/print mode.
    • Noted datetime.utcnow() deprecation for future fix.

Alignment:

  • Endpoints in sensors.py (/api/power, /api/traffic, /api/environment) perfectly match nginx.conf routing rules.

[2026-03-14] - Machine Learning (Isolation Forest) Integration

Changes/Observations:

  • Upgraded Workers to ML: trafficWorker.py, powerWorker.py, and enviornWorker.py now use scikit-learn Isolation Forest for unsupervised anomaly detection.
  • Dynamic Training: Models learn the city's baseline from a 100-event sliding window, with a baseline requirement of 50 events before activation.
  • Hybrid Logic: The Power worker prioritizes hard failure status (OUTAGE) over ML predictions for safety.
  • Dependency Update: pyproject.toml now includes scikit-learn, numpy, and updated versions for fastapi and uvicorn.

Integration Status:

  • Phase 1 (Simulators): Complete (Enabled real POST requests to localhost:8080).
  • Phase 2 (Edge Workers): Complete (ML-enhanced).
  • Sensors Fix: Resolved datetime.utcnow() deprecation and verified aiohttp environment.

[2026-03-14] - Phase 2 to Phase 3 Handoff Integration

Changes/Observations:

  • Handoff Logic: Workers now use requests to push anomalies to ORCHESTRATOR_URL.
  • Structured Payloads: Confirmed that all workers send source_worker, trigger_reason, trigger_data, and historical_context.
  • Resilience: Added try/except blocks and timeouts to the handoff logic to prevent worker crashes.
  • Dependency Alert: Identified need for requests library in the environment.