PR #3231 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
- Hosted Review 1 CompletedRuntime 8m 50sFound: 7 Accepted: 2/3/2 Routed: 0
- Use the base-class init/closed state instead of a second copy.Trivial
AbstractReloadingBlockingGrpcClientalready providesinitOnce(closedMessage, unavailableMessage)andrequireInitializedStub(unavailableMessage). Both use synchronizedclosed/explicitlyInitializedstate, and the baseclose()resets that state. This client keeps its ownvolatile initialized/closedflags and overridesclose()only to reset them. Two sets of lifecycle flags can drift apart. For example, the baseexplicitlyInitializedstaysfalsefor this client.♻️ Proposed refactor
- private volatile boolean initialized; - private volatile boolean closed; ... public synchronized void init() throws SSLException, IOException { - if (closed) { - throw new IllegalStateException("Canonical World preparation client is closed"); - } - if (initialized) { - return; - } - initReloadingClient(); - if (stub() == null) { - throw new IllegalStateException("Canonical World preparation client has no gRPC stub"); - } - initialized = true; + initOnce( + "Canonical World preparation client is closed", + "Canonical World preparation client has no gRPC stub"); } ... - @Override - public void close() throws IOException { - synchronized (this) { - closed = true; - initialized = false; - } - super.close(); - } - private ... requireStub() { - var currentStub = stub(); - if (closed || !initialized || currentStub == null) { - throw new IllegalStateException( - "Canonical World preparation client is not initialized and available"); - } - return currentStub; + return requireInitializedStub( + "Canonical World preparation client is not initialized and available"); }Also applies to: 120-138
- Accepted Verified duplicate lifecycle state; use existing base initOnce and requireInitializedStub preserving messages and behavior.
- Remove "digest" from the documented settlement response.Minor
This paragraph says the receiver "returns the retained terminal bytes, digest and settlement time".
SettleOriginalStartSessionWorldParticipationResponsehas no digest field. It carries the schema version, settlement request ID, participation ID/fence,settled_at, andterminal_evidence_canonical_bytes. The proto comment also says the response is "never a digest-only substitute". Name only the fields that the wire contract actually returns.📝 Proposed fix
-... and returns the retained terminal bytes, digest and settlement time. +... and returns the echoed lookup identity, the complete retained canonical terminal bytes and the settlement time.- Accepted Verified response proto has no digest; correct canonical API wording only.
- Remove the wall-clock dependency from the lease liveness assertion.Minor
Lines 647-654 require
original_lease_expires_at > clock_timestamp(). The lease isInstant.now() + 240s, and the test runs a full Flyway upgrade before that check. A slow CI host can push the upgrade past 240 seconds. The assertion then fails for a timing reason and not for a migration-contract reason. The 2^53 test also usesDuration.ofMinutes(5)for issuance, so that test has a similar timing margin. Use a lease margin that clearly exceeds the upgrade time, for example 30 minutes. The other option is to drop the liveness assertion, because the current-read rejection is already the property under test.Proposed fix
--- "a/services/account-service/src/test/java/integration/net/firedevops/firemud/accountservice/service/session/AccountStartSessionWorldParticipationPostgresIntegrationTest.java" +++ "b/services/account-service/src/test/java/integration/net/firedevops/firemud/accountservice/service/session/AccountStartSessionWorldParticipationPostgresIntegrationTest.java" @@ -595,7 +595,7 @@ original.attempt(), UUID.randomUUID(), original.ownerFence()); - Instant lease = Instant.now().truncatedTo(ChronoUnit.MICROS).plusSeconds(240); + Instant lease = Instant.now().truncatedTo(ChronoUnit.MICROS).plus(Duration.ofMinutes(30)); byte[] scalar = predecessorScalarProjection(original.tuple()); var observation = new OriginalStartSessionCurrentAttemptEvidence.Result(request, lease, scalar);- Accepted Verified real wall-clock assertions after full migration; increase two fixture lease margins while preserving assertions.
- Release the client monitor before calling
super.close().Majorclose()issynchronized, andsuper.close()closes theTlsCertificateWatcherwhile this override still holds the monitor.AbstractReloadingBlockingGrpcClient.close()releases its monitor before it drains the watcher, because the watcher callbacksafeReload→reloadChannel()issynchronizedon the same object. If a reload callback is queued, shutdown can deadlock. The callback waits for the monitor, andclose()waits for the callback.The 2026-10-15 entry in
design/project-management/ai-observations.mdrecords this same mechanism in the World terminal completion client. Stack layer 7 fixes the same pattern in two other clients.Also consider dropping the duplicated
initialized/closedflags. The base class already providesinitOnceandrequireInitializedStub.🔒️ Proposed fix
--- "a/services/common-platform-core/src/main/java/net/firedevops/firemud/common/account/startsession/GrpcAccountStartSessionWorldParticipationSettlementClient.java" +++ "b/services/common-platform-core/src/main/java/net/firedevops/firemud/common/account/startsession/GrpcAccountStartSessionWorldParticipationSettlementClient.java" @@ -112,12 +112,14 @@ .withCompression("gzip"); } @Override - public synchronized void close() throws IOException { - closed = true; - initialized = false; - super.close(); + public void close() throws IOException { + synchronized (this) { + closed = true; + initialized = false; + } + super.close(); } private AccountStartSessionWorldParticipationSettlementServiceGrpc .AccountStartSessionWorldParticipationSettlementServiceBlockingStubAdd a queued-callback shutdown test to cover this override, as the observation entry recommends.
- Accepted Verified synchronized override holds monitor through watcher drain; consolidate into existing base lifecycle and prove queued callback shutdown.
- Reuse
sourceReceipt()instead of copying the receipt construction.TrivialLines 806-835 build the same
AuthoredWorldSourceEvidenceandWorldAuthoredSourceIntakeReceiptassourceReceipt()at lines 959-989. If a field mapping changes in only one copy, the two checks stop agreeing.Lines 844 and 845 also repeat the
versionIdentityOperationIdcheck from lines 840-841. Remove the repeated condition.♻️ Proposed refactor
- JsonNode sourceEvidence = requiredSourceEvidence(); - AuthoredWorldSourceEvidence source = - new AuthoredWorldSourceEvidence( - ...); - WorldAuthoredSourceIntakeReceipt receipt = - new WorldAuthoredSourceIntakeReceipt( - ... - source); + JsonNode sourceEvidence = requiredSourceEvidence(); + WorldAuthoredSourceIntakeReceipt receipt = sourceReceipt();- Accepted Verified receipt helper duplicates exact construction and operation guard; reuse helper and remove duplicate condition only.
- Compare the boxed room IDs by value, not by reference.Major
required(..., Long.class)returnsLongobjects. Lines 687-692 compare twoLongobjects with!=, so Java compares references. TheLongcache covers only -128 to 127. If aruntime_room_instance_idvalue is outside that range, the two reads return different objects. The check is then always true, andrequireMappedRoomthrowsInvalidLifecycleEvidenceException.Production room row IDs will soon go past 127. After that, every valid lifecycle read returns
FAILED_PRECONDITION. Fixtures with small IDs hide the defect. PMD reportsCompareObjectsWithEqualson these lines.🐛 Proposed fix
--- "a/services/world-management-service/src/main/java/net/firedevops/firemud/worldmanagement/tenant/WorldCanonicalInstanceLifecycleReadRepository.java" +++ "b/services/world-management-service/src/main/java/net/firedevops/firemud/worldmanagement/tenant/WorldCanonicalInstanceLifecycleReadRepository.java" @@ -684,12 +684,12 @@ || !startLocation .roomTemplateId() .equals(required(selected, "room_template_id", UUID.class)) - || required(selected, "runtime_room_instance_id", Long.class) - != required(selected, "mapped_room_instance_id", Long.class) - || required(selected, "runtime_room_instance_id", Long.class) - != required(selected, "mapped_room_row_id", Long.class) - || required(selected, "runtime_room_instance_id", Long.class) - != required(selected, "actual_room_instance_id", Long.class) + || required(selected, "runtime_room_instance_id", Long.class).longValue() + != required(selected, "mapped_room_instance_id", Long.class).longValue() + || required(selected, "runtime_room_instance_id", Long.class).longValue() + != required(selected, "mapped_room_row_id", Long.class).longValue() + || required(selected, "runtime_room_instance_id", Long.class).longValue() + != required(selected, "actual_room_instance_id", Long.class).longValue() || !startLocation .roomTemplateId() .equals(required(selected, "mapped_template_id", UUID.class))- Accepted Verified three boxed Long reference comparisons; use numeric equality and prove valid room IDs outside cache.
- Preserve retryable statuses from historical owner reads.Minor
The Account and Game Session blocking clients can propagate
StatusRuntimeException. The generic catch maps these failures toINTERNAL. Handle owner RPC statuses first. Preserve retryable codes, includingRESOURCE_EXHAUSTED, asUNAVAILABLE, and retain distinct non-retryable mappings.+import io.grpc.StatusRuntimeException; @@ + } catch (StatusRuntimeException ownerRead) { + failForOwnerRpcFailure(responseObserver, ownerRead); + return; } catch (RuntimeException failure) { @@ + private static void failForOwnerRpcFailure( + StreamObserver<?> responseObserver, StatusRuntimeException ownerFailure) { + switch (Status.fromThrowable(ownerFailure).getCode()) { + case UNAVAILABLE, DEADLINE_EXCEEDED, RESOURCE_EXHAUSTED -> + fail( + responseObserver, + Status.UNAVAILABLE, + "Historical owner evidence is temporarily unavailable"); + case PERMISSION_DENIED, UNAUTHENTICATED -> + fail( + responseObserver, + Status.PERMISSION_DENIED, + "Historical owner denied the authenticated recovery request"); + case INVALID_ARGUMENT -> + fail( + responseObserver, + Status.INVALID_ARGUMENT, + "Historical owner rejected the recovery request"); + case FAILED_PRECONDITION, NOT_FOUND, ALREADY_EXISTS, ABORTED -> + fail( + responseObserver, + Status.FAILED_PRECONDITION, + "Historical owner evidence is unavailable or inconsistent"); + default -> fail(responseObserver, Status.INTERNAL, "Historical owner read failed"); + } + } + private static void fail(StreamObserver<?> responseObserver, Status status, String description) {- Accepted Verified historical clients can propagate gRPC status and generic catch hides retryability; follow existing sibling owner-read mapping.
- Hosted Review 2 CompletedRuntime 9m 16sFound: 5 Accepted: 0/2/3 Routed: 0
- Use the documented entry format for both new AI observations.Minor
Lines 11-16 define the required entry format: a backticked date, a title, then
Context,Observation, andExpected patternsub-bullets. Neither new entry follows it.design/project-management/ai-observations.md#L139-L141: change2026-10-17 —to `2026-10-17:and add aContext` sub-bullet. Confirm that the Pacific/Auckland date is correct, because the date is one day later than the surrounding entries.design/project-management/ai-observations.md#L94-L94: split the single SpotBugs paragraph into a title plusContext,Observation, andExpected patternsub-bullets.
📍 Affects 1 file
design/project-management/ai-observations.md#L139-L141(this comment)design/project-management/ai-observations.md#L94-L94
- Accepted Main verified current source and owning contracts; bounded correction improves status correctness or focused proof/contract consistency. Fix delegated without expansion.
- Assert the refusal cause in the negative composition cases.Trivial
The
MISMATCHED_ATTEMPTandEXPIRED_ATTEMPTcases assert only two things: someStatusRuntimeExceptionoccurs, and rows do not change. Any unrelated failure also satisfies these assertions. Examples are a peer mismatch, a fixture error, a deadline, or an exception inrequireMatches. The test already captures the owner exception inownerRefusal, but it never checks it. Assert the exception type and message for each refusal. Then each test proves that the attempt or lease check is the rejection path.♻️ Proposed assertion
.isInstanceOf(StatusRuntimeException.class); assertThat(result.get()).isNull(); + assertThat(ownerRefusal.get()) + .as("refusal must come from the intended owner check") + .isNotNull() + .satisfies( + denied -> + assertThat(denied.getMessage()) + .contains( + refusal == Refusal.MISMATCHED_ATTEMPT + ? "owner attempt differs" + : /* expected expiry diagnostic */ "expired"));Confirm the exact expiry diagnostic in the Account acquisition path before you finalize the message.
- Accepted Main verified current source and owning contracts; bounded correction improves status correctness or focused proof/contract consistency. Fix delegated without expansion.
- Use the shared tuple size constant instead of
262_144.TrivialWorldCanonicalInstancePreparation.OriginalStartSessionOperationInputchecks the same tuple againstStartSessionPostAuthorizationExecutionTuple.MAX_CANONICAL_TUPLE_BYTES. This codec repeats the limit as a literal. If the shared bound changes, the transport and the World owner stop agreeing on which tuples are valid.♻️ Proposed refactor
--- "a/services/common-platform-core/src/main/java/net/firedevops/firemud/common/world/CanonicalWorldInstancePreparationGrpcCodec.java" +++ "b/services/common-platform-core/src/main/java/net/firedevops/firemud/common/world/CanonicalWorldInstancePreparationGrpcCodec.java" @@ -199,8 +199,9 @@ UUID gameSessionOwnerAttemptId, long gameSessionOwnerFence) { Objects.requireNonNull(originalPostAuthorizationTuple, "originalPostAuthorizationTuple"); if (originalPostAuthorizationTuple.length == 0 - || originalPostAuthorizationTuple.length > 262_144) { + || originalPostAuthorizationTuple.length + > StartSessionPostAuthorizationExecutionTuple.MAX_CANONICAL_TUPLE_BYTES) { throw new IllegalArgumentException("Original StartSession tuple is empty or oversized"); } var decoded =- Accepted Main verified current source and owning contracts; bounded correction improves status correctness or focused proof/contract consistency. Fix delegated without expansion.
- The "noncanonical" wire case does not reach the canonical-bytes comparison.Trivial
The test appends one
0byte to valid request bytes. Protobuf rejects tag 0 as invalid, soparseFromthrowsInvalidProtocolBufferException.fromRequestWireBytesthen reports "malformed". The branch that compareswireByteswithtoRequest(input).toByteArray()never runs. The assertion checks onlyIllegalArgumentException, so the test passes for the wrong reason.Use bytes that parse successfully but are not canonical. One example is a valid field encoded out of order. Then assert the "not canonical" message. Add the same case for
fromResponseWireBytes, which currently has no noncanonical test.♻️ Proposed change
--- "a/services/common-platform-core/src/test/java/net/firedevops/firemud/common/account/startsession/AccountStartSessionWorldParticipationSettlementGrpcCodecTest.java" +++ "b/services/common-platform-core/src/test/java/net/firedevops/firemud/common/account/startsession/AccountStartSessionWorldParticipationSettlementGrpcCodecTest.java" @@ -127,16 +127,19 @@ .isInstanceOf(IllegalArgumentException.class) .hasMessageContaining("canonical non-nil UUID"); - byte[] noncanonicalWire = - java.util.Arrays.copyOf( - AccountStartSessionWorldParticipationSettlementGrpcCodec.toRequest(input).toByteArray(), - request.getSerializedSize() + 1); - noncanonicalWire[noncanonicalWire.length - 1] = 0; + // Re-encode one field ahead of the others so the bytes parse but are not canonical. + var out = new java.io.ByteArrayOutputStream(); + var last = request.toBuilder().clear().addAllSettlementRequestId(request.getSettlementRequestIdList()).build(); + var rest = request.toBuilder().clearSettlementRequestId().build(); + last.writeTo(out); + rest.writeTo(out); + byte[] noncanonicalWire = out.toByteArray(); assertThatThrownBy( () -> AccountStartSessionWorldParticipationSettlementGrpcCodec.fromRequestWireBytes( noncanonicalWire, NAMESPACE)) - .isInstanceOf(IllegalArgumentException.class); + .isInstanceOf(IllegalArgumentException.class) + .hasMessageContaining("not canonical"); } @Test- Accepted Main verified current source and owning contracts; bounded correction improves status correctness or focused proof/contract consistency. Fix delegated without expansion.
- Map retained-evidence failures to
FAILED_PRECONDITION.MinorThe repository uses plain
IllegalStateExceptionfor immutable-binding conflicts and unavailable retained evidence. The receiver maps every such exception toUNAVAILABLE, which misclassifies deterministic evidence failures as transient.Introduce dedicated exception types, or another explicit classifier, for these repository outcomes. Map only those exceptions to
FAILED_PRECONDITION. Keep storage and transaction failures onUNAVAILABLE. Do not catch everyIllegalStateException, because the repository also uses it for transaction-contract failures.- Accepted Main verified current source and owning contracts; bounded correction improves status correctness or focused proof/contract consistency. Fix delegated without expansion.
- Hosted Review 3 CompletedRuntime 10m 01sFound: 3 Accepted: 0/2/1 Routed: 0
- Map translated storage failures to
UNAVAILABLE.MinorGame Session applies the jOOQ convention, which adds Spring Boot's jOOQ starter. Its exception translator can return Spring
DataAccessExceptionsubtypes for connection and lock failures. These exceptions bypass the jOOQ-only catch and reach the genericRuntimeExceptionbranch, which reportsFAILED_PRECONDITIONinstead of allowing a retry.Catch the transient and resource-failure subtypes while preserving
FAILED_PRECONDITIONfor evidence errors.--- "a/services/game-session-service/src/main/java/net/firedevops/firemud/gamesession/service/impl/CanonicalGameInstanceLaunchAssociationReadGrpcService.java" +++ "b/services/game-session-service/src/main/java/net/firedevops/firemud/gamesession/service/impl/CanonicalGameInstanceLaunchAssociationReadGrpcService.java" @@ -121,9 +121,11 @@ original.catalogRevision(), association.launchBindingEvidence()); response = CanonicalGameInstanceLaunchAssociationReadGrpcCodec.toResponse(result); - } catch (DataAccessException unavailable) { + } catch (DataAccessException + | org.springframework.dao.TransientDataAccessException + | org.springframework.dao.DataAccessResourceFailureException unavailable) { observer.onError( Status.UNAVAILABLE .withDescription("Game Session launch owner storage unavailable") .asRuntimeException()); return;- Accepted Spring-translated transient and resource storage errors bypass the jOOQ catch. Preserve retryable UNAVAILABLE while deterministic evidence stays FAILED_PRECONDITION.
- Map retained-evidence conflicts to
FAILED_PRECONDITION, notINTERNAL.MinorrecoverExactTerminalreachesWorldCanonicalInstancePreparationRepository.readExactExecution. That method throwsConflictingPreparationExceptionwhen the retained row differs from the supplied identity. It throwsInvalidPreparationEvidenceExceptionwhen a terminal row is incomplete. Both classes extendIllegalStateException, notIllegalArgumentException. This handler catches onlyIllegalArgumentExceptionat Line 103, so both conflicts fall through to the genericRuntimeExceptionbranch and returnINTERNAL.Account therefore cannot tell a deterministic identity mismatch from an unexpected server fault. A retrying caller can keep resubmitting a request that will never succeed. The sibling
WorldCanonicalInstancePreparationGrpcServicealready mapsIllegalStateExceptiontoFAILED_PRECONDITION.PreparationDeniedExceptionis already caught earlier, at Line 88, so widening this catch does not change denial handling.🐛 Proposed fix
--- "a/services/world-management-service/src/main/java/net/firedevops/firemud/worldmanagement/tenant/WorldStartSessionExecutionTerminalReadGrpcService.java" +++ "b/services/world-management-service/src/main/java/net/firedevops/firemud/worldmanagement/tenant/WorldStartSessionExecutionTerminalReadGrpcService.java" @@ -100,12 +100,12 @@ } catch (StatusRuntimeException ownerFailure) { failForOwnerRpcFailure(responseObserver, ownerFailure); return; - } catch (IllegalArgumentException inconsistent) { + } catch (IllegalArgumentException | IllegalStateException inconsistent) { fail( responseObserver, Status.FAILED_PRECONDITION, "Exact World StartSession terminal owner evidence is inconsistent"); return; } catch (RuntimeException failure) { fail(responseObserver, Status.INTERNAL, "World StartSession terminal recovery failed"); return;- Accepted Retained World conflict and incomplete-terminal exceptions extend IllegalStateException. Preserve deterministic FAILED_PRECONDITION and earlier denial/storage/RPC handling.
- Test each predicate of
hasExactGameSessionBindingthat the comparator enforces.TrivialThe new test changes only
readRequestIdand checks a null result. The comparator also checksplayableStateScope == SHARED,publicProduction, and equality of the launch binding evidence. The descriptor and release attestation are part of that evidence. If any of these clauses is removed, this test still passes. Only the pair-mismatch clause has indirect coverage, throughcommittedLaunchRejectsGameSessionPairThatDiffersFromGameDesignBeforeSourceOrWrite. These fields decide whether the World accepts the Game Session binding. Add negative cases for a non-SHARED scope and forpublicProduction == false.Proposed additional assertions
+ var nonShared = mock(CanonicalGameInstanceLaunchAssociationReadEvidence.Result.class); + when(nonShared.request()).thenReturn(fixture.request()); + when(nonShared.playableStateScope()).thenReturn(RealmEntryPolicy.StateScope.PRIVATE); + when(nonShared.publicProduction()).thenReturn(true); + when(nonShared.launchBindingEvidence()).thenReturn(fixture.evidence()); + assertThat( + WorldCompleteLaunchBindingService.hasExactGameSessionBinding( + fixture.request(), nonShared, fixture.evidence())) + .isFalse(); + var nonPublic = mock(CanonicalGameInstanceLaunchAssociationReadEvidence.Result.class); + when(nonPublic.request()).thenReturn(fixture.request()); + when(nonPublic.playableStateScope()).thenReturn(RealmEntryPolicy.StateScope.SHARED); + when(nonPublic.publicProduction()).thenReturn(false); + when(nonPublic.launchBindingEvidence()).thenReturn(fixture.evidence()); + assertThat( + WorldCompleteLaunchBindingService.hasExactGameSessionBinding( + fixture.request(), nonPublic, fixture.evidence())) + .isFalse();Check the exact name of the non-SHARED
StateScopeconstant before you apply this change. Based on learnings: "check that the test asserts the actual field(s) that determine the resulting identity/authorization outcome."- Accepted Comparator lacks direct rejection proof for ISOLATED and non-public association results; add focused negative cases with matching selector and binding evidence.
- CLI Review 1 CompletedRuntime 3m 07sFound: 8 Accepted: 1/4/1 Routed: 0
- Add a reconsideration trigger, or keep these entries out of the inbox.Minor
The SpotBugs entry (Lines 94-98) and the early-metadata entry (Lines 142-146) do not have a
Reconsideration trigger. The early-metadata entry also says that the report and observer guidance "were corrected", so its immediate issue appears resolved in the same work. The file contract keeps an entry only when "a genuine blocker or deliberate postponement remains, recording the reason and reconsideration trigger."Do one of the following for each entry:
- Add a trigger. For SpotBugs, the trigger could be enabling XML/HTML reports in the canonical SpotBugs task. For observer reporting, the trigger could be an observer or CI guard that classifies pending source selection.
- If no postponement remains, record the lesson in the owning review or workflow record.
Line 143 also repeats the Pacific/Auckland date convention that Line 5 already states. Remove that clause.
As per coding guidelines: "Retain an entry only when a genuine blocker or deliberate postponement remains, recording the reason and reconsideration trigger."
Also applies to: 142-146
- Accepted Add concrete reconsideration triggers to retained SpotBugs and early-metadata entries; remove only the newly authored redundant date clause.
- Reuse
FileBackedGrpcMtlsPolicyinstead of a fourth copy of the file-backed mTLS validator.TrivialCanonicalGameInstanceLaunchAssociationClientalready delegates toFileBackedGrpcMtlsPolicy.require(...). This class copies the plaintext, blank,classpath:, and readable-file checks inline.CanonicalWorldInstancePreparationClientandAccountStartSessionWorldParticipationAcquisitionClientcopy the same checks. The copies already differ in their messages, and they can also differ in their checks. An earlier Common review correction in this repository moved authoring clients to the shared helper for this reason.♻️ Proposed refactor
private static CommonGrpcClientProperties requireFileBackedMtls( CommonGrpcClientProperties tlsProperties) { - if (tlsProperties == null || tlsProperties.isPlaintext()) { - throw new IllegalArgumentException( - "Account World participation settlement requires workload mTLS"); - } - requireReadableFile(tlsProperties.getCertChain(), "certificate chain"); - requireReadableFile(tlsProperties.getPrivateKey(), "private key"); - requireReadableFile(tlsProperties.getCaCert(), "CA certificate"); - return tlsProperties; + return FileBackedGrpcMtlsPolicy.require( + tlsProperties, + "Account World participation settlement", + "Account World participation settlement requires workload mTLS", + "Account World participation settlement requires workload mTLS"); }Apply the same change in
CanonicalWorldInstancePreparationClient. Check the helper's message wording against the existinghasMessageContaining("file-backed")assertions.- Accepted Reuse existing FileBackedGrpcMtlsPolicy in three owned clients, preserving caller messages, file-only credentials and peer checks.
- Avoid reference comparison of boxed world instance IDs.Major
terminal.worldInstanceId()returnsLong.required(row, "world_instance_id", Long.class)andrequired(selected, "world_instance_id", Long.class)also returnLong. Each one is compared withassociation.worldInstanceId()using!=. IfWorldCanonicalInstanceAssociation.worldInstanceId()returnsLong, these are identity comparisons. Every committed preparation with a world instance ID above 127 would then fail withInvalidPreparationEvidenceException. That covers fresh readback, COMMITTED retry and lifecycle-adjacent readback.The cross-service test does not catch this. A fresh schema allocates small
world_instanceIDs, and that test raises only theroom_instancesequence above 127.Confirm the declared return type of
WorldCanonicalInstanceAssociation.worldInstanceId(). Whatever that type is, compare explicitly so the check does not depend on it.🐛 Proposed fix
- if (result.association().worldInstanceId() != terminal.worldInstanceId()) { + if (!Objects.equals(result.association().worldInstanceId(), terminal.worldInstanceId())) {- || association.worldInstanceId() != required(row, "world_instance_id", Long.class)) { + || !Objects.equals( + association.worldInstanceId(), required(row, "world_instance_id", Long.class))) {- || required(selected, "world_instance_id", Long.class) != association.worldInstanceId()) { + || !Objects.equals( + required(selected, "world_instance_id", Long.class), association.worldInstanceId())) {Also applies to: 644-644, 705-705
- Rejected WorldCanonicalInstanceAssociation declares primitive long worldInstanceId. Comparisons unbox retained Long and compare values, so no reference-identity defect; extra boxing via Objects.equals adds no useful correction.
- Merge this entry into the existing selector observation.Major
This entry repeats the lesson of the
2026-10-16entry "Derive focused Gradle selectors from declared Java packages" (Lines 136-140). That entry already says that a categorized source-root segment is not part of the Java package. It also says to verify fresh testcase counts and to archive reports before a filtered rerun. The2026-10-15entry at Lines 76-80 already says that "a successful mixed selector does not prove every required suite ran."The repository rule requires a check for an equivalent entry first. Append a dated recurrence note to the existing entry, for example a second occurrence on #3231. Do not add a parallel entry. A recurrence also supports a CI or tool guard, so add a reconsideration trigger for that guard.
As per coding guidelines: "check for an equivalent existing entry first, record the consequence and unknowns, update the outcome after recovery".
- Accepted Fold only the newly authored duplicate selector lesson into the existing dated observation; preserve facts and add a reconsideration trigger.
- Correct the recorded case count for the association-read adapter.Minor
Line 43 says that R82 ran "eight fresh cases".
CanonicalGameInstanceLaunchAssociationReadGrpcServiceTestdefines 10@Testmethods:- missing peer and wrong workload
- Human context
- malformed and wrong-namespace selectors
- ambient SQL
- current owner success
- missing or null rows
- wrong tuple, status, or identity
- jOOQ unavailable
- transient Spring failure
- Spring resource failure
The tracker is the reader-facing proof record. Either the count is wrong, or R82 predates the two Spring storage-failure cases. If R82 predates them, state that those two cases have no fresh execution attribution. Otherwise, update the count to ten.
- Accepted Current association-read suite has ten cases. Preserve historical R82 attribution and qualify current focused coverage.
- Map deterministic owner SQL refusals to a non-retryable gRPC status.Minor
This catch maps every
org.jooq.exception.DataAccessExceptiontoUNAVAILABLE. That includes owner-guard rejections from the World SQL functions, such as check violations (23514), raised exceptions (P0001), and unique violations (23505). For example, an expired original Game Session lease rejected byworld_begin_canonical_instance_execution_with_original_attemptis a deterministic refusal. Thematerializerecovery path rethrows the original exception when the row is still PENDING, so the caller gets "temporarily unavailable" for a permanent refusal. The caller then retries. Only a later attempt surfacesFAILED_PRECONDITION, through the PENDING conflict.There is a second gap. If the
DSLContextruns with Spring exception translation, non-transient errors become SpringDataIntegrityViolationException. This catch does not handle that type, so those errors fall through toINTERNAL.Check the SQLState of the root cause. Classify SQLState classes
23,P0and40asFAILED_PRECONDITION, or asABORTEDfor serialization failures. Keep connection and timeout classes (08,57,55P03) asUNAVAILABLE. Apply the same classification inWorldStartSessionExecutionTerminalReadGrpcService.Confirm which exception family the production
DSLContextfor this adapter raises: jOOQ or Spring-translated.- Accepted Owner SQL guard/integrity refusals currently become retryable UNAVAILABLE (or translated INTERNAL). Fix narrow deterministic/transaction versus connectivity classification at both World adapters; retain unexpected-error handling and prove exact statuses.
- Verify that the
includepath matches the compiled package ofCanonicalHumanPublicationOwnerTestFixtures.MajorThe jar includes
integration/net/firedevops/firemud/gamesession/repository/CanonicalHumanPublicationOwnerTestFixtures*.class. A class file path follows the declared Java package, not the source directory. Game Session integration tests in this PR declarepackage net.firedevops.firemud.gamesession.repository;, for exampleGameSessionFreshTenantHistoryPostgresIntegrationTest.GameSessionRunOwnedCanonicalLaunchRepositoryPostgresIntegrationTestusesCanonicalHumanPublicationOwnerTestFixtureswithout a qualifier. The new AI observation (Lines 136-140) records the sameintegration.versusnet.mismatch for Gameplay selectors.If the fixture declares
net.firedevops..., the pattern matches nothing.Jarproduces an empty-filtered archive without an error. World'scrossServiceTestthen has no fixture classes, which causes a compile failure or a runtimeNoClassDefFoundError.Check the declared package of the fixture and the jar contents:
unzip -l services/game-session-service/build/libs/*-classes-proof.jar | grep CanonicalHuman. If the package starts withnet., apply this change:- include("integration/net/firedevops/firemud/gamesession/repository/CanonicalHumanPublicationOwnerTestFixtures*.class") + include("net/firedevops/firemud/gamesession/repository/CanonicalHumanPublicationOwnerTestFixtures*.class")- Rejected CanonicalHumanPublicationOwnerTestFixtures explicitly declares package integration.net.firedevops.firemud.gamesession.repository; the integration/ jar include matches its actual class path. Removing it would break the export.
- Reconcile the "seven passing units" claim with the checked-in receiver tests.Minor
The text says that the new receiver and loopback mTLS tests "account for seven passing units". The checked-in sources define nine cases:
AccountStartSessionWorldParticipationSettlementGrpcServiceTest: 5 cases, includingretainedEvidenceConflictAndUnavailableMapToFailedPreconditionandtransactionContractFailureRemainsUnavailable.AccountStartSessionWorldParticipationSettlementGrpcMtlsTest: 4 cases.
If R80 predates the two retained-evidence mapping cases, state that those cases and the
RetainedEvidenceExceptionmapping have no fresh execution attribution. Otherwise, correct the count.- Accepted Current receiver suites contain nine cases. Preserve historical R80 proof attribution, clarify later additions and record fresh current focused coverage.
- Hosted Review 4 CompletedRuntime 11m 38sFound: 5 Accepted: 0/3/0 Routed: 0
- Correct the adapter case count in the tracker.Minor
The tracker says the focused adapter gate passed "eight fresh cases" with a mocked repository.
CanonicalGameInstanceLaunchAssociationReadGrpcServiceTestnow has ten@Testmethods. The two added cases cover the Spring transient storage failure and the Spring resource storage failure. The earlier fix thread also reported 10 passing handler tests.The recorded proof scope is therefore stale. A reader can conclude that the Spring-failure
UNAVAILABLEmapping has no focused proof. Update the count and the run attribution. If the ten-case run used a different gate or revision, cite that run instead of R82.As per coding guidelines: "Keep its status, implementation record, validation, gaps, decisions, and service-map sections aligned when a domain boundary changes."
- Rejected Duplicate of accepted CLI finding5; local3a8 clarifies historical R82 eight versus current ten and fresh55-case qualification includes all ten.
- Stop converting Spring resource-failure storage errors into lifecycle-evidence conflicts.Minor
readMaterializedrethrows only jOOQDataAccessExceptionand SpringTransientDataAccessException. Spring'sDataAccessResourceFailureExceptionis neither type. If a connection fails during one of the selector, room, or lifecycle queries, the genericRuntimeExceptionbranch wraps that exception inInvalidLifecycleEvidenceException.WorldCanonicalInstanceLifecycleReadGrpcServicethen returnsFAILED_PRECONDITION("source evidence is inconsistent") instead ofUNAVAILABLE. A caller cannot tell a temporary outage from corrupt retained evidence and can stop retrying. The same rethrow list appears at line 142. The gRPC service catch at line 79 has the same gap.Add the Spring resource-failure type to all three places.
🩺 Proposed fix
--- "a/services/world-management-service/src/main/java/net/firedevops/firemud/worldmanagement/tenant/WorldCanonicalInstanceLifecycleReadRepository.java" +++ "b/services/world-management-service/src/main/java/net/firedevops/firemud/worldmanagement/tenant/WorldCanonicalInstanceLifecycleReadRepository.java" @@ -230,9 +230,11 @@ operationalRegionAssignments); } catch (InvalidLifecycleEvidenceException invalid) { throw invalid; - } catch (TransientDataAccessException | DataAccessException unavailable) { + } catch (TransientDataAccessException + | org.springframework.dao.DataAccessResourceFailureException + | DataAccessException unavailable) { throw unavailable; } catch (RuntimeException invalid) { throw new InvalidLifecycleEvidenceException( "Retained canonical World lifecycle source evidence is inconsistent", invalid); }Make the same change in
readInCurrentOwnerTransactionand in the gRPC serviceUNAVAILABLEcatch.- Accepted Spring resource failures bypass both lifecycle repository rethrow lists and adapter retry mapping; retain storage exception and return sanitized UNAVAILABLE.
- Map Spring resource-failure storage errors to
UNAVAILABLE.MinorThe handler treats only jOOQ
DataAccessExceptionand SpringTransientDataAccessExceptionas unavailable storage. Spring'sDataAccessResourceFailureExceptionis a non-transient subtype, so it is in neither branch. It is also not anIllegalStateException. A connection failure translated to that type therefore reaches the genericRuntimeExceptionbranch and returnsINTERNAL.WorldCanonicalInstancePreparationRepository.materializecatches the failure for recovery and then rethrows the original exception, so the type stays unchanged. A transaction-start failure raisesCannotCreateTransactionException, which also ends asINTERNAL.The Game Session association reader in this PR already maps
DataAccessResourceFailureExceptiontoUNAVAILABLE. Use the same classification here so that Game Session retries the exact original operation.🩺 Proposed fix
--- "a/services/world-management-service/src/main/java/net/firedevops/firemud/worldmanagement/tenant/WorldCanonicalInstancePreparationGrpcService.java" +++ "b/services/world-management-service/src/main/java/net/firedevops/firemud/worldmanagement/tenant/WorldCanonicalInstancePreparationGrpcService.java" @@ -138,11 +138,14 @@ responseObserver, Status.PERMISSION_DENIED, "Canonical World preparation authority was denied"); - } catch (TransientDataAccessException | DataAccessException unavailable) { + } catch (TransientDataAccessException + | org.springframework.dao.DataAccessResourceFailureException + | org.springframework.transaction.CannotCreateTransactionException + | DataAccessException unavailable) { fail( responseObserver, Status.UNAVAILABLE, "Canonical World preparation storage is temporarily unavailable"); } catch (StatusRuntimeException ownerFailure) { failForOwnerRpcFailure(responseObserver, ownerFailure); } catch (IllegalArgumentException | IllegalStateException inconsistent) {- Accepted Local CLI classifier covers Spring resource DAO but CannotCreateTransactionException remains outside DAO and maps INTERNAL; add narrow retryable handling.
- Update the receiver unit-case count or record the later typed-failure proof.Minor
This paragraph says the new receiver and loopback mTLS tests "account for seven passing units". The current sources have nine cases:
AccountStartSessionWorldParticipationSettlementGrpcServiceTesthas five.AccountStartSessionWorldParticipationSettlementGrpcMtlsTesthas four.
The two extra cases are
retainedEvidenceConflictAndUnavailableMapToFailedPreconditionandtransactionContractFailureRemainsUnavailable. They were added inbb18961ato cover the typedRetainedEvidenceExceptionmapping. If R80 predates that commit, the seven-case figure is correct for R80. In that case, the tracker gives no proof result for the currentFAILED_PRECONDITION/UNAVAILABLEclassification. Either record the later focused run that covers those cases, or state that R80 does not cover them.The tracker README requires trackers to "Keep its status, implementation record, validation, gaps... aligned when a domain boundary changes." The coding guidelines include this requirement.
- Rejected Duplicate of accepted CLI finding4; local3a8 qualifies historical R80 seven separately from current nine, all nine freshly passed in focused gate.
- Check the retained
playableStateScopeagainstSHARED.MinorLine 167 requires
association.playableStateScope()to beSHARED. No check compares the retained identity scope with that value.requireCrossOwnerReadSelectors()at lines 783-790 only compares retainedidentity.playableStateScopewith retainedgameSessionReadEvidence.playableStateScope. Both values come from the same retained input.Suppose the retained input says
"ISOLATED"in both places and Game Session returnsSHARED. In that case the verifier accepts the pair, but the two values differ. Lines 168-169 already requirepublicProductionto be true on both sides. Scope should follow the same pattern so that this recovery verifier fails closed on the full retained identity.🛡️ Proposed fix
|| !RealmEntryPolicy.StateScope.SHARED.equals(association.playableStateScope()) + || !RealmEntryPolicy.StateScope.SHARED + .name() + .equals(text(savedIdentity, "playableStateScope")) || !bool(savedIdentity, "publicProduction") || !association.publicProduction()) {Add a negative case to
WorldCanonicalInstanceOriginalOperationRecoveryVerifierTest. The case keeps a non-SHAREDretained scope while Game Session returnsSHARED.- Accepted Retained identity and GS read scope can agree as non-SHARED while actual association is SHARED; require retained SHARED and prove mismatch denial.
- CLI Review 2 CompletedRuntime 3m 45sFound: 3 Accepted: 0/3/0 Routed: 0
- Return
UNAUTHENTICATEDwhen no peer identity is present.MinorrequireAuthenticatedGameSessionPeerreturnsPERMISSION_DENIEDwhenGrpcPeerIdentity.current()is null. The sibling receivers in this PR returnUNAUTHENTICATEDfor a missing peer andPERMISSION_DENIEDfor a wrong peer. Examples areCanonicalGameInstanceLaunchAssociationReadGrpcServiceandAccountStartSessionWorldParticipationSettlementGrpcService. With this receiver, callers and tests cannot tell a missing mTLS identity from a wrong workload.Proposed fix
private boolean requireAuthenticatedGameSessionPeer(StreamObserver<?> responseObserver) { GrpcPeerIdentity peer = GrpcPeerIdentity.current(); + if (peer == null) { + responseObserver.onError( + Status.UNAUTHENTICATED + .withDescription("Verified Game Session workload required") + .asRuntimeException()); + return false; + } - if (peer != null - && peer.isService("game-session-service") + if (peer.isService("game-session-service") && peer.isInNamespace(trustedNamespace) && !SessionContext.hasAuthenticatedCallerContext()) {- Accepted Accepted: distinguish absent workload identity as UNAUTHENTICATED while preserving PERMISSION_DENIED for present wrong peers/namespace/caller context and no storage access.
- Reject a null
gameSessionOwnerMutationIdbefore the observation branch uses it.MinorThe public 10-argument constructor does not require
gameSessionOwnerMutationId. The 9-argument overload has that check, but the 10-argument constructor does not. If a caller passes a non-nulloriginalAttemptEvidencewith a null mutation ID, Line 139 callsgameSessionOwnerMutationId.equals(...)and throwsNullPointerException. In every other malformed case, the constructor reportsIllegalArgumentException. Callers that classifyIllegalArgumentExceptionas invalid evidence will treat theNullPointerExceptionas an unexpected internal failure.Proposed fix
} else { + if (gameSessionOwnerMutationId == null) { + throw new IllegalArgumentException("Account original-attempt observation is incomplete"); + } var observationRequest = originalAttemptEvidence.request();- Accepted Accepted: complete ten-argument execution identity can dereference null owner mutation UUID with retained observation; reject malformed evidence with IllegalArgumentException, preserve legacy observation-free forms.
- Do not map deterministic SQL failures to
UNAVAILABLE.MinorjOOQ wraps every SQL error in
org.jooq.exception.DataAccessException. WhenfromSqlStatereturnsnull, Line 28 maps that error toUNAVAILABLE. This includes errors that will fail again on every retry:- SQLSTATE class
22, such as invalid input or data that is too long. - SQLSTATE class
42, such as an undefined function or column after a missing or out-of-order migration. - SQLSTATE class
XX, which covers internal database errors.
Both
WorldCanonicalInstancePreparationGrpcServiceandWorldStartSessionExecutionTerminalReadGrpcServicethen returnUNAVAILABLE. Game Session and Account treatUNAVAILABLEas a retryable code, so they retry a failure that does not clear. A schema or input defect then looks like a short outage.Classify these deterministic classes explicitly. Keep
40003and connection-class states asUNAVAILABLE.🐛 Proposed fix
if (sqlState.startsWith("08") || sqlState.startsWith("57") || "55P03".equals(sqlState)) { return Status.Code.UNAVAILABLE; } + if (sqlState.startsWith("22") || sqlState.startsWith("42") || sqlState.startsWith("XX")) { + return Status.Code.INTERNAL; + } return null;Add cases for
22P02and42883to the two storage-failure mapping tests.Also applies to: 34-46
- Accepted Accepted: explicit SQLSTATE22/42/XX defects should map INTERNAL, preserving40003/connection ambiguity as UNAVAILABLE; add both adapter seam cases.
- SQLSTATE class
- Hosted Review 5 CompletedRuntime 12m 52sFound: 6 Accepted: 0/3/3 Routed: 0
- The method count in the original-catalog paragraph is out of date.Minor
Line 31 says that "the other four methods in that class retain their preceding execution attribution."
GameSessionRunOwnedCanonicalLaunchRepositoryPostgresIntegrationTestnow has six@Testmethods:allocatesOneStartingLaunchWithExactPolicyAndIndependentOwnerReadbackretriesCanonicalLaunchAfterAdvisoryWaitWithRepeatableReadDatasourceDefaultoriginalV1003CatalogRetainsPhysicalOwnerRowsWithoutAcquiringMissingPublishedPolicyoriginalV1004LaunchRetainsPhysicalRowsWithoutAcquiringTupleOrCatalogCaptureforwardHumanPolicyGuardPreservesActualV1011HistoryAndRejectsLegacyCatalogReuseforwardHumanPolicyGuardAcceptsCompletePublishedCatalog
Line 37 records that the V1004 case and the V1011 guard case passed freshly in a later run. With that later attribution, "four other methods" is ambiguous. A reader cannot tell which methods still use the earlier run as proof. Name the methods that keep the preceding attribution, or state that line 31 describes the class before the V1004 case was added.
As per coding guidelines: "Keep its status, implementation record, validation, gaps, decisions, and service-map sections aligned when a domain boundary changes."
- Accepted Accepted Minor: original-catalog paragraph has stale relative method count; qualify its historical before-V1004 attribution without crediting later cases to earlier proof.
- Add direct coverage for
UNAVAILABLE.TrivialThe production switch already maps
UNAVAILABLEtoUNAVAILABLE, but this test does not pass that input. Add it to the status table. Keep theABORTEDmapping unchanged; the inspected Game Session path usesABORTEDfor durable admission outcomes, not as a retryable owner RPC status.Suggested test fix
- Map.of( - Status.Code.RESOURCE_EXHAUSTED, - Status.Code.UNAVAILABLE, - Status.Code.DEADLINE_EXCEEDED, - Status.Code.UNAVAILABLE, - Status.Code.PERMISSION_DENIED, - Status.Code.PERMISSION_DENIED, - Status.Code.UNAUTHENTICATED, - Status.Code.PERMISSION_DENIED, - Status.Code.INVALID_ARGUMENT, - Status.Code.INVALID_ARGUMENT, - Status.Code.FAILED_PRECONDITION, - Status.Code.FAILED_PRECONDITION, - Status.Code.NOT_FOUND, - Status.Code.FAILED_PRECONDITION, - Status.Code.ALREADY_EXISTS, - Status.Code.FAILED_PRECONDITION, - Status.Code.ABORTED, - Status.Code.FAILED_PRECONDITION, - Status.Code.UNKNOWN, - Status.Code.INTERNAL) + Map.ofEntries( + Map.entry(Status.Code.UNAVAILABLE, Status.Code.UNAVAILABLE), + Map.entry(Status.Code.RESOURCE_EXHAUSTED, Status.Code.UNAVAILABLE), + Map.entry(Status.Code.DEADLINE_EXCEEDED, Status.Code.UNAVAILABLE), + Map.entry(Status.Code.PERMISSION_DENIED, Status.Code.PERMISSION_DENIED), + Map.entry(Status.Code.UNAUTHENTICATED, Status.Code.PERMISSION_DENIED), + Map.entry(Status.Code.INVALID_ARGUMENT, Status.Code.INVALID_ARGUMENT), + Map.entry(Status.Code.FAILED_PRECONDITION, Status.Code.FAILED_PRECONDITION), + Map.entry(Status.Code.NOT_FOUND, Status.Code.FAILED_PRECONDITION), + Map.entry(Status.Code.ALREADY_EXISTS, Status.Code.FAILED_PRECONDITION), + Map.entry(Status.Code.ABORTED, Status.Code.FAILED_PRECONDITION), + Map.entry(Status.Code.UNKNOWN, Status.Code.INTERNAL))- Accepted Accepted Trivial: directly exercise UNAVAILABLE owner-RPC mapping, retaining all existing mappings including ABORTED unchanged.
- Move the duplicated watcher-shutdown test helpers into shared test fixtures.Trivial
awaitBlockedReloadCallback,hasFrame,awaitCondition,awaitLatch,watcher,setWatcher, andactiveCallbacksare copied verbatim into four test classes:CanonicalGameInstanceLaunchAssociationClientTestAccountStartSessionWorldParticipationAcquisitionClientMtlsTestGrpcAccountStartSessionWorldParticipationSettlementClientTestDraftCommitOrderReadClientTest
The reflective helpers depend on the private field names
AbstractReloadingBlockingGrpcClient.watcherandTlsCertificateWatcher.activeCallbacks, and on the method namereloadChannel. If one of those names changes, all four copies break. Put the helpers in one class in thecommon-platform-coretest fixtures, whichcommon-securityalready consumes. Each client test then keeps only its client-specific assertions.- Accepted Accepted Trivial: duplicated watcher-close reflection/poll helpers have one shared test-fixture owner; preserve per-client assertions and lifecycle behavior.
- Assert the Game Session selector fields that set the historical identity.Trivial
The mock at Lines 1162 returns
result.request()as the same request object that the verifier sent. The checkexpectedRequest.equals(actual.request())therefore always passes. The current assertions cover onlyreadRequestIdinequality, the attempt, and the fence. SupposeRetainedPreparation.gameSessionRequestbuilds its selector from the wrong tenant, game instance, descriptor ID, or digests. This test still passes.Line 224 also asserts a value on the fixture's own
LaunchAssociation. That assertion does not test the verifier.Assert the selector fields against the retained values. Also assert that the Account and Game Session read IDs differ.
♻️ Proposed assertions
verify(gameSession).read(gameSessionRequest.capture()); - assertThat(gameSessionRequest.getValue().associationSelector().readRequestId()) + var selector = gameSessionRequest.getValue().associationSelector(); + assertThat(selector.readRequestId()) .isNotEqualTo(GAME_INSTANCE) .isNotEqualTo(PARTICIPATION_ID) - .isNotEqualTo(ATTEMPT_ID); + .isNotEqualTo(ATTEMPT_ID) + .isNotEqualTo(accountRequest.getValue().readRequestId()); + var binding = fixture.launchAssociation().launchBindingEvidence(); + assertThat(selector.targetNamespace()).isEqualTo(NAMESPACE); + assertThat(selector.canonicalTenantId()).isEqualTo(TENANT); + assertThat(selector.gameInstanceUuid()).isEqualTo(GAME_INSTANCE); + assertThat(selector.controlPlaneRequestId()).isEqualTo("start-session-control-request"); + assertThat(selector.launchDescriptorId()).isEqualTo(binding.descriptor().launchDescriptorId()); + assertThat(selector.expectedDescriptorResultDigest()) + .isEqualTo(binding.descriptor().resultDigest()); + assertThat(selector.expectedReleaseAttestationEvidenceDigest()) + .isEqualTo(binding.releaseAttestation().evidenceDigest()); assertThat(gameSessionRequest.getValue().expectedOwnerAttemptId()).isEqualTo(ATTEMPT_ID); assertThat(gameSessionRequest.getValue().expectedOwnerFence()).isEqualTo(GAME_SESSION_FENCE); - assertThat(fixture.launchAssociation().capturedStartingRowVersion()).isEqualTo(9_999L);Based on learnings: "check that the test asserts the actual field(s) that determine the resulting identity/authorization outcome (not just adjacent metadata or presence/hash checks)".
- Accepted Accepted Trivial: assert captured historical selector identity/digests and independent Account/GS read IDs, replacing fixture-only assertion.
- Validate the assembly selector before you commit the launch binding.Minor
CanonicalGameInstanceLaunchAssociationReadEvidence.Requestaccepts acontrolPlaneRequestIdof up to 256 characters.WorldCanonicalInstancePreparationAssemblyService.Selectoraccepts at most 128 characters.Line 89 calls
bindCommittedLaunch(selector)before Line 91 constructs theSelector. For a request ID of 129 to 256 characters, the call fails as follows:- The request passes
fromRequest. bindCommittedLaunchruns the Game Design and Game Session owner reads.bindCommittedLaunchcommits a durable World launch binding in its owner transaction.- The
Selectorconstructor throwsIllegalArgumentException, and the client getsFAILED_PRECONDITION.
Every retry fails the same way, but the retained binding stays. Construct the
Selectorfirst so that the length check runs before any owner read or write. Separately, align the two bounds on the canonical limit forcontrolPlaneRequestId.🐛 Proposed fix
--- "a/services/world-management-service/src/main/java/net/firedevops/firemud/worldmanagement/tenant/WorldCanonicalInstancePreparationGrpcService.java" +++ "b/services/world-management-service/src/main/java/net/firedevops/firemud/worldmanagement/tenant/WorldCanonicalInstancePreparationGrpcService.java" @@ -85,14 +85,14 @@ return; } try { - WorldCompleteLaunchBindingReceipt bound = launchBindingService.bindCommittedLaunch(selector); WorldCanonicalInstancePreparationAssemblyService.Selector assemblySelector = new WorldCanonicalInstancePreparationAssemblyService.Selector( selector.canonicalTenantId(), selector.gameInstanceUuid(), selector.controlPlaneRequestId()); + WorldCompleteLaunchBindingReceipt bound = launchBindingService.bindCommittedLaunch(selector); Input input = assemblyService.assemble(assemblySelector); requireAssembledInputMatches(selector, bound, input); // This independent read proves only that the exact immutable input was previously retained.- Accepted Accepted Minor: validate assembly selector before any owner binding effects and reuse canonical StartSession request-id validator (128 UTF-8 bytes, exact NFC) in both selectors.
- The request passes
- Preserve invalid World evidence as
FAILED_PRECONDITION.MinorWorldStartSessionExecutionTerminalReadGrpcCodec.fromResponserejects invalid or mismatched terminal evidence withIllegalArgumentException.WorldStartSessionExecutionTerminalReadClient.readwraps that failure inIllegalStateException. The Account receiver then maps it toUNAVAILABLE.The receiver tests classify retained-evidence conflicts as
FAILED_PRECONDITION, while transaction-contractIllegalStateExceptionremainsUNAVAILABLE. Add a dedicated World evidence exception at the client boundary and catch only that type in the receiver.diff --git a/services/common-platform-core/src/main/java/net/firedevops/firemud/common/world/WorldStartSessionExecutionTerminalReadClient.java b/services/common-platform-core/src/main/java/net/firedevops/firemud/common/world/WorldStartSessionExecutionTerminalReadClient.java @@ public final class WorldStartSessionExecutionTerminalReadClient extends AbstractReloadingBlockingGrpcClient< @@ .WorldStartSessionExecutionTerminalReadServiceBlockingStub> { + public static final class InvalidTerminalEvidenceException extends IllegalStateException { + public InvalidTerminalEvidenceException(String message, Throwable cause) { + super(message, cause); + } + } + @@ - throw new IllegalStateException( + throw new InvalidTerminalEvidenceException( "World returned invalid original StartSession terminal evidence", invalid); diff --git a/services/account-service/src/main/java/net/firedevops/firemud/accountservice/service/session/AccountStartSessionWorldParticipationSettlementGrpcService.java b/services/account-service/src/main/java/net/firedevops/firemud/accountservice/service/session/AccountStartSessionWorldParticipationSettlementGrpcService.java @@ import net.firedevops.firemud.common.world.WorldStartSessionExecutionTerminal; +import net.firedevops.firemud.common.world.WorldStartSessionExecutionTerminalReadClient.InvalidTerminalEvidenceException; @@ } catch (RetainedEvidenceException invalidRetainedEvidence) { observer.onError(Status.FAILED_PRECONDITION.asRuntimeException()); + } catch (InvalidTerminalEvidenceException invalidWorldEvidence) { + observer.onError(Status.FAILED_PRECONDITION.asRuntimeException()); } catch (RuntimeException unavailable) { observer.onError(Status.UNAVAILABLE.asRuntimeException()); }- Accepted Accepted Minor: typed invalid World terminal evidence must remain FAILED_PRECONDITION; preserve unrelated client-state/transaction failures as UNAVAILABLE.
- Hosted Review 6 CompletedRuntime 8m 01sFound: 2 Accepted: 1/1/0 Routed: 0
- CodeRabbit summary-only outside-diff finding 1 of 1 (aggregate; no individual detail)Major
summary-only aggregate; provider supplied no individual detail
- Accepted Major: current terminal client synchronized close holds monitor across super.close watcher drain, blocking queued reload. Accept release monitor before drain plus shared-fixture real watcher lifecycle regression; preserve existing init/read contract.
- Map transaction-start failures to
UNAVAILABLE.Minorrepository.read()opens aREQUIRES_NEWtransaction throughTransactionTemplate.execute. Suppose the connection pool or PostgreSQL is unreachable.DataSourceTransactionManager.doBeginthen throwsCannotCreateTransactionException. That exception is aTransactionException. It is neither a SpringDataAccessExceptionsubtype nor a jOOQDataAccessException. It therefore reaches the genericRuntimeExceptionbranch, and the RPC returnsINTERNALfor a transient storage outage.The earlier resolved finding made storage outages retryable
UNAVAILABLE. This path still violates that contract at transaction start. AddCannotCreateTransactionException(orTransactionSystemException/TransactionExceptionas appropriate) to theUNAVAILABLEcatch.🩺 Proposed fix
--- "a/services/world-management-service/src/main/java/net/firedevops/firemud/worldmanagement/tenant/WorldCanonicalInstanceLifecycleReadGrpcService.java" +++ "b/services/world-management-service/src/main/java/net/firedevops/firemud/worldmanagement/tenant/WorldCanonicalInstanceLifecycleReadGrpcService.java" @@ -77,9 +77,10 @@ .withDescription("Canonical World lifecycle source evidence is inconsistent") .asRuntimeException()); return; - } catch (DataAccessResourceFailureException - | TransientDataAccessException - | DataAccessException unavailable) { + } catch (DataAccessResourceFailureException + | TransientDataAccessException + | DataAccessException + | org.springframework.transaction.CannotCreateTransactionException unavailable) { responseObserver.onError( Status.UNAVAILABLE .withDescription("Canonical World lifecycle storage is temporarily unavailable")- Accepted Minor: CannotCreateTransactionException escapes REQUIRES_NEW repository.read into generic INTERNAL; accept narrow sanitized UNAVAILABLE mapping and exact authenticated request regression.
- CLI Review 3 CompletedRuntime 3m 08sFound: 4 Accepted: 0/4/0 Routed: 0
- Confirm that the conflict translation can receive a
DuplicateKeyException.MinorfetchCanonicalPreparationtranslates only SpringDuplicateKeyException. jOOQ throws that type only when theDSLContexthas Spring's exception translator. A plainDSL.using(dataSource, …)throwsorg.jooq.exception.DataAccessExceptionwith SQLState23505. For example, the cross-service test constructs itsDSLContextthat way. In that configuration, the canonical-identity conflict is never changed toConflictingPreparationException. It then reachesrecoverAfterUncertainWriteas a raw storage failure. This repository is not a Spring component, so the caller decides whichDSLContextit receives.Check that the production
DSLContexthas the translator configured. Otherwise, also handle jOOQDataAccessExceptionwith the same SQLState and message check.♻️ Possible change
- } catch (DuplicateKeyException exception) { + } catch (DuplicateKeyException exception) { throw translateCanonicalPreparationConflict(exception); + } catch (org.jooq.exception.DataAccessException exception) { + throw translateCanonicalPreparationConflict(exception); }Widen
translateCanonicalPreparationConflictto acceptRuntimeException.- Accepted Valid: supplied DSLContext can surface raw jOOQ SQLSTATE23505; narrowly preserve existing exact conflict-message predicate across both translator forms.
- Correct the count of receiver cases added after R80.Minor
The paragraph says R80 "predates the two retained-evidence and transaction-failure cases now present in the receiver suite." The visible receiver suite
AccountStartSessionWorldParticipationSettlementGrpcServiceTesthas six cases. The mTLS suite has four cases. R80 attributed seven passing units to these suites, so three cases are later additions:retainedEvidenceConflictAndUnavailableMapToFailedPreconditioninvalidWorldTerminalEvidenceRemainsFailedPreconditiontransactionContractFailureRemainsUnavailable
The
InvalidTerminalEvidenceExceptiontype that the invalid-World-terminal case uses is new in this change. Count that case as post-R80 evidence, or name it explicitly, so that the proof attribution stays exact.📝 Proposed wording
-R80 predates the two retained-evidence and transaction-failure cases now present in the receiver suite, so its historical total does not qualify those later cases. +R80 predates the three retained-evidence, invalid-World-terminal and transaction-failure cases now present in the receiver suite, so its historical total does not qualify those later cases.- Accepted Valid attribution correction: receiver now has six cases versus original three plus four mTLS units. Name three post-R80 receiver cases; historical seven-unit proof remains unchanged.
- Do not report non-transient Spring storage failures as inconsistent lifecycle evidence.Minor
The multi-catch passes through only
DataAccessResourceFailureException,TransientDataAccessException, and jOOQDataAccessException. Spring's jOOQ exception translator can also throw non-transient SpringDataAccessExceptionsubtypes, such asBadSqlGrammarExceptionorDataIntegrityViolationException. The finalcatch (RuntimeException invalid)catches those exceptions and wraps them inInvalidLifecycleEvidenceException. This changes a storage failure into an evidence-inconsistency signal, so callers and the gRPC adapter classify it wrongly.The outer
readInCurrentOwnerTransactionlets the same exceptions propagate unchanged, so the two read boundaries behave differently. Pass through the full SpringDataAccessExceptionhierarchy before the generic wrap.🐛 Proposed fix
} catch (InvalidLifecycleEvidenceException invalid) { throw invalid; - } catch (DataAccessResourceFailureException - | TransientDataAccessException - | DataAccessException unavailable) { + } catch (org.springframework.dao.DataAccessException | DataAccessException unavailable) { throw unavailable; } catch (RuntimeException invalid) {Make the same change at Lines 143-146 so both read boundaries stay consistent.
- Accepted Valid: inner evidence catch wraps nontransient Spring storage failures as inconsistent evidence. Pass through full Spring DataAccessException hierarchy at both boundaries; preserve gRPC SQLState classification.
- Confirm that the 5-second deadline covers the nested owner calls.Minor
prepareappliesCALL_DEADLINE_SECONDS = 5Lto the complete World preparation. According to the World tracker, World performs the following work inside this RPC before it commitsPREPARING:- It acquires Account participation.
AccountStartSessionWorldParticipationAcquisitionClienthas its own 5-second deadline. - It reads the Game Session association.
CanonicalGameInstanceLaunchAssociationClienthas its own 5-second deadline. - It materializes the topology in SQL.
gRPC Java can carry the inbound server deadline into nested calls through
Context. If it does, every nested call shares this single 5-second budget. On a slow but healthy path, the outer call can then returnDEADLINE_EXCEEDEDwhile World continues or commits. The caller then gets an ambiguous outcome and must reconcile it through replay.Verify that World's server handler propagates or forks the inbound
Contextfor its nested clients. If it propagates the deadline, size the outer deadline to cover the nested calls plus materialization. Alternatively, document the reconciliation path that applies afterDEADLINE_EXCEEDED.- Accepted Valid documentation gap: synchronous World handler does not fork inbound Context; five seconds is one bounded RPC, not sum of owner budgets or commit proof. Document ambiguous deadline and existing exact retained recovery; do not invent a larger timeout or automatic retry.
- It acquires Account participation.
- CLI Review 4 CompletedRuntime 2m 40sFound: 3 Accepted: 0/1/1 Routed: 0
- Map transaction-creation failures to
UNAVAILABLE.MinorThe handler maps only jOOQ
DataAccessException,TransientDataAccessException, andDataAccessResourceFailureExceptiontoUNAVAILABLE. Every otherRuntimeExceptionbecomesFAILED_PRECONDITION.The handler rejects ambient transactions, so the repository must start its own transaction. A
DataSourceTransactionManagerwraps a connection failure atdoBegininCannotCreateTransactionException. That type is aTransactionException. It is not aDataAccessException. A database outage at transaction start therefore returnsFAILED_PRECONDITIONwith "Complete exact original StartSession owner evidence is unavailable". The World consumer can then classify a retryable storage outage as deterministic missing evidence.The sibling
WorldCanonicalInstanceLifecycleReadGrpcServicealready includesCannotCreateTransactionExceptionin itsUNAVAILABLEgroup. Add the same type here, and add a unit case next to the two Spring storage-failure cases.Confirm that
CanonicalGameInstanceLaunchAssociationRepository.readOriginalStartSessionAssociationopens its transaction through a SpringPlatformTransactionManagerorTransactionTemplate.🐛 Proposed fix
} catch (DataAccessException | TransientDataAccessException - | DataAccessResourceFailureException unavailable) { + | DataAccessResourceFailureException + | org.springframework.transaction.CannotCreateTransactionException unavailable) {- Rejected Premise disproved: readOriginalStartSessionAssociation requires no ambient transaction and executes one SQL read via supplied DSLContext; repository has no PlatformTransactionManager/TransactionTemplate or doBegin path. Existing Spring resource/translator storage failures are already caught.
- Return
UNAUTHENTICATEDwhen the verified peer identity is missing.MinorIf
GrpcPeerIdentity.current()returnsnull, this adapter returnsPERMISSION_DENIED. The sibling owner adapters returnUNAUTHENTICATEDin this case:WorldStartSessionExecutionTerminalReadGrpcService.requireAuthenticatedAccountPeer(Lines 137-143).WorldCanonicalInstanceLifecycleReadGrpcService, as asserted byrejectsMissingPeerIdentityAsUnauthenticatedBeforeStorageAccess.
A Game Session caller that classifies failures by status code cannot tell a missing mTLS identity from a wrong workload on this RPC. Use one status-code contract across the three adapters. Keep
PERMISSION_DENIEDfor a wrong service, a wrong namespace, or an end-user context. Also updateWorldCanonicalInstancePreparationGrpcServiceTestLine 95.Proposed fix
private boolean requireAuthenticatedGameSessionPeer(StreamObserver<?> responseObserver) { GrpcPeerIdentity peer = GrpcPeerIdentity.current(); - if (peer != null - && peer.isService("game-session-service") + if (peer == null) { + fail( + responseObserver, + Status.UNAUTHENTICATED, + "Verified same-namespace Game Session workload identity is required"); + return false; + } + if (peer.isService("game-session-service") && peer.isInNamespace(trustedNamespace) && !SessionContext.hasAuthenticatedCallerContext()) { return true; }- Accepted Valid canonical authentication alignment: absent verified workload identity must be UNAUTHENTICATED before reads; wrong service/namespace and end-user context remain PERMISSION_DENIED.
- Share the original-selector and mapped-room checks with the preparation repository.Trivial
requireOriginalSelector(Lines 620-651) repeats the SQL and byte comparisons inWorldCanonicalInstancePreparationRepository.requireExactOriginalSelector(Lines 756-789 of that file). The ROOM-mapping reads have already diverged:- Lifecycle read (`requireMappedRoom`, Lines 653-716):
- It compares the room and region tenant keys with
association.worldPrepareFields().privateTenantKey(). - It checks
region_instancetenant, game instance, andworld_instance_id. - It checks
mapped_room_row_idandmapped_template_id. - Preparation readback (`readOwnerPreparation`, Lines 667-708 of the repository):
- It compares the room tenant key with
input.versionIdentity().sourceIntakeReceipt().localTenantKey(). - It does not join or check
region_instance.
The two readers therefore accept different sets of rows as "the exact mapped scoped World runtime room". Extract one package-private helper for the selector receipt and the scoped ROOM mapping, and call it from both repositories. Then any later fix to the scope rules applies to both readers.
- Accepted Valid useful consolidation with correctness effect: preparation readback omits retained ROOM region/world and mapped-row/template checks enforced by lifecycle reader. Share exact selector and scoped ROOM validation, preserve each caller typed invalid-evidence classification and fail-closed scope.
- CLI Review 5 CompletedRuntime 2m 35sFound: 3 Accepted: 1/1/1 Routed: 0
- Scope both sides of the REGION
FULL OUTER JOINbefore the join.MajorThe query joins the complete
world_canonical_instance_topology_identityandregion_instancetables. All instance-scope predicates are in the outerWHEREclause. TheWHEREpredicates reference both nullable sides of aFULL OUTER JOIN. PostgreSQL therefore cannot apply them before the join.Each lifecycle read can join the complete REGION mapping set and the complete
region_instancetable across all instances, and only filters them afterward. The cost of each read grows with the total number of instances, not with the instance being read. Every successfulPrepareCanonicalWorldInstanceperforms this read, and so does every external lifecycle read.Filter each side in a subquery before the join. The rejection behavior stays the same:
- If a foreign mapping points to an in-scope region, that region appears without a mapping. The
mapping_id == nullcheck rejects it. - If an in-scope mapping points to a foreign region, that mapping appears without a region row. The
region_row_id == nullcheck rejects it. - The row-count check and the coverage check do not change.
⚡ Proposed scoped join
- + "FROM world_canonical_instance_topology_identity m FULL OUTER JOIN region_instance ri " - + "ON m.family='REGION' AND m.runtime_row_id=ri.id " - + "WHERE (m.world_instance_id=? AND m.family='REGION') OR ri.world_instance_id=? " - + "OR (ri.tenant_id=? AND ri.game_instance_id=?)", + + "FROM (SELECT * FROM world_canonical_instance_topology_identity " + + "WHERE world_instance_id=? AND family='REGION') m " + + "FULL OUTER JOIN (SELECT * FROM region_instance " + + "WHERE world_instance_id=? OR (tenant_id=? AND game_instance_id=?)) ri " + + "ON m.runtime_row_id=ri.id",Run
EXPLAINagainst a populated schema. Confirm that both sides use their scoped indexes.- Accepted Valid scoped-query improvement: restrict mapping and region inputs before FULL OUTER JOIN while preserving unmatched-row, scope/count and coverage rejection. Verify actual PostgreSQL query/EXPLAIN with focused proof before making planner-performance claims.
- If a foreign mapping points to an in-scope region, that region appears without a mapping. The
- Add a reconsideration trigger to the review-allocation provenance entry.Minor
The other retained entries in this file record a
Reconsideration trigger. This entry ends afterExpected patternand has no trigger. The applicable rule requires a retained entry to record "the reason and reconsideration trigger." Without a trigger, a later health check cannot tell when to remove this tooling suggestion.📝 Proposed addition
- Expected pattern: expose the controlling grant decision, timestamp, actor, original reason and baseline beside its additional-result count through an existing read-only controller command, so a worker can distinguish lifetime history from the current allowance without guessing. This is a tooling suggestion; existing counting and authorization rules stay unchanged. + - Reconsideration trigger: when a read-only controller command reports the controlling grant decision and baseline beside the remaining allowance, qualify it against a PR with separate lifetime and current allowances and revisit this manual readback step.As per coding guidelines: "Retain only genuine blockers or deliberate postponements with their reason and reconsideration trigger."
- Accepted Valid retained-observation hygiene: add the concrete reconsideration trigger for allocation provenance so later stewardship can verify and retire it; no new process requirement or controller implementation.
- Read the keytool output before waiting for the process to exit.Trivial
This
runKeytoolcallsprocess.waitFor(30, TimeUnit.SECONDS)before it reads stdout. If keytool writes more output than the pipe buffer holds, the process blocks on the write. The test then times out with "keytool timed out", and the diagnostic output is lost. The other PKI helpers in this PR read the stream first and then wait. Use the same order here.🐛 Proposed fix
Process process = new ProcessBuilder(command).redirectErrorStream(true).start(); - if (!process.waitFor(30, TimeUnit.SECONDS)) { - process.destroyForcibly(); - throw new IllegalStateException("keytool timed out"); - } String output; try (var stream = process.getInputStream()) { output = new String(stream.readAllBytes(), StandardCharsets.UTF_8); } - if (process.exitValue() != 0) { + if (!process.waitFor(30, TimeUnit.SECONDS) || process.exitValue() != 0) { + process.destroyForcibly(); throw new IllegalStateException("keytool failed: " + output); }- Accepted Valid bounded fixture issue: waiting before draining can fill keytool pipe. Preserve the real timeout by redirecting merged output to an owned temporary file (or bounded concurrent drain), then read diagnostics after exit/termination; do not adopt blocking readAllBytes before timed wait.
- CLI Review 6 CompletedRuntime 2m 46sFound: 2 Accepted: 0/0/0 Routed: 0
- Check that the
classes-proofinclude pattern matches the fixture's declared Java package.MinorThe include pattern requires the class file under
integration/net/firedevops/firemud/gamesession/repository/. Class output paths follow the declared Java package, not the source-root folder. In the sameintegration/source root,GameSessionFreshTenantHistoryPostgresIntegrationTestdeclarespackage net.firedevops.firemud.gamesession.repository;, without anintegration.prefix.GameSessionRunOwnedCanonicalLaunchRepositoryPostgresIntegrationTestusesCanonicalHumanPublicationOwnerTestFixtureswithout an import, so the fixture shares that test's package.- If the fixture declares
net.firedevops.firemud.gamesession.repository, the pattern matches no file. - In that case, the jar has no fixture class.
- World
crossServiceTestImplementationcode that uses the fixture then fails to compile.
The repository's AI observations log a related selector mistake caused by the same assumption.
Confirm the
packageline ofCanonicalHumanPublicationOwnerTestFixtures.java. Then confirm the class is in the jar, for example withjar tf build/libs/*-classes-proof.jar | grep CanonicalHumanPublicationOwnerTestFixtures. If the class is missing, use a pattern that matches either layout:Proposed pattern correction
from(sourceSets["integrationTest"].output.classesDirs) { - include("integration/net/firedevops/firemud/gamesession/repository/CanonicalHumanPublicationOwnerTestFixtures*.class") + include("**/net/firedevops/firemud/gamesession/repository/CanonicalHumanPublicationOwnerTestFixtures*.class") }- Rejected Actual fixture declares package integration.net.firedevops.firemud.gamesession.repository, matching the include exactly. Main verified the real classes-proof jar contains its class and nested classes; the physical World compilation/proof passed.
- If the fixture declares
- Require the exact SPIFFE URI before the binding write and the owner reads.Minor
requireAuthenticatedGameSessionPeerchecks onlyisService("game-session-service")andisInNamespace(trustedNamespace). Two other entry points also check the exact URIspiffe://firemud/ns/<ns>/sa/<service>:WorldStartSessionAccountParticipationVerifier.requireAuthenticatedGameSessionPeerandWorldStartSessionExecutionTerminalReadGrpcService.requireAuthenticatedAccountPeer.In this adapter, the stricter verifier runs only after these calls:
launchBindingService.bindCommittedLaunch(selector), which can callacceptFreshand write a launch binding.assemblyService.assemble(...), which performs Game Design and Game Session reads.
Assume
GrpcPeerIdentityderives service and namespace without enforcing thefiremudtrust domain. Then a peer from another trust domain with the same namespace/service path passes this guard. That peer can trigger the owner write and the remote reads before the verifier refuses it. Confirm whetherGrpcPeerIdentityalready enforces the trust domain. If it does not, apply the same exact-URI check here.🔒️ Proposed alignment
if (peer.isService("game-session-service") && peer.isInNamespace(trustedNamespace) + && ("spiffe://firemud/ns/" + trustedNamespace + "/sa/game-session-service") + .equals(peer.uri()) && !SessionContext.hasAuthenticatedCallerContext()) { return true; }- Rejected GrpcPeerIdentity constructor and parseUri already enforce anchored spiffe://firemud/ns/<namespace>/sa/<service>, matching fields, canonical URI and allowed service. Exact service+namespace therefore enforces the expected URI; a foreign trust domain cannot construct this identity.
- Hosted Review 7 CompletedRuntime 16m 47sFound: 2 Accepted: 0/2/0 Routed: 0
- Classify SQLSTATE-bearing lifecycle storage failures with the shared classifier.Minor
WorldCanonicalInstanceLifecycleReadRepository.readrethrows jOOQ and Spring data-access exceptions. The gRPC adapter currently maps all jOOQDataAccessExceptioninstances toUNAVAILABLE, including deterministic SQLSTATE failures. Route these exceptions throughWorldPreparationStorageFailureStatus.from(...).Non-transient Spring
DataAccessExceptionsubtypes also reach the genericINTERNALbranch. Include them in the classifier catch.The classifier does not change a
TooManyRowsExceptionthat has noSQLExceptioncause. Its jOOQ type fallback still returnsUNAVAILABLE, so add a separate lifecycle case and mapping if that failure must be non-retryable.--- "a/services/world-management-service/src/main/java/net/firedevops/firemud/worldmanagement/tenant/WorldCanonicalInstanceLifecycleReadGrpcService.java" +++ "b/services/world-management-service/src/main/java/net/firedevops/firemud/worldmanagement/tenant/WorldCanonicalInstanceLifecycleReadGrpcService.java" @@ -78,16 +78,19 @@ .withDescription("Canonical World lifecycle source evidence is inconsistent") .asRuntimeException()); return; - } catch (DataAccessResourceFailureException - | TransientDataAccessException - | DataAccessException - | CannotCreateTransactionException unavailable) { + } catch (CannotCreateTransactionException unavailable) { responseObserver.onError( Status.UNAVAILABLE .withDescription("Canonical World lifecycle storage is temporarily unavailable") .asRuntimeException()); return; + } catch (DataAccessException | org.springframework.dao.DataAccessException storageFailure) { + responseObserver.onError( + Status.fromCode(WorldPreparationStorageFailureStatus.from(storageFailure)) + .withDescription("Canonical World lifecycle storage operation failed") + .asRuntimeException()); + return; } catch (RuntimeException failure) { responseObserver.onError( Status.INTERNAL .withDescription("Canonical World lifecycle read failed")Add lifecycle RPC cases for one deterministic SQLSTATE and one serialization SQLSTATE.
- Accepted Verified lifecycle forwards jOOQ and Spring storage failures but adapter loses deterministic SQLSTATE classification. Reuse existing classifier; preserve transaction-start UNAVAILABLE and make TooManyRows nonretryable.
- Make the keytool timeout effective.Minor
runKeytoolcallsstream.readAllBytes()beforeprocess.waitFor(30, TimeUnit.SECONDS).readAllBytes()blocks until keytool closes its output. If keytool hangs, the read never returns and the 30-second timeout never runs. The test JVM then blocks without a bound.The sibling
HistoricalOriginalStartSessionOwnerEvidenceReadGrpcMtlsTest.runKeytoolsends output to a file, waits with the timeout, and force-stops the process. Use the same pattern here. You can also move that helper into shared test support.🐛 Proposed fix
- Process process = new ProcessBuilder(command).redirectErrorStream(true).start(); - String output; - try (var stream = process.getInputStream()) { - output = new String(stream.readAllBytes(), StandardCharsets.UTF_8); - } - if (!process.waitFor(30, TimeUnit.SECONDS) || process.exitValue() != 0) { - process.destroyForcibly(); - throw new IllegalStateException("keytool failed: " + output); - } + Path outputFile = Files.createTempFile(tempDirectory, "keytool-", ".log"); + Process process = + new ProcessBuilder(command) + .redirectErrorStream(true) + .redirectOutput(outputFile.toFile()) + .start(); + try { + if (!process.waitFor(30, TimeUnit.SECONDS)) { + process.destroyForcibly(); + process.waitFor(5, TimeUnit.SECONDS); + throw new IllegalStateException( + "keytool timed out: " + Files.readString(outputFile, StandardCharsets.UTF_8)); + } + if (process.exitValue() != 0) { + throw new IllegalStateException( + "keytool failed: " + Files.readString(outputFile, StandardCharsets.UTF_8)); + } + } finally { + if (process.isAlive()) process.destroyForcibly(); + Files.deleteIfExists(outputFile); + }- Accepted Verified Common fixture blocks on pipe output before its timed wait. Use bounded file-backed capture, retain30s timeout, bounded force-stop cleanup and interruption semantics.
- Hosted Review 8 CompletedRuntime 10m 45sFound: 1 Accepted: 0/1/0 Routed: 0
- Map transaction-start failures to
UNAVAILABLEin the terminal read adapter.MinorreadExactExecutionstarts a new Spring transaction throughreadTransaction.execute(...). ACannotCreateTransactionExceptioncan bypass the storage-failure catch and reach the genericRuntimeExceptionbranch, which returnsINTERNAL. Map this retryable transaction-start failure toUNAVAILABLE, and add a focused test.🩺 Proposed fix
+import org.springframework.transaction.CannotCreateTransactionException; @@ } catch (WorldCanonicalInstancePreparationService.PreparationDeniedException denied) { fail( responseObserver, Status.FAILED_PRECONDITION, "The exact original World StartSession operation is not authenticated for recovery"); return; + } catch (CannotCreateTransactionException transactionFailure) { + fail( + responseObserver, + Status.UNAVAILABLE, + "World StartSession terminal storage is temporarily unavailable"); + return; } catch (DataAccessException | org.springframework.dao.DataAccessException storageFailure) {- Accepted Verified recoverExactTerminal propagates readTransaction start failure; CannotCreateTransactionException bypasses DAOcatch and genericbranch returnsINTERNAL. CatchsanitizedUNAVAILABLE and focusedtest, no auth/evidence change.
Routed Findings
No routes recorded
Unlinked items
no items unlinked