~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0

harness: SMTP, requests out, MCP lifecycle and spaces OAuth checked

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/monolith:harness/unchecked

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/3n24v3yorfeyq

Claude Opus 5.5 · high

What changes

Harness.

  • EMAIL.md "SMTP": 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 server PDS_EMAIL_SMTP_URL and PDS_EMAIL_FROM; every email the development sink takes must arrive over SMTP once, from PDS_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 is 500 InternalServerError where the reference answers 200, 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.
  • LIMITS.md "Requests out": the --limits run holds 256 forwarded calls open at the AppView, a byte a second; the 257th is 502 UpstreamFailure 9.5 to 13 s after it was sent and never reaches the AppView; released, they are 200, and a call goes through again. lib/services.mjs lets a service hold an answer open. gates.mjs: the --limits run's time, 140 s.
  • OAUTH-MCP.md "Lifecycle and durability": in --commands runs, 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, and deleteAccount; in crash runs with --commands, sessions, refreshes, endings, codes and device sign-ins across each restart.
  • OAUTH-SCOPES.md "Spaces": a client asking for atproto and a space: scope signs in; its token's scope holds no space: permission, and listSpaces with it and a good proof is 400 InvalidToken, on the server alone.
  • spec-coverage.mjs: UNCHECKED names LIMITS.md "getBlocks" alone, with why; it walks no node_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-out says 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:

CheckPlantedFailed at
SMTPemail.rs deliver answers Ok(()) when sending failsrequestEmailConfirmation, the sink refusing: 200, not 500
Requests outoutbound.rs TURN_WAIT 1 sthe 257th 502 after about 1 s, not 9.5 to 13
MCP lifecycleoauth.rs end_for keeps MCP sessions/mcp with the token of a session whose account was taken down
Spacesscopes.rs reads a space method's DPoP tokenlistSpaces with an OAuth token

The getBlocks check on harness/getblocks, for the record: with the memory bound of its 100000-record write set aside by hand, getBlocks of held CIDs 10.48 ms against 4.39 (bound 18.17), of a missing CID first 4.52 against 4.28 (bound 17.85); with blocks_car planted 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; the gates workflow checks the merge.

Shortcomings

  • SMTP: 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.
  • Requests out: only forwarded calls fill the slots; did:web documents, OAuth clients' documents and spaces' notifications take the same slots, unchecked.
  • MCP: deletion is left out of runs with --firehose; deactivation by the admin is not tried with MCP sessions.
  • Spaces: what the section lists "for later", not served yet, is not checked.

Review

The SMTP sink (harness/lib/smtp.mjs, lib/mail.mjs's checkSmtp) and the requests-out check (checks/limits.mjs, requestsOut) are the new machinery; the rest extends existing runs.

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 UNCHECKED list shrinks to getBlocks, 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.md already documents PDS_EMAIL_SMTP_URL and PDS_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.yaml is unchanged.
  • Timing risk: checkSmtp takes 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. The 500 the 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