PR #3150 review history
Unit 1A · identity, Account and public JOIN
Review rounds
Three-number pills mean: found (raw) / accepted here (useful) / routed
Recorded review history
Reviews and findings
- Subagent Review 1 CompletedModel: gpt-6-luna · XhighFound: 1 Accepted: 1 Routed: 0
- 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.
- CLI Review 1 CompletedRuntime 3m 10sFound: 4 Accepted: 0/3/0 Routed: 0
- 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, onlyenrollBootstrap,getCurrentPromotionRequest, andrecordPrivatePromotionResultrequire the coordinator. If a valid trust binding exists and the coordinator is absent,getCurrentGenerationRequest,recordSecretObservation, andrecordGenerationResultstill 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.
- Allow bounded clock skew when you validate the remote
observedAtEpochMillis.MinorLogging/Admin sets
observedAtEpochMillisfrom its own clock. The check rejects the response when that value is greater than Account's localclock.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 withIllegalStateException, and the service maps that toFAILED_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.
- Throw a state failure, not
IllegalArgumentException, for stale or expired authority.Minordenied(...)returnsIllegalArgumentException.requireCurrentandrequireCurrentSnapshotForExactReplayuse it for current-state conditions, such as "Original Account authority evidence is expired" and "Current Account source, generation, or membership changed".StartSessionOperatorAuthorizationGrpcService.invokemapsIllegalArgumentExceptiontoINVALID_ARGUMENT. Logging/Admin and Game Session therefore receive a caller-input error for authority drift or expiry. The documented error precedence definesOPERATOR_AUTH_REFERENCE_EXPIREDandOPERATOR_AUTH_REFERENCE_AUTHORITY_STALEas separate outcomes from request-validation failures. KeepIllegalArgumentExceptionfor decode and shape errors only. UseIllegalStateException, which maps toFAILED_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.
- Map key-custody unavailability to
UNAVAILABLE, notINTERNAL.MinorAccountOperatorAuthorizationFingerprintKeyring.KeyUnavailableExceptionandAccountResponseEnvelopeKeyring.KeyUnavailableExceptionboth extendRuntimeException. Both reach the final catch and map toINTERNAL. The response-envelope exception's ownerrorCode()returns retryableAUTH_UNAVAILABLE, andCryptographyUnavailableExceptionmakes the same claim. Logging/Admin and Game Session can treatINTERNALas terminal. A transient mount withdrawal or key rotation gap can then end operations that a retry would complete. Catch these custody exceptions explicitly and returnUNAVAILABLE.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.
- Subagent Review 2 CompletedModel: gpt-6-luna · XhighFound: 1 Accepted: 1 Routed: 0
- 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.
- Hosted Review 1 CompletedRuntime 9m 36sFound: 3 Accepted: 0/1/0 Routed: 0
- Allow bounded clock skew for the remote
observedAtEpochMillis.MajorobservedAtEpochMilliscomes from the Logging/Admin clock.localNowEpochMilliscomes 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.
- Link the new subsection to
AA-1.3and record its anchors.MinorThe 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.
- Make the
isAllowedPeercheck match the stricterverifiedLoggingPeerUricheck.MajorisAllowedPeercomparespeer.namespace()andpeer.uri().verifiedLoggingPeerUrialso requirespeer.service()to equallogging-admin-service. SupposeGrpcPeerIdentitycan return a URI and aservice()value that disagree. ISSUE and RECOVER then pass the gate and runauthorizationService.issueorrecover, which can mutate state. After that, the response mapping throwsIllegalStateException. The caller receives FAILED_PRECONDITION after a durable mutation, not PERMISSION_DENIED before it. Apply the sameservice()check inisAllowedPeerso 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.
- CLI Review 2 CompletedRuntime 3m 05sFound: 5 Accepted: 0/2/2 Routed: 0
- Allow a small bounded clock skew when you check
observedAtEpochMillis.MinorLogging/Admin sets
observedAtEpochMillisfrom its own clock. Account compares that value with its localclock.millis(). If the Logging/Admin pod clock is ahead by 1 ms or more,observedAt > localNowis true. The client then throws "stale or mismatched", and ISSUE or RECOVER fails asFAILED_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.
- Do not use the raw
controlPlaneRequestIdas the ASCII enveloperequestId.MinorresponseBindingpassestuple.controlPlaneRequestId()toAccountResponseEnvelopeCryptography.Binding. TheBindingconstructor validates it against[A-Za-z0-9._:/@+-]{1,256}, andwriteStringencodes it as US-ASCII. The tuple and the repository accept canonical NFC request IDs of up to 128 UTF-8 bytes.realPostgresAcceptsCanonicalNfcRequestIdAt128Utf8BytesAndRejectsOversizeBeforeInsertstores"é".repeat(64), for example.For any non-ASCII request ID,
prepareIssuancethrowsIllegalArgumentException. The gRPC adapter then returnsINVALID_ARGUMENTfor 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 bysha256(exactTuple)inrequestDigest.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.
- 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.explicitOptInFailsClosedWhenOwnerAndKeySourcesAreUnavailabledoes not registerOwnerDependencies. The context therefore fails on a missing collaborator bean. The test does not prove the fail-closed key-source behavior.- The three
invalidNamespaceOrUnboundedTimingPreventsOwnerCompositioncases cannot tell the namespace rejection apart from the lifetime or recovery-window rejection. - The
missingOrReusedOperatorResponseMountPreventsOwnerCompositioncases 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()andhasRootCauseMessage(...).♻️ 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.
- Align the
keyopsrule with the prepublication validator.MinorAlign the `key_ops` rule with the prepublication validator.
AccountJwtJwksPrepublicationService.validateRetainedJwkaccepts retained keys with 6 or 7 fields, sokey_opsis optional there.publicKeyFingerprintsrequires all 7 fields, includingkey_ops: ["verify"]. Consider a pre-createdjwt-jwksConfigMap whose keys omitkey_ops:- Prepublication succeeds and writes that key set unchanged.
- 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_opsin 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.
- Remove the unused
jackson-databinddependency.TrivialRedisScriptCatalog,RedisScriptContribution, andRedisScriptDescriptoruse onlyjava.utiltypes. 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.
- Subagent Review 3 CompletedModel: gpt-6-luna · XhighFound: 1 Accepted: 1 Routed: 0
- 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.
- CLI Review 3 CompletedRuntime 3m 22sFound: 2 Accepted: 0/1/0 Routed: 0
- Allow bounded clock skew for
observedAtEpochMillis.MinorLine 166 rejects any response where Logging/Admin's
observedAtEpochMillisis later than Account's localclock.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 returnFAILED_PRECONDITIONat random, depending on NTP drift between the pods.Add a small explicit skew tolerance for the future-timestamp check. Keep the strict
claimExpiresAt > localNowcheck.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.
- 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. TheAA-1.3row inCapability 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,
AccountJwtSignerMaterializationServiceis 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 Statusrow 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.
- Hosted Review 2 CompletedRuntime 10m 50sFound: 8 Accepted: 0/4/4 Routed: 0
- Keep one
AccountPublicJwksCacheper owner instance. Both verifiers create a new cache on every call.TrivialBoth verifiers create a new
AccountPublicJwksCachefor 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 aftersourceIdentity()pins the source.services/account-service/src/main/java/net/firedevops/firemud/accountservice/service/session/AccountControlUiActorService.java#L224-L230: replace the per-callnew AccountPublicJwksCache(...)inverifySignedwith 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 inverifywith a lazily created field. GetcurrentJwksfrom that cache instead of making a secondpublicJwks.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.
- Replace the message-substring check with a dedicated exception type.Trivial
The
catchblock decides whether to rethrow by testinggetMessage().contains("Account trusted public JWKS source"). That check depends on the wording ofrejected(). If the text ofrejected()changes, or anotherIllegalStateExceptioncontains the same phrase, the classification breaks without any error. Use a privateIllegalStateExceptionsubclass inrejected()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.
- Reuse
captureOwnerLinearization()instead of repeating its query inprepare.Trivialpreparerepeats thepg_current_xact_id()/nextval('account_control_ui_source_fence')query and its validation fromcaptureOwnerLinearization(). The copy uses an inline regex instead ofTRANSACTION_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.
- Do not hold the provider monitor during the blocking
client.connect.MinoropenPinnedConnectionissynchronized, 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. Trackclosedwith avolatilefield or anAtomicBoolean, and callconnectoutside 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.
- Handle Spring-translated database failures as unavailable.Minor
Account applies the jOOQ convention, which adds Spring Boot’s jOOQ starter. Spring Boot’s
ExceptionTranslatorExecuteListenercan translate SQL failures intoorg.springframework.dao.DataAccessException. That exception bypasses the current jOOQ-only catch and reaches the genericRuntimeExceptionhandler, which returnsINTERNALinstead of preserving the existing SQLSTATE08toUNAVAILABLEmapping.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.
- Delegate
readActivetoAccountControlUiRegistryReaderinstead of keeping a weaker copy.TrivialAccountControlUiCoordination.readActiveandAccountControlUiRegistryReader.readActiveboth read the samesession: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.
AccountControlUiActorServiceuses this weaker copy.AccountControlUiCurrentActorVerifieruses the reader. Each caller later compares the bytes with the storedactiveRegistry, so this is not currently exploitable. The two paths can still drift. Have this method callAccountControlUiRegistryReader, or share thewithConnectionand 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.
- Guard
nextRecord.expbefore the arithmetic.MinorLine 17 evaluates
nextRecord.exp * 1000without a type check. Theexpfield can be missing or non-numeric. Arithmetic onnilor on a non-numeric string raises a Lua runtime error. The script then returns an error reply instead of the-1validation 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 thatexpis 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.
- Map
ResponseRecoveryExpiredExceptionto a terminalFAILED_PRECONDITION, notINTERNAL.MinoropenOriginalResponsecallsAccountResponseEnvelopeCryptography.decrypt. Afterresponse_envelope_expires_at,decryptthrowsResponseRecoveryExpiredExceptionwhen the envelope has not been erased yet. That exception extendsRuntimeException, notIllegalStateException. The finalcatch (RuntimeException)therefore turns it intoINTERNAL.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,
ResponseEnvelopeErasedExceptionmaps toFAILED_PRECONDITION. - Before erasure, the same expiry maps to
INTERNAL.
Logging & Admin can treat
INTERNALas an unknown failure and keep retrying an operation that can never succeed. The contract definesRESPONSE_RECOVERY_EXPIREDas 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.
- After erasure,
- CLI Review 4 CompletedRuntime 3m 05sFound: 1 Accepted: 0/1/0 Routed: 0
- Remove the implementation status from the
AA-1.3allocation rationale.MinorLines 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.mdalready 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.
- Subagent Review 4 CompletedModel: gpt-6-luna · XhighFound: 1 Accepted: 1 Routed: 0
- 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.
- CLI Review 5 CompletedRuntime 3m 49sFound: 4 Accepted: 0/0/3 Routed: 0
- 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
legacyPayloadShapewithout a legacy payload. - Duplicate coexistence entries.
- A multi-key script that has a
NOT_REQUIREDhash 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.
- A legacy payload without
loadInstalledcounts providers only after it instantiates all of them.TrivialloadInstalledcallsProvider::geton every service provider before the constructor checksMAX_CONTRIBUTIONS. As a result, the limit does not cap how many providers are instantiated. Use.limit(MAX_CONTRIBUTIONS + 1)beforemapso 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.
- Allow a bounded clock-skew tolerance for the remote
observedAttimestamp.MinorLogging/Admin sets
observedAtEpochMillisfrom its own clock. Line 166 rejects any value greater than the local Accountclock.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 intermittentIllegalStateException. The gRPC service then maps that exception toFAILED_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.
rpcdoes not check that the RPC calledonCompleted.TrivialThe helper succeeds when the RPC calls
onNextand never callsonCompleted. 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.
- Hosted Review 3 CompletedRuntime 10m 43sFound: 5 Accepted: 1/4/0 Routed: 0
- Derive
tenantBillingCutoffapplicability from current Account state, not from the token.MajorrequireClaimsCurrentaddstenantBillingCutofftoexpectedTupleonly when the signedtuplealready contains that key. A token issued before a tenant billing cutoff can therefore omit the cutoff, and the comparison can still pass when the currenttenantEventhas 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.
- Align the 8 KiB binding bound for the authority bundle with the 128 KiB storage bound.Minor
BindingrejectsauthorityEvidenceBundleCanonicalByteslarger than 8 KiB.AccountStartSessionOperatorAuthorizationService.responseBindingpasses the fullbundle.canonicalBytes()into this binding. The repository and the gRPC receiver both accept bundles up to 128 KiB (MAX_AUTHORITY_BUNDLE_BYTES). The bundle embedsauthorityTuple, includingprivateRealmGrantVersions, so its size grows with the actor's grants. A bundle of more than 8 KiB fails every ISSUE for that actor withIllegalArgumentException. The receiver maps that exception toINVALID_ARGUMENTwith 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_BYTESto the same bound, and enforce it inAccountStartSessionOperatorAuthorityBundle.create. That method throwsIllegalStateException, so the oversized case maps toFAILED_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.
- Treat an unreceipted publication as unavailable.Minor
publishAndRecordupdates the ConfigMap before it records the publication receipt. During that gap, this branch returns the old projection.requireExactReadbackthen rejects it instead of allowing the cache to retain a fresh snapshot.Keep PREPARED handling unchanged.
readCurrentCommittedSignerrejects PREPARED state before it createsCommittedSignerEvidence, 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.
- Add the V126.2 anchor and its gap to the
AA-1.3row.MinorThe 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.3row 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.
- Add
- 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 asruntime-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.
- CLI Review 6 CompletedRuntime 3m 02sFound: 4 Accepted: 0/3/0 Routed: 0
- Allow bounded cross-service clock skew when you validate
observedAtEpochMillis.MajorobservedAtEpochMilliscomes from the Logging/Admin host clock.localNowEpochMilliscomes 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.
- 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
AccountControlUiIssuancePostgresIntegrationTestas 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 Statusrow 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.
- Pass
Integervalues to theunix:uidandunix:gidattributes.MinorThe JDK Unix attribute view casts the
unix:uidandunix:gidvalues toInteger. Line 366 passes65534L. Line 377 also produces along(... ? 1L : 0L). BothFiles.setAttributecalls therefore throwClassCastException.This test runs only when the process is root (
assumeRootCanCreateRootOwnedFixtures). In a root CI container,credentialModeAndFrozenTrustFileIdentityDriftAreRejectedfails 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.
- 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
38113324723and marks the22a6c39e…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.
- Hosted Review 4 CompletedRuntime 9m 10sFound: 5 Accepted: 0/2/1 Routed: 0
- 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 therequireCurrent(...)branch and succeeds. - From
referenceExpiresAtuntilresponseEnvelopeExpiresAt,tryOpenOriginalResponsestill returns the response. The code then takes therequireCurrent(...)branch. That branch throwsIllegalStateException("Original Account authority evidence is expired"), so the request fails. - At or after
responseEnvelopeExpiresAt,originalResponseis empty. The code takesrequireCurrentSnapshotForExactReplay(...), 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 theIllegalStateExceptiontoFAILED_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 therequireCurrentSnapshotForExactReplayJavadoc.To fix this, choose the exact-replay check whenever this is a same-attempt replay at or after reference expiry. The
constantTimeEqualsreference check at Lines 399-403 still runs when the response is available.AccountStartSessionOperatorAuthorizationServiceTesthas noredeemtest. 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.
- Before
- 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.
- 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.checkedCleanupDeadlineMillisalso denies any deadline aboveMAX_REDIS_SAFE_INTEGER(9_007_199_254_740_991, which is 2^53−1). The Lua CAS andAccountControlUiRegistryReaderenforce the same ceiling. A margin that does not overflowlongcan 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.
- 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.
- 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 VALIDfor 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 asNOT VALIDand 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 asNOT VALIDand schedule separate validation.
Based on learnings: adding a CHECK without
NOT VALIDscans 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.
- CLI Review 7 CompletedRuntime 3m 07sFound: 1 Accepted: 0/0/0 Routed: 0
- Add a bounded clock-skew tolerance to the
observedAtcheck.MinorobservedAtEpochMilliscomes from the Logging & Admin host clock.localNowEpochMilliscomes from the Account host clock. Line 166 rejects anyobservedAtlater 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 strictclaimExpiresAt > localNowcheck.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
No routes recorded
Unlinked items
no items unlinked