PR #3203 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
- CLI Review 1 CompletedRuntime 2m 41sFound: 1 Accepted: 0/0/0 Routed: 0
- Mapping rows are paired with plan nodes by index, but the two lists use different orders.Minor
plan.graph().nodes()keeps the order ofbinding.revisions(). The SQL query sorts mappings byrevision_order::numeric. The loop at Lines 346-371 pairsmappings.get(i)withnodes.get(i)and then requires equalrevision_id.WorldCanonicalAuthoredGraphReader.readdepends on the same index pairing. SupposeDraftCommitBindingorders revisions in another way, for example lexicographic"10" < "9", or caller order. Then every commit with that order failsstoreafter the SQL function succeeds, and the transaction rolls back. The integration test uses only"0"–"6", so it cannot show this failure.Verify that
DraftCommitBinding.revisions()is always sorted by numericrevisionOrder. If it is not, look up each mapping byrevision_idinstead of by position. Alternatively, sort the plan nodes numerically before pairing them.Also applies to: 346-371
- Rejected DraftCommitBinding.validateRevisions requires each revisionOrder equal Integer.toString(index). World plan preserves this order while filtering World nodes; SQL numeric sort has identical relative order. The hypothesized lexicographic/caller order cannot construct a valid binding.
- CLI Review 2 CompletedRuntime 2m 12sFound: 4 Accepted: 1/3/0 Routed: 0
- Use one serializer for
ownerbindingjsonin both writers.MinorUse one serializer for `owner_binding_json` in both writers.
WorldDraftTopologyCommitRepository.store(line 78) writesowner_binding_jsonwith the injectedmapper. This repository writesownerJsonwith its own staticJSONmapper. Line 205 then requires an exact match withJSON.writeValueAsString(ownerBinding). The V1006 triggerworld_check_canonical_frozen_capturecomparesNEW.owner_binding_json IS DISTINCT FROM commit_row.owner_binding_jsonas TEXT, not as JSONB. The two strings can differ in property order, naming strategy, indentation or inclusion settings. If they differ, the trigger rejects every frozen capture, andfindrejects every retained row.The tests construct both components with a default
ObjectMapper, so they do not exercise this case.WorldDraftDesignDigestServiceImplalready avoids the application-wide mapper for the same reason.Check one fact. When
WorldDraftTopologyCommitRepositoryis wired in production, does itsObjectMapperproduce byte-identical output to the strict defaultJsonMapperforOwnerBinding? If you cannot guarantee that, make both writers use one shared canonical mapper. As an alternative, compare the owner binding as JSONB in the trigger and parse it before comparing in Java.- Accepted Commit uses injected mapper while frozen writer/readback uses static default; exact TEXT equality lacks a stable shared serializer guarantee. Use one domain-local stable default OwnerBinding serializer, retaining exact checks.
- Update the spawn-binding digest field list to match schema 3.Minor
Lines 199-200 state that schema 3 uses a tagged
entityReferencefor spawn bindings. Line 183 still listsentityTemplateIdas a currentworld_entity_spawn_bindingdigest field.WorldDraftDesignDigestServiceImplno longer emitsentityTemplateId. It emitsentityReferencewithkindset toRETAINED_PRIVATE_KEYorCANONICAL_UUID. The manifest in this document now contradicts itself. ReplaceentityTemplateIdon line 183 withentityReferenceand describe the two tagged forms.As per path instructions: "Review docs for canonical-current-state consistency. Flag obsolete transitional guidance, conflicts between architecture docs".
📝 Proposed fix for line 183
-- Current concrete `world_entity_spawn_binding` digest fields include `id`, `roomId`, `entityTemplateType`, `entityTemplateId`, `spawnCount`, and `respawnDelaySeconds`. +- Current concrete `world_entity_spawn_binding` digest fields include `id`, `roomId`, `entityTemplateType`, the tagged `entityReference` (`RETAINED_PRIVATE_KEY` with `templateId`, or `CANONICAL_UUID` with `tenantId`, `versionId` and `templateId`), `spawnCount`, and `respawnDelaySeconds`.- Accepted Current digest schema3 emits tagged entityReference; the concrete manifest still lists obsolete entityTemplateId. Align the owner manifest with the actual tagged numeric/canonical forms.
- Align the other tracker sections with the new schema-3 stage.Minor
The new section says that the ordinary digest writer now emits schema 3. Other sections of the same tracker were not updated:
- Line 122 still says "World currently emits digest schema
2". - Line 147 (Active Gaps) still says "World digest schema
2is not accepted by the current Game Design publish gate". It should now name schema3. - Line 19 still says "No physical V28 graph-snapshot proof". V28 was replaced by the V1003 donor migration, so this reference is obsolete.
- The
GR-2.1Capability Status row (line 51) names migrationsV23.1–V27.2only. It does not name the V1003–V1007.1 migrations or the newtenantproduction anchors, such asWorldDraftTopologyCommitRepositoryandWorldAuthoredGraphSnapshotCapture. Its proof anchors also omitWorldGuardedAuthoredGraphCapturePostgresIntegrationTestandWorldGuardedAuthoredTopologyPlanTest.
As per coding guidelines: "Keep its status, implementation record, validation, gaps, decisions, and service-map sections aligned when a domain boundary changes" and "
implementedandpartialrows name concrete production anchors."- Accepted Tracker current schema2 statements and V28 name contradict emitted schema3/V1003 donor and omit implemented production/proof anchors. Update aligned status without claiming activation or missing physical proof.
- Line 122 still says "World currently emits digest schema
- Graph capture rejects every canonical UUID spawn binding.Major
V1005 makes
entity_template_idnullable. V1005 also requiresentity_template_id IS NULLfor canonical references, andworld_store_guarded_uuid_topologyalways writes it as NULL. Line 233 callsrequired(row, ENTITY_TEMPLATE_ID). That call throwsSnapshotConflictException("... null required field entity_template_id")for every canonical spawn row. As a result,WorldAuthoredGraphSnapshotCapture.capturecannot create a schema-3 snapshot for any guarded UUID topology that has a spawn binding. The schema-3 digest that the capture compares against already supports the tagged representation, so these two components disagree.The graph also never reads the
entity_canonical_*columns. Even a numeric-only snapshot cannot represent a canonical reference.WorldAuthoredGraph.decodeSpawnBindinghas the same problem: it requires a positiveentityTemplateIdand has no canonical fields. The duplicate check on line 243 also needs the canonical tuple. Without it, two canonical bindings in the same room look identical.Use the same tagged representation in both the reader and the codec. Keep the numeric form for retained rows. Add
tenantId,versionIdandtemplateIdfor canonical rows. Reject mixed and partial forms, asWorldDraftDesignDigestServiceImpl.entityReferencedoes. Then bumpSNAPSHOT_SCHEMA_VERSIONso that retained schema-1 bytes still decode. The current integration test stops at the missing V19 history check before it reads the graph, so no test covers this path.- Accepted Canonical spawn rows deliberately have NULL numeric entity_template_id; authored graph reader/codec require positive numeric field, so canonical capture fails. Add same tagged variants and strict mixed/partial rejection, version fresh graph bytes and preserve immutable retained schema1 decoding.
- CLI Review 3 CompletedRuntime 2m 15sFound: 4 Accepted: 2/2/0 Routed: 0
- Remove the contradiction about graph snapshot capture in this status bullet.Minor
Line 7 says the cut "does not implement graph snapshot capture". The same bullet then says an unpublished component-owner candidate "now includes graph capture". A reader cannot tell which statement is current. Scope the first statement to the source-retention cut, and keep the candidate statement as the current status.
📝 Proposed wording fix
-... This does not implement graph snapshot capture, frozen topology, canonical preparation/execution artifacts (including V62/V63), runtime activation, or gameplay admission, and does not claim external database application. An unpublished component-owner candidate now includes graph capture and the ordinary schema-3 digest writer; ... +... The source-retention cut itself does not implement graph snapshot capture, frozen topology, canonical preparation/execution artifacts (including V62/V63), runtime activation, or gameplay admission, and does not claim external database application. A separate unpublished component-owner candidate now includes graph capture and the ordinary schema-3 digest writer; ...This follows the path instruction to "Review docs for canonical-current-state consistency."
- Accepted Accepted Minor: distinguish original source-retention cut from guarded component capture candidate, preserving missing authority/activation boundaries.
- Serialize immutable evidence with a fixed-configuration mapper, not the injected application mapper.Major
These components store bytes or digests produced by the application
ObjectMapper. Later they recompute those values with the same mapper and require exact equality. If the application mapper configuration changes, for exampleINDENT_OUTPUT(which the integration test already injects), every retained record fails exact replay or readback with a conflict.ownerBindingJsonandWorldDraftDesignDigestServiceImplalready use a dedicated default mapper for this reason.services/world-management-service/src/main/java/net/firedevops/firemud/worldmanagement/tenant/WorldDraftTopologyCommitRepository.java#L44-L44: use a static fixedJsonMapperforreadAndVerifyGraphgraph bytes andencodeResultbytes. Keep the injectedmapperonly for parsing.services/world-management-service/src/main/java/net/firedevops/firemud/worldmanagement/tenant/WorldAuthoredGraphSnapshotCapture.java#L77-L77: use a static fixedJsonMapperforgraph.encode,encodeTuples,captureOwnerRevisionEvidence, andcaptureRequestDigest. This keeps exact retries stable when the application configuration changes.
- Accepted Accepted Major: immutable graph/result/tuples/revision/digest bytes must use fixed default serialization across app mapper changes; retain existing default byte contracts and exact replay checks.
- The schema-3 bump breaks full-version publish against the current Game Design gate.Major
The registered
GetDraftDesignDigestnow returnsdigestSchemaVersion = 3. The tracker states that the current Game Design publish gate supports only World digest schema2. Before this change, both sides used schema 2. After this change, every full-version publish that reads the World participant digest fails at the Game Design gate. Choose one of these options:- Land Game Design schema-3 support in the same change.
- Keep the registered RPC on schema 2. Expose schema 3 only to the unwired capture components until the schema adoption is coordinated.
Confirm whether any environment currently runs full-version publish through this gate.
- Accepted Accepted Major: actual PublishGate hardcodes World2 while producer and shared attestation use3. Root01e859cb places coherent GDS adoption on3203; Document owns patch. CompleteLaunch already uses shared3, no downgrade/remap/guard relaxation.
- List the guarded-stage migrations in the Implementation Status migration inventory.Minor
Line 5 still says the forward-only migrations are "
V23.1andV24–V27.2". This PR addsV1003–V1007.1, and line 31 and the tracker record them. Add a short reference here so that the status summary matches the canonical inventory.- Accepted Accepted Minor: current status must include guarded V1003–V1007.1 inventory while preserving installed history/external-application limits.
- Hosted Review 1 CompletedRuntime 6m 44sFound: 4 Accepted: 1/1/2 Routed: 0
- Use a dedicated fixed mapper for all immutable evidence that replay recomputes.Major
Immutable history is serialized with the injected application
ObjectMapper, and replay recomputes that history and compares it byte-for-byte or by digest. The application mapper configuration can change later, for example indentation, map-key ordering, inclusion rules, or number output. After such a change, all retained history fails replay permanently.OWNER_BINDING_JSONalready fixes this problem for the owner binding. Apply the same fix to the remaining encoders.services/world-management-service/src/main/java/net/firedevops/firemud/worldmanagement/tenant/WorldDraftTopologyCommitRepository.java#L580-L604: InencodeResult, encoderesult_byteswith a staticJsonMapper.builder().build()instead ofmapper.services/world-management-service/src/main/java/net/firedevops/firemud/worldmanagement/tenant/WorldDraftTopologyCommitRepository.java#L469-L474: InreadAndVerifyGraph, encodegraph_byteswith the same static mapper.services/world-management-service/src/main/java/net/firedevops/firemud/worldmanagement/tenant/WorldAuthoredGraphSnapshotCapture.java#L252-L266: EncodewriteJsonandwriteJsonByteswith a static fixed mapper, becauserequireSameRequestcompares the tuples JSON andcaptureRequestDigest.
Proposed fix
- private static final ObjectMapper OWNER_BINDING_JSON = JsonMapper.builder().build(); + private static final ObjectMapper OWNER_BINDING_JSON = JsonMapper.builder().build(); + private static final ObjectMapper HISTORY_JSON = JsonMapper.builder().build(); ... - return mapper.writeValueAsBytes(graph); + return HISTORY_JSON.writeValueAsBytes(graph); ... - return mapper.writeValueAsBytes(result); + return HISTORY_JSON.writeValueAsBytes(result);📍 Affects 2 files
services/world-management-service/src/main/java/net/firedevops/firemud/worldmanagement/tenant/WorldDraftTopologyCommitRepository.java#L580-L604(this comment)services/world-management-service/src/main/java/net/firedevops/firemud/worldmanagement/tenant/WorldDraftTopologyCommitRepository.java#L469-L474services/world-management-service/src/main/java/net/firedevops/firemud/worldmanagement/tenant/WorldAuthoredGraphSnapshotCapture.java#L252-L266
- Accepted Immutable graph/result/capture serialization must use fixed private configuration; verify replay across different application mapper settings, sharing CLI3 fix.
- Add direct PostgreSQL tests for the V1006/V1007 frozen-capture insert triggers.Trivial
The test confirms that the
WorldCanonicalFrozenTopology.Requestconstructor rejects the currentversion:Ncheckpoint. That check runs before any database access. As a result, no test reachesworld_check_canonical_frozen_capture()orworld_require_new_digest_schema3_capture()onworld_canonical_frozen_topology. Both trigger functions still run on every insert into the table, from any writer.Consequences of the gap:
- Mistakes in column references would not appear in tests. Examples are
owner_row.current_publication_fence,attempt.applied_commit_id, and the JSON field names such asversionStateEpochanddigestSchemaVersion. - A mismatch between the
freeze_request_jsonserialization and the->>text comparisons would also not appear in tests.
The repository
capturepath cannot produce a positive row yet. You can still test the database guards with direct inserts intoworld_canonical_frozen_topology:- Insert a row that uses the stored
world_topology_draft_commitvalues and afreeze_request_jsonwithdigestSchemaVersionset to 2. Expect the V1007 trigger to reject it with error code23514. - Insert a row with schema 3 against the current non-FROZEN or mismatched
applied_commit_idattempt. Expect the V1006 trigger to reject it with error code23514. - Attempt
UPDATE,DELETE, andTRUNCATEon the table. Expect all three to fail with the immutable rejection.
These tests prove the fail-closed behavior. They do not claim a positive capture.
- Accepted Exercise actual V1006/V1007 invalid INSERT/TRUNCATE and immutable-source mutations; inspect frozen UPDATE/DELETE trigger bindings. No synthetic positive capture or false empty-row proof.
- Mistakes in column references would not appear in tests. Examples are
- Fix the conflicting integration-test counts in the stage proof paragraph.Minor
Line 15 reports "63 fresh physical PostgreSQL integration tests" for the gate on parent
310532f…. The PR objectives report 64 fresh PostgreSQL integration tests. Line 17 also reports 64. The paragraph does say that a later gate ran 64 tests. However, the line does not say whether 63 is correct for the earlier parent or is a typo. The tracker is the reader-facing status record, so readers cannot tell which count is correct. Confirm the count for each parent. Then state each count once and without ambiguity.- Accepted Clarify chronological 63-case and later64-case physical gates without rewriting historical proof; added retention case explains the increase.
- Remove the unused
objectMapperconstructor parameter, or document that it is ignored.TrivialThe constructor checks the injected
objectMapperfor null and then discards it. Callers and tests still pass a mapper. They can reasonably expect that mapper to control serialization. The isolation from global mapper settings is correct for a stable digest. However, accepting a dependency that the class never uses makes the contract misleading. You can remove the parameter. If you keep it for wiring compatibility, add Javadoc that says the digest always uses a private default mapper.- Accepted Remove unused application ObjectMapper constructor dependency and update all callers; private canonical schema serializer remains.
- CLI Review 4 CompletedRuntime 2m 40sFound: 1 Accepted: 0/1/0 Routed: 0
- Use one proof-status statement for the guarded graph/capture candidate.Minor
The two World architecture documents disagree. One says that focused proof remains incomplete. The other says that focused component proof is recorded. The World tracker records focused component proof. It also records that the exact checkpoint producer and positive live frozen capture are unqualified.
design/architecture/microservices/world-management-service/api-contracts.md#L7-L7: replace "its checkpoint producer and focused proof remain incomplete" with "focused component proof is recorded in the tracker, while its exact checkpoint producer and positive frozen capture remain unqualified".design/architecture/microservices/world-management-service/runtime-and-data.md#L5-L5: keep the "focused component proof is recorded" statement and add "positive frozen capture remains unqualified", so that both documents use the same wording.
As per path instructions: "Flag obsolete transitional guidance, conflicts between architecture docs".
- Accepted Align two World status paragraphs: focused component proof exists, while exact complete-commit producer and positive frozen capture remain unqualified; no capability or proof upgrade.
- CLI Review 5 CompletedRuntime 1m 41sFound: 0 Accepted: 0/0/0 Routed: 0
- No findings recorded for this run
- CLI Review 6 CompletedRuntime 2m 32sFound: 1 Accepted: 0/0/0 Routed: 0
- Verify that plan node order equals numeric
revisionorderorder.MajorVerify that plan node order equals numeric `revision_order` order.
readAndVerifyGraphfetches mappings withORDER BY m.revision_order::numeric. It then compares mappingiwithplan.graph().nodes().get(i). Plan nodes keep the iteration order ofbinding.revisions().world_store_guarded_uuid_topologychecks thatp_execution_revisionsmatches the binding revisions by ordinal, so plan order is the binding order. The SQL function then sortsnodesby(value->>'revisionOrder')::NUMERIC.Assume
DraftCommitBindingkeeps the supplied order or sortsrevisionOrderlexicographically. Then a binding with values such as"2"and"10"aligns the wrong node with each mapping.requireField(m, "template_id", ...)then throwsConflictException. Every fresh store and everyreadCommitted/findreplay for that commit fails.WorldCanonicalAuthoredGraphReader.readuses the same index pairing (rows.get(i)againstplan.graph().nodes().get(i)), so frozen capture fails the same way. The integration test uses only 7 revisions,"0"–"6", so it does not exercise this boundary.Question to resolve: does
DraftCommitBinding.create/fromStoredreject or reorder revisions so thatrevisions()is always in ascending numericrevisionOrder? If it does not, sort the nodes numerically inWorldDraftTopologyCommitPlan.create. Alternatively, pair mappings and nodes byrevision_idinstead of by list index. In either case, add a focused case with at least 11 World revisions.Also applies to: 352-354
- Rejected DraftCommitBinding validates every revisionOrder equals Integer.toString(index); create and fromStored both enforce it. World plan retains that order while filtering World nodes, so numeric SQL ordering matches. Conditional lexicographic-order premise is impossible; no defect or source change.
- Hosted Review 2 CompletedRuntime 5m 34sFound: 1 Accepted: 0/1/0 Routed: 0
- Update the stale schema-2 statements elsewhere in this tracker.Minor
The new status entry says World emits digest schema 3 and that the gate now requires schema 3. Two other parts of the same tracker still say the old contract. The
AR-1.5Capability Status row (Line 114) says "World emits digest schema 2, which the gate supports". The Publication section (Line 189) says "World emits schema2, which the gate supports". After this PR,PublishGateServiceImplrejects schema 2. The tracker therefore gives two contradictory accounts of the current state.Replace both statements with the schema-3 wording. The tracker contract says: "Keep its status, implementation record, validation, gaps, decisions, and service-map sections aligned when a domain boundary changes." The path instructions also require reviewers to flag "obsolete transitional guidance".
- Accepted Update two stale Game Design tracker claims from supported World2 to requiredWorld3, matching actualgate/client/proof; preserve partial publication and genuine-producer limitations.
- Hosted Review 3 CompletedRuntime 6m 48sFound: 0 Accepted: 0/0/0 Routed: 0
- No findings recorded for this run
Routed Findings
No routes recorded
Unlinked items
no items unlinked