Skip to content

Retain historical FINAL evidence during Account fence acquisition - #3425

Merged
benhook1013 merged 75 commits into
codex/gameplay-original-capacity-origin-receiving-20261112from
codex/gameplay-fence-historical-final-receiving-20261112
Nov 19, 2026
Merged

benhook1013 merged 75 commits into
codex/gameplay-original-capacity-origin-receiving-20261112from
codex/gameplay-fence-historical-final-receiving-20261112

Conversation

@benhook1013

@benhook1013 benhook1013 commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Current comparison

The eight-file 3a99687d comparison on #3424 2b915f00 retains the V1065.2 historical FINAL observation. The test-layout carry preserves the original scope. Focused physical proof verified the carried fence/history cases and the active review record retains its completed rounds.

Historical FINAL during Account fence acquisition

The Game Session fence owner retains an independently verified physical FINAL as immutable historical evidence when the same acquisition revalidates the exact no-active epoch, original attempt and frozen inventory. Missing or stale evidence keeps the protective SQL fence. Unwitnessed events remain indeterminate. The receipt carries no admission, release, rearm or successor authority.

Four exact local PostgreSQL and Redis cases passed at 481481f5. They cover witnessed FINAL, SQL acquisition before delayed FINAL, the unobserved crash window and the installed V1065.2 catalog seal. Integration compilation and affected Checkstyle passed. Fresh required CI is pending. This stage builds on #3424, with admitted logout in #3428.

FireMUD LOC impact

Compared 2b915f00ea91 → 3a99687d382b (PR merge-base → head).
PR scope: 8 changed files · 749 added textual lines / 30 deleted textual lines.

Section Base LOC Head LOC Δ LOC Change
Overall 1,723,631 1,724,305 +674 +<0.1%
 Source 1,625,347 1,626,020 +673 +<0.1%
  ↳ Code 710,351 710,628 +277 +<0.1%
  ↳ Tests 914,996 915,392 +396 +<0.1%
 Markdown 65,333 65,334 +1 +<0.1%
 Design 68,397 68,398 +1 +<0.1%
  ↳ Architecture 46,637 46,638 +1 +<0.1%
  ↳ Project management 6,163 6,163 0 0.0%
  ↳ 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

No actionable comments were generated in the recent review.

Summary

Summary

This change adds retained historical FINAL evidence to Game Session account-fence acquisition. It affects the game-session-service runtime, its Flyway migrations, its runtime-family catalog, and its design documentation. The diff touches 6 files, with 749 lines added and 36 removed.

Behavior changes

  • The account fence owner can observe a physical FINAL before it creates its SQL fence intent.
  • The owner retains the observation as a historical receipt only when the same acquisition revalidates:
    • the prior no-active fence,
    • the inventory revision,
    • the exact original attempt, candidate, and frozen cohort.
  • If evidence is missing, expired, or displaced, ordering stays indeterminate. The protective SQL fence is still established.
  • The receipt does not promote frozen inventory. It does not authorize admission, release, rearm, or successor installation.
  • If the pre-intent read throws a RuntimeException, the original intent path runs without observation evidence.
  • A read method returns the observation only when its intent, account, inventory revision, cohort digest, and target digest still match.

Code changes

  • CanonicalGameplayAccountAdmissionBarrierRepository:
    • Adds beginFenceIntentWithFinalObservation, the optional pre-intent FINAL observation entry point. It calls readFinalBeforeAccountIntent on the capacity owner.
    • Locks the inventory clock through a shared helper. The intent and CLOSED-readback paths still request a lock.
    • Persists the observation only when the previous fence and locked inventory revision match, and the trusted clock is before the deadline.
  • CanonicalGameplayOriginalNewCapacityExecutionOwner:
    • retainCommittedBeforeCleanup obtains the execution through retainedExecution. It delegates provisional FINAL recovery to readProvisionalFinal, commits the recovered admission, verifies a COMMITTED exact snapshot, retains its terminal proof, and returns a fresh exact read.
    • Adds readFinalBeforeAccountIntent(request, reservation, deadline). It requires a PROVISIONAL transition and returns a HistoricalFinalReadback record.

Schema and migration changes

  • New migration V1065.2__account_fence_historical_final_observation.sql:
    • Adds the table game_session_account_fence_final_observation, keyed by operation.
    • Links each row to the account's acquisition intent, transition, and execution. Check constraints cover candidate, session, cohort, and barrier digests, timestamps, and inventory revision.
    • Insert validation requires a matching acquisition intent at the expected fence epoch, NO_ACTIVE_ACCOUNT_WIDE_FLOW control state, a matching provisional cohort row for the candidate, and an authorized execution for the transition, attempt, and tenant.
    • Updates, deletes, and truncation are rejected.
    • Classifies the table as retained control-only evidence.
    • Updates the runtime-family catalog functions and epoch to include 1065.2.
  • Combined catalog epoch changes from 13 to 14. The epoch-installation test now rejects epochs 1–14 and 16, and installs epoch 15.
  • Installs that already contain 1065.1 must apply 1065.2 before the catalog epoch 14 checks pass.

Documentation

  • design/architecture/microservices/game-session-service/runtime-and-data.md describes the V1065.2 normal-handoff ordering and the receipt limits. It also lists 1065.2 among the installing migration markers that the pre-installation seal excludes, raising that count from thirteen to fourteen.

Tests

  • CanonicalGameplayOriginalNewFinalAdmissionOwnerIntegrationTest (+324 lines) adds cases for:
    • a FINAL that completes after acquisition intent, which cannot be committed, retained, or exposed as final-readable,
    • a FINAL observed before acquisition, which is recorded as a receipt without promoting the transition from PROVISIONAL,
    • refusing retention when the inventory revision changes or the deadline expires,
    • a repeated acquisition intent, which records no receipt.
  • GameSessionRuntimeFamilyCatalogPostgresIntegrationTest (+99/-12 lines):
    • Expects catalog epoch 14 and includes 1065.2 in installed-history checks.
    • Adds a populated-upgrade test from 1065.1 to 1065.2. It checks that predecessor rows, classifications, epochs through 13, history, and snapshot evidence are retained, and that the new family is CONTROL with OWNER_POLICY_RETAINED in epoch 14.
    • The metadata-guard test attempts to insert epoch 15 using epoch 14's catalog bytes.

Validation status

  • The author reports four local PostgreSQL and Redis cases passed at commit 481481f5. These cover witnessed FINAL, SQL acquisition before delayed FINAL, the unobserved crash window, and the installed V1065.2 catalog seal. This review did not run them.
  • The author reports integration compilation and affected Checkstyle passed. Not verified in this review.
  • Fresh required CI is pending. Current CI status: not available.
  • Two CodeRabbit CLI findings at 834707d and zero findings at 12651dc are reported. A hosted review reported two findings at ca5d37f. The finding details are not available.

Review notes

  • Changes are confined to the account fence path and its catalog. Admission, release, and rearm behavior do not change.
  • The stated stage depends on a prior change (#3424). Admitted logout is in a later change (#3428).

The account-fence flow reads physical FINAL evidence before acquisition intent creation. It retains evidence only when acquisition revalidates the fence, inventory revision, deadline, and matching transition data. A new migration stores the evidence as immutable, control-only data and updates the runtime-family catalog.

Changes: Account-fence historical FINAL

Layer / File(s) Summary
Read and recover provisional FINAL
services/game-session-service/src/main/java/net/firedevops/firemud/gamesession/repository/CanonicalGameplayOriginalNewCapacityExecutionOwner.java
The capacity execution owner reads a provisional FINAL before account-intent creation. Committed-capacity retention uses the exact recovered readback.
Capture and bind fence observation
services/game-session-service/src/main/java/net/firedevops/firemud/gamesession/repository/CanonicalGameplayAccountAdmissionBarrierRepository.java, services/game-session-service/src/main/resources/db/migration/V1065.2__account_fence_historical_final_observation.sql, design/architecture/microservices/game-session-service/runtime-and-data.md
The barrier captures physical FINAL evidence before creating intent. It persists evidence only when the fence, inventory revision, deadline, and matching transition checks pass. The migration adds immutable storage and validation constraints. The documentation describes the evidence limits and catalog update.
Validate observation and catalog behavior
services/game-session-service/src/test/java/integration/net/firedevops/firemud/gamesession/repository/CanonicalGameplayOriginalNewFinalAdmissionOwnerIntegrationTest.java, services/game-session-service/src/test/java/integration/net/firedevops/firemud/gamesession/repository/GameSessionRuntimeFamilyCatalogPostgresIntegrationTest.java
Integration tests cover acquisition ordering, observation retention conditions, immutable evidence, and runtime-family catalog migration and epoch updates.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Barrier as Account admission barrier
  participant Owner as Capacity execution owner
  participant SQL as SQL database
  Barrier->>Owner: Read provisional FINAL before account intent
  Owner-->>Barrier: Return historical FINAL readback
  Barrier->>SQL: Create acquisition intent
  Barrier->>SQL: Persist observation if acquisition checks pass
Loading
Merge Risk: Minimal · previous review e092d

This change retains FINAL evidence as immutable history during fence acquisition. It grants no admission, release or successor authority. Review found no actionable merge-blocking risk, subject to the pending CI passing.

Pre-merge checks: Passed 3 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Description check Warning The description covers the purpose and outcome clearly. It states that the change retains independently verified physical FINAL evidence as immutable historical evidence during Game Session account fe… Restructure the description to follow the repository template headings: Summary, What Changed, Validation, Notes, and Checklist. Under What Changed, list the main areas: the V1065.2 migration (game_session_account_fence_final_observation ta…
Passed Passed checks: 3 passed

Check name Status Explanation
Title check Passed The title "Retain historical FINAL evidence during Account fence acquisition" matches the main change. The raw summary and PR objectives both describe a new read and retention path for physical FINAL …
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 "Retain historical FINAL evidence during Account fence acquisition" matches the main change. The raw summary and PR objectives both describe a new read and retention path for physical FINAL evidence during account-fence acquisition, with the V1065.2 migration and catalog updates supporting it. The title is specific and concise, and it names the primary behavior.

Full details: Description check

Explanation

The description covers the purpose and outcome clearly. It states that the change retains independently verified physical FINAL evidence as immutable historical evidence during Game Session account fence acquisition. It explains that missing or stale evidence keeps the protective SQL fence, and that the receipt grants no admission, release, rearm, or successor authority. It references the related PR chain (#3424, #3428) and the V1065.2 migration. The Validation content is partly present: it lists four exact local PostgreSQL and Redis cases, integration compilation, and affected Checkstyle. Required items are missing: the template asks for ./gradlew spotlessApply, ./gradlew check, and ./gradlew linkCheck lintMarkdown (the raw summary says design markdown changed), and the author does not state whether those were run. The Notes, the Checklist (including the CLA and design-tracker items), and the explicit template headings (Summary, What Changed, Validation, Notes, Checklist) are absent. The description uses a different structure with a generated LOC report. The description's current-comparison wording is also hard to follow for a reviewer.

Resolution

Restructure the description to follow the repository template headings: Summary, What Changed, Validation, Notes, and Checklist. Under What Changed, list the main areas: the V1065.2 migration (game_session_account_fence_final_observation table), the CanonicalGameplayAccountAdmissionBarrierRepository and CanonicalGameplayOriginalNewCapacityExecutionOwner changes, and the runtime-family catalog update to epoch 14 with the design doc updates. Under Validation, list the commands actually run and state the result of each. Run and report ./gradlew spotlessApply and ./gradlew check, or state why they were not run. Run and report ./gradlew linkCheck lintMarkdown because design markdown changed. Under Notes, add the follow-ups, the pending fresh CI, and the stacking on #3424 and #3428. Complete the Checklist, including the design tracker and review-checklist items if the change touches the auth/session contract. Replace the opaque 'eight-file 3a99687 comparison' and 'test-layout carry' wording with plain statements of what changed.

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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 4c65ec8 and e092dcc.

Files selected for processing: 6

  • design/architecture/microservices/game-session-service/runtime-and-data.md
  • services/game-session-service/src/main/java/net/firedevops/firemud/gamesession/repository/CanonicalGameplayAccountAdmissionBarrierRepository.java
  • services/game-session-service/src/main/java/net/firedevops/firemud/gamesession/repository/CanonicalGameplayOriginalNewCapacityExecutionOwner.java
  • services/game-session-service/src/main/resources/db/migration/V1065.2__account_fence_historical_final_observation.sql
  • services/game-session-service/src/test/java/integration/net/firedevops/firemud/gamesession/repository/CanonicalGameplayOriginalNewFinalAdmissionOwnerIntegrationTest.java
  • services/game-session-service/src/test/java/integration/net/firedevops/firemud/gamesession/repository/GameSessionRuntimeFamilyCatalogPostgresIntegrationTest.java

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@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

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

@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

@codecov

codecov Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.00000% with 9 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...icalGameplayAccountAdmissionBarrierRepository.java 88.88% 1 Missing and 6 partials ⚠️
...icalGameplayOriginalNewCapacityExecutionOwner.java 94.59% 0 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

# 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: skipped
  • ✅ Dev tool validation contracts: success
  • ❌ Service build/test matrix: failure
  • ⏭️ Account coverage aggregation: skipped
  • ✅ Game Session coverage aggregation: success
  • ⏭️ World coverage aggregation: skipped

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

@benhook1013

Copy link
Copy Markdown
Owner Author

CodeRabbit CLI — 2 Found, 0/0/2 Accepted (Major/Minor/Trivial), 0 Routed
6 files · 7m 38s · 834707d

…meplay-3425-cli6-carry-20261113

# Conflicts:
#	design/architecture/microservices/game-session-service/runtime-and-data.md
#	services/game-session-service/src/test/java/integration/net/firedevops/firemud/gamesession/repository/GameSessionRuntimeFamilyCatalogPostgresIntegrationTest.java
@benhook1013
benhook1013 merged commit c2fd7db into codex/gameplay-original-capacity-origin-receiving-20261112 Nov 19, 2026
71 of 130 checks passed
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