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

Rules found by rebuilding lifecycle and OAuth scopes from the spec alone, with the server fixed to them

Merged
Merged chadtmiller.com asked to merge into gatespeed from chadtmiller.com/monolith:lifegaps-s

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 on main.

Rules (LIFECYCLE.md)

  • The PLC directory unreachable: checkAccountStatus answers 200 with validDid: false. activateAccount and the admin's activation answer 502 UpstreamFailure, also for a DID no account has.
  • Sync reads of a DID no account has: the token is checked first. A good token, or none, gets RepoNotFound.
  • DPoP on sync reads: the header is checked as an OAuth token. A good one counts as the account's own token.
  • A strongRef with no record key: 200, and nothing is taken down; also for a taken-down account. A handle in getSubjectStatus is 500, as in the reference.
  • Unknown $type subjects: deactivated changes nothing.
  • activateAccount of a deleted account: the order is token, body, DID document, then state. With its DID moved elsewhere, it is 400 InvalidRequest.
  • New rows of the state table: the email methods, getAccountInviteCodes, get/putPreferences and 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 call getPreferences.

Rules (OAUTH-SCOPES.md)

  • blob: media types: only U+0020 counts as a space.
  • The refusal's lower case: the Content-Type bytes are taken as Latin-1.
  • createAccount: a malformed DPoP header is 400 InvalidToken, before the input.
  • htu for 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 main got wrong:

  • PLC-down answers;
  • takedown and deletion leaks in the email, invite, preference and push methods (a taken-down account was even mailed);
  • the odd strongRefs and handle subjects;
  • reactivating a deleted account;
  • the two OAuth-scope edges.

Each has unit tests.

Harness:

  • --lifecycle runs a PLC proxy that can go down, and gains the oddSubjects and passwordReset steps;
  • sync reads with OAuth and DPoP forms;
  • the new state-table rows;
  • oauthScopedEdges in checks/oauth-scopes.mjs.

Checked:

  • --lifecycle, and with --crash-every 6;
  • --only oauthScopedEdges;
  • plain seed 1;
  • --limits;
  • cargo test --workspace.

The merge queue runs the full gates.

🤖 Generated with Claude Code

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_data gives 502 UpstreamFailure, and checkAccountStatus answers validDid: false).
  • activate_gone, activateAccount of a deleted account, and the strongRef and handle-subject cases.
  • The new state-table rows and their gate ordering.
  • The Latin-1 blob: media type, the createAccount DPoP header form, and the htu change.

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.rs
  • crates/pds-server/src/scopes/tests.rs
  • harness/checks/lifecycle.mjs

A harness run is the only check on the new harness steps.

Merged as 910f3a5