PR #3090 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 12m 04sFound: 8 Accepted: 1/4/3 Routed: 0
- Tie the admission target to the candidate binding runtime.Major
V29 only verifies that
candidate_binding_refexists. V32 does not require the admission target to match that candidate's runtime identity.A transition can therefore reference runtime Y while its admission target names runtime X. V34 locks X during decision acquisition, but the runtime mutation trigger searches for transitions whose candidate identifies the mutated runtime. An update to X can bypass the fence while the decision remains
PROVISIONAL.🛡️ Suggested guard
JOIN game_session_canonical_realm_catalog catalog ON catalog.target_namespace = launch.target_namespace @@ AND catalog.catalog_revision = NEW.admission_target_catalog_revision + JOIN game_session_canonical_gameplay_binding_inventory candidate + ON candidate.binding_ref = NEW.candidate_binding_ref + AND candidate.tenant_id = launch.canonical_tenant_id + AND candidate.runtime_game_instance_id = runtime.id + AND candidate.game_instance_id = runtime.game_instance_uuid WHERE runtime.tenant_id = NEW.admission_target_game_session_tenant_id- Accepted Major: lease-bound target can select a different runtime than durable candidate. Add exact candidate tenant and bigint/UUID runtime joins, retaining all existing target fences and lock.
- Make the second-transition conflict test isolate the open-controller fence.Trivial
otherOperationcallsreservation(...). That helper always suppliesRESERVATION_ID, and the firstpreparealready usedRESERVATION_ID. The secondpreparecan therefore fail on reservation-ID reuse instead of onuq_gs_canonical_binding_transition_open_controlleror the repository's open-transition guard. The test asserts only the exception type. It does not prove the behavior that its name describes.Use a distinct reservation ID for
otherOperation. Assert the conflict message that the open-transition guard produces.Proposed fix
- reservation(UUID.fromString("abababab-abab-4bab-8bab-abababababab")), + new CanonicalIssuerReservationFenceEvidence( + UUID.fromString("cdcdcdcd-cdcd-4dcd-8dcd-cdcdcdcdcdcd"), + UUID.fromString("abababab-abab-4bab-8bab-abababababab"), + ISSUER_COVERAGE_OPERATION_ID, + BigInteger.valueOf(13), + BigInteger.valueOf(17), + BigInteger.valueOf(41)), prior.bindingRef(), BigInteger.valueOf(5)); assertThatThrownBy(() -> repository.prepare(otherOperation)) - .isInstanceOf(CanonicalGameplayBindingInventoryConflictException.class); + .isInstanceOf(CanonicalGameplayBindingInventoryConflictException.class) + .hasMessageContaining("<open-transition guard message>");- Accepted Trivial: second-transition fixture reuses reservation ID and can fail for wrong reason. Distinct ID plus exact open-transition rejection proof delegated.
- Bind the launch preparation's tenant to the referenced realm catalog row.Minor
fk_gs_canonical_launch_preparation_catalogreferences only(target_namespace, realm_id). The row also storescanonical_tenant_id,catalog_creation_request_id,catalog_revision, and source-intake identifiers. Nothing ties these values to the catalog row. A preparation row can therefore persist acanonical_tenant_idthat differs from the tenant ofrealm_id. The row is immutable afterwards.Other cohort tables enforce this correspondence in the database. V23 uses exact-match triggers, and V26 uses a deferred launch-association check. V24 relies only on the application.
🛡️ Proposed fix (forward migration)
ALTER TABLE game_session_canonical_realm_catalog ADD CONSTRAINT uq_gs_canonical_realm_catalog_launch_identity UNIQUE (target_namespace, realm_id, canonical_tenant_id, creation_request_id, catalog_revision, source_intake_operation_id); ALTER TABLE game_session_canonical_launch_preparation ADD CONSTRAINT fk_gs_canonical_launch_preparation_catalog_identity FOREIGN KEY (target_namespace, realm_id, canonical_tenant_id, catalog_creation_request_id, catalog_revision, source_intake_operation_id) REFERENCES game_session_canonical_realm_catalog (target_namespace, realm_id, canonical_tenant_id, creation_request_id, catalog_revision, source_intake_operation_id);- Accepted Minor integrity: immutable launch preparation FK omits canonical tenant and captured catalog/source identity. Add exact composite FK against immutable catalog through forward migration.
- Add TRUNCATE guards to the payload and legal-hold tables.Minor
The current protections are row-level
BEFORE DELETEtriggers. PostgreSQL does not execute row-level delete triggers forTRUNCATE. A role withTRUNCATEprivilege can therefore remove protected payload and legal-hold rows.Use statement-level
BEFORE TRUNCATEtriggers. Apply them in a forward migration if V13 is already deployed.CREATE TRIGGER game_session_retained_tenant_payload_expiry_guard BEFORE DELETE ON game_session_retained_tenant_association_payload FOR EACH ROW EXECUTE FUNCTION guard_game_session_retained_tenant_payload_delete(); + +CREATE TRIGGER game_session_retained_tenant_payload_no_truncate + BEFORE TRUNCATE ON game_session_retained_tenant_association_payload + FOR EACH STATEMENT EXECUTE FUNCTION guard_game_session_retained_tenant_payload_update(); @@ CREATE TRIGGER game_session_retained_tenant_hold_audit_no_delete BEFORE DELETE ON game_session_retained_tenant_association_legal_hold FOR EACH ROW EXECUTE FUNCTION guard_game_session_retained_tenant_hold_delete(); + +CREATE TRIGGER game_session_retained_tenant_hold_audit_no_truncate + BEFORE TRUNCATE ON game_session_retained_tenant_association_legal_hold + FOR EACH STATEMENT EXECUTE FUNCTION guard_game_session_retained_tenant_hold_delete();- Accepted Minor integrity: row DELETE retention guards do not stop statement TRUNCATE on payload and legal-hold records. Add forward statement guards; preserve V13 checksum.
- Add an index for the inventory identity lookup.Minor
The trigger runs for every
game_instancesupdate or delete. Its query filtersgame_session_canonical_gameplay_binding_inventorybytenant_id,runtime_game_instance_id, andgame_instance_id. No existing index has those leading columns, so this lookup can scan the inventory table and extend the runtime-row lock.The transition lookup does not need the proposed additional index.
UNIQUE (candidate_binding_ref)already provides an index for that join.+CREATE INDEX ix_gs_canonical_gameplay_binding_inventory_runtime_identity + ON game_session_canonical_gameplay_binding_inventory + (tenant_id, runtime_game_instance_id, game_instance_id); + CREATE FUNCTION reject_runtime_row_mutation_during_lease_bound_binding()- Accepted Minor: per-runtime trigger lookup lacks tenant/runtime identity index. Add matching index only; candidate transition unique index already covers join.
- Keep the original failure as the cause of the rethrown conflict.Minor
The catch block adds
persistFailuretoambiguousas a suppressed exception. It then throws a newCanonicalGameplayBindingInventoryConflictExceptionthat does not useambiguousas its cause. The original adapter, repository or fence failure is lost. The failure to persist the block is lost with it, because it was attached only toambiguous. When a migration run stops, the operator then has no record of which phase failed. Passambiguousas the cause if the exception type accepts one, or add it as a suppressed exception.🩹 Proposed fix
- throw new CanonicalGameplayBindingInventoryConflictException( - "Legacy migration remains fenced and unresolved; retain the same cohort and operation"); + CanonicalGameplayBindingInventoryConflictException unresolved = + new CanonicalGameplayBindingInventoryConflictException( + "Legacy migration remains fenced and unresolved; retain the same cohort and operation"); + unresolved.addSuppressed(ambiguous); + throw unresolved;- Accepted Minor: migration owner loses original exception and nested persistence failure; preserve cause chain without changing fail-closed result. Delegated fix pending.
- Use the shared pinned PostgreSQL image.Trivial
This test hard-codes
"postgres:16-alpine". The sibling V34 and script-pin tests useTestContainerImages.postgres(). This test therefore bypasses the repository's image selection and pinning, so it can run against a different PostgreSQL build than the other physical fixtures.♻️ Proposed fix
--- "a/services/game-session-service/src/test/java/integration/net/firedevops/firemud/gamesession/repository/CanonicalGameplayLegacyMigrationRepositoryIntegrationTest.java" +++ "b/services/game-session-service/src/test/java/integration/net/firedevops/firemud/gamesession/repository/CanonicalGameplayLegacyMigrationRepositoryIntegrationTest.java" @@ -29,7 +29,8 @@ "filesystem:" + Path.of("src/main/resources/db/migration").toAbsolutePath().normalize(); @Container - static PostgreSQLContainer<?> postgres = new PostgreSQLContainer<>("postgres:16-alpine"); + static PostgreSQLContainer<?> postgres = + new PostgreSQLContainer<>(net.firedevops.firemud.test.TestContainerImages.postgres()); @Test void durableFenceAndPhysicalIdentityDoNotPublishV31BeforeReadback() {- Accepted Trivial: legacy migration PostgreSQL fixture bypasses shared pinned image. Use canonical TestContainerImages.postgres.
- Add a PostgreSQL test for the positive fence path.Trivial
This test proves only one thing: an unrelated numeric-tenant row can still be updated and deleted. No test seeds a launch row, a candidate inventory row and a lease-bound transition, and then shows these results:
UPDATEorDELETEon the runtime row fails withgs_binding_runtime_row_mutation_fenced.- PROVISIONAL→COMMITTED fails with
gs_binding_runtime_fence_terminal_owner_required. - PREPARED→PROVISIONAL against a STOPPED runtime row fails with
gs_binding_runtime_fence_exact_running_launch_required.
These results are the main purpose of V34. A test for them would also catch the candidate/target mismatch that comment c1 describes.
- Accepted Minor proof gap: no positive PostgreSQL fixture for candidate-bound runtime/terminal/STOPPED guards. Add real setup and assertions; local physical PostgreSQL unavailable, no pass claim.
- CLI Review 1 CompletedRuntime 3m 28sFound: 3 Accepted: 2/1/0 Routed: 0
- Major
Add a non-locking transition lookup for the read-only path in readAdmissionDecision, replacing its call to findTransition with a query that does not use FOR UPDATE. Keep findTransition’s locking behavior for write paths.
- Accepted Major: readAdmissionDecision starts READ ONLY but findTransition takes FOR UPDATE. Add nonlocking exact read while preserving all write-path locks; fix delegated locally.
- Minor
Update the trigger reset flow in GameplayCrossServiceStack to preserve the guard’s original enabled mode: capture whether it is
OorAbefore disabling it, then restore that same mode instead of always using plainENABLE TRIGGER. Keep the final guard-state check aligned with the restored mode.- Accepted Minor: test reset accepts O or A guard mode but restores only O. Preserve exact original mode and assert its restoration; fix delegated locally, physical PostgreSQL proof pending.
- Major
Update markCandidateAccountIndexPresent to use requireCount for the prior account-obligation update, expecting zero changed rows when current.expectedPrior() is null and one otherwise; preserve the existing update and error context.
- Accepted Major: first binding has no prior ordinal1 obligation, so requireOne rejects valid projection. Enforce exact expected row count zero or one based on retained prior; fix delegated locally.
- Subagent Review 1 CompletedModel: gpt-6-luna · XhighFound: 1 Accepted: 1 Routed: 0
- Standalone client can falsely certify one Redis Cluster node as complete empty inventoryMajor
Reviewed immutable40486eb..c10,85paths. Early shared-tree fix contamination was identified and corrected by re-reading git show c10; no uncommitted fix credited. No executed runtime proof.
- Accepted Committed c10 driver checks run ID/TLS but not live topology; ordinary connection bypasses instanceof cluster guard. Exact live standalone INFO validation is required before inventory proof.
- Subagent Review 2 CompletedModel: gpt-6-luna · XhighFound: 1 Accepted: 1 Routed: 0
- Bounded invalidation cache leaves 65th revoked KID usableMajor
- Accepted Source-owned latent helper defect: bound overflow precedes denial/removal, leaving cached revoked key usable. Fail closed globally on bound exhaustion and add saturation/source-outage regression; no active route is claimed.
- CLI Review 2 CompletedRuntime 5m 09sFound: 2 Accepted: 0/2/0 Routed: 0
- Minor
In AccountAsymmetricJwtVerifier, handle AccountPublicJwksCache.SourceUnavailableException from keyCache.keyFor separately before the generic RuntimeException catch, propagating a distinct detail-free unavailability exception while keeping VerificationException for token defects.
- Accepted Generic RuntimeException catch erases source unavailability into invalid-token outcome. Preserve a detail-free distinct unavailable result; token faults stay denied.
- Minor
Add a minimum time interval between forced refreshes in AccountPublicJwksCache’s unknown-kid path. Before calling refreshFromSource(), check whether the interval has elapsed since the last forced refresh; within the interval, reject the unknown kid without loading the source. Record the refresh time when a forced refresh begins.
- Accepted Fresh snapshot permits distinct unknown KIDs to repeatedly load source without time bound. Add a bounded forced-refresh interval without weakening known-key freshness or rotation.
- Hosted Review 2 CompletedRuntime 13m 33sFound: 5 Accepted: 2/1/2 Routed: 0
- Exclude Flyway’s schema-creation marker from the migration inventory.Major
Flyway 13.9.0 records a
SCHEMAmarker whencreateSchemas(true)creates the configured schema.migrationSourceInventoryincludes that marker and rejects it because it has no versioned migration identity. This can make a fresh-schema run return exit code 4 after applying migrations. A rerun then failsrequireEmptyCohortSchema.--- "a/services/game-session-service/src/main/java/net/firedevops/firemud/gamesession/repository/CanonicalGameplayMigrationDriverMain.java" +++ "b/services/game-session-service/src/main/java/net/firedevops/firemud/gamesession/repository/CanonicalGameplayMigrationDriverMain.java" @@ -517,12 +517,20 @@ Map.entry("1002", "V1002__saga_step_table.sql")); } private static List<MigrationSourceIdentity> migrationSourceInventory(Flyway flyway) { List<MigrationSourceIdentity> migrations = new ArrayList<>(); + int schemaMarkers = 0; for (MigrationInfo migration : flyway.info().all()) { + if (migration.getType() == org.flywaydb.core.api.CoreMigrationType.SCHEMA) { + schemaMarkers++; + if (schemaMarkers > 1) { + throw new IllegalStateException("Flyway schema-creation marker was ambiguous"); + } + continue; + } if (migration.getVersion() == null || migration.getScript() == null) { throw new IllegalStateException("packaged migration source identity was incomplete"); } migrations.add( new MigrationSourceIdentity( migration.getVersion().getVersion(),- Accepted Exclude only the explicit Flyway SCHEMA creation marker before normal identity validation, reject duplicate markers, retain normal migrations validation and ambiguity checks. Fresh-schema driver otherwise fails after applying migrations.
- Do not give the runtime user ownership of the driver launcher and jars.Minor
COPY --chown=999:999makes the runtime user (USER 999:999) the owner of the launcher and every jar. The migration process can then rewrite its own entrypoint and classpath in a writable container layer. This weakens the guarantee that the code which runs is the packaged, reviewed driver. The driver holds PostgreSQL owner and Redis credentials, so the guarantee matters.Keep the files owned by root and make them read-only for uid 999. The runtime user needs read and execute permission only. Update the matching assertion in
dev-tools/tests/game-session-migration-driver-image-contract.shlines 77-81 in the same change.🔒 Proposed fix
--- "a/k8s/game-session-migration-driver/Dockerfile" +++ "b/k8s/game-session-migration-driver/Dockerfile" @@ -2,7 +2,7 @@ FROM ${BASE_IMAGE} WORKDIR /opt/firemud -COPY --chown=999:999 services/game-session-service/build/distributions/game-session-migration-driver/ /opt/firemud/game-session-migration-driver/ +COPY --chown=0:0 --chmod=0555 services/game-session-service/build/distributions/game-session-migration-driver/ /opt/firemud/game-session-migration-driver/ USER 999:999 ENTRYPOINT ["/opt/firemud/game-session-migration-driver/bin/game-session-migration-driver"]- Accepted Root-own the packaged driver and make runtime distribution read-only; uid999 requires read/execute, not ownership. Update image contract. Local validated implementation pending.
- Use the shared pinned PostgreSQL image.Trivial
Line 61 hard-codes
"postgres:16-alpine". The sibling testsCanonicalGameplayDecisionRuntimeFenceIntegrationTestandCanonicalGameplayLegacyMigrationRepositoryIntegrationTestuseTestContainerImages.postgres(). With the hard-coded tag, this test can run against a different PostgreSQL build than the other physical fixtures.♻️ Proposed fix
--- "a/services/game-session-service/src/test/java/integration/net/firedevops/firemud/gamesession/repository/CanonicalGameplayBindingInventoryRepositoryIntegrationTest.java" +++ "b/services/game-session-service/src/test/java/integration/net/firedevops/firemud/gamesession/repository/CanonicalGameplayBindingInventoryRepositoryIntegrationTest.java" @@ -58,7 +58,8 @@ UUID.fromString("ffffffff-ffff-4fff-8fff-ffffffffffff"); @Container - static PostgreSQLContainer<?> postgres = new PostgreSQLContainer<>("postgres:16-alpine"); + static PostgreSQLContainer<?> postgres = + new PostgreSQLContainer<>(net.firedevops.firemud.test.TestContainerImages.postgres()); @Test void failsClosedWhenInventoryAbsenceCannotProveLegacyControllerAbsence() {- Accepted Use the shared immutable PostgreSQL TestContainerImages source in the remaining physical fixture.
- Compare
OLDandNEWbefore rejecting unrelated runtime updates.MajorWhen a matching lease-bound
PROVISIONALorAMBIGUOUStransition exists,game_instances_lease_bound_binding_runtime_fencerejects everyUPDATE.GameInstanceRepository.saverewrites pinned and unrelated columns in one statement, soUPDATE OFalone would still reject routine updates.Return
NEWwhen all columns used by the decision fence are unchanged. Do not useUPDATE OFas the only fix. Do not treatrow_versionas a pinned column because its increase satisfiescaptured_starting_row_version <= runtime.row_version.- Accepted Accept unrelated-update allowance only when ALL decision-pinned runtime fields remain unchanged, not the unsafe identity-only suggested predicate; preserve RUNNING/status/version/start evidence and deletion/race fences via forward migration.
- Shorten the identifiers that exceed PostgreSQL's 63-byte limit.Trivial
game_session_canonical_account_coverage_snapshot_issuer_obligationandgame_session_canonical_account_coverage_snapshot_region_obligationare 66 bytes. Theirfk_..._operationconstraints are 69 bytes. PostgreSQL silently truncates these names to 63 bytes. The stored table names end in..._obligat.SQL that names the tables directly still works because PostgreSQL truncates those identifiers the same way. String literals are not truncated. Catalog checks fail, for example
pg_class.relname = '...obligation',to_regclassin a text comparison, or schema-contract tooling. H2/jOOQ generation keeps the full name, so generated metadata and the physical table name differ.These migrations are new in this PR. Rename the tables and constraints to 63 bytes or fewer, for example
gs_canonical_account_coverage_snapshot_issuer_obligation. Rename them before V31 is applied anywhere.Also applies to: 517-517, 529-529, 546-546
- Accepted Canonicalize overlength PostgreSQL identifiers via forward V34.2, preserving published V31 checksums; prove physical catalog and jOOQ naming. Do not rewrite published migration history.
- Subagent Review 3 CompletedModel: gpt-6-luna · XhighFound: 1 Accepted: 1 Routed: 0
- Valid account security cutoffs reject independent outbox sequencesMajor
Fresh whole85-path immutable df81 broad pass3; no other high-confidence defects. No checks executed; physical PG/Redis/image and activation proof remain unavailable.
- Accepted JWT contract defines independent generation and exact-stream outbox sequence; canonical example generation12 sequence44 is rejected by both profile construction and claim validation. Remove arithmetic coupling while preserving exact generation, scope and canonical-decimal checks.
- Subagent Review 4 CompletedModel: gpt-6-luna · XhighFound: 3 Accepted: 3 Routed: 0
- Third-party console logging can corrupt framed migration protocol stdoutMajor
- Accepted Raw System.out is shared between NDJSON and default Flyway/SLF4J logging. Root accepted bounded diagnostic/protocol separation with deterministic regression; finite tool remains nonactivating.
- Binding model accepts nil session UUID rejected by V29 storageTrivial
- Accepted Align model and durable constraint with early rejection and focused unit proof; no authorization bypass claimed.
- Account and tenant cutoff stream must match claim identityMinor
- Accepted Valid canonical stream shape alone accepts another subject scope; root accepted exact account/tenant binding, independently corroborated by CLI run.36f11704c48a44b19a1e812889efb180 finding2. One implementation obligation, two actual review observations.
- CLI Review 3 CompletedRuntime 4m 36sFound: 3 Accepted: 0/2/1 Routed: 0
- Trivial
Replace the inline Flyway configuration and migration call with the existing migrate(schema, dataSource) helper so this test uses the shared migration configuration.
- Accepted Accepted Trivial: reuse existing migrate helper so test shares exact canonical Flyway configuration; implement in current candidate.
- Minor
Update the owning AA-2.1 and AA-2.2 Capability Status rows to name V29–V34.2, CanonicalGameplayBindingInventoryRepository, CanonicalGameplayLegacyMigrationOwner, and CanonicalGameplayMigrationDriverMain, and add the focused repository, runtime-fence, and driver test anchors. Summarize the outstanding physical PostgreSQL/Redis, image, and trusted-authority proof—and the driver’s execution limits—in the rows’ gap column; retain the partial / drift-found statuses and leave the canonical contract in its existing references.
- Accepted Accepted Minor: owning AA-2 rows lack actual migration/repository/driver/proof anchors and execution limits already described elsewhere; update status without promoting partial/drift-found or claiming physical proof.
- Minor
Update validateAccountSecurityCutoff and validateTenantBillingCutoff to require exact stream keys derived from the token’s accountId and tenantId, respectively. Thread those identity values from requireDelegationCommonIdentity callers through requireDelegationAuthorityTuple into the validators, and preserve the existing cutoff shape and generation checks.
- Accepted Accepted Minor: cutoff exact outbox stream must bind account or tenant claim scope, not merely canonical stream shape; corroborated independently by broad Luna4. Preserve independent generation/sequence checks.
- CLI Review 4 CompletedRuntime 4m 14sFound: 2 Accepted: 1/0/1 Routed: 0
- Major
Move the CanonicalGameplay migration links and V29–V34.2 links from the Gap or decision prose into the Implementation anchors column on AA-2.1, and move its six test links into Proof anchors; leave only the physical PostgreSQL/Redis, final-image-authority, and driver-authorization gap sentence in Gap or decision. On AA-2.2, replace the duplicated anchor list with a short handoff note pointing to AA-2.1.
- Accepted Accepted: move existing driver migration/implementation/proof links to their owning tracker columns and remove AA-2.2 duplication via AA-2.1 handoff. Practical significance is tracker clarity, not a Major runtime defect; implementation/proof gaps remain unchanged. Bounded local fix assigned.
- Trivial
Replace the eager classpath.asPath system property assignment in the Test task configuration with a lazy CommandLineArgumentProvider added to jvmArgumentProviders. Resolve the configured test task’s classpath when the provider supplies JVM arguments so later classpath changes are respected.
- Accepted Accepted: lazy JVM argument provider must read the finalized Test classpath, preserving forked driver test property. Local bounded fix assigned; proof pending.
- Hosted Review 3 CompletedRuntime 9m 29sFound: 5 Accepted: 0/3/2 Routed: 0
- Align the intent request-id bound with the attempt ledger and fix the stale ledger reference.Minor
The intent stores
initial_admission_request_idasvarchar(120)and checks a length of 1 to 120. The attempt table and both pointer tables accept 128 characters. The intent row is persisted before the World hold call, so request IDs of 121 to 128 characters fail at intent even though the attempt contract accepts them. The comment also says "V17 attempt ledger", but that ledger is defined in this V28 migration.Use one bound across both tables, and change the comment to name the V28
game_session_canonical_initial_admission_attemptledger.- Accepted Intent request ID120 disagrees with attempt/pointer128. Accept forward V34.3 migration and boundary proof; preserve historical V28 checksum rather than edit old SQL. Correct ledger reference in new migration commentary.
- Update the recorded full-check counts or remove them from the status line.Minor
This line says the full checks ran 2,039 test executions with 200 skips. The PR reports a later combined run at
05ac5e0be: Game Session had 2,130 cases with 210 Docker-dependent skips, and Common Security had 132 tests. The tracker is the reader-facing status record, so the stale counts misstate the current evidence. The guideline also says "a historical broad test run does not substitute for focused proof". Either name the exact commit with its counts, or drop the counts and keep the focused proof anchors already listed in theAA-2.1andAA-2.2rows.As per coding guidelines: "Keep its status, implementation record, validation, gaps, decisions, and service-map sections aligned".
- Accepted Remove stale aggregate counts from tracker source/packaging status; preserve focused anchors and all honest proof gaps. Bounded local fix assigned.
- Stop recording cached kids as unknown when the source is unavailable.Minor
The stale-refresh
catchblock addskidtounknownKidsRefreshedForSnapshot. It does this even whencachedKidKnownis true. Here is the failure sequence:- A known kid is looked up after the cache reaches
maximumAge. - The source is unavailable. The first call correctly throws
SourceUnavailableException. The block also records the known kid as an unknown-kid refresh. - Within
STALE_SOURCE_RETRY_BACKOFF, the next lookup for the same kid reaches the check at Lines 113-115. That check throwsUnknownKeyException.
AccountAsymmetricJwtVerifier.verifymapsUnknownKeyExceptiontoVerificationException("verification failed"). It does not map it toVerificationUnavailableException. During a short JWKS source outage, a validly signed token is therefore reported as invalid instead of retryable. The entry can also stay in the set after recovery when the JWKS bytes are unchanged, because the set is cleared only when the fingerprint changes.Record the kid only when it was not cached.
🐛 Proposed fix
--- "a/services/common-security/src/main/java/net/firedevops/firemud/common/security/AccountPublicJwksCache.java" +++ "b/services/common-security/src/main/java/net/firedevops/firemud/common/security/AccountPublicJwksCache.java" @@ -141,13 +141,14 @@ recordUnknownKidRefresh(kid, now); } refreshFromSource(); } catch (SourceUnavailableException unavailable) { lastStaleSourceUnavailableAt = clock.instant(); - if (unknownKidsRefreshedForSnapshot.size() < MAX_UNKNOWN_KID_REFRESHES_PER_SNAPSHOT) { + if (!cachedKidKnown + && unknownKidsRefreshedForSnapshot.size() < MAX_UNKNOWN_KID_REFRESHES_PER_SNAPSHOT) { unknownKidsRefreshedForSnapshot.add(kid); } throw unavailable; } lastStaleSourceUnavailableAt = null; rejectHardDenied(kid); RSAPublicKey refreshed = keys.get(kid);Add a test that calls
keyFor("known")twice within one second after the cache is stale and the source is down. Both calls must throwSourceUnavailableException.- Accepted Known cached kid must remain retryable SourceUnavailable throughout stale-source backoff; recording it as unknown misclassifies valid credentials. Narrow guard plus repeated lookup regression assigned.
- A known kid is looked up after the cache reaches
- Check for standalone topology before treating one SCAN cursor as a complete inventory.Trivial
scanConnectionruns oneSCANon the connection it receives. On a Redis cluster connection, that cursor covers one node only. The adapter still returns a snapshot that claims every known family was enumerated.CanonicalGameplayFreshNamespaceRedisReconcilerTest(Lines 229-231) shows this: the legacy adapter completes two empty scans on a cluster connection, and only the later reconciler refuses. The driver's standalone check and the reconciler both stop the flow today. However, this adapter is the source-of-truth forSOURCE_INVENTORY_INCOMPLETE, so it should not produce an empty "complete" snapshot itself. Reuse the reconciler'sINFO cluster/cluster_enabled=0check, and rejectRedisClusterConnectionbefore the first scan.- Accepted Legacy inventory adapter must itself reject cluster/unknown topology before SCAN even though driver/reconciler already fence cluster mode. Preserve finite standalone contract; focused regression assigned.
- Defer test-classpath resolution to execution time.Trivial
classpath.asPathresolves every test task's classpath while Gradle configures the project. This runs on every build, including builds that never run tests. It also breaks configuration-cache compatibility. Use aCommandLineArgumentProviderso the path is computed only when the test JVM starts.♻️ Proposed refactor
--- "a/services/game-session-service/build.gradle.kts" +++ "b/services/game-session-service/build.gradle.kts" @@ -99,7 +99,10 @@ val isWindows = System.getProperty("os.name").lowercase().contains("windows") tasks.withType<Test>().configureEach { - systemProperty("firemud.migration-driver-test-classpath", classpath.asPath) + val testClasspath = classpath + jvmArgumentProviders.add(CommandLineArgumentProvider { + listOf("-Dfiremud.migration-driver-test-classpath=${testClasspath.asPath}") + }) if (isWindows) { maxParallelForks = 1 forkEvery = 0- Accepted Same lazy test-classpath obligation as current CLI1; already implemented locally and forked stdout test passes. Accept/implemented in combined pending batch, not a second independent change.
- Subagent Review 5 CompletedModel: gpt-6-luna · XhighFound: 0 Accepted: 0 Routed: 0
- No findings recorded for this run
- CLI Review 5 CompletedRuntime 4m 19sFound: 1 Accepted: 1/0/0 Routed: 0
- Major
Restore the missing AA-2.1 Capability Status row so the tracker has a scan-first entry for the capability and existing AA-2.1 references resolve. Mark it partial / drift-found, retain the gap text from line 39, and include the named migration-driver production and proof anchors; alternatively, transfer ownership to another row and update every AA-2.1 reference.
- Accepted Accepted current-PR tracker omission: Capability Status has AA-2.2 references to AA-2.1 but no AA-2.1 row. Restore partial/drift-found row with actual migration-driver anchors and explicit physical/runtime proof gaps; practical documentation significance, not a runtime defect.
- Subagent Review 6 CompletedModel: gpt-6-luna · XhighFound: 1 Accepted: 0 Routed: 0
- SERVICE_SCHEMA allows trusted deployment schema overrideMinor
- Rejected Canonical deployment permits schema overrides; valid SQL identifier guard remains. No evidenced requirement to force game_session_service or actual defect found.
- CLI Review 6 CompletedRuntime 4m 59sFound: 1 Accepted: 0/1/0 Routed: 0
- Minor
Update the stale-cache refresh flow in AccountPublicJwksCache to apply the one-second backoff when refreshFromSource throws InvalidJwksException, recording which failure type occurred. In the existing backoff block, rethrow InvalidJwksException for invalid-result failures and SourceUnavailableException otherwise; preserve the existing unknown-key rate limiting.
- Accepted Minor: stale known-key lookups repeatedly reload malformed JWKS without the outage retry backoff. Bound invalid-source retries while preserving invalid-JWKS classification and unknown-key throttling.
- Hosted Review 4 CompletedRuntime 12m 33sFound: 2 Accepted: 1/1/0 Routed: 0
- Use one global lock order for runtime and transition rows.Minor
A
game_instancesupdate locks the runtime row before itsBEFOREtrigger runs. The V34.2 trigger then locks matching transition rows.The lease-bound decision path locks the transition row in
loadProvisionalCasEvidence(..., true)before its transition update. Its fence trigger then locks the runtime row. Concurrent operations on the same binding can therefore deadlock withdeadlock_detected(40P01).Acquire the matching runtime-row lock before acquiring the transition-row lock in the decision path. Locking the runtime row only before the transition
UPDATEis too late because the path already locks the transition row duringloadProvisionalCasEvidence(..., true).- Accepted Minor: runtime UPDATE locks runtime before its trigger locks transitions; markProvisional does the reverse. Acquire exact runtime before transition in the decision path and prove concurrent serialization without weakening either fence.
- Run the permission step as root.Major
docker/base.Dockerfilesets the base image user tofiremud. Because this Dockerfile does not change the user beforeRUN, thechmodcommands run asfiremudagainst root-owned files fromCOPY --chown=0:0and can fail during the image build.Add an explicit root user before the permission step, then retain
USER 999:999for runtime. Updatepermission_step_linesindev-tools/tests/game-session-migration-driver-image-contract.shif the added line changes the expected locations.COPY --chown=0:0 game-session-migration-driver /opt/firemud/game-session-migration-driver +USER 0:0 RUN chmod -R a+rX /opt/firemud/game-session-migration-driver \ && chmod -R a-w /opt/firemud/game-session-migration-driver \ && chmod a+x /opt/firemud/game-session-migration-driver/bin/game-session-migration-driver- Accepted Major: pinned base ends as USER firemud; COPY creates root-owned distribution and chmod runs before a root USER switch. Add explicit build-only root identity, retain runtime 999:999, and enforce ordering in the existing image contract.
- Subagent Review 7 CompletedModel: gpt-6-luna · XhighFound: 1 Accepted: 0 Routed: 0
- Nullable legacy capture time permits raw-payload cleanupMinor
Whole91-path immutable14ec review. Source confirmed null guard behavior, but root verified canonical retained-tenant contract in preserved receiver api-contracts.md: previously ambiguous rows retain anti-reassignment claim while raw payload is immediately cleanup-eligible. No retention extension or schema checksum edit warranted.
- Rejected Unknown-capture legacy payload is deliberately cleanup-eligible and non-replayable; immutable namespace/tenant anti-reassignment evidence survives. Owning GS API retained-tenant contract explicitly distinguishes legacy schema1 from timestamp-bound schema2 retention.
- Subagent Review 8 CompletedModel: gpt-6-luna · XhighFound: 1 Accepted: 0 Routed: 0
- Legacy NULL captured_at permits immediate raw-payload cleanupMinor
V13 nullable captured_at/legacy copy and DELETE guard independently observed. Whole immutable91-file boundary reviewed from0651 to f009, including driver/build/JWT/lease/Redis/inventory/migrations/tests/docs; no new useful obligation.
- Rejected Intentional owner contract: unknown legacy capture/schema1 payload is cleanup-eligible and nonreplayable; immutable canonical/private-tenant anti-reassignment row survives. New schema2 captures retain30days.
- CLI Review 7 CompletedRuntime 4m 31sFound: 2 Accepted: 0/1/1 Routed: 0
- Minor
Update the AA-2.1 row’s gap cell to restore the earlier open PLAY and connect-token gaps, namespace-aware binding enforcement, synthetic character fallback, and incomplete deployment/mTLS and fresh-image proof, retaining their existing tracker anchors. Add the migration-driver evidence and #2967/#2898 status alongside those gaps rather than replacing them; keep SessionAuthenticationService.java and PlayCommandHandler.java as implementation anchors.
- Accepted Accepted Minor tracker loss: AA-2.1 replacement omitted still-open PLAY/connect-token/namespace/synthetic-fallback and fresh-image/mTLS gaps. Restore their owning anchors alongside narrow driver proof.
- Trivial
Tighten the 129-character boundary assertion in the migration integration test so it verifies the width limit caused the rejection, not merely any database failure. Update the assertion around insertIntent to check PostgreSQL SQLSTATE 22001, the expected length-error message, or the named length CHECK constraint used by V34.3.
- Accepted Accepted Trivial current-PR proof gap: any DataAccessException can satisfy the 129-character rejection; assert PostgreSQL SQLSTATE 22001 so unrelated failures cannot pass.
- CLI Review 8 CompletedRuntime 4m 14sFound: 1 Accepted: 0/1/0 Routed: 0
- Minor
Replace the lambda passed to jvmArgumentProviders in the Test task configuration with a typed CommandLineArgumentProvider that exposes the test classpath as a @Classpath input. Keep the existing migration-driver system property behavior while deriving its value from the declared classpath input.
- Accepted Valid current-PR build-input correction: migration-driver JVM argument derives from test runtime classpath but the lambda declares no Classpath input. Replace with a typed CommandLineArgumentProvider preserving the exact system property; focused Gradle configuration/test proof required.
- Hosted Review 5 CompletedRuntime 11m 44sFound: 4 Accepted: 0/3/1 Routed: 0
- Use the 128-character request-ID bound in the DTO.Minor
V34.3 widens the intent ledger to 128 characters. The attempt ledger and immutable audit event also accept 128 characters. The DTO still rejects valid 121–128-character IDs.
--- "a/services/game-session-service/src/main/java/net/firedevops/firemud/gamesession/dto/CanonicalInitialAdmissionRequest.java" +++ "b/services/game-session-service/src/main/java/net/firedevops/firemud/gamesession/dto/CanonicalInitialAdmissionRequest.java" @@ -67,8 +67,8 @@ throw new IllegalArgumentException( "EXPECT_CLOSED requires a positive exact expectedPriorPointerVersion"); } - // The immutable compatibility audit's control_plane_request_id is varchar(120). - requireText(initialAdmissionRequestId, "initialAdmissionRequestId", 120); + // The immutable compatibility audit's control_plane_request_id is varchar(128). + requireText(initialAdmissionRequestId, "initialAdmissionRequestId", 128); if (!REQUEST_DIGEST.matcher(Objects.requireNonNull(requestDigest, "requestDigest")).matches()) { throw new IllegalArgumentException( "requestDigest must be bare lowercase 64-character SHA-256 hex");- Accepted Current DTO120 bound contradicts V9 audit128 and V34.3 intent128. Converge DTO to128 and prove120/121/128 accepted and129 rejected without migration changes.
- Pass the child classpath through an argument file, not the command line.Minor
Line 24 puts the complete Game Session test classpath on the
javacommand line. That classpath holds hundreds of absolute Gradle-cache jar paths. On Windows,CreateProcesslimits a command line to 32,767 characters. The child process can then fail to start.build.gradle.ktsalready has Windows handling (isWindows), so Windows is a supported developer workflow.A second, smaller issue: Lines 31-32 drain stdout and stderr only after
waitFor. If the child writes more than the pipe buffer can hold, it blocks until the 30-second timeout.Write the classpath to a temporary
@argfile. Java 9 and later support argument files. Redirect stdout and stderr to temporary files so that the child never blocks on a full pipe.Proposed fix
- Process process = - new ProcessBuilder(java.toString(), "-cp", classpath, LoggingProbe.class.getName()).start(); + Path argFile = java.nio.file.Files.createTempFile("migration-driver-cp", ".args"); + Path stdoutFile = java.nio.file.Files.createTempFile("migration-driver", ".out"); + Path stderrFile = java.nio.file.Files.createTempFile("migration-driver", ".err"); + java.nio.file.Files.writeString( + argFile, "-cp \"" + classpath.replace("\\", "\\\\") + "\"", StandardCharsets.UTF_8); + Process process = + new ProcessBuilder(java.toString(), "@" + argFile, LoggingProbe.class.getName()) + .redirectOutput(stdoutFile.toFile()) + .redirectError(stderrFile.toFile()) + .start(); @@ - byte[] stdout = process.getInputStream().readAllBytes(); - byte[] stderr = process.getErrorStream().readAllBytes(); + byte[] stdout = java.nio.file.Files.readAllBytes(stdoutFile); + byte[] stderr = java.nio.file.Files.readAllBytes(stderrFile);- Accepted Child JVM classpath can exceed Windows command-line bound and pipes can block before waitFor. Use Java argfile and file-backed stdout/stderr, retain timeout/termination and protocol assertions.
- Assert on the mocked
RedisConnection, not only onStringRedisTemplate.TrivialBoth production classes do all their Redis work through
redis.execute(RedisCallback)on the connection. The tests check only template-leveldelete,opsForValue,opsForHash, andopsForSet. A regression that issuesDELorGETthroughconnection.keyCommands()orconnection.stringCommands()would pass. These tests are the stated proof that retained keys stay unchanged.services/game-session-service/src/test/java/unit/net/firedevops/firemud/gamesession/repository/CanonicalGameplayFreshNamespaceRedisReconcilerTest.java#L692-L697: return or keep theRedisConnectionmock fromredisWithResults. ExtendverifyNoRedisMutationOrValueReadso that the connection receives onlyscanandserverCommands(verifyNoMoreInteractions).services/game-session-service/src/test/java/unit/net/firedevops/firemud/gamesession/repository/CanonicalGameplayLegacyRedisSourceTest.java#L150-L151: keep theRedisConnectionmock fromredisWithScans. Assert that it receives onlyscanandserverCommands, in addition to the template checks.
📍 Affects 2 files
services/game-session-service/src/test/java/unit/net/firedevops/firemud/gamesession/repository/CanonicalGameplayFreshNamespaceRedisReconcilerTest.java#L692-L697(this comment)services/game-session-service/src/test/java/unit/net/firedevops/firemud/gamesession/repository/CanonicalGameplayLegacyRedisSourceTest.java#L150-L151
- Accepted Current read-only Redis tests observe template methods but miss connection-level commands used in production. Retain connection mocks and prove only scan/serverCommands interactions; preserve existing no-mutation assertions.
- Do not record kids as unknown before the first successful load.Minor
Before any snapshot loads,
loadedAtisnull. In that statecachedKidKnownis false for every kid. If the source is unavailable on the first lookup, this block adds the requested kid tounknownKidsRefreshedForSnapshot.This is the failure sequence:
- The first
keyFor("k")runs on a never-loaded cache while the source is down. The call throwsSourceUnavailableException, which is correct. - A second lookup for
kruns withinSTALE_SOURCE_RETRY_BACKOFF. The check at Lines 113-115 findskin the set and throwsUnknownKeyException. AccountAsymmetricJwtVerifier.verifymapsUnknownKeyExceptiontoVerificationException, not toVerificationUnavailableException.
A validly signed token is therefore reported as invalid during a startup outage. It should be reported as retryable. The earlier fix covered cached kids only. This path never had a snapshot that could prove the kid unknown.
Record the kid only when a prior snapshot exists. Add a regression test: on a never-loaded cache with the source down, two
keyForcalls within one second must both throwSourceUnavailableException.🐛 Proposed fix
--- "a/services/common-security/src/main/java/net/firedevops/firemud/common/security/AccountPublicJwksCache.java" +++ "b/services/common-security/src/main/java/net/firedevops/firemud/common/security/AccountPublicJwksCache.java" @@ -143,10 +143,11 @@ refreshFromSource(); } catch (SourceUnavailableException unavailable) { recordStaleRefreshFailure(StaleRefreshFailure.SOURCE_UNAVAILABLE); - if (!cachedKidKnown + if (!cachedKidKnown + && loadedAt != null && unknownKidsRefreshedForSnapshot.size() < MAX_UNKNOWN_KID_REFRESHES_PER_SNAPSHOT) { unknownKidsRefreshedForSnapshot.add(kid); } throw unavailable; } catch (InvalidJwksException invalid) { recordStaleRefreshFailure(StaleRefreshFailure.INVALID_JWKS);- Accepted Never-loaded JWKS outage incorrectly records an unknown kid, causing a later retry to look like invalid credentials. Require a prior successful snapshot before recording, with two-call SourceUnavailable regression.
- The first
Routed Findings
No routes recorded
Unlinked items
no items unlinked