FireMUD Delivery Status

PR data refreshed

PR #3189 review history

Entity and Account: prepare passive actor and StartSession storage

Unit 1A · identity, Account and public JOIN

Review rounds

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

Hosted CodeRabbit9 completed
3/3/01/1/02/2/01/1/01/1/0
CLI CodeRabbit16 completed
3/3/03/3/02/2/01/1/01/1/0

Recorded review history

Reviews and findings

  1. CLI Review 1 CompletedRuntime 2m 58s
    Found: 2 Accepted: 0/0/2 Routed: 0
    1. Use TestContainerImages instead of hardcoded image tags.Trivial

      This class pins postgres:16-alpine and redis:7.2-alpine directly. ContainerInstanceLocationIntegrationTest uses TestContainerImages.postgres() and TestContainerImages.redis(). If the shared helper holds the repository's image pin or a registry mirror, this new suite can drift from that pin or fail in CI environments that cannot pull from Docker Hub. The Flyway V1→latest proof would then run against a PostgreSQL version that differs from the other suites.

      ♻️ Proposed fix

         @Container
      -  static PostgreSQLContainer<?> postgres = new PostgreSQLContainer<>("postgres:16-alpine");
      +  static PostgreSQLContainer<?> postgres =
      +      new PostgreSQLContainer<>(TestContainerImages.postgres());
       
         @Container
         static GenericContainer<?> redis =
      -      new GenericContainer<>("redis:7.2-alpine").withExposedPorts(6379);
      +      new GenericContainer<>(TestContainerImages.redis()).withExposedPorts(6379);
      

      Add import net.firedevops.firemud.test.TestContainerImages;.

      • Accepted Verified hardcoded PostgreSQL/Redis tags in retained-identity fixture bypass canonical TestContainerImages used by adjacent physical suites; use shared pins without changing fixture behavior.
    2. Use one shared owner-resolved guard and the ActorIdentityStatus enum instead of copied string literals.Trivial

      ownerResolvedActorExists() and requireOwnerResolvedActor() are identical to the helpers in ActorResourceStateRepository. The same "OWNER_RESOLVED" literal also appears in CharacterRepository, CharacterEquipmentRepository, and CharacterFriendRepository. ActorIdentityRepository already uses ActorIdentityStatus.OWNER_RESOLVED.name().

      These copies are the fail-closed boundary for every legacy consumer. If one copy changes and the others do not, the gate can become inconsistent. Move the helpers into one place, such as JooqEntityManagementRepositorySupport, and pass in the correlated CHARACTER_ID/TENANT_ID fields. Use the enum constant for the status value.

      ♻️ Sketch of a shared helper

      static Condition ownerResolvedCharacterExists(
          DSLContext dsl, Field<Long> characterId, Field<Long> tenantId) {
        return DSL.exists(
            dsl.selectOne()
                .from(CHARACTERS)
                .where(CHARACTERS.ID.eq(characterId)
                    .and(CHARACTERS.TENANT_ID.eq(tenantId))
                    .and(CHARACTERS.ACTOR_IDENTITY_STATUS.eq(
                        ActorIdentityStatus.OWNER_RESOLVED.name()))));
      }
      
      • Accepted Verified duplicated tenant/character-correlated owner-resolved guards and copied status literals. Consolidate existing repository support and use ActorIdentityStatus enum, preserving every fail-closed gate.
  2. Hosted Review 1 CompletedRuntime 9m 36s
    Found: 4 Accepted: 0/3/1 Routed: 0
    1. CodeRabbit summary-only outside-diff finding 1 of 1 (aggregate; no individual detail)Minor

      summary-only aggregate; provider supplied no individual detail

      • Accepted Full Hosted summary identifies operations.md expiry note: elapsed quarantined conditions are retained; existing statement omits OWNER_RESOLVED guard. Verified against deleteExpired and runtime-and-data owner note.
    2. Correct the claim that all Stage 1 PostgreSQL integration cases use mocked guards.Minor

      Line 20 states: "The Stage 1 PostgreSQL integration cases use test-only mocked guards". Only ContainerInstanceLocationIntegrationTest replaces ScopedCharacterResolver with a @MockitoBean. RetainedActorIdentityIntegrationTest autowires the real ScopedCharacterResolver and InventoryService, and it asserts the real denial (Lines 485-506). The GR-3.2 row in the tracker already describes this split correctly. This sentence conflicts with the tracker and understates the real-resolver proof.

      📝 Proposed wording

      -The Stage 1 PostgreSQL integration cases use test-only mocked guards and prove only the bounded persistence and denial scenarios recorded under [GR-3.1](...);
      +`ContainerInstanceLocationIntegrationTest` uses a test-only mocked scope guard for holder persistence, while `RetainedActorIdentityIntegrationTest` exercises the real fail-closed resolver; both prove only the bounded persistence and denial scenarios recorded under [GR-3.1](...);
      

      As per path instructions, "Review docs for canonical-current-state consistency".

      • Accepted Verified holder suite uses mocked resolver while retained-identity suite uses real fail-closed resolver. Correct service proof summary without widening proven boundary.
    3. Use ActorIdentityStatus instead of repeated raw status literals in the security predicates.Trivial

      "OWNER_RESOLVED" and "QUARANTINED" are hand-typed string literals in this file. The same literals appear in ActorActiveConditionRepository, ActorResourceStateRepository, CharacterFriendRepository, and CharacterEquipmentRepository. ActorIdentityRepository already uses ActorIdentityStatus.OWNER_RESOLVED.name(). These predicates are the fail-closed identity gate. A typo or a future rename makes the gate return no rows, or the wrong rows, without a compile error.

      Define one shared condition, for example CHARACTERS.ACTOR_IDENTITY_STATUS.eq(ActorIdentityStatus.OWNER_RESOLVED.name()) in JooqEntityManagementRepositorySupport, and reuse it in each repository.

      ♻️ Example

      -            .where(CHARACTERS.ID.eq(id).and(CHARACTERS.ACTOR_IDENTITY_STATUS.eq("OWNER_RESOLVED")))
      +            .where(CHARACTERS.ID.eq(id).and(OWNER_RESOLVED_CHARACTER))
      
      static final Condition OWNER_RESOLVED_CHARACTER =
          CHARACTERS.ACTOR_IDENTITY_STATUS.eq(ActorIdentityStatus.OWNER_RESOLVED.name());
      

      Also applies to: 72-72, 84-84, 98-98, 110-110, 134-134, 146-146, 198-198

      • Accepted Verified copied OWNER_RESOLVED and QUARANTINED strings; accept enum symbols. Overlaps CLI1 guard correction; one coherent batch satisfies both source obligations.
    4. Return the cleanup hold as FAILED_PRECONDITION.Minor

      GrpcAppErrors.internal(...) emits application code INTERNAL for the cleanup blocker. Use a typed application code such as FAILED_PRECONDITION for ENTITY_UNCLASSIFIED_OR_QUARANTINED_EVIDENCE_BLOCKS_CLEANUP. WorldLifecycleCommandServiceImpl already propagates the application code to its caller.

      This is an application error code in the response, not a transport gRPC status. The source does not establish indefinite retry, so do not rely on that claim.

      • Accepted Verified known cleanup classification hold throws generic IllegalStateException and maps INTERNAL. Dedicated local hold exception will map FAILED_PRECONDITION; unexpected errors remain INTERNAL and World propagation unchanged.
  3. CLI Review 2 CompletedRuntime 3m 20s
    Found: 2 Accepted: 0/0/0 Routed: 0
    1. Confirm that World handles a permanent cleanup hold without an unbounded retry loop.Trivial

      After this change, any game instance with at least one item_instances, container_instances, item_stacks, or room_ground_inventory row always gets FAILED_PRECONDITION. Nothing in this PR can clear that state. A nonempty instance therefore cannot reach TERMINATED until owner classification is implemented. Assume the World world-lifecycle Temporal activity retries application errors with its default retry policy. In that case, each terminating instance retries indefinitely and sends repeated load to Entity. Confirm two points. First, World marks ENTITY_UNCLASSIFIED_OR_QUARANTINED_EVIDENCE_BLOCKS_CLEANUP as non-retryable or held. Second, an operator alert or metric reports held terminations.

      • Rejected TemporalWorldLifecycleWorkflowImpl explicitly caps retries at5, contradicting assumed indefinite default loop; synchronous fallback exists. World persists TERMINATING before cleanup, so hold remains durable; Entity emits FAILED_PRECONDITION metric/span/warning. No new defect established.
    2. Confirm that the plain-SQL cleanup check resolves the same schema as the generated jOOQ tables.Trivial

      HAS_UNCLASSIFIED_OR_QUARANTINED_RUNTIME_EVIDENCE_SQL uses unqualified table names (item_instances, characters, item_transfer_audits, and others) through DSL.sql. The other repositories use generated jOOQ tables. Those tables can carry schema mapping. This query depends only on the connection search_path. Assume SERVICE_SCHEMA is not public and the datasource does not set search_path (or currentSchema) to that schema. In that case, the query fails or reads public tables. The failure is fail-closed (INTERNAL), so cleanup holds instead of deleting rows. But no instance with this configuration could ever pass the check.

      Confirm that the Entity datasource selects SERVICE_SCHEMA for every connection. The schema-independent alternative is to express the five EXISTS branches with the generated ITEM_INSTANCES, CONTAINER_INSTANCES, ITEM_STACKS, ROOM_GROUND_INVENTORY, ITEM_TRANSFER_AUDITS, and CHARACTERS tables (DSL.exists(...).or(...), then dsl.select(DSL.field(condition))). The architecture doc states: "generated jOOQ types are the default SQL access path". The path instructions say: "For SQL-backed services, expect jOOQ + Flyway".

      • Rejected Assumed unset schema is disproved: DatabaseAutoConfiguration JDBC URL sets currentSchema=PostgresProperties.schema, defaulting from SERVICE_SCHEMA. Non-public entity_management_service PostgreSQL cleanup fixtures pass through this datasource; no schema defect demonstrated.
  4. CLI Review 3 CompletedRuntime 2m 23s
    Found: 1 Accepted: 0/0/0 Routed: 0
    1. Add observability for permanently held runtime-instance cleanup.Trivial

      After this change, cleanup succeeds only when the target has no runtime rows. Every runtime row is unclassified evidence, and no classification path exists in this stage. So every game instance that holds items now returns FAILED_PRECONDITION on every retry. A transfer audit that links a quarantined actor also holds cleanup, and all legacy and newly created characters are quarantined. As a result, World termination for these instances cannot reach TERMINATED until a later stage adds owner classification.

      The docs describe this as intended. Operators still need a way to see it before rollout:

      • Emit a counter or gauge for held cleanups, tagged by tenant. Do not tag it with the raw instance ID.
      • Make the World-side retry policy treat ENTITY_UNCLASSIFIED_OR_QUARANTINED_EVIDENCE_BLOCKS_CLEANUP as a long-term hold, not a transient error. This prevents unbounded retry load.
      • Add an alert when terminating instances stay held past an agreed threshold.
      • Rejected Rechecked CLI2 concern: World retries capped5 and persists TERMINATING; Entity already emits FAILED_PRECONDITION metric/span/warning. No unbounded loop or agreed alert threshold exists. Dedicated tenant metric/new retry and alert policy are unsubstantiated scope expansion, not demonstrated defect.
  5. Hosted Review 2 CompletedRuntime 10m 07s
    Found: 13 Accepted: 2/9/1 Routed: 0
    1. Fix the missing spaces in the validation evidence text.Minor

      Several numbers are joined to the word before them:

      • Line 116: "job115335024215", "artifact11822625688", "in28s".
      • Line 118: "final50-second", "is1005", "The211unit".

      LanguageTool flags "final50-second". The joined tokens are hard to read. Readers can also misread the job and artifact identifiers. Insert a space before each number, for example "job 115335024215", "artifact 11822625688", "in 28s", "final 50-second", "is 1005", and "The 211 unit".

      As per path instructions: "Review docs for canonical-current-state consistency."

      • Accepted Accept: separate identifiers and counts from surrounding prose in the GR proof record.
    2. Fix the run-together words and numbers in the proof record.Minor

      Line 17 contains fresh113-artifact, actual112-artifact, local236-case, artifact11822625688 with240integration0fail/error/skip and1295unit0fail/error/four, and [ADR0047]. These read as typing errors in a reader-facing tracker. Add the missing spaces.

      Proposed text fix

      -... including the default-location fresh113-artifact manifest and unchanged actual112-artifact parent upgrade. ... The broader local236-case Account integration run ... pass the own Account source-CI artifact11822625688 with240integration0fail/error/skip and1295unit0fail/error/four existing filesystem skips. ... Canonical obligations remain in [ADR0047](...)
      +... including the default-location fresh 113-artifact manifest and unchanged actual 112-artifact parent upgrade. ... The broader local 236-case Account integration run ... pass the Account source-CI artifact 11822625688 with 240 integration cases (zero failures, errors or skips) and 1,295 unit cases (zero failures or errors, four existing filesystem skips). ... Canonical obligations remain in [ADR 0047](...)
      
      • Accepted Accept: repair run-together counts and ADR label in the AA proof record.
    3. The writable-hold guard has no effect. Use Propagation.MANDATORY.Minor

      The method is annotated @Transactional with the default REQUIRED propagation. If no outer transaction exists, Spring starts a new writable transaction before the method body runs. isActualTransactionActive() is then always true, and isCurrentTransactionReadOnly() is false. The guard therefore never rejects a call made outside the caller's hold transaction.

      In that case the FOR UPDATE locks on the operation row and the actor row are released when this method returns. The Javadoc invariant fails: actor changes no longer "either win first and invalidate the receipt or observe the durable hold". The read-only outer-transaction case is the only case the guard rejects correctly.

      🔒️ Proposed fix

      --- "a/services/entity-management-service/src/main/java/net/firedevops/firemud/entitymanagement/repository/CharacterRepository.java"
      +++ "b/services/entity-management-service/src/main/java/net/firedevops/firemud/entitymanagement/repository/CharacterRepository.java"
      @@ -705,13 +705,11 @@
          * Callers use this only inside the same writable transaction that records an applicability hold,
          * so actor changes either win first and invalidate the receipt or observe the durable hold.
          */
      -  @Transactional
      +  @Transactional(propagation = org.springframework.transaction.annotation.Propagation.MANDATORY)
         public Optional<PreseededActorAssignmentReceipt> lockCurrentPreseededActorAssignmentReceipt(
             UUID assignmentUuid, UUID canonicalAccountUuid, UUID characterUuid, String intentDigest) {
      -    if (!org.springframework.transaction.support.TransactionSynchronizationManager
      -            .isActualTransactionActive()
      -        || org.springframework.transaction.support.TransactionSynchronizationManager
      -            .isCurrentTransactionReadOnly()) {
      +    if (org.springframework.transaction.support.TransactionSynchronizationManager
      +        .isCurrentTransactionReadOnly()) {
             throw new IllegalStateException(
                 "Pre-seeded placement receipt locking requires the writable hold transaction");
           }
      
      • Accepted Accept: require existing writable transaction with MANDATORY to retain receipt locks through caller hold.
    4. The 256-character limit in requiredText rejects valid release bundle refs.Minor

      requiredText rejects any string longer than 256 characters. The parser uses it for publishedReleaseBundleRef. PreseededActorAssignmentExpectedTarget and PreseededActorAssignmentOwnerEvidence both accept refs up to MAX_RELEASE_REF_LENGTH = 1024, and the database column is VARCHAR(1024).

      If the owner target has a release ref between 257 and 1024 characters, no grant can express it. The assignment then always fails with InvalidCapabilityException. Let the record constructors enforce field-specific bounds, or raise the generic limit to cover the largest field.

      🐛 Proposed fix

      --- "a/services/entity-management-service/src/main/java/net/firedevops/firemud/entitymanagement/service/RunOwnedPreseededActorAssignmentCapability.java"
      +++ "b/services/entity-management-service/src/main/java/net/firedevops/firemud/entitymanagement/service/RunOwnedPreseededActorAssignmentCapability.java"
      @@ -524,9 +524,9 @@
             throw invalidCapability();
           }
           String parsed = value.textValue();
           if (parsed.isBlank()
      -        || parsed.length() > 256
      +        || parsed.length() > 1024
               || !parsed.equals(parsed.trim())
               || parsed.indexOf('\n') >= 0
               || parsed.indexOf('\r') >= 0) {
             throw invalidCapability();
      
      • Accepted Accept: generic capability text bound must admit documented release references up to1024; constructors preserve narrower field limits.
    5. Roster discovery takes exclusive locks that serialize reads across the whole namespace and tenant.Trivial

      captureCanonicalGameplayRosterSnapshot takes two exclusive locks before every read:

      • lockCanonicalRosterNamespace takes FOR UPDATE on the namespace row.
      • requireEntityTenantRow takes FOR UPDATE on the tenant identity row.

      A SHARED namespace covers every player in the realm. All concurrent roster reads in that namespace therefore run one at a time, and all reads in the tenant also queue behind the tenant row lock.

      Both rows are immutable. Triggers reject updates to the namespace scope and to the tenant mapping. The roster path only needs to confirm that the rows exist and to block concurrent assignment writers. FOR SHARE (or FOR KEY SHARE on the tenant row) does both. Assignment writers still take FOR UPDATE and still conflict with these share locks, so the snapshot consistency is preserved.

      ♻️ Proposed change

           String enrolledScope =
               dsl.select(ENTITY_PLAYABLE_STATE_NAMESPACE_SCOPES.PLAYABLE_STATE_SCOPE)
                   ...
      -            .forUpdate()
      +            .forShare()
                   .fetchOne(ENTITY_PLAYABLE_STATE_NAMESPACE_SCOPES.PLAYABLE_STATE_SCOPE);
      

      For the roster path, add a variant of requireEntityTenantRow that uses forKeyShare() instead of forUpdate().

      Also applies to: 1078-1089

      • Accepted Accept if writer conflict preserved: shared roster reader namespace/tenant locks prevent unnecessary reader serialization.
    6. Raise the activation projection limit to the tuple limit.Minor

      account_ss_activation_assert_current requires projection_bytes = tuple_bytes (Line 1034). original_post_authorization_tuple allows 262144 bytes. account_redemption_projection allows only 135168 bytes. A valid original tuple between 135169 and 262144 bytes is accepted by World participation and by admission protection, which uses 262144 for both columns. The same tuple can never get activation protection. Match the admission limit.

      Proposed fix

      --- "a/services/account-service/src/main/resources/db/migration/V1003__original_start_session_source_protections.sql"
      +++ "b/services/account-service/src/main/resources/db/migration/V1003__original_start_session_source_protections.sql"
      @@ -849,8 +849,8 @@
           account_world_participation_fence BIGINT NOT NULL CHECK (account_world_participation_fence > 0),
           original_post_authorization_tuple BYTEA NOT NULL
               CHECK (octet_length(original_post_authorization_tuple) BETWEEN 1 AND 262144),
           account_redemption_projection BYTEA NOT NULL
      -        CHECK (octet_length(account_redemption_projection) BETWEEN 1 AND 135168),
      +        CHECK (octet_length(account_redemption_projection) BETWEEN 1 AND 262144),
           game_session_owner_mutation_id UUID NOT NULL UNIQUE
               CHECK (game_session_owner_mutation_id <> '00000000-0000-0000-0000-000000000000'::UUID),
           game_session_owner_attempt_id UUID NOT NULL
      
      • Accepted Accept: activation redemption projection equals the full original tuple, so allow the same bounded 262144-byte maximum.
    7. A force-push or a non-ancestor before SHA makes the push run fail.Minor

      For push events, github.event.before can name a commit that is no longer reachable after a force-push. If it is unreachable, git rev-parse --verify in parent_snapshot fails, and the job reports a migration failure even though no migration problem exists. A force-push can also leave before as a commit that is not an ancestor of the new head. In that case the history comparison runs against an unrelated parent.

      For pull requests, the base SHA is fine. For pushes, consider one of these fixes:

      • Use git merge-base with the default branch.
      • Skip parent checks when before is not an ancestor of HEAD. Check with git merge-base --is-ancestor.
      • Rejected Reject: push before identifies potentially applied receiving history even after force-push. Skipping nonancestor/unreachable history would conceal removed or rewritten migrations; unavailable immutable history must fail honestly. Zero unborn SHA is separately fixed.
    8. Clarify what is packaged.Minor

      “Required packaged proof” does not state whether the proof used packaged artifacts. Replace it with “the required proof using packaged service artifacts” to make the validation claim clear.

      • Accepted Accept: describe required proof using packaged service artifacts clearly.
    9. The assignment intent digest encodes the scope as PLAYABLE_STATE_SCOPE_SHARED. The documented contract says SHARED.Major

      Both digest encoders write playableStateScope().name(). That call returns the full protobuf identifier, PLAYABLE_STATE_SCOPE_SHARED or PLAYABLE_STATE_SCOPE_ISOLATED. design/architecture/microservices/entity-management-service/api-contracts.md defines the intent_digest preimage with the short strings SHARED or ISOLATED, "not full protobuf enum identifiers."

      A consumer that follows the document computes a different digest. That consumer then rejects every receipt that ReadSelectedPreseededAssignment returns. The two encoders are also near-duplicates, and PreseededActorAssignmentService requires their outputs to be equal. If one changes and the other does not, every assignment fails with PRESEEDED_ASSIGNMENT_MUTATION_INTENT_DIGEST_MISMATCH.

      • services/entity-management-service/src/main/java/net/firedevops/firemud/entitymanagement/service/PreseededActorAssignmentGrantIntentDigest.java#L37-L37: write the documented short scope string, and move the shared field encoder into one helper.
      • services/entity-management-service/src/main/java/net/firedevops/firemud/entitymanagement/service/PreseededActorAssignmentIntentDigest.java#L37-L38: call that same helper, so the short scope string and field order cannot drift from the grant digest.
      static String shortScope(PlayableStateScope scope) {
        return switch (ActorIdentity.requireScope(scope)) {
          case PLAYABLE_STATE_SCOPE_SHARED -> "SHARED";
          case PLAYABLE_STATE_SCOPE_ISOLATED -> "ISOLATED";
          default -> throw new IllegalArgumentException("unsupported scope");
        };
      }
      

      If the full identifier is the intended value, update the canonical document instead. Fix one side before any caller or persisted receipt depends on the current value.

      As per path instructions: "Flag changes that violate documented FireMUD invariants" and cross-service contract drift.

      📍 Affects 2 files

      • services/entity-management-service/src/main/java/net/firedevops/firemud/entitymanagement/service/PreseededActorAssignmentGrantIntentDigest.java#L37-L37 (this comment)
      • services/entity-management-service/src/main/java/net/firedevops/firemud/entitymanagement/service/PreseededActorAssignmentIntentDigest.java#L37-L38
      • Accepted Accept: both grant and owner intent encoders must use canonical short SHARED/ISOLATED scope and one shared ordered encoder.
    10. Add the V1003 anchors to the AA-1.3 Capability Status row.Minor

      This subsection assigns the V1003 storage to AA-1.3. The AA-1.3 row at Line 153 has not changed. Its implementation anchors do not include V1003__original_start_session_source_protections.sql. Its proof anchors do not include the admission or activation PostgreSQL suites. Its gap cell does not record the open admission/activation settlement producer. The tracker contract says the capability rows are "the complete scan-first status surface". It also says to keep the "status, implementation record, validation, gaps … sections aligned when a domain boundary changes". Add the migration, the two test files, and the remaining gap to that row.

      As per coding guidelines: "Each tracker contains one Capability Status row for every capability it primarily owns… the capability rows are the complete scan-first status surface."

      • Accepted Accept: align AA-1.3 scan-first row with V1003 production, both PostgreSQL proofs and remaining real settlement producer gap.
    11. Order the expected activation source vector with the canonical sort key.Minor

      The activation guard orders source evidence by source.source_key, but the canonical source order uses account_publication_authorization_source_sort_key(source.source_key). For multiple sources, these orders can differ. The resulting mismatch can reject a canonically ordered sourceEvidenceVector and keep the activation protection pending.

      Proposed fix

                   jsonb_agg(
                       to_jsonb(replace(replace(encode(source.source_evidence, 'base64'), E'\n', ''), E'\r', ''))
      -                ORDER BY source.source_key),
      +                ORDER BY account_publication_authorization_source_sort_key(source.source_key)),
      
      • Accepted Accept: use existing canonical UTF-16 source sort key for activation expected evidence vector.
    12. Test activation acquisition with its guards enabled, or narrow the documented proof.Minor

      The activation suite inserts the protection and its source child with session_replication_role = replica. That disables account_ss_activation_insert_guard, account_ss_activation_source_insert_guard, and the deferred account_ss_activation_complete_guard. No test runs the insert guard's capture/target checks or the require_complete = TRUE branch on a valid row. With this suite's own data, the insert guard would fail, because preAuthorizationReservationTuple is {}. The docs still say the protection guards stayed enabled.

      • services/account-service/src/test/java/integration/net/firedevops/firemud/accountservice/repository/AccountStartSessionActivationProtectionPostgresIntegrationTest.java#L133-L206: add a test that inserts the activation protection and its sources with the guards enabled and commits. The fixture tuple must carry a preAuthorizationReservationTuple.scope with a matching targetNamespace and tenantId.
      • design/architecture/microservices/account-service/runtime-and-data.md#L341-L341: until that test exists, say that the activation acquisition guards are not exercised.
      • design/project-management/implementation-tracking/player-access-and-session.md#L17-L17: make the same correction to "leaving the protection/source-writer guards enabled" for the activation suite.

      📍 Affects 3 files

      • services/account-service/src/test/java/integration/net/firedevops/firemud/accountservice/repository/AccountStartSessionActivationProtectionPostgresIntegrationTest.java#L133-L206 (this comment)
      • design/architecture/microservices/account-service/runtime-and-data.md#L341-L341
      • design/project-management/implementation-tracking/player-access-and-session.md#L17-L17
      • Accepted Accept: enable acquisition/source/deferred completion guards for actual committed activation fixtures and prove valid acquisition.
    13. Enforce the settlement size limits at acquisition. Otherwise an accepted protection can never be released.Major

      The table accepts these values:

      • world_admission_hold_identity_bytes up to 262144 bytes.
      • request_binding_bytes up to 1048576 bytes.

      account_ss_admission_assert_current adds no tighter limit. The settlement guard rejects these values:

      • world_admission_hold_identity_bytes above 65536 (Line 504).
      • request_binding_bytes above 786432 (Line 503).
      • canonical_snapshot_bytes above 245760 (Line 472).
      • More than 256 source-vector members (Line 516).
      • More than 4194304 total source bytes (Line 527).
      • A source vector that is out of order or not canonical Base64 (Lines 537-548).

      The protection row is append-only. Settlement is the only release path for account_ss_admission_assert_no_pending. So any protection that passes acquisition but breaks one of these limits keeps its source keys blocked for good. Those writers are source-hold, source-change, and hosted-terms dispatch. No SQL path recovers from this state. Apply the same limits during acquisition, either as table CHECKs or in account_ss_admission_assert_current.

      Proposed fix (table bounds)

      --- "a/services/account-service/src/main/resources/db/migration/V1003__original_start_session_source_protections.sql"
      +++ "b/services/account-service/src/main/resources/db/migration/V1003__original_start_session_source_protections.sql"
      @@ -28,8 +28,8 @@
           capture_source_version BIGINT NOT NULL CHECK (capture_source_version > 0),
           capture_source_fence BIGINT NOT NULL CHECK (capture_source_fence > 0),
           capture_sha256 VARCHAR(64) NOT NULL CHECK (capture_sha256 ~ '^[0-9a-f]{64}$'),
      -    world_admission_hold_identity_bytes BYTEA NOT NULL CHECK (octet_length(world_admission_hold_identity_bytes) BETWEEN 1 AND 262144),
      -    request_binding_bytes BYTEA NOT NULL CHECK (octet_length(request_binding_bytes) BETWEEN 1 AND 1048576),
      +    world_admission_hold_identity_bytes BYTEA NOT NULL CHECK (octet_length(world_admission_hold_identity_bytes) BETWEEN 1 AND 65536),
      +    request_binding_bytes BYTEA NOT NULL CHECK (octet_length(request_binding_bytes) BETWEEN 1 AND 786432),
           request_binding_digest VARCHAR(71) NOT NULL
               CHECK (request_binding_digest = 'sha256:' || encode(sha256(request_binding_bytes), 'hex')),
           producer_xid BIGINT NOT NULL DEFAULT txid_current(),
      

      Also add the snapshot-size, source-count (1–256), total-source-bytes, and canonical-order checks to the require_complete branch of account_ss_admission_assert_current.

      • Accepted Accept: acquisition must enforce settlement bounds and canonical source evidence; append-only unsettled protections otherwise permanently block writers.
  6. CLI Review 4 CompletedRuntime 3m 54s
    Found: 4 Accepted: 0/4/0 Routed: 0
    1. Treat an all-zero push before SHA as "no parent" on every input path.Minor

      The CI step exports github.event.before as FIREMUD_FLYWAY_BASE_REF. The checker accepts that explicit value as its base ref and never applies the all-zero handling in event_base_ref. A new-branch push therefore passes 0000…0000 to git rev-parse, raises ValueError, and fails the Flyway job.

      • dev-tools/validation/check-flyway-versions.py#L285-L288: map an explicit "0" * 40 base ref to None before you fall back to event metadata and call parent_snapshot.
      • .github/workflows/ci.yml#L578-L579: export an empty value instead of the all-zero github.event.before SHA.
      • Accepted Accept: normalize the all-zero unborn push SHA on CLI and environment paths; keep nonzero immutable parent history comparison.
    2. Order the expected activation source vector by the canonical sort key, not by text collation.Minor

      The admission settlement guard orders source evidence with account_publication_authorization_source_sort_key(source.source_key) (lines 560-565 and 544-547). The activation settlement guard builds expected_source_vector with ORDER BY source.source_key instead. Plain text ordering depends on the database default collation, for example C or en_US.UTF-8. It can also differ from the canonical order that the producer uses.

      jsonb array equality is order-sensitive. A protection with two or more source children can therefore have an exact terminal receipt rejected. The activation protection then stays pending, and account_ss_admission_assert_no_pending blocks its source writers with no release path. The single-source fixture cannot detect this case.

      🐛 Proposed fix

      -                ORDER BY source.source_key),
      +                ORDER BY account_publication_authorization_source_sort_key(source.source_key)),
      

      Confirm that the Common activation-evidence carrier orders sourceEvidenceVector by the same canonical source sort key as the admission evidence.

      • Accepted Accept: activation settlement must use the existing canonical UTF-16 source-key ordering, matching producer evidence.
    3. Use Propagation.MANDATORY so that the writable-hold guard can fail.Minor

      @Transactional uses the default propagation, REQUIRED. The Spring proxy therefore opens a new transaction before the method body runs. As a result, isActualTransactionActive() is always true, and the "requires the writable hold transaction" check never rejects a caller that has no transaction.

      In that case, the FOR UPDATE locks on the assignment and actor rows are released when the self-created transaction commits. This happens before the caller records its applicability hold. The javadoc requires the opposite guarantee: actor changes must either win first or observe the durable hold.

      🐛 Proposed fix

      -  @Transactional
      +  @Transactional(propagation = org.springframework.transaction.annotation.Propagation.MANDATORY)
         public Optional<PreseededActorAssignmentReceipt> lockCurrentPreseededActorAssignmentReceipt(
      

      With MANDATORY, a caller without a transaction fails with IllegalTransactionStateException. A read-only caller still fails on the existing isCurrentTransactionReadOnly() check.

      • Accepted Accept: require an existing writable outer transaction through Spring MANDATORY; otherwise locks are released before the applicability hold.
    4. Remove the Compose-placeholder entry or reframe it as a reusable guard.Minor

      This entry records an ordinary bug in the discovery command of verify-fresh-bootstrap.sh. The same work fixed that bug, and "Current status" says the smoke and baselines pass. The file guideline states: "Do not use this file as a bug log for ordinary fixes that were completed in the same piece of work."

      Keep the entry only if it proposes a reusable rule. One example is a CI guard that runs docker compose config with every required placeholder. Otherwise, drop the entry.

      As per coding guidelines: "Workers should append reusable observations ... and ordinary bugs fixed in the same work should not become entries."

      • Accepted Accept: reframe the existing observation as a reusable config-only Compose preflight lesson; preserve history and avoid speculative guard tooling.
  7. CLI Review 5 CompletedRuntime 3m 34s
    Found: 3 Accepted: 0/1/0 Routed: 0
    1. Do not pass an unreachable github.event.before commit to the Flyway checker after a force push.Minor

      On a push event, FIREMUD_FLYWAY_BASE_REF receives github.event.before. After a force push, before is the previous branch tip. That commit is no longer reachable from any ref, so fetch-depth: 0 does not fetch it. parent_snapshot then runs git rev-parse --verify <sha>^{commit}, raises ValueError, and checkFlywayVersions fails. The job stays red until a non-forced push. An all-zero SHA is handled, but a rewritten history is not.

      Use a duplicate-only check for forced pushes. Alternatively, fetch the base commit explicitly before the check. Also confirm which branches trigger push for this job. If force pushes cannot happen on those branches, the impact is limited.

      🐛 Proposed fix

               env:
      -          FIREMUD_FLYWAY_BASE_REF: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }}
      +          FIREMUD_FLYWAY_BASE_REF: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || (!github.event.forced && github.event.before || '') }}
      
      • Rejected Same rejected Hosted2 retention issue: push before denotes receiving/applied history even on force push; duplicate-only fallback would hide removed/rewritten migrations. Missing immutable proof must fail honestly.
    2. Decide whether the fresh-bootstrap placeholder entry belongs in this file.Minor

      This entry records a defect that this PR fixes in dev-tools/verify-fresh-bootstrap.sh Line 55. Its "Current status" says the fix passes. The file rules say: "Do not use this file as a bug log for ordinary fixes that were completed in the same piece of work."

      Keep the entry only if it proposes a reusable guard. One example is a smoke-contract check that compares the configuration-only placeholders with the required Compose mounts. Otherwise, remove it. The native-Docker credential-helper entry is an environment observation and is acceptable. As per coding guidelines.

      • Rejected Already fixed in current reviewed head: the entry now states reusable required-placeholder and existing validate-only preflight pattern; file rules permit shared implementation patterns. No new redundant guard or deletion is needed.
    3. Confirm that the selected-assignment read is limited to shared scope.Minor

      requireSupportedTarget rejects every PLAYABLE_STATE_SCOPE_ISOLATED target with UnsupportedOperationException. CanonicalGameplayRosterService accepts isolated targets, so ListPreseededRoster can return an isolated snapshot. The follow-up ReadSelectedPreseededAssignment for that same snapshot is then always denied.

      design/architecture/microservices/entity-management-service/api-contracts.md Line 11 describes both methods without a scope limit. It also says that context playable_state_scope is SHARED or ISOLATED. Choose one of these corrections:

      • If the limit is intended, document it in the Implementation Status of api-contracts.md.
      • If the limit is not intended, remove the scope check here. The repository already matches the scope through PreseededActorAssignmentExpectedTarget.
      • Accepted Canonical selected assignment read contract supports both validated scopes. Remove unsupported SHARED-only restriction while preserving PRESEEDED policy, exact scope/context/owner/receipt bindings.
  8. CLI Review 6 CompletedRuntime 4m 09s
    Found: 3 Accepted: 1/1/0 Routed: 0
    1. Do not write the Entity-local entitytenantrowid into the legacy characters.tenantid column.Major

      Do not write the Entity-local `entity_tenant_row_id` into the legacy `characters.tenant_id` column.

      insertOwnerResolvedCharacter sets CHARACTERS.TENANT_ID to entityTenantRowId. That value comes from the new entity_tenant_identities BIGSERIAL, which starts at 1. Legacy rows and legacy consumers use characters.tenant_id as the numeric platform tenant ID, which is a different ID space that also starts at small integers. Several legacy paths isolate tenants by this column:

      • findByIdAndTenantId
      • countByTenantId
      • inventory and equipment joins through characters.tenant_id

      Consequence: suppose an owner-resolved actor for canonical tenant B gets entity_tenant_row_id = 1. Legacy tenant 1 then treats that actor as its own. A legacy tenant-1 caller can read the actor or mutate its holder rows by numeric ID. The integration test asserts this join (c.tenant_id = t.entity_tenant_row_id), so the behavior is intended. The collision risk across the two ID spaces is not addressed.

      Use one of these fixes:

      • Write a value that cannot collide, such as an Account-supplied numeric tenant ID resolved through owner evidence.
      • Fence assigned actors from legacy tenant predicates, for example by excluding OWNER_RESOLVED rows from legacy readers.
      • Allocate entity_tenant_row_id from a range that is disjoint from legacy tenant IDs.

      Confirm whether entity_tenant_row_id is meant to share the legacy tenant_id numbering space. Also confirm whether any reachable legacy handler resolves characters by (id, tenantId) without a playable_state_key predicate.

      • Accepted Accept: Entity-local tenant row IDs can collide with platform numeric IDs. New OWNER_RESOLVED actors must be excluded from legacy numeric reads/writes and holder joins; preserve ordinary legacy row behavior and canonical UUID reads.
    2. Update the GR-3.1 verification counts to match the latest proof record.Minor

      The GR-3.1 Verification cell cites 234 Entity unit cases and 24 physical PostgreSQL cases. Line 118 records the later correction gate: 236 unit cases and 26 physical PostgreSQL cases. That later gate is the current qualification for the review corrections. The scan-first capability row now contradicts the Validation and Proof section of the same tracker. Cite the latest counts in the row, or state that the row's counts belong to the pre-correction run.

      The path instructions require canonical-current-state consistency. The tracker contract requires the status, validation, and proof sections to stay aligned.

      • Accepted Accept: GR-3.1 scan-first verification must match current correction proof; avoid stale duplicated counts and cite current executed qualification.
    3. Do not use github.event.before as the parent after a force-push.Minor

      After a force-push, github.event.before names the replaced commit. That commit is usually unreachable from any fetched ref, so fetch-depth: 0 does not fetch it. parent_snapshot then runs git rev-parse --verify <sha>^{commit}, which fails. The checker raises ValueError and exits with status 1. The Flyway job turns red even when the migrations are valid. The next ordinary push recovers, but every forced push to a branch that runs this job fails this way.

      Pass no parent when the push event is forced. The checker already handles a missing base ref as a duplicate-only run.

      🐛 Proposed fix

             - name: 🧪 Check Flyway Migration Versions
               env:
      -          FIREMUD_FLYWAY_BASE_REF: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }}
      +          FIREMUD_FLYWAY_BASE_REF: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || (!github.event.forced && github.event.before || '') }}
               run: ./gradlew checkFlywayVersions
      
      • Rejected Same canonical retention issue rejected in Hosted2/CLI5: forced pushes still require immutable receiving/applied history preservation. Missing history must fail rather than skip deleted/rewritten migrations.
  9. Hosted Review 3 CompletedRuntime 11m 31s
    Found: 7 Accepted: 1/4/1 Routed: 1
    1. Keep the canonical roster assignment identifier consistent with its writer.Minor

      CanonicalGameplayRosterSelectedAssignmentService passes target.gameInstanceUuid().toString(), while the assignment models accept any bounded opaque gameInstanceId. The repository compares the target fields exactly. A receipt written with "game-instance" or uppercase UUID text can therefore fail this selected-assignment read.

      The canonical roster integration helper already writes target.gameInstanceUuid().toString() to both assignment records, so do not globally tighten the shared validators without preserving legacy opaque assignments. Either enforce the canonical UUID contract only on the canonical-roster assignment path, or pass the exact stored identifier through that path.

      • Accepted Overseer e2af8f49 confirms glossary canonical UUID roster bridge; correct conflicting API prose, preserve generic opaque digest/storage and exact receipt matching.
    2. Removed shared Saga migrations are reported once, but removed adopter histories are not checked per project.Minor

      This loop reads parent_migrations from the raw file list. A parent adopter can stop adopting Saga, for example because its dependency or its db/migration location is removed. In that case the shared files still exist, so this check passes. That adopter's installed Saga migrations then disappear from its effective history, and no check reports the change. Compare the effective set of each parent project with the current set for the same project. Report any parent (project, path) pair that is missing from the current set.

      Proposed fix

      +    for project, items in parent_grouped.items():
      +        current_paths = {item.path for item in grouped.get(project, [])}
      +        for item in items:
      +            if item.path in current and item.path not in current_paths:
      +                issues.append(f"services/{project}: historical migration {item.path} left effective history")
      
      • Accepted Removing runtime saga dependency/location drops an adopter effective applied history while raw migration files remain; compare per-project historical effective paths.
    3. Apply the settlement's hold-canonicality checks at acquisition. Otherwise an accepted admission protection can stay pending forever.Major

      account_ss_admission_assert_current checks only part of the World hold identity. The settlement guard (account_ss_admission_settlement_insert_guard) also rejects the following, for every outcome:

      • holdId or holdFence text that is not the lowercase canonical UUID form (Lines 653-654). For example, an uppercase UUID casts successfully at acquisition but fails settlement.
      • A hold request that does not have exactly the keys schema and request. The guard also requires exactly 14 request keys and the right JSON types (Lines 663-688).
      • Hold request bytes that differ from the reconstructed canonical JSON (Lines 722-726).
      • Hold identity bytes that differ from the reconstructed canonical object (Lines 732-735).

      The acquisition request binding embeds the hold as opaque Base64, so the request canonicality check at Line 241 does not cover these cases. A protection row is append-only, and only settlement releases account_ss_admission_assert_no_pending. Any hold that passes acquisition but fails one of these checks therefore blocks its source keys permanently. Those source keys gate the source-hold, source-change and hosted-terms dispatch writers, and no SQL path recovers them. This is the same failure class as the earlier settlement-bounds finding, but for hold structure.

      Move the hold validation into one shared helper, for example account_ss_admission_assert_canonical_hold(original). Call it from both account_ss_admission_assert_current and the settlement guard. Consider also validating the initialAdmissionOrigin/expectedPriorPointerVersion precondition (Lines 837-852) at acquisition. Without it, a COMMITTED settlement cannot be recorded.

      • Accepted Acquisition accepts hold/request shapes rejected by terminal settlement, permanently stranding append-only pending source protection; reuse complete canonical validation before acquisition.
    4. Add a positive admission settlement test.Trivial

      This suite tests only the rejection of a malformed settlement envelope. No test inserts a valid COMMITTED or ABORTED settlement through account_ss_admission_settlement_insert_guard. That guard is about 450 lines of byte-exact reconstruction: the outer envelope, the evidence vector, the hold request, the owner-proof frames and the timestamp normalization. It is also the only release path for an append-only admission protection. If the guard contains a defect that rejects every valid receipt, every admission protection stays pending permanently, and the current suite does not detect it. The activation suite already covers a positive settlement and a source-writer release.

      Add one ABORTED and one COMMITTED (NO_PRIOR_POINTER → pointer 1) settlement. Build each from the fixture hold and a framed owner proof. Then assert that account_control_ui_hold_required_sources succeeds afterwards.

      🪛 PMD (7.27.0)

      [Medium] 755-755: UnitTestContainsTooManyAsserts (Best Practices): Unit tests should not contain more than 1 assert(s).

      (UnitTestContainsTooManyAsserts (Best Practices))

      • Accepted Only malformed settlement negatives exist; add real COMMITTED and ABORTED proof through enabled guard and verify source writer unblocks.
    5. Stop labelling the superseded run on Line 116 as "Current".Minor

      Line 116 starts with "Current passive preparation" and records 234 unit and 24 integration cases. Lines 118 and 120 record later Entity gates with 236/26 and 237/27 cases. Line 120 holds the final legacy-bridge isolation result. Readers who scan the first bullet get stale counts as the current proof. Line 116 also reports "Account's 15 new protection cases", but the PR reports 18 focused Account admission and activation cases. Rename Line 116 as the initial recut run. Move the "current" label to the latest gate, and confirm the Account count against [Player Access and Session](./player-access-and-session.md).

      As per path instructions: "Flag obsolete transitional guidance." As per coding guidelines: "Keep its status, implementation record, validation, gaps, decisions, and service-map sections aligned".

      • Accepted First recut proof is historical; distinguish latest Entity237/27 and current Account18 without rewriting old15 attribution.
    6. Correct the claim that the canonical repository readers have no Spring registration.Minor

      Line 9 says that "exact canonical repository readers are present without Spring registration." Both ActorIdentityRepository and CharacterRepository have the @Repository annotation, so Spring registers them as beans. RetainedActorIdentityIntegrationTest and PreseededActorAssignmentIntegrationTest autowire them. Only the assignment, receipt and roster services are composed manually and left unregistered. A reader could conclude that the canonical reads cannot be reached from the Spring context, which is not true.

      📝 Proposed wording

      -Manually composed source services and exact canonical repository readers are present without Spring registration, authenticated clients, or gRPC handlers.
      +Manually composed assignment/receipt/roster source services are present without Spring registration, authenticated clients, or gRPC handlers; the exact canonical repository readers are Spring `@Repository` beans with no transport caller.
      

      As per path instructions: "Review docs for canonical-current-state consistency."

      • Accepted Registered repository beans contradict README; narrow wording preserves passive unregistered services and absent transport caller.
    7. 🚀 Performance & Scalability | 🔵 Trivial

      Define a retention policy for roster snapshots before roster reads are activated.

      captureCanonicalGameplayRosterSnapshot inserts a new snapshot whenever the snapshot digest changes. The digest covers the account, the complete target and the ordered actors. Each pointerVersion, activeWorldEpoch or gameInstanceUuid change therefore creates a new snapshot row, plus actor rows, for every account that reads its roster. V1008 blocks DELETE and TRUNCATE on both snapshot tables, and the roster actor rows have a foreign key to characters. Nothing can reclaim these rows, so storage grows without bound and an ordinary read path writes to the database.

      Before you register a transport caller, decide the retention class and the disposal path. For example:

      • Allow a fenced, owner-local purge of superseded snapshots after a horizon.
      • Record why indefinite retention is acceptable, and add a growth metric.

      [operational_advice]

      Route · PR #3189 → Unassigned target OpenOverseer e2af8f49 routes retention to held runtime2967: passive writer is callable but unregistered. Record Entity activation prerequisite for ADR0163 policy and proved owner disposal before any writer registration; preserve deletion guards. View routed finding
  10. CLI Review 7 CompletedRuntime 3m 41s
    Found: 2 Accepted: 0/2/0 Routed: 0
    1. Exclude rows that carry canonical owner provenance from legacyCharacterRow(), whatever their status.Minor

      legacyCharacterRow() checks only actor_identity_status <> 'OWNER_RESOLVED'. A canonical actor carries canonical provenance (non-null tenant_uuid). Once such a row is QUARANTINED, it passes this filter and becomes visible to every legacy numeric reader and writer. That includes the character, inventory, equipment, friend, resource and condition repositories, and deleteExpired.

      insertOwnerResolvedCharacter writes values that make this exposure harmful:

      • tenant_id is entity_tenant_row_id, a BIGSERIAL that can equal an unrelated real legacy numeric tenant ID.
      • account_id is the real Account row ID.
      • playable_state_key is the namespace UUID.

      After quarantine, findByIdAndTenantId(id, <colliding tenant>) returns the actor. save(...) can also overwrite it. This breaks the documented guarantee: "equal numeric values do not authorize legacy access to a canonical actor."

      At least two paths already trigger it:

      • The V1006 migration moves retained OWNER_RESOLVED duplicates to QUARANTINED with reason AMBIGUOUS_ACCOUNT_NAMESPACE. Those rows keep their tenant_uuid.
      • Any future runtime quarantine of an assigned actor will do the same.

      Legacy rows always have a null tenant_uuid. Canonical rows always have a non-null tenant_uuid. Add that column to the predicate. Then add a regression case that quarantines an assigned actor and asserts that legacy readers still return nothing for it.

      Proposed fix

         static Condition legacyCharacterRow() {
      -    return CHARACTERS.ACTOR_IDENTITY_STATUS.ne(ActorIdentityStatus.OWNER_RESOLVED.name());
      +    // Rows carrying canonical owner provenance stay out of legacy numeric paths even when
      +    // quarantined; their numeric tenant_id is an Entity-private row id, not a platform tenant.
      +    return CHARACTERS
      +        .ACTOR_IDENTITY_STATUS
      +        .ne(ActorIdentityStatus.OWNER_RESOLVED.name())
      +        .and(CHARACTERS.TENANT_UUID.isNull());
         }
      
      • Accepted Verified V1006 quarantines canonical duplicates without clearing tenant_uuid; status-only legacy predicate then admits Entity-private numeric tenant collisions. Require null canonical tenant provenance and prove legacy isolation after canonical quarantine.
    2. Make the push-event parent ref tolerate force-pushes, and decide what merge-queue runs should compare against.Minor

      For non-PR events, the job sets FIREMUD_FLYWAY_BASE_REF to github.event.before. On a force-push, before names the commit the branch pointed to before the rewrite. After the rewrite, no ref points to that commit. actions/checkout with fetch-depth: 0 fetches commits that refs point to, so it will usually not fetch it. parent_snapshot then runs git rev-parse --verify <sha>^{commit}, which raises ValueError. main reports that as a failure. The Flyway job therefore fails on every force-push, even when the migrations have not changed.

      The opposite gap exists for events with no before field, such as merge_group and workflow_dispatch. In those runs the expression yields an empty string, and event_base_ref returns None. The checker then runs only the duplicate check, with no parent comparison.

      Pick one fallback for each case:

      • When before is not a reachable commit, fall back to the branch's merge-base with the default branch. Alternatively, skip parent comparison with an explicit warning.
      • For merge_group, pass github.event.merge_group.base_sha.

      Confirm which branches the push trigger covers, whether those branches allow force-push, and whether the repository uses a merge queue. Those facts set how often each case occurs.

      Proposed CI expression change

      -          FIREMUD_FLYWAY_BASE_REF: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }}
      +          FIREMUD_FLYWAY_BASE_REF: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event_name == 'merge_group' && github.event.merge_group.base_sha || github.event.before }}
      

      In dev-tools/validation/check-flyway-versions.py, handle an unreachable parent explicitly. Do not let the generic ValueError handler turn it into a failure.

      • Accepted Valid manual-dispatch gap: no before/base means duplicate-only validation. Main/develop restrict force pushes and merge_group is not configured. Require an explicit immutable manual base and fetch it; retain fail-closed missing-parent behavior, no skip/fallback.
  11. Hosted Review 4 CompletedRuntime 9m 04s
    Found: 1 Accepted: 0/1/0 Routed: 0
    1. Validate lifecycle evidence before releasing source writers.Minor

      account_ss_activation_settlement_insert_guard checks that lifecycleEvidenceBytesBase64 is present, but it does not decode or validate it. A COMMITTED settlement can therefore carry arbitrary bytes and still satisfy the current lifecycle checks.

      For COMMITTED, decode the evidence and require canonical Base64, the World lifecycle schema, ACTIVE status, and the retained PREPARING request binding. Validate the complete closed shape defined by WorldCanonicalInstanceLifecycleEvidence.

           result_request_bytes BYTEA;
      +    lifecycle_bytes BYTEA;
      +    lifecycle_value JSONB;
      @@
           result_request_bytes := decode(result_value->>'requestBytesBase64', 'base64');
      +    lifecycle_bytes := decode(result_value->>'lifecycleEvidenceBytesBase64', 'base64');
      +    IF NEW.outcome = 'COMMITTED' THEN
      +        lifecycle_value := convert_from(lifecycle_bytes, 'UTF8')::JSONB;
      +    END IF;
      @@
               OR result_value->>'outcome' IS DISTINCT FROM NEW.outcome
      +        OR regexp_replace(encode(lifecycle_bytes, 'base64'), E'[\n\r]', '', 'g')
      +            IS DISTINCT FROM result_value->>'lifecycleEvidenceBytesBase64'
      +        OR (NEW.outcome = 'COMMITTED' AND (
      +            lifecycle_value->>'schema' IS DISTINCT FROM 'world-canonical-instance-lifecycle-evidence/v1'
      +            OR lifecycle_value->>'lifecycleStatus' IS DISTINCT FROM 'ACTIVE'
      +            OR lifecycle_value->'request' - 'readRequestId'
      +                IS DISTINCT FROM preparing_request - 'readRequestId'))
               OR (NEW.outcome = 'COMMITTED' AND result_value->'terminalCode' IS DISTINCT FROM 'null'::JSONB)
      
      • Accepted Verified COMMITTED guard never decodes lifecycle bytes and current positive fixture uses arbitrary synthetic ACTIVE bytes. Enforce closed ACTIVE lifecycle evidence bound to retained PREPARING input via forward Account migration and physical negative/release proof.
  12. CLI Review 8 CompletedRuntime 4m 48s
    Found: 1 Accepted: 0/0/0 Routed: 0
    1. Fetch the push-event parent commit before the Flyway check.Minor

      The fetch step runs only for workflow_dispatch. For push events, line 602 passes github.event.before as the base SHA. The fetch-depth: 0 checkout fetches only commits that a branch or tag can reach. A force-push to main or develop makes the old commit unreachable from every branch. In that case parent_snapshot raises "immutable receiving parent commit is unavailable". The Flyway job then fails although no migration changed.

      Run the existing fetch logic for every event that supplies a base SHA. Skip the all-zero push sentinel.

      🔧 Proposed fix

      -      - name: Fetch manual Flyway parent when needed
      -        if: ${{ github.event_name == 'workflow_dispatch' }}
      +      - name: Fetch Flyway parent when needed
               env:
      -          FLYWAY_BASE_SHA: ${{ inputs.flyway_base_sha }}
      +          FLYWAY_BASE_SHA: ${{ github.event_name == 'workflow_dispatch' && inputs.flyway_base_sha || github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }}
               run: |
      +          if [[ "${{ github.event_name }}" != "workflow_dispatch" && ( -z "$FLYWAY_BASE_SHA" || "$FLYWAY_BASE_SHA" == "0000000000000000000000000000000000000000" ) ]]; then
      +            exit 0
      +          fi
                 if [[ ! "$FLYWAY_BASE_SHA" =~ ^[[:xdigit:]]{40}$ ]]; then
      
      • Rejected Both actual main/develop branch rules enforce non_fast_forward, verified live. Supported push parent remains reachable in fetch-depth0; suggested failure requires prohibited force-push. Retain exact missing-parent failure rather than expanding unsupported event behavior.
  13. CLI Review 9 CompletedRuntime 3m 29s
    Found: 5 Accepted: 0/2/2 Routed: 0
    1. Compare against the parent's effective history, not the raw parent snapshot.Minor

      The frontier check runs only when item.path not in parent. Existing common-saga files are always in the raw parent snapshot. This allows the following sequence:

      • A service has local versions above V1002.
      • The service then starts loading common-saga through a new runtime dependency or Flyway location.
      • The shared V1000–V1002 migrations become new effective migrations below that service's applied frontier.
      • The checker does not flag them.
      • With default ordering, Flyway validation on upgraded databases fails with resolved-but-unapplied lower versions.

      This contradicts the documented rule that new versions must exceed the receiving parent's combined local/shared frontier. Use the project's parent effective paths instead.

      🐛 Proposed fix

               previous = parent_grouped.get(project, [])
      +        previous_paths = {entry.path for entry in previous}
               frontier = max((item.version_key for item in previous), default=None)
               for item in items:
      -            if parent is not None and item.path not in parent and frontier is not None and item.version_key <= frontier:
      +            if (parent is not None and item.path not in previous_paths
      +                    and frontier is not None and item.version_key <= frontier):
      

      Add a self-test case. In that case, the parent has a service with local V2000 and no Saga wiring. The current snapshot adds the Saga dependency and location. The expected result is a failure that names frontier V2000.

      • Accepted Raw parent includes unloaded Saga files; compare parent effective paths and add below-frontier regression.
    2. Remove or reframe the Compose placeholder entry as a reusable rule.Minor

      This entry records a defect that this same work fixed: the discovery command now supplies the receipt placeholder. The file rules exclude ordinary fixes completed in the same work. Keep the entry only if a lasting guard or rule remains open. One example is a CI check that keeps the configuration-only placeholders aligned with the required Compose inputs. If you keep it, record that open item and its reconsideration trigger. Otherwise, remove the entry before merge. The native-Docker credential-helper entry (lines 245-248) is an environment observation and qualifies.

      As per coding guidelines: "Do not use this file as a bug log for ordinary fixes that were completed in the same piece of work. Prefer logging reusable observations that suggest a better repo rule, CI guard, design refinement, or shared implementation pattern."

      • Rejected Existing entry already states reusable rule to align configuration-only placeholders with required Compose inputs and run validate-only preflight when those inputs change, with explicit parse-proof limits. Preserve append-only observations; no invented open item or deletion.
    3. Add the V1004 migration as an AA-1.3 implementation anchor.Minor

      The row adds V1003 as an anchor. V1004 is not listed. V1004 is a separate production migration that adds the COMMITTED activation-settlement lifecycle guard. The source-protection section (lines 15-21) and Account Runtime and Data both describe V1004 as part of this boundary. Add [V1004 activation settlement lifecycle integrity](../../../services/account-service/src/main/resources/db/migration/V1004__activation_settlement_lifecycle_integrity.sql) beside the V1003 anchor.

      As per coding guidelines: "implemented and partial rows name concrete production anchors" and "Keep its status, implementation record, validation, gaps, decisions, and service-map sections aligned."

      • Accepted AA-1.3 anchors omit new V1004; add exact production anchor without changing status.
    4. Test the two-root rejection before the certificate is made invalid.Trivial

      Line 201 stubs trustedRoot.checkValidity() to throw CertificateExpiredException. The assertion at Lines 207-211 then runs with List.of(trustedRoot, trustedRoot). That list fails because the certificate is expired, not because the list has more than one root. As a result, the "exactly one CA" rule in fingerprintValidatedTrustRoot has no independent test. If someone removes the cardinality check, this test still passes.

      Move the two-root assertion above the doThrow stub. Consider adding a non-CA case (getBasicConstraints() returning -1) as well, because the test name says the method requires "one valid CA".

      ♻️ Proposed reorder

      +    assertThatThrownBy(
      +            () ->
      +                RunOwnedPreseededActorAssignmentCapability.fingerprintValidatedTrustRoot(
      +                    List.of(trustedRoot, trustedRoot)))
      +        .isInstanceOf(RunOwnedPreseededActorAssignmentCapability.InvalidCapabilityException.class);
      +
           doThrow(new CertificateExpiredException()).when(trustedRoot).checkValidity();
           assertThatThrownBy(
                   () ->
                       RunOwnedPreseededActorAssignmentCapability.fingerprintValidatedTrustRoot(
                           List.of(trustedRoot)))
               .isInstanceOf(RunOwnedPreseededActorAssignmentCapability.InvalidCapabilityException.class);
      -    assertThatThrownBy(
      -            () ->
      -                RunOwnedPreseededActorAssignmentCapability.fingerprintValidatedTrustRoot(
      -                    List.of(trustedRoot, trustedRoot)))
      -        .isInstanceOf(RunOwnedPreseededActorAssignmentCapability.InvalidCapabilityException.class);
      
      • Accepted Verified two-root assertion uses an already expired certificate and cannot independently prove cardinality; reorder before expiry.
    5. Do not pin the Account migration tip in the protection suites.Trivial

      Both suites assert the current tip (114 artifacts and a maximum version of 1004) under the default migration locations. Any later Account or shared migration fails both suites, even when the parent-preservation contract still holds.

      • services/account-service/src/test/java/integration/net/firedevops/firemud/accountservice/repository/AccountStartSessionAdmissionProtectionPostgresIntegrationTest.java#L192-L201: assert that V1003 and V1004 are present and successful, or run with target("1004") before the exact count is asserted. Apply the same change to the upgrade assertions at lines 261-274. Keep the frozen 112-artifact parent fixture.
      • services/account-service/src/test/java/integration/net/firedevops/firemud/accountservice/repository/AccountStartSessionActivationProtectionPostgresIntegrationTest.java#L160-L166: assert that V1004 is present and successful in flyway_schema_history, or upgrade with target("1004"). Do not compare max(version) with 1004.
      • Accepted Latest-history count/max hardcodes fail on valid future additions; preserve resolved-history success and explicit V1003/V1004, pin isolated historical upgrade.
  14. Hosted Review 5 CompletedRuntime 8m 58s
    Found: 3 Accepted: 1/2/0 Routed: 0
    1. Exclude canonical rows from the quarantined tenant count.Minor

      countQuarantinedByTenantId must apply the canonical-provenance exclusion used by other numeric tenant predicates. A quarantined canonical actor can retain the queried TENANT_ID, so the current query counts it. Add TENANT_UUID IS NULL and update the test expectation to 2.

         public long countQuarantinedByTenantId(Long tenantId) {
           return dsl.fetchCount(
               CHARACTERS,
               CHARACTERS
                   .TENANT_ID
                   .eq(tenantId)
      -            .and(CHARACTERS.ACTOR_IDENTITY_STATUS.eq(ActorIdentityStatus.QUARANTINED.name())));
      +            .and(CHARACTERS.ACTOR_IDENTITY_STATUS.eq(ActorIdentityStatus.QUARANTINED.name()))
      +            .and(CHARACTERS.TENANT_UUID.isNull()));
         }
      
           assertThat(characterRepository.countQuarantinedByTenantId(entityTenantRowId))
      -        .isEqualTo(quarantined ? 3 : 2);
      +        .isEqualTo(2);
      
      • Accepted Verified numeric tenant quarantined count lacks null TENANT_UUID provenance exclusion and physical test currently expects leaked canonical count3. Exclude canonical rows and retain legacy count2.
    2. Validate the retained lifecycle before acquiring the protection.Major

      account_ss_activation_insert_guard calls account_ss_activation_assert_current(..., FALSE), but that function checks only selected PREPARING fields. Its require_complete branch checks source children, not lifecycle completeness. The acquisition boundary can therefore retain evidence with extra request keys, publicProduction = false, ISOLATED scope, or an empty region map.

      The COMMITTED guard rejects those shapes. The protection then cannot settle as COMMITTED, and account_ss_admission_assert_no_pending keeps its source keys blocked until a settlement exists.

      Add a shared helper such as account_ss_activation_assert_canonical_lifecycle(bytes, expected_status). Call it for the retained PREPARING evidence during acquisition and for the ACTIVE evidence during settlement. If non-public or ISOLATED activations are valid, remove those restrictions from the settlement contract instead.

      • Accepted Verified V1003 acquisition permits partial PREPARING while V1004 settlement requires full canonical shape; World Request mandates SHARED/publicProduction. Share closed lifecycle validation at acquisition and settlement, preserving existing locks and guards.
    3. Add V1004 to the AA-1.3 Capability Status row.Minor

      The subsection at Lines 15 and 21 assigns forward V1004 lifecycle integrity to AA-1.3. The row anchors only V1003__original_start_session_source_protections.sql. The row omits V1004__activation_settlement_lifecycle_integrity.sql. The gap cell mentions only V1003 storage. Add the V1004 migration link to the implementation anchors. State in the gap cell that V1004 validates COMMITTED lifecycle integrity only and does not authenticate World.

      As per coding guidelines: "Keep its status, implementation record, validation, gaps, decisions, and service-map sections aligned when a domain boundary changes" and "the capability rows are the complete scan-first status surface."

      • Accepted AA-1.3 anchor overlap with accepted CLI finding; also add explicit V1004 COMMITTED integrity versus unauthenticated World limit to the row.
  15. CLI Review 10 CompletedRuntime 4m 07s
    Found: 2 Accepted: 0/0/1 Routed: 0
    1. Assert the specific constraint failure in the duplicate-insert checks.Trivial

      isInstanceOf(RuntimeException.class) accepts any failure. For example, a bad column value, a check-constraint violation, or a SQL grammar error would also pass. The duplicate character_uuid insert therefore does not prove that ux_characters_character_uuid rejects the row. The second insertNamespace call also does not prove that the namespace primary key rejects a scope change.

      Assert DuplicateKeyException, which Spring translates from SQLSTATE 23505. Also assert the constraint name in the message so each check matches the invariant in its test name.

      ♻️ Proposed change

      -        .isInstanceOf(RuntimeException.class);
      +        .isInstanceOf(org.springframework.dao.DuplicateKeyException.class)
      +        .hasMessageContaining("ux_characters_character_uuid");
           assertThatThrownBy(
                   () ->
                       insertNamespace(
                           tenantUuid, namespaceUuid, PlayableStateScope.PLAYABLE_STATE_SCOPE_ISOLATED))
      -        .isInstanceOf(RuntimeException.class);
      +        .isInstanceOf(org.springframework.dao.DuplicateKeyException.class);
      
      • Accepted Verified broad RuntimeException may mask unrelated insert failures; require translated23505 DuplicateKeyException and exact actor/namespace constraints.
    2. Test URI exactness separately from the namespace mismatch.Trivial

      The test name says that the authenticated URI must match exactly. The peer in this block changes both the URI and the namespace ("other"). The adapter could check only the peer namespace or the service name, and this assertion would still pass. In that case, the test would not cover the exact-URI check.

      Add a case that keeps the namespace NAMESPACE and the service game-session-service but uses a different URI SAN. Keep the current case as a separate namespace-mismatch check.

      ♻️ Proposed addition

      +    Context.current()
      +        .withValue(
      +            GrpcPeerIdentity.CONTEXT_KEY,
      +            new GrpcPeerIdentity(
      +                "spiffe://firemud/ns/dev/sa/game-session-service-shadow",
      +                NAMESPACE,
      +                "game-session-service"))
      +        .run(
      +            () ->
      +                assertThatThrownBy(
      +                        () ->
      +                            authority.requireAuthorized(
      +                                request(),
      +                                RunOwnedPreseededAssignmentAuthority.Action
      +                                    .PRESEEDED_ACTOR_ASSIGNMENT))
      +                    .isInstanceOf(AdminAuthorizationException.class));
      
      • Accepted Verified the denial currently changes namespace and URI simultaneously, masking exact URI enforcement; add independent same-namespace/service URI mismatch.
  16. CLI Review 11 CompletedRuntime 4m 29s
    Found: 4 Accepted: 0/2/2 Routed: 0
    1. Fetch only the exact parent commit for every event, not the full history.Trivial

      This job needs only one parent commit. The checker reads that commit with git rev-parse, git ls-tree and git show. fetch-depth: 0 clones the full repository history on every pull-request and push run of this job. This increases CI cost for no benefit.

      A full clone also does not make push events reliable. After a force-push to main or develop, github.event.before is not reachable from any fetched ref. The checker then fails with "immutable receiving parent commit is unavailable".

      Apply the existing exact-SHA fetch to all events. Use the same expression that selects FIREMUD_FLYWAY_BASE_REF. Skip the fetch for the all-zero new-branch value. Keep the default shallow checkout. Update the matching assertions in dev-tools/tests/pr-retarget-workflow-contract.sh.

      This follows the path instruction: "Focus on workflow correctness, ... cache correctness, duplication, and CI cost."

      ♻️ Proposed refactor

             - name: ⬇️ Checkout Code
               uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
      -        with:
      -          fetch-depth: 0
       
      -      - name: Fetch manual Flyway parent when needed
      -        if: ${{ github.event_name == 'workflow_dispatch' }}
      +      - name: Fetch exact Flyway parent
               env:
      -          FLYWAY_BASE_SHA: ${{ inputs.flyway_base_sha }}
      +          FLYWAY_BASE_SHA: ${{ github.event_name == 'workflow_dispatch' && inputs.flyway_base_sha || github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }}
               run: |
      +          if [[ "$FLYWAY_BASE_SHA" == "0000000000000000000000000000000000000000" && "${{ github.event_name }}" != "workflow_dispatch" ]]; then
      +            exit 0
      +          fi
                 if [[ ! "$FLYWAY_BASE_SHA" =~ ^[[:xdigit:]]{40}$ ]]; then
                   echo "workflow_dispatch requires a full immutable 40-character Flyway base SHA" >&2
                   exit 1
                 fi
                 if ! git cat-file -e "${FLYWAY_BASE_SHA}^{commit}" 2>/dev/null; then
      -            git fetch --no-tags origin "$FLYWAY_BASE_SHA"
      +            git fetch --no-tags --depth=1 origin "$FLYWAY_BASE_SHA"
                 fi
      
      • Accepted Accepted: use the same immutable parent SHA expression for all event fetches, shallow exact-SHA fetch, zero-branch sentinel handling and matching workflow contract.
    2. Check that the ACTIVE lifecycleEpoch does not go backwards from the retained PREPARING evidence.Minor

      The guard removes lifecycleEpoch and rowVersion before it compares the two lifecycle documents. No other check covers these counters. A COMMITTED settlement can therefore bind ACTIVE evidence whose lifecycleEpoch is lower than the retained PREPARING epoch. Such evidence describes an earlier or different World lifecycle, and the SQL accepts it as the exact terminal binding. Settlement then releases the pending source-writer exclusion.

      Confirm the World lifecycle contract: does the PREPARING → ACTIVE transition keep or increase lifecycleEpoch? If yes, reject a decrease. Apply the same check to rowVersion only if that counter is also monotonic across the transition.

      🛡️ Proposed guard

           IF lifecycle - ARRAY['request', 'lifecycleStatus', 'lifecycleEpoch', 'rowVersion']
                   IS DISTINCT FROM preparing - ARRAY['request', 'lifecycleStatus', 'lifecycleEpoch', 'rowVersion']
               OR (lifecycle->'request') - 'readRequestId'
      -            IS DISTINCT FROM (preparing->'request') - 'readRequestId' THEN
      +            IS DISTINCT FROM (preparing->'request') - 'readRequestId'
      +        OR (lifecycle->>'lifecycleEpoch')::NUMERIC < (preparing->>'lifecycleEpoch')::NUMERIC THEN
               RAISE EXCEPTION 'Committed activation lifecycle differs from retained PREPARING binding'
                   USING ERRCODE = '23514';
           END IF;
      
      • Accepted Accepted: ADR0123 requires monotonic lifecycle epoch and World repository increments row version. Add forward-only settlement nondecrease guards with actual PostgreSQL rejection/retention proof; preserve published V1004.
    3. Move this rollout outcome to the owning PR or tracker evidence.Minor

      This entry records one completed rollout: the build number, reset counts and a readback summary. It states no new reusable lesson, repository rule, CI guard or design refinement.

      The open item stays in the existing 2026-10-14 entry. Its reconsideration trigger still applies, because this entry states that concurrent resets were not tested. The new entry therefore adds a status log next to that observation.

      Record the rollout result in the owning PR or orchestrator evidence. If a reusable lesson exists, rewrite this entry as that lesson and keep the current reconsideration trigger.

      This is required by the coding guideline: "Do not use this file as a bug log for ordinary fixes that were completed in the same piece of work. Prefer logging reusable observations that suggest a better repo rule, CI guard, design refinement, or shared implementation pattern."

      • Accepted Accepted: rewrite new rollout-status entry as reusable safe terminal-session handoff lesson; native jobs already retain detailed completion evidence. Preserve existing open observation and trigger.
    4. Put the legacy-character EXISTS predicate in one place.Trivial

      Three repositories each define the same private legacyCharacter(Field<Long>) helper around CharacterRepository.legacyCharacterRow(). If the legacy-row boundary changes later, all three copies must change together. A missed copy would expose canonical actors to a legacy reader.

      • services/entity-management-service/src/main/java/net/firedevops/firemud/entitymanagement/repository/CharacterRepository.java#L152-L157: add a package-private static legacyCharacterExists(Field<Long> characterId) next to legacyCharacterRow().
      • services/entity-management-service/src/main/java/net/firedevops/firemud/entitymanagement/repository/ActorActiveConditionRepository.java#L150-L155: remove the local helper and call CharacterRepository.legacyCharacterExists.
      • services/entity-management-service/src/main/java/net/firedevops/firemud/entitymanagement/repository/ActorResourceStateRepository.java#L102-L107: remove the local helper and call CharacterRepository.legacyCharacterExists.
      • services/entity-management-service/src/main/java/net/firedevops/firemud/entitymanagement/repository/CharacterFriendRepository.java#L104-L109: remove the local helper and call CharacterRepository.legacyCharacterExists from legacyFriendEndpoints() and save.

      ♻️ Shared predicate

        static Condition legacyCharacterExists(Field<Long> characterId) {
          return DSL.exists(
              DSL.selectOne()
                  .from(CHARACTERS)
                  .where(CHARACTERS.ID.eq(characterId).and(legacyCharacterRow())));
        }
      
      • Accepted Accepted: consolidate identical legacy-character EXISTS conditions into CharacterRepository without changing the canonical/legacy boundary or callers.
  17. Hosted Review 6 CompletedRuntime 8m 04s
    Found: 1 Accepted: 0/0/1 Routed: 0
    1. Handle a non-dict pull_request.base value and prefer explicit dispatch handling.Trivial

      pull_request.get("base", {}) raises AttributeError when base is null. main catches only ValueError, OSError, and TypeError. In that case the script exits with a traceback instead of the normal failure message. GitHub always sends a base object, so this mainly affects the robustness of the error path. The fix is small: read base once and check it with isinstance.

      Proposed fix

      -    if isinstance(pull_request, dict):
      -        return pull_request.get("base", {}).get("sha")
      +    if isinstance(pull_request, dict):
      +        base = pull_request.get("base")
      +        return base.get("sha") if isinstance(base, dict) else None
      
      • Accepted Accepted: malformed pull_request.base must not raise AttributeError; use the existing event parser dictionary shape check without changing dispatch/push parent semantics.
  18. CLI Review 12 CompletedRuntime 3m 22s
    Found: 3 Accepted: 0/2/1 Routed: 0
    1. Validate the retained PREPARING evidence before you compare its counters.Minor

      The guard parses original.world_preparing_evidence as raw JSONB. Only the V1004 acquisition path runs account_ss_activation_validate_lifecycle on PREPARING evidence. Protection rows retained from V1003 never went through that validator, and the upgrade test retains such pending rows. Consider a retained row whose PREPARING evidence has no lifecycleEpoch or rowVersion key:

      • (preparing->>'lifecycleEpoch')::NUMERIC is NULL.
      • The < comparison is NULL, so the counter check does not raise.
      • The key-subtraction equality check removes both counters, so it also passes.

      A COMMITTED settlement then releases the source-writer exclusion without any monotonic check. That contradicts the documented rule that malformed carriers keep the exclusion. Call the closed validator on the retained bytes. It rejects a missing, non-canonical or non-PREPARING carrier with 23514.

      🛡️ Proposed fix

           lifecycle := account_ss_activation_validate_lifecycle(lifecycle_bytes, 'ACTIVE');
      -    preparing := convert_from(original.world_preparing_evidence, 'UTF8')::JSONB;
      +    preparing := account_ss_activation_validate_lifecycle(
      +        original.world_preparing_evidence, 'PREPARING');
           IF preparing->>'lifecycleStatus' IS DISTINCT FROM 'PREPARING' THEN
      
      • Accepted Retained V1003 PREPARING rows bypass the V1004 acquisition validator; NULL counters evade comparison. Validate retained bytes with the existing closed validator in new forward V1004.2; preserve published V1004/V1004.1 and prove historical pending rows remain fenced.
    2. Add the V1004.1 anchor and qualification to the AA-1.3 row.Minor

      The row anchors only V1003 and V1004. Its gap text says only that V1004 validates COMMITTED lifecycle integrity. V1004.1 adds a separate settlement guard that rejects regressing lifecycleEpoch and rowVersion. The narrative at line 27 and the Account runtime document already describe that guard. Add the V1004.1 migration link to the implementation anchors. Then extend the gap sentence so that the capability row matches the narrative record.

      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 AA-1.3 row omits published V1004.1 implementation anchor and nondecreasing-counter qualification despite narrative/Account owner recording it. Align row while preserving passive integrity-only/no-authentication scope.
    3. Add the changed-snapshot case that the test name claims.Trivial

      The method name changedSnapshotOrActorAbsentFromItFailsBeforeReceiptRead names two failure paths. The body covers only one: the actor is absent from a snapshot that matches the request. No case returns a snapshot whose snapshotUuid or snapshotDigest differs from request.expectedSnapshot(). The stale-snapshot rejection path therefore has no test. A regression in that path would let a selection bind to a roster the caller never saw.

      Add a case where readCurrentCanonicalGameplayRosterSnapshot returns a snapshot with a different digest that still contains the selected actor. Assert that the read fails and that readSelectedPreseededActorAssignmentReceipt is never called. If the repository is the only component that rejects a mismatched snapshot, rename the test so it does not claim that coverage.

      🧪 Proposed additional case

      +    when(repository.readCurrentCanonicalGameplayRosterSnapshot(
      +            request.canonicalAccountUuid(), request.expectedTarget(), request.expectedSnapshot()))
      +        .thenReturn(
      +            new CanonicalGameplayRosterSnapshot(
      +                request.canonicalAccountUuid(),
      +                request.expectedSnapshot().snapshotUuid(),
      +                "b".repeat(64),
      +                request.expectedTarget(),
      +                java.util.List.of(
      +                    new CanonicalGameplayRosterActor(
      +                        request.selectedCharacterUuid(), "Selected Actor"))));
      +    assertThatThrownBy(() -> service.read(request)).isInstanceOf(IllegalStateException.class);
      
      • Accepted Repository already rejects stale digest before returning snapshot (CharacterRepository lines1101-1102). Accept the provider alternative: rename the unit case to actor-absent-only; preserve existing storage stale-snapshot proof and avoid invented service checks.
  19. Hosted Review 7 CompletedRuntime 14m 57s
    Found: 2 Accepted: 2/0/0 Routed: 0
    1. Validate retained PREPARING counters before comparing them.Major

      The acquisition checks in services/account-service/src/main/resources/db/migration/V1003__original_start_session_source_protections.sql, Lines 1059–1065, permit PREPARING evidence without rowVersion. The forward migrations preserve those rows.

      For that retained shape, preparing->>'rowVersion' returns NULL. The comparison returns NULL, and the IF does not reject it when the epoch comparison is false. (postgresql.org)

      The subsequent binding check removes both counters. Consequently, an otherwise matching ACTIVE result can release source writers despite an unverifiable retained counter.

      Use the shared PREPARING validator before comparison. Add a V1003 upgrade regression with a missing or JSON-null retained counter. Install the correction through a forward migration without rewriting retained evidence.

      Required retained-evidence validation

      -    preparing := convert_from(original.world_preparing_evidence, 'UTF8')::JSONB;
      +    preparing := account_ss_activation_validate_lifecycle(
      +        original.world_preparing_evidence, 'PREPARING');
      
      • Accepted Retained V1003 PREPARING rows can omit counters, bypass comparison and release writers. Same useful obligation as CLI2 finding3; new forward V1004.2 reuses the existing closed validator with retained-history/pending exclusion proof.
    2. Reject noncanonical activation-request UUID text before acquisition.Major

      PostgreSQL accepts uppercase UUID input and emits lowercase canonical text. This cast therefore accepts an uppercase worldActivationRequestId. (postgresql.org)

      Neither currentness nor deferred completeness rejects that spelling. However, the settlement check at Line 1393 compares the retained request text with original.world_activation_request_id::TEXT. Both COMMITTED and ABORTED settlement then fail. The append-only protection remains pending and blocks its source writers.

      Require exact canonical text during acquisition. Apply the correction through a forward migration, preserving V1003 history. Add an acquisition regression for uppercase UUID text.

      Required guard change

      --- "a/services/account-service/src/main/resources/db/migration/V1003__original_start_session_source_protections.sql"
      +++ "b/services/account-service/src/main/resources/db/migration/V1003__original_start_session_source_protections.sql"
      @@ -1160,7 +1160,8 @@
               OR NEW.original_lease_expires_at IS DISTINCT FROM (request_value->>'originalLeaseExpiresAt')::TIMESTAMPTZ
               OR NEW.account_world_participation_id IS DISTINCT FROM (request_value->>'accountWorldParticipationId')::UUID
               OR NEW.account_world_participation_fence IS DISTINCT FROM (request_value->>'accountWorldParticipationFence')::BIGINT
      -        OR NEW.world_activation_request_id IS DISTINCT FROM (request_value->>'worldActivationRequestId')::UUID
      +        OR request_value->>'worldActivationRequestId'
      +            IS DISTINCT FROM NEW.world_activation_request_id::TEXT
               OR NEW.game_session_launch_read_evidence IS DISTINCT FROM launch_bytes
               OR NEW.world_preparing_evidence IS DISTINCT FROM preparing_bytes
               OR NEW.request_binding_digest IS DISTINCT FROM 'sha256:' || encode(sha256(NEW.request_binding_bytes), 'hex')
      
      • Accepted Uppercase UUID text acquires through PostgreSQL cast but cannot match canonical settlement text, stranding writer exclusion. Enforce exact canonical text in the existing insert guard via forward V1004.2 and physical acquisition refusal proof.
  20. CLI Review 13 CompletedRuntime 3m 43s
    Found: 3 Accepted: 0/2/1 Routed: 0
    1. Remove the same-work bug entry for the fresh-bootstrap placeholder.Minor

      This entry records a defect that this PR fixes in dev-tools/verify-fresh-bootstrap.sh at Line 58. Its "Current status" line confirms the fix and the passing checks. The file guideline does not allow ordinary fixes that are completed in the same work. Remove the entry. If a reusable rule remains, state it as a repo rule or a CI guard, for example a validate-only Compose preflight that must run when Compose inputs change.

      As per coding guidelines: "Do not use this file as a bug log for ordinary fixes that were completed in the same piece of work."

      • Accepted Remove this PR’s completed bootstrap bug entry under bounded Overseer stewardship; retain all unrelated observations.
    2. Use a fresh shallow checkout for each event in the fetch loop.Trivial

      The first iteration (pull_request) runs git fetch and stores the parent object in checkout. In the push and workflow_dispatch iterations, git cat-file -e succeeds, so git fetch does not run. Those iterations prove the resolve step only. The fetch path for those events is not tested, although the step description says it is. Clone a new --depth=1 checkout per event and assert the parent is missing before each fetch.

      ♻️ Proposed change

      -    for event_name in ("pull_request", "push", "workflow_dispatch"):
      -        environment.update(FLYWAY_BASE_SHA=parent, FLYWAY_EVENT_NAME=event_name)
      -        fetched = subprocess.run(["bash", "-euo", "pipefail", "-c", fetch_script], cwd=checkout,
      -                                 env=environment, capture_output=True, text=True)
      -        if fetched.returncode or git_at(checkout, "rev-parse", parent + "^{commit}") != parent:
      +    for event_name in ("pull_request", "push", "workflow_dispatch"):
      +        event_checkout = Path(temporary) / f"checkout-{event_name}"
      +        subprocess.run(["git", "clone", "--depth=1", fixture.as_uri(), str(event_checkout)],
      +                       check=True, capture_output=True, text=True)
      +        if subprocess.run(["git", "cat-file", "-e", parent + "^{commit}"], cwd=event_checkout,
      +                          capture_output=True).returncode == 0:
      +            raise SystemExit(f"{event_name} fixture already contained the parent")
      +        environment.update(FLYWAY_BASE_SHA=parent, FLYWAY_EVENT_NAME=event_name)
      +        fetched = subprocess.run(["bash", "-euo", "pipefail", "-c", fetch_script], cwd=event_checkout,
      +                                 env=environment, capture_output=True, text=True)
      +        if fetched.returncode or git_at(event_checkout, "rev-parse", parent + "^{commit}") != parent:
      

      Then also run git fetch with the same parent in checkout before the available check, or point that check at one of the event checkouts.

      • Accepted Use fresh depth-one clone for each actual workflow event fetch; prove missing parent then exact parent availability independently.
    3. Align the AA-1.3 capability row with V1004.1 and V1004.2.Minor

      The tracker subsection at Lines 27-29 records forward V1004.1 and V1004.2 and their proof. The AA-1.3 row names only V1003 and V1004 as implementation anchors. Its gap text says only that V1004 validates COMMITTED lifecycle integrity. Without the later migrations, the scan-first row does not show the monotonic-counter guard or the retained-PREPARING and canonical UUID guards. Add both migration anchors and one short clause to the gap text.

      As per coding guidelines: "Keep its status, implementation record, validation, gaps, decisions, and service-map sections aligned when a domain boundary changes."

      • Accepted Correct exact AA-1.3 migration anchors and passive integrity gap clause; prior narrative-only proof missed this row.
  21. Hosted Review 8 CompletedRuntime 10m 30s
    Found: 1 Accepted: 1/0/0 Routed: 0
    1. Require canonical Base64 for preparingEvidenceBytesBase64 at acquisition. Otherwise a protection that cannot be settled can become pending.Major

      account_ss_activation_insert_guard decodes preparingEvidenceBytesBase64 with decode(..., 'base64') and compares only the decoded bytes (Line 78, Line 91). PostgreSQL's Base64 decoder skips space, tab, CR and LF characters. A request that contains, for example, a trailing \n or a wrapped line in this field therefore passes acquisition. account_ss_activation_assert_current also checks only the decoded bytes, through account_ss_activation_validate_lifecycle(preparing_bytes, 'PREPARING').

      The settlement guard in V1003 (Lines 1394-1395) compares the retained request text exactly:

      protection_request->>'preparingEvidenceBytesBase64' IS DISTINCT FROM
          replace(replace(encode(original.world_preparing_evidence, 'base64'), E'\n', ''), E'\r', '')
      

      protection_request_bytes must equal original.request_binding_bytes (Line 1364), so the settlement producer cannot correct the field. Both COMMITTED and ABORTED settlements then fail. The append-only protection stays pending, and account_ss_admission_assert_no_pending blocks the source-hold, source-change and hosted-terms dispatch writers for its source keys permanently.

      This is the same acquisition/settlement mismatch that V1004.2 fixes for worldActivationRequestId. The other Base64 request fields (originalPostAuthorizationTupleBytesBase64, accountRedemptionProjectionBytesBase64 and gameSessionLaunchReadEvidenceBytesBase64) are compared by decoded value on both sides. Only preparingEvidenceBytesBase64 has this asymmetry. Requiring canonical text for all four fields at acquisition is still the simplest invariant.

      Add the check through a forward migration (for example V1004.3), so that installed history stays unchanged. Add an acquisition regression with a \n-suffixed preparingEvidenceBytesBase64. The regression must assert SQLSTATE 23514, zero protection rows, and that account_control_ui_hold_required_sources still succeeds.

      Proposed guard addition (forward migration)

               OR (request_value->>'worldActivationRequestId') IS DISTINCT FROM NEW.world_activation_request_id::TEXT
      +        OR regexp_replace(encode(preparing_bytes, 'base64'), E'[\n\r]', '', 'g')
      +            IS DISTINCT FROM request_value->>'preparingEvidenceBytesBase64'
      +        OR regexp_replace(encode(tuple_bytes, 'base64'), E'[\n\r]', '', 'g')
      +            IS DISTINCT FROM request_value->>'originalPostAuthorizationTupleBytesBase64'
      +        OR regexp_replace(encode(projection_bytes, 'base64'), E'[\n\r]', '', 'g')
      +            IS DISTINCT FROM request_value->>'accountRedemptionProjectionBytesBase64'
      +        OR regexp_replace(encode(launch_bytes, 'base64'), E'[\n\r]', '', 'g')
      +            IS DISTINCT FROM request_value->>'gameSessionLaunchReadEvidenceBytesBase64'
               OR NEW.game_session_launch_read_evidence IS DISTINCT FROM launch_bytes
      

      This check establishes storage integrity only. It does not authenticate World. The retrieved learning records this proof boundary: "StartSession activation-protection settlement validation establishes storage integrity only."

      • Accepted Acquisition PostgreSQL Base64 decoder accepts whitespace; immutable settlement requires canonical PREPARING text, stranding protection. Add forward guard for all four retained fields and physical rejection/unblocked-source regression.
  22. CLI Review 14 CompletedRuntime 4m 03s
    Found: 2 Accepted: 2/0/0 Routed: 0
    1. Bind typed values in the legacy-guarded INSERT … SELECT statements.Major

      Both repositories now insert through insertInto(...).select(dsl.select(DSL.val(x), ...).where(...)). When a value is null, untyped DSL.val(null) binds with an unspecified type. PostgreSQL then resolves the subquery output as text and rejects the assignment to a non-text column, such as timestamptz. Nullable fields, for example a condition without an expiry, can therefore fail to insert. The previous .set(FIELD, value) form kept the column type.

      • services/entity-management-service/src/main/java/net/firedevops/firemud/entitymanagement/repository/ActorActiveConditionRepository.java#L92-L108: replace each DSL.val(value) with DSL.val(value, ACTOR_ACTIVE_CONDITIONS.<FIELD>), at minimum for EXPIRES_AT, SOURCE_TYPE, SOURCE_ID, and EFFECT_PAYLOAD_JSON.
      • services/entity-management-service/src/main/java/net/firedevops/firemud/entitymanagement/repository/ActorResourceStateRepository.java#L55-L70: replace each DSL.val(value) with DSL.val(value, ACTOR_RESOURCE_STATES.<FIELD>), at minimum for the nullable value and source columns.

      On PostgreSQL, save a new ActorActiveCondition with expiresAt = null and a new ActorResourceState with null optional fields. Confirm that both inserts succeed.

      • Accepted Typed INSERT SELECT values must use column data types; nullable expiry and resource numeric fields otherwise resolve as text in PostgreSQL. Preserve legacy existence guard and prove nullable native readback.
    2. Remove GITHUBEVENTNAME from the unborn-sentinel subprocess environment.Major

      Remove `GITHUB_EVENT_NAME` from the unborn-sentinel subprocess environment.

      The self-test copies os.environ and removes only GITHUB_EVENT_PATH. In a manual CI run, GITHUB_EVENT_NAME is workflow_dispatch. In that case, main() ignores FIREMUD_FLYWAY_BASE_REF and --base-ref, and it calls event_base_ref(None). That call returns None, so main() raises "workflow_dispatch requires a full immutable Flyway base SHA input". The "unborn explicit" assertion then fails.

      As a result, --self-test fails in every workflow_dispatch run that runs it. That is the CI path this change adds. The companion contract test already removes GITHUB_EVENT_NAME (dev-tools/tests/pr-retarget-workflow-contract.sh Line 469).

      🐛 Proposed fix

                   environment = dict(os.environ)
                   environment.pop("GITHUB_EVENT_PATH", None)
      +            environment.pop("GITHUB_EVENT_NAME", None)
                   environment["FIREMUD_FLYWAY_BASE_REF"] = "0" * 40
      

      Confirm that a workflow_dispatch CI job runs check-flyway-versions.py --self-test.

      • Accepted Self-test subprocess inherits workflow_dispatch and rejects unborn base sentinel. Remove only inherited GITHUB_EVENT_NAME alongside existing event path, preserving manual-input requirements.
  23. CLI Review 15 CompletedRuntime 3m 47s
    Found: 1 Accepted: 0/0/1 Routed: 0
    1. Move the V1004.3 proof result into the source-protection tracker.Trivial

      The V1004 paragraph at Line 341 states that current proof and limits belong in the source-protection tracker. The V1004.3 paragraph at Line 347 records an execution result: "The 25-case Account physical PostgreSQL gate passes, including 16 whitespace rejection variants…". The architecture document now holds a validation ledger. That ledger will drift from the tracker, and the tracker already records the same result at player-access-and-session.md Line 31.

      The sentence also has a grammar error: a semicolon is followed by a capitalized "The".

      Replace the proof sentence with a link to the tracker.

      📝 Proposed fix

      -... It changes only the existing acquisition guard and does not backfill rows, authenticate World, or activate the source path; The 25-case Account physical PostgreSQL gate passes, including 16 whitespace rejection variants and unchanged retained rows/history through upgrade; this remains controlled integrity proof.
      +... It changes only the existing acquisition guard and does not backfill rows, authenticate World, or activate the source path. Current proof and limits are recorded in the [source-protection tracker](../../../project-management/implementation-tracking/player-access-and-session.md#original-startsession-source-protection-storage).
      

      As per coding guidelines, "Architecture and design documents own target-state technical contracts. The domain implementation trackers record capability, code, and proof status". Based on learnings, "Record actual execution results in PR/CI evidence and implementation-tracking documents when applicable; do not duplicate a validation ledger inside normative target-state architecture contracts."

      • Accepted V1004.3 runtime paragraph duplicates execution proof already in tracker and has semicolon/capitalization error. Keep local storage consequence; link canonical tracker for proof and limits.
  24. CLI Review 16 CompletedRuntime 9m 12s
    Found: 1 Accepted: 0/0/1 Routed: 0
    1. Remove the unused digestFirstHexDigit parameter from assign.Trivial

      assign accepts digestFirstHexDigit, but its body never reads that parameter. request.mutationIntentDigest() computes the digest from the request alone. Several tests still pass different values for it:

      • sameAssignmentUuidConflictsForChangedAccountScopeOrPayloadWithoutReturningActor passes "b", "c", and "d".
      • distinctConcurrentAssignmentsPersistOneWinnerAndOneReplayableConflict passes "retry".

      A reader can conclude that these digest values cause the conflict or the replay. They do not. The real triggers are the changed account, scope, payload, or catalog revision. The replay assertion at Lines 1378-1386 also passes only because the ignored value has no effect.

      If a future test depends on a changed digest, this helper silently gives no coverage. Remove the parameter and update every caller.

      ♻️ Proposed change

         private PreseededActorAssignmentResult assign(
             UUID operationUuid,
             UUID actorAccountUuid,
             long catalogRevision,
             PlayableStateScope scope,
      -      String displayName,
      -      String digestFirstHexDigit) {
      +      String displayName) {
      

      Then remove the last argument from each assign(...) call.

      • Accepted The helper ignores digestFirstHexDigit; remove that unused parameter and every corresponding call argument, preserving request-derived digest and all scenario assertions.
  25. Hosted Review 9 CompletedRuntime 9m 02s
    Found: 1 Accepted: 1/0/0 Routed: 0
    1. Bind guarded friend insert values to their column types.Major

      The guarded INSERT … SELECT uses untyped DSL.val(...) expressions. Use field-typed binds for the projected values and for the legacyCharacterExists arguments.

      -                          DSL.val(entity.getId().getCharacterId()),
      -                          DSL.val(entity.getId().getFriendId()),
      -                          DSL.val(entity.getTenantId()),
      -                          DSL.val(toLocalDateTime(entity.getCreatedAt())))
      +                          DSL.val(entity.getId().getCharacterId(), CHARACTER_FRIEND.CHARACTER_ID),
      +                          DSL.val(entity.getId().getFriendId(), CHARACTER_FRIEND.FRIEND_ID),
      +                          DSL.val(entity.getTenantId(), CHARACTER_FRIEND.TENANT_ID),
      +                          DSL.val(
      +                              toLocalDateTime(entity.getCreatedAt()), CHARACTER_FRIEND.CREATED_AT))
      
      • Accepted Guarded friend INSERT SELECT binds infer a timestamp without target column type. Bind all projections and endpoint predicates to generated CHARACTER_FRIEND field types; preserve both legacy-identity guards.

Routed Findings

1 Open0 Accepted/Fixed0 Rejected
  1. Route 1 · PR #3189 → Unassigned target Open🚀 Performance & Scalability** | **🔵 Trivial

    Define a retention policy for roster snapshots before roster reads are activated.

    captureCanonicalGameplayRosterSnapshot inserts a new snapshot whenever the snapshot digest changes. The digest covers the account, the complete target and the ordered actors. Each pointerVersion, activeWorldEpoch or gameInstanceUuid change therefore creates a new snapshot row, plus actor rows, for every account that reads its roster. V1008 blocks DELETE and TRUNCATE on both snapshot tables, and the roster actor rows have a foreign key to characters. Nothing can reclaim these rows, so storage grows without bound and an ordinary read path writes to the database.

    Before you register a transport caller, decide the retention class and the disposal path. For example:

    • Allow a fenced, owner-local purge of superseded snapshots after a horizon.
    • Record why indefinite retention is acceptable, and add a growth metric.

    [operational_advice]

    Outcome: Overseer e2af8f49 routes retention to held runtime2967: passive writer is callable but unregistered. Record Entity activation prerequisite for ADR0163 policy and proved owner disposal before any writer registration; preserve deletion guards.

    Earlier routing and proof
    • Target history: Unassigned: Root194ecc31 assigns retention/disposal to future Entity roster transport activation; no concrete activation PR. Entity ADR0163 registration hold stays binding. Keep full source obligation open/unassigned, not fixed; no indefinite-retention decision.

    Earlier decisions

    • Accepted Owned runtime2967 activation prerequisite per Overseer e2af8f49: classify sealed roster family under ADR0163 and prove disposal before registered writer; pending implementation, existing holds/deletion guards preserved.

Unlinked items

no items unlinked