chadtmiller.com/monolith
An atproto PDS
0
0
Rules found by rebuilding lifecycle and OAuth scopes from the spec alone, with the server fixed to them
Mergedchadtmiller.com added 10 commits
Approved
This pull writes down the lifecycle and OAuth-scope edge cases found by rebuilding both areas from the spec alone. It fixes the server to match and adds harness steps for them.
The server changes I read agree with the spec text that came with them:
- PLC-down answers (
did_datagives502 UpstreamFailure, andcheckAccountStatusanswersvalidDid: false). activate_gone,activateAccountof a deleted account, and thestrongRefand handle-subject cases.- The new state-table rows and their gate ordering.
- The Latin-1
blob:media type, thecreateAccountDPoPheader form, and thehtuchange.
The one departure from the reference, refusing push registration for a taken-down account, is listed in both LIFECYCLE.md and PROXY.md.
I found no loosened harness check. harness/conformance.yaml is untouched, no crates were added, and the spec carries no build history.
I did not read these files, so I say nothing about them:
crates/pds-server/src/lifecycle/tests.rscrates/pds-server/src/scopes/tests.rsharness/checks/lifecycle.mjs
A harness run is the only check on the new harness steps.
Merged as 910f3a5
Rules found by rebuilding two areas from the spec alone. A fresh agent, given only
spec/, rebuilt the lifecycle module and then the OAuth scopes module. Both passed every harness run on the first build, but each logged where the spec left it to guess. Those cases are now probed on the reference, written down, and drawn by the harness. Several were wrong onmain.Rules (
LIFECYCLE.md)checkAccountStatusanswers 200 withvalidDid: false.activateAccountand the admin's activation answer502 UpstreamFailure, also for a DID no account has.RepoNotFound.DPoPon sync reads: the header is checked as an OAuth token. A good one counts as the account's own token.strongRefwith no record key: 200, and nothing is taken down; also for a taken-down account. A handle ingetSubjectStatusis500, as in the reference.$typesubjects:deactivatedchanges nothing.activateAccountof a deleted account: the order is token, body, DID document, then state. With its DID moved elsewhere, it is400 InvalidRequest.getAccountInviteCodes,get/putPreferencesand push registration, for deactivated, taken-down and deleted accounts. The state is checked after the token and scope, before the input. The taken-down session may callgetPreferences.Rules (
OAUTH-SCOPES.md)blob:media types: only U+0020 counts as a space.Content-Typebytes are taken as Latin-1.createAccount: a malformedDPoPheader is400 InvalidToken, before the input.htufor a method named in another case: the path as sent.Departure from the reference: it forwards push registration for a taken-down account. The server refuses, as it refuses service tokens to taken-down accounts. The departure is listed in the page.
Server fixes: each rule
maingot wrong:strongRefs and handle subjects;Each has unit tests.
Harness:
--lifecycleruns a PLC proxy that can go down, and gains theoddSubjectsandpasswordResetsteps;DPoPforms;oauthScopedEdgesinchecks/oauth-scopes.mjs.Checked:
--lifecycle, and with--crash-every 6;--only oauthScopedEdges;--limits;cargo test --workspace.The merge queue runs the full gates.
🤖 Generated with Claude Code