| 17 |
17 |
|
| Module | File | Role |
|
| 18 |
18 |
|
|--------|------|------|
|
| 19 |
19 |
|
| `main` | `src/main.rs` | Entry point: parses CLI args, dispatches to CLI handler or MCP server |
|
| 20 |
|
- |
| `cli` | `src/cli.rs` | CLI command handlers (health, test, status, versions, history, prune, serve, mesh) |
|
|
20 |
+ |
| `cli` | `src/cli/` | CLI command handlers. `mod.rs` dispatch, plus `serve.rs`, `status.rs`, `incident.rs`, `transition.rs`, and `tasks/` (one spawner per background loop: health, tls, dns, whois, routes, cors, backup, systemd, scan_pipeline, synckit_fleet, meta_alert, prune) |
|
| 21 |
21 |
|
| `config` | `src/config.rs` | TOML config loading, types for targets/peers/alerts/serve settings |
|
| 22 |
22 |
|
| `types` | `src/types.rs` | Shared domain types: HealthSnapshot, TestRun, TlsStatus, LatencyStats, TestStaleness |
|
| 23 |
|
- |
| `db` | `src/db.rs` | SQLite schema (versioned migrations), all queries for health/tests/alerts/TLS/incidents/peers |
|
|
23 |
+ |
| `db` | `src/db/` | SQLite persistence. `migrations.rs` holds the numbered schema migrations and pool construction; the rest is one query module per subject: health, test_runs, alerts, incidents, peers, tls, dns, whois, routes, cors, backup, systemd, scan_pipeline, synckit_fleet, maintenance |
|
| 24 |
24 |
|
| `api` | `src/api.rs` | Axum HTTP API: status, trends, peer info, mesh view, bearer token auth middleware |
|
| 25 |
|
- |
| `alerts` | `src/alerts.rs` | Alerter struct: sends emails via Postmark on status transitions, with cooldown tracking |
|
|
25 |
+ |
| `alerts` | `src/alerts/` | Alerter struct: sends emails via Postmark on status transitions, with cooldown tracking. One module per alert kind: health, tls, latency, offline, peer, dns, whois, route, cors, backup, systemd, scan, test_duration |
|
| 26 |
26 |
|
| `peer` | `src/peer.rs` | Peer mesh: identity management, heartbeat loops, grace period state machine, mesh state |
|
|
27 |
+ |
| `status` | `src/status.rs` | PoM's projection onto the shared operator status payload |
|
|
28 |
+ |
| `dashboard` | `src/dashboard.rs` | Optional HTML dashboard served at `GET /` |
|
|
29 |
+ |
| `tls` | `src/tls.rs` | Shared TLS configuration for pom's outbound HTTP, used by every probe |
|
| 27 |
30 |
|
| `display` | `src/display.rs` | Pure formatting functions for CLI output (no I/O) |
|
| 28 |
31 |
|
| `versions` | `src/versions.rs` | The `pom versions` roll-up: live version/sha per target, plus commits behind the local checkout |
|
| 29 |
32 |
|
| `error` | `src/error.rs` | Typed error enum (PomError) wrapping IO, DB, HTTP, JSON, config errors |
|
| 30 |
|
- |
| `checks::http` | `src/checks/http.rs` | HTTP health checker, response classification, expectation validation, latency drift detection, test staleness computation |
|
| 31 |
|
- |
| `checks::tls` | `src/checks/tls.rs` | TLS certificate prober: TCP connect, TLS handshake, x509 leaf cert parsing |
|
| 32 |
|
- |
| `checks::ssh` | `src/checks/ssh.rs` | Remote test runner: executes commands over SSH, captures output |
|
|
33 |
+ |
| `checks::http` | `src/checks/http.rs` | HTTP health probe: issues the request, applies configured JSON expectations, classifies the response into a HealthStatus |
|
|
34 |
+ |
| `checks::drift` | `src/checks/drift.rs` | Trend and staleness analysis over stored check history: latency drift, test duration, test staleness |
|
|
35 |
+ |
| `checks::tls` | `src/checks/tls.rs` | TLS certificate prober: connect, inspect the leaf cert, track expiry |
|
|
36 |
+ |
| `checks::ssh` | `src/checks/ssh.rs` | Remote test runner: validates the filter, runs the target's command over SSH, parses output into a TestRun |
|
|
37 |
+ |
| `checks::ssh_banner` | `src/checks/ssh_banner.rs` | TCP connect and verify the SSH protocol banner |
|
| 33 |
38 |
|
| `checks::parse` | `src/checks/parse.rs` | CI output parser: extracts PASS/FAIL steps and cargo test counts |
|
|
39 |
+ |
| `checks::dns` | `src/checks/dns.rs` | DNS record verification: resolves hostnames, compares against expected values |
|
|
40 |
+ |
| `checks::whois` | `src/checks/whois.rs` | WHOIS domain expiry checking over raw TCP |
|
|
41 |
+ |
| `checks::routes` | `src/checks/routes.rs` | Route accessibility: verifies expected pages are reachable |
|
|
42 |
+ |
| `checks::cors` | `src/checks/cors.rs` | CORS preflight: sends OPTIONS and checks Access-Control headers |
|
|
43 |
+ |
| `checks::backup` | `src/checks/backup.rs` | Local filesystem backup verification: scans for PostgreSQL backup files, checks recency |
|
|
44 |
+ |
| `checks::systemd` | `src/checks/systemd.rs` | Local systemd unit health: liveness, crash-loops, optionally any failed unit on the host |
|
|
45 |
+ |
| `checks::scan_pipeline` | `src/checks/scan_pipeline.rs` | Polls a makenotwork instance's upload scan health and applies the audit thresholds |
|
|
46 |
+ |
| `checks::synckit_fleet` | `src/checks/synckit_fleet.rs` | Polls a makenotwork instance for which SyncKit SDK versions are syncing |
|
| 34 |
47 |
|
| `tools` | `src/tools/mod.rs` | MCP server definition (PomServer), tool registration via rmcp |
|
| 35 |
48 |
|
| `tools::health` | `src/tools/health.rs` | MCP tool implementations for health checks, history, targets, mesh status |
|
| 36 |
49 |
|
| `tools::tests` | `src/tools/tests.rs` | MCP tool implementations for test execution, history, raw output |
|
| 101 |
114 |
|
|
| 102 |
115 |
|
## Database Schema
|
| 103 |
116 |
|
|
| 104 |
|
- |
SQLite with WAL journal mode. Schema is managed through numbered migrations (currently v1-v4).
|
|
117 |
+ |
SQLite with WAL journal mode. Schema is managed through numbered migrations (currently v1-v13).
|
| 105 |
118 |
|
|
| 106 |
119 |
|
### Tables
|
| 107 |
120 |
|
|