PR #3236 review history
Unit 1A · identity, Account and public JOIN
Review rounds
Three-number pills mean: found (raw) / accepted here (useful) / routed
Recorded review history
Reviews and findings
- Hosted Review 1 CompletedRuntime 6m 10sFound: 5 Accepted: 0/4/1 Routed: 0
- Update the stale prerequisite statement that the new section contradicts.Minor
Line 23 still states: "The actual Game Logic storage/terminal owner and Game Design selected-source/receipt pipeline remain absent from this cut and must qualify before the launch-descriptor producer can consume an intake receipt."
The new "Selected gameplay-rule retention and receipt composition" section (Lines 15-19) records the following facts:
- The Game Logic intake owner, V1003 storage, and the Game Design selected-intake and receipt owners are present.
- These owners qualified in a controlled standalone pipeline.
The two paragraphs now give conflicting current status. Change Line 23 to state the remaining gaps:
- The owners are unregistered.
- The launch-descriptor consumer and genuine release authority are unqualified.
Remove the claim that the owners are absent. Link to the new section instead of repeating it.
As per path instructions: "Flag obsolete transitional guidance" and "Review docs for canonical-current-state consistency."
- Accepted Verified same tracker says qualified controlled owners exist but older prerequisite says absent. Link to composition section, preserve unregistered launch-consumer and genuine-authority gaps.
- Keep the gRPC status code when you sanitize producer failures.Trivial
The catch block correctly removes the message and the cause, so the original creator credential cannot be reflected in the error. It also removes the
Status.Code. As a result, the caller cannot tell a transientUNAVAILABLEorDEADLINE_EXCEEDEDfailure from a definitive denial such asPERMISSION_DENIEDorFAILED_PRECONDITION.The class contract says that the caller owns recovery through
recoverAndRetainafter an uncertain acknowledgement. Only the transient codes justify that recovery path. Put the code alone into the sanitized exception, without the description or the cause. The credential cannot leak through the code, and the caller can then choose between recovery and abandonment.Possible refactor
} catch (RuntimeException denied) { // The protected original credential must never be reflected by an injected client error. - throw new IllegalStateException("Account intake authorization denied or unavailable"); + var code = io.grpc.Status.fromThrowable(denied).getCode(); + throw new IllegalStateException( + "Account intake authorization denied or unavailable (" + code + ")"); }If you apply this change, update
sanitizesProducerFailuresWithoutReflectingProtectedCredentialand the composed test's message assertion to match the new message.- Accepted Keep existing sanitized IllegalState exception family; retain only safe Status.Code enum in its message for transient-vs-denial diagnosis. Never propagate original descriptions, credentials or causes; update focused unit and composed assertions.
- Do not report integrity conflicts as
UNAVAILABLE.MinorGameLogicGameplayRuleIntakeRepository.findTerminalthrowsIllegalStateException("GL_GAMEPLAY_RULE_INTAKE_READBACK_CONFLICT")when the stored row differs from its terminal bytes.retainthrowsIllegalStateException("GL_GAMEPLAY_RULE_INTAKE_COMMIT_READBACK_MISMATCH")on a commit-readback mismatch. This catch maps both exceptions toUNAVAILABLE.Clients treat
UNAVAILABLEas a transient, retryable status.SelectedDraftGameLogicReceiptServiceand recovery callers will therefore keep retrying a permanent storage-integrity fault. The Game Design source-read endpoint already mapsIllegalArgumentException | IllegalStateExceptiontoFAILED_PRECONDITION. Use the same mapping here and inGameLogicGameplayRuleIntakeTerminalReadGrpcService. KeepUNAVAILABLEfor other runtime failures, for exampleDataAccessException.Proposed fix
--- "a/services/game-logic-service/src/main/java/net/firedevops/firemud/gamelogic/sourceintake/GameLogicGameplayRuleIntakeGrpcService.java" +++ "b/services/game-logic-service/src/main/java/net/firedevops/firemud/gamelogic/sourceintake/GameLogicGameplayRuleIntakeGrpcService.java" @@ -55,11 +55,13 @@ GameLogicIntakeRetainProtoCodec.toResponse( new GameLogicIntakeRetainEvidence(decoded, terminal))); observer.onCompleted(); } catch (StatusRuntimeException failure) { observer.onError(failure); + } catch (IllegalArgumentException | IllegalStateException conflict) { + observer.onError(Status.FAILED_PRECONDITION.asRuntimeException()); } catch (RuntimeException unavailable) { observer.onError(Status.UNAVAILABLE.asRuntimeException()); } } private static void requireGameDesignPeer(String namespace) {- Accepted Verified Game Logic repository throws permanent IllegalState readback/integrity conflicts. Map IllegalArgument/IllegalState to FAILED_PRECONDITION in both intake RPCs, retain real storage/transaction outages UNAVAILABLE; focused transport tests.
- Align ADR-0180 with the Account implementation status.Minor
The ADR states that Account has individual-party persistence, a hosted-terms catalog, and acceptance storage. The Account implementation status states that these capabilities are target-only and that no current Account storage implements them. Update the ADR to describe these as target capabilities until their implementation status changes.
- Accepted Verified inconsistency; V84/V85 and live owner repositories already provide unregistered party/catalog/acceptance storage. Correct stale Account API implementation status to match factual ADR limits, not erase implemented storage or claim genuine authority.
- Restructure this entry into the required format, or remove it.Minor
The file defines this entry format: "
YYYY-MM-DD: short title", followed by "Context", "Observation", and "Expected pattern". This entry is one paragraph with no title and no sub-fields. Every other entry in the file follows the format.The entry also records a fix that this same change completes ("Game Design now tracks the foreign Game Logic and World migration directories"). The file states: "Do not use this file as a bug log for ordinary fixes that were completed in the same piece of work."
- If the reusable lesson applies, keep only that lesson in the required format. The lesson is that classes-only proof artifacts need declared foreign migration inputs.
- Add a reconsideration trigger if a check or guard should enforce the rule. One option is a check that rejects filesystem migration reads that have no declared task input.
Proposed restructure
--- "a/design/project-management/ai-observations.md" +++ "b/design/project-management/ai-observations.md" @@ -103,7 +103,11 @@ - Expected pattern: treat the setting as a qualified local choice, not a repository-wide memory guarantee or a change to hosted sizing. - Reconsideration trigger: fresh OOM/GC thrashing or a concrete need to measure cold-build memory. -- `2026-10-15`: Classes-only foreign-owner proof artifacts intentionally omit application and Flyway resources. A composed test that reads another owner’s migrations from disk must declare those directories as task inputs; otherwise a SQL-only change can leave the composition up-to-date. The selected Game Logic proof exposed this after its forward migration was reconciled, and Game Design now tracks the foreign Game Logic and World migration directories. +- `2026-10-15`: Declare foreign migration directories read by composed proofs + - Context: the selected Game Logic composed proof reads Game Logic and World migrations from disk through classes-only proof artifacts. + - Observation: classes-only artifacts omit Flyway resources, so a SQL-only change could leave the composed task up-to-date. + - Expected pattern: declare every foreign migration directory that a composed test reads from disk as a named task input. + - Reconsideration trigger: a build check rejects undeclared filesystem migration reads in cross-service suites. - `2026-10-15`: Verify the complete absolute patch destination after the first write - Context: Gameplay’s World digest-guard helper verified its checkout but mistyped the absolute migration path, creating a file in a similarly named sibling directory outside Git. This is distinct from the earlier relative-path incident: an absolute path alone does not identify the intended checkout.As per coding guidelines: "Entry format:
YYYY-MM-DD: short title / Context / Observation / Expected pattern" and "Do not use this file as a bug log for ordinary fixes that were completed in the same piece of work."- Accepted The malformed entry is newly introduced by this active unmerged PR, not a prior base observation. Format that one new entry as reusable migration-input lesson plus trigger; preserve every historical entry and avoid completed-fix bug-log detail.
- Hosted Review 2 CompletedRuntime 7m 50sFound: 3 Accepted: 0/2/1 Routed: 0
- Test namespace isolation independently of scope.Trivial
The other-namespace actor also has a different scope. If either repository read drops its namespace predicate, the scope predicate still excludes this actor and the test passes. Seed the other namespace with
sharedscope, then usesharedin the other-namespace read assertions. Keep the existingisolatedreads to test scope separately.- Accepted Trivial: Other namespace currently also changes scope, hiding a missing namespace predicate. Use SHARED for that fixture and its positive reads, retaining independent ISOLATED negatives and unchanged-row assertions.
- Map client lifecycle failures to
UNAVAILABLE.MinorThe two read clients call
requireInitializedStub(...), which throwsIllegalStateExceptionwhen the client is closed or not initialized.retainandabortinvoke these readers before persistence. The gRPC handler maps that exception toFAILED_PRECONDITION, so a retryable client lifecycle failure becomes permanent. The underlyingStatusRuntimeExceptionpath is already forwarded correctly.Convert the
IllegalStateExceptionraised during each blocking read toStatus.UNAVAILABLE:+import io.grpc.Status; import io.grpc.ManagedChannel;- var response = - requireInitializedStub( - "Account GL intake authorization read client is not initialized and available") - .withDeadlineAfter(CALL_DEADLINE_SECONDS, TimeUnit.SECONDS) - .readHeldGameLogicIntakeAuthorization( - GameLogicIntakeAuthorizationReadGrpcCodec.toRequest(request)); + final var response; + try { + response = + requireInitializedStub( + "Account GL intake authorization read client is not initialized and available") + .withDeadlineAfter(CALL_DEADLINE_SECONDS, TimeUnit.SECONDS) + .readHeldGameLogicIntakeAuthorization( + GameLogicIntakeAuthorizationReadGrpcCodec.toRequest(request)); + } catch (IllegalStateException unavailable) { + throw Status.UNAVAILABLE.asRuntimeException(); + }Apply the same narrow conversion around the blocking read in
GameplayRuleSourceReadClient.- Accepted Minor: Shared requireInitializedStub throws lifecycle IllegalStateException before RPC; the intake handler misclassifies it as permanent. Convert only stub acquisition to sanitized UNAVAILABLE in both read clients; preserve validation, invalid-evidence and existing RPC statuses.
- Add the required
Expected patternfield.MinorThe file’s entry format requires an
Expected pattern. This entry records an outcome and a reconsideration trigger, but omits that field. Add the reusable action separately from the trigger. This repeats the prior entry-format finding.- Accepted Minor: The new PR-owned admission observation lacks the required Expected pattern field. Add the reusable action while preserving Outcome and Reconsideration text; no unrelated historical cleanup.
- CLI Review 1 CompletedRuntime 2m 08sFound: 0 Accepted: 0/0/0 Routed: 0
- No findings recorded for this run
- CLI Review 2 CompletedRuntime 2m 06sFound: 1 Accepted: 0/1/0 Routed: 0
fetchOneon the selection lock fails if a Version has more than one selection row.MinorThe lock query filters only by
canonical_tenant_idandcanonical_version_id. The selection table primary key also containspublish_request_id, so the query can return several rows. If more than one row matches, jOOQfetchOnethrowsTooManyRowsException. In that case, every receipt retention for that Version fails, including exact retries. The query only takes locks and discards its result, sofetchkeeps the same lock semantics without the cardinality assumption.Confirm whether the V43 owner schema allows at most one
game_design_authored_draft_publish_selectionrow per(canonical_tenant_id, canonical_version_id). If it guarantees a single row, document that invariant at this call site.🔒️ Proposed fix
- dsl.fetchOne( + dsl.fetch( "SELECT canonical_tenant_id FROM game_design_authored_draft_publish_selection WHERE canonical_tenant_id = ? AND canonical_version_id = ? FOR UPDATE", selection.target().canonicalTenantId(), selection.target().canonicalVersionId());- Accepted Runtime cardinality alarm is false: V50.2 primary key is tenant/version. Accept the conditional invariant-documentation request and align this PR predecessor fixture to that existing owner key; preserve fetchOne and lock order.
- Hosted Review 3 CompletedRuntime 8m 06sFound: 1 Accepted: 0/1/0 Routed: 0
- Map lifecycle failures from the Account permission client to
UNAVAILABLE.MinorGrpcGameLogicIntakeSourceReadClient.readcallsrequireInitializedStub(...)without converting itsIllegalStateException. A closed or uninitialized client therefore reaches the Game Logic retain service asFAILED_PRECONDITIONinstead of the retryableUNAVAILABLErequired for this read path.+import io.grpc.Status; + - var stub = - requireInitializedStub( - "Account GL intake source permission client is not initialized and available") - .withDeadlineAfter(CALL_DEADLINE_SECONDS, TimeUnit.SECONDS); + AccountGameLogicIntakeSourceReadServiceGrpc.AccountGameLogicIntakeSourceReadServiceBlockingStub + initializedStub; + try { + initializedStub = + requireInitializedStub( + "Account GL intake source permission client is not initialized and available"); + } catch (IllegalStateException unavailable) { + throw Status.UNAVAILABLE.asRuntimeException(); + } + var stub = initializedStub.withDeadlineAfter(CALL_DEADLINE_SECONDS, TimeUnit.SECONDS);Apply the same lifecycle mapping to other unguarded intake clients used by this composition.
- Accepted Verified lifecycle leakage from source-permission stub acquisition. Same retain/terminal/settlement/authorization composition clients share it. Catch only stub acquisition, sanitize UNAVAILABLE, preserve deadlines and all permanent request/evidence checks.
- CLI Review 3 CompletedRuntime 2m 28sFound: 1 Accepted: 0/0/1 Routed: 0
- Move the duplicated Version-row proof SQL into one helper.Trivial
readForPublication(lines 89-113) andretain(lines 122-146) each contain the same 14-line Version/Game join predicate. The only differences areFOR UPDATE OF vand where the parameters come from. If one copy changes and the other does not, the publication read and the retention write will accept different Version provenance. Use one private helper that takes the target values and a lock flag. The same file also repeats theAuthoredDraftPublishSelectionRepository(...).read(...)lambda, which also appears inSelectedDraftGameLogicIntakeCommandService.repositoryReaderand in theSelectedDraftGameLogicReceiptServiceconstructor. One shared reader would remove those copies as well.♻️ Proposed helper
private static final String VERSION_PROOF = "SELECT v.id FROM version v JOIN game g " + "ON g.id = v.identity_source_game_row_id " // ... unchanged predicate ... + "AND v.version_state_epoch > 0"; private boolean versionProofPresent( long versionRowId, String versionTenantKey, UUID tenant, UUID version, long sourceGameRowId, String sourceGameTenantKey, String provenance, boolean lock) { return dsl.fetchOne( VERSION_PROOF + (lock ? " FOR UPDATE OF v" : ""), versionRowId, versionTenantKey, tenant, version, sourceGameRowId, sourceGameTenantKey, provenance) != null; }Also applies to: 122-146
- Accepted Verified duplicated Version/Game provenance SQL in read/retain and repeated selection read adapters. Consolidate exact predicate/parameters and retained-selection reader without changing lock order, transactions or refusal behavior.
- CLI Review 4 CompletedRuntime 2m 04sFound: 0 Accepted: 0/0/0 Routed: 0
- No findings recorded for this run
- CLI Review 5 CompletedRuntime 2m 20sFound: 1 Accepted: 0/0/0 Routed: 0
- Check the nested deadline budget before any receiver is registered.Trivial
Game Design calls
retainGameplayRuleIntakewith a 5-second client deadline. Inside that call, this method makes a blocking Account HELD read and a blocking Game Design source read. The Game Design source read then makes a blocking Account permission read. Each hop sets its own 5-second deadline. gRPC also propagates the inboundContextdeadline, so all of these nested hops must finish within the original 5 seconds. Each hop can carry gzip-compressed payloads of up to 24 MiB.No durable state exists until the final terminal INSERT. If a large selected source keeps the chain over 5 seconds, every exact retry repeats the same work and returns
DEADLINE_EXCEEDEDagain. The controlled pipeline test uses one admission tag, so it does not cover this case.Measure the full chain against a source near the maximum size. Then decide whether the outer
CALL_DEADLINE_SECONDSfor the retain client needs its own budget, separate from the leaf reads.- Rejected No demonstrated deadline violation or intake latency SLO.24MiB is wire cap; full canonical binding is4MiB.Same-identity ambiguous recovery exists. Near-max full-chain measurement is future performance qualification; no justified budget change.
- CLI Review 6 CompletedRuntime 2m 30sFound: 1 Accepted: 0/1/0 Routed: 0
- Do not relay dependency
StatusRuntimeExceptions to the Game Design caller unchanged.Minorowner.retaincalls two dependencies through outbound clients:accountAuthorizationReader.read(Account HELD read) andgameDesignSourceReader.read(Game Design source read). Those clients throwStatusRuntimeExceptionfor their own transport results. Examples areUNAUTHENTICATEDwhen the client-side server-identity interceptor rejects a substituted peer,PERMISSION_DENIEDfrom Account, andFAILED_PRECONDITIONdescriptions from the Game Design endpoint. Thiscatchblock forwards those statuses and descriptions to the Game Design caller as if they came from this endpoint.Consequences:
- A correctly authenticated Game Design peer can receive
UNAUTHENTICATEDorPERMISSION_DENIED, but the failure was in Game Logic's outbound mTLS or Account authorization. - The forwarded descriptions are not sanitized. The other branches in this method send no description, and
mapsPermanentOwnerFailuresToSanitizedFailedPreconditiontests that behavior.
The status codes that Game Logic itself raises (
ALREADY_EXISTS,FAILED_PRECONDITIONfromexactTerminaland the HELD/source mismatch checks) are still valid to return. Map dependency transport codes to a caller-relative code (UNAVAILABLEfor authentication, permission, deadline and unavailability failures) and drop the description. A dedicated owner exception is one way to do this, or the outbound calls can be wrapped inGameLogicGameplayRuleIntakeService.GameDesignGameplayRuleSourceReadGrpcServicehas the same pattern. Its lines 48-49 forward theStatusRuntimeExceptionfrompermissions.read(the Account source-permission client) unchanged.🔧 Possible mapping at the transport
} catch (StatusRuntimeException failure) { - observer.onError(failure); + var code = failure.getStatus().getCode(); + observer.onError( + (code == Status.Code.ALREADY_EXISTS + || code == Status.Code.FAILED_PRECONDITION + || code == Status.Code.INVALID_ARGUMENT) + ? Status.fromCode(code).asRuntimeException() + : Status.UNAVAILABLE.asRuntimeException());Prefer distinguishing local owner statuses from dependency statuses at the source, because a dependency can also return
FAILED_PRECONDITION.This follows the path instructions: "Flag changes that violate documented FireMUD invariants, especially gRPC application-error handling."
- Accepted Foreign auth/precondition statuses can blame valid callers and leak descriptions. Classify at outbound calls; sanitize dependency errors, preserve canonical infrastructure codes and local owner refusals.
- A correctly authenticated Game Design peer can receive
Routed Findings
No routes recorded
Unlinked items
no items unlinked