refactor(api): static feature modules, one clock and per-kind minters, an account/ layer #536
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
spec
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
amaurycoudr/chess-project!536
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "spec-421-api-wiring"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The API's wiring now follows ADR 0044. The root module alone is dynamic and global: it provides each feature's options, one clock and one minter per kind of identity. Feature modules are static and declare what they import. Tests replace providers by token through
createApp(options, overrides?).Rules first, in their own commit: ADR 0044 (0043 is taken by !534) takes over the API part of ADR 0026, ADR 0027 is corrected, and the API standards' preamble and rules 1, 2 and 6 are rewritten.
Decisions taken during the work:
AppModuleitself is global and exports the option tokens. A separate rootOptionsModuleclass failedno-extraneous-classandmax-classes-per-file.account/has no service.GamesService.exportOfgivesaccount.exportone Games call.ROOM_OPTIONSandGAMES_SERVICE_OPTIONSare gone: once the clock and minters left them, they held nothing.Evidence
After: 834 API tests, all five gate commands green on Node 24. New cases:
The profiles test now advances 1 s per Game, so its 22 Games stay inside one access token on the shared clock. Its assertions are unchanged.
Merge Danger
Door: two-way
No schema, contract or stored data changes. A revert restores the old wiring.
Blast Radius: API-boot
A provider missing from the root would fail at boot, not at a call. The whole suite boots the real app through
createApp, andaccount.*keeps its contract.Closes #421
Closes #422
Closes #423
Closes #424
Closes #425
Closes #426
Closes #427
Closes #428
added 18 commits
mainb40e298d- docs(api): state static modules, one clock and per-kind minters in ADR 004456356d9d- refactor(api): move the rate limiter to auth, its defaults to config and the doorbell to room2d993c3f- refactor(api): make Guest plain functions and import the oRPC module once6a3a6992- refactor(api): make feature modules static and override providers by token9f47a988- refactor(api): answer account.me, account.export and account.delete from an account layer122fc4ff- refactor(api): run the whole app on one injected clock27a25216- refactor(api): mint each kind of identity through its own injected minter52f99ce9- docs(repo): point the ADR index and the API standards at the new layout658857e3- refactor(api): declare the Database module global and keep session cookie headers in one file73882500- test(api): show a Room's eviction and a Session's expiry following the one clockCompare with previous version
Screenshots
Before is production, after is this merge request's review app at
7388250.Desktop
Mobile
mentioned in commit
215cdba4c9mentioned in merge request !537