FireMUD Delivery Status

PR data refreshed

PR #3248 review history

Review rounds

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

Hosted CodeRabbit4 completed
3/3/02/1/11/1/01/1/0
CLI CodeRabbit6 completed
1/1/02/2/01/1/01/0/01/0/0

Recorded review history

Reviews and findings

  1. Hosted Review 1 CompletedRuntime 11m 14s
    Found: 3 Accepted: 1/1/1 Routed: 0
    1. Use the required observation entry format.Minor

      These four entries omit the labeled Context, Observation, and Expected pattern fields. Add a short title and those fields to each entry. As per coding guidelines, the entry format requires “YYYY-MM-DD: short title” followed by “Context,” “Observation,” and “Expected pattern.”

      Also applies to: 120-120, 122-122, 130-130

      • Accepted Required observation structure was missing in four owned entries; preserve facts while formatting.
    2. Allow retained v2 captures without branding enrollment.Major

      isHistoricalOperation recognizes only game-design-publication-operation/v1. A retained v2 operation without branding genesis therefore reaches the non-historical check, and line 393 rejects its otherwise complete capture when brand.isEmpty().

      PublishedReleaseBundleRepository calls readCapture for published operations, so this can block reads for retained published versions. Gate the branding requirement on enrollment:

      --- "a/services/game-design-service/src/main/java/net/firedevops/firemud/gamedesign/publication/GameDesignSourceRepository.java"
      +++ "b/services/game-design-service/src/main/java/net/firedevops/firemud/gamedesign/publication/GameDesignSourceRepository.java"
      @@ -390,7 +390,7 @@
               || policy.isEmpty()
               || (asset.isEmpty() && !historicalOperation)
               || (gameplayCapture.isEmpty() && !historicalOperation && !historicalGameplay)
      -        || (brand.isEmpty() && (!historicalOperation || brandingSourceEnrolled))
      +        || (brand.isEmpty() && brandingSourceEnrolled)
               || (templateSourceEnrolled && templateConfig.isEmpty() && !historicalTemplate)) {
             throw new IllegalStateException("GAME_DESIGN_SOURCE_CAPTURE_INCOMPLETE");
           }
      
      • Accepted Retained pre-branding v2 captures must remain readable; require branding only when enrolled, preserving fresh freeze requirements.
    3. Use the lifecycle helpers that AbstractReloadingBlockingGrpcClient already provides.Trivial

      The superclass already provides initOnce(closedMessage, unavailableMessage), requireInitializedStub(unavailableMessage), and requireNoAmbientSql(message). Its close() already sets closed and explicitlyInitialized. This class copies that state in its own volatile initialized/closed fields and overrides close() only to keep those copies in sync. GrpcSelectedOwnerIntakeSourceReadClient (lines 29-30, 47-54, 60-62, 101-118) contains the same copy. The two copies and the base class can drift apart in future edits. Delegate to the base helpers in both clients.

      ♻️ Proposed refactor

      -  private volatile boolean initialized;
      -  private volatile boolean closed;
       ...
      -  public synchronized void init() throws SSLException, IOException {
      -    if (closed) throw new IllegalStateException("Game Design source client is closed");
      -    if (initialized) return;
      -    initReloadingClient();
      -    if (stub() == null) throw new IllegalStateException("Game Design source stub unavailable");
      -    initialized = true;
      -  }
      +  public void init() throws SSLException, IOException {
      +    initOnce("Game Design source client is closed", "Game Design source stub unavailable");
      +  }
       ...
      -    if (TransactionSynchronizationManager.isActualTransactionActive()
      -        || TransactionSynchronizationManager.isSynchronizationActive())
      -      throw new IllegalStateException(
      -          "Game Design selected-owner source read must run outside SQL");
      +    requireNoAmbientSql("Game Design selected-owner source read must run outside SQL");
       ...
      -    var response =
      -        requireStub()
      +    var response =
      +        requireInitializedStub(
      +                "Game Design selected-owner source client is not initialized and available")
                   .withDeadlineAfter(CALL_DEADLINE_SECONDS, TimeUnit.SECONDS)
       ...
      -  @Override
      -  public void close() throws IOException { ... }
      -  private ... requireStub() { ... }
      

      Also applies to: 48-54, 60-63, 102-119

      • Accepted Both clients duplicate lifecycle state already owned by the shared base; delegate without changing messages or transport checks.
  2. Hosted Review 2 CompletedRuntime 10m 46s
    Found: 2 Accepted: 0/0/1 Routed: 1
    1. Make the Entity result distinguishable and assert both owner results.Trivial

      The vector gives World and Entity the same result bytes. The test checks only the World result identity and bytes, so it cannot detect an Entity result-byte substitution. Give Entity distinct bytes, then assert its result identity and bytes alongside the World assertions. Based on learnings, identity-sensitive tests should assert the fields that determine the resulting identity or authorization outcome, not only adjacent metadata.

      • Accepted Verified World/Entity use identical result bytes and only World assertions. Give Entity distinct bytes and verify both identities, bytes and defensive copies.
    2. Give every reservation a terminal state other than an explicit abort.Major

      account_selected_owner_intake_source_read_is_pending treats a reservation as pending until a row exists in account_selected_owner_intake_source_read_aborts. The reservation has no completion, finalization, or expiry path.

      V1007 uses this predicate in the source-writer, source-change completion, and hosted-terms dispatch guards. The Java authorization paths also depend on it. A successful read therefore continues to block the affected Account source vector until Game Design calls abortSourceRead.

      If Game Design crashes, loses its state, or does not send the abort, source changes remain blocked without a bound. Issuer credential expiry does not release the reservation because readSourceScope rejects expired reads, while account_selected_owner_intake_source_read_is_pending does not check expiry.

      Before registering these endpoints, add an Account-owned completion or expiry terminal and a recovery path. Preserve the reservation until the Account-owned recovery logic has sufficient evidence to release it.

      Route · PR #3248 → PR #3251 Accepted/FixedRoute to3251 owning finalization/terminal settlement (V1008–1010), which already replaces pending predicate. Add safe Account-owned abandoned-preliminary recovery before registration; expiry alone cannot settle finalized owners. 3248 remains passive/default-denied with explicit gap. View routed finding
  3. CLI Review 1 CompletedRuntime 4m 12s
    Found: 4 Accepted: 1/1/2 Routed: 0
    1. A reservation that is never aborted blocks the creator's Account source writers with no time limit.Major

      account_selected_owner_intake_source_read_is_pending returns true for every reservation that has no abort row. The function has no expiry term and no finalization term. The V1007 hooks in this file and DraftAuthorizationFenceRepository.allAffectedSettled use this function. As a result, a reservation that is never aborted keeps these operations pending:

      • source-change completion and abort,
      • account_control_ui_hold_required_sources,
      • hosted-terms dispatch,
      • disclosure preparation.

      These rows lock the current creator's complete source vector (ACCOUNT, GLOBAL_ROLES, MEMBERSHIP, HOSTED_TERMS, and others). Password reset, logout-all, role changes, and terms changes on those sources stay WAITING, and callers get retryable AUTH_UNAVAILABLE.

      readSourceScope refuses reads after the original creator credential expires. After that point the reservation cannot be used, but it still blocks writers. Only an explicit Game Design abortSourceRead releases it. Game Design can fail to abort in several ways: a crash after reserve, a lost scope, or a missed abort path. In each case, Account cannot release the block on its own. The PostgreSQL test confirms the block: sourceMutationPermitted stays false until abort.

      Confirm whether the planned finalization or settlement owner also has an Account-local release path. One option is a terminal state that a database-clock check derives from the creator issuance expires_at_epoch_second plus a bounded grace period. Add that path before any registration. If the unlimited hold is intended, record the gap and its reconsideration trigger in the tracker.

      • Accepted Verified V1007 holds until explicit abort despite issuance expiry. Accept tracker gap/registration blocker and recovery-owner requirement; do not invent timeout release or weaken source fences. Passive unregistered scope remains incomplete until safe owner recovery is implemented.
    2. Name the owning Capability Status row for the selected-recipient intake section.Minor

      The other preparation sections state their owning capability row and its state, for example "This preparation is owned by AA-1.3 … partial / drift-found". This new section adds V1007, new Account owners, and new Game Design production anchors. It does not say which Capability Status row owns them, and it does not say whether that row's production anchors or proof cells changed. The tracker contract requires one status row for each owned capability. It also requires production and proof anchors that resolve.

      Add one sentence that names the owning row and its current state. In the same edit, update that row's anchors to include V1007__selected_owner_intake_source_reservations.sql, AccountSelectedOwnerIntakeSourceReservationService, and the R28 focused proof classes.

      As per coding guidelines: "Each tracker contains one Capability Status row for every capability it primarily owns … implemented and partial rows name concrete production anchors."

      • Accepted Verified selected intake section omits AA-1.3 state and its capability row lacks V1007/service/focused proof anchors. Accept exact owning-row and resolvable-anchor correction.
    3. The malformed-reservation case never reaches the V1007 completeness trigger.Trivial

      The insert uses owner = 'UNDECLARED_OWNER' and random UUIDs for actor_account_uuid, tenant_uuid, and issuance_operation_id. PostgreSQL rejects this row at statement time, either with the owner CHECK constraint or with an immediate foreign-key violation. The deferred account_selected_owner_intake_source_read_complete constraint trigger never runs. The assertion accepts any RuntimeException. This case therefore proves only column constraints, not the creator-evidence, scope-framing, or source-vector guards that the tracker credits to R28.

      Add a case that inserts a row that passes the column checks and foreign keys but has a wrong scope_digest or a mismatched source_payload. Commit that transaction. Assert SQLSTATE 23514 and the trigger message, and assert that no source rows remain.

      • Accepted Verified malformed owner and absent FK identities fail immediate constraints. Accept a valid-fixture deferred-completeness regression with wrong scope digest, commit-time23514/message and unchanged/no reservation children.
    4. Make the race tests wait for the blocked write before they commit the first writer.Trivial

      Each test calls started.countDown() before the worker issues its write. The main thread then calls lifecycle.commit(), slot.commit(), or selection.commit() at once. The second write can therefore start after the first transaction commits.

      At TRANSACTION_READ_COMMITTED, that order is sequential, not concurrent. The second write sees committed state and fails with 23514, even if the storage guard takes no lock. At REPEATABLE_READ and SERIALIZABLE, the earlier SELECT creates the stale snapshot, so 40001 can also occur without a blocked write. The tests prove the final outcomes. They do not prove the path where one write blocks and then resolves after the other write commits.

      RealmPolicySourcePostgresIntegrationTest.freezeAndSourceWriterUseSameVersionLockAndRollbackDoesNotLeaveCapture already shows the stronger pattern. It polls pg_stat_activity and pg_blocking_pids until the second backend waits on a lock. Use the same pattern here before each commit.

      ♻️ Sketch for one race (apply to all four)

      +        int firstPid = DSL.using(lifecycle, SQLDialect.POSTGRES)
      +            .fetchSingle("SELECT pg_backend_pid()").get(0, Integer.class);
      +        int secondPid = slotSql.fetchSingle("SELECT pg_backend_pid()").get(0, Integer.class);
               var started = new java.util.concurrent.CountDownLatch(1);
               var inserting = worker.submit(...);
               try {
                 assertThat(started.await(10, TimeUnit.SECONDS)).isTrue();
      +          awaitBlocked(local, firstPid, secondPid); // poll pg_blocking_pids(secondPid) with a deadline
               } finally {
                 lifecycle.commit();
               }
      

      Also applies to: 1842-1857, 1885-1896, 1927-1938

      • Accepted Verified all four tests release the first transaction after a pre-write latch only. Accept bounded test correction: observe exact worker backend blocked by first backend before commit, retaining isolation/outcome assertions.
  4. CLI Review 2 CompletedRuntime 3m 32s
    Found: 1 Accepted: 0/1/0 Routed: 0
    1. Restore the removed prior observation. Append new entries at the end.Minor

      This change deletes the earlier 2026-10-15 entry "Preserve receiver status when relocating inherited tracker proof" because it duplicates another entry. The repository rule does not allow this kind of deletion during ordinary autonomous work. Removal is allowed only under explicitly assigned Overseer stewardship or a human-requested repository health check, and nothing in this change shows either one.

      The new 2026-10-15 and 2026-10-16 entries are also inserted in the middle of the file (Line 118 onward), not appended at the end.

      Required fixes:

      • Restore the deleted entry.
      • If it is a true duplicate, add a dated note that links the two entries and leave both in place.
      • Move the new entries to the end of the file.

      As per coding guidelines: "During ordinary autonomous work, append dated entries; do not silently rewrite or delete prior observations."

      • Accepted Accept append-only correction: five added observation blocks were inserted mid-file. Existing Preserve receiver status entry remains byte-identical in current diff, so no duplicate restoration. Move only added blocks to EOF; preserve every existing entry.
  5. Hosted Review 3 CompletedRuntime 14m 26s
    Found: 1 Accepted: 1/0/0 Routed: 0
    1. Add a recovery path for retained Draft Versions without branding genesis.Major

      GameDesignSourceRepository.readGenesis rejects a retained Draft Version when policy and command genesis exist but branding genesis is absent. apply, captureSynchronized, and freeze call requireGenesis, so authoring and publication fail for these Draft Versions. enrollFreshDraft cannot repair them because it requires a same-transaction fresh-insert witness.

      Add either:

      • a migration that creates branding genesis and head rows for each existing enrolled Draft Version; or
      • an explicit legacy rule that treats missing branding genesis like missing asset genesis.

      Preserve the existing compatibility behavior for historical readSynchronized and partial historical captures, which allow unenrolled branding to remain absent. If this publication boundary is intentional, record it in the implementation tracker.

      • Accepted Accept explicit tracker boundary alternative. Canonical six-family/no-backfill contract and existing native history/refusal tests intentionally deny fresh work without branding. Document retained apply/capture/freeze restriction; do not invent genesis or relax production.
  6. CLI Review 3 CompletedRuntime 3m 32s
    Found: 2 Accepted: 0/2/0 Routed: 0
    1. Identify the owning migration for the "existing V1007 storage" reference.Minor

      Line 9 says that the branding source owner "uses existing V1007 storage". In this PR, the V1007 migration is Account's V1007__selected_owner_intake_source_reservations.sql. That migration creates no branding tables. The tracker (player-access-and-session.md line 15) also calls it "Account V1007". A reader of this Game Design document cannot tell whether the reference means a Game Design V1007 migration or the Account migration.

      Confirm which Game Design migration holds the game_design_branding_source_* tables. Then link that file and name the owning service. As per path instructions: "Flag obsolete transitional guidance, conflicts between architecture docs, broken repo links".

      📝 Proposed clarification

      -The recipient-intake preparation adds an unregistered Account-authenticated read of all six selected source families. Its required branding source owner uses existing V1007 storage, and command snapshot parsing ...
      +The recipient-intake preparation adds an unregistered Account-authenticated read of all six selected source families. Its required branding source owner uses the existing Game Design branding storage in [V<n>](../../../../services/game-design-service/src/main/resources/db/migration/V<n>__<name>.sql), and command snapshot parsing ...
      
      • Accepted Accepted: ambiguous V1007 ownership. Published40d explicitly links Game Design V1007__branding_asset_source_history.sql; it is not Account reservation storage. Exact three-doc correction and successful11s canonical docs proof verified.
    2. Update the source-protection text that still calls selected-owner reservation an outside obligation.Minor

      This section says that Account V1007 now adds selected-owner preliminary reservations and source-writer exclusions. Two unchanged sentences still describe that work as outside the current scope:

      • Line 69 of this tracker: "The source-only V130 selected-owner reservation hook is outside this cut and remains a separate receiving obligation."
      • Line 357 of account-service/runtime-and-data.md: "...and the separate selected-owner source-reservation obligation remain unproved."

      These sentences now conflict with lines 9–17 and with the AA-1.3 row, which lists V1007 as a production anchor. Revise both sentences. State that V1007 receives the reservation and hook storage, and that finalization and terminal settlement (#3251) remain open. As per coding guidelines: "Keep its status, implementation record, validation, gaps, decisions, and service-map sections aligned when a domain boundary changes". As per path instructions: "Flag obsolete transitional guidance".

      • Accepted Accepted: stale reservation hook/source-protection status. Published40d tracker and Account runtime/data name received V1007 preliminary reservation storage; finalization/settlement/registration remain unproved at this boundary. Canonical docs proof verified.
  7. CLI Review 4 CompletedRuntime 2m 52s
    Found: 1 Accepted: 0/0/1 Routed: 0
    1. Make the deferred-guard assertion prove the digest check.Trivial

      The first IF block in account_selected_owner_intake_source_read_complete_guard raises the same message for ten different conditions. These include issuer status, issuer expiry, source payload, bundle, fence, checkpoints and the scope digest. This test asserts only that shared message, so any other mismatch in the fixture also passes the test.

      The fixture also uses "sources":[]. The later vector check requires at least one source, so the guard would reject this reservation even with the correct scope_digest. The test therefore does not show that the digest is the only cause of the rejection.

      Use one of these fixes:

      • Add a positive control. Insert the same row with scope.digest() and one valid source row, and show that it commits.
      • Give the digest check its own error message in the migration, and assert that message.
      • Accepted Useful proof gap: shared ten-predicate error plus sources[] cannot isolate digest. Add same valid populated reservation/source fixture positive control with correct digest committing, retain wrong-digest rollback/SQL assertions; production guards unchanged.
  8. CLI Review 5 CompletedRuntime 2m 49s
    Found: 1 Accepted: 0/0/0 Routed: 0
    1. Return a retained Genesis without branding instead of throwing from readGenesis.Minor

      readGenesis now throws GAME_DESIGN_SOURCE_GENESIS_INCOMPLETE when branding genesis is absent. This applies to every retained five-family Version that predates branding. Before this change, the same call returned a Genesis.

      This creates two inconsistencies:

      • Genesis still declares brandingEvidence as Optional. The compatibility constructors still supply Optional.empty().
      • requireGenesis already refuses fresh apply, captureSynchronized and freeze when brandingEvidence is empty. The throw in readGenesis is therefore redundant for those paths.

      The new throw affects every other caller of GameDesignSourceRepository.readGenesis. A read that only inspects retained genesis now fails for historical Versions, and the error code differs from the existing GAME_DESIGN_SOURCE_GENESIS_UNAVAILABLE.

      Check whether any caller other than enrollFreshDraft and requireGenesis exists. If such a caller exists, treat branding the same way as the optional asset evidence. Keep the refusal in requireGenesis.

      ♻️ Proposed change

      -    if (policy.isEmpty() || command.isEmpty() || brand.isEmpty()) {
      +    if (policy.isEmpty() || command.isEmpty()) {
             throw new IllegalStateException("GAME_DESIGN_SOURCE_GENESIS_INCOMPLETE");
           }
      
      • Rejected Intentional fresh-genesis completeness guard: aggregate callers enroll/prepare fresh review/advance visibility, not historical inspection. Historical readSynchronized preserves five-family rows; qualified retained-branding test explicitly expects readGenesis refusal. No regression or useful fix.
  9. CLI Review 6 CompletedRuntime 2m 38s
    Found: 1 Accepted: 0/0/0 Routed: 0
    1. Confirm that referenced gameassets rows cannot change after a branding revision binds them.Major

      Confirm that referenced `game_assets` rows cannot change after a branding revision binds them.

      verifyItems runs on every readSnapshot and every retained application readback. It calls qualify(item.reference(), false) and requires an exact match with the current game_assets row. The match covers file_name, content_type and the SHA-256 digest and size of data.

      The snapshot stores the content digest, content type and byte size. The revision row stores the same three values. If ordinary authoring can update data, content_type or file_name for a referenced asset row after apply, three failures follow:

      • readSnapshot for every retained snapshot that contains that item throws BRANDING_SOURCE_BYTE_READBACK_CONFLICT.
      • apply and captureSynchronized for later commits fail, because they read the inherited snapshot through readSnapshot.
      • freeze and the selected-owner source export also fail.

      Only a new owner-evidenced path could then recover the branding source for that Version.

      Check one of these facts:

      • Game Design V1007, or an earlier migration, prevents updates to these columns while a game_design_branding_source_revision row references the asset row.
      • Branding asset rows are append-only.

      If neither guard exists, choose one fix:

      • Add an immutability guard on referenced rows.
      • Verify historical snapshots against the retained revision columns only, and check current asset bytes only at apply and freeze.
      • Rejected Already guarded: V1007 protect_branding_asset_bytes rejects any changed/deleted referenced asset row; V1003 denies TRUNCATE. Existing branding PG proof rejects byte updates; V1030 and two-connection PG cases fence stale first-reference writers. Historical verification stays fail closed.
  10. Hosted Review 4 CompletedRuntime 12m 31s
    Found: 1 Accepted: 0/1/0 Routed: 0
    1. Wait for mapped JDBC readiness on both PostgreSQL containers before the test runs.Minor

      This PR adds PostgresBackedServiceTestSupport.awaitPostgresJdbcReady because the owner gate showed PostgreSQL connection refusals on the first connection. This new cross-service test opens GDS and ACCOUNT connections immediately in sourceStore() and in AccountControlUiOriginalOrderFixture. It does not call the readiness helper. A transient mapped-port refusal therefore fails this test before any assertion runs. Other changed fixtures in this PR already use the helper, for example TemplateConfigSourcePostgresIntegrationTest. Add a @BeforeAll method that calls the helper for both containers.

      Proposed fix

      --- "a/services/game-design-service/src/test/java/crossservice/net/firedevops/firemud/accountservice/service/session/SelectedOwnerSourceDisclosurePostgresIntegrationTest.java"
      +++ "b/services/game-design-service/src/test/java/crossservice/net/firedevops/firemud/accountservice/service/session/SelectedOwnerSourceDisclosurePostgresIntegrationTest.java"
      @@ -117,9 +117,15 @@
                     "selected-disclosure-primary",
                     "6379");
       
         @TempDir Path temporary;
       
      +  @org.junit.jupiter.api.BeforeAll
      +  static void awaitPostgresJdbcReady() {
      +    net.firedevops.firemud.test.PostgresBackedServiceTestSupport.awaitPostgresJdbcReady(GDS);
      +    net.firedevops.firemud.test.PostgresBackedServiceTestSupport.awaitPostgresJdbcReady(ACCOUNT);
      +  }
      +
         @Test
         void actualPreliminaryPermissionDisclosesExactSixFamiliesAndAbortPermanentlyRefuses()
             throws Exception {
           var local = sourceStore();
      
      • Accepted Both cross-service PostgreSQL containers open mapped JDBC connections without the shared bounded readiness guard. Add BeforeAll waits for GDS and ACCOUNT; preserve all behavioral assertions and options.

Routed Findings

0 Open1 Accepted/Fixed0 Rejected
  1. Route 1 · PR #3248 → PR #3251 Accepted/FixedMajorGive every reservation a terminal state other than an explicit abort.

    account_selected_owner_intake_source_read_is_pending treats a reservation as pending until a row exists in account_selected_owner_intake_source_read_aborts. The reservation has no completion, finalization, or expiry path.

    V1007 uses this predicate in the source-writer, source-change completion, and hosted-terms dispatch guards. The Java authorization paths also depend on it. A successful read therefore continues to block the affected Account source vector until Game Design calls abortSourceRead.

    If Game Design crashes, loses its state, or does not send the abort, source changes remain blocked without a bound. Issuer credential expiry does not release the reservation because readSourceScope rejects expired reads, while account_selected_owner_intake_source_read_is_pending does not check expiry.

    Before registering these endpoints, add an Account-owned completion or expiry terminal and a recovery path. Preserve the reservation until the Account-owned recovery logic has sufficient evidence to release it.

    Outcome: Published ae830dbf96cdce32394c3d3fa42d828c2fd80888: bounded original-scope expiry recovery; finalized owners excluded.8units cda9+actual expiry/late-lock PG case7ff2+checks PASS; own code unchanged. Fresh five-store case ae830 PASS,5DockerIDsabsent; docs79914de. Internal/unregistered; no activation.

    Earlier routing and proof

    Earlier decisions

    • Accepted Own selected-recipient finalization/terminal lifecycle here in V1008–1010. Implement and prove Account-owned abandoned-preliminary recovery without releasing finalized reservations from credential expiry or missing owner terminal evidence.
    • Routed Route to3251 owning finalization/terminal settlement (V1008–1010), which already replaces pending predicate. Add safe Account-owned abandoned-preliminary recovery before registration; expiry alone cannot settle finalized owners. 3248 remains passive/default-denied with explicit gap.

Unlinked items

no items unlinked