feat(service): M2a — account gate, quotas, sessions #4
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/m2a-service"
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?
Roadmap M2a. The transport-free service layer with the account gate, quotas, and session migration — hard-rule #1 (uncircumventable gate), tested over in-memory fakes. Still offline/std-only (Postgres + async land in M2b).
Changes
TreeId.Actor(Anonymous/User) +require_user()→AuthRequired(FR-OV-02).TreeStore/QuotaStore/SessionStore/TripBuilder(sync now; async in M2b).Trees.validate_tree(anon-ok, attaches to session),Trips.build_trip/refine_trip(gate → places check → quota consume → refund on failure),Accounts.quota_remaining/adopt_session(FR-IMP-18).ServiceError(nothiserror— keeps it dependency-free).MemTrees/MemQuota/MemSessions/StubBuilder).Verification
just qagreen. 5 invariant tests: anon build rejected; anon validate + adopt; build needs usable places (checked before quota); quota consumed→exceeded; failed build refunds.Traces: FR-OV-01/02, FR-ACC-13/16, FR-IMP-18/19 · tech-spec 01.
- domain: add TreeId - service: transport-free capability layer - Actor (Anonymous/User) + require_user → AuthRequired (FR-OV-02) - ports: TreeStore/QuotaStore/SessionStore/TripBuilder (sync; async in M2b) - Trees.validate_tree (anon-ok, attaches to session), Trips.build/refine (gate → places check → quota consume → refund on failure), Accounts (quota_remaining, adopt_session migration — FR-IMP-18) - hand-rolled ServiceError (no thiserror; offline) - mem: in-memory fakes (MemTrees/MemQuota/MemSessions/StubBuilder) Invariants tested (5): anon build rejected; anon validate + adopt; build needs usable places (before quota); quota consumed→exceeded; failed build refunds. just qa green. Still offline/std-only (no external deps yet). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>