PR #3237 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 14m 37sFound: 9 Accepted: 0/7/2 Routed: 0
- Do not hold the client monitor across
super.close().MinorThis client has the same
synchronized close()defect asGrpcAccountStartSessionActivationProtectionAcquisitionClient. Updateclosedandinitializedinside asynchronized (this)block. Then callsuper.close()without the monitor, so watcher callbacks can drain.- Accepted Accepted same bounded watcher-drain/client-monitor contention in protected activation client; preserve lifecycle flags and release monitor before superclass close.
- Read
selector.originalOperation()once.TrivialLines 822-832 call
selector.originalOperation()and null-check it five times to build one parameter list. Store the operation in a local variable. This makes the shared null branch explicit and shortens the parameter list.♻️ Proposed refactor
- private Record findOriginalStartSessionAssociation( - ...Request selector) { - return dsl.fetchOne( + private Record findOriginalStartSessionAssociation( + ...Request selector) { + var operation = selector.originalOperation(); + byte[] tuple = operation == null ? null : operation.originalPostAuthorizationTuple(); + return dsl.fetchOne( ... selector.gameInstanceUuid(), - selector.originalOperation() == null - ? null - : selector.originalOperation().originalPostAuthorizationTuple(), - selector.originalOperation() == null - ? null - : selector.originalOperation().originalPostAuthorizationTuple(), - selector.originalOperation() == null - ? null - : selector.originalOperation().ownerMutationId(), - selector.originalOperation() == null ? null : selector.originalOperation().ownerAttemptId(), - selector.originalOperation() == null ? null : selector.originalOperation().ownerFence()); + tuple, + tuple, + operation == null ? null : operation.ownerMutationId(), + operation == null ? null : operation.ownerAttemptId(), + operation == null ? null : operation.ownerFence());- Accepted Accepted useful single operation/tuple snapshot removes repeated accessor/null paths without changing SQL predicates, parameter ordering or selector semantics.
- Do not hold the client monitor across
super.close().MinorThis client has the same
synchronized close()defect asGrpcAccountStartSessionActivationProtectionAcquisitionClient. A queued certificate-reload callback can wait for the monitor thatclose()holds while the base watcher shutdown drains callbacks. Update the flags inside asynchronized (this)block and callsuper.close()outside it.- Accepted Accepted same bounded watcher-drain/client-monitor contention in terminal reader; preserve lifecycle flags and release monitor before superclass close.
- Release the client monitor before closing the certificate watcher.Minor
super.close()releases its internal lock before it callsTlsCertificateWatcher.close(), but this override keeps the client monitor held across that call. An active reload callback can then wait forreloadChannel(), while the watcher waits for that callback. The watcher uses bounded waits, soclose()can stall through the shutdown grace period rather than hang indefinitely. A queued callback that has not started is skipped after shutdown begins; test an active callback instead.--- "a/services/common-platform-core/src/main/java/net/firedevops/firemud/common/account/startsession/GrpcAccountStartSessionActivationProtectionAcquisitionClient.java" +++ "b/services/common-platform-core/src/main/java/net/firedevops/firemud/common/account/startsession/GrpcAccountStartSessionActivationProtectionAcquisitionClient.java" @@ -109,12 +109,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 AccountStartSessionActivationProtectionAcquisitionServiceGrpc .AccountStartSessionActivationProtectionAcquisitionServiceBlockingStubApply the same change to the other activation-protection and terminal clients with this close pattern. Add a shutdown test with an active reload callback contending for the client monitor.
- Accepted Accepted monitor held across watcher drain can stall active reload callback; narrow synchronized flags and close outside monitor, prove active contention.
- Add the receiving source commit for the focused proof.Minor
The Player Access anchor resolves, and the World
Capability Statustable already records the relatedGR-2.1capability as partial. However, this section reports four fresh composed cases and 578 fresh World units without naming the source commit that produced them. Add that receiving commit so the focused proof remains traceable.- Accepted Accepted missing receiving source attribution for the named four composed and578unit proof; retain scope/limits and establish exact existing source.
- Keep the terminal-read contract consistent with the gRPC error path.Minor
When World has no terminal receipt,
WorldOriginalStartSessionActivationTerminalReadGrpcServicereturnsFAILED_PRECONDITION.GrpcWorldOriginalStartSessionActivationTerminalReadClientlets thatStatusRuntimeExceptionescape, so the settlement service does not reach itsnullbranch. The settlement receiver forwards the status unchanged. The status code, status-based retryability, and transaction state do not change; only the error description differs.The interface contract is still inconsistent with the implementation. Remove the
nullwording and unreachable branch, or introduce a dedicated missing-terminal status and map only that status tonull. Do not map everyFAILED_PRECONDITION, because World also uses it for terminal mismatches.Suggested contract cleanup
- /** Returns the exact first World receipt, or {@code null} when World has no terminal receipt. */ + /** Returns the exact first World receipt. */ WorldOriginalStartSessionActivationTerminalEvidence read( WorldOriginalStartSessionActivationTerminalReadInput input);- if (terminal == null) { - throw failedPrecondition( - "World activation remains unresolved without an exact terminal receipt"); - } if (!Arrays.equals( lookup.protection().evidence().canonicalBytes(), terminal.accountProtectionEvidence().canonicalBytes())) {- Accepted Accepted null-return interface promise contradicts actual gRPC absence refusal. Document exact receipt-or-status; retain defensive null refusal for invalid alternate implementations without mapping broad precondition statuses.
- Do not hold the client monitor across
super.close().MinorThis client has the same
synchronized close()defect asGrpcAccountStartSessionActivationProtectionAcquisitionClient. While it holds the monitor, a queuedsafeReloadcallback cannot entersynchronized reloadChannel(). The baseclose()waits for that callback to drain, so shutdown can hang.🔒️ Proposed fix
- 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(); }- Accepted Accepted same bounded watcher-drain/client-monitor contention in settlement client; preserve lifecycle flags and release monitor before superclass close.
- Use the documented entry format for the new observation.Minor
The file defines this entry format: "
YYYY-MM-DD: short title" followed by "Context:", "Observation:" and "Expected pattern:" items. The new entry uses a plain date with an em dash, and it has noContext:line. Every other entry in the file follows the format. Rewrite the entry so that tools and later health-check passes can parse it in the same way.As per coding guidelines, entries use the "Entry format: -
YYYY-MM-DD: short title / Context / Observation / Expected pattern".📝 Proposed fix
--- "a/design/project-management/ai-observations.md" +++ "b/design/project-management/ai-observations.md" @@ -166,8 +166,9 @@ - Expected pattern: Preserve completed review evidence and surface the exact capture incompatibility without silently replacing counts or requiring a quota reset. Overseer received the retained diagnostic; Gameplay made no database or installed-runtime bypass. - Reconsideration trigger: when the trailing-content cause after the final `cr-comment:v1` marker is identified, or a repeated capture of the affected finalized predecessor completes without the warning, verify the outcome and revisit this retained capture limitation. -- 2026-10-17 — A validation allowance of NONE includes whitespace checks. - - Observation: A historical-test receiving helper ran `git diff --check` despite an explicit validation allowance of NONE. It reported the extra check; no runtime tests or source edits resulted from it. The handoff also said no validation ran, which obscured the distinction. +- `2026-10-17`: A validation allowance of NONE includes whitespace checks + - Context: a historical-test receiving helper operated under an explicit validation allowance of NONE. + - Observation: the helper ran `git diff --check` and reported the extra check; no runtime tests or source edits resulted from it. The handoff also said no validation ran, which obscured the distinction. - Expected pattern: Treat standalone whitespace checks as validation under the closed allowance. Report the actual check and its outcome, and wait for the orchestrator’s named gate. Main gave that bounded correction and selected receiving proof separately; the extra check earns no test credit. - `2026-10-18`: Retain admission context for independent review refusals- Accepted Accepted documented observation format drift; preserve facts and add required Context/date structure.
- Move
WorldOriginalStartSessionActivationTransportTestSupportinto its own file.TrivialThis file declares a second top-level class of about 670 lines.
WorldOriginalStartSessionActivationTerminalReadGrpcMtlsTestalso uses this class. The class compiles only because Gradle compiles the whole test source set together. Tools and readers that look up a type by its file name cannot find it. Running one file on its own also hides the dependency. PMD reports the same problem asTypeNameMismatch. Move the class toWorldOriginalStartSessionActivationTransportTestSupport.javain the same package, and keep it package-private.- Accepted Accepted shared670line package-private top-level test support belongs in its own discoverable file, with exact implementation/imports preserved; one extra owned path stays below100.
- CLI Review 1 CompletedRuntime 3m 20sFound: 3 Accepted: 1/2/0 Routed: 0
- Fix the World native-gate statement. It conflicts with the World tracker.Minor
This paragraph says World's "88 ordinary native cases retain the preceding full gate". In [World Runtime and Movement](./world-runtime-and-movement.md#original-startsession-protected-activation-source), the preceding full gate is R11. That gate failed, and six of its 88 World native cases failed. R12 reran only eight scoped native cases. A reader of this tracker therefore sees a passing attribution that the owning World record contradicts.
Name the actual native-case result. Use the World tracker's wording: R11 failed with six of 88 cases, and R12 passed only eight scoped cases. Also check the "578 units freshly pass after the transport denial correction" claim. The World tracker attributes the 578 units to R11, not to a later fresh run.
The path instructions say: "Flag ... conflicts between architecture docs". The tracker README says the tracker must keep "status, implementation record, validation, gaps" aligned.
- Accepted Accept stale secondary World proof claims: link the World owner tracker and retain exact R11 failed-gate/R12 scoped limits, with no invented later fresh578 run or duplicate normative detail.
- Use the same proto package as the other files in
protos/world-management/v1.MajorThis file declares
package worldmanagement.v1;. The sibling filesoriginal_start_session_activation_terminal_read.protoandworld_canonical_instance_activation.protodeclarepackage world_management.v1;. All three files sharejava_package = "net.firedevops.firemud.worldmanagement.v1".The mismatch has these consequences:
- Buf's
PACKAGE_SAME_DIRECTORYandPACKAGE_DIRECTORY_MATCHrules require one package per directory. If the repository enforces them, the Buf lint job fails. - The gRPC full service name becomes
worldmanagement.v1.WorldOriginalStartSessionProtectedActivationService. Its method path differs from the convention used by the other World services. Any route allowlist or reflection-based tooling keyed by the package name sees a different service.
Align the package with the directory's existing package.
Proposed fix
-package worldmanagement.v1; +package world_management.v1;Confirm the package that the existing protos in
protos/world-management/v1declare. Confirm whether the repository Buf configuration enables thePACKAGE_SAME_DIRECTORYrule.- Accepted Accept canonical world_management.v1 wire package alignment; all sibling World protos use it and Java package stays unchanged. Verify exact method consumers and existing transport proof; no compatibility alias or registration.
- Buf's
- A transient failure in the CAS transaction leaves the activation stuck in PENDING.Minor
beginProtectedActivationcommits the PENDING fence in its own transaction. The secondwriteTransaction.executethen runs the lifecycle CAS. That transaction can fail for a transient reason, such as aTransientDataAccessException, a connection loss, or a serialization failure. In that case thecatchblock finds no terminal and rethrows the exception. The fence row stays PENDING.Every later call is then blocked.
readProtectedActivationByAcquisitionInputreturnspendingReadback(), andWorldOriginalStartSessionProtectedActivationServicethrowsPendingActivationException. A directactivateProtectedretry fails on!intent.createdByThisInvocation(). The only exit isabortProtected, and nothing in this change calls it. One transient storage error therefore blocks activation of the canonical instance until an operator aborts it manually.The current invocation still owns the intent (
createdByThisInvocation == true). The CAS transaction checks the fence state again under the lock, so it is safe to rerun. Retry it a bounded number of times insideactivateProtectedfor transient errors before the method falls back to terminal readback.♻️ Sketch of a bounded in-invocation retry
- try { - writeTransaction.execute( - status -> { - ... - }); - } catch (RuntimeException outcomeUncertain) { + RuntimeException last = null; + for (int attempt = 0; attempt < 3; attempt++) { + try { + writeTransaction.execute(status -> { /* unchanged body */ }); + last = null; + break; + } catch (org.springframework.dao.TransientDataAccessException transientFailure) { + last = transientFailure; + if (readTerminalEvidence(protection).isPresent()) break; + } catch (RuntimeException outcomeUncertain) { + last = outcomeUncertain; + break; + } + } + if (last != null) { Optional<WorldOriginalStartSessionActivationTerminalEvidence> terminal = readTerminalEvidence(protection); if (terminal.isPresent()) return terminal.orElseThrow(); - throw outcomeUncertain; + throw last; }Also applies to: 300-403
- Accepted Accept bounded transient CAS retries only within original invocation that created PENDING, retaining exact first receipt, locks/fences/lease/held checks and terminal-first readback. Later requests remain forbidden to resume or reacquire; exhausted/nontransient failures remain fenced.
- Hosted Review 2 CompletedRuntime 12m 34sFound: 5 Accepted: 0/3/2 Routed: 0
- Move
ActivationProtectionGrpcMtlsTestSupportinto its own file.TrivialThis file declares a second top-level class of about 360 lines.
AccountStartSessionActivationProtectionSettlementGrpcMtlsTestalso uses this class. The class compiles only because the whole test source set compiles together. A lookup by file name cannot find the type. PMD reportsTypeNameMismatchat Line 127. The World layer already moved its equivalent class,WorldOriginalStartSessionActivationTransportTestSupport, into a separate file. Move this class toActivationProtectionGrpcMtlsTestSupport.javain the same package, and keep it package-private.🪛 PMD (7.28.0)
[Medium] 127-127: TypeNameMismatch (Best Practices): Top-level type ActivationProtectionGrpcMtlsTestSupport should be defined in a file called ActivationProtectionGrpcMtlsTestSupport.java
(TypeNameMismatch (Best Practices))
[Medium] 146-146: AvoidUsingHardCodedIP (Best Practices): Do not hard code the IP address '127.0.0.1'
(AvoidUsingHardCodedIP (Best Practices))
[Medium] 183-183: TestClassWithoutTestCases (Error Prone): The class 'TestPki' might be a test class, but it contains no test cases.
(TestClassWithoutTestCases (Error Prone))
[Medium] 184-184: AvoidFieldNameMatchingMethodName (Error Prone): Field caCertificate has the same name as a method
(AvoidFieldNameMatchingMethodName (Error Prone))
[Medium] 185-185: AvoidFieldNameMatchingMethodName (Error Prone): Field server has the same name as a method
(AvoidFieldNameMatchingMethodName (Error Prone))
[Medium] 186-186: AvoidFieldNameMatchingMethodName (Error Prone): Field worldClient has the same name as a method
(AvoidFieldNameMatchingMethodName (Error Prone))
[Medium] 187-187: AvoidFieldNameMatchingMethodName (Error Prone): Field wrongWorkloadClient has the same name as a method
(AvoidFieldNameMatchingMethodName (Error Prone))
[Medium] 188-188: AvoidFieldNameMatchingMethodName (Error Prone): Field otherNamespaceClient has the same name as a method
(AvoidFieldNameMatchingMethodName (Error Prone))
[Medium] 207-207: AvoidDuplicateLiterals (Error Prone): The String literal "-alias" appears 7 times in this file; the first occurrence is on line 207
(AvoidDuplicateLiterals (Error Prone))
[Medium] 208-208: AvoidDuplicateLiterals (Error Prone): The String literal "activation-test-ca" appears 4 times in this file; the first occurrence is on line 208
(AvoidDuplicateLiterals (Error Prone))
[Medium] 217-217: AvoidDuplicateLiterals (Error Prone): The String literal "-ext" appears 10 times in this file; the first occurrence is on line 217
(AvoidDuplicateLiterals (Error Prone))
[Medium] 221-221: AvoidDuplicateLiterals (Error Prone): The String literal "-storetype" appears 7 times in this file; the first occurrence is on line 221
(AvoidDuplicateLiterals (Error Prone))
[Medium] 222-222: AvoidDuplicateLiterals (Error Prone): The String literal "PKCS12" appears 8 times in this file; the first occurrence is on line 222
(AvoidDuplicateLiterals (Error Prone))
[Medium] 223-223: AvoidDuplicateLiterals (Error Prone): The String literal "-keystore" appears 7 times in this file; the first occurrence is on line 223
(AvoidDuplicateLiterals (Error Prone))
[Medium] 225-225: AvoidDuplicateLiterals (Error Prone): The String literal "-storepass" appears 7 times in this file; the first occurrence is on line 225
(AvoidDuplicateLiterals (Error Prone))
[Medium] 240-240: AvoidDuplicateLiterals (Error Prone): The String literal "-file" appears 4 times in this file; the first occurrence is on line 240
(AvoidDuplicateLiterals (Error Prone))
[Medium] 429-429: UseLocaleWithCaseConversions (Error Prone): When doing a String.toLowerCase()/toUpperCase() call, use a Locale
(UseLocaleWithCaseConversions (Error Prone))
[Medium] 432-432: LooseCoupling (Best Practices): Avoid using implementation types like 'ArrayList'; use the interface instead
(LooseCoupling (Best Practices))
- Accepted Shared package-private test support is in acquisition test file; exact own-file extraction preserves behavior and makes name/type ownership canonical.
- Align the protobuf package with the sibling World protos.Minor
The protobuf package forms the service's fully qualified gRPC name. This file therefore defines
worldmanagement.v1.WorldOriginalStartSessionProtectedActivationService, while the sibling World protos useworld_management.v1. Consumers or policies that match fully qualified gRPC names will treat these as different services.Proposed fix
--- "a/protos/world-management/v1/original_start_session_protected_activation.proto" +++ "b/protos/world-management/v1/original_start_session_protected_activation.proto" @@ -1,6 +1,6 @@ syntax = "proto3"; -package worldmanagement.v1; +package world_management.v1; import "account/v1/start_session_activation_protection_acquisition.proto";- Accepted Valid canonical package mismatch on reviewed a267. Same correction is prepared in local CLI1 commit987; share that fix, no duplicate code change or extra test credit.
- Append the observation after the existing entries.Minor
The new entry precedes the existing
2026-10-18entries at Lines 174–185. Move the new entry to the end of the file so this change preserves the append-only record. As per coding guidelines, “During ordinary autonomous work, append dated entries; do not silently rewrite or delete prior observations.”- Accepted Owned observation was inserted before inherited later entries; relocate only this intact entry to end, preserving all inherited text.
- Replace the self-comparison with a real re-encoding check.Trivial
decodedis constructed withstoredas itscanonicalBytes. The constructor clones that argument. TheMessageDigest.isEqual(stored, decoded.canonicalBytes)check therefore compares the stored bytes with a copy of themselves, so it always passes. The "exact canonical encoding" error can never be thrown.The other checks currently cover the gap: RFC 8785 canonical form, the closed field set, child decodes, and the identity and digest comparisons. The dead assertion still states an invariant that the code does not enforce. If a field changes later, nothing ties the envelope to
encode().AccountStartSessionActivationProtectionEvidence.decodeandAccountStartSessionActivationProtectionRequest.decodealready use the correct pattern: rebuild the value throughcreate, then compare.♻️ Proposed refactor
--- "a/services/common-platform-core/src/main/java/net/firedevops/firemud/common/world/WorldOriginalStartSessionActivationTerminalEvidence.java" +++ "b/services/common-platform-core/src/main/java/net/firedevops/firemud/common/world/WorldOriginalStartSessionActivationTerminalEvidence.java" @@ -157,12 +157,11 @@ throw invalid("World activation terminal identity differs from its retained Account proof"); } requireExactBinding(accountEvidence, result); - WorldOriginalStartSessionActivationTerminalEvidence decoded = - new WorldOriginalStartSessionActivationTerminalEvidence( - accountEvidence, result, worldActivationFence, stored); - if (!MessageDigest.isEqual(stored, decoded.canonicalBytes)) { + WorldOriginalStartSessionActivationTerminalEvidence decoded = + create(accountEvidence, result, worldActivationFence); + if (!MessageDigest.isEqual(stored, decoded.canonicalBytes)) { throw invalid("World activation terminal evidence is not its exact canonical encoding"); } return decoded; } catch (IllegalArgumentException expected) { throw expected;- Accepted Current decode compares stored bytes with their clone. Rebuild through existing create then compare genuine encoding, preserving all bounds and binding checks.
- Map caller-identity conflicts to
FAILED_PRECONDITION, notINTERNAL.MinorrequireSameProtectionIdentitythrowsActivationConflictExceptionwhen the supplied protection evidence differs from the stored identity. The service propagates this exception, and the handler's genericRuntimeExceptioncatch maps it toINTERNAL. Existing protected-activation handling maps the same exception toFAILED_PRECONDITION.Proposed fix
--- "a/services/world-management-service/src/main/java/net/firedevops/firemud/worldmanagement/tenant/WorldOriginalStartSessionActivationTerminalReadGrpcService.java" +++ "b/services/world-management-service/src/main/java/net/firedevops/firemud/worldmanagement/tenant/WorldOriginalStartSessionActivationTerminalReadGrpcService.java" @@ -59,9 +59,15 @@ } WorldOriginalStartSessionActivationTerminalEvidence terminal; try { terminal = activationService.readTerminalEvidence(input.protectionEvidence()).orElse(null); + } catch (WorldCanonicalInstanceActivationRepository.ActivationConflictException conflict) { + fail( + observer, + Status.FAILED_PRECONDITION, + "World activation is bound to different Account protection evidence"); + return; } catch (TransientDataAccessException unavailable) { fail(observer, Status.UNAVAILABLE, "World activation terminal storage is unavailable"); return; } catch (DataAccessException failure) {- Accepted Repository identity conflict currently falls into generic INTERNAL. Map only ActivationConflictException to sanitized FAILED_PRECONDITION, preserving auth and other failures.
- CLI Review 2 CompletedRuntime 2m 37sFound: 1 Accepted: 0/1/0 Routed: 0
- Map Account-side failures to World-owned statuses. Do not forward Account's status or report Account's receipt as caller input.Minor
The
StatusRuntimeExceptionbranch returnsdenied.getStatus()from the Account acquisition call. Suppose World's own mTLS identity toward Account is rejected. Account then returnsUNAUTHENTICATEDorPERMISSION_DENIED, and Game Session receives that code. Game Session would conclude that its own call to World was not authorized. AccountINVALID_ARGUMENTis forwarded the same way.The
IllegalArgumentExceptionbranch has a related problem.WorldOriginalStartSessionProtectedActivationService.activatevalidates Account's receipt withAccountStartSessionActivationProtectionAcquisitionGrpcCodec.toResponse(...). If the receipt changed the binding, that call throwsIllegalArgumentException, and Game Session receivesINVALID_ARGUMENT. By that point the Game Session input was already decoded successfully at Line 54-56. The failure is a dependency contract break, not caller input.Keep only the retryable codes from Account (
UNAVAILABLE,DEADLINE_EXCEEDED). Map all other Account codes, and post-decode argument failures, toFAILED_PRECONDITIONorINTERNAL. This matches the path instruction on gRPC application-error handling.Proposed mapping
} catch (StatusRuntimeException denied) { - fail( - observer, - denied.getStatus(), - "World protected activation owner request denied or unavailable"); + Status.Code code = denied.getStatus().getCode(); + Status mapped = + code == Status.Code.UNAVAILABLE || code == Status.Code.DEADLINE_EXCEEDED + ? Status.fromCode(code) + : Status.FAILED_PRECONDITION; + fail(observer, mapped, "World protected activation owner request denied or unavailable"); return; } catch (IllegalArgumentException invalid) { - fail(observer, Status.INVALID_ARGUMENT, "World protected activation input is invalid"); + fail( + observer, + Status.FAILED_PRECONDITION, + "World protected activation owner evidence is inconsistent"); return;- Accepted Valid dependency-origin error. Preserve ADR0092 infrastructure codes; sanitize foreign caller-relative codes to World UNAVAILABLE and post-decode owner-contract errors to INTERNAL. Retain caller denials; reject proposed cancellation/internal-to-precondition narrowing.
- CLI Review 3 CompletedRuntime 3m 36sFound: 4 Accepted: 1/1/1 Routed: 0
- Do not forward downstream
StatusRuntimeExceptionvalues as Account's own status.MinorThe owner service throws
StatusRuntimeExceptionfor its own decisions, such asfailedPreconditionandrequireWorldPeer. The same type also comes back from the downstream callsCanonicalGameInstanceLaunchAssociationClient.readandOriginalStartSessionCurrentAttemptClient.read. This catch forwards both kinds unchanged. A Game SessionPERMISSION_DENIED,UNAUTHENTICATEDorNOT_FOUNDtherefore reaches World as if Account had refused the World caller. The forwarded exception also carries the downstream trailers and description to World.AccountStartSessionActivationProtectionSettlementGrpcServicelines 84-85 do the same with the World terminal-read client's status.The path instructions require the canonical gRPC outcome classification. Wrap each downstream client call in the owner services. Map transport failures to
UNAVAILABLE. Map an unexpected downstream refusal toFAILED_PRECONDITIONorINTERNAL, with a bounded description and no forwarded trailers.♻️ Sketch for the owner service
private <T> T downstream(Supplier<T> call, String owner) { try { return call.get(); } catch (StatusRuntimeException failure) { Status.Code code = failure.getStatus().getCode(); Status mapped = code == Status.Code.UNAVAILABLE || code == Status.Code.DEADLINE_EXCEEDED ? Status.UNAVAILABLE : Status.FAILED_PRECONDITION; throw mapped.withDescription(owner + " owner read did not produce exact evidence") .withCause(failure) .asRuntimeException(); // no downstream trailers } }- Accepted Valid foreign dependency status leak. Classify only three outbound owner reads; preserve six clean infrastructure codes, map foreign caller-relative codes to Account UNAVAILABLE, remove foreign metadata/causes, retain local owner decisions.
- Check heap budgets against the 200–768 MiB carrier caps before registration.Trivial
The terminal receipt may reach 768 MiB. The clients raise
withMaxInboundMessageSizeto these caps and enable gzip. Each decode path makes several full copies of the payload:- the strict UTF-8
String; - the RFC 8785 re-canonicalization;
- the Base64 decode of each child;
- the nested
AccountStartSessionActivationProtectionEvidence.decodeandWorldCanonicalInstanceActivation.Result.fromStored; - the
createre-encode; - the defensive
clone()calls inboundedand the accessors.
One maximum-size receipt can therefore need several GiB of transient heap in Account settlement and in the World codec path. Account also binds the full bytes into the PostgreSQL insert. Before these receivers are registered:
- confirm the target JVM heap and the gRPC server
maxInboundMessageSizeagainst these caps; - or lower the caps to an empirically justified ceiling.
bounded(...)inrequireChildBoundsonly checks lengths, but it still clones each child. A length-only check removes those copies.- Accepted Remove discarded child-array clones from length-only checks; retain defensive copies and exact carrier caps. Record that maximum-size heap/server-inbound qualification is unrun before registration. No arbitrary bound reduction.
- the strict UTF-8
- Confirm that a committed protection can be recovered after the original lease expires.Major
The only path that returns the protection ID and fence to World is this acquisition call. That call runs
acquireOrReadExactinsidewithCurrentWorldReceivingParticipationCurrentness. The callback and the SQL guard reject the call afteroriginalLeaseExpiresAt.The failure case is as follows:
- Account commits the protection and its source children.
- The World caller loses the response, for example through a deadline or a connection reset.
- World retries only after the original Game Session lease has expired.
The retry then fails, and World never gets the
AccountStartSessionActivationProtectionEvidence. World cannot run its activation CAS or settle the protection without that evidence. Settlement needsaccount_protection_idandaccount_protection_fence, and the terminal read needs the full evidence. The pending protection then blocks the source-hold, source-change and hosted-terms disclosure writers with no end date. Perruntime-and-data.mdline 345, these stay blocked until the protection's exact immutable settlement exists.The World tracker lists "the protected-acquisition recovery lookup" as unqualified, but this change contains no such lookup. Please confirm one of these:
- An exact recovery read exists or is planned. It would return the committed winner for the exact operation identity and need no currentness check, matching the participation historical read.
- An explicit Account-owned abort or expiry path releases the protection.
If neither exists, record this gap in the activation-protection tracker before the methods are registered.
- Accepted Accept precise pre-registration gap documentation: committed protection response loss after lease expiry has no authenticated acquisition-identity lookup/abort. Keep pending fences; no historical receipt may silently grant late activation. Recovery remains unimplemented.
- Extract the duplicated mTLS-material validation and client lifecycle into one shared helper.Trivial
requireFileBackedMtlsandrequireReadableFileare copied nearly verbatim into four new clients:GrpcAccountStartSessionActivationProtectionAcquisitionClientGrpcAccountStartSessionActivationProtectionSettlementClientGrpcWorldOriginalStartSessionActivationTerminalReadClientGrpcWorldOriginalStartSessionProtectedActivationClient
The four clients also repeat the same
init/close/requireStubstate machine. The same pattern of copying appears on the server side: the exact-World-peer check andhasConnectionFailureSqlStateare duplicated across the two Account receivers and the two owner services.The repository's AI observation of 2026-10-15 records a defect in one copy of shared client lifecycle code that was already fixed in another copy. A single helper prevents that kind of divergence. One option is a
FileBackedMtlsClientProperties.require(properties, label)utility plus a small abstractExplicitInitReloadingClientbase.- Rejected Optional broad lifecycle/TLS abstraction; no remaining divergent behavior identified. Existing four-client callback regressions protect the corrected invariant. A new shared base/framework would widen this bounded repair without required contract or correctness benefit.
- CLI Review 4 CompletedRuntime 2m 44sFound: 1 Accepted: 0/1/0 Routed: 0
- Handle two matching fence rows as a conflict, not as an internal failure.Minor
The recovery lookup selects
WHERE activation_request_id=? OR canonical_game_instance_id=?and usesfetchOne. One fence row can match byactivation_request_idwhile a different row matches bycanonical_game_instance_id. This happens when a caller reuses an activation request ID that is already bound to instance A for instance B, and instance B already has a fence. In that casefetchOnethrows jOOQTooManyRowsException. The gRPC adapter then maps the exception toINTERNAL("World protected activation failed"). It should be theFAILED_PRECONDITIONconflict thatrequireSameAcquisitionInputgives for every other changed-identity retry.Fetch all matching rows. If more than one row is returned, throw
ActivationConflictException.Confirm that
world_canonical_instance_activation_fencehas unique keys on bothactivation_request_idandcanonical_game_instance_id. If both keys are unique, at most two rows can match. TheON CONFLICT DO NOTHINGinsert and its "already owns this canonical instance" message suggest that both keys are unique.🐛 Proposed fix
- Record row = - dsl.fetchOne( - "SELECT * FROM world_canonical_instance_activation_fence " - + "WHERE activation_request_id=? OR canonical_game_instance_id=?", - activationId, - gameInstanceId); + var rows = + dsl.fetch( + "SELECT * FROM world_canonical_instance_activation_fence " + + "WHERE activation_request_id=? OR canonical_game_instance_id=?", + activationId, + gameInstanceId); + if (rows.size() > 1) { + throw new ActivationConflictException( + "World activation request identity is bound to another canonical instance"); + } + Record row = rows.isEmpty() ? null : rows.get(0);- Accepted Verified V1038 independently unique request and instance keys: two distinct valid fences can match OR recovery; fetchOne wrongly raises TooManyRows/INTERNAL. Classify as ActivationConflict; same bounded two-row risk in legacy-result existence query.
- CLI Review 5 CompletedRuntime 3m 00sFound: 3 Accepted: 0/2/1 Routed: 0
- Do not report deterministic Account refusals as
UNAVAILABLE.MinorThe
default -> Status.UNAVAILABLEbranch turns every non-infrastructure Account status into a retryable status. This includesFAILED_PRECONDITION,PERMISSION_DENIED,INVALID_ARGUMENTandALREADY_EXISTS. The cross-service caseCHANGED_ACTIVATION_ATTEMPTshows the effect: a wrong owner attempt is a permanent refusal, but the Game Session caller receivesUNAVAILABLE. A caller that retries onUNAVAILABLEwill repeat a request that cannot succeed.Hiding Account's description, cause and trailers is correct. However, map deterministic refusals to a non-retryable code, for example
FAILED_PRECONDITION. Check the FireMUD gRPC application-error contract for the required mapping. The path instructions require attention to "gRPC application-error handling".Proposed mapping
switch (code) { case UNAVAILABLE, DEADLINE_EXCEEDED, CANCELLED, RESOURCE_EXHAUSTED, INTERNAL, UNKNOWN -> Status.fromCode(code); - default -> Status.UNAVAILABLE; + default -> Status.FAILED_PRECONDITION; };Then update the expectation in
foreignOwnerStatusesAreSanitizedWhileInfrastructureStatusesRemainCanonicaland theCHANGED_ACTIVATION_ATTEMPTassertion.As per path instructions, "Flag changes that violate documented FireMUD invariants, especially gRPC application-error handling".
- Accepted Canonical gRPC outcome classification requires deterministic Account refusals to remain nonretryable. Map sanitized foreign non-infrastructure codes to World FAILED_PRECONDITION, preserving six infrastructure codes and no foreign details.
- Name the owning capability row for the protected-activation source.Minor
The neighbouring source sections name their owning capability. For example, they say "This preparation is owned by AA-1.3" and link to the
Capability Statusrow. This new section does not name an owner. A reader therefore cannot find the scan-first status row for the new acquisition, readback and settlement anchors.- Add one sentence that names the owning row, probably
AA-1.3. - State that the row stays
partial/drift-found. - Confirm that the row's production anchors and proof anchors include the new repository, the V1006 migration and
AccountStartSessionActivationProtectionPostgresIntegrationTest.
Line 17 also repeats the "remain unregistered" statement from line 15. You can remove one of them.
The tracker rule requires this: "Each tracker contains one
Capability Statusrow for every capability it primarily owns… the capability rows are the complete scan-first status surface." It also says to "Keep its status, implementation record, validation, gaps… aligned when a domain boundary changes."- Accepted AA-1.3 remains partial/drift-found but lacks new activation repository/V1006/proof anchors and explicit section ownership. Add bounded tracker links/status and remove duplicated registration wording.
- Add one sentence that names the owning row, probably
- Confirm a recovery path for a PENDING fence after a failed lifecycle CAS.Trivial
If the lifecycle CAS fails with a nontransient error, or if all
MAX_PROTECTED_ACTIVATION_ATTEMPTStransient attempts fail,activateProtectedrethrows. Theworld_canonical_instance_activation_fencerow then staysPENDING. The same thing happens if the process stops afterbeginProtectedActivationcommits. A later call with the same input then getsPendingActivationExceptionfromWorldOriginalStartSessionProtectedActivationService. That call never retries the CAS, so the Account activation protection never reaches settlement.abortProtectedis the only way out ofPENDING. The supplied files do not show a registered caller or reconciler for it. The cross-service test asserts that this state is permanent (exhaustedTransientLifecycleCasLeavesPendingAndCannotBeRestarted).Verify these two facts:
- An owner-driven reconciler or operator path calls
abortProtectedfor a strandedPENDINGfence. - The owning tracker records the Account-side effect of a protection that never settles, such as blocked source mutation for the tenant.
If neither exists, record the gap with its reason and a reconsideration trigger.
- Accepted Valid documentation gap: stranded World PENDING has no registered reconciler and retains Account source fences. Record reason and registration/recovery trigger; do not invent abort or expiry release.
- An owner-driven reconciler or operator path calls
- Hosted Review 3 CompletedRuntime 11m 42sFound: 3 Accepted: 0/2/1 Routed: 0
- Name the source commit for the focused protected-activation gate.Minor
Line 19 reports a "focused corrected gate" that passes in 2m55s. The gate covers 13 Account PostgreSQL cases and four World/Account/Game Session compositions. The paragraph does not name the source commit that produced these results. The World tracker records its matching attribution at receiving source
ec72188f…. That tracker also says R12 did not rerun the four compositions. Without a commit, a reader cannot tell which source head this tracker's gate result applies to, or whether it is the same run as the World R11/R12 record.The PR objectives also report a later focused run at
cd3e5515b23e. That run covers five protected-activation gRPC handler cases and one changed-attempt PostgreSQL/Redis/mTLS composition. This paragraph does not record that run.Add the exact source commit for the 2m55s gate. If the
cd3e5515cases belong to this capability, record them as a separately attributed result. The tracker contract requires focused proof to be traceable, and it states that "a historical broad test run does not substitute for focused proof."As per coding guidelines, "
implementeddoes not implyproven, and a historical broad test run does not substitute for focused proof."- Accepted Valid proof-attribution gap. Bind historical2m55 claim to actual tested source if recoverable or qualify/remove unbound claim; record cd3e5handler+1physical cases separately. No invented execution/source attribution.
- Add tests for the denial and storage status branches in the handler.Trivial
The tests in this file cover authentication, the ambient-transaction check, the malformed carrier,
StatusRuntimeExceptionsanitization, andIllegalArgumentException. They do not cover four other branches inWorldOriginalStartSessionProtectedActivationGrpcService.activateOriginalStartSessionProtected:PendingActivationException,ActivationConflictException, andActivationDeniedExceptionmap toFAILED_PRECONDITIONwith the description "World protected activation is not admissible".TransientDataAccessExceptionmaps toUNAVAILABLE.- A non-transient
DataAccessExceptionmaps toINTERNAL. - Any other
RuntimeExceptionmaps toINTERNAL. - The
isSynchronizationActive()check is a separate ambient-transaction condition. The current test sets onlysetActualTransactionActive(true).
Callers make retry decisions from these status codes. The handler classification is the gRPC application-error contract. If someone reorders the catch blocks,
DataAccessExceptionwill be caught beforeTransientDataAccessException. That change would turn a retryableUNAVAILABLEinto a terminalINTERNAL, and no test would fail. Add a parameterized case that uses the sameinvokehelper. Assert the code, the description, a null cause, null trailers, and zero responses.🧪 Proposed parameterized classification test
static java.util.stream.Stream<org.junit.jupiter.params.provider.Arguments> ownerFailures() { return java.util.stream.Stream.of( org.junit.jupiter.params.provider.Arguments.of( WorldOriginalStartSessionProtectedActivationService.PendingActivationException.class, Status.Code.FAILED_PRECONDITION, "World protected activation is not admissible"), org.junit.jupiter.params.provider.Arguments.of( net.firedevops.firemud.worldmanagement.tenant.WorldCanonicalInstanceActivationRepository .ActivationConflictException.class, Status.Code.FAILED_PRECONDITION, "World protected activation is not admissible"), org.junit.jupiter.params.provider.Arguments.of( net.firedevops.firemud.worldmanagement.tenant.WorldCanonicalInstanceActivationService .ActivationDeniedException.class, Status.Code.FAILED_PRECONDITION, "World protected activation is not admissible"), org.junit.jupiter.params.provider.Arguments.of( org.springframework.dao.TransientDataAccessResourceException.class, Status.Code.UNAVAILABLE, "World protected activation storage is unavailable"), org.junit.jupiter.params.provider.Arguments.of( org.springframework.dao.DataIntegrityViolationException.class, Status.Code.INTERNAL, "World protected activation storage failed"), org.junit.jupiter.params.provider.Arguments.of( IllegalStateException.class, Status.Code.INTERNAL, "World protected activation failed")); } @org.junit.jupiter.params.ParameterizedTest @org.junit.jupiter.params.provider.MethodSource("ownerFailures") void ownerFailuresAreClassifiedWithoutDetails( Class<? extends RuntimeException> thrown, Status.Code expected, String description) throws Exception { var fixture = WorldOriginalStartSessionActivationTransportTestSupport.fixture(); var request = WorldOriginalStartSessionProtectedActivationGrpcCodec.toRequest(fixture.input(), "test"); var owner = mock(WorldOriginalStartSessionProtectedActivationService.class); when(owner.activate(any())).thenThrow(thrown); var service = new WorldOriginalStartSessionProtectedActivationGrpcService(owner, "test"); var failure = invoke(service, peer("spiffe://firemud/ns/test/sa/game-session-service"), request); assertThat(failure.failureCode()).isEqualTo(expected); assertThat(failure.failureDescription()).isEqualTo(description); assertThat(failure.failureCause()).isNull(); assertThat(failure.failureTrailers()).isNull(); assertThat(failure.responseCount()).isZero(); assertThat(failure.completionCount()).isZero(); }The path instructions say: "Prioritize bugs, regressions, missing tests ... especially gRPC application-error handling".
- Accepted Useful handler contract proof: cover three domain denials, actual Spring transient and jOOQ nontransient storage branches, generic runtime failure, privacy/no success and independent synchronization-active denial. Existing coverage misses these branches.
- Require the operation-bound launch read in the activation carrier.Minor
requireExactOriginalStartBindingchecks the launch read'soriginalOperationonly when one is present. A launch association from the World selector branch has a nulloriginalOperation, andcreatestill accepts it. In that case, no Game Session-authenticated evidence bindsgameSessionOwnerMutationId. The launch read binds only the attempt and fence at lines 500-501.At acquisition time,
originalCurrentAttemptcompares the mutation ID. Afterdecode,originalCurrentAttemptisnull(line 360). The retained request therefore carries a mutation ID that no retained Game Session evidence binds. The PR contract says the Account caller path binds the complete original tuple and the exact pending owner. The cohort testretainedLaunchOperationEchoIsExactAndCannotOmitOwnerBindingrejects only a partial echo. A launch read with the whole operation omitted still passes.AccountStartSessionActivationProtectionAcquisitionService.launchRequestalways builds anOriginalOperation, so the production producer meets this requirement. The carrier should enforce it as well. Reject a null operation. Then update the fixtures that build unboundResultvalues, such asAccountStartSessionActivationProtectionEvidenceTest.request(...)andWorldOriginalStartSessionActivationTerminalEvidenceTest.accountRequest(...).🛡️ Proposed fix
--- "a/services/common-platform-core/src/main/java/net/firedevops/firemud/common/account/startsession/AccountStartSessionActivationProtectionRequest.java" +++ "b/services/common-platform-core/src/main/java/net/firedevops/firemud/common/account/startsession/AccountStartSessionActivationProtectionRequest.java" @@ -501,14 +501,14 @@ || ownerFence != launch.ownerFence()) { throw invalid("Original StartSession tuple differs from the exact launch scope"); } var operation = selector.originalOperation(); - if (operation != null - && (!Arrays.equals(tupleBytes, operation.originalPostAuthorizationTuple()) + if (operation == null + || !Arrays.equals(tupleBytes, operation.originalPostAuthorizationTuple()) || !ownerAttemptId.equals(operation.ownerAttemptId()) || ownerFence != operation.ownerFence() - || !ownerMutationId.equals(operation.ownerMutationId()))) { + || !ownerMutationId.equals(operation.ownerMutationId())) { throw invalid("Launch read original operation differs from the complete protection tuple"); } if (originalCurrentAttempt != null && (!Arrays.equals( tupleBytes, originalCurrentAttempt.request().canonicalPostAuthorizationTuple())- Accepted Valid retained-operation binding gap: null originalOperation can omit authenticated owner mutation after decode. Require complete tuple/mutation/attempt/fence and repair exact valid fixtures; preserve general World-selector read behavior.
- CLI Review 6 CompletedRuntime 2m 46sFound: 3 Accepted: 0/3/0 Routed: 0
- Raise
MAXPROJECTIONBYTESto the complete original-tuple bound.MinorRaise `MAX_PROJECTION_BYTES` to the complete original-tuple bound.
The current redemption projection is the complete canonical tuple.
StartSessionAccountRedemptionProjection.fromOriginalTuple(tuple)returnstuple.canonicalBytes(), andAccountStartSessionAdmissionProtectionEvidenceTestasserts this. The documented tuple bound is 256 KiB, according to the Game Session continuation contract and the Account tuple contract. This constant is 132 KiB (135,168 bytes).AccountStartSessionActivationProtectionRequest.MAX_PROJECTION_BYTESreuses this value, andcreateRetainedapplies it throughbounded(...). A valid tuple between 132 KiB and 256 KiB therefore passes the tuple bound and then fails the projection bound. Acquisition stops withFAILED_PRECONDITIONbefore Account retains protection, so World cannot activate that original StartSession. The activation PostgreSQL suite accepts this shape:lifecycleUpgradePreservesPendingProtectionAndBlocksInvalidSettlementasserts a projection larger than 135,168 bytes. Only the Java carrier rejects it.Confirm that
StartSessionPostAuthorizationExecutionTuple.MAX_CANONICAL_TUPLE_BYTESis 256 KiB. Then derive the projection cap from that constant. Re-check theMAX_CANONICAL_BYTESbudget of 768 KiB. Base64 of a 256 KiB tuple and a 256 KiB projection is about 683 KiB, so the budget remains sufficient. Add a Java carrier case above 132 KiB.Proposed fix
- public static final int MAX_PROJECTION_BYTES = 132 * 1024; + public static final int MAX_PROJECTION_BYTES = + StartSessionPostAuthorizationExecutionTuple.MAX_CANONICAL_TUPLE_BYTES;- Accepted Confirmed projection is complete tuple and canonical tuple bound256KiB, while inherited projection cap132KiB rejects valid inputs. Derive cap from tuple constant and prove actual valid >132KiB carrier roundtrip/aggregate budget/refusal.
- Confirm that mapping definitive owner refusals to
UNAVAILABLEmatches the gRPC outcome contract.MinordependencyFailurekeeps only the infrastructure codes. It maps every other downstream status toUNAVAILABLE, includingFAILED_PRECONDITION,NOT_FOUNDandPERMISSION_DENIED. Game Session can refuse the current-attempt read or the STARTING association read for a deterministic reason, such as an expired lease, a changed owner or a non-STARTING row. World then receives a retryableUNAVAILABLEfor a refusal that can never succeed.The World tracker records that exhausted transient retries leave the activation
PENDING. In that state, Account keeps the source protection until exact terminal settlement. Classifying deterministic refusals as transient increases retry load and keeps that state for longer. The testhistoricalWitnessCannotSubstituteForDeniedFreshCurrentAttemptasserts this mapping, so the mapping is intentional. Confirm that the [canonical gRPC outcome classification](design/architecture/system-architecture-grpc.md#outcome-and-transport-classification) permits it.If the contract does not permit it, map non-infrastructure codes to
FAILED_PRECONDITION. Keep the description bounded, and do not attach the downstream cause or trailers. Apply the same correction toAccountStartSessionActivationProtectionSettlementService.dependencyFailure.Possible correction
- default -> Status.UNAVAILABLE; + default -> Status.FAILED_PRECONDITION;The path instruction states: "Flag changes that violate documented FireMUD invariants, especially gRPC application-error handling".
- Accepted Canonical gRPC contract forbids retryable UNAVAILABLE for deterministic foreign refusals. Main already prepared/applied identical four-file correction locally: Account FAILED_PRECONDITION fallback, six infra codes/privacy/local decisions retained. Proof/publication pending.
- Keep the retry policy and the original failure when the terminal read fails.Minor
The catch block calls
readTerminalEvidence(firstProtection)without a guard. A lifecycle transaction can fail with aTransientDataAccessExceptionbecause the database is briefly unavailable. In that state, the terminal read is likely to throw too.If the read throws, its exception leaves the catch block, and this causes two problems:
- The loop does not run the remaining
MAX_PROTECTED_ACTIVATION_ATTEMPTS. The invocation that created the PENDING fence is the only invocation that may retry. If it stops early, the fence stays PENDING, and only a fenced abort can continue. - The original
outcomeUncertainfailure is lost, so operators see only the readback error.
A lifecycle retry is safe after a failed read. Each retry locks the fence again and returns early when the state is no longer
PENDING.🛡️ Proposed fix
} catch (RuntimeException outcomeUncertain) { - Optional<WorldOriginalStartSessionActivationTerminalEvidence> terminal = - readTerminalEvidence(firstProtection); + Optional<WorldOriginalStartSessionActivationTerminalEvidence> terminal; + try { + terminal = readTerminalEvidence(firstProtection); + } catch (RuntimeException readbackFailure) { + outcomeUncertain.addSuppressed(readbackFailure); + terminal = Optional.empty(); + } if (terminal.isPresent()) return terminal.orElseThrow(); if (!(outcomeUncertain instanceof TransientDataAccessException) || attempts >= MAX_PROTECTED_ACTIVATION_ATTEMPTS) { throw outcomeUncertain; } }- Accepted Valid retry/readback bug: failed terminal read masks original failure and bypasses remaining same-invocation transient retries. Guard/suppress readback failure, avoid self-suppression, retain exact terminal and MAX3/lease/fence/retry policy.
- The loop does not run the remaining
- CLI Review 7 CompletedRuntime 2m 27sFound: 2 Accepted: 0/1/0 Routed: 0
- Update the peer-denial descriptions to include the Account workload.Minor
The service now accepts two peers: the exact World Management workload and the exact Account workload. The denial branch still returns "Verified World Management workload required" or "Exact same-namespace World Management workload required". A wrong-namespace Account caller therefore receives a description that names only World Management. Operators who debug Account-side denials get a misleading cause. Change both descriptions so they name both permitted workloads.
Proposed fix
Status status = peer == null ? Status.UNAUTHENTICATED.withDescription( - "Verified World Management workload required") + "Verified World Management or Account workload required") : Status.PERMISSION_DENIED.withDescription( - "Exact same-namespace World Management workload required"); + "Exact same-namespace World Management or Account workload required");- Accepted Both exact same-namespace World and Account peers are permitted. The two denial descriptions name only World, misleading Account diagnostics; correct only those descriptions, preserving status codes and all admission predicates.
- Confirm that production Flyway supplies the
serviceSchemaplaceholder before V1006 runs.MajorV1006 uses
${serviceSchema}to resolveaccount_ss_activation_settlement_insert_guard(). Flyway fails a migration that contains an unresolved${...}placeholder. This PR changedCredentialCleanupRepositoryIntegrationTestto add.placeholders(Map.of("serviceSchema", ...))and the saga location. That change suggests that a plain full migration without the placeholder now fails. None of the supplied files shows that the Account service runtime Flyway configuration definesspring.flyway.placeholders.serviceSchema, or an equivalent. If that configuration is missing, Account startup stops on V1006 in every environment that applies migrations. The other Account integration suites that run Flyway also need the placeholder.Confirm one of the following:
application*.ymlor the Flyway customizer for Account definesserviceSchemaand sets it to the actual service schema.- Every other Account Flyway caller already supplies the placeholder.
If neither is true, add the runtime placeholder. Alternatively, resolve the function with
to_regprocedure('account_ss_activation_settlement_insert_guard()')under the activesearch_path, because earlier V1004.x checks follow that pattern.- Rejected Already configured: Account application.yml:4-11 and application-prod.yml:5-11 both supply spring.flyway.placeholders.serviceSchema from SERVICE_SCHEMA with public default, matching schemas/defaultSchema. The named cleanup caller also supplies its exact schema and Saga location.
- CLI Review 8 CompletedRuntime 2m 40sFound: 1 Accepted: 0/0/0 Routed: 1
- A pending Account protection can be left without any way to settle it.Major
accountProtectionClient.acquire(input)makes the Account source protection durable before World writes its PENDING fence. Two failure paths can strand that protection:WorldCanonicalInstanceActivationRepository.beginProtectedActivationcallsrequireLocalProtectedActivationBinding(protection, true). That check throwsActivationDeniedExceptionif the original Game Session lease expired between acquisition and fence insert. It throwsActivationConflictExceptionif the execution binding no longer matches. In both cases no fence row exists. As a result,readTerminalEvidencereturns empty. Account settlement then getsFAILED_PRECONDITIONfrom the terminal-read RPC every time.beginProtectedActivationcan commit the fence and then raise a transient error. In that caseactivateProtectedpropagates the error. Every later call sees a PENDING fence that "this invocation" did not create. That call fails withPendingActivationException. The CAS never runs and no terminal is written.
abortProtectedexists and records a positive ABORTED terminal under the same operation lock. The service never calls it on these paths.Confirm whether Account can settle or expire a protection when World has no fence or terminal. If it cannot, do this:
- On a non-retryable denial from
beginProtectedActivationafteracquire, callactivationService.abortProtected(protection, "<code>"). This gives the caller a terminal it can settle. - Define a recovery owner for PENDING fences that no running invocation is still driving.
Route · PR #3237 → Unassigned target Open View routed finding- Accepted Verified durable Account protection can precede a denied/uncertain World begin. Existing tracker covers stranded PENDING, but not the no-fence denial case. Preserve fail-closed source guards; automatic abort on expiry conflicts with current contract. Owner/scope adjudication requested.
- Hosted Review 4 CompletedRuntime 12m 51sFound: 4 Accepted: 0/1/2 Routed: 0
- Extract the duplicated exact World peer check into one shared helper.Trivial
The same exact World workload check appears in four places. These are
requireWorldPeerhere,requireWorldPeerinAccountStartSessionActivationProtectionSettlementService, and the inline checks in both Account gRPC receivers. Each copy builds the SPIFFE URI string"spiffe://firemud/ns/" + workloadNamespace + "/sa/world-management-service". All copies also comparepeer.namespace()andSessionContext.hasAuthenticatedCallerContext(). A future change to only one copy will make the receiver and owner disagree on the authentication boundary.dependencyFailure,requireNoAmbientTransaction,freshReadId, andtransaction(...)are also duplicated between the two owner services.Move the predicate into one package-level helper, for example
ActivationProtectionPeers.isExactWorldPeer(String namespace). Call that helper from all four locations.- Accepted Four Account owner/receiver predicates duplicate the same boundary. Share only this predicate, preserving null-peer status, exact URI, namespace and caller-context checks.
- Translate Jackson 3 parse failures to
IllegalArgumentExceptioninfromStored.MinorThis class uses Jackson 3 (
tools.jackson). In Jackson 3,JacksonExceptionextendsRuntimeExceptionand is not anIOException. Thecatch (IOException invalid)block therefore does not catch these failures:- malformed JSON
- duplicate keys from
STRICT_DUPLICATE_DETECTION - trailing tokens from
FAIL_ON_TRAILING_TOKENS
For stored bytes with any of these defects,
fromStoredthrows a rawStreamReadException. It does not throw the documentedIllegalArgumentException. Callers that classify invalid evidence byIllegalArgumentExceptionthen take their genericRuntimeExceptionbranch.AccountStartSessionActivationProtectionRequest.decodealready catchesIOException | RuntimeExceptionand translates both.canonicalRequestBytes()at Lines 89-91 has the same gap.🐛 Proposed fix
--- "a/services/common-platform-core/src/main/java/net/firedevops/firemud/common/world/WorldCanonicalInstanceActivation.java" +++ "b/services/common-platform-core/src/main/java/net/firedevops/firemud/common/world/WorldCanonicalInstanceActivation.java" @@ -199,10 +199,10 @@ throw new IllegalArgumentException("Stored canonical activation result is not canonical"); } return result; - } catch (IOException invalid) { + } catch (IOException | tools.jackson.core.JacksonException invalid) { throw new IllegalArgumentException( "Stored canonical activation result is invalid", invalid); } } }Apply the same change to the
catchincanonicalRequestBytes().- Accepted Jackson 3 parse failures escape IOException catches. Normalize JacksonException at both existing boundaries preserving bounded descriptions and causes; add canonical malformed/duplicate/trailing-store proof.
- Add tests for the other terminal-read status branches.Trivial
This file tests only the
ActivationConflictException→FAILED_PRECONDITIONbranch ofreadOriginalStartSessionActivationTerminalEvidence. It has no tests for these branches:- An empty owner result maps to
FAILED_PRECONDITIONwith "World has no exact terminal receipt; Account protection remains pending". Account uses this answer to keep protection pending. TransientDataAccessExceptionmaps toUNAVAILABLE.- A non-transient
DataAccessExceptionmaps toINTERNAL. - Any other
RuntimeExceptionmaps toINTERNAL. - An
IllegalArgumentExceptionfromtoResponsemaps toFAILED_PRECONDITION. isSynchronizationActive()without an actual transaction maps toFAILED_PRECONDITION.
Callers base retry and settlement decisions on these codes. If a change reorders the
TransientDataAccessExceptionandDataAccessExceptioncatches, a retryableUNAVAILABLEbecomes a terminalINTERNAL, and no test fails.WorldOriginalStartSessionProtectedActivationGrpcServiceTest.classifiesDomainStorageAndUnexpectedFailuresWithoutLeakingOwnerDetailsalready shows the table-driven pattern. Add the same pattern here and assert the code, the description, and zero responses.As per path instructions: "Prioritize bugs, regressions, missing tests ... especially gRPC application-error handling".
- Accepted Terminal-read callers depend on empty/storage/runtime/response/synchronization status classification. Add focused status, description and zero-response tests without changing production behavior.
- An empty owner result maps to
- Match the exact SPIFFE URI, as the sibling receivers do.Minor
isServiceandisInNamespacecompare only the parsed service and namespace fields. They do not validate the trust domain or the service-account path. This check can therefore accept a broader identity than the sibling receivers that compare the complete URI.if (peer != null && peer.isService("game-session-service") && peer.isInNamespace(trustedNamespace) + && ("spiffe://firemud/ns/" + trustedNamespace + "/sa/game-session-service") + .equals(peer.uri()) && !SessionContext.hasAuthenticatedCallerContext()) {- Rejected GrpcPeerIdentity constructor enforces canonical URI, anchored spiffe://firemud/ns/.../sa/... pattern and exact namespace/service agreement. Both field comparisons already imply the exact URI; alleged broader identity is unrepresentable.
Routed Findings
Route 1 · PR #3237 → Unassigned target OpenMajorA pending Account protection can be left without any way to settle it.
accountProtectionClient.acquire(input)makes the Account source protection durable before World writes its PENDING fence. Two failure paths can strand that protection:WorldCanonicalInstanceActivationRepository.beginProtectedActivationcallsrequireLocalProtectedActivationBinding(protection, true). That check throwsActivationDeniedExceptionif the original Game Session lease expired between acquisition and fence insert. It throwsActivationConflictExceptionif the execution binding no longer matches. In both cases no fence row exists. As a result,readTerminalEvidencereturns empty. Account settlement then getsFAILED_PRECONDITIONfrom the terminal-read RPC every time.beginProtectedActivationcan commit the fence and then raise a transient error. In that caseactivateProtectedpropagates the error. Every later call sees a PENDING fence that "this invocation" did not create. That call fails withPendingActivationException. The CAS never runs and no terminal is written.
abortProtectedexists and records a positive ABORTED terminal under the same operation lock. The service never calls it on these paths.Confirm whether Account can settle or expire a protection when World has no fence or terminal. If it cannot, do this:
- On a non-retryable denial from
beginProtectedActivationafteracquire, callactivationService.abortProtected(protection, "<code>"). This gives the caller a terminal it can settle. - Define a recovery owner for PENDING fences that no running invocation is still driving.
Unlinked items
no items unlinked