FireMUD Delivery Status

PR data refreshed

PR #3150 review history

Stage Account operation sources and encrypted response proof

Unit 1A · identity, Account and public JOIN

Review rounds

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

Hosted CodeRabbit4 completed
3/1/08/8/05/5/05/3/0
CLI CodeRabbit7 completed
2/1/01/1/04/3/04/3/01/0/0
Subagent Review4 completed
1/1/01/1/01/1/01/1/0

Recorded review history

Reviews and findings

  1. Subagent Review 1 CompletedModel: gpt-6-luna · Xhigh
    Found: 1 Accepted: 1 Routed: 0
    1. V126 denies genuine redemption sharing issuance millisecondMinor

      V126 line70;1of4 commissioned full-boundary passes complete,3remaining.

      • Accepted SQL requires later time despite millisecond owner timestamps. Allow equality with guarded transition, retaining before-issuance/expiry denial; add proof. Fix pending.
  2. CLI Review 1 CompletedRuntime 3m 10s
    Found: 4 Accepted: 0/3/0 Routed: 0
    1. Correct the claim that missing bootstrap composition denies all materializer RPC operations.Minor

      Both documents say that absent trust or bootstrap composition denies the materializer RPC operations. In AccountJwtSignerMaterializationService, only enrollBootstrap, getCurrentPromotionRequest, and recordPrivatePromotionResult require the coordinator. If a valid trust binding exists and the coordinator is absent, getCurrentGenerationRequest, recordSecretObservation, and recordGenerationResult still persist Account signer state.

      • design/architecture/microservices/account-service/runtime-and-data.md#L17-L17: state that missing trust denies all materializer RPCs, and that missing bootstrap composition denies only enrollment and the promotion RPCs. Otherwise, gate the generation RPCs in code.
      • design/project-management/implementation-tracking/player-access-and-session.md#L21-L21: apply the same correction so that the tracker matches the architecture document and the code.

      As per path instructions: "Review docs for canonical-current-state consistency." As per coding guidelines: "Keep its status, implementation record, validation, gaps, decisions, and service-map sections aligned when a domain boundary changes."

      • Accepted Fix pending in #3150 docs/tracker: distinguish missing trust (all materializer operations denied) from missing bootstrap coordinator (enrollment/promotion denied, trusted generation readback still available). Preserve runtime behavior.
    2. Allow bounded clock skew when you validate the remote observedAtEpochMillis.Minor

      Logging/Admin sets observedAtEpochMillis from its own clock. The check rejects the response when that value is greater than Account's local clock.millis(). Logging/Admin's clock can run ahead of Account's clock by more than the RPC round trip. In that case, every ISSUE and RECOVER fails with IllegalStateException, and the service maps that to FAILED_PRECONDITION. The failure lasts as long as the skew lasts, and it can recur. Accept a small explicit skew tolerance for the observation timestamp. Keep the strict claim-expiry check against local time.

      Proposed fix

      +  private static final long MAX_REMOTE_CLOCK_SKEW_MILLIS = 2_000L;
      ...
      -        || response.getObservedAtEpochMillis() > localNowEpochMillis
      +        || response.getObservedAtEpochMillis() > localNowEpochMillis + MAX_REMOTE_CLOCK_SKEW_MILLIS
      
      • Rejected Future observations deliberately fail closed (client test rejects NOW+1ms). No canonical skew allowance authorizes the proposed arbitrary 2000ms relaxation; preserve current claim expiry and observation guards rather than invent a freshness policy.
    3. Throw a state failure, not IllegalArgumentException, for stale or expired authority.Minor

      denied(...) returns IllegalArgumentException. requireCurrent and requireCurrentSnapshotForExactReplay use it for current-state conditions, such as "Original Account authority evidence is expired" and "Current Account source, generation, or membership changed". StartSessionOperatorAuthorizationGrpcService.invoke maps IllegalArgumentException to INVALID_ARGUMENT. Logging/Admin and Game Session therefore receive a caller-input error for authority drift or expiry. The documented error precedence defines OPERATOR_AUTH_REFERENCE_EXPIRED and OPERATOR_AUTH_REFERENCE_AUTHORITY_STALE as separate outcomes from request-validation failures. Keep IllegalArgumentException for decode and shape errors only. Use IllegalStateException, which maps to FAILED_PRECONDITION, for current-state denials.

      As per path instructions: "Flag changes that violate documented FireMUD invariants, especially gRPC application-error handling."

      • Accepted Fix pending in #3150: current-source/expiry authority denials must map to FAILED_PRECONDITION rather than malformed request INVALID_ARGUMENT; preserve shape/decode errors and fail-closed checks.
    4. Map key-custody unavailability to UNAVAILABLE, not INTERNAL.Minor

      AccountOperatorAuthorizationFingerprintKeyring.KeyUnavailableException and AccountResponseEnvelopeKeyring.KeyUnavailableException both extend RuntimeException. Both reach the final catch and map to INTERNAL. The response-envelope exception's own errorCode() returns retryable AUTH_UNAVAILABLE, and CryptographyUnavailableException makes the same claim. Logging/Admin and Game Session can treat INTERNAL as terminal. A transient mount withdrawal or key rotation gap can then end operations that a retry would complete. Catch these custody exceptions explicitly and return UNAVAILABLE.

      Proposed fix

           } catch (CannotCreateTransactionException unavailable) {
      +    } catch (CannotCreateTransactionException
      +        | AccountOperatorAuthorizationFingerprintKeyring.KeyUnavailableException
      +        | AccountResponseEnvelopeKeyring.KeyUnavailableException
      +        | AccountResponseEnvelopeCryptography.CryptographyUnavailableException unavailable) {
      

      As per path instructions: "Flag changes that violate documented FireMUD invariants, especially gRPC application-error handling."

      • Accepted Fix pending in #3150: map exact key-custody and response cryptography unavailable exceptions to retryable UNAVAILABLE, preserving redaction and all other status handling; add focused transport regression.
  3. Subagent Review 2 CompletedModel: gpt-6-luna · Xhigh
    Found: 1 Accepted: 1 Routed: 0
    1. V126 prevents expiry cleanup of retained operator response ciphertextMinor

      Broad full85-file review22a; V126 NOT NULL/immutable encrypted_response_envelope has no expiry-erasure path despite Account/ADR0047 bounded original-reference recovery. AES rotation is custody dependency, not a separate finding.

      • Accepted Fix in #3150: retain compact immutable idempotency/redemption proof but permit strictly owner-scoped envelope erasure after its existing persisted recovery horizon; preserve deletion/TRUNCATE and pre-expiry guards. No new numeric policy or activation.
  4. Hosted Review 1 CompletedRuntime 9m 36s
    Found: 3 Accepted: 0/1/0 Routed: 0
    1. Allow bounded clock skew for the remote observedAtEpochMillis.Major

      observedAtEpochMillis comes from the Logging/Admin clock. localNowEpochMillis comes from the Account clock. Line 166 rejects the evidence when the Logging clock is ahead of the Account clock by more than the call's round-trip time.

      In-cluster RTT is usually about 1 ms. NTP-synchronized hosts commonly differ by a few milliseconds. On an affected pod pair, every ISSUE and RECOVER call therefore throws IllegalStateException ("stale or mismatched StartSession reservation evidence"). Operators see a persistent failure that has no workaround.

      Add a small explicit skew tolerance for the upper bound. Keep the strict expiry check against local time.

      🐛 Proposed fix

      +  private static final long MAX_REMOTE_CLOCK_SKEW_MILLIS = 2_000L;
      ...
               || response.getObservedAtEpochMillis() <= 0L
      -        || response.getObservedAtEpochMillis() > localNowEpochMillis
      +        || response.getObservedAtEpochMillis()
      +            > localNowEpochMillis + MAX_REMOTE_CLOCK_SKEW_MILLIS
               || response.getClaimExpiresAtEpochMillis() <= response.getObservedAtEpochMillis()
               || response.getClaimExpiresAtEpochMillis() <= localNowEpochMillis) {
      
      • Rejected Repeats rejected CLI clock-skew relaxation. Current client proof deliberately rejects NOW+1ms and no owning contract authorizes arbitrary 2000ms allowance; preserve observation/claim-expiry fail-closed guards.
    2. Link the new subsection to AA-1.3 and record its anchors.Minor

      The new subsection adds V126 and multiple Account operation-source components, but it does not identify an owning capability or list production and proof anchors. The preceding paragraph covers the separate V99–V125 signer/currentness preparation.

      Add the new production anchors, such as AccountControlUiIssuanceService, AccountJwtSignerMaterializationService, and V126. Add the applicable test anchors and state which reported checks passed versus which composed, PostgreSQL, mTLS, and end-to-end checks remain pending. Do not add a new capability row unless the tracker defines one for this work.

      Suggested tracker update

       ### Account operation and signer source preparation
       
      +This preparation is owned by [AA-1.3](#capability-status). Its production anchors include [AccountControlUiIssuanceService.java](../../../services/account-service/src/main/java/net/firedevops/firemud/accountservice/service/session/AccountControlUiIssuanceService.java), [AccountJwtSignerMaterializationService.java](../../../services/account-service/src/main/java/net/firedevops/firemud/accountservice/service/impl/AccountJwtSignerMaterializationService.java), and [V126](../../../services/account-service/src/main/resources/db/migration/V126__start_session_operator_authorization.sql). Add the applicable Account operation-source test anchors and record their validation status in the AA-1.3 row.
      +
       The current Account cut adds V126 operator-authorization storage, default-inactive StartSession authorization sources, Control-UI issuance and Redis coordination, Account-owned JWKS and signer-materialization adapters, and readiness-probe sources.
      
      • Accepted Fix pending in #3150 tracker: associate source preparation with AA-1.3 and exact production/test anchors, distinguish qualified run-owned PG/Redis CI proof from unproved live mTLS/full flow/activation; no capability-state upgrade.
    3. Make the isAllowedPeer check match the stricter verifiedLoggingPeerUri check.Major

      isAllowedPeer compares peer.namespace() and peer.uri(). verifiedLoggingPeerUri also requires peer.service() to equal logging-admin-service. Suppose GrpcPeerIdentity can return a URI and a service() value that disagree. ISSUE and RECOVER then pass the gate and run authorizationService.issue or recover, which can mutate state. After that, the response mapping throws IllegalStateException. The caller receives FAILED_PRECONDITION after a durable mutation, not PERMISSION_DENIED before it. Apply the same service() check in isAllowedPeer so both gates use one predicate.

      ♻️ Proposed fix

           return peer != null
               && workloadNamespace.equals(peer.namespace())
      +        && serviceAccount.equals(peer.service())
               && peer.uri().equals("spiffe://firemud/ns/" + workloadNamespace + "/sa/" + serviceAccount);
      
      • Rejected GrpcPeerIdentity compact constructor already rejects URI/namespace/service disagreement. Matching exact namespace and canonical URI therefore implies the service match before operations; hypothesized inconsistent identity cannot be constructed.
  5. CLI Review 2 CompletedRuntime 3m 05s
    Found: 5 Accepted: 0/2/2 Routed: 0
    1. Allow a small bounded clock skew when you check observedAtEpochMillis.Minor

      Logging/Admin sets observedAtEpochMillis from its own clock. Account compares that value with its local clock.millis(). If the Logging/Admin pod clock is ahead by 1 ms or more, observedAt > localNow is true. The client then throws "stale or mismatched", and ISSUE or RECOVER fails as FAILED_PRECONDITION. Normal NTP skew between nodes can trigger this failure at random. The claim-expiry check against local time already protects freshness. A small, explicit future tolerance does not weaken that check.

      Proposed fix

      +  private static final long MAX_FUTURE_SKEW_MILLIS = 2_000L;
      @@
      -        || response.getObservedAtEpochMillis() > localNowEpochMillis
      +        || response.getObservedAtEpochMillis() > localNowEpochMillis + MAX_FUTURE_SKEW_MILLIS
      
      • Rejected Repeated already-adjudicated suggestion. Existing owning contract and test reject future observation even NOW+1ms; no approved clock-skew policy permits arbitrary 2000ms tolerance. Preserve fail-closed guard.
    2. Do not use the raw controlPlaneRequestId as the ASCII envelope requestId.Minor

      responseBinding passes tuple.controlPlaneRequestId() to AccountResponseEnvelopeCryptography.Binding. The Binding constructor validates it against [A-Za-z0-9._:/@+-]{1,256}, and writeString encodes it as US-ASCII. The tuple and the repository accept canonical NFC request IDs of up to 128 UTF-8 bytes. realPostgresAcceptsCanonicalNfcRequestIdAt128Utf8BytesAndRejectsOversizeBeforeInsert stores "é".repeat(64), for example.

      For any non-ASCII request ID, prepareIssuance throws IllegalArgumentException. The gRPC adapter then returns INVALID_ARGUMENT for input that every other layer accepts. Bind a fixed-format derivative instead, for example the hex SHA-256 of the UTF-8 request ID. The exact request ID is already covered by sha256(exactTuple) in requestDigest.

      Proposed fix

           return new Binding(
               ENVELOPE_OPERATION,
      -        tuple.controlPlaneRequestId(),
      +        java.util.HexFormat.of()
      +            .formatHex(sha256(tuple.controlPlaneRequestId().getBytes(StandardCharsets.UTF_8))),
               sha256(exactTuple),
      

      This change modifies the envelope AAD. Apply it before any envelope is persisted, or keep the old binding for existing ASCII rows.

      • Accepted Verified accepted NFC/128-UTF8 request IDs fail ASCII-only envelope binding. Correct owner-derived binding without changing generic crypto or losing retained ASCII envelope recovery; full tuple digest remains bound. Fix pending.
    3. Assert the failure cause in the negative composition tests.Trivial

      These tests check only assertThat(context).hasFailed(). Any startup failure makes them pass, including failures that are not related to the condition each test names.

      • explicitOptInFailsClosedWhenOwnerAndKeySourcesAreUnavailable does not register OwnerDependencies. The context therefore fails on a missing collaborator bean. The test does not prove the fail-closed key-source behavior.
      • The three invalidNamespaceOrUnboundedTimingPreventsOwnerComposition cases cannot tell the namespace rejection apart from the lifetime or recovery-window rejection.
      • The missingOrReusedOperatorResponseMountPreventsOwnerComposition cases cannot tell the missing-mount rejection apart from the reused-mount rejection.

      Assert the root cause type or message for each case, for example with getStartupFailure() and hasRootCauseMessage(...).

      ♻️ Example assertion

      -        .run(context -> assertThat(context).hasFailed());
      +        .run(
      +            context ->
      +                assertThat(context)
      +                    .getFailure()
      +                    .hasRootCauseInstanceOf(IllegalArgumentException.class)
      +                    .rootCause()
      +                    .hasMessageContaining("reference-lifetime"));
      

      Also applies to: 149-185

      • Accepted Useful negative-proof correction: startup failure alone permits false passes; register owner collaborators where needed and assert exact namespace/timing/mount/key-source failures. Fix pending.
    4. Align the keyops rule with the prepublication validator.Minor

      Align the `key_ops` rule with the prepublication validator.

      AccountJwtJwksPrepublicationService.validateRetainedJwk accepts retained keys with 6 or 7 fields, so key_ops is optional there. publicKeyFingerprints requires all 7 fields, including key_ops: ["verify"]. Consider a pre-created jwt-jwks ConfigMap whose keys omit key_ops:

      1. Prepublication succeeds and writes that key set unchanged.
      2. Every later load()/sourceIdentity() call rejects the same published set.

      After step 2, readiness probes and control-ui verification are blocked with no recovery path. Choose one rule and apply it in both validators. Either require key_ops in prepublication, or make it optional here.

      Proposed fix (accept the prepublication contract)

      -        if (key == null || !key.isObject() || !hasExactFields(key, JWK_FIELDS)) {
      +        if (key == null
      +            || !key.isObject()
      +            || !(hasExactFields(key, JWK_FIELDS)
      +                || hasExactFields(key, java.util.Set.of("kty", "use", "alg", "kid", "n", "e")))) {
                 throw new IllegalArgumentException();
               }
      @@
      -            || keyOps == null
      -            || !keyOps.isArray()
      -            || keyOps.size() != 1
      -            || !keyOps.get(0).isTextual()
      -            || !"verify".equals(keyOps.get(0).textValue())) {
      +            || (keyOps != null
      +                && (!keyOps.isArray()
      +                    || keyOps.size() != 1
      +                    || !keyOps.get(0).isTextual()
      +                    || !"verify".equals(keyOps.get(0).textValue())))) {
      
      • Accepted Verified producer/consumer contract mismatch: prepublication retains six-field JWKs without key_ops, trusted source demands seven. Accept existing optional key_ops with exact verify when present; preserve all private/unknown-field guards. Fix pending.
    5. Remove the unused jackson-databind dependency.Trivial

      RedisScriptCatalog, RedisScriptContribution, and RedisScriptDescriptor use only java.util types. No main source in this module uses Jackson. Remove the dependency so the shared contract module stays dependency-free and does not force Jackson onto its consumers' classpath.

      ♻️ Proposed fix

       dependencies {
      -    implementation("tools.jackson.core:jackson-databind")
      -
           testImplementation(libs.spring.boot.starter.test)
       }
      
      • Accepted Trivial dependency hygiene: contract module uses no Jackson; remove unused implementation dependency and validate actual contracts/Account compilation. Fix pending in current PR.
  6. Subagent Review 3 CompletedModel: gpt-6-luna · Xhigh
    Found: 1 Accepted: 1 Routed: 0
    1. Retained prepared signer promotion dispatches without required coordinator compositionMinor

      AccountJwtSignerMaterializationService.java:247-378; full86-path broad pass, gpt-6-luna xhigh; no tests run.

      • Accepted Verified getCurrentPromotionRequest checks coordinator only on missing prepared state, then dispatches retained prepared state; receipt also mutates before missing coordinator denial. Enforce the documented deny boundary before promotion effects; fix pending.
  7. CLI Review 3 CompletedRuntime 3m 22s
    Found: 2 Accepted: 0/1/0 Routed: 0
    1. Allow bounded clock skew for observedAtEpochMillis.Minor

      Line 166 rejects any response where Logging/Admin's observedAtEpochMillis is later than Account's local clock.millis(). These are two separate hosts. Consider this case: the Logging clock runs a few milliseconds ahead of Account, and the in-cluster round trip is shorter than that skew. Every valid claim read then fails with "stale or mismatched StartSession reservation evidence". ISSUE and RECOVER then return FAILED_PRECONDITION at random, depending on NTP drift between the pods.

      Add a small explicit skew tolerance for the future-timestamp check. Keep the strict claimExpiresAt > localNow check.

      Proposed fix

      +  private static final long MAX_CLOCK_SKEW_MILLIS = 2_000L;
       ...
               || response.getObservedAtEpochMillis() <= 0L
      -        || response.getObservedAtEpochMillis() > localNowEpochMillis
      +        || response.getObservedAtEpochMillis() > localNowEpochMillis + MAX_CLOCK_SKEW_MILLIS
      
      • Rejected Duplicate clock-skew relaxation rejected: future observations widen finite authority without a canonical tolerance contract. Account local-clock expiry stays strict; StartSessionReservationEvidenceClientTest denies localNow+1ms. No current-PR fix.
    2. Update the AA-1.3 capability row to match the new narrative.Minor

      This section states that the new cut is tracked under AA-1.3. It names new production anchors: AccountControlUiIssuanceService.java, AccountJwtSignerMaterializationService.java, and V126. It also names new focused proof anchors. The AA-1.3 row in Capability Status (Line 93) was not updated:

      • The implementation-anchor cell does not list V126, V126.1, the materializer gRPC service, or the StartSession owner service.
      • The proof-anchor cell does not list the new StartSession or control-ui suites.
      • The gap cell still reads "signer runtime/currentness remains inactive". After this change, AccountJwtSignerMaterializationService is always registered as a @GrpcService, and only the trust binding denies it by default.

      The guideline makes the capability rows the complete scan-first status surface. Readers who check only the table miss this cut. Also confirm that StartSession operator authorization belongs to AA-1.3 and not to the SEC-04/AA-2.x operator-mutation capability. Then update the owning row and the Capability Allocation handoff to match.

      As per coding guidelines: "Keep its status, implementation record, validation, gaps, decisions, and service-map sections aligned when a domain boundary changes" and "Each tracker contains one Capability Status row for every capability it primarily owns ... the capability rows are the complete scan-first status surface."

      • Accepted Minor tracker drift: align AA-1.3 row/handoff with V126/V126.1, registered default-trust-denied materializer, StartSession sources and proof. Preserve partial/drift-found, SEC-04 lifecycle ownership and activation gaps. Documentation correction delegated.
  8. Hosted Review 2 CompletedRuntime 10m 50s
    Found: 8 Accepted: 0/4/4 Routed: 0
    1. Keep one AccountPublicJwksCache per owner instance. Both verifiers create a new cache on every call.Trivial

      Both verifiers create a new AccountPublicJwksCache for each verification, so the 30-second TTL never applies. Each Control-UI actor check therefore reloads the trusted JWKS source. A reload runs SelfSubjectReview, two Namespace GETs, one ConfigMap GET, and two owner SQL transactions. Store the cache in a field and create it lazily after sourceIdentity() pins the source.

      • services/account-service/src/main/java/net/firedevops/firemud/accountservice/service/session/AccountControlUiActorService.java#L224-L230: replace the per-call new AccountPublicJwksCache(...) in verifySigned with a lazily created field.
      • services/account-service/src/main/java/net/firedevops/firemud/accountservice/service/session/AccountControlUiCurrentActorVerifier.java#L206-L211: replace the per-call cache in verify with a lazily created field. Get currentJwks from that cache instead of making a second publicJwks.load() call.

      📍 Affects 2 files

      • services/account-service/src/main/java/net/firedevops/firemud/accountservice/service/session/AccountControlUiActorService.java#L224-L230 (this comment)
      • services/account-service/src/main/java/net/firedevops/firemud/accountservice/service/session/AccountControlUiCurrentActorVerifier.java#L206-L211
      • Accepted Partially accepted Trivial: persist finite cryptographic JWKS cache per owner with immutable source pin. Retain separate fresh owner/signer-receipt read; do not cache current authorization or add new snapshot API. Add TTL/source-pin proof.
    2. Replace the message-substring check with a dedicated exception type.Trivial

      The catch block decides whether to rethrow by testing getMessage().contains("Account trusted public JWKS source"). That check depends on the wording of rejected(). If the text of rejected() changes, or another IllegalStateException contains the same phrase, the classification breaks without any error. Use a private IllegalStateException subclass in rejected() and match on that type.

      ♻️ Proposed refactor

      --- "a/services/account-service/src/main/java/net/firedevops/firemud/accountservice/service/session/AccountJwtJwksTrustedSource.java"
      +++ "b/services/account-service/src/main/java/net/firedevops/firemud/accountservice/service/session/AccountJwtJwksTrustedSource.java"
      @@ -304,17 +304,11 @@
               throw unavailable();
             }
             return result;
      -    } catch (RuntimeException ownerStateUnavailable) {
      -      if (ownerStateUnavailable instanceof SourceUnavailableException unavailable) {
      -        throw unavailable;
      -      }
      -      if (ownerStateUnavailable instanceof IllegalStateException
      -          && ownerStateUnavailable.getMessage() != null
      -          && ownerStateUnavailable.getMessage().contains("Account trusted public JWKS source")) {
      -        throw ownerStateUnavailable;
      -      }
      -      throw rejected();
      -    }
      +    } catch (SourceUnavailableException | SourceRejectedException expected) {
      +      throw expected;
      +    } catch (RuntimeException ownerStateUnavailable) {
      +      throw rejected();
      +    }
         }
       
         /**
      
      private static final class SourceRejectedException extends IllegalStateException {
        private SourceRejectedException() {
          super("Account trusted public JWKS source was rejected");
        }
      }
      
      private static IllegalStateException rejected() {
        return new SourceRejectedException();
      }
      
      • Accepted Trivial: JWKS rejection classification depends on message substring. Use private typed rejection exception; preserve source-unavailable classification and fail-closed unexpected exceptions.
    3. Reuse captureOwnerLinearization() instead of repeating its query in prepare.Trivial

      prepare repeats the pg_current_xact_id() / nextval('account_control_ui_source_fence') query and its validation from captureOwnerLinearization(). The copy uses an inline regex instead of TRANSACTION_ID. Call the existing method so that both paths keep one validation rule.

      ♻️ Proposed refactor

      --- "a/services/account-service/src/main/java/net/firedevops/firemud/accountservice/service/session/AccountControlUiIssuanceRepository.java"
      +++ "b/services/account-service/src/main/java/net/firedevops/firemud/accountservice/service/session/AccountControlUiIssuanceRepository.java"
      @@ -95,17 +95,9 @@
           Instant recovery = issuedAt.plusSeconds(60);
           var spec =
               new AccountControlUiSigningSpec(operationId, requestId, jti, source, issuedAt, expiry);
      -    var transaction =
      -        dsl.fetchOne(
      -            "SELECT pg_current_xact_id()::TEXT AS xid, nextval('account_control_ui_source_fence') AS fence");
      -    if (transaction == null) {
      -      throw denied();
      -    }
      -    String xid = transaction.get("xid", String.class);
      -    Long fence = transaction.get("fence", Long.class);
      -    if (xid == null || !xid.matches("[1-9][0-9]{0,19}") || fence == null || fence <= 0) {
      -      throw denied();
      -    }
      +    OwnerLinearization linearization = captureOwnerLinearization();
      +    String xid = linearization.transactionId();
      +    long fence = linearization.sourceFence();
           Map<String, Object> ref =
               Map.of(
                   "bundleVersion",
      
      • Accepted Trivial: reuse existing transaction-bound captureOwnerLinearization rather than duplicate identical xid/fence query and validation. Preserve exact capture and one allocator increment.
    4. Do not hold the provider monitor during the blocking client.connect.Minor

      openPinnedConnection is synchronized, and it opens a new physical Redis connection on every call. Every Coordination read, CAS, and revoke goes through this method. One slow or timing-out connect therefore blocks all other Account Coordination callers until the Lettuce connect timeout expires. Track closed with a volatile field or an AtomicBoolean, and call connect outside the lock.

      🔧 Proposed fix

      -  private boolean closed;
      +  private final java.util.concurrent.atomic.AtomicBoolean closed =
      +      new java.util.concurrent.atomic.AtomicBoolean();
       ...
         @Override
      -  public synchronized StatefulRedisConnection<byte[], byte[]> openPinnedConnection() {
      -    if (closed) {
      +  public StatefulRedisConnection<byte[], byte[]> openPinnedConnection() {
      +    if (closed.get()) {
             throw new IllegalStateException("Account Coordination Redis client is closed");
           }
           return client.connect(ByteArrayCodec.INSTANCE);
         }
       ...
         @Override
      -  public synchronized void close() {
      -    if (!closed) {
      -      closed = true;
      +  public void close() {
      +    if (closed.compareAndSet(false, true)) {
             client.shutdown();
           }
         }
      
      • Accepted Minor: synchronized blocking Redis connect serializes unrelated callers and shutdown. Narrow atomic closed-state handling with connect outside monitor; prove concurrent close/connect failure and idempotent shutdown.
    5. Handle Spring-translated database failures as unavailable.Minor

      Account applies the jOOQ convention, which adds Spring Boot’s jOOQ starter. Spring Boot’s ExceptionTranslatorExecuteListener can translate SQL failures into org.springframework.dao.DataAccessException. That exception bypasses the current jOOQ-only catch and reaches the generic RuntimeException handler, which returns INTERNAL instead of preserving the existing SQLSTATE 08 to UNAVAILABLE mapping.

      Use a multi-catch so both exception types keep the same classification:

      --- "a/services/account-service/src/main/java/net/firedevops/firemud/accountservice/service/impl/StartSessionOperatorAuthorizationGrpcService.java"
      +++ "b/services/account-service/src/main/java/net/firedevops/firemud/accountservice/service/impl/StartSessionOperatorAuthorizationGrpcService.java"
      @@ -548,7 +548,7 @@
                 observer,
                 Status.UNAVAILABLE,
                 "Account operator authorization is temporarily unavailable");
      -    } catch (DataAccessException failure) {
      +    } catch (DataAccessException | org.springframework.dao.DataAccessException failure) {
             Status status = hasConnectionFailureSqlState(failure) ? Status.UNAVAILABLE : Status.INTERNAL;
             fail(
                 observer,
      
      • Accepted Minor: Spring-translated SQL failures bypass jOOQ-only handler. Accept both exception families under existing cause-chain SQLSTATE08 classification; non-connectivity failures remain INTERNAL. Add receiver regressions.
    6. Delegate readActive to AccountControlUiRegistryReader instead of keeping a weaker copy.Trivial

      AccountControlUiCoordination.readActive and AccountControlUiRegistryReader.readActive both read the same session:auth:token: record. The checks differ:

      • The reader enforces the exact field set and RFC 8785 canonical bytes.
      • The reader enforces UUID and digest formats.
      • The reader enforces registryVersion == 2.
      • This copy checks only five fields.

      AccountControlUiActorService uses this weaker copy. AccountControlUiCurrentActorVerifier uses the reader. Each caller later compares the bytes with the stored activeRegistry, so this is not currently exploitable. The two paths can still drift. Have this method call AccountControlUiRegistryReader, or share the withConnection and parse logic.

      • Accepted Trivial: Coordination active reader duplicates weaker checks. Delegate to existing canonical RegistryReader with same pinned connection/ACL/physical-expiry safeguards; prove malformed registry denial.
    7. Guard nextRecord.exp before the arithmetic.Minor

      Line 17 evaluates nextRecord.exp * 1000 without a type check. The exp field can be missing or non-numeric. Arithmetic on nil or on a non-numeric string raises a Lua runtime error. The script then returns an error reply instead of the -1 validation outcome. The Java caller maps that error to denial. The script still fails closed, but its declared outcome contract does not cover this path. Check that exp is a number before the multiplication.

      Proposed fix

      -    or nextRecord.exp * 1000 ~= deadline then return -1 end
      +    or type(nextRecord.exp) ~= 'number'
      +    or nextRecord.exp * 1000 ~= deadline then return -1 end
      
      • Accepted Minor: Lua exp missing/nonnumeric throws instead of declared -1 validation result. Type-check before arithmetic; numeric deadline equality remains exact. Add malformed-exp script regression.
    8. Map ResponseRecoveryExpiredException to a terminal FAILED_PRECONDITION, not INTERNAL.Minor

      openOriginalResponse calls AccountResponseEnvelopeCryptography.decrypt. After response_envelope_expires_at, decrypt throws ResponseRecoveryExpiredException when the envelope has not been erased yet. That exception extends RuntimeException, not IllegalStateException. The final catch (RuntimeException) therefore turns it into INTERNAL.

      The trigger is a late ISSUE retry or RECOVER after the recovery deadline. Erasure has no scheduler, so the envelope usually remains present. Two outcomes are then inconsistent for the same operation:

      • After erasure, ResponseEnvelopeErasedException maps to FAILED_PRECONDITION.
      • Before erasure, the same expiry maps to INTERNAL.

      Logging & Admin can treat INTERNAL as an unknown failure and keep retrying an operation that can never succeed. The contract defines RESPONSE_RECOVERY_EXPIRED as terminal for the original attempt.

      🐛 Proposed fix

      --- "a/services/account-service/src/main/java/net/firedevops/firemud/accountservice/service/impl/StartSessionOperatorAuthorizationGrpcService.java"
      +++ "b/services/account-service/src/main/java/net/firedevops/firemud/accountservice/service/impl/StartSessionOperatorAuthorizationGrpcService.java"
      @@ -561,12 +561,17 @@
             fail(observer, mapped, descriptionFor(mapped));
           } catch (IllegalArgumentException malformed) {
             fail(observer, Status.INVALID_ARGUMENT, "StartSession authorization input is invalid");
      +    } catch (AccountResponseEnvelopeCryptography.ResponseRecoveryExpiredException expired) {
      +      fail(
      +          observer,
      +          Status.FAILED_PRECONDITION,
      +          "Original StartSession authorization response is no longer recoverable");
           } catch (IllegalStateException rejected) {
             fail(
                 observer,
                 Status.FAILED_PRECONDITION,
                 "Current Account authorization evidence is unavailable");
           } catch (RuntimeException failure) {
             fail(observer, Status.INTERNAL, "Account operator authorization could not be completed");
           }
         }
      

      Add import net.firedevops.firemud.accountservice.service.session.AccountResponseEnvelopeCryptography;. Add a receiver test that makes the owner throw this exception, the same way the existing unavailable-type test does.

      • Accepted Minor: expired retained response crypto throws RuntimeException mapped INTERNAL unlike erased envelope. Map exact recovery-expired type to terminal FAILED_PRECONDITION; preserve generic runtime INTERNAL and proof.
  9. CLI Review 4 CompletedRuntime 3m 05s
    Found: 1 Accepted: 0/1/0 Routed: 0
    1. Remove the implementation status from the AA-1.3 allocation rationale.Minor

      Lines 7 and 9 of this document say that the allocation map "is … not a source of … implementation status". The new rationale adds the V126/V126.1 source-preparation state, "StartSession remains off by default", and "materializer trust defaults to deny". Those facts are status. player-access-and-session.md already records them in its AA-1.3 row and its "Account operation and signer source preparation" subsection. If the status changes, the two documents will drift apart.

      Keep only the ownership statement in this row.

      Proposed fix

      -| `AA-1.3` | … | Account Service owns credential, recovery, security-policy, and data-rights decisions. V126/V126.1 StartSession authorization and signer-materialization sources are Account-owned, source-only preparation under AA-1.3; StartSession remains off by default and materializer trust defaults to deny, without assigning operator lifecycle ownership to AA-1.3. Shared Runtime supplies trust propagation and Platform Operations supplies operator and deployment controls. |
      +| `AA-1.3` | … | Account Service owns credential, recovery, security-policy, and data-rights decisions, including Account-owned StartSession authorization and signer-materialization sources; operator lifecycle ownership is not assigned to AA-1.3. Shared Runtime supplies trust propagation and Platform Operations supplies operator and deployment controls. |
      

      Based on learnings: "do not duplicate canonical technical contracts … use this documentation only to track implementation-specific status" in the owning tracker. As per coding guidelines, the tracker is "the reader-facing account of implementation status".

      • Accepted Minor documentation drift: allocation map explicitly excludes implementation status. Keep static Account/SharedRuntime/Platform ownership only; implementation and defaults remain in owning AA-1.3 tracker. No behavioral expansion or extra discovery.
  10. Subagent Review 4 CompletedModel: gpt-6-luna · Xhigh
    Found: 1 Accepted: 1 Routed: 0
    1. Control-UI source hard-codes zero cleanup marginMinor

      Reader.checkedExpiryMillis, IssuanceRepository.Stored.expiryMillis and packaged CAS currently force exp*1000. Fix owner-bound cleanup configuration and exact physical deadline; no authority extension/activation. Full89-path pass; no runtime/physical tests executed. Reviewer additionally ran unassigned diff-check, not credited as required proof.

      • Accepted Canonical JWT/Account contract requires the configured nonnegative cleanup margin (default300000ms). Unregistered source hard-codes0 in reader, owner deadline and Lua; legal zero override does not establish a fixed zero policy. Preserve auth expiry separately and immutable retained deadline.
  11. CLI Review 5 CompletedRuntime 3m 49s
    Found: 4 Accepted: 0/0/3 Routed: 0
    1. Add tests for the coexistence, legacy-payload, and multi-key hash-tag rules.Trivial

      The tests do not cover these validations in RedisScriptDescriptor:

      • A legacy payload without legacyPayloadShape.
      • A legacyPayloadShape without a legacy payload.
      • Duplicate coexistence entries.
      • A multi-key script that has a NOT_REQUIRED hash tag.
      • A non-success outcome that is mutating.

      These rules protect Redis Cluster slot safety and payload compatibility. Add a focused negative test for each rule.

      • Accepted Five implemented descriptor rejection branches lack focused negative proof: legacy/shape mismatch both ways, duplicate coexistence, multi-key tag omission and mutating non-success. Add tests without relaxing behavior.
    2. loadInstalled counts providers only after it instantiates all of them.Trivial

      loadInstalled calls Provider::get on every service provider before the constructor checks MAX_CONTRIBUTIONS. As a result, the limit does not cap how many providers are instantiated. Use .limit(MAX_CONTRIBUTIONS + 1) before map so the constructor still rejects an overflow but stops instantiating extra providers.

      • Accepted loadInstalled realizes every SPI provider before the constructor count bound. Limit provider stream to MAX_CONTRIBUTIONS plus one before get so overflow still rejects without unbounded provider construction.
    3. Allow a bounded clock-skew tolerance for the remote observedAt timestamp.Minor

      Logging/Admin sets observedAtEpochMillis from its own clock. Line 166 rejects any value greater than the local Account clock.millis(). Normal NTP skew between pods on different nodes can be a few milliseconds. RPC latency inside a cluster is often smaller than that. A peer clock that runs slightly ahead therefore causes intermittent IllegalStateException. The gRPC service then maps that exception to FAILED_PRECONDITION, and ISSUE or RECOVER fails for valid evidence.

      Add a small explicit tolerance to the future-time check. Keep the expiry checks strict.

      🐛 Proposed fix

      +  private static final long MAX_PEER_CLOCK_SKEW_MILLIS = 1_000L;
       ...
      -        || response.getObservedAtEpochMillis() > localNowEpochMillis
      +        || response.getObservedAtEpochMillis() > localNowEpochMillis + MAX_PEER_CLOCK_SKEW_MILLIS
      
      • Rejected The proposed arbitrary one-second allowance weakens the intentional future-observation rejection. Existing in-process test explicitly denies NOW+1ms; no owning contract authorizes this skew policy. Preserve strict expiry and future-evidence denial.
    4. rpc does not check that the RPC called onCompleted.Trivial

      The helper succeeds when the RPC calls onNext and never calls onCompleted. A gRPC handler that skips completion is a protocol defect, and this fixture accepts that defect. Track completion and fail if the RPC does not complete.

      Proposed fix

           AtomicReference<Throwable> failure = new AtomicReference<>();
      +    java.util.concurrent.atomic.AtomicBoolean completed = new java.util.concurrent.atomic.AtomicBoolean();
       ...
                 @Override
      -          public void onCompleted() {}
      +          public void onCompleted() {
      +            completed.set(true);
      +          }
               });
           if (failure.get() != null)
             throw new AssertionError("Actual Account materialization RPC failed", failure.get());
      +    if (!completed.get())
      +      throw new AssertionError("Account materialization RPC did not complete");
      
      • Accepted Fixture accepts onNext without onCompleted; require terminal completion as well as a value and preserve RPC error failure.
  12. Hosted Review 3 CompletedRuntime 10m 43s
    Found: 5 Accepted: 1/4/0 Routed: 0
    1. Derive tenantBillingCutoff applicability from current Account state, not from the token.Major

      requireClaimsCurrent adds tenantBillingCutoff to expectedTuple only when the signed tuple already contains that key. A token issued before a tenant billing cutoff can therefore omit the cutoff, and the comparison can still pass when the current tenantEvent has an applicable cutoff.

      Derive applicability from the current billing fields in tenantEvent, then require the token to contain the exact current cutoff. This also rejects an extra cutoff when the current event has none.

      --- "a/services/account-service/src/main/java/net/firedevops/firemud/accountservice/service/session/AccountControlUiCurrentActorVerifier.java"
      +++ "b/services/account-service/src/main/java/net/firedevops/firemud/accountservice/service/session/AccountControlUiCurrentActorVerifier.java"
      @@ -621,9 +621,9 @@
                               cutoff.outboxStreamKey(),
                               "outboxSequence",
                               Long.parseLong(cutoff.outboxSequence()))));
      -    if (tuple.containsKey("tenantBillingCutoff")) {
      +    if (tenantBillingCutoffApplies(tenantEvent)) {
             expectedTuple.put(
                 "tenantBillingCutoff",
                 Map.of(
                     tenantId.toString(),
                     Map.of(
      
      • Accepted Current-owner billing cutoff applicability must not be selected by token key presence. Current verified tenant event has billing provenance; compare complete current cutoff and add missing/changed/extra negatives.
    2. Align the 8 KiB binding bound for the authority bundle with the 128 KiB storage bound.Minor

      Binding rejects authorityEvidenceBundleCanonicalBytes larger than 8 KiB. AccountStartSessionOperatorAuthorizationService.responseBinding passes the full bundle.canonicalBytes() into this binding. The repository and the gRPC receiver both accept bundles up to 128 KiB (MAX_AUTHORITY_BUNDLE_BYTES). The bundle embeds authorityTuple, including privateRealmGrantVersions, so its size grows with the actor's grants. A bundle of more than 8 KiB fails every ISSUE for that actor with IllegalArgumentException. The receiver maps that exception to INVALID_ARGUMENT with the text "StartSession authorization input is invalid". The caller sent valid input, and a retry cannot succeed.

      Fix one of these:

      • Bind a SHA-256 digest of the bundle in the AAD instead of the raw bytes.
      • Lower MAX_AUTHORITY_BUNDLE_BYTES to the same bound, and enforce it in AccountStartSessionOperatorAuthorityBundle.create. That method throws IllegalStateException, so the oversized case maps to FAILED_PRECONDITION.
      • Accepted Valid authority bundles exceed the binding 8KiB bound. Fix coherent bounded binding/response/storage path while preserving v1 raw AAD and retained encrypted bytes; do not blindly replace AAD with a digest or rewrite old migration.
    3. Treat an unreceipted publication as unavailable.Minor

      publishAndRecord updates the ConfigMap before it records the publication receipt. During that gap, this branch returns the old projection. requireExactReadback then rejects it instead of allowing the cache to retain a fresh snapshot.

      Keep PREPARED handling unchanged. readCurrentCommittedSigner rejects PREPARED state before it creates CommittedSignerEvidence, so a PREPARED check here is unreachable.

      -                if (currentPublication.isEmpty()
      -                    || currentPublication.orElseThrow().receipt().isEmpty()) {
      +                if (currentPublication.isEmpty()) {
                         return new OwnerProjection(committed, projection);
                       }
      +                if (currentPublication.orElseThrow().receipt().isEmpty()) {
      +                  throw unavailable();
      +                }
      
      • Accepted Published ConfigMap without durable publication receipt is transient unavailable, not rejected old projection; preserve committed/PREPARED fences and prove cache behavior.
    4. Add the V126.2 anchor and its gap to the AA-1.3 row.Minor

      The new subsection at Line 21 says V126.2 adds the immutable Control-UI cleanup deadline. It also says retained rows without that deadline fail closed. The AA-1.3 row at Line 95 lists V126 and V126.1 as implementation anchors but not V126.2. The row's gap text also covers only "V126/V126.1". The tracker contract says capability rows are "the complete scan-first status surface". It also says the status and implementation-record sections must stay aligned. A reader who scans only the row cannot see the cleanup-deadline migration, its retained-row denial, or the bounded-cleanup and late-revocation gap.

      Fix:

      • Add [V126.2](../../../services/account-service/src/main/resources/db/migration/V126.2__account_control_ui_registry_cleanup_deadline.sql) to the implementation anchors.
      • Add the retained-row migration regression suite to the proof anchors, if that suite exists. If it does not exist, record that physical proof is pending.
      • In the gap text, state that V126.2 rows carry an immutable cleanup deadline, that retained rows without one remain unchanged and fail closed, and that bounded cleanup and late revocation are not implemented.

      As per coding guidelines: "Keep its status, implementation record, validation, gaps, decisions, and service-map sections aligned when a domain boundary changes".

      • Accepted AA-1.3 omits V126.2 and its retained-row proof/gaps. Add anchor and immutable cleanup evidence; preserve bounded-cleanup and late-revocation incompleteness.
    5. Use one proof status for the Account StartSession and Control-UI slice.Minor

      The Account architecture documents disagree about PostgreSQL/Redis proof for this slice. One document claims executed recorded-head CI proof. Another says the proof is compile-only. The PR objectives say that physical execution of the corrected head is still pending, and that the earlier physical proof ran only on historical head 22a6c39e.

      • design/architecture/microservices/account-service/runtime-and-data.md#L17-L17: name the historical head for the executed PostgreSQL/Redis proof, or state that physical execution of the current head is pending. This also matches Line 19 of the same file.
      • design/architecture/microservices/account-service/api-contracts.md#L180-L180: keep the compile-only statement, and use the same proof wording as runtime-and-data.md.

      As per path instructions, "Flag ... conflicts between architecture docs".

      📍 Affects 2 files

      • design/architecture/microservices/account-service/runtime-and-data.md#L17-L17 (this comment)
      • design/architecture/microservices/account-service/api-contracts.md#L180-L180
      • Accepted Accepted proof-status inconsistency, not the proposed pending downgrade: exact f6 hosted CI now executed PostgreSQL/Redis successfully. Align both owner docs with attributable current-head evidence and retain unproved full-service/activation limits.
  13. CLI Review 6 CompletedRuntime 3m 02s
    Found: 4 Accepted: 0/3/0 Routed: 0
    1. Allow bounded cross-service clock skew when you validate observedAtEpochMillis.Major

      observedAtEpochMillis comes from the Logging/Admin host clock. localNowEpochMillis comes from the Account host clock. Line 166 rejects the response when the observation time is even 1 ms ahead of Account's clock. Ordinary NTP skew between pods can cause this.

      When Logging/Admin's clock leads Account's, every ISSUE and RECOVER attempt fails with "stale or mismatched StartSession reservation evidence". The failure lasts as long as the skew. This blocks the operator StartSession workflow without any malformed input.

      Use a small explicit skew allowance on the future-time check. Keep the expiry check strict.

      🐛 Proposed fix

      +  private static final long MAX_FUTURE_OBSERVATION_SKEW_MILLIS = 2_000L;
       ...
      -        || response.getObservedAtEpochMillis() > localNowEpochMillis
      +        || response.getObservedAtEpochMillis()
      +            > localNowEpochMillis + MAX_FUTURE_OBSERVATION_SKEW_MILLIS
      
      • Rejected Repeated unsupported future-time tolerance; current fail-closed contract and focused test explicitly deny observedAt NOW+1ms. No selected clock-skew allowance authorizes 2000ms relaxation.
    2. Add V126.2 and V126.3 anchors to the AA-1.3 Capability Status row.Minor

      The narrative section above names two more migrations under AA-1.3: V126.2 (the cleanup deadline) and V126.3 (the envelope bounds). It also names AccountControlUiIssuancePostgresIntegrationTest as a proof anchor. The AA-1.3 row lists only V126 and V126.1, and its gap text still says "V126/V126.1 separately add…".

      The row is the scan-first status surface, so it now under-reports the capability's production and proof anchors. Add these entries to the row:

      • The V126.2 and V126.3 migration links, as implementation anchors.
      • AccountControlUiIssuancePostgresIntegrationTest, as a proof anchor.
      • A gap-text update that names the cleanup-deadline and envelope-bound limits.

      As per coding guidelines: "Each tracker contains one Capability Status row for every capability it primarily owns ... the capability rows are the complete scan-first status surface."

      • Accepted AA-1.3 scan-first row omits V126.2/V126.3 and issuance PostgreSQL proof anchors; align owned tracking.
    3. Pass Integer values to the unix:uid and unix:gid attributes.Minor

      The JDK Unix attribute view casts the unix:uid and unix:gid values to Integer. Line 366 passes 65534L. Line 377 also produces a long (... ? 1L : 0L). Both Files.setAttribute calls therefore throw ClassCastException.

      This test runs only when the process is root (assumeRootCanCreateRootOwnedFixtures). In a root CI container, credentialModeAndFrozenTrustFileIdentityDriftAreRejected fails before it checks owner or group drift. On a non-root runner, the test is skipped, so the defect stays hidden.

      🐛 Proposed fix

      -    Files.setAttribute(ownerFixture.currentToken(), "unix:uid", 65534L, LinkOption.NOFOLLOW_LINKS);
      +    Files.setAttribute(ownerFixture.currentToken(), "unix:uid", 65534, LinkOption.NOFOLLOW_LINKS);
      @@
           Files.setAttribute(
               groupFixture.currentToken(),
               "unix:gid",
      -        ((Number) gid).longValue() == 0L ? 1L : 0L,
      +        ((Number) gid).intValue() == 0 ? 1 : 0,
               LinkOption.NOFOLLOW_LINKS);
      
      • Accepted Unix uid/gid attribute setters require Integer; Long fixtures fail before root-only drift assertions.
    4. Remove the stale duplicated "current Account cut" paragraph.Minor

      Line 25 is the old version of the paragraph. Line 26 is its updated replacement. Both paragraphs remain in the file, with no blank line between them. As a result, the tracker contains claims that contradict each other:

      • Line 25 says "Corrected-head CI remains pending after publication".
      • Line 25 cites only the 22a6c39e… proof.
      • Line 26 records the later run 38113324723 and marks the 22a6c39e… result as historical.

      A reader cannot tell which proof record is current. The tracking guideline requires that the status, implementation record, and validation sections stay aligned. Delete line 25.

      📝 Proposed fix

      -The current Account cut adds V126 operator-authorization storage, ... Corrected-head CI remains pending after publication. ... with Account-local consequences in [Account Runtime and Data](../../architecture/microservices/account-service/runtime-and-data.md#implementation-status).
       The current Account cut adds V126 operator-authorization storage, default-inactive StartSession authorization sources, ...
      

      As per coding guidelines: "Keep its status, implementation record, validation, gaps, decisions, and service-map sections aligned when a domain boundary changes."

      • Accepted Two consecutive current Account-cut paragraphs contradict proof status; remove stale duplicate.
  14. Hosted Review 4 CompletedRuntime 9m 10s
    Found: 5 Accepted: 0/2/1 Routed: 0
    1. Make the same-attempt replay check consistent across the response-envelope horizon.Minor

      The branch choice depends on whether the original response envelope can still be opened. It does not depend on whether the reference has expired. This causes three outcomes for the same replay:

      • Before referenceExpiresAt, the replay takes the requireCurrent(...) branch and succeeds.
      • From referenceExpiresAt until responseEnvelopeExpiresAt, tryOpenOriginalResponse still returns the response. The code then takes the requireCurrent(...) branch. That branch throws IllegalStateException("Original Account authority evidence is expired"), so the request fails.
      • At or after responseEnvelopeExpiresAt, originalResponse is empty. The code takes requireCurrentSnapshotForExactReplay(...), and the same replay succeeds.

      Here is a realistic trigger. Game Session redeems shortly before referenceExpiresAt, the acknowledgement is lost, and Game Session retries within the next 60 s. The receiver maps the IllegalStateException to FAILED_PRECONDITION, which a caller can treat as terminal. The reference was already consumed, so Game Session sees a terminal denial for a redemption that actually committed. A later retry of the same request then succeeds. This contradicts the intent stated in the requireCurrentSnapshotForExactReplay Javadoc.

      To fix this, choose the exact-replay check whenever this is a same-attempt replay at or after reference expiry. The constantTimeEquals reference check at Lines 399-403 still runs when the response is available. AccountStartSessionOperatorAuthorizationServiceTest has no redeem test. Add one that replays inside this window.

      🐛 Proposed fix

      --- "a/services/account-service/src/main/java/net/firedevops/firemud/accountservice/service/session/AccountStartSessionOperatorAuthorizationService.java"
      +++ "b/services/account-service/src/main/java/net/firedevops/firemud/accountservice/service/session/AccountStartSessionOperatorAuthorizationService.java"
      @@ -417,22 +417,24 @@
                       request.canonicalTupleBytes(),
                       request.reservationOwnerId(),
                       request.reservationClaimFence());
      -            if (sameAttemptReplay && originalResponse.isEmpty()) {
      +            Instant now = clock.instant();
      +            if (sameAttemptReplay
      +                && (originalResponse.isEmpty() || !now.isBefore(observed.referenceExpiresAt()))) {
                     bundle.requireCurrentSnapshotForExactReplay(
                         current.source(),
                         current.stored(),
                         tuple,
                         AccountStartSessionOperatorAuthorityBundle.fromSharedReference(
                             observed.bundleReference()));
                   } else {
                     bundle.requireCurrent(
                         current.source(),
                         current.stored(),
                         tuple,
                         AccountStartSessionOperatorAuthorityBundle.fromSharedReference(
                             observed.bundleReference()),
      -                  clock.instant());
      +                  now);
                   }
                   RedemptionResult result =
                       repository.redeemExact(
                           new RedemptionRequest(
      
      • Accepted Same completed redemption retry must preserve immutable result across reference/envelope horizons; current branch rejects only intermediate window. Keep current-state equality and fresh-redemption expiry denial.
    2. Describe the retained-row test as pending physical proof.Minor

      The test defines the retained-row assertions, but the supplied PR record says physical PostgreSQL execution of the corrected head is pending. “Confirms” presents an unexecuted migration regression as established behavior. Say that the test checks these conditions and state that physical execution remains pending. As per coding guidelines: “Keep its status, implementation record, validation, gaps, decisions, and service-map sections aligned when a domain boundary changes.”

      • Rejected Premise disproved by exact44bb Validation38117703529 Accountjob114405941820 artifact11693819544: issuance PostgreSQL5/5 executes retainedV126.2 proof. Tracker/PR status updated; do not reclassify executed proof as pending.
    3. State the actual upper bound for the cleanup deadline.Minor

      Line 58 says that only a negative margin or a "checked deadline overflow" denies issuance. The code applies a stricter limit. AccountControlUiIssuanceRepository.checkedCleanupDeadlineMillis also denies any deadline above MAX_REDIS_SAFE_INTEGER (9_007_199_254_740_991, which is 2^53−1). The Lua CAS and AccountControlUiRegistryReader enforce the same ceiling. A margin that does not overflow long can still deny every new issuance.

      Line 54 in the same document states the bound as 0..Long.MAX_VALUE - configured JWT lifetime. This contradicts the enforced Control-UI bound. Document the actual bound on line 58 so that operators can choose a valid margin.

      📝 Proposed wording

      -The source-only Control-UI issuance preparation reads the configured margin through `firemud.auth.session-safety-margin-ms`; its nonnegative value is captured for new issuance rows only. Zero is an explicit valid setting, while a negative value or checked deadline overflow denies issuance.
      +The source-only Control-UI issuance preparation reads the configured margin through `firemud.auth.session-safety-margin-ms`; its nonnegative value is captured for new issuance rows only. Zero is an explicit valid setting. A negative value, a checked `long` overflow, or a resulting deadline above the Redis/Lua safe-integer ceiling (`9007199254740991` epoch milliseconds) denies issuance.
      

      As per path instructions, "Review docs for canonical-current-state consistency. Flag ... conflicts between architecture docs".

      • Accepted Control-UI issuance has stricter absolute Redis/Lua safe-integer deadline ceiling; clarify actual local configuration bound.
    4. Remove the superseded preparation paragraph.Trivial

      Line 26 repeats this paragraph and records later hosted validation. Keeping both makes “corrected-head CI remains pending” at Line 25 difficult to reconcile with the later result. Keep the later record and transfer any unique evidence from Line 25 into it. As per coding guidelines: “Keep its status, implementation record, validation, gaps, decisions, and service-map sections aligned when a domain boundary changes.”

      • Accepted Duplicate stale current Account-cut paragraph contradicts later evidence; same necessary fix as acceptedCLI1.
    5. Separate CHECK installation from validation.Minor

      On an installation with retained rows, each new CHECK causes a validation scan under a blocking ALTER TABLE lock. Use NOT VALID for installation and validate in a later transaction; validation in the same migration transaction does not release the earlier lock.

      • services/account-service/src/main/resources/db/migration/V126.2__account_control_ui_registry_cleanup_deadline.sql#L5-L5: install the cleanup-deadline CHECK as NOT VALID and schedule separate validation.
      • services/account-service/src/main/resources/db/migration/V126.3__start_session_response_envelope_bounds.sql#L59-L59: install the replacement size CHECK as NOT VALID and schedule separate validation.

      Based on learnings: adding a CHECK without NOT VALID scans the existing table under a blocking lock.

      📍 Affects 2 files

      • services/account-service/src/main/resources/db/migration/V126.2__account_control_ui_registry_cleanup_deadline.sql#L5-L5 (this comment)
      • services/account-service/src/main/resources/db/migration/V126.3__start_session_response_envelope_bounds.sql#L59-L59
      • Rejected Do not rewrite already-tested retained Flyway V126.2/V126.3 checksums or defer atomic validated guards. Inactive source preparation claims no online migration availability; future deployment planning must address scan/lock exposure without rewriting applied history.
  15. CLI Review 7 CompletedRuntime 3m 07s
    Found: 1 Accepted: 0/0/0 Routed: 0
    1. Add a bounded clock-skew tolerance to the observedAt check.Minor

      observedAtEpochMillis comes from the Logging & Admin host clock. localNowEpochMillis comes from the Account host clock. Line 166 rejects any observedAt later than local now.

      The two pods have independent clocks. Assume the Logging & Admin clock is a few milliseconds ahead of the Account clock. If the gap is larger than the RPC round-trip time, valid fresh evidence is rejected. ISSUE and RECOVER then fail intermittently with FAILED_PRECONDITION.

      Allow a small explicit skew bound for observedAt. Keep the strict claimExpiresAt > localNow check.

      Proposed fix

      +  private static final long MAX_FORWARD_CLOCK_SKEW_MILLIS = 1_000L;
       ...
               || response.getObservedAtEpochMillis() <= 0L
      -        || response.getObservedAtEpochMillis() > localNowEpochMillis
      +        || response.getObservedAtEpochMillis()
      +            > localNowEpochMillis + MAX_FORWARD_CLOCK_SKEW_MILLIS
      
      • Rejected Duplicate of prior rejected skew proposal: canonical current-evidence guard denies any future observedAt, and fixture explicitly rejects NOW+1ms. An invented 1s tolerance would weaken that boundary; no new contract authorizes it.

Routed Findings

0 Open0 Accepted/Fixed0 Rejected

No routes recorded

Unlinked items

no items unlinked