Spaces:
Sleeping

svkrishna commited on
Commit
7b7b417
·
1 Parent(s): 78b489c

🤖 Implement Story 4: Reflexive Core

Browse files

- Add ReflexiveEngine for self-monitoring and corrective actions
- Implement PolicyMonitor, LedgerMonitor, and AnomalyDetector
- Add HaltAction, EscalateAction, MonitorAction, and AllowAction
- Create ActionFactory and ActionExecutor for action management
- Add HTTP API endpoints for risk simulation and engine status
- Integrate ReflexiveEngine into FastMCP server
- Add comprehensive test suite with 70 passing tests
- Support halt(), escalate(), monitor(), and allow() decisions
- Record reflexive events with cryptographic proof hashes
- Enable automatic risk assessment and corrective actions

Closes: Story 4 - Reflexive Core implementation

12 files changed +3240
Files changed (12)
examples/reflexive_example.pyAdded+191
src/fastmcp/reflexive/__init__.pyAdded+19
src/fastmcp/reflexive/actions.pyAdded+340
src/fastmcp/reflexive/engine.pyAdded+376
src/fastmcp/reflexive/monitor.pyAdded+356
src/fastmcp/server/reflexive_routes.pyAdded+385
src/fastmcp/server/server.py+38
tests/reflexive/__init__.pyAdded+1
tests/reflexive/test_actions.pyAdded+461
tests/reflexive/test_monitors.pyAdded+428
tests/reflexive/test_reflexive_engine.pyAdded+320
tests/reflexive/test_reflexive_http.pyAdded+325