Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -977,6 +977,16 @@ jobs:
--require-case 'integration.net.firedevops.firemud.accountservice.repository.AccountAuthorityOutboxRepositoryIntegrationTest#exhaustedSequenceRejectsAppendWithoutChangingEventCheckpointOrCallerSentinel()' \
account-service

- name: 🔎 Verify Account committed connect source readback proof
if: ${{ matrix.module == 'account-service' }}
run: |
bash dev-tools/validation/inspect-test-results.sh \
--strict \
--require-suite integration.net.firedevops.firemud.accountservice.AccountCommittedConnectSourceReaderIntegrationTest \
--require-case 'integration.net.firedevops.firemud.accountservice.AccountCommittedConnectSourceReaderIntegrationTest#readsExactCommittedOriginalSourceAndLostResultWithoutMutation()' \
--require-case 'integration.net.firedevops.firemud.accountservice.AccountCommittedConnectSourceReaderIntegrationTest#doesNotReturnWhenAccountFenceWaitOutlivesTheUnchangedGatewayDeadline()' \
account-service

- name: 🔎 Verify Game Session PostgreSQL proof case
if: ${{ matrix.module == 'game-session-service' }}
run: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ The live runtime membership response carries `accountId`, `tenantId`, `membershi

The latest local Unit 1B source checkpoint also rejects both cached idempotent replay and freshly constructed success when the complete selected-target authority evidence is unavailable. This is a fail-closed guard, not a complete Account-signed `gameplay-connect` producer, durable issuance proof, or activation of the target `IssueConnectToken` RPC; end-to-end source evidence and consumer proof remain open.

The next unwired Account component reads an original successful V35 connect-issuance operation and its exact purpose-bound encrypted response envelope under the Account row fence. Its local successful-envelope payload is the strict UTF-8 compact Account JWT, not a reconstructed token or a second credential. It verifies the independently signed Gateway context, the exact Game Session workload identity, Account UUID provenance and approved retained tenant mapping, the stored token hash and identity, the original Account signature/profile, and complete original source/context correspondence. It rechecks the unchanged source and context deadlines after any fence wait. Its immutable result is original-source evidence only: stored authority/postcondition digest binding is not proof of current authority, registry readiness, or admission. This component is not registered as a runtime credential producer or RPC handler; fresh tenant handoff, complete Account-authenticated evidence, current-authority and registry consumption, protected key delivery, and end-to-end exchange remain separate activation gates. Focused proof status is recorded in the [player access and session tracker](../../../project-management/implementation-tracking/player-access-and-session.md).

The current `application.yml` and `application-prod.yml` no longer classify `GetTenantMembershipForRuntime` or `GetTenantEntitlementsForRuntime` as gRPC public methods. The membership request now carries typed `PlayerExecutionContext`, and Game Session sends that typed context; Account's handler still denies before producer/data access with `FAILED_PRECONDITION`. The held-back candidate producer/consumer path remains incomplete, so this typed request is not a working admission path or proof of the target membership/entitlement snapshot. The entitlement and realm-grant reads retain their local request shapes and must likewise remain denied until their exact caller/target contracts are carried and verified.

An unwired Account membership-snapshot reader now forms an exact one-tenant version map, a complete ordered four-stream checkpoint set, and separate positive membership source-event evidence only from a fenced local transaction. Its issuer, account, and tenant streams can presently prove sequence zero only while their durable generation and source-version baselines remain at one and no committed outbox head exists; advanced upstream history fails closed until its source-event proof is implemented. A never-joined pair's positive version/generation baseline and absence history are read under the same fence; a changed account-local issuance fence is preserved. This reader is not the gRPC response, does not authenticate the runtime caller, and does not enable the denied method or Game Session admission.
Expand Down
5 changes: 5 additions & 0 deletions design/project-management/ai-observations.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,8 @@ Entry format:
- Context: Account counter-exhaustion tests belong to #2876, whose test-result inspector is diagnostic-only; the strict required-suite/case interface exists only in its later descendant.
- Observation: inspection before publication caught an unsupported strict CI step in the older ancestor. The uncommitted step was removed and the required execution gate placed in #2911, preserving source-test ownership without copying future tooling into the ancestor. Local PostgreSQL skips remain explicitly unproved.
- Expected pattern: verify a workflow command against that exact branch's tooling version, not the latest tail; gate composed runtime proof where the required tool exists, then keep owning-PR and composed-descendant proof distinct.

- `2026-10-01`: Observe the earliest actual transaction in PostgreSQL contention proof
- Context: the complete Account snapshot/first-JOIN test held the Account row `FOR UPDATE` and waited for JOIN's explicit Account-lock spy. JOIN first inserts its PENDING intent, whose foreign-key check can already wait on that same row.
- Observation: exact CI timed out at the later spy, not at a source invariant. Instrumenting the actual intent-insert backend before the real insert retained the exact `pg_blocking_pids` correlation and complete before/after DTO assertions; corrected CI `36778631119` executed the race once successfully. Worker exceptions are surfaced rather than hidden behind a latch timeout.
- Expected pattern: trace earlier foreign-key and deferred-trigger work before selecting a concurrency signal; prove the exact blocked backend/owner relation and do not fix a misplaced signal by extending timeouts or changing production transaction order.
2 changes: 1 addition & 1 deletion design/project-management/design-alignment/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ The preserved 5B implementation work was rebuilt into #2826 Schema, the dependen
| Section | Original scope | Status | Main PR | Evidence / routed work |
| --- | --- | --- | --- | --- |
| 1A | Identity, entitlement, and hosted terms | Provisional; earlier broad discovery closed by judgment, required implementation and proof open | [#2840](https://github.com/benhook1013/FireMUD/pull/2840) | The refreshed 29-source unit had no taper finding; #2846–#2848 are stacked correction drafts, not merge or activation proof. #2848 contains Account gRPC/provider fail-closed boundaries, atomic recovery-token claims, disabled deletion/legacy export, and bounded evidence-only JOIN reconciliation. The [Player Access tracker](../implementation-tracking/player-access-and-session.md#unit-1a-section-exit-dispositions) names each current correction, pre-v1 Account successor, Unit 1B consumer, and activation gate. PostgreSQL concurrency/lost-acknowledgement, composed cross-service/certificate CI, direct text-to-Logging delivery, retained-data disposition, and billing/hosted-terms authority remain open; locally skipped tests do not close them. |
| 1B | Admission, session continuity, and reconnect | Provisional; required producer/consumer implementation and proof open | [#2857](https://github.com/benhook1013/FireMUD/pull/2857), [#2861](https://github.com/benhook1013/FireMUD/pull/2861), [#2873](https://github.com/benhook1013/FireMUD/pull/2873) → [#2876](https://github.com/benhook1013/FireMUD/pull/2876) → [#2880](https://github.com/benhook1013/FireMUD/pull/2880) → [#2881](https://github.com/benhook1013/FireMUD/pull/2881) → [#2911](https://github.com/benhook1013/FireMUD/pull/2911) | Earlier discovery and train pre-review did not complete the section. The tail contains JOIN recovery, retained tenant mapping, durable pair authority, authenticated snapshot preparation, purpose-separated envelopes and one-use exchange storage. Exact #2881 `b2a2f31b0` [CI 36703863842](https://github.com/benhook1013/FireMUD/actions/runs/36703863842) executed 29 JOIN, 9 connect-issuance and 9 bare-LOGIN storage PostgreSQL cases without skips or failures; Account and Game Session jobs passed, while aggregate CI remains red on recorded inherited failures. These are storage/snapshot proofs, not end-to-end credential issuance or live admission. #2911 converges the complete selected-target contract and shared signed-context component proof while denying obsolete incomplete/HMAC first-party issuance and admission; it does not enable the producer/consumer path. Required Account connect/delegation producers, full authority/consumer proof, fresh Game Design tenant handoff, protected ring delivery, durable reconnect, HTTPS/mail/abuse and live browser proof remain open in the [Player Access tracker](../implementation-tracking/player-access-and-session.md). Membership RPC and credential activation stay denied; the ring mount stays unpublished. |
| 1B | Admission, session continuity, and reconnect | Provisional; required producer/consumer implementation and proof open | [#2857](https://github.com/benhook1013/FireMUD/pull/2857), [#2861](https://github.com/benhook1013/FireMUD/pull/2861), [#2873](https://github.com/benhook1013/FireMUD/pull/2873) → [#2876](https://github.com/benhook1013/FireMUD/pull/2876) → [#2880](https://github.com/benhook1013/FireMUD/pull/2880) → [#2881](https://github.com/benhook1013/FireMUD/pull/2881) → [#2911](https://github.com/benhook1013/FireMUD/pull/2911) → [#2914](https://github.com/benhook1013/FireMUD/pull/2914) | Earlier discovery and train pre-review did not complete the section. Exact #2911 `78c3fe886` [CI 36778631119](https://github.com/benhook1013/FireMUD/actions/runs/36778631119) executed 30 JOIN, 9 connect-issuance and 9 bare-LOGIN storage PostgreSQL cases without skips or failures, including the complete snapshot/first-JOIN race; both authority-exhaustion methods and Game Session strict cases also passed. Aggregate CI remains red on routed inherited failures. #2914 adds unwired original committed-connect source readback and strict signed-source/context correspondence; its seven new PostgreSQL cases are pending executed proof. These are component prerequisites, not credential issuance or live admission. Required complete Account authority/consumer evidence, connect/delegation producers and registry, fresh Game Design tenant handoff, protected ring delivery, durable reconnect, HTTPS/mail/abuse and live browser proof remain open in the [Player Access tracker](../implementation-tracking/player-access-and-session.md). Membership RPC and credential activation stay denied; the ring mount stays unpublished. |
| 1C | Commands, output, and frontend presentation | Queued | — | — |
| 1D | Social, communication, and moderation-facing UX | Queued | — | — |
| 2A | Tick scheduling and region authority | Queued | — | — |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ This is a non-normative implementation tracker for player access and session. Ca

## Current Status

The resumed Account runtime-authority candidate adds an Account-fenced pair-preparation boundary for runtime snapshots: a verified never-joined pair reuses durable absence enrollment and exact readback, while retained active membership requires its existing receipt/event proof and preserved counters. Unmapped tenants, inactive membership, and absent rows with retained history remain denied; neither enrollment nor exact retry creates membership or an authority event. The pure snapshot reader still rejects an absent baseline. Local `:account-service:check -PfullCheck --no-configuration-cache` passed with 389 unit cases executed and all 83 integration cases compiled/discovered but skipped without Docker, including the new concurrent preparation/first-JOIN proof and the preserved connect-issuance recovery cases. #2880 owns composing this preparation with its complete typed same-snapshot response. This is not authenticated RPC, database execution, or admission proof; the runtime membership RPC, credential paths, and Account ring mount remain disabled.
The next Account-owned committed-connect source reader is an unwired prerequisite, not an authorization or credential producer. It recovers a complete successful V35 receipt and purpose-bound envelope by exact identity, checks the original compact JWT hash/JTI and asymmetric signature against the closed selected-target profile, verifies the Gateway assertion independently, and proves source/context correspondence under the Account row fence and approved retained tenant mapping. It requires the exact Game Session peer and an active owner transaction before data access, returns no raw credential, and rechecks unchanged deadlines after a fence wait. The consolidated local Account check passed with 413 unit cases executed, including 11 original-source verifier and four early-denial cases; all 105 PostgreSQL cases compiled but skipped without Docker, including the seven new source-readback cases. The CI strict inspector requires that new suite and both exact reread and fence-expiry methods to execute without skips. This component does not supply fresh tenant authority, authenticated current-eligibility evidence, an issued-token registry, protected key delivery, or a working bare-LOGIN exchange; those gates remain open and no runtime path or mount is enabled.

Exact #2911 `78c3fe88614708a4cd224800ac0f1bd6d03b310e` [CI 36778631119](https://github.com/benhook1013/FireMUD/actions/runs/36778631119) passed both strict Account PostgreSQL gates: JOIN 30/30, connect issuance 9/9, bare-LOGIN storage 9/9, authority-generation 2/2 and authority-outbox 4/4, all zero skips/failures. The complete nonadmitting snapshot versus concurrent first-JOIN case and both exhaustion rollback methods each executed once. Game Session strict Script Pin 25/25 and WebSocket 16/16 also passed. Account and Game Session checks disabled build/configuration cache and executed their tasks; aggregate CI remains red on separately routed shared tooling, Game Design fixture and Automation formatting failures. This closes those source/component database-proof gaps, not the live authenticated snapshot, complete immutable Account evidence bundle, credential producer/registry, or end-to-end bare-LOGIN gates below. The runtime RPC and credential paths remain denied, and the ring mount remains unpublished.

Account-fenced runtime snapshot preparation reuses durable absence enrollment and exact readback for a verified never-joined pair, while retained active membership requires its existing receipt/event proof and preserved counters. Unmapped tenants, inactive membership, and absent rows with retained history remain denied; neither enrollment nor exact retry creates membership or an authority event. The pure snapshot reader still rejects an absent baseline. #2880 composes preparation with the complete typed same-snapshot response, and the executed PostgreSQL proof above covers that nonadmitting DTO against concurrent first JOIN. It does not prove an authenticated runtime RPC or admission; those paths and the Account ring mount remain disabled.

The unmerged #2876 `account-auth-authority-event/v1` correction uses ADR 0030's exact one-tenant `membershipVersion` map in the producer, strict shared codec, canonical digest vectors, immutable evidence, and Account exact retry/readback comparisons. The Account producer may extract a local numeric value only after validating the map; it does not persist or transmit a scalar event field. Shared codec and Account/Game Session vector tests execute locally; PostgreSQL JOIN/reconciliation tests compile but skip without Docker, and the runtime membership RPC remains denied until its complete same-snapshot producer and consumer proof is ready. The unactivated Account ring materializer binds a dedicated service-account username in the protected source record, checks server-reported identity before Secret access, and returns a typed non-secret receipt with source generation/predecessor and exact Secret UID/resourceVersion readback. A focused read-side verifier now checks its closed typed shape, canonical digest, and exact source, writer, and Secret bindings; this remains local structural proof, not authenticated environment/secrets-channel publication. Sole-writer RBAC, protected custody, handoff, deployment readback, and live readiness remain unproved, so no Account ring mount is published.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package net.firedevops.firemud.accountservice.repository;

import java.security.MessageDigest;
import java.util.Objects;
import net.firedevops.firemud.accountservice.dto.AccountJoinDigest;
import net.firedevops.firemud.accountservice.repository.AccountConnectTokenIssuanceOperation.Lifecycle;
import net.firedevops.firemud.accountservice.security.AccountEnvelopeBinding;

/** Exact committed Account source receipt and its purpose-bound encrypted response envelope. */
public record AccountCommittedConnectSource(
AccountConnectTokenIssuanceOperation operation,
AccountConnectTokenResponseEnvelope responseEnvelope) {

public AccountCommittedConnectSource {
Objects.requireNonNull(operation, "operation");
Objects.requireNonNull(responseEnvelope, "responseEnvelope");
AccountEnvelopeBinding binding = responseEnvelope.binding();
if (operation.lifecycle() != Lifecycle.COMMITTED
|| !"SUCCESS".equals(operation.outcomeCode())
|| operation.tokenIdentity() == null
|| operation.tokenIdentity().isBlank()
|| operation.tokenHash() == null
|| operation.contextEvidenceDigest() == null
|| operation.authorityTupleDigest() == null
|| operation.issuanceFenceDigest() == null
|| operation.postconditionDigest() == null
|| !operation.operationId().equals(responseEnvelope.operationId())
|| binding.operationKind() != AccountEnvelopeBinding.OperationKind.CONNECT_TOKEN_ISSUANCE
|| !operation.operationId().toString().equals(binding.operationId())
|| !operation.requestId().equals(binding.requestId())
|| !Long.toString(operation.accountId()).equals(binding.accountId())
|| !Long.toString(operation.tenantId()).equals(binding.tenantId())
|| !operation
.connectScopeHash()
.equals(AccountJoinDigest.tokenHash(binding.connectScopeId()))
|| !sameDigest(operation.requestDigest(), binding.requestDigest())
|| !sameDigest(operation.contextEvidenceDigest(), binding.contextEvidenceDigest())
|| !sameDigest(operation.authorityTupleDigest(), binding.authorityTupleDigest())
|| !sameDigest(operation.issuanceFenceDigest(), binding.issuanceFenceDigest())
|| !sameDigest(operation.postconditionDigest(), binding.postconditionDigest())) {
throw new IllegalArgumentException(
"Committed Account connect source evidence is incomplete or mismatched");
}
}

@Override
public String toString() {
return "AccountCommittedConnectSource[operationId="
+ operation.operationId()
+ ", lifecycle="
+ operation.lifecycle()
+ ", encryptedResponse=<redacted>]";
}

private static boolean sameDigest(byte[] left, byte[] right) {
return left != null && right != null && MessageDigest.isEqual(left, right);
}
}
Loading
Loading