Skip to content

Prepare exact pre-dispatch capacity recovery receiving - #3424

Open
benhook1013 wants to merge 183 commits into
codex/gameplay-account-shared-abuse-20261113from
codex/gameplay-original-capacity-origin-receiving-20261112
Open

benhook1013 wants to merge 183 commits into
codex/gameplay-account-shared-abuse-20261113from
codex/gameplay-original-capacity-origin-receiving-20261112

Conversation

@benhook1013

@benhook1013 benhook1013 commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Current receiving boundary

d9917f2a on #3436 05d89011 binds the origin-aware Redis descriptor to the exact shared final-admission Lua. The consolidated #3428 proof exercised captured execution and transferred-origin Account recovery successfully. Fresh exact CI is pending.

This PR owns the open Account V1040.2 refusal-budget provisioning route from #3427. Capacity activation stays held until approved finite per-tenant limits are installed and verified for every supported fresh and existing tenant, and a physical first quota denial and exact NO_ACCEPT replay pass. Missing, inconsistent or exhausted limits preserve the Game Session evidence charge and unresolved custody. The existing same-transition rearm finding stays open and needs independently proven predecessor closure and exact Account successor authority.

Earlier comparison

171d78a9 on #3427 63374fb2 puts retained origin envelopes, Account resolutions and fence readbacks inside the tenant transfer-history budget. The existing origin transfer can finish within its reserved capacity. Five focused PostgreSQL, Redis and authenticated cases passed, including exact origin handoff, no-accept recovery, interrupted freeze recovery, and the fresh and populated catalog. The comparison has 62 changed files. Fresh CI, same-transition rearm, operational restore, registration and activation remain open.

Prior durable refusal receiving

ff6c29a4 on #3427 7cacd7cf receives the exact durable Account refusal while keeping origin closure and the authenticated recovery read here. The receiving path retains the denied origin, confirms its physical denial and settles only an unused active reservation. Seven focused PostgreSQL, Redis and authenticated composition cases passed, including the last-slot replay, delayed commit refusal, the committed-origin path and catalog upgrade. Fresh substantive CI is pending. Same-transition rearm, operational restore, registration and activation remain open.

Prior receiving comparison

1f927776 receives #3427 b476ecc4. The private Account-to-Game Session readback and origin receiving path carry complete target binding, first handoff from a verified committed original and the explicit per-attempt storage charge. The committed origin recovery and mTLS composition remain exercised by focused integration cases. Same-transition rearm, reset and restoration qualification, production registration and activation remain open. Substantive CI for this head is pending.

Prior receiving proof

95b83870 receives #3427 1ca58052 and owns the complete private original NEW capacity readback boundary. The comparison includes the Account recovery client, same-namespace Game Session mTLS receiver, closed codec, route policy, and the three physical recovery cases for exact FINAL settlement, retained FINAL after controlled retirement, and unresolved handoff through bounded quarantine.

The receiving source passed 114 focused unit cases and eight physical integration cases, including all three moved recovery tests. The receiving route matrix passed. GitHub CI is pending. Same-transition rearm, production registration and runtime activation remain open.

Earlier receiving proof

03596a0e receives #3427 ae4e9d5d and preserves the unified terminal source. Nine focused integration cases passed, including exact terminal replay, frozen transfer, stalled protected read and successor install fencing. Full rearm and runtime activation remain open.

Pre-dispatch capacity recovery

Account retains the exact original reservation decision. Game Session records origin custody before attempting Account commitment and retains the original observation budget across owner transfer. Missing or ambiguous evidence keeps the hold. #3425 owns the fence-acquisition receipt for exact FINAL witnessed before SQL intent.

Account V1040.1 installs on this comparison's V1040 frontier. Game Session V1065.1 adds the origin and transfer-custody families. The current migration chain seals this installer at epoch 15. The current source allows exact same-owner continuation after acknowledged INSTALL, reserves two resource slots for final admission during background recovery, and preserves definitive Account abort evidence through same-grant handoff and lost-completion recovery. Ten local PostgreSQL and Redis cases passed for these repairs, with affected static, formatting and documentation checks. Fresh required CI is pending.

The latest fixes refresh exact terminal topology when Account aborts after successor installation and refuse ordinary admission replay for an attempt with retained origin custody. Seven focused Game Session cases and two Account cross-service composition cases passed, including the preserved historical no-origin path and the exact origin-bound FINAL.

The latest source also bounds Redis origin mutations by the admitted operation deadline and independently asserts successor ownership in the transfer proof. Three focused PostgreSQL/Redis cases and six matching-input unit cases passed. Writers must be quiesced before activation of the stricter Account grant boundary. Deployment proof for that requirement and same-transition rearm remain open.

Eight earlier exact PostgreSQL, Redis and mTLS origin cases and one populated catalog upgrade passed on tree bb77974e. The later 20-case run at d0108393 covered same-grant recovery, successor claim, missing-marker refusal and signed expiry. Both retain their original attribution.

Draft #3431 carries the exact permit overlap and moved OPEN-origin closure repairs on the forward V1066.1 frontier. Draft #3429 owns the supported mixed-inventory limit and activation qualification. Full rearm, registration and activation remain held.

FireMUD LOC impact

Compared 11dc28b8b87a → 84a9a61e6be4 (PR merge-base → head).
PR scope: 70 changed files · 9,636 added textual lines / 1,141 deleted textual lines.

Section Base LOC Head LOC Δ LOC Change
Overall 1,723,764 1,731,680 +7,916 +0.5%
 Source 1,623,626 1,631,499 +7,873 +0.5%
  ↳ Code 707,533 712,146 +4,613 +0.7%
  ↳ Tests 916,093 919,353 +3,260 +0.4%
 Markdown 65,323 65,334 +11 +<0.1%
 Design 68,356 68,399 +43 +0.1%
  ↳ Architecture 46,597 46,639 +42 +0.1%
  ↳ Project management 6,162 6,163 +1 +<0.1%
  ↳ Observability 2,147 2,147 0 0.0%
  ↳ Operator runbooks 579 579 0 0.0%
  ↳ gRPC API documentation 11,391 11,391 0 0.0%
  ↳ Product requirements and user journeys 926 926 0 0.0%
  ↳ Developer workflows 475 475 0 0.0%
  ↳ Other design 79 79 0 0.0%

Rows are hierarchical and overlapping views; do not add them together.
LOC means cloc code lines; blank and comment-only lines are excluded.

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Explain Change →

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
Summary

Summary

This change adds pre-dispatch capacity-origin recovery. Account records one immutable origin decision for each exact reservation attempt. Game Session records origin custody before Account commits. The receiving composition is implemented but not registered. Runtime registration and activation remain held.

Affected components

  • account-service: Adds origin decision persistence (AccountCapacityOriginDecisionRepository). Adds a manually invoked recovery adapter (AccountCapacityOriginRecovery). Adds origin resolution to AccountTenantCapacityOwner. Changes the reconciliation deadline in AccountTenantCapacityRepository. Changes the observation limits in AccountTenantCapacityRecoveryWorker.
  • game-session-service: Adds origin custody storage and origin-aware transfer and final-admission handling. Adds two Redis custody scripts and their descriptors. Adds a recovery receiver seam (CanonicalGameplayCapacityOriginRecoveryReceiver). Updates the region-transfer repositories and the region-owner transfer coordinator.
  • common-platform-core: Adds AccountCapacityOriginContinuation (policy, observation budget, deadlines). Adds AccountCapacityOriginResolution (canonical bytes and digest).
  • Design docs and tracker: Updates the Account and Game Session runtime docs. Updates the player-access implementation tracker.

Contract and behavior changes

  • Account decision retention: Each reservation attempt retains one immutable origin decision. ACCEPTED commits with reservation creation or rearm. A durable NO_ACCEPT decision blocks later acceptance of the same request. Earlier reservation rows get no invented decisions.
  • Reconciliation deadline: Rearmed reservations derive their reconciliation deadline from AccountCapacityOriginContinuation.reconcileDeadline(expiresAt). The previous rule added 60 seconds to the evidence expiry.
  • Recovery worker limits: AccountTenantCapacityRecoveryWorker uses AccountCapacityOriginContinuation.MAX_OBSERVATIONS and OBSERVATION_SECONDS. It no longer uses hard-coded values of 12 observations and 5 seconds.
  • Origin recovery adapter: AccountCapacityOriginRecovery has no scheduler. It performs no release, rearm, or registration. It calls receiveExact at most once. It returns DELIVERED only if the permit deadline remains valid afterward. All other outcomes return HELD_UNAVAILABLE. These include UNKNOWN resolutions, expired deadlines, and caught runtime exceptions.
  • Game Session receiver: CanonicalGameplayCapacityOriginRecoveryReceiver is an explicit seam. It is not a registered gRPC service or a live route. It requires an Account workload identity. It rejects any inbound authorization header. It caps owner call deadlines to the earlier of the supplied deadline and the inbound gRPC deadline.
  • Same-owner frozen transfer: A frozen transfer can continue under the same owner's live grant. Each continuation revalidates the exact intent, predecessor, World source, protected incarnation, and grant within five seconds. An expired grant leaves the transfer held. Owner movement cannot make missing evidence terminal.
  • Redis scripts:
    • Adds game-session-original-new-capacity-origin-custody.lua with a v2 descriptor. It takes one key and eight arguments.
    • Extends game-session-original-new-final-admission.lua to accept an eight-key, 22-argument form. The seven-key, 19-argument form remains supported.
    • Adds the descriptor game-session.original-new-origin-final-admission.v1. It takes eight keys and 23 arguments.
    • Changes the SHA-256 value in the game-session-original-new-final-admission manifest.
  • Origin resolutions: AccountCapacityOriginResolution supports RESERVATION_RETAINED, NO_ACCEPT_RETAINED, and UNKNOWN. Its canonical bytes use a versioned, length-prefixed encoding. digest() returns the SHA-256 digest of those bytes. The resolution is not authentication or execution proof.
  • Region transfer terminal sources: Terminal sources now include committed and aborted outcomes. An aborted source requires the exact retained definitive first-NEW Account abort.

Schema and migration changes

  • Account V1040.1: Adds account_capacity_origin_decisions, keyed by tenant, request, admission, and rearm fence. A deferred constraint trigger requires each ACCEPTED decision to commit with its exact reservation. NO_ACCEPT is valid only at fence 1. Decision rows cannot be updated, deleted, or truncated.
  • Game Session V1065.1: Adds retained tables for pre-Account capacity origins and their transfer custody. Execution rows gain the CLOSURE_CLAIMED status. New dispatch and closure executions require an exact matching origin claim. Historical executions without an origin keep their prior handling. Owner-transfer completion requires matching captured origin evidence and verified custody. Origin-only regions get no empty-inventory exemption.
  • Catalog: The runtime-family catalog seal records epoch 13. It includes the V1065.1 installation marker. It excludes thirteen installing history rows.

Deployment notes

  • Account and Game Session origin storage now runs through Flyway. The fixture-schema installation was removed.
  • Game Session upgrades require migration V1065.1. Catalog epochs advance to 13.
  • The final-admission Redis descriptor states that compatibility requires a cluster reset. Only caller version v1 with payload version none is listed as supported coexistence.
  • Registration and activation of the receiving composition remain held.

Validation status

  • Reported by the author, local only:
    • Ten local PostgreSQL and Redis cases passed for the repairs. The author also reports passing local static, formatting, and documentation checks.
    • Eight earlier exact PostgreSQL, Redis, and mTLS origin cases passed on tree bb77974e. A populated Game Session catalog upgrade also passed on that tree.
    • A 20-case run passed at d0108393. It covered same-grant recovery, successor claim, missing-marker refusal, and signed expiry.
  • Not established:
    • Fresh required CI is pending on the current head. Its result is not available.
    • Forward-migration and physical composition proof on the receiving source still require fresh execution.
    • Mixed-inventory limits, activation qualification, larger-cohort proof, and refusal of excess admissions are not covered here. Separate draft work owns them.
    • Permit-overlap and OPEN-origin closure repairs are not covered here. Separate draft work owns them.
  • Review findings: Review results were reported for earlier commits only. CLI reviews at 91077beb and 1c88fc00 reported 8 findings each. Hosted reviews at 2eef3520 and cdd98ee2 reported 3 and 4 findings. The comments do not include the findings. Findings for the current head 522009c7 are not available.
  • Scope: The change touches 47 files, with 7,301 lines added and 339 lines removed.

The PR adds immutable Account origin decisions, bounded origin-resolution delivery, and retained Game Session origin custody. It also extends region-owner transfer and frozen-transfer recovery to carry, verify, and resume origin evidence, plus related SQL, Redis, and test updates.

Changes: Capacity-origin custody and recovery

Layer / File(s) Summary
Account decisions and shared recovery policy
services/common-platform-core/..., services/account-service/...
Shared types define canonical resolutions and bounded continuation policy. Account stores immutable ACCEPTED and NO_ACCEPT decisions and uses the shared reconciliation deadline in reservation flows.
Bounded origin resolution delivery
services/account-service/src/main/java/net/firedevops/firemud/accountservice/service/AccountCapacityOriginRecovery.java, services/game-session-service/src/main/java/net/firedevops/firemud/gamesession/service/impl/CanonicalGameplayCapacityOriginRecoveryReceiver.java, services/account-service/src/test/*, services/game-session-service/src/test/*
Account recovery admits a bounded observation, resolves the retained decision, and sends the exact resolution. The receiving seam validates caller identity, namespace, metadata, and deadlines. Tests cover retries, stale permits, denials, retained reservations, and transport edges.
Game Session origin creation and admission
services/game-session-service/src/main/java/net/firedevops/firemud/gamesession/repository/*CapacityOrigin*, .../CanonicalGameplayOriginalNewCapacityExecutionOwner.java, .../CanonicalGameplayOriginalNewFinalAdmission*.java, services/game-session-service/src/main/resources/db/migration/V1065.1__original_new_capacity_origin_custody.sql, services/game-session-service/src/main/resources/redis/*, services/game-session-service/build.gradle.kts
Game Session stores canonical origin and custody evidence in SQL and Redis. Origin-aware admission, resolution, and finalization now read and write the retained origin state, and the catalog and script metadata describe the new custody records.
Origin custody transfer and frozen-transfer continuation
services/game-session-service/src/main/java/net/firedevops/firemud/gamesession/repository/CanonicalGameplayRegion*, .../CanonicalGameplayProtectedIncarnationReceiver.java, services/game-session-service/src/test/*, design/architecture/microservices/*/runtime-and-data.md, design/project-management/implementation-tracking/player-access-and-session.md
Region transfers capture and verify origin custody before promotion to a reserved successor fence. A frozen transfer can continue under the same owner’s live grant and exact intent. Tracking records pending receiving-source migration and physical-composition execution.

Estimated code review effort: 5 (Critical) | ~120 minutes

Change: Other

Merge Risk: Moderate · previous review 52200

The capacity-origin recovery path is not yet registered or activated, so production exposure is limited. The path still has unresolved defects. Reservation recovery can fail after origin custody moves to a successor. Overlapping observation admissions can exhaust the retry budget. The Account migration needs a confirmed drain boundary. Fix these before activation, and ideally before merge.

Pre-merge checks: Passed 3 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Description check Warning The description does not follow the repository template. It lacks the required '## Summary', '## What Changed', '## Validation', '## Notes', and '## Checklist' headings. It gives a long chain of commi… Restructure the description to follow the template headings: Summary (purpose, user/operator-visible outcome, linked issues and design docs), What Changed (main implementation areas and contract/doc updates such as V1040.1, V1065.1, and the…
Passed Passed checks: 3 passed

Check name Status Explanation
Title check Passed The title "Prepare exact pre-dispatch capacity recovery receiving" matches the main change: Account and Game Session capacity-origin recovery, origin custody, and the receiving seam. It is specific an…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "Prepare exact pre-dispatch capacity recovery receiving" matches the main change: Account and Game Session capacity-origin recovery, origin custody, and the receiving seam. It is specific and concise, and it does not describe unrelated work. It does not mention the Account reservation-decision persistence or the catalog epoch change, but those are supporting parts of the same recovery work.

Full details: Description check

Explanation

The description does not follow the repository template. It lacks the required '## Summary', '## What Changed', '## Validation', '## Notes', and '## Checklist' headings. It gives a long chain of commit-referenced progress notes. It reports many validation runs, but it does not list the commands actually run, such as './gradlew spotlessApply' and './gradlew check', and it does not state whether './gradlew linkCheck lintMarkdown' ran, although markdown design docs changed. It states that fresh required CI is pending. It describes the operator-visible outcome only partially: capacity activation stays held. It references design docs and trackers by PR number (#3424, #3427, #3431, #3429, #3425) but no canonical design doc links are given. The checklist is absent, so the CLA and review-checklist confirmations cannot be verified.

Resolution

Restructure the description to follow the template headings: Summary (purpose, user/operator-visible outcome, linked issues and design docs), What Changed (main implementation areas and contract/doc updates such as V1040.1, V1065.1, and the Redis descriptors), Validation (exact commands run, including './gradlew spotlessApply' and './gradlew check', and './gradlew linkCheck lintMarkdown' because design markdown changed, plus the targeted PostgreSQL/Redis case counts), Notes (open items such as pending CI, same-transition rearm, and held activation), and the Checklist. Replace the commit-by-commit history with a concise current-state description. Confirm the checklist items, including the domain tracker and review-checklists.md check for auth/session and scripting changes, and the CLA item.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Smoke Summary

⚠️ Known PLAY failed: ERROR ENTITLEMENT_UNAVAILABLE after LOGIN. Canonical PLAY transition exception accepted; no runtime qualification or publication.

  • ✅ Changes detection: success
  • ✅ Smoke Gate: success
  • ❌ PR Full-Stack Smoke: failure (known PLAY exception accepted; no runtime qualification or publication)

@github-actions

Copy link
Copy Markdown
Contributor

Security Summary

✅ Security checks passed or were intentionally skipped

  • ✅ Security gate: success
  • ✅ Trivy filesystem scan: success
  • ✅ Secret compliance validation: success

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Static Analysis Summary

✅ Static analysis checks passed

  • ✅ CodeQL gate: success
  • ✅ License gate: success

CodeQL breakdown

  • ✅ CodeQL analysis (java): success
  • ⏭️ CodeQL analysis (javascript-typescript): skipped

# Conflicts:
#	services/account-service/src/main/java/net/firedevops/firemud/accountservice/service/AccountTenantCapacityOwner.java
#	services/account-service/src/test/java/integration/net/firedevops/firemud/accountservice/service/session/AccountTenantCreationCompletionPostgresIntegrationTest.java
#	services/game-session-service/src/main/java/net/firedevops/firemud/gamesession/repository/CanonicalGameplayOriginalNewCapacityExecutionOwner.java
#	services/game-session-service/src/main/java/net/firedevops/firemud/gamesession/repository/CanonicalGameplayRegionOwnerTransferCoordinator.java
#	services/game-session-service/src/main/resources/redis/lua/game-session-original-new-final-admission.lua
#	services/game-session-service/src/main/resources/redis/scripts/game-session-original-new-final-admission.json
#	services/game-session-service/src/test/java/integration/net/firedevops/firemud/gamesession/repository/GameSessionRuntimeFamilyCatalogPostgresIntegrationTest.java
# Conflicts:
#	services/game-session-service/src/test/java/integration/net/firedevops/firemud/gamesession/repository/GameSessionRuntimeFamilyCatalogPostgresIntegrationTest.java
# Conflicts:
#	services/game-session-service/src/test/java/integration/net/firedevops/firemud/gamesession/repository/GameSessionRuntimeFamilyCatalogPostgresIntegrationTest.java
@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Validation Summary

❌ One or more validation checks failed

  • ❌ Validation gate: failure
  • ✅ Buf generation: success
  • ✅ Dockerfile lint: success
  • ✅ ShellCheck: success
  • ✅ Python script validation: success
  • ✅ Dev tool contract checks: success
  • ⏭️ Dev Tools README contract: skipped
  • ✅ YAML lint: success
  • ✅ Metrics cardinality policy check: success
  • ✅ Flyway migration sanity checks: success
  • ✅ gRPC transport configuration sanity checks: success
  • ✅ GitHub workflow lint: success
  • ✅ Helm chart lint: success
  • ✅ Helm render validation: success
  • ✅ Helm transaction proof: success
  • ✅ Validate Documentation: success
  • ✅ Frontend checks: success
  • ✅ Dev tool validation contracts: success
  • ❌ Service build/test matrix: failure
  • ⏭️ Account coverage aggregation: skipped
  • ⏭️ Game Session coverage aggregation: skipped
  • ⏭️ World coverage aggregation: skipped

Coverage reports and failure logs are available in the workflow artifacts.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant