PR #3162 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 not recordedFound: 2 Accepted: 2 Routed: 0
- Major: run-owned fixture evidence stops before World lifecycle validationMajor
Severity Major. Testing owner system-architecture-testing.md:180-186 permits committed fixture projections for GS preflight while preserving GDS production denial. GS GameInstanceServiceImpl.java:1314-1385 verifies receipt snapshots against authenticated ResolveLaunchDescriptor. World PrepareWorldInstanceRequest proto:179-193 and GS WorldManagementClient.java:103-136 carry only descriptor inputs. World WorldLifecycleCommandServiceImpl.java:202 and :262-276 call validateAttestedLaunchInputs for fresh prepare and nonterminal activate; :468-525 invokes all three GDS reads. GDS GameDesignGrpcService.java:2175-2194 authenticates candidate peers then denies before reads. Both transitions require bounded fixture evidence; prepare-only repair leaves activate blocked. World world-creation-workflow.md:49-55 requires rereads, so Testing needs an explicit narrow World fixture consequence preserving production freshness and ADR 0123 lifecycle/epoch authority.
- Accepted Root accepts for Gameplay PR 3162 repair: gate evidence at both prepare and activate; preserve production denial. Prove identity denials, replay/restart, zero GDS fixture reads and rebuilt smoke. Static bounded evidence; Root owns carrier choice and integration.
- Major: synthesized prb alias rejects the persisted opaque release referenceMajor
Severity Major. GDS PublishedReleaseBundleRepository.java:130-159 generates, persists, and verifies an opaque UUID-shaped publishedReleaseBundleRef. Projection/descriptor preserve it; run-owned GS GameInstanceServiceImpl.java:1348 compares it directly. World WorldLifecycleCommandServiceImpl.java:483-487,646-647 instead requires synthesized prb:<tenantId>:<versionId>:<bundleId>, rejecting valid owner evidence after transport repair. Ordinary GS retains alias reconstruction at GameInstanceServiceImpl.java:824-826 and :1413-1414. Canonical owner game-design-service/game-templates.md:233 requires opaque byte-for-byte preservation; :232 claiming no reference field is stale. This is implementation convergence and nearby documentation drift, not missing target authority. Preserve actual owner references without parsing UUID format or inventing aliases.
- Accepted Root accepts for Gameplay PR 3162 repair: compare actual opaque owner references and align stale docs. Prove unrelated opaque ref success, changed ref denial and exact replay through prepare/activate. Production denial remains; static bounded assessment.
- Subagent Review 2 CompletedModel: gpt-6.1-sol · MediumFound: 1 Accepted: 1 Routed: 0
- Define exact fixture ACTIVE replay epoch semanticsMinor
Draft SHA2565bd3b9a80a6038f69ba36f6a1293d89e0f9e45c7dd4c02465af5d5938a8f725b does not specify caller epoch for exact ACTIVE retry. Immutable8d7 WorldLifecycleCommandServiceImpl.java253-256/593-599 requires current epoch before ACTIVE fast path, so original activation request epoch becomes stale after success. State fixture-only original PREPARING epoch replay when stored binding matches; reject other stale epochs/changed identity. Prove lost-response retry and restart; no implementation or runtime proof in this static contract review.
- Accepted Choose receipt-bound replay at retained original PREPARING epoch for an already ACTIVE row, with complete identity match and no mutation; preserve ordinary current-epoch/CAS behavior.
- CLI Review 1 CompletedRuntime 3m 31sFound: 5 Accepted: 1/2/2 Routed: 0
- Fix the migration attribution for
versionassetexportitem.MinorFix the migration attribution for `version_asset_export_item`.
Line 304 states that "Migration V38 defines the
version_asset_export_itemprojection". V37 createsversion_asset_export_item, together withversion_asset_export_snapshotand their guard triggers (V37__version_asset_export_snapshot.sqllines 51-70). V38 only addsmanifest_schema_version,artifact_digests_json, and candidate evidence columns topublished_release_bundleandversion_asset_artifact.Readers who use this sentence to find the snapshot schema will open the wrong migration. Lines 9, 360, 412, and 513 use "V37/V38" loosely, but line 304 makes a specific false claim.
📝 Proposed fix
-Before the first byte is exported for a version, the workflow freezes an immutable durable per-version export snapshot. Migration V38 defines the `version_asset_export_item` projection keyed by `(tenant_id, version_id, usage_key)` with selected `asset_id`, source content hash, byte size, and content type. +Before the first byte is exported for a version, the workflow freezes an immutable durable per-version export snapshot. Migration V37 defines the `version_asset_export_snapshot` header and the `version_asset_export_item` projection keyed by `(tenant_id, version_id, usage_key)` with selected `asset_id`, source content hash, byte size, and content type; V38 adds the candidate artifact-digest evidence columns.As per path instructions: "Review docs for canonical-current-state consistency."
- Accepted Verified V37 creates export snapshot header/items; V38 adds candidate artifact evidence. Correct the specific migration attribution.
- Use the shared PostgreSQL test image in the new authored-world integration tests.Trivial
Both new tests hard-code
"postgres:16-alpine". The other Game Design integration tests useTestContainerImages.postgres(). The authored-world migrations and triggers can therefore be verified against a different PostgreSQL image than the rest of the suite.services/game-design-service/src/test/java/integration/net/firedevops/firemud/gamedesign/repository/GameAuthoredWorldSourceDeliveryIntegrationTest.java#L60-L61: replace the literal image withnew PostgreSQLContainer<>(TestContainerImages.postgres())and importnet.firedevops.firemud.test.TestContainerImages.services/game-design-service/src/test/java/integration/net/firedevops/firemud/gamedesign/repository/GameAuthoredWorldSourceRepositoryIntegrationTest.java#L57-L58: make the same replacement and import.
- Accepted Verified both authored-world tests use PostgreSQL 16 instead of shared canonical test image. Use TestContainerImages.postgres().
- The delete guard blocks script-patch failure cleanup and leaves the attempt permanently PENDING.Major
Every new
Versionrow now receives a canonical identity, becauseVersionRepository.saveissuescanonical_version_idon insert. This includes script-patch drafts created inVersionServiceImpl.reserveScriptPatch. This trigger then rejectsDELETEfor any row whosecanonical_version_id IS NOT NULL.VersionServiceImpl.failScriptPatch(line 407) still callsdraft.ifPresent(versionRepository::delete)beforemarkScriptPatchFailed. The failure sequence is:- A deterministic gate failure occurs, for example
PARTICIPANT_SCOPE_MISMATCHor arecordVerifiedDigestsfailure. failScriptPatchruns, and theDELETEraisescanonical Version identity is immutable.- The cleanup transaction rolls back. The attempt is never marked
FAILED. - The caller receives the cleanup
DataAccessException, with the real failure suppressed. The gRPC handler maps it toINTERNAL. - Every exact retry finds the
PENDINGattempt and theDRAFTrow, repeats the same failure, and fails cleanup again.
The publish request has no exit. The effective
(tenant, base, patch)tuple also stays occupied by the undeletable Draft row.reserveScriptPatchthen rejects new request IDs withPUBLISH_SCRIPT_PATCH_IDENTITY_CONFLICT.VersionServiceImplTest.failedScriptPatchRecordsStableAttemptAndRemovesDraftForRetrymocks the repository, so it cannot detect this.Pick one contract and implement it in both places:
- Option 1: Permit deleting a canonical row only while
OLD.version_state = 'DRAFT'and no bundle, mapping, or snapshot references it. The existing FKs withON DELETE RESTRICTalready cover dependents. - Option 2: Retain the candidate, as the full-version path does. Move it to
FAILEDinstead of deleting it. Then make the script-patch tuple conflict check (and V27's partial unique index) excludeFAILEDrows.
Add a PostgreSQL integration test that drives a script-patch gate failure through the real repository.
🐛 Sketch for option 1
IF TG_OP = 'DELETE' THEN - IF OLD.canonical_version_id IS NOT NULL THEN + IF OLD.canonical_version_id IS NOT NULL + AND OLD.version_state IS DISTINCT FROM 'DRAFT' THEN RAISE EXCEPTION 'canonical Version identity is immutable' USING ERRCODE = 'check_violation'; END IF; RETURN OLD; END IF;As per path instructions: "Prioritize bugs, regressions, missing tests, cross-service contract drift".
- Accepted Verified canonical delete guard rolls back script-patch failure finalization. Retain Draft candidate and record FAILED attempt under existing retained-tuple contract; preserve migrations.
- A deterministic gate failure occurs, for example
- Use one mapper for the Version-state and artifact-state projections.Trivial
The new
toProto(VersionAssetArtifactStateDto),toProto(VersionStateDto), andtoProto(model.VersionLifecycleState)copy existing code inGameDesignGrpcService:toProto(VersionAssetArtifactStateDto)(lines 1724-1739)toProtoVersionState(lines 1001-1010)toProtoVersionLifecycleState(lines 1062-1077)
GameDesignGrpcService.getVersionStateandgetVersionAssetArtifactStatestill use the private copies. The new mapper tests (launchReadProjectionMapperReturnsCanonicalStateSnapshotandlaunchReadProjectionMapperReturnsArtifactProof) therefore test code that no production RPC calls. A later field change to one copy can drift from the other.Delegate the three private methods in
GameDesignGrpcServicetoGameDesignLaunchReadProjectionMapper, or delete them and call the mapper directly.♻️ Sketch for GameDesignGrpcService
// getVersionState builder.setVersionState( GameDesignLaunchReadProjectionMapper.toProto( versionService.getVersionState(request.getTenantId(), request.getVersionId()))); // getVersionAssetArtifactState and the purge/tombstone/repair handlers builder.setArtifactState( GameDesignLaunchReadProjectionMapper.toProto( versionAssetArtifactService.getState(request.getTenantId(), request.getVersionId())));- Accepted Verified production RPCs duplicate the tested projection mapper. Converge identical state/artifact/lifecycle mappings without response changes.
- Remove the stale
CompareAndSetVersionStateclaim from the V28 paragraph.MinorLine 9 now states that state-changing
CompareAndSetVersionStaterequests fail closed after the tenant/version and epoch checks. Line 13 still says "the live path still accepts any non-null lifecycle state after its in-memory epoch check".VersionServiceImpl.compareAndSetVersionState(lines 856-863) now refuses every state change withVERSION_STATE_MUTATION_UNAVAILABLE. The two statements in this Implementation Status section contradict each other.📝 Proposed fix
-This data correction is separate from the still-open `CompareAndSetVersionState` transition gap: the live path still accepts any non-null lifecycle state after its in-memory epoch check and does not enforce release-bundle/artifact or retirement guards. +This data correction is separate from the still-open `CompareAndSetVersionState` transition gap: the live path refuses every state-changing request with `VERSION_STATE_MUTATION_UNAVAILABLE`, and the legal transition matrix, release-bundle/artifact and retirement guards, and database CAS remain unimplemented.As per path instructions: "Flag obsolete transitional guidance, conflicts between architecture docs".
- Accepted Verified V28 status contradicts fail-closed CAS implementation. Correct only current status while retaining unimplemented transition/CAS guards.
- Hosted Review 1 CompletedRuntime 8m 08sFound: 4 Accepted: 4 Routed: 0
- Use the configured jOOQ stop marker.Minor
The module uses jOOQ
DDLDatabasewithout overriding its ignore markers. The default closing marker is[jooq ignore stop], so[jooq ignore end]does not close this ignore region.--- [jooq ignore end] +-- [jooq ignore stop]- Accepted V36 jOOQ closing marker is invalid under canonical default; exact two-comment correction awaits Root migration-byte authority.
- CodeRabbit summary-only outside-diff finding 1 of 1 (aggregate; no individual detail)
summary-only aggregate; provider supplied no individual detail
- Accepted Verified outside-diff tracker finding duplicates still-open CLI2 scope; preserve partial statuses and add accurate implementation/proof anchors.
- Use the
[jooq ignore stop]marker.MinorThe jOOQ DDL parser recognizes
[jooq ignore stop], not[jooq ignore end]. Replace the marker.--- -- [jooq ignore end] +++ -- [jooq ignore stop]- Accepted V41 jOOQ closing marker is invalid under canonical default; exact two-comment correction awaits Root migration-byte authority.
- Make the H2
outcome_statuscolumn match V35. Then assert the PostgreSQL readback.MinorIn V35,
outcome_statusisVARCHAR(16) NOT NULL DEFAULT 'SUCCESS'. A legacysave()does not set the column, so PostgreSQL storesSUCCESS. The test table at Line 43 declaresoutcome_status VARCHAR(16)with no default. Line 105 then assertsgetOutcomeStatus()isnull. Production never returns that value for a retained row. The assertion fixes behavior that does not match the real schema. It can hide a regression in the outcome mapping for retained descriptors.Proposed fix
- + "source_evidence_json VARCHAR(4000), outcome_status VARCHAR(16), " + + "source_evidence_json VARCHAR(4000), " + + "outcome_status VARCHAR(16) DEFAULT 'SUCCESS' NOT NULL, "- assertThat(saved.getOutcomeStatus()).isNull(); + assertThat(saved.getOutcomeStatus()).isEqualTo(LaunchDescriptor.OUTCOME_SUCCESS);Also applies to: 105-105
- Accepted H2 test schema lacks V35 non-null SUCCESS default and asserts impossible retained outcome; accepted focused schema/assertion correction.
- CLI Review 2 CompletedRuntime 3m 25sFound: 2 Accepted: 0/2/0 Routed: 0
- Update the Capability Status rows. Do not record the new foundation only as narrative above the table.Minor
The tracker contract states that "the capability rows are the complete scan-first status surface". The new paragraph at Line 50 describes V34.1–V41, canonical Version/bundle identity, and the Version refusal. The owning rows were not updated:
- The
AR-1.4row at Line 59 still lists only V8/V10 as implementation anchors. Its gap text still says "Theversion_assetmapping table and its Draft-version authoring path are absent" and "The release bundle also lacks canonical target-commit, manifest-schema, and applicable artifact-digest fields". These statements contradict the changed Lines 131, 135, and 185. Those lines say that V37 defines the mapping schema and that the bundle now projects manifest-schema and artifact-digest fields. - The
AR-1.5andAR-3.1rows do not list the new production anchors as implementation anchors. The missing anchors includeV35__authored_source_launch_descriptor_binding.sql,V35.1/V35.2,V36, andV41, plusGameAuthoredWorldSourceRepository.javaandGameAuthoredWorldSourceDeliveryRepository.java. - The same rows do not list the new focused tests as proof anchors:
TestDataSeederIntegrationTest,GameAuthoredWorldSourceDeliveryIntegrationTest,PublishedReleaseBundleRepositoryTest, andLaunchDescriptorRepositoryTest. - Line 143 still says "durable
version_assetmappings and export-item snapshots are absent". Change it to say that only the runtime writer and reader paths are absent.
Move the status into the owning rows. Then rewrite the stale AR-1.4 gap text so it matches Lines 131/135/185.
As per coding guidelines, a tracker "contains one
Capability Statusrow for every capability it primarily owns" and must "Keep its status, implementation record, validation, gaps, decisions, and service-map sections aligned when a domain boundary changes".- Accepted Owning capability rows incorrectly claim mapping schema and optional bundle fields absent; update their local implementation/proof anchors and retain runtime producer/activation gaps.
- The
- Close the jOOQ ignore blocks with
[jooq ignore stop].MinorjOOQ
DDLDatabaserecognizes[jooq ignore start]and[jooq ignore stop]by default. The other new migrations usestop. These two files use[jooq ignore end], so jOOQ does not close the ignore block. The effect is harmless only if jOOQ parses each script on its own. Otherwise, schema generation can fail or skip later DDL.services/game-design-service/src/main/resources/db/migration/V36__persist_opaque_published_release_bundle_reference.sql#L56-L56: replace-- [jooq ignore end]with-- [jooq ignore stop].services/game-design-service/src/main/resources/db/migration/V41__world_authored_source_delivery.sql#L249-L249: replace-- [jooq ignore end]with-- [jooq ignore stop].
- Accepted Canonical jOOQ convention sets no override; DDLDatabase default closing token is stop, while V36/V41 use end. Two-comment correction is valid; historical byte restriction awaits Overseer adjudication.
- CLI Review 3 CompletedRuntime 3m 19sFound: 1 Accepted: 0/1/0 Routed: 0
- Both immutability assertions pass through the bound-field guard, not the immutability guard.Minor
A descriptor read back from the database has
outcomeStatus = "SUCCESS"from the column default.LaunchDescriptorRepository.saverejects any non-nullgetOutcomeStatus()before it checksgetId(). It throwsIllegalArgumentException("Bound launch descriptors require the immutable owner insert").hasMessageContaining("immutable")accepts that message, so neither test proves the"Launch descriptors are immutable"branch.services/game-design-service/src/test/java/unit/net/firedevops/firemud/gamedesign/repository/LaunchDescriptorRepositoryTest.java#L118-L118: assert.isInstanceOf(IllegalStateException.class).hasMessage("Launch descriptors are immutable").services/game-design-service/src/test/java/integration/net/firedevops/firemud/gamedesign/data/TestDataSeederIntegrationTest.java#L186-L186: assert.isInstanceOf(IllegalStateException.class).hasMessage("Launch descriptors are immutable").
- Accepted Verified DB SUCCESS default makes substring immutable assertions exercise bound-insert refusal. Strengthen exact exception proofs and check persisted-ID immutability first so existing rows cannot take new-insert guards.
- CLI Review 4 CompletedRuntime 2m 52sFound: 0 Accepted: 0/0/0 Routed: 0
- No findings recorded for this run
- Hosted Review 2 CompletedRuntime 6m 37sFound: 1 Accepted: 0/0/1 Routed: 0
- Move the artifact-digest deserialization into a helper and treat blank JSON as absent.Trivial
Three sibling helpers in this class treat
nulland blank JSON as empty:deserializeKeys,deserializeParticipantDigestsanddeserializeCommandDefinitions. The inline expression at Lines 123-129 checks only fornull. A stored value of""therefore reachesobjectMapper.readValue. Jackson fails on empty input, so the bundle read throws instead of returning an absent value. Move this logic into adeserializeArtifactDigestshelper. Returnnullfor both null and blank input, so absent values keep the meaning thatretainedBundleWithoutCanonicalIdentityKeepsIdentityAndArtifactProofAbsentasserts.♻️ Proposed refactor
--- "a/services/game-design-service/src/main/java/net/firedevops/firemud/gamedesign/service/impl/PublishedReleaseBundleServiceImpl.java" +++ "b/services/game-design-service/src/main/java/net/firedevops/firemud/gamedesign/service/impl/PublishedReleaseBundleServiceImpl.java" @@ -120,13 +120,7 @@ entity.getCanonicalVersionId(), entity.getPublishedReleaseBundleRef(), entity.getManifestSchemaVersion(), - entity.getArtifactDigestsJson() == null - ? null - : objectMapper.readValue( - entity.getArtifactDigestsJson(), - objectMapper - .getTypeFactory() - .constructCollectionType(List.class, PublishedArtifactDigest.class))); + deserializeArtifactDigests(entity.getArtifactDigestsJson())); return dto; }private List<PublishedArtifactDigest> deserializeArtifactDigests(String json) { if (json == null || json.isBlank()) { return null; } return objectMapper.readValue( json, objectMapper.getTypeFactory() .constructCollectionType(List.class, PublishedArtifactDigest.class)); }- Accepted Verified Trivial: optional retained artifact JSON checks only null; blank text throws. Treat null/blank as absent null via sibling helper, keep typed nonblank parsing strict and test absent/populated/malformed readback.
- CLI Review 5 CompletedRuntime 3m 01sFound: 1 Accepted: 0/1/0 Routed: 0
- Move the
888fvalidation evidence to the Validation and Proof section.MinorThis paragraph records runtime and CI proof (316 tests, 37 PostgreSQL cases, Rebuilt Runtime
LOGIN/PLAY/LOOK) inside the Capability Status preamble. It cites two external GitHub Actions run URLs as the evidence. The Validation and Proof section (Lines 169-178) does not record this foundation slice, so the tracker sections are no longer aligned.The tracker contract requires that evidence targets are "repository-local and resolvable". It also requires that the tracker keeps its "status, implementation record, validation, gaps, decisions, and service-map sections aligned".
Do these steps:
- Keep only a short status sentence in the Capability Status preamble.
- Move the
888frun summary to a bullet under Validation and Proof. - Keep the external run links as context only. Do not present them as focused executable proof.
- Remove the repeated "does not establish runtime activation" sentence.
As per coding guidelines: "Evidence targets must be repository-local and resolvable" and "Keep its status, implementation record, validation, gaps, decisions, and service-map sections aligned".
- Accepted Verified Minor tracker drift: detailed historical888f proof is in status but absent from proof section. Move bounded evidence below; retain status and retention caveats, add local executable anchors, keep run URLs as dated context.
- CLI Review 6 CompletedRuntime 3m 33sFound: 3 Accepted: 0/2/1 Routed: 0
- Check
contenthashagainst the source bytes in the export-item guard.TrivialCheck `content_hash` against the source bytes in the export-item guard.
guard_version_asset_export_itemcheckscontent_typeandbyte_sizeagainstgame_assets. It does not checkcontent_hash. A writer can freeze an item with any well-formedsha256:value, and the snapshot then becomes immutable evidence for bytes it does not describe. The snapshot is the future exact-bytes repair source.asset-storage.mdrequires the snapshot to "verify source bytes" and to never silently substitute bytes.The trigger already reads
a.data. It can compute the digest inside the same query (PostgreSQL 11+sha256(bytea)). V37 runtime writers are not live yet, so this migration can still change before activation. If V37 has already been applied in a shared environment, add the check in a forward migration instead.Proposed change
- SELECT a.content_type, octet_length(a.data)::BIGINT - INTO source_type, source_size + SELECT a.content_type, octet_length(a.data)::BIGINT, + 'sha256:' || encode(sha256(a.data), 'hex') + INTO source_type, source_size, source_hash FROM game_assets a ... IF NOT FOUND OR source_type IS DISTINCT FROM NEW.content_type - OR source_size IS DISTINCT FROM NEW.byte_size THEN + OR source_size IS DISTINCT FROM NEW.byte_size + OR source_hash IS DISTINCT FROM NEW.content_hash THENDeclare
source_hash VARCHAR(71);in theDECLAREblock.- Accepted Verified source digest omission. Root decision1104 authorizes minimal forward guard replacement preserving V37 and all predicates, with correct/incorrect digest PostgreSQL proof.
- Return
updated=falsefor the same-state no-op.MinorAfter this change,
VersionServiceImpl.compareAndSetVersionStatereturns normally only when the requested state equals the current state. That path saves nothing and does not change the epoch. Every state-changing request now throwsMutationOwnerProofUnavailableException.Line 797 still sets
setUpdated(true)on every successful return. Callers such as retirement or activation tooling can readupdated=trueas proof that a transition was committed. The docs (api-contracts.mdLine 155) describe this path as a no-op.Proposed fix
- builder.setVersionState(toProtoVersionState(state)).setUpdated(true); + // State-changing requests fail closed; a successful return is the exact same-state no-op. + builder.setVersionState(toProtoVersionState(state)).setUpdated(false);Add an assertion for
getUpdated()to the same-state test inGameDesignGrpcServiceTest.- Accepted Verified Minor: state-changing calls refuse; only same-state no-op returns normally, but RPC says updated=true. Report false and prove returned state/epoch with no error.
- Update the stale current-behavior bullet about
publishedReleaseBundleRef.MinorLine 18 states that new bundles now store an owner-generated opaque reference.
GameDesignLaunchReadProjectionMappernow sends that value inpublishedReleaseBundleRef. The value is empty for retained bundles and a UUID for new inserts.Line 235 (unchanged) still says that
GetPublishedReleaseBundle"returns the bundleidandgenerationConfigRevisionrather than a separate reference field". That statement is now false. Launch descriptors still store the reconstructedprb:<tenantId>:<versionId>:<bundleId>value. A reader can therefore compare the descriptor reference with the new opaque field and get a mismatch on every new bundle.Update line 235 with these facts:
- The response now carries the opaque owner reference for new bundles. Retained bundles carry an empty value.
- The descriptor compatibility path still reconstructs
prb:frombundle.id. - Consumers must not compare the descriptor
prb:value with the opaque field until the two converge.
As per path instructions: "Review docs for canonical-current-state consistency. Flag obsolete transitional guidance, conflicts between architecture docs".
- Accepted Verified Minor stale reference/RPC documentation. Correct current opaque projection/retained absence and denied production-read facts; preserve canonical opaque contract, do not introduce prb/UUID comparison authority.
Routed Findings
No routes recorded
Unlinked items
no items unlinked