Start here
This page is the front door. Everything the brief asks for lives in
this folder: the working code (src/), the complete AI conversations
rendered as clickable transcripts (transcript/), the docs and
benchmarks behind every number. Below: how to run it, what to test step by step,
and what my usual workflow adds that this task didn't need. Dry-run only — no real
recipient ever receives anything.
Retry-After. ~135k emails/s until every recipient
is accounted for, then it starts over.Run it
Needs Node ≥ 20 and pnpm (corepack enable gets you pnpm).
Zero runtime dependencies — install pulls only the dev toolchain.
.claude/commands/guide-me.md): open Claude
Code in the folder and run it for an interactive tour that walks every step below,
runs the demos, and interprets your machine's actual numbers instead of reciting
the README's. Everything that follows is the manual version of the same route.- Install.
pnpm install
- Tests first — they're what make every number below trustworthy.
pnpm test
✓ 15/15 in ~2s: checkpoint durability, retry classification, semaphore bound, and two end-to-end exactly-once runs.
- Generate the list. 1,000,000 synthetic recipients, ~40MB CSV.
pnpm generate
- Send the campaign — and open
http://localhost:3210while it runs for the live dashboard.pnpm send
✓ ~7s wall clock, ~140k emails/s, and the accounting line sums to exactly 1,000,000 — every recipient, exactly once.
What to test, step by step
Three demos, in order of importance — each one exercises a claim the
README makes (all covered by /guide-me too).
- Crash mid-campaign, resume without duplicates. The core
promise: duplicates are worse than slowness.
pnpm send --crash-after 400000 pnpm send
The first run dies hard at ~400k sends (a simulated
kill -9, no graceful shutdown). The rerun prints "400 of 1000 batches already sent — they will be skipped" and finishes the rest: zero duplicates, at most one batch per in-flight slot re-sent.campaign.checkpoint(~4KB) is the entire mechanism. - Why rate ≠ concurrency. Run against a simulated
50 req/s provider quota, first with no client-side limiter, then with one.
pnpm send --sim-quota 50 pnpm send --sim-quota 50 --rate 50
Without
--rate: a wall of 429s — the retry machinery becomes your flow control. With--rate 50: pinned steady at the quota with a handful of 429s from jitter at the boundary. Same wall clock; very different citizenship. - Find the scaling walls. Two-regime concurrency sweep
with p50/p95/p99.
pnpm sweep
Unlimited regime: scaling bends where the client CPU (CSV parsing + request building) becomes the ceiling — never the network. Quota regime: past saturation, throughput pins and the median latency collapses ~7× — extra concurrency is pure downside.
- Optional — real TLS instead of the mock.
pnpm exec tsx scripts/bench-tls.ts
The real
EspTransportthrough real HTTPS against a local server — the bench that validated the fsync conclusion under genuine crypto load.
What's in the folder
The brief asks for two things: the code, and all of the prompts. The starred lines are the prompts — start there.
- ★transcript/01-session-scoping-and-build.html the full conversation: scoping → build → review → packaging
- ★transcript/02-session-guide-tour.html second session: re-verifying the delivered repo on my machine
- README.md the ninety-second map of the whole project
- docs/visual/architecture.html system flow, crash-resume timeline, failure tree
- docs/visual/benchmarks.html stat tiles, throughput ramp, the sweep
- docs/01–06 · *.md the depth: approaches, architecture, reliability, performance, sweep, security
- src/ · tests/ · scripts/ ~500 lines of pipeline, 15 tests, the sweep + TLS bench harnesses
How I usually work with AI — and what I skipped here
This take-home is a compressed version of the loop I run on real projects. The full loop, what ran here, and what a real project would get in addition:
docs/01–06) as the AI-readable context layer; HTML
(docs/visual/, the transcript pages, this page) as the layer I
actually read. Same facts, two audiences.docs/04 and docs/05.docs/06: three fixes, named audit
gaps) and design skills built the visual layer; the full four-skill pass is what
I'd run before any real deploy.openspec archive closing the task.