Metadata-Version: 2.4
Name: topology_anomaly_detector
Version: 0.1.0
Summary: topology-anomaly-detector — extracted from SuperInstance oracle1-workspace
License: MIT
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# topology-anomaly-detector

Real-time anomaly detection on fleet coordination topology. Computes running TE, CSD, source counts, null multiplier against PLATO data and alerts on coordination failures.

## Dependencies

coordination-topology (algorithm dependency)

## Usage

```bash
python3 topology_anomaly_detector.py
```

Listens on port 8080 by default.

## Anomaly Types Detected

| Type | Threshold | What It Means |
|------|-----------|---------------|
| TE collapse | SI-TE < 0.1 bits | Coordination structure lost |
| TE spike | SI-TE > 5.0 bits | Suspicious surge in predictability |
| CSD anomaly | |τ| > 0.9 | Timing coordination outside normal bounds |
| Null multiplier spike | null_mult > 3.0 | Structure far beyond random chance |
| Source burst | >2 new sources in 5 min | Fleet composition changing |
| TE shock | ΔTE > 0.5 in 30s | Coordination topology regime shift |

## Alerts

Publishes anomaly events to PLATO room `topology-anomalies` as tiles with:
- `type`: anomaly type string
- `value`: current metric value
- `threshold`: threshold exceeded
- `sources`: active sources at time of event
- `confidence`: statistical confidence (1 - p-value)

## API

- `GET /health` — server status
- `GET /anomalies` — recent anomaly history
- `GET /status` — current coordination metrics

## Shell Loading

```python
from plato_shell_bridge import PlatoShell
shell = PlatoShell("agent-shell")
shell.load_tool("topology-anomaly-detector")
```

## License

MIT — Part of the Cocapn Fleet Intelligence System
