Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
83a2fc1
Reconstruct global registration and Account JOIN core with fail-close…
benhook1013 Oct 1, 2026
d248d1b
Reconcile reviewed Account parent corrections into registration core
benhook1013 Oct 1, 2026
90cad5c
Merge commit 'dc04c19aba8211e067d912ae27a894814b4044af' into codex/pr…
benhook1013 Oct 1, 2026
960d55b
Merge commit '5c4b21d6ccb9e96c92974d94ff0e36e2f1d0d9bf' into codex/pr…
benhook1013 Oct 1, 2026
2be1385
Merge reviewed bootstrap corrections into account join core
benhook1013 Oct 1, 2026
0bfdbf2
Retain public JOIN denial with canonical internal path guard
benhook1013 Oct 1, 2026
48143c1
merge: preserve demo entitlement and explicit membership bootstrap
benhook1013 Oct 1, 2026
ce80884
Merge commit '4c80083a8638030bda71856bb6d79dabfd0138b6' into codex/pr…
benhook1013 Oct 1, 2026
a54cebc
Merge commit 'ac3422161427bdeca19b9999aad24829c1b9c1ee' into codex/pr…
benhook1013 Oct 1, 2026
cbdaa5f
Merge commit '1f772d7e132c9cd05591b1fad1929c5b115a6f58' into codex/pr…
benhook1013 Oct 2, 2026
cd95e1b
Merge commit '8069ab226b2641c30b5fec9ad295401783818022' into codex/pr…
benhook1013 Oct 2, 2026
2a51fdf
Merge commit '38ee08d16ffef9fdb2201d4873426f431bf225e5' into codex/pr…
benhook1013 Oct 2, 2026
8fb4e9e
Fix Account unavailable responses and catalog snapshot consistency
benhook1013 Oct 2, 2026
4f43dc7
Merge remote-tracking branch 'origin/codex/unit-1a-identity-entitleme…
benhook1013 Oct 2, 2026
10f28bf
fix(account): fence JOIN retries and schedule immutable audit delivery
benhook1013 Oct 2, 2026
3a6d636
Merge commit '38c4f0c4331753f005ae19a204259c2c8e738d26' into codex/pr…
benhook1013 Oct 2, 2026
c2dbaa0
Merge commit '3ddab80af166ce378beff20c53ac368a7e2f2562' into codex/pr…
benhook1013 Oct 2, 2026
34d80a8
fix(account): bound JOIN request identities and typed error completion
benhook1013 Oct 2, 2026
89a320b
Merge commit 'e066e9e8fdfcb5f565159696b7726f5cc28a19ab' into codex/pr…
benhook1013 Oct 2, 2026
a486dab
Merge remote-tracking branch 'origin/develop' into codex/pr2847-accou…
benhook1013 Oct 2, 2026
65e8adb
fix: close Account JOIN review and CI proof gaps
benhook1013 Oct 2, 2026
6a3f5ee
fix: tighten Account discovery and Gateway denial proof
benhook1013 Oct 2, 2026
8c0aeb3
Merge remote-tracking branch 'origin/develop' into codex/pr2847-accou…
benhook1013 Oct 2, 2026
a386786
fix: retain catalog-bound pointer audit and review proof
benhook1013 Oct 2, 2026
4488d5d
Merge commit 'ea703d2e09b046103f4dd4aa495416e09a3fe14f' into codex/pr…
benhook1013 Oct 2, 2026
9fbf132
merge: reconcile Account JOIN child with validated bootstrap parent
benhook1013 Oct 2, 2026
51ad951
Merge published World CI and controller fixes into JOIN follow-up
benhook1013 Oct 2, 2026
7175711
Merge published World lifecycle hold SQL repair
benhook1013 Oct 2, 2026
c787f9d
Merge commit 'ec1937d109a4eaa29ba32f0e843b873273508025' into codex/28…
benhook1013 Oct 2, 2026
30ac77d
Merge commit 'c4e5ee640808e211eec12dd64909621664b2f7e8' into codex/28…
benhook1013 Oct 2, 2026
697ff9b
Merge commit '5037a4179efce29405b5ff937ac89a24c48271a7' into codex/28…
benhook1013 Oct 2, 2026
d672da4
Merge commit '84976dcbfad6a18c79737d767f69854eb8433113' into codex/28…
benhook1013 Oct 2, 2026
842ab9f
Preserve complete #2847 unique Account JOIN patch for develop reconci…
benhook1013 Oct 3, 2026
9abeca7
Merge commit 'd672da40c626e8409a95a118345d1f89dd191bc8' into codex/28…
benhook1013 Oct 3, 2026
1cf7fcf
fix(gameplay): localize admission-pointer unavailability
benhook1013 Oct 3, 2026
133c892
fix: reconcile JOIN proof status and audit receiver transport
benhook1013 Oct 3, 2026
308d495
Merge remote-tracking branch 'origin/develop' into codex/2847-develop…
benhook1013 Oct 3, 2026
91488ca
chore: preserve canonical merged review tooling during reconciliation
benhook1013 Oct 3, 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
23 changes: 13 additions & 10 deletions design/architecture/microservices/account-service/api-contracts.md

Large diffs are not rendered by default.

59 changes: 58 additions & 1 deletion design/architecture/microservices/account-service/operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,74 @@ This document collects the Account Service operational behavior, readiness model
- `liveness` is process-local only.
- `readiness` is truthful local readiness for the currently implemented authentication/account slice and must fail when the service cannot safely satisfy new authentication traffic with its required local persistence/session infrastructure.
- Logging, metrics, and tracing follow the standard [Logging & Monitoring](../../system-architecture-logging-monitoring.md) pipeline.
- Expired connect-scope cleanup requires PostgreSQL 16 or later because its deletion predicate uses `pg_input_is_valid`; local Docker Compose and Account integration-test containers use PostgreSQL 16. Keep the guarded delete predicate and do not add a pre-16 compatibility query.

### V26 membership migration preflight

Before applying [V26](../../../../services/account-service/src/main/resources/db/migration/V26__global_registration_join_evidence.sql) to a populated target, take an authoritative read-only inventory of `account_tenant_membership` and its account/tenant identities. The migration retains each original `gameplay_admission_allowed` value in `account_legacy_membership_sources.original_gameplay_admission_allowed` as provenance; it is not current player intent or admission authority. V26 quarantines legacy memberships as `LEGACY_UNVERIFIED` and disables admission. Do not restore access from the retained boolean; membership authority and explicit reconciliation remain owned by [Account Runtime and Data](./runtime-and-data.md#membership-and-entitlement-authority).

Quiesce Account mutations and block new admission throughout inventory, migration, and readback so the preflight cannot race with another writer. If that quiescence cannot be proved, do not apply V26. Run these read-only queries before V26 and retain their output with the deployment record:

```sql
SELECT COUNT(*) AS membership_rows,
COUNT(*) FILTER (WHERE gameplay_admission_allowed) AS legacy_admitting_rows
FROM account_tenant_membership;

SELECT m.id AS membership_id,
m.account_id,
m.tenant_id,
a.tenant_id AS account_legacy_tenant_id,
m.gameplay_admission_allowed AS original_gameplay_admission_allowed
FROM account_tenant_membership AS m
LEFT JOIN accounts AS a ON a.id = m.account_id
ORDER BY m.tenant_id, m.account_id, m.id;
```

Treat rows as run-owned demo data only when an independent deployment/run record proves that ownership; do not infer it from identifiers, account names, or the legacy boolean. If any real memberships exist, keep deployment and gameplay traffic closed pending explicit owner-validated reconciliation. [TestDataSeeder](../../../../services/account-service/src/main/java/net/firedevops/firemud/accountservice/data/TestDataSeeder.java) is for explicitly run-owned local smoke data and must not be enabled in production. The current stage has no live target inventory or production reconciliation proof; this preflight is not activation approval.

After V26 and before any explicitly enabled non-production demo seed, use read-only readback to verify each retained source has its quarantined membership row:

```sql
SELECT COUNT(membership.id) AS membership_rows,
(SELECT COUNT(*) FROM account_legacy_membership_sources) AS source_rows,
COUNT(*) FILTER (WHERE legacy_source.membership_id IS NULL) AS rows_without_source,
COUNT(*) FILTER (
WHERE membership.lifecycle_state <> 'LEGACY_UNVERIFIED'
OR membership.authority_provenance <> 'LEGACY_UNVERIFIED'
OR membership.gameplay_admission_allowed
) AS rows_not_quarantined
FROM account_tenant_membership AS membership
LEFT JOIN account_legacy_membership_sources AS legacy_source
ON legacy_source.membership_id = membership.id;

SELECT legacy_source.membership_id,
legacy_source.account_id,
legacy_source.tenant_id,
legacy_source.original_gameplay_admission_allowed,
legacy_source.matches_account_legacy_tenant,
legacy_source.disposition,
legacy_source.captured_at,
membership.lifecycle_state,
membership.authority_provenance,
membership.gameplay_admission_allowed
FROM account_legacy_membership_sources AS legacy_source
JOIN account_tenant_membership AS membership
ON membership.id = legacy_source.membership_id
ORDER BY legacy_source.tenant_id, legacy_source.account_id, legacy_source.membership_id;
```

## Saga Participation

The Account audit handoff is a mandatory owner-local durable-outbox target, not a compensated Saga step. Global registration creates only global account/security state and emits a platform-scoped audit with no `tenantId` from that transaction; tenant-scoped profile and membership operations are separate and use the exact committed `tenantId`. Explicit `JoinPublicProductionMembership` emits its separate tenant-scoped audit from the membership transaction. Global `account_security_lock`, `platform_access_ban`, recovery, and suspicious-activity audits likewise use platform scope and omit `tenantId`. Producer consequences are defined in [Account Runtime and Data](./runtime-and-data.md#architecture-and-runtime-notes), while the normative ingress, envelope, receipt, readback, retention, and authorization contract is owned by [Logging & Admin API Contracts](../logging-admin-service/api-contracts.md#account-audit-ingress-and-receipt). **Current runtime:** Account persists the account, profile, and membership locally, then attempts the `CreateLogEvent` RPC post-commit on a best-effort basis. Logging failure is swallowed and does not roll back or compensate the committed creation. The owner-local outbox and corresponding proto/receiver implementation must be implemented and proved before mandatory audit delivery is claimed. No Account workflow is currently authorized as a `common-saga` adopter in this document or tracker; existing `accountCreation` and `purchase` `SagaRunner` calls are unclassified implementation drift. Any future Account Saga must first satisfy the explicit owner, boundary, negative-case, and focused-proof classification in [Transaction Strategies](../../system-architecture-transactions.md#mandatory-workflow-adopter-classification).
The Account audit handoff is a mandatory owner-local durable-outbox target, not a compensated Saga step. Global registration creates only global account/security state and emits a platform-scoped audit with no `tenantId` from that transaction; tenant-scoped profile and membership operations are separate and use the exact committed `tenantId`. Explicit `JoinPublicProductionMembership` emits its separate tenant-scoped audit from the membership transaction. The target contract also requires global `account_security_lock`, `platform_access_ban`, recovery, and suspicious-activity audits to use platform scope and omit `tenantId`; those producers are not yet converged to the current outbox path. Producer consequences are defined in [Account Runtime and Data](./runtime-and-data.md#architecture-and-runtime-notes), while the normative ingress, envelope, receipt, readback, retention, and authorization contract is owned by [Logging & Admin API Contracts](../logging-admin-service/api-contracts.md#account-audit-ingress-and-receipt). **Current local implementation:** registration and successful explicit JOIN append immutable audit envelopes to Account's SQL outbox in the same local transaction as their owner-state writes. Account's delivery job sends the unchanged envelope and marks it complete only after matching terminal receipt evidence; unavailable, `UNIMPLEMENTED`, timeout, mismatched, or ambiguous responses leave the same event `PENDING` for retry. The Logging & Admin receipt receiver, durable receipt persistence/deduplication, exact payload-digest validation, and readback are separate #2848 work and are not implemented in this Account core. This local producer status does not claim PostgreSQL runtime proof or direct text-client end-to-end proof. Durable recovery/reconciliation of a JOIN operation left `PENDING` after an unknown database commit outcome remains open under the Overseer decision and ADR 0025, with recovery ownership assigned to #2848. These audit paths are not Account Saga steps. No Account workflow is currently authorized as a `common-saga` adopter in this document or tracker; existing `accountCreation` and `purchase` `SagaRunner` calls are unclassified implementation drift. Any future Account Saga must first satisfy the explicit owner, boundary, negative-case, and focused-proof classification in [Transaction Strategies](../../system-architecture-transactions.md#mandatory-workflow-adopter-classification).

The current `PurchaseWorkflowService` implementation for one-time payments and donations is non-exposed, unsupported provider-mutating drift, not a V1 product path or entitlement authority. It currently enters the shared runner to create a payment intent, record the transaction with the Logging & Admin Service, and refund through compensation if the log step fails. The target Account containment boundary requires every generic purchase or donation entry point to reject before entering that runner or making any Stripe call; no supported V1 flow may invoke it. Current V1 remains the hosting-billing boundary in [ADR 0143](../../decisions/adr-0143-stripe-v1-hosting-billing-and-deferred-creator-monetization.md), while the future marketplace direction in [ADR 0179](../../decisions/adr-0179-firemud-managed-creator-commerce-boundary.md) remains deferred and must be implemented and proved separately.

## Metrics and Tracing

Prometheus scrapes metrics from `/actuator/prometheus`. Service methods expose `account.*`, `payment.*`, `notification.*`, and `session.*` timers via `@Timed` annotations. OpenTelemetry spans are exported to the collector service so traces can be viewed in Jaeger. No additional configuration is required when running via `./gradlew bootRun` as the default properties target `http://otel-collector:4317`.

Expired connect-scope cleanup exposes `account.connect_scopes.cleanup.deleted` for deleted rows, `account.connect_scopes.cleanup.failure` for failed runs, the `account.connect_scopes.cleanup` timer, and `account.connect_scopes.cleanup.cap_saturation` for runs in which all five batches return the configured full batch size. The job can process at most five times the batch size per scheduled invocation. With fixed delay, the effective start-to-start period is the configured interval plus the prior run's execution time, so long runs reduce how often cleanup can run. Tune the batch size and interval against measured expired, unreferenced scope insertion load. Cap saturation signals cleanup pressure, not an exact backlog count.

## Integration Test Notes

The old disabled GHCR-based cross-service placeholder for Account Service was removed because it did not prove a meaningful current contract. The maintained local application smoke now lives under `src/test/java/integration` and should be treated as the canonical lightweight readiness check for this service. Higher-value cross-service behavior should be covered by targeted current-contract tests rather than by "other container exists" scaffolding.
Expand Down
Loading
Loading