FireMUD Delivery Status

PR data refreshed

PR #3237 review history

Review rounds

Three-number pills mean: found (raw) / accepted here (useful) / routed

Hosted CodeRabbit4 completed
9/9/05/5/03/3/04/3/0
CLI CodeRabbit8 completed
1/1/03/3/03/3/02/1/01/1/0

Recorded review history

Reviews and findings

  1. Hosted Review 1 CompletedRuntime 14m 37s
    Found: 9 Accepted: 0/7/2 Routed: 0
    1. Do not hold the client monitor across super.close().Minor

      This client has the same synchronized close() defect as GrpcAccountStartSessionActivationProtectionAcquisitionClient. Update closed and initialized inside a synchronized (this) block. Then call super.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.
    2. Read selector.originalOperation() once.Trivial

      Lines 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.
    3. Do not hold the client monitor across super.close().Minor

      This client has the same synchronized close() defect as GrpcAccountStartSessionActivationProtectionAcquisitionClient. A queued certificate-reload callback can wait for the monitor that close() holds while the base watcher shutdown drains callbacks. Update the flags inside a synchronized (this) block and call super.close() outside it.

      • Accepted Accepted same bounded watcher-drain/client-monitor contention in terminal reader; preserve lifecycle flags and release monitor before superclass close.
    4. Release the client monitor before closing the certificate watcher.Minor

      super.close() releases its internal lock before it calls TlsCertificateWatcher.close(), but this override keeps the client monitor held across that call. An active reload callback can then wait for reloadChannel(), while the watcher waits for that callback. The watcher uses bounded waits, so close() 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
                 .AccountStartSessionActivationProtectionAcquisitionServiceBlockingStub
      

      Apply 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.
    5. Add the receiving source commit for the focused proof.Minor

      The Player Access anchor resolves, and the World Capability Status table already records the related GR-2.1 capability 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.
    6. Keep the terminal-read contract consistent with the gRPC error path.Minor

      When World has no terminal receipt, WorldOriginalStartSessionActivationTerminalReadGrpcService returns FAILED_PRECONDITION. GrpcWorldOriginalStartSessionActivationTerminalReadClient lets that StatusRuntimeException escape, so the settlement service does not reach its null branch. 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 null wording and unreachable branch, or introduce a dedicated missing-terminal status and map only that status to null. Do not map every FAILED_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.
    7. Do not hold the client monitor across super.close().Minor

      This client has the same synchronized close() defect as GrpcAccountStartSessionActivationProtectionAcquisitionClient. While it holds the monitor, a queued safeReload callback cannot enter synchronized reloadChannel(). The base close() 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.
    8. 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 no Context: 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.
    9. Move WorldOriginalStartSessionActivationTransportTestSupport into its own file.Trivial

      This file declares a second top-level class of about 670 lines. WorldOriginalStartSessionActivationTerminalReadGrpcMtlsTest also 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 as TypeNameMismatch. Move the class to WorldOriginalStartSessionActivationTransportTestSupport.java in 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.
  2. CLI Review 1 CompletedRuntime 3m 20s
    Found: 3 Accepted: 1/2/0 Routed: 0
    1. 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.
    2. Use the same proto package as the other files in protos/world-management/v1.Major

      This file declares package worldmanagement.v1;. The sibling files original_start_session_activation_terminal_read.proto and world_canonical_instance_activation.proto declare package world_management.v1;. All three files share java_package = "net.firedevops.firemud.worldmanagement.v1".

      The mismatch has these consequences:

      • Buf's PACKAGE_SAME_DIRECTORY and PACKAGE_DIRECTORY_MATCH rules 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/v1 declare. Confirm whether the repository Buf configuration enables the PACKAGE_SAME_DIRECTORY rule.

      • 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.
    3. A transient failure in the CAS transaction leaves the activation stuck in PENDING.Minor

      beginProtectedActivation commits the PENDING fence in its own transaction. The second writeTransaction.execute then runs the lifecycle CAS. That transaction can fail for a transient reason, such as a TransientDataAccessException, a connection loss, or a serialization failure. In that case the catch block finds no terminal and rethrows the exception. The fence row stays PENDING.

      Every later call is then blocked. readProtectedActivationByAcquisitionInput returns pendingReadback(), and WorldOriginalStartSessionProtectedActivationService throws PendingActivationException. A direct activateProtected retry fails on !intent.createdByThisInvocation(). The only exit is abortProtected, 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 inside activateProtected for 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.
  3. Hosted Review 2 CompletedRuntime 12m 34s
    Found: 5 Accepted: 0/3/2 Routed: 0
    1. Move ActivationProtectionGrpcMtlsTestSupport into its own file.Trivial

      This file declares a second top-level class of about 360 lines. AccountStartSessionActivationProtectionSettlementGrpcMtlsTest also 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 reports TypeNameMismatch at Line 127. The World layer already moved its equivalent class, WorldOriginalStartSessionActivationTransportTestSupport, into a separate file. Move this class to ActivationProtectionGrpcMtlsTestSupport.java in 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.
    2. 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 use world_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.
    3. Append the observation after the existing entries.Minor

      The new entry precedes the existing 2026-10-18 entries 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.
    4. Replace the self-comparison with a real re-encoding check.Trivial

      decoded is constructed with stored as its canonicalBytes. The constructor clones that argument. The MessageDigest.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.decode and AccountStartSessionActivationProtectionRequest.decode already use the correct pattern: rebuild the value through create, 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.
    5. Map caller-identity conflicts to FAILED_PRECONDITION, not INTERNAL.Minor

      requireSameProtectionIdentity throws ActivationConflictException when the supplied protection evidence differs from the stored identity. The service propagates this exception, and the handler's generic RuntimeException catch maps it to INTERNAL. Existing protected-activation handling maps the same exception to FAILED_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.
  4. CLI Review 2 CompletedRuntime 2m 37s
    Found: 1 Accepted: 0/1/0 Routed: 0
    1. Map Account-side failures to World-owned statuses. Do not forward Account's status or report Account's receipt as caller input.Minor

      The StatusRuntimeException branch returns denied.getStatus() from the Account acquisition call. Suppose World's own mTLS identity toward Account is rejected. Account then returns UNAUTHENTICATED or PERMISSION_DENIED, and Game Session receives that code. Game Session would conclude that its own call to World was not authorized. Account INVALID_ARGUMENT is forwarded the same way.

      The IllegalArgumentException branch has a related problem. WorldOriginalStartSessionProtectedActivationService.activate validates Account's receipt with AccountStartSessionActivationProtectionAcquisitionGrpcCodec.toResponse(...). If the receipt changed the binding, that call throws IllegalArgumentException, and Game Session receives INVALID_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, to FAILED_PRECONDITION or INTERNAL. 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.
  5. CLI Review 3 CompletedRuntime 3m 36s
    Found: 4 Accepted: 1/1/1 Routed: 0
    1. Do not forward downstream StatusRuntimeException values as Account's own status.Minor

      The owner service throws StatusRuntimeException for its own decisions, such as failedPrecondition and requireWorldPeer. The same type also comes back from the downstream calls CanonicalGameInstanceLaunchAssociationClient.read and OriginalStartSessionCurrentAttemptClient.read. This catch forwards both kinds unchanged. A Game Session PERMISSION_DENIED, UNAUTHENTICATED or NOT_FOUND therefore reaches World as if Account had refused the World caller. The forwarded exception also carries the downstream trailers and description to World.

      AccountStartSessionActivationProtectionSettlementGrpcService lines 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 to FAILED_PRECONDITION or INTERNAL, 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.
    2. Check heap budgets against the 200–768 MiB carrier caps before registration.Trivial

      The terminal receipt may reach 768 MiB. The clients raise withMaxInboundMessageSize to 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.decode and WorldCanonicalInstanceActivation.Result.fromStored;
      • the create re-encode;
      • the defensive clone() calls in bounded and 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 maxInboundMessageSize against these caps;
      • or lower the caps to an empirically justified ceiling.

      bounded(...) in requireChildBounds only 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.
    3. 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 acquireOrReadExact inside withCurrentWorldReceivingParticipationCurrentness. The callback and the SQL guard reject the call after originalLeaseExpiresAt.

      The failure case is as follows:

      1. Account commits the protection and its source children.
      2. The World caller loses the response, for example through a deadline or a connection reset.
      3. 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 needs account_protection_id and account_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. Per runtime-and-data.md line 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.
    4. Extract the duplicated mTLS-material validation and client lifecycle into one shared helper.Trivial

      requireFileBackedMtls and requireReadableFile are copied nearly verbatim into four new clients:

      • GrpcAccountStartSessionActivationProtectionAcquisitionClient
      • GrpcAccountStartSessionActivationProtectionSettlementClient
      • GrpcWorldOriginalStartSessionActivationTerminalReadClient
      • GrpcWorldOriginalStartSessionProtectedActivationClient

      The four clients also repeat the same init/close/requireStub state machine. The same pattern of copying appears on the server side: the exact-World-peer check and hasConnectionFailureSqlState are 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 abstract ExplicitInitReloadingClient base.

      • 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.
  6. CLI Review 4 CompletedRuntime 2m 44s
    Found: 1 Accepted: 0/1/0 Routed: 0
    1. 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 uses fetchOne. One fence row can match by activation_request_id while a different row matches by canonical_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 case fetchOne throws jOOQ TooManyRowsException. The gRPC adapter then maps the exception to INTERNAL ("World protected activation failed"). It should be the FAILED_PRECONDITION conflict that requireSameAcquisitionInput gives 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_fence has unique keys on both activation_request_id and canonical_game_instance_id. If both keys are unique, at most two rows can match. The ON CONFLICT DO NOTHING insert 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.
  7. CLI Review 5 CompletedRuntime 3m 00s
    Found: 3 Accepted: 0/2/1 Routed: 0
    1. Do not report deterministic Account refusals as UNAVAILABLE.Minor

      The default -> Status.UNAVAILABLE branch turns every non-infrastructure Account status into a retryable status. This includes FAILED_PRECONDITION, PERMISSION_DENIED, INVALID_ARGUMENT and ALREADY_EXISTS. The cross-service case CHANGED_ACTIVATION_ATTEMPT shows the effect: a wrong owner attempt is a permanent refusal, but the Game Session caller receives UNAVAILABLE. A caller that retries on UNAVAILABLE will 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 foreignOwnerStatusesAreSanitizedWhileInfrastructureStatusesRemainCanonical and the CHANGED_ACTIVATION_ATTEMPT assertion.

      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.
    2. 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 Status row. 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 Status row 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.
    3. 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_ATTEMPTS transient attempts fail, activateProtected rethrows. The world_canonical_instance_activation_fence row then stays PENDING. The same thing happens if the process stops after beginProtectedActivation commits. A later call with the same input then gets PendingActivationException from WorldOriginalStartSessionProtectedActivationService. That call never retries the CAS, so the Account activation protection never reaches settlement.

      abortProtected is the only way out of PENDING. 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 abortProtected for a stranded PENDING fence.
      • 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.
  8. Hosted Review 3 CompletedRuntime 11m 42s
    Found: 3 Accepted: 0/2/1 Routed: 0
    1. 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 cd3e5515 cases 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, "implemented does not imply proven, 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.
    2. 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, StatusRuntimeException sanitization, and IllegalArgumentException. They do not cover four other branches in WorldOriginalStartSessionProtectedActivationGrpcService.activateOriginalStartSessionProtected:

      • PendingActivationException, ActivationConflictException, and ActivationDeniedException map to FAILED_PRECONDITION with the description "World protected activation is not admissible".
      • TransientDataAccessException maps to UNAVAILABLE.
      • A non-transient DataAccessException maps to INTERNAL.
      • Any other RuntimeException maps to INTERNAL.
      • The isSynchronizationActive() check is a separate ambient-transaction condition. The current test sets only setActualTransactionActive(true).

      Callers make retry decisions from these status codes. The handler classification is the gRPC application-error contract. If someone reorders the catch blocks, DataAccessException will be caught before TransientDataAccessException. That change would turn a retryable UNAVAILABLE into a terminal INTERNAL, and no test would fail. Add a parameterized case that uses the same invoke helper. 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.
    3. Require the operation-bound launch read in the activation carrier.Minor

      requireExactOriginalStartBinding checks the launch read's originalOperation only when one is present. A launch association from the World selector branch has a null originalOperation, and create still accepts it. In that case, no Game Session-authenticated evidence binds gameSessionOwnerMutationId. The launch read binds only the attempt and fence at lines 500-501.

      At acquisition time, originalCurrentAttempt compares the mutation ID. After decode, originalCurrentAttempt is null (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 test retainedLaunchOperationEchoIsExactAndCannotOmitOwnerBinding rejects only a partial echo. A launch read with the whole operation omitted still passes.

      AccountStartSessionActivationProtectionAcquisitionService.launchRequest always builds an OriginalOperation, so the production producer meets this requirement. The carrier should enforce it as well. Reject a null operation. Then update the fixtures that build unbound Result values, such as AccountStartSessionActivationProtectionEvidenceTest.request(...) and WorldOriginalStartSessionActivationTerminalEvidenceTest.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.
  9. CLI Review 6 CompletedRuntime 2m 46s
    Found: 3 Accepted: 0/3/0 Routed: 0
    1. Raise MAXPROJECTIONBYTES to the complete original-tuple bound.Minor

      Raise `MAX_PROJECTION_BYTES` to the complete original-tuple bound.

      The current redemption projection is the complete canonical tuple. StartSessionAccountRedemptionProjection.fromOriginalTuple(tuple) returns tuple.canonicalBytes(), and AccountStartSessionAdmissionProtectionEvidenceTest asserts 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_BYTES reuses this value, and createRetained applies it through bounded(...). A valid tuple between 132 KiB and 256 KiB therefore passes the tuple bound and then fails the projection bound. Acquisition stops with FAILED_PRECONDITION before Account retains protection, so World cannot activate that original StartSession. The activation PostgreSQL suite accepts this shape: lifecycleUpgradePreservesPendingProtectionAndBlocksInvalidSettlement asserts a projection larger than 135,168 bytes. Only the Java carrier rejects it.

      Confirm that StartSessionPostAuthorizationExecutionTuple.MAX_CANONICAL_TUPLE_BYTES is 256 KiB. Then derive the projection cap from that constant. Re-check the MAX_CANONICAL_BYTES budget 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.
    2. Confirm that mapping definitive owner refusals to UNAVAILABLE matches the gRPC outcome contract.Minor

      dependencyFailure keeps only the infrastructure codes. It maps every other downstream status to UNAVAILABLE, including FAILED_PRECONDITION, NOT_FOUND and PERMISSION_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 retryable UNAVAILABLE for 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 test historicalWitnessCannotSubstituteForDeniedFreshCurrentAttempt asserts 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 to AccountStartSessionActivationProtectionSettlementService.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.
    3. 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 a TransientDataAccessException because 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 outcomeUncertain failure 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.
  10. CLI Review 7 CompletedRuntime 2m 27s
    Found: 2 Accepted: 0/1/0 Routed: 0
    1. 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.
    2. Confirm that production Flyway supplies the serviceSchema placeholder before V1006 runs.Major

      V1006 uses ${serviceSchema} to resolve account_ss_activation_settlement_insert_guard(). Flyway fails a migration that contains an unresolved ${...} placeholder. This PR changed CredentialCleanupRepositoryIntegrationTest to 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 defines spring.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*.yml or the Flyway customizer for Account defines serviceSchema and 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 active search_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.
  11. CLI Review 8 CompletedRuntime 2m 40s
    Found: 1 Accepted: 0/0/0 Routed: 1
    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:

      1. WorldCanonicalInstanceActivationRepository.beginProtectedActivation calls requireLocalProtectedActivationBinding(protection, true). That check throws ActivationDeniedException if the original Game Session lease expired between acquisition and fence insert. It throws ActivationConflictException if the execution binding no longer matches. In both cases no fence row exists. As a result, readTerminalEvidence returns empty. Account settlement then gets FAILED_PRECONDITION from the terminal-read RPC every time.
      2. beginProtectedActivation can commit the fence and then raise a transient error. In that case activateProtected propagates the error. Every later call sees a PENDING fence that "this invocation" did not create. That call fails with PendingActivationException. The CAS never runs and no terminal is written.

      abortProtected exists 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 beginProtectedActivation after acquire, call activationService.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.
  12. Hosted Review 4 CompletedRuntime 12m 51s
    Found: 4 Accepted: 0/1/2 Routed: 0
    1. Extract the duplicated exact World peer check into one shared helper.Trivial

      The same exact World workload check appears in four places. These are requireWorldPeer here, requireWorldPeer in AccountStartSessionActivationProtectionSettlementService, 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 compare peer.namespace() and SessionContext.hasAuthenticatedCallerContext(). A future change to only one copy will make the receiver and owner disagree on the authentication boundary. dependencyFailure, requireNoAmbientTransaction, freshReadId, and transaction(...) 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.
    2. Translate Jackson 3 parse failures to IllegalArgumentException in fromStored.Minor

      This class uses Jackson 3 (tools.jackson). In Jackson 3, JacksonException extends RuntimeException and is not an IOException. The catch (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, fromStored throws a raw StreamReadException. It does not throw the documented IllegalArgumentException. Callers that classify invalid evidence by IllegalArgumentException then take their generic RuntimeException branch. AccountStartSessionActivationProtectionRequest.decode already catches IOException | RuntimeException and 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 catch in canonicalRequestBytes().

      • 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.
    3. Add tests for the other terminal-read status branches.Trivial

      This file tests only the ActivationConflictException → FAILED_PRECONDITION branch of readOriginalStartSessionActivationTerminalEvidence. It has no tests for these branches:

      • An empty owner result maps to FAILED_PRECONDITION with "World has no exact terminal receipt; Account protection remains pending". Account uses this answer to keep protection pending.
      • TransientDataAccessException maps to UNAVAILABLE.
      • A non-transient DataAccessException maps to INTERNAL.
      • Any other RuntimeException maps to INTERNAL.
      • An IllegalArgumentException from toResponse maps to FAILED_PRECONDITION.
      • isSynchronizationActive() without an actual transaction maps to FAILED_PRECONDITION.

      Callers base retry and settlement decisions on these codes. If a change reorders the TransientDataAccessException and DataAccessException catches, a retryable UNAVAILABLE becomes a terminal INTERNAL, and no test fails. WorldOriginalStartSessionProtectedActivationGrpcServiceTest.classifiesDomainStorageAndUnexpectedFailuresWithoutLeakingOwnerDetails already 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.
    4. Match the exact SPIFFE URI, as the sibling receivers do.Minor

      isService and isInNamespace compare 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

1 Open0 Accepted/Fixed0 Rejected
  1. 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:

    1. WorldCanonicalInstanceActivationRepository.beginProtectedActivation calls requireLocalProtectedActivationBinding(protection, true). That check throws ActivationDeniedException if the original Game Session lease expired between acquisition and fence insert. It throws ActivationConflictException if the execution binding no longer matches. In both cases no fence row exists. As a result, readTerminalEvidence returns empty. Account settlement then gets FAILED_PRECONDITION from the terminal-read RPC every time.
    2. beginProtectedActivation can commit the fence and then raise a transient error. In that case activateProtected propagates the error. Every later call sees a PENDING fence that "this invocation" did not create. That call fails with PendingActivationException. The CAS never runs and no terminal is written.

    abortProtected exists 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 beginProtectedActivation after acquire, call activationService.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