PR #3189 review history
Unit 1A · identity, Account and public JOIN
Review rounds
Three-number pills mean: found (raw) / accepted here (useful) / routed
Recorded review history
Reviews and findings
- CLI Review 1 CompletedRuntime 2m 58sFound: 2 Accepted: 0/0/2 Routed: 0
- Use
TestContainerImagesinstead of hardcoded image tags.TrivialThis class pins
postgres:16-alpineandredis:7.2-alpinedirectly.ContainerInstanceLocationIntegrationTestusesTestContainerImages.postgres()andTestContainerImages.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.
- Use one shared owner-resolved guard and the
ActorIdentityStatusenum instead of copied string literals.TrivialownerResolvedActorExists()andrequireOwnerResolvedActor()are identical to the helpers inActorResourceStateRepository. The same"OWNER_RESOLVED"literal also appears inCharacterRepository,CharacterEquipmentRepository, andCharacterFriendRepository.ActorIdentityRepositoryalready usesActorIdentityStatus.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 correlatedCHARACTER_ID/TENANT_IDfields. 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.
- Hosted Review 1 CompletedRuntime 9m 36sFound: 4 Accepted: 0/3/1 Routed: 0
- 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.
- 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
ContainerInstanceLocationIntegrationTestreplacesScopedCharacterResolverwith a@MockitoBean.RetainedActorIdentityIntegrationTestautowires the realScopedCharacterResolverandInventoryService, 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.
- Use
ActorIdentityStatusinstead 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 inActorActiveConditionRepository,ActorResourceStateRepository,CharacterFriendRepository, andCharacterEquipmentRepository.ActorIdentityRepositoryalready usesActorIdentityStatus.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())inJooqEntityManagementRepositorySupport, 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.
- Return the cleanup hold as
FAILED_PRECONDITION.MinorGrpcAppErrors.internal(...)emits application codeINTERNALfor the cleanup blocker. Use a typed application code such asFAILED_PRECONDITIONforENTITY_UNCLASSIFIED_OR_QUARANTINED_EVIDENCE_BLOCKS_CLEANUP.WorldLifecycleCommandServiceImplalready 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.
- CLI Review 2 CompletedRuntime 3m 20sFound: 2 Accepted: 0/0/0 Routed: 0
- 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, orroom_ground_inventoryrow always getsFAILED_PRECONDITION. Nothing in this PR can clear that state. A nonempty instance therefore cannot reachTERMINATEDuntil owner classification is implemented. Assume the Worldworld-lifecycleTemporal 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 marksENTITY_UNCLASSIFIED_OR_QUARANTINED_EVIDENCE_BLOCKS_CLEANUPas 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.
- Confirm that the plain-SQL cleanup check resolves the same schema as the generated jOOQ tables.Trivial
HAS_UNCLASSIFIED_OR_QUARANTINED_RUNTIME_EVIDENCE_SQLuses unqualified table names (item_instances,characters,item_transfer_audits, and others) throughDSL.sql. The other repositories use generated jOOQ tables. Those tables can carry schema mapping. This query depends only on the connectionsearch_path. AssumeSERVICE_SCHEMAis notpublicand the datasource does not setsearch_path(orcurrentSchema) to that schema. In that case, the query fails or readspublictables. 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_SCHEMAfor every connection. The schema-independent alternative is to express the fiveEXISTSbranches with the generatedITEM_INSTANCES,CONTAINER_INSTANCES,ITEM_STACKS,ROOM_GROUND_INVENTORY,ITEM_TRANSFER_AUDITS, andCHARACTERStables (DSL.exists(...).or(...), thendsl.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.
- CLI Review 3 CompletedRuntime 2m 23sFound: 1 Accepted: 0/0/0 Routed: 0
- 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_PRECONDITIONon 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 reachTERMINATEDuntil 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_CLEANUPas 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.
- Hosted Review 2 CompletedRuntime 10m 07sFound: 13 Accepted: 2/9/1 Routed: 0
- 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.
- 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.
- The writable-hold guard has no effect. Use
Propagation.MANDATORY.MinorThe method is annotated
@Transactionalwith the defaultREQUIREDpropagation. If no outer transaction exists, Spring starts a new writable transaction before the method body runs.isActualTransactionActive()is then always true, andisCurrentTransactionReadOnly()is false. The guard therefore never rejects a call made outside the caller's hold transaction.In that case the
FOR UPDATElocks 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.
- The 256-character limit in
requiredTextrejects valid release bundle refs.MinorrequiredTextrejects any string longer than 256 characters. The parser uses it forpublishedReleaseBundleRef.PreseededActorAssignmentExpectedTargetandPreseededActorAssignmentOwnerEvidenceboth accept refs up toMAX_RELEASE_REF_LENGTH = 1024, and the database column isVARCHAR(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.
- Roster discovery takes exclusive locks that serialize reads across the whole namespace and tenant.Trivial
captureCanonicalGameplayRosterSnapshottakes two exclusive locks before every read:lockCanonicalRosterNamespacetakesFOR UPDATEon the namespace row.requireEntityTenantRowtakesFOR UPDATEon the tenant identity row.
A
SHAREDnamespace 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(orFOR KEY SHAREon the tenant row) does both. Assignment writers still takeFOR UPDATEand 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
requireEntityTenantRowthat usesforKeyShare()instead offorUpdate().Also applies to: 1078-1089
- Accepted Accept if writer conflict preserved: shared roster reader namespace/tenant locks prevent unnecessary reader serialization.
- Raise the activation projection limit to the tuple limit.Minor
account_ss_activation_assert_currentrequiresprojection_bytes = tuple_bytes(Line 1034).original_post_authorization_tupleallows 262144 bytes.account_redemption_projectionallows 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.
- A force-push or a non-ancestor
beforeSHA makes the push run fail.MinorFor push events,
github.event.beforecan name a commit that is no longer reachable after a force-push. If it is unreachable,git rev-parse --verifyinparent_snapshotfails, and the job reports a migration failure even though no migration problem exists. A force-push can also leavebeforeas 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-basewith the default branch. - Skip parent checks when
beforeis not an ancestor ofHEAD. Check withgit 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.
- Use
- 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.
- The assignment intent digest encodes the scope as
PLAYABLE_STATE_SCOPE_SHARED. The documented contract saysSHARED.MajorBoth digest encoders write
playableStateScope().name(). That call returns the full protobuf identifier,PLAYABLE_STATE_SCOPE_SHAREDorPLAYABLE_STATE_SCOPE_ISOLATED.design/architecture/microservices/entity-management-service/api-contracts.mddefines theintent_digestpreimage with the short stringsSHAREDorISOLATED, "not full protobuf enum identifiers."A consumer that follows the document computes a different digest. That consumer then rejects every receipt that
ReadSelectedPreseededAssignmentreturns. The two encoders are also near-duplicates, andPreseededActorAssignmentServicerequires their outputs to be equal. If one changes and the other does not, every assignment fails withPRESEEDED_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.
- Add the V1003 anchors to the
AA-1.3Capability Status row.MinorThis subsection assigns the V1003 storage to
AA-1.3. TheAA-1.3row at Line 153 has not changed. Its implementation anchors do not includeV1003__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 Statusrow 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.
- 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 usesaccount_publication_authorization_source_sort_key(source.source_key). For multiple sources, these orders can differ. The resulting mismatch can reject a canonically orderedsourceEvidenceVectorand 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.
- 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 disablesaccount_ss_activation_insert_guard,account_ss_activation_source_insert_guard, and the deferredaccount_ss_activation_complete_guard. No test runs the insert guard's capture/target checks or therequire_complete = TRUEbranch on a valid row. With this suite's own data, the insert guard would fail, becausepreAuthorizationReservationTupleis{}. 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 apreAuthorizationReservationTuple.scopewith a matchingtargetNamespaceandtenantId.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-L341design/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.
- 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_bytesup to 262144 bytes.request_binding_bytesup to 1048576 bytes.
account_ss_admission_assert_currentadds no tighter limit. The settlement guard rejects these values:world_admission_hold_identity_bytesabove 65536 (Line 504).request_binding_bytesabove 786432 (Line 503).canonical_snapshot_bytesabove 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 tableCHECKs or inaccount_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_completebranch ofaccount_ss_admission_assert_current.- Accepted Accept: acquisition must enforce settlement bounds and canonical source evidence; append-only unsettled protections otherwise permanently block writers.
- CLI Review 4 CompletedRuntime 3m 54sFound: 4 Accepted: 0/4/0 Routed: 0
- Treat an all-zero push
beforeSHA as "no parent" on every input path.MinorThe CI step exports
github.event.beforeasFIREMUD_FLYWAY_BASE_REF. The checker accepts that explicit value as its base ref and never applies the all-zero handling inevent_base_ref. A new-branch push therefore passes0000…0000togit rev-parse, raisesValueError, and fails the Flyway job.dev-tools/validation/check-flyway-versions.py#L285-L288: map an explicit"0" * 40base ref toNonebefore you fall back to event metadata and callparent_snapshot..github/workflows/ci.yml#L578-L579: export an empty value instead of the all-zerogithub.event.beforeSHA.
- Accepted Accept: normalize the all-zero unborn push SHA on CLI and environment paths; keep nonzero immutable parent history comparison.
- 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 buildsexpected_source_vectorwithORDER BY source.source_keyinstead. Plain text ordering depends on the database default collation, for exampleCoren_US.UTF-8. It can also differ from the canonical order that the producer uses.jsonbarray 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, andaccount_ss_admission_assert_no_pendingblocks 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
sourceEvidenceVectorby 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.
- Use
Propagation.MANDATORYso that the writable-hold guard can fail.Minor@Transactionaluses the default propagation,REQUIRED. The Spring proxy therefore opens a new transaction before the method body runs. As a result,isActualTransactionActive()is alwaystrue, and the "requires the writable hold transaction" check never rejects a caller that has no transaction.In that case, the
FOR UPDATElocks 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 withIllegalTransactionStateException. A read-only caller still fails on the existingisCurrentTransactionReadOnly()check.- Accepted Accept: require an existing writable outer transaction through Spring MANDATORY; otherwise locks are released before the applicability hold.
- 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 configwith 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.
- CLI Review 5 CompletedRuntime 3m 34sFound: 3 Accepted: 0/1/0 Routed: 0
- Do not pass an unreachable
github.event.beforecommit to the Flyway checker after a force push.MinorOn a
pushevent,FIREMUD_FLYWAY_BASE_REFreceivesgithub.event.before. After a force push,beforeis the previous branch tip. That commit is no longer reachable from any ref, sofetch-depth: 0does not fetch it.parent_snapshotthen runsgit rev-parse --verify <sha>^{commit}, raisesValueError, andcheckFlywayVersionsfails. 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
pushfor 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.
- 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.shLine 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.
- Confirm that the selected-assignment read is limited to shared scope.Minor
requireSupportedTargetrejects everyPLAYABLE_STATE_SCOPE_ISOLATEDtarget withUnsupportedOperationException.CanonicalGameplayRosterServiceaccepts isolated targets, soListPreseededRostercan return an isolated snapshot. The follow-upReadSelectedPreseededAssignmentfor that same snapshot is then always denied.design/architecture/microservices/entity-management-service/api-contracts.mdLine 11 describes both methods without a scope limit. It also says that contextplayable_state_scopeisSHAREDorISOLATED. 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.
- If the limit is intended, document it in the Implementation Status of
- CLI Review 6 CompletedRuntime 4m 09sFound: 3 Accepted: 1/1/0 Routed: 0
- Do not write the Entity-local
entitytenantrowidinto the legacycharacters.tenantidcolumn.MajorDo not write the Entity-local `entity_tenant_row_id` into the legacy `characters.tenant_id` column.
insertOwnerResolvedCharactersetsCHARACTERS.TENANT_IDtoentityTenantRowId. That value comes from the newentity_tenant_identitiesBIGSERIAL, which starts at 1. Legacy rows and legacy consumers usecharacters.tenant_idas 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:findByIdAndTenantIdcountByTenantId- 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_RESOLVEDrows from legacy readers. - Allocate
entity_tenant_row_idfrom a range that is disjoint from legacy tenant IDs.
Confirm whether
entity_tenant_row_idis meant to share the legacytenant_idnumbering space. Also confirm whether any reachable legacy handler resolves characters by(id, tenantId)without aplayable_state_keypredicate.- 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.
- Update the GR-3.1 verification counts to match the latest proof record.Minor
The GR-3.1
Verificationcell 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.
- Do not use
github.event.beforeas the parent after a force-push.MinorAfter a force-push,
github.event.beforenames the replaced commit. That commit is usually unreachable from any fetched ref, sofetch-depth: 0does not fetch it.parent_snapshotthen runsgit rev-parse --verify <sha>^{commit}, which fails. The checker raisesValueErrorand 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.
- Hosted Review 3 CompletedRuntime 11m 31sFound: 7 Accepted: 1/4/1 Routed: 1
- Keep the canonical roster assignment identifier consistent with its writer.Minor
CanonicalGameplayRosterSelectedAssignmentServicepassestarget.gameInstanceUuid().toString(), while the assignment models accept any bounded opaquegameInstanceId. 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.
- Removed shared Saga migrations are reported once, but removed adopter histories are not checked per project.Minor
This loop reads
parent_migrationsfrom the raw file list. A parent adopter can stop adopting Saga, for example because its dependency or itsdb/migrationlocation 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.
- Apply the settlement's hold-canonicality checks at acquisition. Otherwise an accepted admission protection can stay pending forever.Major
account_ss_admission_assert_currentchecks only part of the World hold identity. The settlement guard (account_ss_admission_settlement_insert_guard) also rejects the following, for every outcome:holdIdorholdFencetext 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
schemaandrequest. The guard also requires exactly 14requestkeys 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 bothaccount_ss_admission_assert_currentand the settlement guard. Consider also validating theinitialAdmissionOrigin/expectedPriorPointerVersionprecondition (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.
- 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→ pointer1) settlement. Build each from the fixture hold and a framed owner proof. Then assert thataccount_control_ui_hold_required_sourcessucceeds 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.
- 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.
- 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
ActorIdentityRepositoryandCharacterRepositoryhave the@Repositoryannotation, so Spring registers them as beans.RetainedActorIdentityIntegrationTestandPreseededActorAssignmentIntegrationTestautowire 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.
- 🚀 Performance & Scalability | 🔵 Trivial
Define a retention policy for roster snapshots before roster reads are activated.
captureCanonicalGameplayRosterSnapshotinserts a new snapshot whenever the snapshot digest changes. The digest covers the account, the complete target and the ordered actors. EachpointerVersion,activeWorldEpochorgameInstanceUuidchange therefore creates a new snapshot row, plus actor rows, for every account that reads its roster. V1008 blocksDELETEandTRUNCATEon both snapshot tables, and the roster actor rows have a foreign key tocharacters. 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
- CLI Review 7 CompletedRuntime 3m 41sFound: 2 Accepted: 0/2/0 Routed: 0
- Exclude rows that carry canonical owner provenance from
legacyCharacterRow(), whatever their status.MinorlegacyCharacterRow()checks onlyactor_identity_status <> 'OWNER_RESOLVED'. A canonical actor carries canonical provenance (non-nulltenant_uuid). Once such a row isQUARANTINED, 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, anddeleteExpired.insertOwnerResolvedCharacterwrites values that make this exposure harmful:tenant_idisentity_tenant_row_id, aBIGSERIALthat can equal an unrelated real legacy numeric tenant ID.account_idis the real Account row ID.playable_state_keyis 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_RESOLVEDduplicates toQUARANTINEDwith reasonAMBIGUOUS_ACCOUNT_NAMESPACE. Those rows keep theirtenant_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-nulltenant_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.
- 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_REFtogithub.event.before. On a force-push,beforenames the commit the branch pointed to before the rewrite. After the rewrite, no ref points to that commit.actions/checkoutwithfetch-depth: 0fetches commits that refs point to, so it will usually not fetch it.parent_snapshotthen runsgit rev-parse --verify <sha>^{commit}, which raisesValueError.mainreports 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
beforefield, such asmerge_groupandworkflow_dispatch. In those runs the expression yields an empty string, andevent_base_refreturnsNone. The checker then runs only the duplicate check, with no parent comparison.Pick one fallback for each case:
- When
beforeis 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, passgithub.event.merge_group.base_sha.
Confirm which branches the
pushtrigger 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 genericValueErrorhandler 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.
- When
- Hosted Review 4 CompletedRuntime 9m 04sFound: 1 Accepted: 0/1/0 Routed: 0
- Validate lifecycle evidence before releasing source writers.Minor
account_ss_activation_settlement_insert_guardchecks thatlifecycleEvidenceBytesBase64is present, but it does not decode or validate it. ACOMMITTEDsettlement 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,ACTIVEstatus, and the retained PREPARING request binding. Validate the complete closed shape defined byWorldCanonicalInstanceLifecycleEvidence.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.
- CLI Review 8 CompletedRuntime 4m 48sFound: 1 Accepted: 0/0/0 Routed: 0
- Fetch the push-event parent commit before the Flyway check.Minor
The fetch step runs only for
workflow_dispatch. For push events, line 602 passesgithub.event.beforeas the base SHA. Thefetch-depth: 0checkout fetches only commits that a branch or tag can reach. A force-push tomainordevelopmakes the old commit unreachable from every branch. In that caseparent_snapshotraises "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.
- CLI Review 9 CompletedRuntime 3m 29sFound: 5 Accepted: 0/2/2 Routed: 0
- Compare against the parent's effective history, not the raw parent snapshot.Minor
The frontier check runs only when
item.path not in parent. Existingcommon-sagafiles 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-sagathrough 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
V2000and no Saga wiring. The current snapshot adds the Saga dependency and location. The expected result is a failure that namesfrontier V2000.- Accepted Raw parent includes unloaded Saga files; compare parent effective paths and add below-frontier regression.
- 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.
- 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: "
implementedandpartialrows 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.
- Test the two-root rejection before the certificate is made invalid.Trivial
Line 201 stubs
trustedRoot.checkValidity()to throwCertificateExpiredException. The assertion at Lines 207-211 then runs withList.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 infingerprintValidatedTrustRoothas no independent test. If someone removes the cardinality check, this test still passes.Move the two-root assertion above the
doThrowstub. 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.
- 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 withtarget("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 inflyway_schema_history, or upgrade withtarget("1004"). Do not comparemax(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.
- Hosted Review 5 CompletedRuntime 8m 58sFound: 3 Accepted: 1/2/0 Routed: 0
- Exclude canonical rows from the quarantined tenant count.Minor
countQuarantinedByTenantIdmust apply the canonical-provenance exclusion used by other numeric tenant predicates. A quarantined canonical actor can retain the queriedTENANT_ID, so the current query counts it. AddTENANT_UUID IS NULLand update the test expectation to2.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.
- Validate the retained lifecycle before acquiring the protection.Major
account_ss_activation_insert_guardcallsaccount_ss_activation_assert_current(..., FALSE), but that function checks only selectedPREPARINGfields. Itsrequire_completebranch checks source children, not lifecycle completeness. The acquisition boundary can therefore retain evidence with extra request keys,publicProduction = false,ISOLATEDscope, or an empty region map.The
COMMITTEDguard rejects those shapes. The protection then cannot settle asCOMMITTED, andaccount_ss_admission_assert_no_pendingkeeps 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 retainedPREPARINGevidence during acquisition and for theACTIVEevidence during settlement. If non-public orISOLATEDactivations 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.
- Add V1004 to the
AA-1.3Capability Status row.MinorThe subsection at Lines 15 and 21 assigns forward V1004 lifecycle integrity to
AA-1.3. The row anchors onlyV1003__original_start_session_source_protections.sql. The row omitsV1004__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.
- CLI Review 10 CompletedRuntime 4m 07sFound: 2 Accepted: 0/0/1 Routed: 0
- 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 duplicatecharacter_uuidinsert therefore does not prove thatux_characters_character_uuidrejects the row. The secondinsertNamespacecall also does not prove that the namespace primary key rejects a scope change.Assert
DuplicateKeyException, which Spring translates from SQLSTATE23505. 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.
- 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
NAMESPACEand the servicegame-session-servicebut 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.
- CLI Review 11 CompletedRuntime 4m 29sFound: 4 Accepted: 0/2/2 Routed: 0
- 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-treeandgit show.fetch-depth: 0clones 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
mainordevelop,github.event.beforeis 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 indev-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.
- Check that the ACTIVE
lifecycleEpochdoes not go backwards from the retained PREPARING evidence.MinorThe guard removes
lifecycleEpochandrowVersionbefore it compares the two lifecycle documents. No other check covers these counters. A COMMITTED settlement can therefore bind ACTIVE evidence whoselifecycleEpochis 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 torowVersiononly 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.
- 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.
- Put the legacy-character
EXISTSpredicate in one place.TrivialThree repositories each define the same private
legacyCharacter(Field<Long>)helper aroundCharacterRepository.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 staticlegacyCharacterExists(Field<Long> characterId)next tolegacyCharacterRow().services/entity-management-service/src/main/java/net/firedevops/firemud/entitymanagement/repository/ActorActiveConditionRepository.java#L150-L155: remove the local helper and callCharacterRepository.legacyCharacterExists.services/entity-management-service/src/main/java/net/firedevops/firemud/entitymanagement/repository/ActorResourceStateRepository.java#L102-L107: remove the local helper and callCharacterRepository.legacyCharacterExists.services/entity-management-service/src/main/java/net/firedevops/firemud/entitymanagement/repository/CharacterFriendRepository.java#L104-L109: remove the local helper and callCharacterRepository.legacyCharacterExistsfromlegacyFriendEndpoints()andsave.
♻️ 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.
- Hosted Review 6 CompletedRuntime 8m 04sFound: 1 Accepted: 0/0/1 Routed: 0
- Handle a non-dict
pull_request.basevalue and prefer explicit dispatch handling.Trivialpull_request.get("base", {})raisesAttributeErrorwhenbaseisnull.maincatches onlyValueError,OSError, andTypeError. In that case the script exits with a traceback instead of the normal failure message. GitHub always sends abaseobject, so this mainly affects the robustness of the error path. The fix is small: readbaseonce and check it withisinstance.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.
- CLI Review 12 CompletedRuntime 3m 22sFound: 3 Accepted: 0/2/1 Routed: 0
- Validate the retained PREPARING evidence before you compare its counters.Minor
The guard parses
original.world_preparing_evidenceas raw JSONB. Only the V1004 acquisition path runsaccount_ss_activation_validate_lifecycleon 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 nolifecycleEpochorrowVersionkey:(preparing->>'lifecycleEpoch')::NUMERICis 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.
- Add the V1004.1 anchor and qualification to the
AA-1.3row.MinorThe 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
lifecycleEpochandrowVersion. 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 "
implementedandpartialrows 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.
- Add the changed-snapshot case that the test name claims.Trivial
The method name
changedSnapshotOrActorAbsentFromItFailsBeforeReceiptReadnames two failure paths. The body covers only one: the actor is absent from a snapshot that matches the request. No case returns a snapshot whosesnapshotUuidorsnapshotDigestdiffers fromrequest.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
readCurrentCanonicalGameplayRosterSnapshotreturns a snapshot with a different digest that still contains the selected actor. Assert that the read fails and thatreadSelectedPreseededActorAssignmentReceiptis 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.
- Hosted Review 7 CompletedRuntime 14m 57sFound: 2 Accepted: 2/0/0 Routed: 0
- 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 withoutrowVersion. The forward migrations preserve those rows.For that retained shape,
preparing->>'rowVersion'returns NULL. The comparison returns NULL, and theIFdoes 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.
- 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.
- CLI Review 13 CompletedRuntime 3m 43sFound: 3 Accepted: 0/2/1 Routed: 0
- 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.shat 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.
- Use a fresh shallow checkout for each event in the fetch loop.Trivial
The first iteration (
pull_request) runsgit fetchand stores the parent object incheckout. In thepushandworkflow_dispatchiterations,git cat-file -esucceeds, sogit fetchdoes 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=1checkout 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 fetchwith the same parent incheckoutbefore theavailablecheck, 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.
- Align the
AA-1.3capability row with V1004.1 and V1004.2.MinorThe tracker subsection at Lines 27-29 records forward V1004.1 and V1004.2 and their proof. The
AA-1.3row 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.
- Hosted Review 8 CompletedRuntime 10m 30sFound: 1 Accepted: 1/0/0 Routed: 0
- Require canonical Base64 for
preparingEvidenceBytesBase64at acquisition. Otherwise a protection that cannot be settled can become pending.Majoraccount_ss_activation_insert_guarddecodespreparingEvidenceBytesBase64withdecode(..., '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\nor a wrapped line in this field therefore passes acquisition.account_ss_activation_assert_currentalso checks only the decoded bytes, throughaccount_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_bytesmust equaloriginal.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, andaccount_ss_admission_assert_no_pendingblocks 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,accountRedemptionProjectionBytesBase64andgameSessionLaunchReadEvidenceBytesBase64) are compared by decoded value on both sides. OnlypreparingEvidenceBytesBase64has 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-suffixedpreparingEvidenceBytesBase64. The regression must assert SQLSTATE23514, zero protection rows, and thataccount_control_ui_hold_required_sourcesstill 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_bytesThis 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.
- CLI Review 14 CompletedRuntime 4m 03sFound: 2 Accepted: 2/0/0 Routed: 0
- Bind typed values in the legacy-guarded
INSERT … SELECTstatements.MajorBoth repositories now insert through
insertInto(...).select(dsl.select(DSL.val(x), ...).where(...)). When a value is null, untypedDSL.val(null)binds with an unspecified type. PostgreSQL then resolves the subquery output astextand rejects the assignment to a non-text column, such astimestamptz. 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 eachDSL.val(value)withDSL.val(value, ACTOR_ACTIVE_CONDITIONS.<FIELD>), at minimum forEXPIRES_AT,SOURCE_TYPE,SOURCE_ID, andEFFECT_PAYLOAD_JSON.services/entity-management-service/src/main/java/net/firedevops/firemud/entitymanagement/repository/ActorResourceStateRepository.java#L55-L70: replace eachDSL.val(value)withDSL.val(value, ACTOR_RESOURCE_STATES.<FIELD>), at minimum for the nullable value and source columns.
On PostgreSQL, save a new
ActorActiveConditionwithexpiresAt = nulland a newActorResourceStatewith 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.
- Remove
GITHUBEVENTNAMEfrom the unborn-sentinel subprocess environment.MajorRemove `GITHUB_EVENT_NAME` from the unborn-sentinel subprocess environment.
The self-test copies
os.environand removes onlyGITHUB_EVENT_PATH. In a manual CI run,GITHUB_EVENT_NAMEisworkflow_dispatch. In that case,main()ignoresFIREMUD_FLYWAY_BASE_REFand--base-ref, and it callsevent_base_ref(None). That call returnsNone, somain()raises "workflow_dispatch requires a full immutable Flyway base SHA input". The "unborn explicit" assertion then fails.As a result,
--self-testfails in everyworkflow_dispatchrun that runs it. That is the CI path this change adds. The companion contract test already removesGITHUB_EVENT_NAME(dev-tools/tests/pr-retarget-workflow-contract.shLine 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" * 40Confirm that a
workflow_dispatchCI job runscheck-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.
- CLI Review 15 CompletedRuntime 3m 47sFound: 1 Accepted: 0/0/1 Routed: 0
- 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.mdLine 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.
- CLI Review 16 CompletedRuntime 9m 12sFound: 1 Accepted: 0/0/1 Routed: 0
- Remove the unused
digestFirstHexDigitparameter fromassign.TrivialassignacceptsdigestFirstHexDigit, but its body never reads that parameter.request.mutationIntentDigest()computes the digest from the request alone. Several tests still pass different values for it:sameAssignmentUuidConflictsForChangedAccountScopeOrPayloadWithoutReturningActorpasses"b","c", and"d".distinctConcurrentAssignmentsPersistOneWinnerAndOneReplayableConflictpasses"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.
- Hosted Review 9 CompletedRuntime 9m 02sFound: 1 Accepted: 1/0/0 Routed: 0
- Bind guarded friend insert values to their column types.Major
The guarded
INSERT … SELECTuses untypedDSL.val(...)expressions. Use field-typed binds for the projected values and for thelegacyCharacterExistsarguments.- 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
Route 1 · PR #3189 → Unassigned target Open🚀 Performance & Scalability** | **🔵 Trivial
Define a retention policy for roster snapshots before roster reads are activated.
captureCanonicalGameplayRosterSnapshotinserts a new snapshot whenever the snapshot digest changes. The digest covers the account, the complete target and the ordered actors. EachpointerVersion,activeWorldEpochorgameInstanceUuidchange therefore creates a new snapshot row, plus actor rows, for every account that reads its roster. V1008 blocksDELETEandTRUNCATEon both snapshot tables, and the roster actor rows have a foreign key tocharacters. 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