Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
5bd6972
feat(access): prepare canonical JOIN intent and source-bound realm ca…
benhook1013 Oct 2, 2026
c4c0add
Merge validated Account preservation correction into canonical JOIN p…
benhook1013 Oct 2, 2026
3400ad3
test(access): validate composed canonical JOIN producer preparation
benhook1013 Oct 2, 2026
211cbe4
Persist source-bound initial CLOSED admission pointers
benhook1013 Oct 2, 2026
a0404ba
Distinguish catalog FK denial from immutable truncate guard
benhook1013 Oct 3, 2026
1a36c2b
Preserve canonical membership receipt history and correct CLOSED read…
benhook1013 Oct 3, 2026
51bfdaf
Prove locked canonical CLOSED origin and repair receipt fixture keys
benhook1013 Oct 3, 2026
e0e4d8f
Bind Account audit delivery and receipts to explicit canonical tenant…
benhook1013 Oct 3, 2026
996d99c
Prove Account audit workload identity and correct constraint exceptio…
benhook1013 Oct 3, 2026
8509492
Publish canonical first-JOIN events from exact Account owner evidence
benhook1013 Oct 3, 2026
f2fed83
Keep canonical first-JOIN fixture usernames within Account schema
benhook1013 Oct 3, 2026
ad8f2da
Respect owner source-key bounds in first-JOIN fixtures
benhook1013 Oct 3, 2026
838f4e3
test(account): stub canonical JOIN faults beneath transaction proxies
benhook1013 Oct 3, 2026
b3835c2
test(account): respect immutable JOIN policy and optional event readback
benhook1013 Oct 3, 2026
d557bd4
Merge current Unit 1B source into canonical JOIN preparation
benhook1013 Oct 4, 2026
e727963
Repair retained receipt and CLOSED audit migration composition
benhook1013 Oct 4, 2026
e5b0ab3
Align retained UUID proof with additive schema and exact migration hi…
benhook1013 Oct 4, 2026
b33c914
Keep UTC audit fixture valid under canonical identity schema
benhook1013 Oct 4, 2026
080efe7
Allow Validation for stacked pull requests
benhook1013 Oct 4, 2026
813fbb5
Carry forward reviewed CI safety corrections
benhook1013 Oct 5, 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
227 changes: 225 additions & 2 deletions .github/workflows/ci.yml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions .github/workflows/publish-pr-runtime-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ jobs:
fail("source workflow run API id does not match the event")
if source_run.get("workflow_id") != int(workflow_id_text):
fail("source workflow identity changed between event and API")
if source_run.get("name") != source_title:
fail("source workflow API name differs from its exact run title")
if source_run.get("name") not in {"Build Runtime Images", source_title}:
fail("source workflow API name is neither its owning name nor exact run title")
if source_run.get("path") != SOURCE_WORKFLOW_PATH:
fail("source workflow API path is not the trusted runtime-images workflow")
if source_run.get("event") != source_event:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ jobs:
uses: ./.github/actions/setup-trivy

- name: 🔍 Run Trivy and Save Report
shell: bash
run: |
echo "::group::Run Trivy"
trivy fs --config config/security/trivy.yaml . | tee trivy-report.txt
Expand Down Expand Up @@ -207,7 +208,7 @@ jobs:
contents: read
pull-requests: write # Publishes the consolidated security result on the PR.
needs: [changes, trivy-scan, secret-compliance, security-gate]
if: ${{ always() && github.event_name == 'pull_request' && (github.event.action != 'edited' || github.event.changes.base.ref != null) }}
if: ${{ !cancelled() && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' && (github.event.action != 'edited' || github.event.changes.base.ref != null) }}
steps:
- name: Harden runner
uses: step-security/harden-runner@ab7a9404c0f3da075243ca237b5fac12c98deaa5
Expand Down
51 changes: 48 additions & 3 deletions .github/workflows/smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ jobs:
".github/actions/load-workflow-tool-versions/",
".github/actions/setup-python/",
"dev-tools/smoke/",
"dev-tools/minio/",
];
const fullRelevantFiles = new Set([
"build.gradle.kts",
Expand Down Expand Up @@ -145,7 +146,7 @@ jobs:
contents: read
pull-requests: write
needs: [changes]
if: ${{ always() && github.event_name == 'pull_request' && (github.event.action != 'edited' || github.event.changes.base.ref != null) }}
if: ${{ !cancelled() && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' && (github.event.action != 'edited' || github.event.changes.base.ref != null) }}
steps:
- name: Harden runner
uses: step-security/harden-runner@ab7a9404c0f3da075243ca237b5fac12c98deaa5
Expand Down Expand Up @@ -198,6 +199,26 @@ jobs:
`- ${statusIcon(fullResult)} PR Full-Stack Smoke: \`${fullResult}\``,
].join("\n");

const expectedHeadSha = context.payload.pull_request.head.sha;
const expectedBaseRef = context.payload.pull_request.base.ref;
const expectedBaseSha = context.payload.pull_request.base.sha;
const { data: currentPullRequest } = await github.rest.pulls.get({
...context.repo,
pull_number: context.issue.number,
});
if (
currentPullRequest.state !== "open" ||
currentPullRequest.head.sha !== expectedHeadSha ||
currentPullRequest.base.ref !== expectedBaseRef ||
currentPullRequest.base.sha !== expectedBaseSha
) {
core.info(
`Skipping stale smoke summary for ${expectedBaseRef}@${expectedBaseSha}...${expectedHeadSha}; ` +
`current PR state/base/head is ${currentPullRequest.state}/${currentPullRequest.base.ref}@${currentPullRequest.base.sha}/${currentPullRequest.head.sha}`
);
return;
}

const comments = await github.paginate(
github.rest.issues.listComments,
{
Expand Down Expand Up @@ -277,7 +298,7 @@ jobs:
contents: read
pull-requests: write
needs: [changes, smoke-gate, smoke-summary-pending]
if: ${{ always() && github.event_name == 'pull_request' && (github.event.action != 'edited' || github.event.changes.base.ref != null) }}
if: ${{ !cancelled() && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' && (github.event.action != 'edited' || github.event.changes.base.ref != null) }}
steps:
- name: Harden runner
uses: step-security/harden-runner@ab7a9404c0f3da075243ca237b5fac12c98deaa5
Expand Down Expand Up @@ -334,6 +355,26 @@ jobs:
`- ${statusIcon(fullResult)} PR Full-Stack Smoke: \`${fullResult}\``,
].join("\n");

const expectedHeadSha = context.payload.pull_request.head.sha;
const expectedBaseRef = context.payload.pull_request.base.ref;
const expectedBaseSha = context.payload.pull_request.base.sha;
const { data: currentPullRequest } = await github.rest.pulls.get({
...context.repo,
pull_number: context.issue.number,
});
if (
currentPullRequest.state !== "open" ||
currentPullRequest.head.sha !== expectedHeadSha ||
currentPullRequest.base.ref !== expectedBaseRef ||
currentPullRequest.base.sha !== expectedBaseSha
) {
core.info(
`Skipping stale smoke summary for ${expectedBaseRef}@${expectedBaseSha}...${expectedHeadSha}; ` +
`current PR state/base/head is ${currentPullRequest.state}/${currentPullRequest.base.ref}@${currentPullRequest.base.sha}/${currentPullRequest.head.sha}`
);
return;
}

const comments = await github.paginate(
github.rest.issues.listComments,
{
Expand Down Expand Up @@ -476,7 +517,11 @@ jobs:
const eventMergeSha = context.sha;
const prNumber = String(context.payload.pull_request.number);
const started = Date.now();
const timeoutMs = 25 * 60 * 1000;
// Contract-checked against pr-local-smoke; bounded overhead covers metadata,
// runner scheduling and API convergence, not unbounded queue delays.
const producerTimeoutMinutes = 45;
const prerequisiteAndQueueAllowanceMinutes = 45;
const timeoutMs = (producerTimeoutMinutes + prerequisiteAndQueueAllowanceMinutes) * 60 * 1000;
const cancelledReplacementTimeoutMs = 5 * 60 * 1000;
const sleepMs = 15000;
const pullRequestCheckInterval = 4;
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/static-analysis-summary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ jobs:
if (
currentPullRequest.state !== "open" ||
!sourceWorkflowName ||
context.payload.workflow_run.name !== expectedSourceTitle ||
(context.payload.workflow_run.name !== sourceWorkflowName &&
context.payload.workflow_run.name !== expectedSourceTitle) ||
context.payload.workflow_run.display_title !== expectedSourceTitle
) {
core.info("The source run is not bound to the current open pull-request base and head.");
Expand Down
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 @@ -84,6 +84,20 @@ For version `2`, each preimage segment is strict UTF-8 prefixed by its canonical

Only after authoritative available entitlement evaluation, the policy-request preimage additionally includes `AVAILABLE`, the exact lowercase boolean `allowPublicJoin`, and positive canonical-decimal `entitlementVersion`, in that order. Unavailable authority has no invented policy result/version or policy digest; retain a policy-independent pending intent and failure diagnostics. A typed scope value or digest is not an authentication capability: Account still verifies caller and persisted source, re-resolves the exact current Game Session target, and revalidates entitlement at commit. Complete UUID scope persistence, positive JOIN/event/audit/reconciliation, producer/consumer and negative proof remain required before activation; their status belongs to [Player Access and Session](../../../project-management/implementation-tracking/player-access-and-session.md), not to the presence of these encoding rules.

Canonical scope retention widens the existing Account scope family rather than creating a second identity or retry authority. Store only the connect-scope token hash, the exact versioned target evidence and digest, and the full approved-retained or fresh Game Design-backed tenant association. The private Account primary key is resolved from the persisted Account UUID; fresh canonical tenant and instance evidence has no numeric alias. Retained v1 rows, preimages and owner history are not rewritten or interpreted as v2. Writes require the Account owner transaction and exact source readback; neither repository insertion nor construction of a typed scope establishes signed-token authenticity, caller authorization, current routing or entitlement.

An incoming retry supplies the original connect-scope token, allowing its hash and complete v2 preimage to be checked against the immutable owner row. A hash-only recovery read does not reconstruct that bearer and cannot independently recompute a preimage containing it. Recovery instead proves the exact stored operation, scope hash, versioned digest, source association and dependent committed evidence under the existing JOIN recovery contract. Do not substitute the token hash as `connectScopeId`, persist the plaintext bearer, or describe structural/hash-only readback as fresh authorization or a recomputed bearer-bound digest.

The same durable request-ID fence covers retained v1 and canonical v2 JOIN operations. Bind the v2 pending intent to its exact immutable scope and verified caller before retaining any policy result; changed caller, target or representation under that request ID conflicts. Under the Account and operation fences, one authoritative available result binds its exact boolean, positive entitlement version and policy-request digest immutably. An unavailable attempt records diagnostics without a fabricated policy result or digest and cannot overwrite already-bound available evidence. This journal evidence does not prove policy freshness: the eventual membership commit still revalidates the authority result. Legacy recovery must not interpret or terminalize a v2 operation, and a canonical pending intent cannot become a terminal success until the complete operation, membership, receipt, audit and event evidence is proved.

Canonical provisional transition receipts widen the existing receipt/head family; they are transaction and recovery evidence, not an authority event, admission permission or outbox checkpoint. A head has one independent monotonically increasing provisional receipt sequence. Bind an approved retained head once to its exact persisted Account UUID, tenant UUID and immutable tenant-source tuple without changing its legacy storage key, existing receipt bytes or sequence. A fresh head uses the proved Game Design-backed UUID identity without a numeric tenant alias. Internal head and membership row keys remain private references. Mixed-version receipts share the same head counter and global request-ID uniqueness; historical readback dispatches from the receipt's own representation, never from the latest head state. Unsupported latest representations fail closed instead of being decoded as retained v1.

Version-2 receipt evidence uses `account:membership-transition-receipt:v2:membership/{accountId}/{tenantId}` with exact canonical UUIDs. Its `membershipVersion` is the exact one-tenant map with a positive canonical decimal-string value, read from the same locked membership state. Receipt identity is `UUID.nameUUIDFromBytes` over strict UTF-8 `account-membership-transition-receipt/v2:` followed by the exact request ID; this identity is not its cryptographic payload digest. The SHA-256 preimage uses the byte-length framing above in this fixed order: `account-membership-transition-receipt/v2`, `2`, `PROVISIONAL_TRANSITION_RECEIPT`, canonical receipt stream key, receipt sequence, receipt UUID, transition type, request ID, Account UUID, tenant UUID, membership lifecycle state, lowercase gameplay-admission boolean, the map's sole tenant UUID key, its exact decimal version, membership-authority generation, authority provenance, tenant-provenance kind, tenant-source operation UUID and tenant-provenance digest. The private membership row ID and numeric aliases are excluded. JOIN/reactivation require `ACTIVE`, admitting state and `EXPLICIT_JOIN`; LEFT requires `INACTIVE`, nonadmitting state and that same provenance. Independent counters remain independent, with overflow denied before mutation rather than reset or wrap.

Appending a canonical receipt requires an actual read-write Account owner transaction, the persisted Account fence and exact membership/tenant-source readback; constructing the evidence value is not authorization. Exact request replay returns the original immutable receipt, while changed input or cross-version request reuse conflicts. Current receipt readback additionally matches the current membership state; historical receipt readback remains historical after later transitions. The receipt does not by itself prove atomic JOIN completion: terminal operation, role snapshot, canonical authority event/checkpoint and tenant audit must still be committed and proved together by the JOIN owner. Detailed implementation and execution status remains in the [Player Access and Session tracker](../../../project-management/implementation-tracking/player-access-and-session.md).

Account's canonical tenant audit uses the version-qualified UUID envelope of [Logging & Admin's ingress and receipt owner](../logging-admin-service/api-contracts.md#account-audit-ingress-and-receipt) through the existing outbox and RPCs. Account preserves exact retained numeric/platform envelope history and never invents a numeric alias for a fresh canonical tenant. The producer must compare the exact typed identity in delivery/readback before persisting terminal delivery evidence. A successful canonical JOIN must append that immutable outbox envelope in the same owner transaction as its membership, role snapshot, authority event, provisional receipt and operation outcome; implementing the audit carrier alone is not positive JOIN or admission proof.

### Current vs Target Export Lifecycle

The current `GET /accounts/{accountId}/export` route is a synchronous Account/profile-local read. Direct account-ID `ExportAccount` gRPC and the legacy account-targeted tenant-export REST/service and gRPC entries deny before data access. The local Account read has no cross-service required-owner fan-in and does not satisfy ADR 0050; none of these current surfaces may be described as a complete portable-data or tenant-admin export.
Expand Down
Loading
Loading