- π€ LLM usage: $7.5000 (50 commits)
- π€ Human dev: ~$1141 (11.4h @ $100/h, 30min dedup)
Generated on 2026-05-05 using openrouter/qwen/qwen3-coder-next
Infrastructure anomaly detection and monitoring tool for development environments.
- Manifest Scanning: Scans docker-compose, OpenAPI, package.json, and pyproject.toml files up to 3 layers deep
- Environment Interpolation: Full
${VAR:-default}support with.envfile layering and compose override merging - Port Parsing: Resolves host/container port mappings with protocol and host-bind support
- Topology Building: Builds service dependency graphs with cycle detection and hub analysis
- Anomaly Detection: Detects missing healthchecks, port conflicts, dependency cycles, and hardcoded secrets
- Real-time Monitoring: Watches for config changes, probes HTTP/TCP health checks with concurrent probing
- Web Dashboard: Real-time FastAPI/WebSocket dashboard with topology visualization and event stream
- DSL Change Tracking: Structured change commands for service/port/probe state transitions
- Topology Caching: mtime-based cache with configurable TTL to avoid redundant rescans
- Multi-format Output: JSON, YAML graph, Mermaid, PNG (graphviz), and Semcod toon format
- CLI Interface:
scan,monitor,diff, andwebcommands via argparse
pip install detaWith optional dependencies:
# web dashboard (FastAPI + uvicorn + WebSocket)
pip install 'deta[web]'
# all extras
pip install deta[docker,toml,web]deta scan /path/to/project --depth 3 --output infra-map.json# text graph + mermaid + json
deta scan /path/to/project --formats json,yaml,mermaid
# include online checks (localhost probes)
deta scan /path/to/project --formats json,yaml,mermaid --online
# try PNG (requires graphviz python package + graphviz binary)
deta scan /path/to/project --formats pngGenerated files (configurable in deta.yaml):
infra-map.jsoninfra-graph.yamlinfra-graph.mmdinfra-graph.pnginfra.toon.yaml
deta monitor /path/to/project --interval 30 --depth 3
deta monitor . --interval 30 --depth 3
# realtime watch from scan command (regenerates outputs on each change)
deta scan /path/to/project --watch --formats json,yaml,mermaid --onlinedeta web /path/to/project --depth 3 --host 127.0.0.1 --port 8765Open http://127.0.0.1:8765 β real-time topology view with WebSocket event push (service up/down, port changes).
Configuration in deta.yaml:
web:
enabled: true
host: 127.0.0.1
port: 8765
refresh_seconds: 5
cache_ttl_seconds: 30.0
debounce_seconds: 0.5
push_events:
- service_added
- service_removed
- service_up
- service_downdeta diff --baseline infra-map.json /path/to/projectHere is a complete example of how to use deta to scan, monitor, and visualize the c2004 project:
- Scan and export topology:
deta scan ../maskservice/c2004 --output infra-map.json
- Detect changes against the baseline:
deta diff --baseline infra-map.json ../maskservice/c2004
- Monitor infrastructure in real-time:
deta monitor ../maskservice/c2004 --interval 5
- Launch the interactive Web Dashboard:
# Ensure the web extra is installed: pip install '.[web]' deta web ../maskservice/c2004 --host 127.0.0.1 --port 8765
from pathlib import Path
from deta import build_topology, scan_compose, scan_openapi, probe_all
# Build topology from manifests
topology = build_topology(Path("/path/to/project"), max_depth=3)
# Detect anomalies
anomalies = topology.detect_anomalies()
for anomaly in anomalies:
print(f"{anomaly['severity']}: {anomaly['type']}")
# Cycle & hub analysis
cycles = topology.detect_cycles()
hubs = topology.find_hubs(min_degree=3)
# Export to JSON
import json
output = json.loads(topology.to_json())
# Probe services
results = probe_all(topology.services, max_concurrency=20)deta/
βββ scanner/ # Manifest parsing
β βββ compose.py # docker-compose.yml (with override merging)
β βββ openapi.py # OpenAPI specs
β βββ npm.py # package.json
β βββ python.py # pyproject.toml & requirements.txt
β βββ env.py # .env file loading & interpolation
β βββ ports.py # Port binding parsing & resolution
βββ builder/ # Topology construction
β βββ topology.py # Graph, anomaly detection, cycles, hubs
β βββ cache.py # mtime-based topology cache
βββ monitor/ # Real-time monitoring
β βββ watcher.py # File change polling
β βββ prober.py # HTTP/TCP health checks (concurrent)
β βββ alerter.py # Rich console output
βββ formatter/ # Output formats
β βββ graph.py # YAML graph, Mermaid, PNG
β βββ toon.py # Semcod toon format
βββ dsl/ # Change tracking DSL
β βββ commands.py # service_up/down, port_added/removed
βββ web/ # Real-time dashboard
β βββ app.py # FastAPI + WebSocket (topology, probes, events)
βββ integration/ # Ecosystem hooks
β βββ semcod.py # sumd, pyqual, vallm, pre_deploy_check
βββ config.py # deta.yaml configuration (Pydantic models)
βββ core.py # Base Wup class
βββ cli.py # CLI entry point (scan, monitor, diff, web)
Place deta.yaml in your project root. See deta.yaml.example for all options:
- scan β depth, include/exclude patterns
- watch β file monitoring paths and patterns
- anomaly β toggle checks, secret patterns, severity levels
- monitor β interval, probe timeout/retries, concurrency
- output β formats and file paths
- alert β console colors, min severity
- web β dashboard host/port, refresh, cache TTL, push events
deta integrates with the Semcod ecosystem:
from pathlib import Path
from deta.integration import generate_for_sumd, generate_for_pyqual, generate_for_vallm, pre_deploy_check
# Generate toon for sumd
generate_for_sumd(Path("."), output=Path("infra.toon.yaml"))
# Quality analysis for pyqual
generate_for_pyqual(Path("."), depth=3)
# Validation for vallm
generate_for_vallm(Path("."), depth=3)
# Pre-deployment validation
passed, issues = pre_deploy_check(Path("."))
if not passed:
print("Deployment blocked:", issues)pytest tests/ -vTest coverage: cache invalidation, compose env interpolation, DSL commands, .env parsing, port parsing, monitor port display.
Licensed under Apache-2.0.