PR #3120 review history
Unit 1A · identity, Account and public JOIN
Review rounds
Three-number pills mean: found (raw) / accepted here (useful) / routed
Recorded review history
Reviews and findings
- Subagent Review 1 CompletedModel: gpt-6-luna · XhighFound: 1 Accepted: 1 Routed: 0
- Normal full-version publication bypasses selected source capture and terminal sealMajor
- Accepted Owned B publication path still commits v1 from mutable revisions. Reconcile genuine retained source-qualified producer and seal flow with original focused proof; missing owner authority must deny, never fabricate evidence.
- Subagent Review 2 CompletedModel: gpt-6-luna · XhighFound: 1 Accepted: 0 Routed: 1
- Supply independently authorized operation receipts for scoped publication and lifecycle readsMajor
Launch resolution remains fail-closed; PrepareWorldInstance, WMS Draft mutation/version read, Automation activation/work-item release reads lack receiver-verifiable scope. Need exact caller workload+namespace, canonical tenant+version, selected source commit/digest, read purpose, and governing operation/lifecycle from independently authorized owner operation. Preserve terminal reads and separate Account-authorized diagnostics; no invented expiry/revocation.
Route · PR #3120 → PR #3105 OpenDocument producer handoff required by Overseer 7b059d55; Gameplay retains receiver/caller contract and proof ownership. Existing correlation, tenant selectors or workload identity cannot mint read authority. View routed finding
- Hosted Review 1 CompletedRuntime 10m 54sFound: 3 Accepted: 0/0/3 Routed: 0
- Remove the vacuous
revisionRepositoryassertions and the mismatched collision test.TrivialThe constructor never receives the
revisionRepositorymock (Lines 43, 272-273).PublishedReleaseBundleServiceImpltakes onlyPublishedReleaseBundleRepository,VersionRepository, andObjectMapper. EveryverifyNoInteractions(revisionRepository)andverify(revisionRepository, never())in this file therefore passes regardless of service behavior. These assertions do not prove that mutable revision rows stay unread.createFullVersionBundleRejectsCanonicalIdAndAliasCollisions(Lines 521-537) calls the legacy 5-argument overload. That overload always throwsPUBLISH_SELECTION_REQUIRED, so the revision stubs never take effect. The test name claims collision rejection, but the test only checks the legacy refusal. Collision coverage already exists inselectedFullVersionBundleRejectsCanonicalIdAndAliasCollisions(Lines 631-636).Delete this test. Remove the
revisionRepositoryfield, its stubs, and its verifications, or replace them with a structural check on the class.♻️ Proposed cleanup
--- "a/services/game-design-service/src/test/java/unit/net/firedevops/firemud/gamedesign/service/impl/PublishedReleaseBundleServiceImplTest.java" +++ "b/services/game-design-service/src/test/java/unit/net/firedevops/firemud/gamedesign/service/impl/PublishedReleaseBundleServiceImplTest.java" @@ -518,23 +518,6 @@ org.mockito.Mockito.verifyNoInteractions(revisionRepository); } - @Test - void createFullVersionBundleRejectsCanonicalIdAndAliasCollisions() { - when(repository.findByTenantIdAndVersionId("tenant-1", 7L)).thenReturn(Optional.empty()); - Revision first = new Revision(); - first.setData(commandDefinition("salute", "greet")); - Revision second = new Revision(); - second.setData(commandDefinition("hail", "SALUTE")); - when(revisionRepository.findByTenantIdAndVersionIdAndRevisionKindOrderByIdAsc( - "tenant-1", 7L, "COMMAND_DEFINITION")) - .thenReturn(List.of(first, second)); - - assertThrows( - IllegalStateException.class, - () -> - service.createFullVersionBundle( - version(), "workflow-1", emptyManifest(), "genrev-1", List.of())); - } @Test void legacyFullVersionBundleDoesNotReachMutableCommandValidation() {Then remove the line
@Mock private RevisionRepository revisionRepository;and eachverifyNoInteractions(revisionRepository)orverify(revisionRepository, ...)reference.- Accepted Collision portion duplicates CLI1 finding3, but unused RevisionRepository mock is additional useful cleanup: service never receives it, so interaction assertions are vacuous. Remove disconnected mock/stubs/assertions, preserve real repository and selected-source tests.
- Merge the two duplicate post-export finalization recovery tests.Trivial
fullVersionMechanicsLeavesPostExportFinalizationFailurePendingWithCandidateAndRemap(Lines 717-893) andselectedMechanicsLeavesPostExportFinalizationFailurePendingWithCandidateAndRemap(Lines 948-1124) set up the same fixture. They inject the samemarkPublishedfailure and make the same assertions. The differences are only the tenant ID (isolatedTenantId()vs"9003") and the remap-set ID (random vs fixed). Each copy is about 175 lines, and future fixes must be applied twice.Keep one test with the isolated tenant and random remap ID, and delete the other. Line 704 also hard-codes
"https://assets.example.test/assets". UseFIXTURE_PUBLIC_BASE_URLthere.Also applies to: 948-1124
- Accepted Two post-export transaction tests differ only fixed versus isolated tenant/remap identities. Keep isolated/random variant and exact pending/readback/recovery assertions; replace repeated fixture URL literals with existing constant.
- Remove the duplicated claim checks from
claim().Trivialclaim()callsvalidateClaim()on Line 44. Lines 47-95 then repeat the same checks: operation lookup, commit lookup,QUEUEDstate,DRAFTstate, and absence of the application slot.DraftCommitCoordinatorRepository.claim(binding, account)also callsvalidateClaim()beforeclaim(). Each Account claim therefore runs the same locking reads three times. The two copies can also drift apart.The only behavior that
claim()adds is that the commit row must exist. Keep that check and the insert, and remove the other repeated checks. Lines 414-417 also have a redundantif (inserted == 0) return retained;branch.♻️ Proposed refactor
GameDesignDraftTerminalOperation claim( GameDesignDraftTerminalOperation operation, DraftCommitCoordinatorRepository.LockedVersion lockedVersion) { requireWritableReadCommittedTransaction(); validateClaim(operation, lockedVersion); DraftCommitBinding binding = operation.gameDesignBinding(); - Record byOperation = findOperation(operation.accountBinding().operationId(), true); if (byOperation != null) { - GameDesignDraftTerminalOperation persisted = toOperation(byOperation); - requireExactOperation(operation, persisted); - return persisted; + return toOperation(byOperation); // validateClaim already proved exactness } - Record byCommit = ... - ... (repeated commit/state/slot checks) + if (dsl.fetchOne( + "SELECT 1 FROM " + COMMIT_TABLE + + " WHERE canonical_tenant_id = ? AND canonical_version_id = ? " + + "AND request_id = ? AND commit_id = ?", + binding.target().canonicalTenantId(), binding.target().canonicalVersionId(), + binding.requestId(), binding.commitId()) == null) { + throw new DraftCommitCoordinatorRepository.DraftCommitNotFoundException( + "Game Design commit must be claimed before its Account operation"); + }- Accepted validateClaim already validates exact operation/commit/state/slot under same Version lock. Remove duplicate checks while retaining replay return, commit existence and atomic insert; terminal inserted==0 return is identical to final return.
- CLI Review 1 CompletedRuntime 4m 43sFound: 10 Accepted: 0/4/2 Routed: 1
- Verify that this adapter compiles against the merge base.Major
This file imports these types:
PublishedRealmEntryPolicyServiceGrpcResolvePublishedRealmEntryPolicyRequest/ResponseListPublishedRealmEntryPoliciesRequest/ResponsePublishedRealmEntryPolicyReadGrpcCodecPublishedRealmEntryPolicySetEvidence
None of these types is in this change.
api-contracts.mdlinksprotos/game-design/v1/published_realm_entry_policy_service.proto, and that file is also not in this change. The tracker says that "post-A compilation" is pending. That wording suggests these types come from another, unmerged change.Confirm that the proto and the
common-platform-corepublication classes exist on the target branch. If they do not exist,:game-design-service:compileJavafails, and the class is unconditionally on the component-scan path. The@ConditionalOnPropertyannotation does not prevent a compile failure.- Rejected Proto and both common-platform-core codec/evidence classes exist as immutable blobs on actual reviewedparent20c7. Core/GDS compilation and471/490 fresh units passed at identical runtime postimages; undefined documentation wording handled finding4.
- Reject
gamedesignrealmpolicysourceupdates that do not advance to a synchronized snapshot.MinorReject `game_design_realm_policy_source` updates that do not advance to a synchronized snapshot.
The other V50.8 guards bind every write to exact owner evidence. The
UPDATEbranch forgame_design_realm_policy_sourcechecks onlycanonical_tenant_id,canonical_version_id, andgenesis_receipt_id.A raw write can set
visible_commit_idback to an older snapshot and setsource_epochto that older snapshot'ssourceEpoch. The capture guard at Lines 220-224 then accepts the older snapshot as the visible source. The capture guard checks only that the epoch matches and that a visibility row exists.Add these checks to the source-row
UPDATEbranch:- The new epoch is greater than the old epoch.
source_epochequals thesourceEpochof the referenced snapshot.
The existing fixtures change the epoch from 1 to 2 with a new snapshot, so they stay valid.
🛡️ Proposed guard
ELSIF NEW.canonical_tenant_id IS DISTINCT FROM OLD.canonical_tenant_id OR NEW.canonical_version_id IS DISTINCT FROM OLD.canonical_version_id - OR NEW.genesis_receipt_id IS DISTINCT FROM OLD.genesis_receipt_id THEN + OR NEW.genesis_receipt_id IS DISTINCT FROM OLD.genesis_receipt_id + OR NEW.source_epoch::NUMERIC <= OLD.source_epoch::NUMERIC + OR NOT EXISTS (SELECT 1 FROM game_design_realm_policy_snapshot s + WHERE s.canonical_tenant_id = NEW.canonical_tenant_id + AND s.canonical_version_id = NEW.canonical_version_id + AND s.commit_id = NEW.visible_commit_id + AND s.snapshot_json::JSONB->>'sourceEpoch' = NEW.source_epoch) THEN RAISE EXCEPTION 'realm policy history is immutable' USING ERRCODE = 'check_violation';- Accepted Valid raw-head rewind can be inherited by later disjoint capture. Fix two legal transitions via additive migration: exact staged +1 with matching application, or same-epoch current-fence snapshot/preserved predecessor; naive greater-epoch every update breaks legitimate capture.
- Realm policies are mandatory for full-version publication, but one code comment says they are optional.Minor
RealmPolicySnapshot.CapturecallsRealmPolicySource.ordered(...). That method rejects an empty set and requires exactly onevisible && publicProductionpolicy.GameDesignSourceRepository.freezealways freezes the policy source, andreadCapturerequires both captures. So a Draft with commands but no realm policies cannot be published.recordFreshGenesisalways creates agame_design_realm_policy_sourcerow. As a result, the "no policy source" branch inretainSealedPublishedis unreachable, and its comment is wrong.Decide whether published full Versions must define realm policies. Then apply one consistent rule:
services/game-design-service/src/main/java/net/firedevops/firemud/gamedesign/publication/RealmPolicySnapshot.java#L64-L71: if policies are optional, callorderedonly for a non-empty snapshot. If policies are mandatory, return a typed publication gate failure, not a constructorIllegalArgumentException.services/game-design-service/src/main/java/net/firedevops/firemud/gamedesign/publication/RealmPolicyPublicationRepository.java#L66-L73: change the method comment and the empty-capture branch to match the chosen rule. Skip association for an empty capture if policies are optional, or delete the unreachable branch if they are mandatory.
- Accepted Canonical full publication requires bounded policies with exactly one visible public policy. Reject absent/invalid set through typed owner-freeze publication failure before constructing capture; remove unrelated no-policy success association branch. No activation.
- Verify that every existing caller that creates a new full Draft still passes the isolation check.Major
@Transactional(isolation = READ_COMMITTED)uses the defaultREQUIREDpropagation. Suppose a caller already holds a transaction with default isolation. Spring then joins that transaction and ignores the inner isolation attribute.TransactionSynchronizationManager.getCurrentTransactionIsolationLevel()returnsnull, and Lines 235-238 throwIllegalStateException. PostgreSQL already runsREAD COMMITTEDby default, so this check rejects callers that are effectively correct.Before this change, any caller inside a default
@Transactionalboundary could create a new non-script Draft. Examples are a game-creation service,TestDataSeeder, and template or bootstrap flows. Each of these callers now fails.Run this search:
rg -n "versionRepository\.save\(|VersionRepository" services/game-design-service/src/main. Confirm that each insert path for a new full Draft runs inside an explicitisolation = READ_COMMITTEDtransaction, or outside any transaction. If not, either annotate those callers, or accept anullisolation level when the database default isREAD COMMITTED.- Rejected Actual current main save callsites do not insert full Draft: seeder inserts PUBLISHED, VersionService creates script-only/base-bound Draft, other calls update existing rows. Reported present seeder/bootstrap regression unsupported; future default-transaction caller hazard not current defect.
- Delete the duplicated selected-mechanics tests.Trivial
The rewrite left many tests in pairs with identical bodies:
- Successful mechanics:
reflectiveUnitHarnessReconcilesSelectedExistingVersionWithCapturedOperation(Line 666) andprivateMechanicsUsesDurablySelectedVersionWithoutSequenceReservation(Line 1870). - Typed gate failure:
publishFullVersionPropagatesTypedPublishGateFailures(Line 817) andprivateMechanicsRecordsTypedPublishGateFailures(Line 2021). - Gate rejection: Line 845 and Line 2049.
- Transient participant read: Line 936 and Line 2672.
- Staged artifact with a mismatched workflow, a mismatched scope, or a published version: Lines 1075, 1095, and 1115, and Lines 2434, 2454, and 2474.
- Mismatched or uncertain persisted candidate: Lines 1323 and 1376, and Lines 2386 and 2410.
- Mismatched version evidence and mixed scope: Lines 1479 and 1503, and Lines 2484 and 2508.
- Fresh legacy denial: Line 149 and Line 1798.
The second copies named
legacyFull...(Lines 2484 and 2508) useselectedPublishFixture. Their names describe a legacy path that they do not test.Keep one copy of each scenario. Delete the duplicates or rename them so that each name describes the actual path.
- Accepted Ten exact duplicate selected-mechanics bodies verified, including misnamed legacy selected-fixture cases. Keep canonical named scenarios once, preserve distinct assertions/refusal/recovery cases; no production change.
- Successful mechanics:
- Confirm that the bearer-exemption method names use the actual proto package of
PublishedRealmEntryPolicyService.MajorThe existing exemption uses
gamedesign.v1.TenantIdentityService. The new entries usegame_design.v1.PublishedRealmEntryPolicyService. The [redacted credential] matches full gRPC method names exactly. If the package differs, the interceptor rejects every Game Session mTLS call that has no JWT before the handler's peer check runs, so the read can never succeed.Run this search:
rg -n "^package" protos/game-design/v1/published_realm_entry_policy_service.proto.services/game-design-service/src/main/resources/application.yml#L65-L66: change the two entries to match the declared proto package.services/game-design-service/src/main/resources/application-prod.yml#L54-L55: apply the same correction.
- Rejected Both base and production exemptions already use game_design.v1, exactly the proto package at reviewed3a28 and parent20c7. No package mismatch; same-namespace mTLS handler gate retained.
- Replace the undefined term "A-dependent compilation".Minor
Line 107 says "final A-dependent compilation". The document does not define "A". A reader cannot tell which dependency this term names. This sentence also records proof status inside a canonical architecture contract. The implementation tracker owns proof status.
Name the exact prerequisite, for example the PR or the shared module that supplies the published-policy proto and codec. As an alternative, remove the proof clause here and keep it only in the tracker. Apply the same change to the "post-A" wording in the tracker.
As per path instructions: "Review docs for canonical-current-state consistency."
- Accepted Undefined A/post-A and stale pendingproof claims are verified; remove undefinedarchitectureproof wording, name current inherited dependency and retain qualified proof status/limits at tracker.
- A publication selection permanently freezes its Draft with no recovery path.Major
The selection row is immutable, and this repository never releases it. These are its effects:
reserverejects every later publish request with a differentpublishRequestIdfor the same Version (Lines 66-69).- The V50.2 trigger
reject_gd_draft_application_during_authored_publicationrejects every new application slot for that Version. requireNoPublicationSelectionin the coordinator and the source repositories also blocks owner application.
Consider a selected publication that ends
FAILED, for example onAPPLIED_COMMIT_MISMATCHor a gate failure. The Version staysDRAFT. It cannot accept a corrective commit, and it cannot accept a new publish request. No code creates a successor Draft that copies the source.Confirm the intended recovery after a definitive
FAILED/NO_PUBLICATIONseal. Two options are a release rule tied to the sealedNO_PUBLICATIONoutcome, or a documented successor-Version path. The selected path is not reachable yet, so this is a lifecycle gap for the future, not a current outage.Route · PR #3120 → Unassigned target OpenRoot20e0e42c accepts Major future recovery gap into existing PR-unassigned production-readiness followup. Preserve passive immutable selection; OPEN before enablement/genuine recovery proof. No deletion/unfreeze/clone or fixed/route-closure claim. View routed finding - Remove or rewrite the stale legacy-path collision and validation tests.Trivial
createFullVersionBundleRejectsCanonicalIdAndAliasCollisionscalls the legacy five-argumentcreateFullVersionBundle. That entry point now throwsPUBLISH_SELECTION_REQUIREDbefore it readsrevisionRepository. The test passes because of that refusal, not because the code detects a collision. TheRevisionstubs are never used.legacyFullVersionBundleDoesNotReachMutableCommandValidationchecks the same refusal. Lines 283, 294, 308, 368, and 462 check it as well, so the legacy refusal is tested seven times.The selected-path tests at Lines 618-643 already cover collisions and invalid command definitions. Delete these two tests. Merge the legacy-refusal tests into one test.
- Accepted Legacy five-arg path throws selection-required before repositories; stale collision/validation tests pass for wrong reason and duplicate refusal. Keep one exact refusal+no-interactions test, retain selected-path collision/effect-validation proof.
- Align the Capability Status rows with the new immutable source capability.Minor
This section adds new production anchors. These include
CommandSourceRepository,RealmPolicySourceRepository,RealmPolicyPublicationGrpcService,GameDesignPublicationOperationRepository, and migrations V50.1–V50.11. TheAR-1.5row still lists only the older anchors. No Capability Status row names the new focused tests as proof anchors, for exampleRealmPolicyPublicationPostgresIntegrationTestandCommandSourceTest. The section also says that compilation and execution are pending, so the row Verification cell must show that state explicitly.Line 19 also uses "post-A compilation" without a definition. Name the exact prerequisite.
As per coding guidelines: "Each tracker contains one
Capability Statusrow for every capability it primarily owns" and "implementedandpartialrows name concrete production anchors."- Accepted AR1.5 production/test anchors omit this new immutable-source slice; add existing owner paths and scoped actual proof limits, keeping whole publication/producer/runtime incomplete. Undefined post-A duplicates finding4 fix.
- Hosted Review 2 CompletedRuntime 11m 56sFound: 5 Accepted: 0/2/1 Routed: 0
- Remove the duplicate World selector evidence comparison.Trivial
Lines 323-325 already compare
getWorldPublishedStartLocationEvidenceJson(). The new check at Lines 305-307 repeats the same comparison.Proposed cleanup
--- "a/services/game-design-service/src/main/java/net/firedevops/firemud/gamedesign/repository/PublishedReleaseBundleRepository.java" +++ "b/services/game-design-service/src/main/java/net/firedevops/firemud/gamedesign/repository/PublishedReleaseBundleRepository.java" @@ -301,11 +301,8 @@ || !Objects.equals(persisted.getManifestHash(), requested.getManifestHash()) || !Objects.equals( persisted.getManifestSchemaVersion(), requested.getManifestSchemaVersion()) || !Objects.equals(persisted.getArtifactDigestsJson(), requested.getArtifactDigestsJson()) - || !Objects.equals( - persisted.getWorldPublishedStartLocationEvidenceJson(), - requested.getWorldPublishedStartLocationEvidenceJson()) || !Objects.equals( persisted.getAttestationSchemaVersion(), requested.getAttestationSchemaVersion()) || !Objects.equals(persisted.getPublishWorkflowId(), requested.getPublishWorkflowId()) || persisted.getVersionNumber() != requested.getVersionNumber()- Accepted ExactWorldpublishedstartlocationevidence comparison duplicated in samepersisted/requestedguard; retainone comparison, remove duplicate.
- Run the published-policy PostgreSQL proof against schema V50.12.Trivial
The fixture stops at
50.10, but the replacement-baseline test callsbaseline(..., "1", "Replacement World"). That path directly updatesgame_design_realm_policy_source. V50.12 adds a trigger that requires epoch and visible-pointer changes to match the exact owner application and synchronized snapshot. This test therefore does not prove the source transition used by the publication and readback flow against the current schema.Migrate through V50.12 after setup. Create the replacement baseline through the guarded transition instead of issuing the direct
UPDATE. V50.11 is not shown to affect this publication path, so do not rely on it alone as the reason for the change.- Rejected DuplicateCLI2f5 acceptedfirst; same50.12guardedfixture/currentownerapplication correctionalreadyprepared and physicalvalidationongoing, noextra usefulwork.
- Wrap the readback in the failure-marking catch so it keeps the pending-reconciliation contract.Minor
In the
FullVersionTransactionExceptionbranch, Line 668 callsreadPublication(request, attempt)without atry.readPublicationcan throw. The reasons are:readPublishedReleaseBundlemaps the stored row throughtoDto.toDtorunsrequireSelectorBinding.versionAssetArtifactService.findStatereads storage.
If the readback throws, the raw exception escapes
failDefinitively. The caller then receives a non-PendingReconciliationException, soTemporalVersionPublishActivitiesImpl.reconciledoes not return aPENDINGsnapshot. The originalex.causeException()is also lost. The finalization catch at Lines 297-304 already wraps the same readback and attaches the suppressed failure. Apply the same pattern here.🐛 Proposed fix
--- "a/services/game-design-service/src/main/java/net/firedevops/firemud/gamedesign/service/impl/VersionPublishCommandServiceImpl.java" +++ "b/services/game-design-service/src/main/java/net/firedevops/firemud/gamedesign/service/impl/VersionPublishCommandServiceImpl.java" @@ -664,9 +664,17 @@ // Approved launch remap sets may reference this failed candidate, so retain the row. return Boolean.TRUE; }); } catch (PublishAttemptService.FullVersionTransactionException ex) { - PublicationReadback winningPublication = readPublication(request, attempt); + PublicationReadback winningPublication; + try { + winningPublication = readPublication(request, attempt); + } catch (RuntimeException readFailure) { + readFailure.addSuppressed(ex.causeException()); + throw pendingReconciliation( + "full-version failure marking readback failed; reconciliation is required", + readFailure); + } if (winningPublication.isComplete()) return reconcileCommittedAttempt(request, attempt); throw pendingReconciliation( "full-version failure marking commit outcome is unknown; readback/reconciliation is required", ex.causeException());- Accepted Failuremarking transaction catch readPublication canthrowoutsidePendingwrapper; preserve pendingreconciliation contract and suppressedoriginalcause, focusedregression.
- Make the AR-1.5 PostgreSQL proof count match the status narrative.Minor
Line 19 says that 17 cases failed with mapped PostgreSQL connection refusal or the resulting context-loading failure. The AR-1.5 gap cell on Line 80 says that the latest local PostgreSQL proof has "one unresolved mapped-endpoint failure". These two statements give different counts for the same gate. The Verification cell is also inconsistent with itself: it says "mapped-endpoint failures" in the plural. It also contains a double space before "Immutable-source".
Line 80 must state the same result as the narrative: 17 mapped-endpoint or context failures, with the cause unknown. Otherwise the scan-first status row understates the open integration-gate gap. The tracker contract requires the status, validation, and gap sections to stay aligned.
As per coding guidelines: "Keep its status, implementation record, validation, gaps, decisions, and service-map sections aligned".
- Rejected DuplicateCLI2f1 acceptedfirst; same17endpointtrackerfix is prepared and beingvalidated, noadditional usefulcorrection.
- Map transaction-begin failures to
UNAVAILABLE, notINTERNAL.MinorRealmPolicyPublicationService.readPublishedSetruns inside aTransactionTemplate. If the database connection fails when the transaction starts, Spring throwsCannotCreateTransactionException. That class extendsTransactionException, notDataAccessException. Both handlers therefore send it to the genericRuntimeExceptionbranch and returnINTERNAL. Game Session would then classify a transient storage outage as a non-retryable server fault. AddTransactionExceptionto theUNAVAILABLEcatch in both handlers.Proposed fix (apply to both handlers)
- } catch (DataAccessException | org.jooq.exception.DataAccessException unavailable) { + } catch (DataAccessException + | org.jooq.exception.DataAccessException + | org.springframework.transaction.TransactionException unavailable) { fail(observer, Status.UNAVAILABLE, "Published realm policy owner storage unavailable");Also applies to: 131-140
- Accepted Bothreadhandlers miss SpringTransactionException at TransactionTemplatebegin; add storageUNAVAILABLEmapping and focusedmethodregressions.
- CLI Review 2 CompletedRuntime 3m 57sFound: 6 Accepted: 0/3/2 Routed: 0
- New full Draft inserts fail when the caller's transaction uses the default isolation.Major
@Transactional(isolation = Isolation.READ_COMMITTED)usesREQUIREDpropagation. When a caller already has a transaction, Spring joins it and does not apply the inner isolation level (validateExistingTransactionisfalseby default).TransactionSynchronizationManager.getCurrentTransactionIsolationLevel()then returns the outer transaction's level. For a plain@Transactionalcaller that level isnull.As a result, the guard on lines 235-238 throws
IllegalStateExceptionfor every new non-script-onlyDRAFTVersion saved from a default-isolation transaction. Examples are game creation, template bootstrap, or a test/demo seeder that opens its own@Transactional. Before this change those inserts succeeded. The annotation only appliesREAD_COMMITTEDwhen no outer transaction exists.If any production caller creates full Drafts inside a default-isolation transaction, Draft creation stops working. Fix the callers rather than the guard:
- Annotate each such caller with
isolation = Isolation.READ_COMMITTED, or - Run the insert in a dedicated
REQUIRES_NEW+READ_COMMITTEDboundary. Note thatenrollFreshDraftrequires the insert witness from the current transaction, so the insert and the enrollment must stay in that same new boundary.
Verify which callers reach this branch:
For each caller that sets
DRAFTandscriptOnly=falseon a new Version, confirm that its enclosing@TransactionaldeclaresREAD_COMMITTED. Also confirm that the PostgreSQL seeder and integration paths, such asTestDataSeederIntegrationTest, pass with the guard enabled.- Rejected DuplicateCLI1f9 hypothetical: all actual new full main-source seeder Versions are PUBLISHED, VersionService newVersions scriptOnly=true; no identified default-isolation full-DRAFT caller. Preserve strictguard.
- Annotate each such caller with
- Make the PostgreSQL proof status in the AR-1.5 row match the narrative.Minor
Line 19 says the broader local integration gate had 17 failures. They were mapped PostgreSQL connection refusals or their context-loading cascade, and the cause is still unknown. The
AR-1.5row says something different. It reports "one unresolved mapped-endpoint failure" in its gap cell and "mapped-endpoint failures remain unqualified" in its verification cell. A reader scanning the row first gets a smaller failure count than the record supports.Use one statement in both places, for example: "17 mapped-endpoint/context-loading failures; cause unknown; full current-candidate integration gate unqualified."
As per coding guidelines: "Keep its status, implementation record, validation, gaps, decisions, and service-map sections aligned when a domain boundary changes."
- Accepted AR1.5 still says one endpoint failure while current narrative has17; align row with actual unknown-cause/unqualified integration record.
- Run the publication-association proof against the latest schema, not
50.10.TrivialThe fixture stops at migration
50.10. The PR also ships V50.11 (immutable_reviewed_draft_base) and V50.12 (realm_policy_source_head_transition_guard).baseline(..., "1", ...)updatesgame_design_realm_policy_sourcedirectly with SQL.RealmPolicySourcePostgresIntegrationTestshows that V50.12 rejects this kind of update. So this test cannot run at the latest schema. Its seal, capture, and set-association assertions therefore do not cover the triggers that production runs.Migrate to the latest version. Create the replacement baseline through the real owner application path (
RealmPolicySourceRepository.applyplus the coordinator), not a raw source-rowUPDATE.- Accepted Confirmed fixture stops50.10 and rawpolicy UPDATE bypasses shipped50.12guard. Upgrade fixture to currentmigration and real existing coordinator/source application; retain association assertions.
- Remove the orphaned
@ParameterizedTestand@EnumSourceannotations fromfullAttempt.MinorLines 2320-2323 belonged to a test method that this change removed. They now annotate the private, non-void helper
fullAttempt. JUnit Jupiter does not run a private method that returns a value as a test. JUnit reports such a method as an invalid test method. Depending on the JUnit version and the discovery-issue severity setting, this is either a warning or a discovery failure. In both cases the annotations suggest a test that does not exist.Confirm the JUnit Platform version and the
junit.platform.discovery.issue.severity.criticalsetting.🐛 Proposed fix
- @ParameterizedTest - @EnumSource( - value = Status.Code.class, - names = {"UNAVAILABLE", "DEADLINE_EXCEEDED"}) private PublishAttempt fullAttempt( PublishAttemptStatus status, long versionId, int versionNumber, String workflowId) {- Accepted Confirmed orphan parameterized/enum annotations on private nonvoid fullAttempt helper after dedup; remove only those annotations.
- Document that
tenantidchanges meaning when the selection fields are set.MinorDocument that `tenant_id` changes meaning when the selection fields are set.
GameDesignGrpcService.publishVersionreadstenant_idin two ways:- With all five selection fields blank, it treats
tenant_idas the legacy Game Design tenant key and passes it toreplayLegacyFullVersion. - With all five selection fields set, it parses
tenant_idwithcanonicalPublicationUuidand requires a canonical non-nil UUID.
The proto comment says nothing about this. A client that sends the tenant key together with a complete selection gets
INVALID_ARGUMENT. Add the canonical-UUID requirement fortenant_id,version_id,selected_commit_request_id, andselected_commit_idto the comment.📝 Proposed comment
- // Complete together for new publication: the exact existing Draft selection. - // When all selection fields are empty, only a retained terminal legacy retry is eligible. + // Complete together for new publication: the exact existing Draft selection. When set, + // tenant_id, version_id, selected_commit_request_id, and selected_commit_id must be + // canonical lower-case non-nil UUIDs (tenant_id is the canonical tenant UUID, not the key). + // When all selection fields are empty, tenant_id is the legacy tenant key and only a + // retained terminal legacy retry is eligible.- Accepted Actual publishVersion requires canonical lower-case nonnil UUID tenant/version/selected commit identifiers in selectedmode; proto comment omits key-vsUUID semantics. Clarify comment only.
- With all five selection fields blank, it treats
- Make the late publisher wait on the winner's locks before you release the winner.Trivial
The test calls
releaseSeal.countDown()right after it submitsloser. It does not wait forloserto block on the winner's row locks. The executor can startloserafter the winner has committed. In that casepublish(fixture)sees a sealed operation through the ordinary non-concurrent path, and the test passes without proving serialization.Wait for the loser backend to block on the winner's backend before you release the winner. Get the backend PIDs and poll
pg_blocking_pids, asRealmPolicySourcePostgresIntegrationTest.freezeAndSourceWriterUseSameVersionLockAndRollbackDoesNotLeaveCapturedoes.♻️ Sketch
- releaseSeal.countDown(); + // Get the winner and loser backend PIDs, then poll pg_stat_activity until + // winnerPid = ANY(pg_blocking_pids(loserPid)) before releasing the winner. + awaitBlockedBy(winnerPid, loserPid); + releaseSeal.countDown();- Accepted Confirmed seal latch released immediately afterlosersubmit, no actuallockblockingproof. Add bounded pg_blocking_pids evidence beforewinner release, existingtestpatternreuse.
- CLI Review 3 CompletedRuntime 3m 46sFound: 2 Accepted: 0/1/0 Routed: 0
- Fix the duplicated and malformed proof sentence in the AR-1.5 row.Minor
The Verification cell contains a double space before "Immutable-source". It then continues with "; The full current-candidate…", which starts with a capital letter after a semicolon. The same sentence pair also appears in the Gap cell. Both cells state the same qualification, so readers see the text twice.
Correct the punctuation. Keep the integration-gate qualification in one cell only.
📝 Proposed wording fix (Verification cell)
-...remain unproved. Historical lineage remains a retained-data deployment blocker: the owner must record a verified no-data boundary or explicit retained-row disposition/mapping with exact readback before migration cleanup or any completion claim. Immutable-source PostgreSQL proof is partial on the latest local parent gate; The full current-candidate integration gate remains unqualified after 17 mapped-endpoint/context-loading failures; their cause is unknown. +...remain unproved. Historical lineage remains a retained-data deployment blocker: the owner must record a verified no-data boundary or explicit retained-row disposition/mapping with exact readback before migration cleanup or any completion claim. Immutable-source PostgreSQL proof is partial on the latest local parent gate: the full current-candidate integration gate remains unqualified after 17 mapped-endpoint/context-loading failures of unknown cause.- Accepted PriorAR1.5literalreplacement duplicatedqualification/leftmalformedpunctuation. Keep17unknown-causeunqualifiedfullgate statement once inVerification, preserve othergapsemantics.
- Check that existing full Draft creators still satisfy the new transaction guard.Major
savenow rejects a new fullDRAFTrow unless the current transaction reportsISOLATION_READ_COMMITTED. The method-level@Transactional(isolation = READ_COMMITTED)usesREQUIREDpropagation. That setting applies only whensavestarts its own transaction. If a caller is already inside an ordinary@Transactionalmethod,savejoins that transaction. With default isolation,TransactionSynchronizationManager.getCurrentTransactionIsolationLevel()returnsnull, so the guard throws. Before this change, the same call succeeded.Genesis enrollment adds a second constraint. Both
CommandSourceRepository.enrollNewDraftGenesisand the V50.10 baseline trigger requireversion_state_epoch = 1. A caller that inserts a new full Draft with any other epoch now fails at enrollment.Removing the Draft creation from
VersionPublishCommandServiceImpldoes not show that no other caller remains. The demo seeder, game creation paths, or test fixtures may still create full Drafts. Confirm that every caller that creates a fullDRAFTeither runs without an outer transaction or uses an explicitREAD_COMMITTEDwritable transaction. Each caller must also setversionStateEpoch = 1.- Rejected RepeatCLI1f9/CLI2f2 hypothetical. ActualnewfullmainseedVersionsPUBLISHED; VersionService newscriptOnly=true; defaultVersionDRAFTepoch1, latest50.12fixtureREAD_COMMITTED passed4PG. Noactualaffecteddefault-isolationfullDraftcalleridentified.
- CLI Review 4 CompletedRuntime 3m 42sFound: 4 Accepted: 2/2/0 Routed: 0
- Bind the realm-policy JWT-bypass entries to the generated gRPC method names.Major
The YAML allowlist and both tests write
game_design.v1.PublishedRealmEntryPolicyService/...by hand. The existing tenant method uses the packagegamedesign.v1.AuthTokenInterceptormatches the full method name exactly.If the generated full method name differs from the YAML entry, every call without a JWT from game-session-service fails with
UNAUTHENTICATED. No test detects this, because each test compares the YAML with another hand-written copy.RealmPolicyPublicationMtlsTestbuilds its allowlist fromgetFullMethodName(), so it does not exercise the YAML.Verification needed: confirm the
packagedeclaration ofPublishedRealmEntryPolicyServiceinprotos/game-design/v1/game_design_service.proto.services/game-design-service/src/test/java/unit/net/firedevops/firemud/gamedesign/config/RealmPolicyPublicationReadConfigurationTest.java#L89-L92: assert the YAML entries againstPublishedRealmEntryPolicyServiceGrpc.getResolvePublishedRealmEntryPolicyMethod().getFullMethodName()andgetListPublishedRealmEntryPoliciesMethod().getFullMethodName().services/game-design-service/src/test/java/unit/net/firedevops/firemud/gamedesign/security/TenantIdentityGrpcAuthWiringTest.java#L54-L58: buildCONFIGURED_PUBLIC_METHODSfrom the same generated descriptors instead of string literals.
- Accepted Actualproto/YAMLnames alreadymatch game_design.v1; generateddescriptor assertions improveproof insteadofmatchingtwohandwrittenexpectedliterals. Twoexistingtests only, noactualauthoutageclaim.
- Validate the epoch of a non-genesis source-head insert.Minor
The
game_design_realm_policy_sourcebranch validates anINSERTonly whengenesis_receipt_id IS NOT NULL. A non-genesis insert passes with anysource_epochand anyvisible_commit_id. The only conditions are a Draft owner and the snapshot FK.V50.12 checks every later
UPDATEof the head, but it usesOLD.source_epochas its trusted base. If the first row has an epoch that differs from its snapshotsourceEpoch, every later transition builds on a value that was never verified.RealmPolicySourcePostgresIntegrationTest.retainedFixtureuses this exact raw-insert path.Fix: for a non-genesis insert, require that the visible snapshot exists and that its
sourceEpochequalsNEW.source_epoch.Proposed guard
IF TG_OP = 'INSERT' AND NEW.genesis_receipt_id IS NOT NULL THEN ... END IF; + IF TG_OP = 'INSERT' AND NEW.genesis_receipt_id IS NULL AND NOT EXISTS ( + SELECT 1 FROM game_design_realm_policy_snapshot s + WHERE s.canonical_tenant_id = NEW.canonical_tenant_id + AND s.canonical_version_id = NEW.canonical_version_id + AND s.commit_id = NEW.visible_commit_id + AND s.snapshot_json::JSONB->>'sourceEpoch' = NEW.source_epoch) THEN + RAISE EXCEPTION 'realm policy source head must match its visible snapshot epoch' USING ERRCODE = 'check_violation'; + END IF;- Accepted Validrawnon-genesis sourceINSERT epoch/snapshotmismatch acceptedbyoldguard; newforwardinsertguard mustmatchsameowner/version/commit snapshotepoch andpreservevalidgenesis/retainedinitialization.
- Fix the receipt evidence so it does not depend on the release table's column set.Major
sealstoresto_jsonb(r)::TEXTfor the wholepublished_release_bundlerow asrelease_row_jsonand inside thereceipt(...)bytes.read(Lines 138-145) recomputesto_jsonb(r)::TEXTand requires exact equality with the stored text.A future migration can add a column to
published_release_bundle, even a nullable or defaulted one. That migration changes theto_jsonboutput for every existing row. Every retainedPUBLISHEDoperation then fails withPUBLICATION_RECEIPT_BACKING_CONFLICT. This failure blocks:- exact terminal replay;
GameDesignPublicationTerminalReadGrpcService;RealmPolicyPublicationRepository.readPublishedSet.
These records are immutable, so retained receipts cannot be repaired. The closed
PublicationReleaseContentandpublishedReleaseBundleDigestalready provide an exact binding.Use one of these fixes:
- Bind the receipt to
PublicationReleaseContent.canonicalBytes()and its digest only. - Build the evidence from a fixed, versioned projection, for example
jsonb_build_object(...), with an explicit column list.
Apply the same change at both the seal site and the read site.
- Accepted Valid retained-receipt regression risk: fullrowJSONchangesonadditivecolumns. Fixedversionedprojection atseal/read/guard mustpreservecurrentimmutablebytes; forwardSQLonly andphysicaladdcolumn/tamperproof.
- Prevent backward movement and deletion of the Draft visibility pointer.Minor
enforce_gd_draft_commit_visibility_pointerchecks only three things:- the named fence exists;
- the digest matches;
- the commit is not
FAILED_NONPUBLICATIONor final-aborted.
An
UPDATEcan therefore movegame_design_draft_commit_visibilityback to an older fence that was alreadySYNCHRONIZED. ADELETEorTRUNCATEof the pointer row is not guarded. The other evidence tables in this migration reject both operations.enforce_gd_authored_draft_publish_selection(V50.2) treats this pointer as the definition of "current". A moved-back pointer makes an older commit selectable for publication. A deleted pointer removes current visibility.Required changes:
- Reject
DELETEandTRUNCATEon the pointer table. - On
UPDATE, require the new commit to be the commit that is now advancing. For example, require that its fence was created in the current transaction, or that its workflow state is stillAPPLYINGorRECONCILIATION_REQUIRED.
Verification needed: confirm where
DraftCommitCoordinatorRepository.advanceVisibilityFenceandadvanceSourceVisibilityFencewrite the pointer, relative to theSYNCHRONIZEDstate change. The state-based check is valid only if the pointer write happens before that state change.- Accepted Validrawvisibilitypointerrewind/delete/truncate notguarded. CanonicalcoordinatorwritesbeforeSYNCHRONIZED; forwardactivewriter/retentionguards +physicalnegativeandvalidretryproof, nooldSQLrewrite.
- CLI Review 5 CompletedRuntime 4m 06sFound: 5 Accepted: 1/3/1 Routed: 0
- Migrate this composed-source proof to the latest schema, not
50.12.MinorThis class is the PostgreSQL proof for the real local source writers (
GameDesignSourceRepository, coordinator SQL, freeze). The fixture stops at50.12, so it does not apply V50.13 or V50.14. V50.14 adds the Draft visibility and realm-policy source insert guards, and those guards act directly on the writers this test covers.RealmPolicySourcePostgresIntegrationTestandRealmPolicyPublicationPostgresIntegrationTestboth migrate to50.14.At
50.12, a writer can pass here and still be rejected in production. For example, it could depend on rewinding the visibility pointer or on inserting a source head without its snapshot epoch. Remove.target(...)or set it to the latest version. If the test fails on the latest schema for a deliberate reason, record that reason in a comment.- .target("50.12")Confirm that the class passes when Flyway migrates to the latest version (no
.target).- Accepted Validlatestguardproofgap: composedGameDesignSourcePG stilltarget50.12 bypasses13/14. Removefixturetarget tolatest, proveactualwriters and newrequiredownerforwardguard physically; historicalretainedfixturesremainlabeled.
- Add explicit deletion to the realm-policy source, or document that deletion is not supported.Major
revisionaccepts exactly one payload shape:revisionKind,logicalRevisionId, andpolicy. That shape is an upsert.effectiveonly appliespolicies.put(selector, policy). No source operation removes an inherited policy.The canonical contract at
api-contracts.mdLine 151 says: "Each typed upsert or explicit deletion names its stable authored key … An omitted row is not a deletion."CommandSourceimplementsDELETEfor commands. The realm-policy source has no equivalent.This has two consequences:
- When an authored policy enters a Draft's effective set, every later snapshot inherits it. The same
Versioncan never remove that policy. draftOrderedenforces tenant/version-widerealmSluguniqueness. Therefore a creator cannot move a realm to anotherworldSlug. The upsert under the new selector collides with the inherited row.
Neither problem is reachable through production ingress today. Both become user-visible when the reviewed-source writer is wired.
Add a closed
DELETEpayload keyed by(worldSlug, realmSlug)torevision/effective. Mirror the command-source rules: deny a delete of an absent selector, and keep revision provenance. Extend the V50.8/V50.12 application guards to match. If deletion is intentionally out of scope for v1, state that in the realm-entry policy owner contract.- Accepted Acceptedcanonicalcapabilitygap: ownerAPIexplicitlyrequiresdeletion butRealmPolicySourceonlyupserts. AddclosedDELETEselector/provenance operation, absentdelete denial, exactreplay+moveproof, preserveexistingcanonicalupserts/retainedbytes; no activation.
- When an authored policy enters a Draft's effective set, every later snapshot inherits it. The same
- Assert the storage guard messages, not only
RuntimeException.TrivialThese PostgreSQL tests claim to prove specific trigger guards. They assert only
RuntimeException, so an unrelated SQL, lock, or fixture error also passes them. Each guard raises a deterministic message, so assert that message.services/game-design-service/src/test/java/integration/net/firedevops/firemud/gamedesign/publication/GameDesignPublicationOperationPostgresIntegrationTest.java#L796-L808: for theepoch,digest, andcontentfields, assert "publication terminal content or committed epoch differs from owner seal". For theterminalfield, assert "publication terminal bytes differ from original owner result". Apply the same change to the loop at Lines 762-789.services/game-design-service/src/test/java/integration/net/firedevops/firemud/gamedesign/draft/RealmPolicySourcePostgresIntegrationTest.java#L566-L574: replace.isInstanceOf(RuntimeException.class)with.hasMessageContaining("realm policy history is immutable").
- Accepted Validproofspecificitygap: genericRuntimeException canmaskunrelatedSQLfailure. Assertactualdeterministicfirstseal/terminalimmutability/historyguard messages, correctreviewersuggestedpostsealedmessageagainstrealtriggerorder.
- Pin the 473-unit / 109-PostgreSQL result to a revision and run.Minor
The new status cites "the primary full source run" and a follow-up 27-case suite. It names no commit SHA, CI run, or job. The same tracker pins every other proof claim to an exact head and run, for example
0c15969…with run38205959330. Without that pin, a reader cannot tell whether a later head still matches this result. The AR-1.5 row at Line 80 repeats the same unpinned totals. Record the source revision and the run or job identifiers for the full run and for the 27-case rerun. Alternatively, state explicitly that the run was local and unpublished.As per coding guidelines: "
implementeddoes not implyproven, and a historical broad test run does not substitute for focused proof."- Accepted Acceptedprooftraceability: pin local unpublished primary473unit109PG +final27PG to sourcepostimages9bf/logtimestamps and actualfreshGDSCIjob115153084495/run38354137185; no broaderworkflow/runtimeclaim.
- Require a non-empty, closed
requiredOwnersarray when a Draft commit binding is inserted.MinorThe insert path checks the identity fields in
binding_json. It does not checkrequiredOwners. Every later guard assumes that the array exists:enforce_gd_draft_commit_visibility_fence(Lines 680-692) runs aLEFT JOINoverjsonb_array_elements_text(... -> 'requiredOwners'). If the key is missing or the array is[], the join returns no rows.NOT EXISTSis then true, so a fence is accepted with noAPPLIEDowner.- The same empty-set result also affects the
SYNCHRONIZEDslot-release check (Lines 779-788) and the selection check in V50.2 (Lines 225-237). enforce_gd_draft_commit_owner_result(Line 582) evaluatesNOT ((NULL) ? NEW.owner). The result isNULL, and theIFtreatsNULLas false. The trigger therefore accepts an owner result outside any bound owner set.
Only
gd_draft_commit_has_exact_terminal_abort_vectorrejects an absent or empty array. A raw insert that passes the Version source proof can therefore produce a "synchronized" commit that no owner applied. These triggers are the storage-level enforcement, so add the check where the binding is first stored.🛡️ Proposed fix
IF NEW.binding_json::jsonb ->> 'canonicalTenantId' IS DISTINCT FROM NEW.canonical_tenant_id::text ... OR NEW.binding_json::jsonb ->> 'schemaVersion' IS DISTINCT FROM '1' THEN RAISE EXCEPTION 'Stored Draft commit JSON differs from its indexed identity' USING ERRCODE = 'check_violation'; END IF; + IF jsonb_typeof(NEW.binding_json::jsonb -> 'requiredOwners') IS DISTINCT FROM 'array' + OR jsonb_array_length(NEW.binding_json::jsonb -> 'requiredOwners') = 0 + OR EXISTS ( + SELECT 1 FROM jsonb_array_elements(NEW.binding_json::jsonb -> 'requiredOwners') o(v) + WHERE jsonb_typeof(o.v) IS DISTINCT FROM 'string' + OR o.v #>> '{}' NOT IN ('WORLD_MANAGEMENT', 'ENTITY_MANAGEMENT', 'GAME_LOGIC', + 'AUTOMATION_SCRIPTING', 'GAME_DESIGN_CONTROL_PLANE')) + OR (SELECT count(DISTINCT o) FROM jsonb_array_elements_text( + NEW.binding_json::jsonb -> 'requiredOwners') o) + <> jsonb_array_length(NEW.binding_json::jsonb -> 'requiredOwners') THEN + RAISE EXCEPTION 'Draft commit binding requires a non-empty distinct required owner set' + USING ERRCODE = 'check_violation'; + END IF;Also change Line 582 so that a
NULLresult fails:IF NOT COALESCE((parent_record.binding_json::jsonb -> 'requiredOwners') ? NEW.owner, FALSE) THEN.- Accepted Validrawstoragezero-owner/nullmembershipgap. ForwardrequiredOwnersINSERTguard nonemptydistinctclosedknownstrings plusownerresultCOALESCEfalse; physicalmalformeddenials/validclaimapplyfenceproof, nooldSQL/historyrewrite.
- Hosted Review 3 CompletedRuntime 11m 11sFound: 8 Accepted: 2/1/4 Routed: 0
- Reject source-less fence advances for Drafts that have source genesis.Major
advanceVisibilityFenceis public. It advances the coordinator pointer without moving the command and realm-policy source heads.advanceSourceVisibilityFenceis the only path that captures both sources.Consider a genesis-enrolled Draft whose fence is advanced through
advanceVisibilityFence, for example for a World-only commit. In that case:game_design_command_source_head.visible_commit_idstaysNULL.- The coordinator fence then names a commit.
CommandSourceRepository.requireVisibleHeadMatchesFencethrowsCOMMAND_SOURCE_VISIBLE_FENCE_CHANGEDfor every later command application.readSynchronizedreturns empty for that commit.- No repair path exists, because the source head can only advance to a snapshot whose fence is current.
The integrity invariant in the contract ("only the exact fully synchronized owner fence advances the effective snapshot") therefore depends on which public method the caller chooses. No V50.x trigger enforces it.
When
GameDesignSourceRepository.readGenesis(target)is present, makeadvanceVisibilityFencerefuse the call. Alternatively, reduce it to package-private and route all callers throughadvanceSourceVisibilityFence. Retained fixtures that need the raw primitive can keep the package-private seam.- Accepted Validpublicrawfencecanbypasssourcecapture. Use explicitreviewalternative: make rawadvanceVisibilityFence packageprivate androuteactualproductionthroughpublicadvanceSourceVisibilityFence; retainedsamepackageseamisnotproductionauthority.
- Map transaction-start failures to
UNAVAILABLEand wrap response encoding.Minorowner.readExactruns inside aTransactionTemplate. If the service cannot get a connection, Spring throwsCannotCreateTransactionException, which is aTransactionException. ATransactionExceptionis not aDataAccessException. The catch at Lines 89-90 therefore does not match it. The failure falls through to Line 99 and returnsINTERNAL. A transient storage outage becomes a non-retryable status for the Account or World caller.RealmPolicyPublicationGrpcServicealready catchesTransactionExceptionand maps it toUNAVAILABLE. The PR objectives also state that transaction failures map toUNAVAILABLE.Line 103 calls
GameDesignPublicationTerminalReadGrpcCodec.toResponseoutside thetry. If encoding throws, the exception escapes the handler and gRPC returnsUNKNOWN. The realm-policy handler wraps its response encoding and returnsFAILED_PRECONDITIONorINTERNAL.🐛 Proposed fix
} catch (org.springframework.dao.DataAccessException - | org.jooq.exception.DataAccessException unavailable) { + | org.jooq.exception.DataAccessException + | org.springframework.transaction.TransactionException unavailable) { fail(observer, Status.UNAVAILABLE, "Publication terminal owner storage unavailable"); return; @@ - observer.onNext(GameDesignPublicationTerminalReadGrpcCodec.toResponse(request, result)); + final ReadGameDesignPublicationTerminalResponse response; + try { + response = GameDesignPublicationTerminalReadGrpcCodec.toResponse(request, result); + } catch (IllegalArgumentException | IllegalStateException inconsistent) { + fail( + observer, + Status.FAILED_PRECONDITION, + "Retained publication terminal evidence unavailable or inconsistent"); + return; + } catch (RuntimeException unexpected) { + fail(observer, Status.INTERNAL, "Publication terminal response encoding failed"); + return; + } + observer.onNext(response); observer.onCompleted();- Accepted Validavailability/encodingerror boundary: includeSpringTransactionException inUNAVAILABLE andmap encodingfailures throughguardedresponse beforeonNext/complete, meaningfulRPCfaultproof.
- Remove the unused full-version digest backfill path.Trivial
PublishAttemptRepository.backfillFullVersionRequestDigestIfAbsenthas no production caller. Remove the repository method, this integration test, and the test-only mock verifications inVersionPublishCommandServiceImplTest.- Accepted Validpre-v1convergence: digestbackfillhasNOproductioncallers, onlytest references confirmedbyfullserviceRG. Removeunusedmethod/test/mockverifications; preserveexactretainedterminalreplayauthorization/checks.
- Enforce the reviewed-base requirement at the source owner, not only in the composing repository.Major
Only
GameDesignSourceRepositorycallsrequireRetained.RealmPolicySourceRepository.apply/applyMutationandCommandSourceRepository.applyare public. They stage source applications for any claimed binding, including an opaquebaseCommitIdsuch as"ISOLATED-explicit-base".RealmPolicySourcePostgresIntegrationTestshows this: it claims throughcoordinator.claimand applies policy source with no reviewed-base row.The V50.8 and V50.10 application triggers do not check
game_design_reviewed_draft_baseeither. The contract says that unknown or contradictory base references "fail before a new application" and that the closedgame-design-draft-base-reference/v1grammar governs the base. At present the database does not enforce either rule.Pick one of these fixes:
- Add an existence check against
game_design_reviewed_draft_base(exact request/commit/digest) to the application insert guards in a forward migration. - Reduce the per-source
applymethods to package-private so thatGameDesignSourceRepositoryis the only entry point, and move the retained-fixture tests to that path.
- Accepted Validbaseauthoritystoragegap: per-sourceapplicationINSERTmustrequire exactretainedreviewedbase forcanonicaltarget/request/commit/digest/binding. ForwardV50.16 only, actualclosedgenesis/authoredclaimReviewed fixturepath; no fakelegacy authority.
- Add an existence check against
- Reuse
replayTerminalAttemptfor the FAILED branch and remove the stale comment.TrivialLines 170-182 duplicate the FAILED branch of
replayTerminalAttempt(Lines 338-349) exactly. That covers the validation, therequireNoPublicationOperationcheck, and the snapshot construction. The comment at Lines 171-172 refers to a "draft-dependent compatibility backfill". This PR removes that backfill. Both copies must currently stay aligned by hand. A future change to one terminal-replay check can therefore miss the mechanics path.♻️ Proposed refactor
--- "a/services/game-design-service/src/main/java/net/firedevops/firemud/gamedesign/service/impl/VersionPublishCommandServiceImpl.java" +++ "b/services/game-design-service/src/main/java/net/firedevops/firemud/gamedesign/service/impl/VersionPublishCommandServiceImpl.java" @@ -164,22 +164,10 @@ requireCanonicalOwnerPublicationCarrier(request); attempt = reserveDraftAttempt(request); } - if (attempt.getStatus() == PublishAttemptStatus.SUCCEEDED) { - return replayTerminalAttempt(request, attempt); - } - if (attempt.getStatus() == PublishAttemptStatus.FAILED) { - // Failed legacy attempts may retain only terminal evidence after their draft was deleted. - // Validate their stable scope before entering the draft-dependent compatibility backfill. - validateTerminalFullVersionAttempt(attempt, request); - if (request.intent() != null) publishAttemptRepository.requireNoPublicationOperation(attempt); - return new PublishWorkflowSnapshot( - attempt.getVersionId() == null ? 0L : attempt.getVersionId(), - attempt.getVersionNumber(), - request.publishWorkflowId(), - "FAILED", - emptyIfNull(attempt.getFailureCode()), - emptyIfNull(attempt.getFailureMessage())); - } + if (attempt.getStatus() == PublishAttemptStatus.SUCCEEDED + || attempt.getStatus() == PublishAttemptStatus.FAILED) { + return replayTerminalAttempt(request, attempt); + } requireSelectedIntent(request); validateFullVersionAttempt(attempt, request); requireCanonicalOwnerPublicationCarrier(request);- Accepted Validsharedterminal-replaydeduplication andobsoletebackfillcomment: existingFAILEDmechanicduplicateshelperexactly. ReusecanonicalreplayTerminalAttempt forbothterminalstatuses, preserveallchecks.
- Override
equals,hashCodeandtoStringforPublishedSet, or replace the record with a class.TrivialPublishedSetis a record with threebyte[]components:operationBytes,captureBytesandterminalEvidenceBytes. The record-generatedequalsandhashCodecompare these arrays by reference, not by content. The record-generatedtoStringprints array identities. As a result, twoPublishedSetvalues built from the same stored evidence are not equal. The tests compare fields one by one, so the problem does not appear today. A laterassertThat(a).isEqualTo(b)or a set/map lookup would fail without a clear reason.The accessors already return clones. Add content-based
equalsandhashCodethat useArrays.equalsandArrays.hashCodefor the three arrays. Alternatively, convertPublishedSetto a final class with explicit accessors.Based on learnings: "avoid converting a class to a record if it holds array-typed fields (e.g., byte[]). Record-generated equals/hashCode/toString use identity-based semantics for arrays".
♻️ Proposed content-based equality
@Override public List<Policy> policies() { return List.copyOf(policies); } + + @Override + public boolean equals(Object other) { + return other instanceof PublishedSet that + && versionNumber == that.versionNumber + && publicationVersionStateEpoch == that.publicationVersionStateEpoch + && policyCount == that.policyCount + && target.equals(that.target) + && sourceCommitId.equals(that.sourceCommitId) + && sourceEpoch.equals(that.sourceEpoch) + && publishedReleaseBundleRef.equals(that.publishedReleaseBundleRef) + && publishedReleaseBundleDigest.equals(that.publishedReleaseBundleDigest) + && publishWorkflowId.equals(that.publishWorkflowId) + && manifestHash.equals(that.manifestHash) + && Arrays.equals(operationBytes, that.operationBytes) + && Arrays.equals(captureBytes, that.captureBytes) + && Arrays.equals(terminalEvidenceBytes, that.terminalEvidenceBytes) + && policySetDigest.equals(that.policySetDigest) + && policies.equals(that.policies); + } + + @Override + public int hashCode() { + return Objects.hash(target, versionNumber, publishWorkflowId, policySetDigest, + Arrays.hashCode(operationBytes), Arrays.hashCode(captureBytes), + Arrays.hashCode(terminalEvidenceBytes), policies); + } + + @Override + public String toString() { + return "PublishedSet[workflow=" + publishWorkflowId + ", policySetDigest=" + + policySetDigest + ", policyCount=" + policyCount + "]"; + }- Accepted Validrecordvalue-semantics defect: bytearraycomponents currentlyuseidentityEquals/hash. Content-awareequals/hash retainingallotherfields/defensiveclones andsamevalue/differentbytes tests; optionaltoStringnotrequired.
- Run the combined-source proof against the current schema (V50.14).Trivial
This fixture migrates only to
50.12. V50.13 (stable release-row receipt evidence) and V50.14 (visibility-pointer advance/delete/truncate guards and non-genesis source-head insert guard) are therefore absent. The combined command/policy flow, the mixed-outcome replay, and the source-backed freeze never run under those guards.The tracker cites this suite as V50.14-era proof for AR-1.5.
RealmPolicySourcePostgresIntegrationTestalready migrates to50.14. Align this fixture with it so that the combined source path is proven against the deployed migration set.Proposed fix
--- "a/services/game-design-service/src/test/java/integration/net/firedevops/firemud/gamedesign/draft/GameDesignSourcePostgresIntegrationTest.java" +++ "b/services/game-design-service/src/test/java/integration/net/firedevops/firemud/gamedesign/draft/GameDesignSourcePostgresIntegrationTest.java" @@ -392,7 +392,7 @@ .placeholders(Map.of("serviceSchema", schema)) .locations("classpath:db/migration") .table("flyway_schema_history_game_design_service") - .target("50.12") + .target("50.14") .load() .migrate(); var write = new TransactionTemplate(new DataSourceTransactionManager(dataSource));- Rejected Duplicate ofalreadyacceptedCLI5f3 latestschemafixtureproofgap, sameGameDesignSourcePG line. Currentfix removesoldtargetandphysicallyqualifieslatestforwardguards; nosecondacceptedcount.
- Use the shared PostgreSQL test image instead of a hard-coded tag.Trivial
Line 119 pins
postgres:16-alpinedirectly. Other PostgreSQL integration tests in this service useTestContainerImages.postgres(), for examplePublishAttemptServiceTransactionIntegrationTest. If the shared image changes, this test still runs on a different PostgreSQL version. Trigger andjsonbbyte-equality proofs in this file depend on server behavior.♻️ Proposed fix
--- "a/services/game-design-service/src/test/java/integration/net/firedevops/firemud/gamedesign/publication/GameDesignPublicationOperationPostgresIntegrationTest.java" +++ "b/services/game-design-service/src/test/java/integration/net/firedevops/firemud/gamedesign/publication/GameDesignPublicationOperationPostgresIntegrationTest.java" @@ -116,7 +116,8 @@ @Testcontainers(disabledWithoutDocker = true) class GameDesignPublicationOperationPostgresIntegrationTest { @Container - static PostgreSQLContainer<?> postgres = new PostgreSQLContainer<>("postgres:16-alpine"); + static PostgreSQLContainer<?> postgres = + new PostgreSQLContainer<>(net.firedevops.firemud.test.TestContainerImages.postgres()); private static final AtomicLong TEST_CERTIFICATE_SERIAL = new AtomicLong(1);- Accepted Validcanonicaltestimagealignment: useexistingTestContainerImages.postgres() insteadhardcodedtag soownerSQL/JSONbyteproof tracksrepositorysupportedimage. NoDocker/resource/environmentsettingchanges.
- Hosted Review 4 CompletedRuntime 11m 46sFound: 5 Accepted: 0/1/2 Routed: 0
- Run the published-policy proof against the latest schema, not V50.14.Trivial
fixturemigrates only to50.14.baselinecreates its policy commit throughcoordinator.claimwithout reviewed-base evidence. Under V50.16,GameDesignSourcePostgresIntegrationTestshows that this sequence fails with "Draft source application requires exact reviewed base evidence". As a result, this suite never tests the publication, sealing and readback path under the V50.15 required-owner guards or the V50.16 reviewed-source guards.Fix:
- Create the baseline through
GameDesignReviewedBaseRepository.resolveandsources.claimReviewed, as thestarthelper in the source suites does. - Remove the
.target("50.14")pin so that the suite migrates to the latest schema.
Also applies to: 497-514
- Rejected Duplicate acceptedCLI6finding4; same latest-schema publication fixture and actual reviewed-base/source-aware setup correction owns the fix, no double accepted count.
- Create the baseline through
- Allow selected-publication retries after lifecycle transitions.Minor
For an intent-bearing request,
replaySucceededAttemptcallsreadPublication. That method returns partial readback unless the current version state is exactlyPUBLISHED. If a succeeded selected publication later moves toACTIVEorRETIRED, reconciliation returnsPENDINGinstead of the storedSUCCEEDEDresult.Separate terminal-replay validation from the readback used to mark an attempt successful. The terminal replay path must accept
PUBLISHED,ACTIVE, andRETIREDwhile preserving the existing bundle, artifact, selected-world, committed-bundle, publication-gate, and recorded-digest checks. Add a selected-publication test that retries after anACTIVEtransition.- Accepted Confirmed selected SUCCEEDED replay uses PUBLISHED-only readPublication and becomes PENDING after ACTIVE/RETIRED. Separate terminal-state acceptance while preserving full bundle/artifact/selection/gate/digest checks; add selected lifecycle replay proof.
- Align the
AR-1.5status row and the immutable-source section with the newer validation record.MinorLine 13 records the 2026-10-13 local runs: 476 unit and 114 physical PostgreSQL cases, then an affected 12-case PostgreSQL run. Line 23 and the
AR-1.5row on Line 84 still cite only the older 473/109 checkpoint at9bf78e2. Both still say that the V50.15 owner-list guard and the exact publication-terminal denial assertions are "pending consolidated proof".If the newer run covers V50.15, mark that proof as complete and cite the newer evidence. If it does not, state in Line 13 that V50.15 remains pending. In both cases, the scan-first row must agree with the narrative.
As per coding guidelines: "Keep its status, implementation record, validation, gaps, decisions, and service-map sections aligned".
Also applies to: 84-84
- Rejected Duplicate acceptedCLI6finding1; same trackerpublication/proof inconsistency is being corrected and qualified under thatsource, no double accepted count.
- Assert the rejection reason for each malformed payload.Trivial
The loop accepts any
IllegalArgumentException. All three payloads share the samerevisionIdand binding helper. If one payload fails for an unrelated reason, the test still passes. For example,DraftCommitBinding.createcan reject the binding, orupsertPayloadvalidation can fail. In that case, the test does not prove the targeted guard: surplus field, unsupportedrevisionKind, or schema version 2. Add.hasMessageContaining(...)with the expected message for each case. Also buildbadoutside the lambda so that construction failures are not counted as parser rejections.- Accepted Confirmed malformed-command assertions accept anyIllegalArgumentException. Keep bindingconstruction outside assertion (already so) and require precise surplusfield/revisionkind/schemaversion rejection messages.
- Use the shared PostgreSQL test image in the new trigger-proof suites.Trivial
Three new suites pin
postgres:16-alpinedirectly.GameDesignPublicationOperationPostgresIntegrationTestandPublishAttemptServiceTransactionIntegrationTestuseTestContainerImages.postgres(). If the shared image changes, these trigger andjsonbproofs run on a different server version.services/game-design-service/src/test/java/integration/net/firedevops/firemud/gamedesign/publication/RealmPolicyPublicationPostgresIntegrationTest.java#L84-L84: replace the literal withTestContainerImages.postgres().services/game-design-service/src/test/java/integration/net/firedevops/firemud/gamedesign/draft/GameDesignSourcePostgresIntegrationTest.java#L45-L45: replace the literal withTestContainerImages.postgres().services/game-design-service/src/test/java/integration/net/firedevops/firemud/gamedesign/draft/RealmPolicySourcePostgresIntegrationTest.java#L54-L54: replace the literal withTestContainerImages.postgres().
📍 Affects 3 files
services/game-design-service/src/test/java/integration/net/firedevops/firemud/gamedesign/publication/RealmPolicyPublicationPostgresIntegrationTest.java#L84-L84(this comment)services/game-design-service/src/test/java/integration/net/firedevops/firemud/gamedesign/draft/GameDesignSourcePostgresIntegrationTest.java#L45-L45services/game-design-service/src/test/java/integration/net/firedevops/firemud/gamedesign/draft/RealmPolicySourcePostgresIntegrationTest.java#L54-L54
- Accepted Confirmed three new PostgreSQL suites retain hardcoded16 tag. Use existing canonical TestContainerImages.postgres() and physically qualify affected suites on shared server version.
- CLI Review 6 CompletedRuntime 3m 28sFound: 4 Accepted: 0/1/1 Routed: 0
- Prove realm-policy publication against the latest schema, not V50.14.Trivial
fixture()stops at migration50.14. Production applies V50.15 (required-owner shape guard) and V50.16 (reviewed-base requirement for every source application). Thebaseline()helper usescoordinator.claimwith the unresolvable base"ISOLATED-initial-source-base"and no reviewed-base evidence. V50.16 would reject that helper. This class therefore proves publication only on a schema that does not exist in production. It cannot detect a regression in which the latest guards block the publication path.Migrate to the latest version. Build the baseline the way
RealmPolicySourcePostgresIntegrationTest.startdoes: resolve the fresh genesis base withGameDesignReviewedBaseRepository.resolve, then callGameDesignSourceRepository.claimReviewed. Then useIsolatedPublicationOwnerSetup.retainSourceBacked(orretainFrozenSourceBacked) inprepare.- Accepted Confirmed positive publication fixture stops50.14 and uses opaque baseline with no reserved reviewed-base evidence. Converge normal latest-schema lifecycle through actual fresh genesis, claimReviewed and source-aware owner capture; preserve retained evidence negatives.
- Make the #3120 checkpoint status consistent across the tracker.Minor
Line 11 calls
9bf78e22f742c3830821c920e70570eb1bc03e2bthe "published #3120 immutable-source proof checkpoint". Line 23 and theAR-1.5row (Line 84) say the proof ran on "locally unpublished postimages". Both statements cite Validation run38354137185, which is a hosted CI run.Line 23 and Line 84 also say that the V50.15 owner-list guard and the terminal-denial assertions are "pending consolidated proof". Line 13 records later local full and affected runs on the combined fixes. A reader cannot tell which statement is current.
Choose one publication status for the checkpoint. State whether the Line 13 runs cover the V50.15 assertions, and update Line 23 and Line 84 to match.
Path instruction: "Review docs for canonical-current-state consistency."
- Accepted Confirmed two residual tracker paragraphs mislabeled hosted9bf evidence locally unpublished and kept V50.15 proof pending after qualified3e812. Correct canonical status and exact run attribution without widening implementation claims.
- Confirm that every caller that creates a new full Draft runs in an explicit
READCOMMITTEDtransaction.MajorConfirm that every caller that creates a new full Draft runs in an explicit `READ_COMMITTED` transaction.
savedeclares@Transactional(isolation = Isolation.READ_COMMITTED)with the defaultREQUIREDpropagation. With no outer transaction, Spring opens a newREAD_COMMITTEDtransaction, so the guard always passes in that case.With an outer transaction, Spring joins it and does not apply the inner isolation. The default setting
validateExistingTransaction=falsekeeps this silent. If the outer transaction usesISOLATION_DEFAULT,TransactionSynchronizationManager.getCurrentTransactionIsolationLevel()returnsnull. The guard then throws"New full Draft creation requires one writable READ_COMMITTED source transaction".Any existing
@Transactionalservice that creates a non-script-onlyDRAFTVersion can therefore fail where it worked before. Possible callers include the demo/test data seeder and game or Version creation services.enrollFreshDraftalso needs thegame_design_realm_policy_version_insertwitness from the same transaction andversion_state_epoch = 1. A caller that does not meet these conditions also fails.Verify the following:
- List every caller of
VersionRepository.savethat passes a new fullDRAFTVersion. - Confirm that each one runs with explicit
READ_COMMITTEDisolation and epoch1. - Update any caller that does not meet both conditions, or document why the change does not reach it.
- Rejected Complete production caller investigation finds no new full-DRAFT save: seeder creates PUBLISHED/epoch1, script patch creates scriptOnly DRAFT, publication updates existing rows. Future default-isolation caller would intentionally deny; no current regression to fix.
- List every caller of
- Run the header-clone rejection checks before the additive release column is added.Minor
Lines 114-121 add
future_optional_evidencetopublished_release_bundle. After that change,to_jsonb(release)::TEXTno longer equals the retainedoperation.release_row_json.guard_published_realm_policy_set(V50.9, line 187) therefore rejects every clone with the sameterminalBindingErrortext, whatever field the clone changes.Line 149 runs
assertRejectedHeaderClonesPreserveOriginalafter the column is added. As a result, theoperation_bytes,terminal_evidence_bytes, andcapture_bytescases pass even if the guard drops the specific field comparison. These cases do not prove what their names state.Move the call so that it runs before the
ALTER TABLE. An unmodified clone then fails at the primary key, not at the guard, so each expected message proves that the guard rejected that specific field.🧪 Proposed reordering
assertThat(originalReleaseEvidence).isEqualTo(originalWholeReleaseRow); + var preAlteration = + fixture.publicationReads().readPublishedSet(fixture.target()).orElseThrow(); + assertRejectedHeaderClonesPreserveOriginal(fixture, preAlteration); fixture.tx( () -> { @@ assertThat(original.publicationVersionStateEpoch()) .isEqualTo(operation.world().request().versionStateEpoch() + 1); - assertRejectedHeaderClonesPreserveOriginal(fixture, original);- Rejected Allegation cites obsolete V50.9 whole-row comparison. Fixture50.14 includes V50.13 replacement guard using publication_release_row_evidence_v1(release), ignoring added columns; other clone fields remain unchanged so guards remain specific after ALTER. Physical current tests pass.
- CLI Review 7 CompletedRuntime 3m 22sFound: 4 Accepted: 0/1/0 Routed: 0
- Confirm that one failed publication should permanently freeze the Draft Version.Major
The primary key
(canonical_tenant_id, canonical_version_id)allows only one selection for each Version. The selection is immutable, and the trigger rejects UPDATE and DELETE. Lines 247-264 reject every latergame_design_draft_commit_application_slotinsert after any selection exists. Other migrations add more permanent constraints:game_design_publication_operationhasUNIQUE (tenant_id, version_id)(V50.6).game_design_realm_policy_capturepermanently freezes the policy source (V50.8).
Here is a likely sequence. A publication reaches
NO_PUBLICATIONafter a gate failure such asRECORDED_CONTENT_DIGEST_MISMATCH. The Version then staysDRAFT. It cannot accept new owner applications to fix the cause, and it cannot be reselected for a new publication. A reservation without an attempt causes the same block, for example when the process crashes betweenreserveand attempt creation. No supported path recovers that Version.Verify that
version-control.mdandapi-contracts.mdexplicitly require "one publication attempt per Draft Version, retry only through a new Version". If they do not, scope the interlock and uniqueness to non-terminal selections. For example, key the interlock on an operation that is stillPENDING, or on an attempt that has not reached a terminal failed state.- Rejected Duplicate CLI1 finding10, OPEN failed-selection-recovery route f88269d02a28928ee09f8414c233d8eb01b000c237d19ef286388eed50ae5485. Version-control records passive retention and recovery gap; fresh/PENDING ingress denied. Preserve immutable evidence; original route remains open.
- Reject a
DELETEof an absent command key.Minorreplaycallseffective.remove(mutation.stableKey())and accepts the mutation when the key is not in the inherited set. The commit then records a digest-bound delete that removes nothing. A mistypedcommandIdis never detected.RealmPolicySource.effectiverejects the same case with "Cannot delete an absent policy selector". The api-contracts document says that omission is never deletion and that every deletion names an exact stable key. Make the command path fail closed in the same way as the realm-policy path.🐛 Proposed fix
if (mutation.operation() == OperationKind.DELETE) { - effective.remove(mutation.stableKey()); + if (effective.remove(mutation.stableKey()) == null) { + throw new IllegalArgumentException("Cannot delete an absent command definition key"); + } } else {- Accepted Valid absent-command DELETE is currently silently accepted. Require an existing effective stable key, aligned with closed explicit source mutation and policy deletion; preserve ordered replay/provenance with negative proof.
- Replace the
!=comparisons of Version row IDs in both genesis readbacks.MajorBoth readbacks compare a jOOQ
LongwithTargetProof.gameDesignVersionRowId()by using!=. If the accessor returns a boxedLong, the comparison checks references. Values from -128 to 127 are cached, so the comparison passes for small IDs and fails for larger IDs. Every Version with a row ID above 127 would then fail genesis readback, and all source apply, capture, and freeze operations would deny. Tests that use small row IDs do not detect this. Check the return type ofTargetProof.gameDesignVersionRowId(). UseObjects.equalsin both places, as other code in this PR already does.services/game-design-service/src/main/java/net/firedevops/firemud/gamedesign/publication/CommandSourceRepository.java#L106-L106: replacerow.get("game_design_version_row_id", Long.class) != target.gameDesignVersionRowId()with!Objects.equals(...).services/game-design-service/src/main/java/net/firedevops/firemud/gamedesign/publication/RealmPolicySourceRepository.java#L80-L80: replacetarget.gameDesignVersionRowId() != row.get("version_id", Long.class)with!Objects.equals(...).
- Rejected False premise: TargetProof.gameDesignVersionRowId is primitive long (record line52). Both Long-versus-long != expressions unbox and compare numeric values, including IDs above127; no reference comparison.
- Confirm that no caller creates a full Draft inside a default-isolation transaction.Major
saveuses@Transactional(isolation = READ_COMMITTED)with defaultREQUIREDpropagation. If a caller already holds a transaction, Spring joins that transaction and does not change its isolation level. If the outer transaction uses the default isolation,getCurrentTransactionIsolationLevel()returnsnull. The new guard then throwsIllegalStateExceptionfor every new fullDRAFTVersion. Candidates include the demo/test data seeder, game-creation services, and any@Transactionalservice method that callsversionRepository.save(newDraft). Before this change, those calls succeeded.Check every caller that creates a non-script-only
DRAFTVersion withid == null. Confirm that each caller runs with no outer transaction or inside aREAD_COMMITTEDtransaction. If the caller set is not closed, usePropagation.REQUIRES_NEWfor new full-Draft inserts. Alternatively, addisolation = READ_COMMITTEDto those callers.- Rejected Duplicate CLI6 finding2. Rechecked all production save callers: both seeder paths create PUBLISHED; VersionServiceImpl creates scriptOnly=true DRAFT; publication updates existing Version. No new full DRAFT default-isolation caller; guard deliberately requires proved creation transaction.
- CLI Review 8 CompletedRuntime 3m 42sFound: 2 Accepted: 0/0/0 Routed: 0
- Use value equality for the genesis readback row-ID checks.Major
Both genesis readback checks compare a Version row ID by using
!=. IfTargetProof.gameDesignVersionRowId()returns a boxedLong, Java compares references, not values. A matching Version row ID above 127 then fails the check, and every new Draft genesis readback and enrollment fails. Tests that use small sequence IDs do not show this failure. Verify the declared return type ofDraftCommitBinding.TargetProof.gameDesignVersionRowId()in common-platform-core. UseObjects.equalsin both places so that the result does not depend on that type.services/game-design-service/src/main/java/net/firedevops/firemud/gamedesign/publication/CommandSourceRepository.java#L106-L106: replacerow.get("game_design_version_row_id", Long.class) != target.gameDesignVersionRowId()with!Objects.equals(row.get("game_design_version_row_id", Long.class), target.gameDesignVersionRowId()).services/game-design-service/src/main/java/net/firedevops/firemud/gamedesign/publication/RealmPolicySourceRepository.java#L79-L81: replacetarget.gameDesignVersionRowId() != row.get("version_id", Long.class)with!Objects.equals(target.gameDesignVersionRowId(), row.get("version_id", Long.class)).
- Rejected Duplicate CLI7 finding3 false premise: TargetProof.gameDesignVersionRowId is primitive long, so both jOOQ Long != long expressions unbox and compare numeric values. IDs above127 do not incur reference inequality.
- Confirm that every caller that creates a new full Draft runs in an explicit
READCOMMITTEDtransaction.MajorConfirm that every caller that creates a new full Draft runs in an explicit `READ_COMMITTED` transaction.
@Transactional(isolation = Isolation.READ_COMMITTED)uses the default propagation,REQUIRED. A call inside an existing transaction joins that transaction, and Spring does not apply the declared isolation level. If the outer transaction usesDEFAULTisolation,TransactionSynchronizationManager.getCurrentTransactionIsolationLevel()returnsnull. In that case, the guard on Lines 235-238 throwsIllegalStateExceptionfor every new non-script-onlyDRAFTinsert. PostgreSQL already defaults to READ COMMITTED, so the guard rejects transactions that are semantically valid. Game creation, the demo seeder, and other owner-local Draft creation paths can fail at runtime if they wrapsavein a plain@Transactionalor a defaultTransactionTemplate.Verify every caller of
VersionRepository.savethat inserts a fullDRAFT. Each caller must either have no outer transaction or declareREAD_COMMITTEDexplicitly. If a caller uses the default isolation, choose one fix: acceptnull(DEFAULT) when the database default is READ COMMITTED, or update those callers.- Rejected Duplicate CLI6 finding2/CLI7 finding4. Verified production callers: seeder creates PUBLISHED, script patch creates scriptOnly DRAFT, publication updates existing Version. No new full DRAFT default-isolation caller; guard intentionally requires explicit READ_COMMITTED owner transaction.
Routed Findings
Route 1 · PR #3120 → PR #3105 OpenMajorSupply independently authorized operation receipts for scoped publication and lifecycle reads
Launch resolution remains fail-closed; PrepareWorldInstance, WMS Draft mutation/version read, Automation activation/work-item release reads lack receiver-verifiable scope. Need exact caller workload+namespace, canonical tenant+version, selected source commit/digest, read purpose, and governing operation/lifecycle from independently authorized owner operation. Preserve terminal reads and separate Account-authorized diagnostics; no invented expiry/revocation.
Outcome: Document producer handoff required by Overseer 7b059d55; Gameplay retains receiver/caller contract and proof ownership. Existing correlation, tenant selectors or workload identity cannot mint read authority.
Route 2 · PR #3120 → Unassigned target OpenMajorA publication selection permanently freezes its Draft with no recovery path.
The selection row is immutable, and this repository never releases it. These are its effects:
reserverejects every later publish request with a differentpublishRequestIdfor the same Version (Lines 66-69).- The V50.2 trigger
reject_gd_draft_application_during_authored_publicationrejects every new application slot for that Version. requireNoPublicationSelectionin the coordinator and the source repositories also blocks owner application.
Consider a selected publication that ends
FAILED, for example onAPPLIED_COMMIT_MISMATCHor a gate failure. The Version staysDRAFT. It cannot accept a corrective commit, and it cannot accept a new publish request. No code creates a successor Draft that copies the source.Confirm the intended recovery after a definitive
FAILED/NO_PUBLICATIONseal. Two options are a release rule tied to the sealedNO_PUBLICATIONoutcome, or a documented successor-Version path. The selected path is not reachable yet, so this is a lifecycle gap for the future, not a current outage.Outcome: Root20e0e42c accepts Major future recovery gap into existing PR-unassigned production-readiness followup. Preserve passive immutable selection; OPEN before enablement/genuine recovery proof. No deletion/unfreeze/clone or fixed/route-closure claim.
Route 3 · PR #3122 → PR #3120 Accepted/FixedMajorVersion lifecycle CAS can assert unsafe states without durable fencing
Outcome: Published5fe03e2f4: changing CAS denied before writes; same-state read-only. VersionServiceImplTest no-save/no-mutation cases passed in44-case focused gate. Secondary stale status fixed; linkCheck/lintMarkdown pass. DB-CAS/activation remain incomplete.
Earlier routing and proof
Earlier decisions
- Accepted Unsafe arbitrary lifecycle writes are already contained in published24e291cc: state changes deny before persistence; same-state remains read-only. Full legal transition/DB epoch-CAS capability is not implemented; stale cross-document status correction still needed.
Unlinked items
Decisions
- Accepted Exact same-namespace mTLS method allowlist exists, but request tenant/version only scope lookup and do not prove caller authority. Need canonical owner evidence under ADR0038; preserve legitimate immutable/retired reads.
- Accepted Confirmed generic internal-service context bypass and missing authorized tenant/scope on state/artifact reads. Exact workload guard and independent tenant evidence required; clarification sent to Overseer; preserve valid terminal reads.