Every failure the server answers with names its own error code
Build / Build (push) Successful in 34s
Deploy / privapub.thepra.dev (push) Successful in 57s
Deploy / Release notes on the Releases tab (push) Successful in 3s

Each refusal and failure the client API sends now starts with a code no other failure uses, such as "[ERR0030006] That
code is not valid.", so a screenshot or a report points at the exact place it came from. Nothing another program reads
changes: ActivityPub, the Mastodon API's errors, sign-in tokens and the error kinds decePubClient branches on stay as they
were. The house-rules checks move to 1.1.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W4YtEJrgxG12Pc39Fai8Bd
This commit is contained in:
thepraandClaude Opus 5.5 committed 2026-11-10 08:11:24 +01:00
1 parent f3fdeaf038
commit c2f439d1e9
25 files changed
+268 -224

No files matched your search

+37
View File
@@ -1105,6 +1105,43 @@ same rules. Applied to PrivaPub:
(HR0009).
- Numbers shown to a reader go through formatting helpers (HR0011). The ISO week key (`InstanceDescriber.Week`)
and the six-digit email code (`EmailVerificationJob.NewCode`) are identifiers, and say so.
- **Error codes** (HR0012, HR0013): every `WebResult` failure the server answers with starts with a code no other
failure uses, `[ERR0030006] …`, through `ErrUtility.ToCodedError` (namespace `PrivaPub`; `HouseRulesCodedErrors` is on
in `PrivaPub.csproj` only). The code goes in the message, the text a person reads in decePubClient. Nothing
machine-read changes: `WebResult.ErrorCode` (the `FailureCodes` decePubClient branches on), ActivityPub responses,
OpenIddict's own errors and the Mastodon API's `{"error": …}` bodies don't come from `WebResult`. A helper that
builds failures takes an `int errorCode` (`EmojiAdminController.Refused`, `InstanceAdminController.Refused`), called
with a literal. Each file owns a block of 1000; a new file takes the next free one (31000):
| Codes | File |
|---|---|
| 10000–10999 | `Controllers/ClientToServer/AdminController` |
| 11000–11999 | `Controllers/ClientToServer/BackupController` |
| 12000–12999 | `Controllers/ClientToServer/DataController` |
| 13000–13999 | `Controllers/ClientToServer/DomainBlockController` |
| 14000–14999 | `Controllers/ClientToServer/EmojiAdminController` |
| 15000–15999 | `Controllers/ClientToServer/GroupController` |
| 16000–16999 | `Controllers/ClientToServer/InstanceAdminController` |
| 17000–17999 | `Controllers/ClientToServer/ModeratorController` |
| 18000–18999 | `Controllers/ClientToServer/PersonaArchiveController` |
| 19000–19999 | `Controllers/ClientToServer/PostController` |
| 20000–20999 | `Controllers/ClientToServer/PrivateAvatarController` |
| 21000–21999 | `Controllers/ClientToServer/RootUserController` |
| 22000–22999 | `Controllers/ClientToServer/SocialController` |
| 23000–23999 | `Domain/Moderation/AccountModeration` |
| 24000–24999 | `Domain/Social/FollowService` |
| 25000–25999 | `Domain/Timelines/TimelineService` |
| 26000–26999 | `Services/ClientToServer/Private/IPrivateAvatarUsersService` |
| 27000–27999 | `Services/GroupUsersService` |
| 28000–28999 | `Services/JwtEvents` |
| 29000–29999 | `Services/PostsService` |
| 30000–30999 | `Services/RootUsersService` |
- **Passwords** (HR0311): only the owner of a login chooses its password (sign-up, change, e-mailed recovery code). The
one place an operator types a password is the shell's `PrivaPub admin create-root`, meant for the operator's own
first login.
- **Spreadsheets** (HR0319): none, and none by default.
- **Not applicable here:** the markup rules (HR0107, HR0108, HR0320) belong to decePubClient, which has its own section.
- **Routes** are constants in `PrivaPub/ApiPaths.cs` (HR0305): one nested class per controller, `GET_`/`POST_`/…,
`_M_` when the template has parameters, `Prefix` for a controller's own `[Route]`. The values are the frozen routes
above, never changed by a rename. decePubClient keeps its own `APIs` class (owner, 2026-11-10: kept separate).