IncidentEnv is an OpenEnv-compatible RL environment for microservice incident response.
It includes a Rust simulation core, Python environment wrappers, reward/graders, a FastAPI runtime, Torch/PPO training, a React dashboard, and historical trace replay in reality mode.
Meta_Hackathon/
├── incident-env/ # Main runtime + training package
│ ├── engine/ # Rust simulation engine (PyO3)
│ ├── envs/ # Gym/OpenEnv wrappers
│ ├── rewards/ # Reward components
│ ├── graders/ # Programmatic + LLM grading
│ ├── training/ # PPO training/eval/backtest
│ ├── api/ # FastAPI server
│ ├── dashboard/ # React UI
│ ├── scenarios/ # Scenario configs + historical traces
│ └── tests/ # Test suite
├── API_CONTRACT.md
├── ARCHITECTURE.md
├── DEMO_GUIDE.md
├── command.md # End-to-end commands
├── trackA.md
└── trackB.md
| Surface | Value |
|---|---|
| Observation | (72,) float32 in [0,1] |
| Structure | 12 services × 6 metrics |
| Metric order | cpu, memory, error_rate, latency_p50, latency_p99, request_rate |
| Action | MultiDiscrete([12, 7]) |
| Action layout | [service_id, action_type] |
| Reward | step reward in [-1.0, 1.0] |
- benchmark: synthetic incident overlays for fast iteration.
- reality: historical trace replay + safety rails + operational scoring + audit trail.
Reality mode supports:
- timeline-based trace events
- action cooldowns and dependency checks
- high-risk action approvals (
approval_token) - action justification checks
- operational metrics (
mttr_minutes,false_positive_rate,slo_recovery,customer_impact_minutes)
From C:\Users\ssang\Downloads\Meta_Hackathon\incident-env:
.\bootstrap.ps1
.\.venv\Scripts\python.exe -m pytest tests\cd C:\Users\ssang\Downloads\Meta_Hackathon\incident-env
.\.venv\Scripts\python.exe -m uvicorn api.main:app --host 127.0.0.1 --port 8000cd C:\Users\ssang\Downloads\Meta_Hackathon\incident-env\dashboard
npm install
npm run devcd C:\Users\ssang\Downloads\Meta_Hackathon\incident-env\dashboard
npm run build
cd ..
.\.venv\Scripts\python.exe -m uvicorn api.main:app --host 127.0.0.1 --port 8000Open: http://127.0.0.1:8000/ui
Required:
GET /GET /healthPOST /resetPOST /stepGET /stateGET /metadataGET /schemaPOST /mcp
Supplemental:
GET /episode/optionsPOST /episode/startWS /episode/stream/{episode_id}POST /backtest/run
Invoke-RestMethod -Method Post -Uri "http://127.0.0.1:8000/reset" -ContentType "application/json" -Body '{"scenario":"bad_deploy","execution_mode":"reality","trace_id":"bad_deploy_trace_001"}'Invoke-RestMethod -Method Post -Uri "http://127.0.0.1:8000/step" -ContentType "application/json" -Body '{"action":[3,2],"justification":"Rollback deploy for active deploy and error_rate symptoms while reducing escalation risk.","approval_token":"INC-APPROVED","operator_id":"oncall"}'cd C:\Users\ssang\Downloads\Meta_Hackathon\incident-env
.\.venv\Scripts\python.exe training\train.py --epochs 100
.\.venv\Scripts\python.exe training\eval.py --episodes 25
.\.venv\Scripts\python.exe inference.py --agent greedy
.\.venv\Scripts\python.exe -m training.backtest --agent-mode greedy --max-incidents 50 --output backtest_report.jsoncd C:\Users\ssang\Downloads\Meta_Hackathon\incident-env
.\.venv\Scripts\python.exe -m pytest tests\cd C:\Users\ssang\Downloads\Meta_Hackathon\incident-env
docker build -t incidentenv .
docker run --rm -p 8000:7860 incidentenvYou are likely running the wrong backend copy. Start API from incident-env (hyphen), not a legacy incidentenv folder.
No checkpoint is available/selected. Use greedy, random, or four_stage, or train first to generate checkpoints\latest.pt.
Errors like Cannot find menu item with id translate-page are from browser extensions, not IncidentEnv.
incident-env\README.md— deep technical detailscommand.md— command cookbook for setup/test/run/validateAPI_CONTRACT.md— integration contractARCHITECTURE.md— system architectureDEMO_GUIDE.md— demo flowtrackA.md,trackB.md— progress and handoff status