chadtmiller.com/monolith
An atproto PDS
0
0
harness: SMTP, requests out, MCP lifecycle and spaces OAuth checked
Merged Approved
This adds harness checks for the SMTP, requests-out, MCP lifecycle and spaces-OAuth sections that the citation gate listed as unchecked. It adds an SMTP sink (lib/smtp.mjs) and a checkSmtp that holds each email to the development sink's record. It also adds a requestsOut check that fills 256 slots and waits for the 257th to fail. MCP session checks cover a takedown, deactivation by password and by MCP token, sign-out, deletion, and restarts. A space-scope check on the server alone completes the set.
I read all 21 files and found nothing that has to change.
- Harness strictness: every check I read tightens the harness or adds a check. The
UNCHECKEDlist shrinks togetBlocks, and the reason it gives is concrete and points at an issue. - Spec and docs: each page's "How it is checked" matches its new check. The OAUTH-MCP "Lifecycle and durability" text about sign-out now agrees with OAUTH.md and the server.
docs/guide/deploying.mdalready documentsPDS_EMAIL_SMTP_URLandPDS_EMAIL_FROM, so no guide needs updating. - Server code and crates: the pull changes no server code and adds no crates.
- Excused conformance checks:
harness/conformance.yamlis unchanged. - Timing risk:
checkSmtptakes the wire messages right after the development sink's record. That is only sound while the server finishes its SMTP delivery before it answers the request. The500the sink-refusing step expects implies it does, but any email the server later sends in the background would show up as a stray message.
Merged as 03290bc
Checks for five of the six sections the citation gate listed as unchecked, and one marked informative. The sixth, LIMITS.md "getBlocks", has its check written and proven on branch
harness/getblocks, but its setup found the server over its memory bound, so it waits there for the server: at://did:plc:bcgltzqazw5tb6k2g3ttenbj/space/dev.knotless.space/spec-pds/did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.issue/3n24v3yorfeyqClaude Opus 5.5 · high
What changes
Harness.
lib/smtp.mjs, an SMTP sink on the loopback that requires a login, its user and password percent-encoded in the URL, its envelope read as UTF-8, one sink for a whole run across restarts. Every run gives the serverPDS_EMAIL_SMTP_URLandPDS_EMAIL_FROM; every email the development sink takes must arrive over SMTP once, fromPDS_EMAIL_FROM, to the account's email, with its kind's subject and its token, and nothing else may arrive. A new step sets the sink refusing: the method is500 InternalServerErrorwhere the reference answers200, and the token not delivered is then used. The end of each run starts the server with one of the two variables: exit 1,pds:on standard error.--limitsrun holds 256 forwarded calls open at the AppView, a byte a second; the 257th is502 UpstreamFailure9.5 to 13 s after it was sent and never reaches the AppView; released, they are200, and a call goes through again.lib/services.mjslets a service hold an answer open.gates.mjs: the--limitsrun's time, 140 s.--commandsruns, MCP sessions through an admin takedown and its lifting, a deactivation by the password session and one by an MCP token, the pages' sign-out, anddeleteAccount; in crash runs with--commands, sessions, refreshes, endings, codes and device sign-ins across each restart.atprotoand aspace:scope signs in; its token's scope holds nospace:permission, andlistSpaceswith it and a good proof is400 InvalidToken, on the server alone.spec-coverage.mjs:UNCHECKEDnames LIMITS.md "getBlocks" alone, with why; it walks nonode_modules(94 s of a checkout with the packages installed, now 0.2 s).Spec. Each page's "How it is checked" says what its new check does; LIMITS.md no longer leaves the slots of requests out to the server's own tests. OAUTH-SCOPES.md "For other slices" is marked informative: it says what a handler is given inside the server, which no request shows, and its observable rules are stated in "What a scope allows". OAUTH-MCP.md "Lifecycle and durability" read as if the pages' sign-out ended MCP sessions; it now says what OAUTH.md's
sign-outsays and the server does: the account is signed out of that device alone, and no session ends.Why
The citation gate made these sections visible: parts of the spec no check held the server to. The server already did what each says; nothing would have caught it stopping.
How it was checked
Each run alone on this machine, against the server built from this branch:
compare.mjs --steps 400 --seed 1: passes; the SMTP refusals (500, the token used after), the bad start, and the space method's refusal counted.compare.mjs --limits: passes; "requests out, 256 at once" counted.compare.mjs --steps 400 --seed 31 --commands: passes; each MCP lifecycle case counted.compare.mjs --steps 120 --seed 41 --crash-every 15 --firehose --commands: passes; MCP sessions across 8 restarts.Each check was seen to fail on a bug planted in the server, built and run alone, the server put back after:
email.rsdeliveranswersOk(())when sending failsrequestEmailConfirmation, the sink refusing:200, not500outbound.rsTURN_WAIT1 s502after about 1 s, not 9.5 to 13oauth.rsend_forkeeps MCP sessions/mcpwith the token of a session whose account was taken downscopes.rsreads a space method'sDPoPtokenlistSpaceswith an OAuth tokenThe getBlocks check on
harness/getblocks, for the record: with the memory bound of its 100000-record write set aside by hand,getBlocksof held CIDs 10.48 ms against 4.39 (bound 18.17), of a missing CID first 4.52 against 4.28 (bound 17.85); withblocks_carplanted to walk the tree before a CID is found missing, 805.78 ms against 3.94 (bound 16.82), failed. Its write peaked at 83.3, 94.1 and 93.9 MiB against a bound of about 75.5: the issue above.The runs were made before
main's newest commits were merged in; thegatesworkflow checks the merge.Shortcomings
smtps://and the STARTTLS upgrade are not checked; the sink offers neither. "With neither, nothing is sent" is not either: spec-pds's runs now always set both.did:webdocuments, OAuth clients' documents and spaces' notifications take the same slots, unchecked.--firehose; deactivation by the admin is not tried with MCP sessions.Review
The SMTP sink (
harness/lib/smtp.mjs,lib/mail.mjs'scheckSmtp) and the requests-out check (checks/limits.mjs,requestsOut) are the new machinery; the rest extends existing runs.