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
79 changes: 79 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -959,6 +959,85 @@ jobs:
fi
echo "::endgroup::"

- name: 🔎 Verify Account Original Acknowledgement Receipt Proof
if: ${{ always() && !cancelled() && matrix.module == 'account-service' }}
run: |
bash dev-tools/validation/inspect-test-results.sh account-service
python3 - <<'PY'
from pathlib import Path
import sys
import xml.etree.ElementTree as ET

result_root = Path("services/account-service/build/test-results")
required_class = (
"net.firedevops.firemud.accountservice.repository."
"AccountGameplayAdmissionLeasePersistenceIntegrationTest"
)
required_methods = {
"originalAckReceiptMigrationPreservesV91HistoryWithoutInventingAcknowledgement",
"originalAckReceiptRecoversExactOriginalProofAfterLostReceiptAcknowledgement",
"originalAckReceiptCommitsThenIndependentlyReadsExactOriginalBound",
"originalAckReceiptRejectsAnotherDataSourceAndChangedBindings",
"lostOriginalAcknowledgementCannotCreateOriginalAckReceipt",
"originalAckReceiptCreatedInCurrentTransactionIsNotDurableReadback",
"lostOriginalAckReceiptAcknowledgementDeniesWithoutRemintingOriginalProof",
}

xml_files = sorted(result_root.glob("**/TEST-*.xml"))
if not xml_files:
raise SystemExit(
f"No JUnit XML files found under {result_root}; "
"Account receipt proof is missing."
)

observed = {name: [] for name in required_methods}
for xml_file in xml_files:
try:
root = ET.parse(xml_file).getroot()
except ET.ParseError as exc:
raise SystemExit(f"Could not parse {xml_file}: {exc}") from exc
for case in root.iter("testcase"):
if case.attrib.get("classname") != required_class:
continue
name = case.attrib.get("name", "").removesuffix("()")
if name in required_methods:
observed[name].append((xml_file, case))

missing = sorted(name for name, cases in observed.items() if not cases)
duplicates = sorted(name for name, cases in observed.items() if len(cases) > 1)
failed = sorted(
name
for name, cases in observed.items()
if any(
any(child.tag in {"failure", "error", "skipped"} for child in case)
for _, case in cases
)
)
if missing or duplicates or failed:
if missing:
print("Missing required Account integration tests:", file=sys.stderr)
for name in missing:
print(f" - {name}", file=sys.stderr)
if duplicates:
print("Ambiguous duplicate Account integration tests:", file=sys.stderr)
for name in duplicates:
print(
f" - {name} ({len(observed[name])} occurrences)",
file=sys.stderr,
)
if failed:
print("Required Account integration tests did not pass:", file=sys.stderr)
for name in failed:
files = ", ".join(str(path) for path, _ in observed[name])
print(f" - {name} ({files})", file=sys.stderr)
raise SystemExit(1)

print(
f"Verified {len(required_methods)} passing Account receipt integration tests "
f"in {required_class}."
)
PY

- name: 📦 Build Runtime JAR
if: ${{ contains(fromJSON(needs.changes.outputs.bootable_modules), matrix.module) }}
run: ./gradlew :${{ matrix.module }}:bootJar -PfullCheck
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,11 +281,23 @@ The canonical membership, entitlement response shape, freshness, and sequence co
- `GetTenantEntitlementsTenant` and `GetTenantEntitlementsCrossTenantSupportSafe` remain separate caller-bound and redacted support-safe API variants. They must not be multiplexed with the internal runtime surface.
- Internal callers must treat missing required owner fields as contract failure and fail closed; Account's REST/OpenAPI and gRPC/proto sources remain the executable API authorities.

## Authenticated Issuer-Source Read

`AccountIssuerAuthoritySourceService.ReadCurrentIssuerAuthoritySource` is a distinct internal owner read for Game Session's issuer projection and initial issuer-index reconciliation. Only the verified same-namespace Game Session workload may call it; a forwarded JWT, caller-supplied workload name, projection cache or per-Account assembly is not issuer-source authority. The request binds schema version, target namespace, a non-nil `reconciliationOperationId` and the exact issuer ID. Account opens its own writable SERIALIZABLE transaction, reads and locks the actual issuer generation/source row and complete source checkpoint, and verifies the exact retained closed issuer event in the same snapshot before returning. No ambient transaction is accepted and the read does not initialize or advance any source, outbox or projection.

The closed response binds the original reconciliation operation, target namespace and verified caller workload to the exact issuer ID, positive issuer generation and source version, canonical issuer stream and committed source sequence. Sequence zero is the proved original issuer enrollment (generation and source version both one), with no event ID, digest or event payload. A positive sequence carries the unchanged issuer variant of the canonical `account-auth-authority-source-event/v1` event, including its verified identity/digest and exact scope, generation, source version and checkpoint; mismatches or unavailable history deny the read. Recipient tuples, Account `issuanceFence`, membership evidence and recipient checkpoint sets are absent: they remain separate Account-authenticated recipient evidence under [ADR 0030](../../decisions/adr-0030-risk-based-active-session-revocation.md).

An initial read may capture the current source. The consumer durably binds that authenticated result to its reconciliation operation before using it as source evidence. An exact retry/revalidation supplies the entire captured response, not just a generation or watermark; Account returns it only if a fresh owner snapshot matches every field and retained event byte. Changed source, operation, scope, caller or checkpoint conflicts rather than silently replacing the captured state. An unavailable or contradictory result is not an empty issuer stream. This read supplies no Game Session binding inventory, partition acknowledgement, freshness lease, admission, rebind or installation authority.

Implementation is source-only and unregistered while the protected producer, wire/client, same-snapshot database and negative proof are prepared. Current progress and executed proof belong in the [Player Access and Session tracker](../../../project-management/implementation-tracking/player-access-and-session.md), not in a claim that this target contract is already callable.

## Admission-Lease Confirmation Preparation

The admission owner remains unregistered and non-admitting. Its cancellation and exact negative-state readback methods accept only the original same-namespace Game Session workload and complete unchanged lease evidence; `ReadGameplayAdmissionLease` currently requires `expected_lease` and returns only `PENDING` or `ABORTED`, not `not_observed` or raw storage `COMMITTED`. The positive acquire/finalize/read/reconcile surface is not enabled. The canonical expiry and confirmation requirement is owned by [Session Behavior](../../system-architecture-session-behavior.md#admission-lease-durable-confirmation).

The separate Account-local temporal confirmation preparation stamps the actual finalization transaction and derives immutable proof from independent committed operation readback, ordered PostgreSQL WAL insertion/flush coverage on one primary, and a subsequent conservatively rounded database-time bound before the original expiry. Enforce a writable SERIALIZABLE transaction, establish its fixed snapshot and capture the database-owned WAL coverage fence before heap reads or tuple locks can emit observer WAL. A subsequently visible independently committed operation in that same snapshot committed before the snapshot and therefore before the captured fence. Exclude the observer's own top-level transaction, including its subtransactions; then lock Account first and revalidate the exact immutable operation before accepting covered WAL and the time bound. Independently durable receipt readback follows the same snapshot, capture and locked-revalidation ordering. It requires durable storage settings; unavailable or uncovered WAL, same-transaction finalization and late observation remain denied. Receipt creation must commit before a new transaction independently proves and reads the durable receipt; caller-supplied bounds and bare LSNs carried across a reconnect cannot substitute. Exact retained replay returns the original receipt without restamping its proof or expiry. Original operation, lease, digest, decision and deadline remain unchanged. This is not an authenticated positive admission result, a current restriction-source producer, Game Session installation proof or completed cleanup. Implementation and executed versus unavailable proof belong to the [Account admission tracker](../../../project-management/implementation-tracking/player-access-and-session.md#account-admission-lease-prerequisite).
For fresh finalization, the protected Account owner must control the actual original writable SERIALIZABLE transaction, bind its database-stamped finalization identity to the complete unchanged lease and Game Session decision, and enforce a qualified synchronous durability policy on the actual physical COMMIT. On the supported primary, `fsync=on` and `synchronous_commit=on` must hold through that COMMIT, not merely during an earlier statement or in a fixture default. Only a successfully observed physical COMMIT acknowledgement followed by a fresh authoritative, conservatively rounded database-clock bound strictly before the original expiry establishes this transaction-specific temporal proof. The causal chain must belong to the original fresh `PENDING -> COMMITTED` transition; a transaction callback return, caller-supplied success flag, visible terminal row or successful retry transaction cannot establish it. Lost or ambiguous original acknowledgement remains non-admitting unless separately adequate independent proof already exists. Late acknowledgement or clock observation cannot renew or replace the original deadline.

Persist the immutable exact-bound confirmation separately and prove its own durable COMMIT before independently reading it back. The clock bound following the original COMMIT certifies only that original finalization, never the later receipt transaction. Exact retained recovery returns the original receipt without restamping its proof, operation, lease, digest, decision or expiry. Unavailable, contradictory or ambiguous receipt persistence/readback denies confirmation; it does not remint a receipt from a retry acknowledgement. A conservative independent WAL-coverage observer may deny when unrelated global WAL is uncovered, but that failure is not evidence that the original synchronous COMMIT was non-durable. Do not remove its existing rejection boundary until a qualified transaction-specific producer and its positive, late, lost-acknowledgement and retry proofs replace it. Neither temporal proof nor receipt recovery supplies current Account source/restriction authority, Game Session installation or cleanup proof, or gameplay admission. Implementation and executed versus unavailable proof belong to the [Account admission tracker](../../../project-management/implementation-tracking/player-access-and-session.md#account-admission-lease-prerequisite).

## Subject-Binding Rules (Normative)

Expand Down
Loading
Loading