Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
9f8f3b1
Compose canonical public world discovery over Account source owners
benhook1013 Nov 2, 2026
19d7f17
Merge commit '5cdeb7a5f7e099c5bde99ad10570a95e3201396c' into codex/ga…
benhook1013 Nov 2, 2026
e23062d
docs: retain current public discovery source qualification
benhook1013 Nov 2, 2026
33f8e6f
Compose public UUID selector scopes and repair final World evidence f…
benhook1013 Nov 2, 2026
02b734f
Verify shared billing source families and public discovery failures
benhook1013 Nov 2, 2026
fe5a841
Preserve lifecycle wallet bindings and exact selector expiry
benhook1013 Nov 2, 2026
bbcf164
Merge commit '3f81e74421e7225b722b2f28ccf97f5057bc8146' into codex/ga…
benhook1013 Nov 3, 2026
95a765c
Merge remote-tracking branch 'origin/codex/gameplay-private-realm-aut…
benhook1013 Nov 3, 2026
ee7ae1c
Merge commit 'c900c55094720dc959385e8c9ce9ea85d7266dcf' into codex/ga…
benhook1013 Nov 3, 2026
882dfe8
fix: preserve safe auth diagnostics and reject stale source reads
benhook1013 Nov 3, 2026
736c3af
Bound concurrent public discovery entitlement evaluation
benhook1013 Nov 3, 2026
6afe9fa
Isolate discovery target bounds and align hosting source tracker
benhook1013 Nov 3, 2026
e056ed7
Bound aggregate discovery evaluations and strengthen source boundary …
benhook1013 Nov 3, 2026
b53872b
Separate committed hosting facts from read freshness
benhook1013 Nov 3, 2026
4f93d32
Project freshly confirmed canceled hosting as unavailable
benhook1013 Nov 3, 2026
337e61e
Record paid discovery renewal activation prerequisite
benhook1013 Nov 3, 2026
a48ebce
Address discovery review proof and bound Stripe transport options
benhook1013 Nov 6, 2026
2158204
Document paid discovery observation activation prerequisites
benhook1013 Nov 6, 2026
9211008
Merge develop into public world source receiving branch
benhook1013 Nov 6, 2026
4d95d8f
Fix public discovery failure classification and strengthen launch ref…
benhook1013 Nov 6, 2026
867abce
Preserve retained recovery origins and filter qualified discovery pol…
benhook1013 Nov 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions design/architecture/microservices/account-service/api-contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,18 @@ The distinct platform-admin break-glass owner transport is `POST /internal/opera

At effective expiry or revocation, Account publishes the monotonic grant-authority change. The grant becomes invalid for discovery, connect-token issuance, `PLAY`, reconnect, and continued gameplay authority; Game Session consumes that change through bounded indexes/reconciliation and terminates affected active bindings under the session contract. A planned friendly ending is separate: close admission, complete bounded drain, then revoke/expire grants. Grant revocation is never a request to drain indefinitely. This contract is target state; the registered legacy four-field `AccountRealmAccessGrant` persistence and internal reads do not provide expiry, exact request replay, or retained tombstones. Local lifecycle-bound storage retains those capabilities, while its management and consumer entry points remain unregistered; tenant-admin mutation, qualified actor authorization, and end-to-end active-binding ejection remain unproved.

### Public bootstrap WORLDS discovery

`ListBootstrapWorlds` returns the complete set of unambiguous visible public-production worlds whose current Account entitlement says gameplay is available. Account verifies the existing browser-bootstrap credential against its persisted account identity, obtains the complete canonical target collection from Game Session, evaluates current entitlement once for each represented canonical tenant, and revalidates the caller and checks each original entitlement observation deadline before returning a deterministic `worldSlug` ordering. The Account owner fails the whole request when the target collection changes, is ambiguous, or cannot be read completely, or when any required entitlement is unavailable or expired; it never returns a partial list. The canonical target collection contract and limits are owned by [Game Session's public-production target collection read](../game-session-service/api-contracts.md#public-production-bootstrap-target-collection-read).

Independent tenant entitlement evaluations run outside ambient SQL with at most eight concurrent workers per discovery request. A shared fair eight-permit bound also limits active evaluations across all discovery requests and owner instances in the Account process. Waiting for a permit occurs outside SQL and lasts at most five seconds; contention expiry fails the whole discovery request as `ENTITLEMENT_UNAVAILABLE`. Success, source failure and interruption return acquired permits. This bounds this owner’s aggregate connection demand without resizing the Account pool or guaranteeing production capacity. Each tenant is evaluated once and retains its owner’s independent transaction/isolation checks; caller and SQL context are not propagated to workers. The owner waits for the complete set, validates every returned tenant identity and returns no partial result on failure or interruption. Original observation deadlines remain unchanged and are checked after the second complete target read and final caller check. This bound reduces serialized latency; it is not a production capacity guarantee or permission to extend expired evidence, and slow or large collections can still refuse when their original observations expire.

An unreachable Game Session authority maps to `AUTH_UNAVAILABLE`; a reachable malformed, ambiguous, or changed collection maps to `ADMISSION_POINTER_UNAVAILABLE`; and an unavailable or expired entitlement maps to `ENTITLEMENT_UNAVAILABLE`. Bootstrap-caller verification retains its authentication failure. None of these failures produces an empty or partial success.

`gameplayAvailable` controls discovery visibility; `allowPublicJoin` does not. This pre-scope result contains only world slug and display name and creates no membership, JOIN, connect scope, or gameplay-admission authority. Public bootstrap discovery does not resolve private playtest realms or substitute for later target selection, current entitlement, membership, grant, or admission checks.

The manually composed `AccountCanonicalPublicRealmScopeOwner` uses the same public source collection for UUID-bearing V2 selector scopes. It rechecks Account identity, fresh tenant provenance, current membership and billing-head observations in short Account transactions, retains the exact signed scope preimage and verifies its immutable readback. Protected Game Session, registry and provider reads stay outside those transactions. Scope expiry follows the configured scope lifetime capped by the original verified bootstrap expiry; a later check cannot restamp an expired observation. Public visibility remains membership-independent, while current membership and `allowPublicJoin` are facts for subsequent fresh selection and JOIN checks. The scope grants neither membership repair nor gameplay admission. This source remains unregistered and separate from the existing numeric facade and private-realm path; its proof and receiving gaps are recorded in [Player Access](../../../project-management/implementation-tracking/player-access-and-session.md#public-bootstrap-worlds-source-preparation).

### Account-Owned Safety Restriction Contract

Account is the sole enforcement owner for the two global safety categories defined by [Moderation Policies](../logging-admin-service/moderation-policies.md): `account_security_lock` and `platform_access_ban`. They are separate durable lifecycles, not aliases or one combined account-ban state. Both apply to the global account subject across tenants; neither accepts a tenant, realm, or channel scope.
Expand All @@ -113,6 +125,8 @@ Fresh-enrollment certification is internal Account owner work, not a public regi

## Implementation Status

The public bootstrap WORLDS source is prepared as an unregistered Account owner and is not yet wired into the existing `ListBootstrapWorlds` facade. Its current schema-backed source is the canonical Account DEMO entitlement; paid-hosting discovery remains unavailable until the subscription schema and retained facade consumers migrate together. Current source and proof status are recorded in [Player Access and Session](../../../project-management/implementation-tracking/player-access-and-session.md#public-bootstrap-worlds-source-preparation).

The opaque `bootstrap-connect-scope` artifact uses canonical non-nil Account UUID subject/claim equality. Both browser discovery and the existing direct-text Account producer obtain that identity from Account persistence; the dedicated reader resolves it back to Account-local storage before existing binding checks. Numeric scopes have no compatibility parser: clients obtain fresh scope evidence through bounded rediscovery, while retained rows/receipts are not rewritten and existing retained-replay guards remain. Caller authentication, public-join policy and the held connect-token issuer are unchanged. Detailed receiving proof belongs to [Player Access and Session](../../../project-management/implementation-tracking/player-access-and-session.md#bootstrap-connect-scope-uuid-artifact).

The prepared selected gameplay-rule intake authorization, source-reservation/recovery, read and terminal-settlement owners are standalone and unregistered. Their typed transports add no available API or caller authority. Before enabling any standalone intake receiver (authorization, source read, HELD read, or settlement), its inbound message limit must accommodate the applicable 24 MiB codec bound: authorization and HELD read use `GameLogicIntakeAuthorizationGrpcCodec.MAX_WIRE_BYTES`; source read uses `GameLogicIntakeSourceReadProtoCodec.MAX_WIRE_BYTES`; settlement uses `AccountGameLogicIntakeSettlementEvidence.MAX_WIRE_BYTES`. The authorization receiver also carries the unchanged protected creator credential in binary metadata, so its inbound metadata limit must accommodate `AccountGameLogicIntakeAuthorizationCredentials.MAX_METADATA_BYTES`, which includes base64 wire encoding of the existing 16 KiB credential maximum plus metadata overhead. Binding a service configures neither limit. These are required receiver configurations, not claims about current deployment. The [Account prerequisite tracker](../../../project-management/implementation-tracking/player-access-and-session.md#selected-gameplay-rule-intake-authorization-prerequisite) records qualification and receiving pipeline gaps.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@ The current append-only inbox has no processing terminal, guarded payload minimi

The billing-customer and saved-method owners have the same prerequisite. Their append-only observation histories retain provider bindings and versioned card-display metadata; customer and instrument rows also retain Account references that currently block deletion. Before registering these sources, their exact categories require approved finite retention schedules, guarded minimization or erasure, and explicit account-deletion and backup treatment in the same canonical retention registry. Card-display history is not automatically necessary settlement evidence. Minimize or erase it when its authorized purpose ends, retaining only the minimum billing evidence authorized by ADR 0043 and any applicable legal hold. The owner must preserve unresolved provider and subscription obligations while completing the Account erasure workflow; neither indefinite Account retention nor bypassing a foreign-key or immutability guard is an acceptable deletion policy. The current owners remain unregistered until these paths and their physical proof exist.

### Paid discovery observation activation prerequisites

Account billing runtime composition owns bounded Stripe observation and its binding to the retained subscription policy. Account public-discovery composition owns the aggregate discovery workload and its qualification. Before registering paid discovery or claiming production paid discovery support, these owners must satisfy the following gates together with the [runtime entitlement contract](./subscription-management.md#runtime-entitlement-contract) and [public discovery contract](./api-contracts.md#public-bootstrap-worlds-discovery):

- **End-to-end provider deadline and resource release.** Apply an explicit finite deadline to the complete provider attempt, including connection establishment and response-body consumption, with SDK retries disabled on discovery reads. Connect/read socket timeouts alone are insufficient: repeated successful reads can keep a response in progress beyond the observation window. Prove deadline expiry stops the underlying provider work and releases its resources before the shared execution capacity is reused. Timing out a waiting future, interrupting a worker, or returning an unavailable response is not proof that its network work ended. Late results cannot become evidence or renew freshness.
- **Exact retained-policy budget.** Carry the policy budget belonging to the exact committed receipt and original operation into the provider-read preparation; do not substitute current configuration for a retained policy. The total attempt budget must fit strictly within that policy's `maximumObservationAge`, measured from the original read start, and leave time for the existing final current-row, receipt and freshness checks. Refuse an absent, elapsed or incompatible budget before provider dispatch. Reacquire and revalidate the same receipt/source fence afterward; a shorter network budget never extends the receipt's committed fact bound or the observation deadline.
- **Aggregate provider-load qualification.** Qualify the planned paid-tenant collection sizes and concurrent discovery request rate across all Account instances against the provider account's applicable limits. Include rate limiting, slow and trickling responses, exhausted execution capacity, repeated concurrent requests and recovery. Demonstrate that failed required reads still refuse the complete collection without partial results, retry amplification, leaked provider work or capacity released while work continues. The existing process-local concurrency bound does not establish a fleet-wide request-rate bound. Production rate/size limits must come from this qualification rather than inferred SDK defaults.
- **Operational evidence.** Publish bounded-cardinality measurements of provider attempts per discovery call, provider-read latency, timeout and HTTP 429 outcomes, and discovery capacity refusal and complete-call failure. Use fixed operation/outcome labels, not Account, tenant, subscription or request identifiers, provider payloads, payment metadata or exception text. Qualification must demonstrate these signals for controlled success, timeout and rate-limit cases and show how operators detect exhaustion before activation.

These gates do not authorize caching or a longer freshness window. Any separately selected observation reuse must preserve the exact committed receipt, current authority fence and original observation deadline; a cache cannot replace the deadline, load or failure-semantics proof. The [implementation tracker](../../../project-management/implementation-tracking/player-access-and-session.md#public-bootstrap-worlds-source-preparation) records the current preparation boundary and missing qualification.

## Implementation Status

The hosting-subscription, provider-reconciliation, and account-deletion billing-owner precondition contracts below are canonical target-state behavior. Account now has an unregistered verified Stripe event inbox, durable billing-customer intent and first-dispatch claim, and saved-method confirmation bound to the exact customer. The inbox is event intake only; the customer and instrument owners have controlled Stripe SDK/readback source and PostgreSQL proof, not a live provider or registered route. Current payment code records payment transactions, donations, refunds, platform fees, and creator shares, but still needs subscription webhook lifecycle processing, durable idempotent hosting-billing fulfillment/reconciliation, caller-stable subscription create retry evidence, active-subscription deletion guards, and end-to-end entitlement enforcement. The generic `CreatePaymentIntent`, `CreateDonation`, and `RefundPayment` RPCs now fail closed with `FAILED_PRECONDITION` before `PaymentService` or provider invocation; the underlying provider-mutating service methods remain unsupported substrate. Only separately typed hosting-billing operations may mutate Stripe. `purchase_entitlement` and paid-but-unfulfilled compensation are reserved for a separately accepted future marketplace path under [ADR 0179](../../decisions/adr-0179-firemud-managed-creator-commerce-boundary.md), and remain unsupported until its launch gates are implemented and proved.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,10 @@ These behaviors tie directly into the revocation rules in [Session Behavior](../

The canonical per-tenant membership, entitlement response, freshness, and billing-sequence contract is [Account Runtime and Data](./runtime-and-data.md#membership-and-entitlement-authority). This document retains the subscription-local consequences:

A committed subscription receipt retains the provider/policy fact boundary separately from the maximum age of one provider observation. For an active or trialing receipt, that bound is the earlier of the paid period end and effective scheduled cancellation; payment-recovery phases additionally stop at their next configured grace or suspension boundary. A later read obtains fresh provider evidence and bounds its response by that read's own observation deadline and the unchanged committed fact bound. Reading does not renew a receipt, advance tenant authority, or append billing events. Stale observations, changed provider facts, elapsed fact bounds, or a changed current row require refusal or explicit lifecycle reconciliation. Existing immutable receipts keep their originally committed bounds.

The existing `CANCELED` status is a terminal negative marker: after the original receipt's observation deadline, a current read may independently confirm the exact same provider facts and return `gameplayAvailable=false` with its new read deadline. It must still prove the unchanged committed receipt, current row and authority source; stale or changed provider evidence refuses. This negative projection never extends a positive entitlement, rewrites the receipt or treats unknown provider state as cancellation. Discovery omits that confirmed unavailable tenant rather than failing the complete collection solely because its old observation aged.

- Account exposes separate runtime, tenant-admin, and support-safe entitlement surfaces; subscription status and plan metadata are projected into the canonical runtime response rather than maintained by consumers.
- Game Session and World Management use `GetTenantEntitlementsForRuntime(tenantId, requestId)` before instance start, new bindings, scaling, or other capacity-affecting lifecycle work. This read assesses eligibility only and never commits capacity. Capacity-changing work must use `CommitTenantCapacityAdmission` when implemented and fail closed until that Account-owned commitment route exists. `grace` may preserve already-authorized gameplay while blocking new commitments.
- Runtime consumers invalidate or refresh cached entitlement state when Account emits `SubscriptionStatusChanged` or `TenantBillingStateChanged`; Account remains the sole producer of those events.
Expand Down
Loading
Loading