Repository navigation
Open
Milestone
Description
Parent: #860
Milestone: Phase 6: Hardening + benchmark
Host: both · Expected cost: $3.30
Prove the rewrite before cutover: security review, the benchmark gate, and the long-run soak.
- Six-lens factory review of the whole
nostream-relay+nostream-storagesurface (security, architecture, performance at minimum; code/UX on the admin+MCP surface) - Fuzzing:
cargo-fuzztargets on the message parser, filter parser, NIP-11 doc generator, settings loader — 24h fuzz run on tauceti, zero crashes (crashes found → issues → re-fuzz) - Benchmark gate (chappie rig, from [Rewrite P3] Storage seam + LMDB backend (strfry-style) + PG→LMDB migration #864's baseline): LMDB backend within 1.5× of Postgres on REQ p95 latency, ≥ 1× on ingest throughput, at 1M and 10M event corpora; results published in
docs/rewrite/benchmarks.md - Soak: 72h run on tauceti under synthetic load (mixed subscribe/event/COUNT/negentropy traffic, restarts injected) — memory flat, no fd leaks, event-store checksums stable across restarts
- Security review of the new surface: the MCP auth model, the settings surface, the migration tool (it holds DB credentials), LMDB file permissions
- Docs:
docs/rewrite/completed — architecture map TS→Rust crate, deployment guide, operator migration runbook
Acceptance: fuzz clean, benchmark gate green, soak green with published evidence, review lenses PASS, docs complete.
- Prometheus
/metricsendpoint (feat: add Prometheus metrics endpoint #595): the soak's acceptance is that the relay stays healthy under sustained load, and health is unmeasurable from outside the process until this exists — connections, throughput and queue depth have to be scraped live, or the soak produces a log rather than a measurement. One build pass, inside this issue's estimate rather than as a row of its own.
Estimate basis (2026-10-24): $3.30 - the 72-hour soak is wall-clock, not tokens; fuzzing, the benchmark gate and an independent security review cost about two large jobs' review rounds. Model and per-unit costs: .factory/estimates.md.
Activity
chappie-daemon commentedon Nov 29, 2026
Row split for this issue, taken 2026-11-29 on the operator's steer to run the rewrite programme before defect tickets.
Six rows, in this order, with the reason each is where it is:
GET /metricsin Prometheus text format, and the admin SSE snapshot upgraded from itsunavailableshape to the real numberscargo-fuzztargets for the message parser, filter parser, NIP-11 generator and settings loader, plus a short local rundocs/rewrite/benchmarks.md, run against #864's baseline corpusnostream-relay+nostream-storage, code/UX on admin+MCP, plus the security review of MCP auth, settings, the migration tool and LMDB permissionsRows 2–6 are filed when their turn comes, not now, so each spec is written against the tree it will land on. This issue closes when all six are done.
Starting row 1 (#595).
chappie-daemon commentedon Nov 29, 2026
Row 1 amended after recon (job 042) — the SSE snapshot upgrade comes out of this row and becomes its own.
Measured, not assumed: the console's snapshot
updateSnapshotrenders seven numeric keys, and two of them (eventsPerSecond,eventsRejectedPerSecond) need a rate window the process does not keep whilecpuLoadPercent/memoryUsedMbneed process statistics with no crate behind them (libc/sysinfoabsent; the only procfs reader sits innostream-cli). Doing the text endpoint and an honest snapshot in one pass, with the four parity/route/SSE fixtures it moves, is where this row would exceed one build pass and, per the recon's risks, turn an instrument into two jobs.So row 1 is #595 alone: the counters the relay can keep honestly, and a scrape endpoint with an auth a Prometheus target can actually use. The SSE snapshot upgrade is filed as a row of its own when it is picked up — it is still Phase 6 work, not dropped.
Second finding worth the board:
nostreamdstill composesunavailable::stores()(main.rs:235,247), so an accepted-throughput counter reads 0 at this commit and every query duration times an error return. Rows 3 and 4 (benchmark gate, 72 h soak) cannot measure anything real until #1206 lands; row 1 is startable because the counters instrument the relay's own paths and are testable against a real-store harness.feat: a Prometheus scrape endpoint and the relay counters it reads (#…
chappie-daemon commentedon Nov 29, 2026
Row 1 done: #595 merged as
bb00f82eb350d291de47220ca3e4592fe00843ba(PR #1282), issue closed.The relay now keeps the counters #595 names and serves them as Prometheus text at
GET <prefix>/metrics, behindAuthorization: Bearer $METRICS_TOKEN(constant-time) andMETRICS_ENABLED, outside the admin gate because<prefix>/admin/metricsis the console's SSE stream. ADR 0021 records the four decisions and their costs. AUTH's replies are carved out of the accepted/rejected families — before the carve-out a successful NIP-42 AUTH counted as an accepted event.Two corrections the job had to make to its own record, worth naming so the next row does not repeat them: ADR 0021 first claimed the accepted counter reads 0 until #1206, which the rebase onto
1514e7f2made false; and Greptile caught a torn histogram read that six independent atomic loads made possible, fixed with a monotone clamp and a seam-backed regression case.Cost: $3.01 against a $1.85 first estimate, re-estimated to $2.75 at pr-open, then extended to $3.25 on Cameri's call to cover the histogram fix round. 21 sessions. The estimate was wrong because it priced one pass for a row that introduced a surface, a credential and an encoder; the regret line's forward rule is that a credential-plus-ADR row is priced as a two-round row.
Rows 2–5 of the split are unaffected; row 3 and 4 no longer wait on #1206 (it merged), only on tauceti's runbook.