FireMUD Delivery Status

PR data refreshed

PR #3203 review history

Add guarded World topology and immutable graph owner storage

Unit 1A · identity, Account and public JOIN

Review rounds

Three-number pills mean: found (raw) / accepted here (useful) / routed

Hosted CodeRabbit3 completed
4/4/01/1/00/0/0
CLI CodeRabbit6 completed
4/4/04/4/01/1/00/0/01/0/0

Recorded review history

Reviews and findings

  1. CLI Review 1 CompletedRuntime 2m 41s
    Found: 1 Accepted: 0/0/0 Routed: 0
    1. Mapping rows are paired with plan nodes by index, but the two lists use different orders.Minor

      plan.graph().nodes() keeps the order of binding.revisions(). The SQL query sorts mappings by revision_order::numeric. The loop at Lines 346-371 pairs mappings.get(i) with nodes.get(i) and then requires equal revision_id. WorldCanonicalAuthoredGraphReader.read depends on the same index pairing. Suppose DraftCommitBinding orders revisions in another way, for example lexicographic "10" < "9", or caller order. Then every commit with that order fails store after 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 numeric revisionOrder. If it is not, look up each mapping by revision_id instead 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.
  2. CLI Review 2 CompletedRuntime 2m 12s
    Found: 4 Accepted: 1/3/0 Routed: 0
    1. Use one serializer for ownerbindingjson in both writers.Minor

      Use one serializer for `owner_binding_json` in both writers.

      WorldDraftTopologyCommitRepository.store (line 78) writes owner_binding_json with the injected mapper. This repository writes ownerJson with its own static JSON mapper. Line 205 then requires an exact match with JSON.writeValueAsString(ownerBinding). The V1006 trigger world_check_canonical_frozen_capture compares NEW.owner_binding_json IS DISTINCT FROM commit_row.owner_binding_json as 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, and find rejects every retained row.

      The tests construct both components with a default ObjectMapper, so they do not exercise this case. WorldDraftDesignDigestServiceImpl already avoids the application-wide mapper for the same reason.

      Check one fact. When WorldDraftTopologyCommitRepository is wired in production, does its ObjectMapper produce byte-identical output to the strict default JsonMapper for OwnerBinding? 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.
    2. Update the spawn-binding digest field list to match schema 3.Minor

      Lines 199-200 state that schema 3 uses a tagged entityReference for spawn bindings. Line 183 still lists entityTemplateId as a current world_entity_spawn_binding digest field. WorldDraftDesignDigestServiceImpl no longer emits entityTemplateId. It emits entityReference with kind set to RETAINED_PRIVATE_KEY or CANONICAL_UUID. The manifest in this document now contradicts itself. Replace entityTemplateId on line 183 with entityReference and 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.
    3. 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 2 is not accepted by the current Game Design publish gate". It should now name schema 3.
      • 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.1 Capability Status row (line 51) names migrations V23.1–V27.2 only. It does not name the V1003–V1007.1 migrations or the new tenant production anchors, such as WorldDraftTopologyCommitRepository and WorldAuthoredGraphSnapshotCapture. Its proof anchors also omit WorldGuardedAuthoredGraphCapturePostgresIntegrationTest and WorldGuardedAuthoredTopologyPlanTest.

      As per coding guidelines: "Keep its status, implementation record, validation, gaps, decisions, and service-map sections aligned when a domain boundary changes" and "implemented and partial rows 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.
    4. Graph capture rejects every canonical UUID spawn binding.Major

      V1005 makes entity_template_id nullable. V1005 also requires entity_template_id IS NULL for canonical references, and world_store_guarded_uuid_topology always writes it as NULL. Line 233 calls required(row, ENTITY_TEMPLATE_ID). That call throws SnapshotConflictException("... null required field entity_template_id") for every canonical spawn row. As a result, WorldAuthoredGraphSnapshotCapture.capture cannot 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.decodeSpawnBinding has the same problem: it requires a positive entityTemplateId and 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, versionId and templateId for canonical rows. Reject mixed and partial forms, as WorldDraftDesignDigestServiceImpl.entityReference does. Then bump SNAPSHOT_SCHEMA_VERSION so 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.
  3. CLI Review 3 CompletedRuntime 2m 15s
    Found: 4 Accepted: 2/2/0 Routed: 0
    1. 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.
    2. 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 example INDENT_OUTPUT (which the integration test already injects), every retained record fails exact replay or readback with a conflict. ownerBindingJson and WorldDraftDesignDigestServiceImpl already 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 fixed JsonMapper for readAndVerifyGraph graph bytes and encodeResult bytes. Keep the injected mapper only for parsing.
      • services/world-management-service/src/main/java/net/firedevops/firemud/worldmanagement/tenant/WorldAuthoredGraphSnapshotCapture.java#L77-L77: use a static fixed JsonMapper for graph.encode, encodeTuples, captureOwnerRevisionEvidence, and captureRequestDigest. 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.
    3. The schema-3 bump breaks full-version publish against the current Game Design gate.Major

      The registered GetDraftDesignDigest now returns digestSchemaVersion = 3. The tracker states that the current Game Design publish gate supports only World digest schema 2. 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.
    4. List the guarded-stage migrations in the Implementation Status migration inventory.Minor

      Line 5 still says the forward-only migrations are "V23.1 and V24–V27.2". This PR adds V1003–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.
  4. Hosted Review 1 CompletedRuntime 6m 44s
    Found: 4 Accepted: 1/1/2 Routed: 0
    1. 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_JSON already 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: In encodeResult, encode result_bytes with a static JsonMapper.builder().build() instead of mapper.
      • services/world-management-service/src/main/java/net/firedevops/firemud/worldmanagement/tenant/WorldDraftTopologyCommitRepository.java#L469-L474: In readAndVerifyGraph, encode graph_bytes with the same static mapper.
      • services/world-management-service/src/main/java/net/firedevops/firemud/worldmanagement/tenant/WorldAuthoredGraphSnapshotCapture.java#L252-L266: Encode writeJson and writeJsonBytes with a static fixed mapper, because requireSameRequest compares the tuples JSON and captureRequestDigest.

      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-L474
      • services/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.
    2. Add direct PostgreSQL tests for the V1006/V1007 frozen-capture insert triggers.Trivial

      The test confirms that the WorldCanonicalFrozenTopology.Request constructor rejects the current version:N checkpoint. That check runs before any database access. As a result, no test reaches world_check_canonical_frozen_capture() or world_require_new_digest_schema3_capture() on world_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 as versionStateEpoch and digestSchemaVersion.
      • A mismatch between the freeze_request_json serialization and the ->> text comparisons would also not appear in tests.

      The repository capture path cannot produce a positive row yet. You can still test the database guards with direct inserts into world_canonical_frozen_topology:

      1. Insert a row that uses the stored world_topology_draft_commit values and a freeze_request_json with digestSchemaVersion set to 2. Expect the V1007 trigger to reject it with error code 23514.
      2. Insert a row with schema 3 against the current non-FROZEN or mismatched applied_commit_id attempt. Expect the V1006 trigger to reject it with error code 23514.
      3. Attempt UPDATE, DELETE, and TRUNCATE on 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.
    3. 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.
    4. Remove the unused objectMapper constructor parameter, or document that it is ignored.Trivial

      The constructor checks the injected objectMapper for 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.
  5. CLI Review 4 CompletedRuntime 2m 40s
    Found: 1 Accepted: 0/1/0 Routed: 0
    1. 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.
  6. CLI Review 5 CompletedRuntime 1m 41s
    Found: 0 Accepted: 0/0/0 Routed: 0
    1. No findings recorded for this run
  7. CLI Review 6 CompletedRuntime 2m 32s
    Found: 1 Accepted: 0/0/0 Routed: 0
    1. Verify that plan node order equals numeric revisionorder order.Major

      Verify that plan node order equals numeric `revision_order` order.

      readAndVerifyGraph fetches mappings with ORDER BY m.revision_order::numeric. It then compares mapping i with plan.graph().nodes().get(i). Plan nodes keep the iteration order of binding.revisions(). world_store_guarded_uuid_topology checks that p_execution_revisions matches the binding revisions by ordinal, so plan order is the binding order. The SQL function then sorts nodes by (value->>'revisionOrder')::NUMERIC.

      Assume DraftCommitBinding keeps the supplied order or sorts revisionOrder lexicographically. Then a binding with values such as "2" and "10" aligns the wrong node with each mapping. requireField(m, "template_id", ...) then throws ConflictException. Every fresh store and every readCommitted/find replay for that commit fails. WorldCanonicalAuthoredGraphReader.read uses the same index pairing (rows.get(i) against plan.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/fromStored reject or reorder revisions so that revisions() is always in ascending numeric revisionOrder? If it does not, sort the nodes numerically in WorldDraftTopologyCommitPlan.create. Alternatively, pair mappings and nodes by revision_id instead 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.
  8. Hosted Review 2 CompletedRuntime 5m 34s
    Found: 1 Accepted: 0/1/0 Routed: 0
    1. 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.5 Capability Status row (Line 114) says "World emits digest schema 2, which the gate supports". The Publication section (Line 189) says "World emits schema 2, which the gate supports". After this PR, PublishGateServiceImpl rejects 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.
  9. Hosted Review 3 CompletedRuntime 6m 48s
    Found: 0 Accepted: 0/0/0 Routed: 0
    1. No findings recorded for this run

Routed Findings

0 Open0 Accepted/Fixed0 Rejected

No routes recorded

Unlinked items

no items unlinked