404human Projects Writing Build logs Learning Books Progress
Rust · Zola
zsh · 404human@dev:~ Tab complete · ↑↓ history · type help

Service Monitor: the build log

A monitor that keeps an eye on your websites and tells you, honestly, when something breaks — and just as honestly, when it can't see. Rust, built in the open, one tested step at a time. This is the rebuild: the first monitor's build log is retired, its lessons kept.

Entries
39 logged
Status
feature-complete; security pass done, final check: ship; 1M API reads pass; 1M checks not run (20 checks/s ceiling)
Up next
H.3 The commit-lag miss and a way to run a million checks, then the droplet
Service Monitor at a glance 39 entries
MilestoneNameEntriesState
M0 scaffold 1 done
M1 check and remember 5 done
M2 notify 4 done
M3 display and status 4 done
M4 operate 4 done
M5 ship 5 done
M6 parity 11 done
M7 deferred items, closed 3 done
H hardening 2 ● in progress

Latest · H · H.2: Internet-ready, and 1M API reads

tests per entry — 11 at 0.1 → 279 at H.2
0.1   ███ 11
1.1   █████ 31
1.2   █████ 31
1.3   █████ 31
1.4   █████ 31
1.5   █████ 31
2.1   ██████████ 61
2.2   ██████████ 61
2.3   ██████████ 61
2.4   ██████████ 61
3.1   ███████████ 67
3.2   ███████████ 71
3.3   ███████████ 71
3.4   ███████████ 71
4.1   ███████████ 72
4.2   ████████████ 78
4.3   ████████████ 80
4.4   ████████████ 80
5.1   █████████████ 83
5.2   ██████████████ 88
5.3   ██████████████ 88
5.4   ██████████████ 88
6.1   ██████████████ 93
6.2   ███████████████ 100
6.3   ███████████████ 101
6.4   ███████████████ 101
6.5   ███████████████ 101
6.6   ███████████████ 101
6.7   ███████████████ 101
6.8   ████████████████ 106
6.9   █████████████████ 113
6.10  ██████████████████ 116
6.11  ██████████████████ 122
7.1   ███████████████████ 125
7.2   █████████████████████ 137
7.3   █████████████████████ 137
soak  █████████████████████ 137
H.1   █████████████████████████████████████ 253
H.2   █████████████████████████████████████████ 279


M0 · scaffold

Workspace, contract-first domain types, the honest-states dashboard shell.

0.1
The rebuild

The first monitor's code is gone. This log restarts with a contract-first rebuild — and one rule from the old build that never changed: unknown is a state, not a bug.

Read the full entry →

11
M1 · check and remember

Real probes on a bounded schedule, one writer committing evidence, state that survives a restart.

1.1
Probe engine

One GET with a whole-attempt deadline and a 64 KiB body bound — a probe returns a classified CheckOutcome, and a hung target reads 'timeout', never a stalled worker.

Read the full entry →

31
1.2
Scheduler + coordinator

Slots fire on the interval grid under try_acquire bounds — one attempt per slot, no overlap, no catch-up; a saturated worker records 'missed', never a queue storm.

Read the full entry →

31
1.3
Single writer

Check row + incident transition + outbox event commit together — the in-memory machine only advances after the commit lands, and a missed slot is a stored row, not an absence.

Read the full entry →

31
1.4
Restart recovery

Open incidents and streaks rebuild from the store on boot — an incident persists until two fresh passes, and a server killed mid-incident comes back still 'down'.

Read the full entry →

31
1.5
Committed-only status

The API and dashboard answer from a map written after the commit — an unwritten result can never show up green, and M1's live drill proved the whole loop end to end.

Read the full entry →

31
M2 · notify

Signed webhooks delivered at least once, editing that can't lose a probe, evidence you can query.

2.1
Outbox deliverer

Signed webhooks delivered at least once from a bounded pool — a hung receiver holds a delivery slot, never a probe slot.

Read the full entry →

61
2.2
Generation-guarded writes

PATCH/DELETE revalidate and bump generation atomically — an in-flight probe under the old generation is dropped as stale, and a monitor with evidence refuses to be deleted.

Read the full entry →

61
2.3
Evidence APIs

GET checks (missed rows included — gaps are part of the record) and GET incidents with filters, the dashboard detail page, and full CLI management verbs.

Read the full entry →

61
2.4
Fault fixtures

ok/fail/slow/hang/status/flaky targets plus a /sink webhook receiver with a hang mode — none of the honest-states claims are provable without worst-case fixtures.

Read the full entry →

61
M3 · display and status

Coverage kept apart from success, a public status page, and a heartbeat that says when the monitor itself dies.

3.1
Coverage vs success

GET stats answers 'did we look' and 'what did we see' as separate numbers — 24h of misses is 0% coverage with undefined success, never 'down by silence'.

Read the full entry →

67
3.2
Public status snapshot

status.json rewritten every beat — atomic, allowlisted fields only, self-expiring — rendered by a static page with zero runtime dependency on the monitor.

Read the full entry →

71
3.3
Independent heartbeat

expires_at is the heartbeat: an independent checker reads it, so a dead monitor reads 'monitoring unavailable' — a different sentence than 'all targets down'.

Read the full entry →

71
3.4
Browser suite

Playwright boots the real server and fixture — the abort banner fabricates nothing, a badge turns up on committed evidence, a real incident renders, keyboard nav works.

Read the full entry →

71
M4 · operate

Retention, disk guardrails, backup and restore, and running on its own host.

4.1
Retention

Checks past 7 days roll into per-day outcome counts and delete in the same transaction — open incidents keep every raw row, and coverage over a long window stays true after expiry.

Read the full entry →

72
4.2
Disk guardrails

A page-count ceiling turns a full disk into clean SQLITE_FULL errors, consecutive commit failures answer a real 503 on readyz — and recovery is proven by a landed write, never a timer.

Read the full entry →

78
4.3
Backup + restore

VACUUM INTO behind POST /api/backup, plus a drill that opens an incident, backs up, destroys, restores — and finds the incident and pending outbox still there.

Read the full entry →

80
4.4
Deployment

Versioned releases behind a current symlink, data outside releases so a rollback can't roll back evidence — and the upgrade/rollback drill ran mid-incident for real.

Read the full entry →

80
M5 · ship

Auth, the rest of the SSRF hardening, load runs, and a release someone else can install.

5.1
Management auth

Bearer auth on every /api route, compared on SHA-256 digests — and a tokenless public bind refuses to boot before a single task spawns.

Read the full entry →

83
5.2
SSRF complete

PolicyResolver validates every DNS answer inside reqwest's resolver — the dialer only ever sees validated addresses, one local address fails the whole answer, redirects revalidate per hop.

Read the full entry →

88
5.3
Load baseline

The monitor's own scheduler as the load generator: 100 monitors at the 15s floor for 10 minutes — 4000/4000 slots, zero missed, p95 commit lag 4.9s, 107/107 alerts first-attempt.

Read the full entry →

88
5.4
Release

Fresh-prefix install drill passed end to end — migrations, livez/readyz/version, dashboard, auth — with README and RUNBOOK rewritten to what the system actually is.

Read the full entry →

88
soak
24h soak evidence

576,000 probe checks over 24 hours: zero missed slots, the honest outcome mix, incidents opened and resolved, every alert delivered — reconstructed from the SQLite authority after the summarizer died, gates all true.

Read the full entry →

137
M6 · parity

Every gap the retired monitor knew — real certificate classification, per-monitor sensitivity, the four incident times, a mutating dashboard, honest charts, a drift-checked guide, exit codes, mutation testing, and maintenance windows.

6.1
Certificate classification

TLS failures now say which certificate problem they saw — expired, not yet valid, name mismatch, untrusted — committed as check detail, not flattened to 'connect'.

Read the full entry →

93
6.2
Per-monitor sensitivity

failures_to_open and passes_to_recover live on the monitor row — a noisy target and a quiet one get different tripwires, applied atomically with the generation bump.

Read the full entry →

100
6.3
Four incident times

first_fail_at, opened_at, last_fail_at, resolved_at tracked separately — start-of-failure is not time-of-notice, and the streak start is derived from committed rows inside the transaction.

Read the full entry →

101
6.4
Dashboard mutations

Create, edit, pause and delete in the browser — through the same API contract as the CLI, with the generation guard and envelope errors surfaced instead of swallowed.

Read the full entry →

101
6.5
Check strip

One cell per committed check, plus dashed gap cells for slots with no evidence — a paused window renders as a hole, never interpolated green.

Read the full entry →

101
6.6
Auto-refresh

Both pages poll invalidateAll on the 15-second tick — atomic data swaps with no stale-green flash, and a mid-poll outage honestly resolves to 'cannot see'.

Read the full entry →

101
6.7
Status in-app

GET /status.json serves the sanitized artifact unmodified — outside /api, no token — and /status renders it; stale or missing reads 'monitoring unavailable', never fabricated rows.

Read the full entry →

101
6.8
Guide + drift check

Every status word documented in plain English from one glossary — and a drift test that fails the build if the wire vocabulary and the guide ever disagree.

Read the full entry →

106
6.9
CLI exit codes

A documented contract — 0 success, 1 API error, 2 usage, 3 unreachable, 4 unauthorized — pinned by tests that spawn the real binary against a stub server.

Read the full entry →

113
6.10
Mutation testing

cargo-mutants attacked every public function in monitor-domain — the first run missed 5 boundary mutants, three tests closed them, re-run clean at zero missed.

Read the full entry →

116
6.11
Maintenance windows

Schedule-scoped suppression that silences the page but never the evidence — checks still commit, the streak keeps counting, and a still-broken target opens on the first check after expiry.

Read the full entry →

122
M7 · deferred items, closed

Email alerts as a second outbox channel, a real dashboard login, and a rising-load drill that checks the monitor's story against a real app's own ground truth.

7.1
Email alerts

Email joins webhooks in the same outbox — one incident transition enqueues one row per configured channel, each with its own retries, so a dead relay can never stall the other channel.

Read the full entry →

125
7.2
Dashboard login

The token gate kept the admin token in localStorage and sent it on every call. Now the dashboard trades it once for an HttpOnly session cookie — expiring server-side, logout that actually kills the row, and CSRF rules the middleware enforces.

Read the full entry →

137
7.3
Real-app load drill

The lab profile proved the monitor keeps bounded evidence under load it generates itself. This drill drives 3.84M requests at a real Node app, degrades it, heals it, and checks every monitor claim against the app's own ground truth.

Read the full entry →

137
H · hardening — in progress

An outside gap review before the monitor moves to its own server; fix rounds each re-checked by a second reviewer; then the owed load evidence on a release build of the hardened code.

H.1
Security pass: four rounds

A gap review found the 2 GiB disk cap held on one database connection out of four, webhook secrets in the logs and holes in the SSRF guard. Four reviewed fix rounds later the last reviewer said ship, tests went from 137 to 215, and several of the fixes turned out to have created bugs of their own. A late verification round with hosted CI merged too, not yet reviewed. The million-check run and a fresh soak are still owed, and one SQLite advisory waits on an upstream release.

Read the full entry →

253
H.2
Internet-ready, and 1M API reads

Two more security rounds closed what the reviews asked for before the monitor faces the internet: per-address login limits, connection and write deadlines, and DNS-rebinding protection. The final check says ship. A million API reads all answered 200. A million checks can't run yet: at the monitor's 20 checks a second, that's almost 14 hours.

Read the full entry →

279
H.3 ● The commit-lag miss and a way to run a million checks, then the droplet — being built now

Related guides