PR #3010 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 6m 56sFound: 7 Accepted: 1/2/2 Routed: 0
- Minor
Update the issuer-row reads in readCompositeSnapshot and initializeIssuerIfAbsentForSourceEvidence to use a shared lock instead of an exclusive lock. Keep exclusive locking for ScopeKind.ISSUER only in advanceInternal.
- Accepted Implement in #3010: shared issuer read locks for stable source enrollment/composite reads; preserve exclusive issuer mutation and same-transaction source/currentness fencing with focused locking proof.
- Minor
Update POSITIVE_DECIMAL_PATTERN and the isPositiveDecimal validation in MembershipAuthorityEventV1Codec so positive decimal values are rejected when they exceed Long.MAX_VALUE, matching the range check used by AccountAuthoritySourceEventV1Codec.
- Rejected Membership wire counters are arbitrary-precision canonical decimal strings (Session Behavior/ADR0022). Owner BIGINT range checks must not narrow the shared wire codec; the distinct transitional Account source codec is not its range authority.
- Trivial
Update rejectsZeroLeadingNegativeAndOutOfRangeCounters to assert that each invalid counter error contains the positive canonical decimal string message, so the test specifically verifies counter-format and range rejection rather than the baseline-successor check.
- Accepted Implement in #3010: assert the owner-range canonical-counter error in the invalid Account source counter vector so another guard cannot satisfy this regression accidentally.
- Major
Update the AccountRepository.save flow and sourceEvidence.recordAccountUpdate handling so security-relevant updates work for retained Accounts without V40 baseline rows, without claiming a sequence-zero fresh baseline; preserve fresh-account validation. Document the retained-account behavior and add a PostgreSQL test that resets the password of a V29-provenance Account.
- Rejected V40/approved forward-only source policy does not adopt retained Account authority from V29 UUID provenance. Missing source history must deny/rollback security mutations, not fabricate a baseline/event. Fresh Accounts remain supported; retained recovery needs separate positive owner proof.
- Minor
Update the Capability Status rows for AA-1.2 and AA-1.3 to name the retained production anchors and focused tests: include AccountCanonicalFirstJoinTerminalCoordinator, AccountMembershipAuthorityEventProducer, AccountAuthoritySourceEvidenceRepository, V30–V40, AccountAuthoritySourceEvidencePersistenceIntegrationTest, and AccountCanonicalFirstJoinTerminalCoordinatorTest where applicable. Keep the existing capability status values unchanged.
- Accepted Implement in #3010: update AA-1.2/AA-1.3 anchor/proof references to retained first-JOIN/source/coordinator paths; keep capability status unchanged and avoid target-contract duplication.
- Major
Update the first-membership flow around requireGenesisAuthority and requireFreshIssuerAccountBaselines to allow current issuer, Account, tenant, and fence generations instead of requiring generation 1 or a sequence-0 checkpoint; remove requireNoPriorTenantHistory. Keep the pair and membership-stream absence checks, embed current generations in the event, and ensure the committed-replay branch compares only the stored event with the stored pair.
- Accepted Fix #3010: first membership is pair-local genesis, not issuer/Account/tenant genesis. Require verified current source generations/fence; preserve absent membership stream and exact stored pair/event replay without comparing old events to later global authority.
- Trivial
Remove the duplicate AccountRepositoryHardDeleteTest class because AccountRepositoryTest.hardDeletionFailsClosedWithoutSqlOrSourceEvidenceMutation already covers the same exception and message with additional sourceEvidence verification.
- Accepted Implement in #3010: remove exact duplicate hard-delete test; AccountRepositoryTest already proves the same exception/message plus no SQL and no source-evidence mutation.
- Hosted Review 1 CompletedRuntime 10m 47sFound: 11 Accepted: 9 Routed: 0
- CodeRabbit summary-only outside-diff finding 1 of 1 (aggregate; no individual detail)
summary-only aggregate; provider supplied no individual detail
- Accepted Correct stale Active Gaps hard-delete claim: AccountRepository denies hard deletion; complete retained-data lifecycle remains unimplemented.
- Lock the shared issuer row
FOR SHAREon read-only snapshot paths.MinorreadScopeState(issuerScope, true)appendsFOR UPDATEto the singlefiremud-account-serviceissuer generation row. Every caller then takes an exclusive lock on that row until commit:readCurrentIssuerAccountSources, throughreadCompositeSnapshot.initializeIssuerIfAbsent, which every fresh Account insert reaches throughinitializeFreshAccount.
As a result, all registrations and all first-JOIN snapshot reads across all Accounts run one at a time on one row lock.
The snapshot does not need an exclusive lock for this row.
advanceInternalalready usesupdateGeneration, which compares expected generation values. AFOR SHARElock also blocks a concurrent issuer advance, so the snapshot stays consistent. KeepFOR UPDATEonly for the path that advances the issuer row.♻️ Proposed direction
- ScopeState issuer = readScopeState(issuerScope, true); + ScopeState issuer = readScopeState(issuerScope, LockMode.SHARE);Add a lock-mode parameter to
readScopeState, withSHAREemittingFOR SHARE. UseSHAREfor the issuer inreadCompositeSnapshotand in theinitializeIssuerIfAbsentForSourceEvidencereadback.- Accepted Shared issuer FOR SHARE is implemented locally for accepted CLI finding5; same regression remains pending real PostgreSQL validation and publication.
- Do not re-verify the full event history on every source read.Trivial
readCurrentSourcecallsverifyEventHistory. That method loads and codec-verifies events1..sequence: onefindEventquery, RFC 8785 canonicalization, and SHA-256 per event.recordAccountUpdatecallsreadCurrentSourcetwice per security update.readCurrentIssuerAccountSourcescalls it for both the issuer stream and the Account stream on every first-JOIN snapshot. The cost per call therefore grows linearly with the lifetime of each stream.The V40 update trigger already checks each head advance against its exact outbox event. The trigger also keeps the event count equal to
last_outbox_sequence. Verify only the head event,sequence, against the source record andauthority. Keep the full-history walk for an explicit audit or repair operation.- Rejected Head-only verification loses canonical digest/closed-shape proof for historical events. V40 SQL guards do not recompute those digests and there is no certified history chain; retain full verification.
- This test duplicates
AccountAuthorityCurrentnessIntegrationTest.TrivialpersistedTenantAuthorityGenerationChangesOnEverySubscriptionMutationrepeats the subscription half of the new currentness test. It uses the same tenant ID and the same assertions. Keep one copy to reduce maintenance.- Accepted Remove duplicate subscription-only integration method; retain stronger AccountAuthorityCurrentnessIntegrationTest covering both subscription and grant mutations.
- The v2 delete guard breaks the existing expired connect-scope cleanup for all rows.Major
AccountConnectScopeRepository.DELETE_EXPIRED_UNREFERENCED_SQL(lines 41-61, unchanged) selects every expired scope that no JOIN operation references. It does not filter onscope_digest_version. The guard on lines 81-87 raises an exception when a v2 row is deleted. That exception aborts the wholeDELETEstatement.A v2 scope that was issued but never used for JOIN is a normal state. It expires with no referencing operation. From then on, every
deleteExpiredUnreferencedcall fails. The v2 row is never removed, so the failure repeats on every run. Expired v1 scopes in the same batch are also never deleted.Add
AND candidate.scope_digest_version = 1to the cleanup query. As an alternative, define retention for unreferenced v2 scopes and let the trigger allow that deletion.-- AccountConnectScopeRepository.DELETE_EXPIRED_UNREFERENCED_SQL AND candidate.scope_digest_version = 1 AND NOT EXISTS ( ... )- Accepted Cleanup must exclude immutable V2 scopes before batching; mixed-version PostgreSQL regression will prove V1 cleanup succeeds and V2 evidence is retained.
- Restore a production trigger for
deliverPending().Major@Scheduledwas removed, and no production caller fordeliverPending()exists in the repository. Without a trigger, pending Account audit envelopes can remain undelivered. Restore the fixed-delay schedule. If v2 envelopes must wait, keep the schedule and skip only rows wheretenantIdentityVersion() == 2.import org.slf4j.LoggerFactory; +import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; @@ + @Scheduled(fixedDelayString = "${firemud.account.audit-delivery-delay-ms:5000}") public void deliverPending() {- Accepted Restore scheduled delivery only for supported legacy V1 selected before SQL batching. V2 remains fail-closed and retained until canonical receiving proof; preserve delivery retries and receipts.
- Retain approval payloads required by canonical scopes.Major
deleteExpiredApprovalPayloadsdeletes payloads after 30 days, even when the retained association remains.verifyTenantIdentityreadsmanifest_digestfrom that payload for every canonical V2 readback and insert. After cleanup, the query returnsnull, so the digest check throws.The V35 and V37 triggers also require the payload for approved-retained provenance. Update cleanup to retain payloads referenced by canonical scope or membership rows, or persist and use a durable digest copy in every validator and trigger.
- Accepted Age-only payload cleanup destroys referenced canonical tenant proof. Retain referenced association approval payloads and prove readback survives expiry.
findCanonicalEvidenceByRequestIdfails inside the read-only transactions its guard accepts.MinorLine 204 accepts any active transaction. The read path then calls
connectScopes.findCanonicalEvidenceByTokenHash, which callsrequireWritableOwnerTransaction(). That call throws inside a read-only transaction. The same path also runsSELECT ... FROM accounts ... FOR UPDATE, which PostgreSQL rejects in aREAD ONLYtransaction.AccountConnectScopeRepository.findCanonicalhas the same mismatch, because it callsverifyAccountIdentityand takes the same lock.Do one of these:
- Require a writable transaction on both methods.
- Add a lock-free identity check for the read path.
♻️ Proposed fix (align the guard with actual behavior)
public Optional<CanonicalJoinOperationEvidence> findCanonicalEvidenceByRequestId( String requestId) { - requireOwnerTransaction(); + requireWritableOwnerTransaction();- Accepted Canonical readbacks acquire row locks and must reject read-only owner transactions before SQL, not merely check transaction activity.
- The grant
saveupdate has no optimistic-concurrency guard.MinorSubscriptionRepository.savematches on version and generation. This update matches only onID.Example: a concurrent revoke and regrant on the same grant.
grantRealmAccessreads a granted row.- A revoke commits. The trigger advances the version and generation.
- The regrant
saveoverwrites the row withGRANTED=trueand no stale-write error.
The result is acceptable for a regrant. A stale
savethat carriesgranted=falsecan still silently override a newer grant.Add
GRANT_AUTHORITY_GENERATION.eq(entity.getGrantAuthorityGeneration())to the WHERE clause when the generation is non-null. This matches the subscription path.- Accepted Existing realm-grant save must compare its observed authority generation; missing or stale generation must not overwrite a newer grant.
- Preserve security updates for retained Accounts.Major
For a security-field change,
AccountRepository.savecallsrecordAccountUpdate. That method requiresACCOUNT_REPOSITORY_INSERTidentity and an existing source baseline before it can append an event. V40 does not backfill retained source baselines, and the source-evidence repository does not enroll existing Accounts. Therefore, security updates for retained pre-V40 Accounts can fail. The deferred trigger also rejects a changed row without an appended source event.Add an owner-verified retained-Account enrollment path with a distinct provenance kind, generation, fence, and source baseline. Update the V40 identity and trigger constraints to accept that provenance. Otherwise, document and enforce a verified deployment boundary with no retained Accounts. Record this consequence in the AA-1.3 tracker.
- Rejected Automatic baseline adoption of retained Accounts is unsupported. Owner source provenance is forward-only, retained rows are not backfilled; existing explicit limitation must not be replaced by fabricated enrollment or an unproved empty-data claim.
- Scope genesis checks to the pending branch.Major
requireGenesisAuthority,requireFreshIssuerAccountBaselines, andrequireNoPriorTenantHistoryrun beforeisPendingBaseline(pair). An exact committed replay therefore requires generation-one authority and fresh source baselines again. Later Account authority changes can makeCOMMITTEDretries throw instead of returning the stored checkpoint.The replay helper already validates the stored event's initial authority tuple and accepts a committed issuance fence that is less than or equal to the current fence.
🐛 Proposed fix
- requireGenesisAuthority(authority, accountUuid, tenantUuid, membership); - requireFreshIssuerAccountBaselines(sourceSnapshot, accountUuid); - requireNoPriorTenantHistory(tenantUuid); - String streamKey = membershipStreamKey(accountUuid, tenantUuid); if (isPendingBaseline(pair)) { + requireGenesisAuthority(authority, accountUuid, tenantUuid, membership); + requireFreshIssuerAccountBaselines(sourceSnapshot, accountUuid); + requireNoPriorTenantHistory(tenantUuid); if (authorityOutboxRepository.readCheckpoint(streamKey).isPresent()) {- Accepted Already implemented locally by accepted CLI6: pair-local genesis only on initial commit, exact committed retry retains its stored evidence without requiring unrelated global generation1.
- CLI Review 2 CompletedRuntime 3m 48sFound: 4 Accepted: 0/1/3 Routed: 0
- Minor
Update AccountServiceImpl.deleteAccount to return the typed ACCOUNT_DELETE_UNAVAILABLE lifecycle outcome before running any child deletes, including grant deletion; remove the late untyped failure reached through AccountRepository.delete.
- Accepted Accepted: hard deletion is deliberately unavailable; typed service rejection must occur before child mutations and retained-grant deletion. Preserve existing JOIN/billing preconditions and require no child write proof. Pending implementation.
- Trivial
Update the architecture status statement to remove run-specific test counts and validation results, while retaining that reconciled V40/source-currentness/coordinator proof is pending and not established by inherited evidence. Refer readers to the Player Access and Session tracker for inherited storage-stage evidence.
- Accepted Accepted: target-state architecture status should link tracker evidence rather than embed stale per-run counts; retain honest nonactivation and proof boundary. Pending documentation correction.
- Trivial
Update insertExpiredClaimAndPayload to put the association and payload inserts inside a try block and re-enable both disabled triggers in a finally block, including when either insert fails.
- Accepted Accepted: restore both disabled fixture triggers in finally on failed association/payload insertion; meaningful isolation repair. Pending local implementation and focused PostgreSQL proof.
- Trivial
Update readCurrentSource and verifyEventHistory to avoid scanning and codec-verifying every event from sequence 1 through the head on each read; validate only the event at sequence against the source row and authority state, relying on the database’s contiguity and immutability guarantees. Remove the per-read full-stream count query, and keep any complete-history audit separate from the normal source-read path.
- Accepted Accepted bounded source read: validate exact current event/source/authority head, retain baseline denial and latest codec/counter checks; rely on proved append-only contiguous DB guards. Pending focused gap/currentness proof; no per-read full-history audit.
- Hosted Review 2 CompletedRuntime 12m 07sFound: 6 Accepted: 2/3/1 Routed: 0
- Assert the canonical conflict type for a changed caller.Trivial
CanonicalJoinOperationConflictExceptionextendsIllegalStateException, so the current assertion accepts the intended exception but does not ensure the caller mismatch triggered that denial path.Suggested assertion
- .isInstanceOf(IllegalStateException.class); + .isInstanceOf( + AccountJoinOperationRepository.CanonicalJoinOperationConflictException.class);- Accepted Accept exact canonical changed-caller conflict assertion; strengthens denial proof.
- Fail closed in
AccountServiceImpl.deleteAccountbefore any mutation, and update the stale test.Minordeletenow always throwsIllegalStateException. However,AccountServiceImpl.deleteAccount(lines 2201-2229) still runs eightdeleteByAccountIdcalls before it callsaccountRepository.delete(account).Every deletion request therefore runs destructive child deletes. Only the transaction rollback undoes them. The request then ends with an unclassified
IllegalStateExceptioninstead of anAccountLifecycleExceptionwith a stable code.AccountServiceImplTest.deleteAccountRemovesAccountOwnedRowsAfterTerminalSubscriptionsstill asserts a successful deletion. It passes only because the repository is a mock.Throw
AccountLifecycleException("ACCOUNT_DELETE_RETENTION_WORKFLOW_REQUIRED", ...)after the existing guards and before any delete. Then change the test to assert that exception and no repository deletes.- Accepted Accept typed denial before child writes; same obligation implemented in current local CLI batch, pending focused proof/publication.
- Re-enable the guard triggers in
finallyand storesigned_atin the production format.MinorinsertExpiredClaimAndPayloaddisablesaccount_approved_tenant_claim_capture_windowandaccount_approved_tenant_payload_immutable_expiryin autocommit statements. If the claim insert or payload insert fails, the triggers stay disabled for the shared per-class schema. Later assertions in the same class can then pass because only the Java check runs, and the database guard is never tested. Examples are thefutureandexpiredcapture checks.insertPayloadalso castssigned_attoTIMESTAMP WITH TIME ZONEbefore it inserts into theVARCHAR(64)column. PostgreSQL then stores the text form of the timestamp, for example2026-10-01 00:00:00+00. The production path inApprovedLegacyTenantAssociationRepository.importOwnerApprovedstores the raw ISO string2026-10-01T00:00:00Z, andpayloadMatchescompares the two strings exactly. A fixture row therefore never matches its own evidence on replay. A later replay assertion against these rows would fail for the wrong reason.🧪 Proposed fixture fix
private void insertExpiredClaimAndPayload(OwnerApprovedAccountTenantAssociation evidence) { dsl.execute( "ALTER TABLE account_approved_legacy_tenant_associations " + "DISABLE TRIGGER account_approved_tenant_claim_capture_window"); dsl.execute( "ALTER TABLE account_approved_legacy_tenant_association_payload " + "DISABLE TRIGGER account_approved_tenant_payload_immutable_expiry"); - dsl.execute( - "INSERT INTO account_approved_legacy_tenant_associations " - ... - evidence.sourceCapturedAt()); - insertPayload(evidence); - dsl.execute( - "ALTER TABLE account_approved_legacy_tenant_associations " - + "ENABLE TRIGGER account_approved_tenant_claim_capture_window"); - dsl.execute( - "ALTER TABLE account_approved_legacy_tenant_association_payload " - + "ENABLE TRIGGER account_approved_tenant_payload_immutable_expiry"); + try { + dsl.execute( + "INSERT INTO account_approved_legacy_tenant_associations " + ... + evidence.sourceCapturedAt()); + insertPayload(evidence); + } finally { + dsl.execute( + "ALTER TABLE account_approved_legacy_tenant_associations " + + "ENABLE TRIGGER account_approved_tenant_claim_capture_window"); + dsl.execute( + "ALTER TABLE account_approved_legacy_tenant_association_payload " + + "ENABLE TRIGGER account_approved_tenant_payload_immutable_expiry"); + } } @@ - + "VALUES (?, ?, ?, ?, ?, ?, CAST(? AS TIMESTAMP WITH TIME ZONE), ?, ?, ?)", + + "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",- Accepted Accept restoration already implemented in local CLI batch plus signed_at ISO representation parity.
- Fix the IPv6 loopback check. It never matches.Minor
URI.getHost()keeps the brackets on an IPv6 literal. For example,jdbc:postgresql://[::1]:5432/postgresreturns"[::1]", not"::1". As a result, the fixture always rejects the documented IPv6 loopback option. Normalize the brackets before the comparison.Proposed fix
- boolean loopbackHost = "127.0.0.1".equals(host) || "::1".equals(host); + boolean loopbackHost = + "127.0.0.1".equals(host) || "[::1]".equals(host) || "::1".equals(host);- Accepted Accept bracketed IPv6 loopback support without widening remote credential/options policy.
- Accept a null
globalRole. Without this change, security updates fail for every newly registered Account.MajorAccountServiceImpl.createAccountnever sets a role.createAccountPersistsOnlyGlobalIdentityasserts that the role isnull. As a result,accounts.roleisNULLfor every new registration.The codec breaks on that value:
- Every later security mutation calls
AccountRepository.save, which callsrecordAccountUpdate. Examples areverifyEmail(EMAIL_LOGIN_ELIGIBILITY_CHANGED) andcompletePasswordReset(PASSWORD_RESET). recordAccountUpdatecallssealAccount.accountNodewritesglobalRoleas a JSON null.validateAccountcallstext(state, "globalRole"), which throwsmust be a string.- The transaction rolls back.
The result is that newly registered Accounts can never verify their email or reset their password. The SQL guards already compare
globalRolewithIS DISTINCT FROM NEW.role, so they accept null. Only the codec rejects it.The tests miss this case because both
account(...)helpers set the role to"player". Add a case with a null role.accountEvidencemust also readglobalRoleas a nullable value.🐛 Proposed fix
- String role = text(state, "globalRole"); - if (!ROLE_PATTERN.matcher(role).matches()) { - throw invalid("accountState.globalRole", "must be a bounded Account role identifier"); - } + JsonNode roleNode = state.get("globalRole"); + if (roleNode == null + || !(roleNode.isNull() + || (roleNode.isTextual() && ROLE_PATTERN.matcher(roleNode.textValue()).matches()))) { + throw invalid( + "accountState.globalRole", "must be null or a bounded Account role identifier"); + }In
accountEvidence, replacetext(state, "globalRole")withstate.get("globalRole").isNull() ? null : state.get("globalRole").textValue().- Accepted Fresh registered Accounts have null roles; closed codec rejects real email/password security mutations. Accept explicit null while rejecting missing/invalid role.
- Every later security mutation calls
- Preserve the stored lifecycle state in generic updates.Major
Both token repositories omit lifecycle state when loading the linked
Account, which therefore defaults toACTIVE.completePasswordResetandverifyEmailsave that account. A valid, unexpired token can thus change a persistedSECURITY_LOCKED,DEACTIVATED_PENDING_DELETE, orDELETEDstate toACTIVE.recordAccountUpdaterecords this difference asLIFECYCLE_STATE_CHANGED. The V40 trigger checks that the event matches the row; it does not reject the transition. Keep the stored state in generic updates and reserve lifecycle changes for an explicit mutation path.- .set(ACCOUNTS.LIFECYCLE_STATE, entity.getLifecycleState().storageValue()) + .set(ACCOUNTS.LIFECYCLE_STATE, before.getLifecycleState())- Accepted Generic save can reactivate a protected Account loaded through partial token projections. Accept preserve stored lifecycle; explicit transitions remain owner work.
- CLI Review 3 CompletedRuntime 3m 36sFound: 4 Accepted: 0/1/2 Routed: 0
- Trivial
Update findForUpdate to delegate snapshot loading to readLockedSnapshot after lockRetainedMembership succeeds. Remove the duplicated header lock, version validation, role query, and RoleSnapshot construction, preserving the helper’s Optional result.
- Accepted Accept reuse of existing readLockedSnapshot after unchanged retained-membership lock and validation; one canonical header/role reader.
- Trivial
Extend freshMembershipWriteReadRequiresWritableOwnerTransactionBeforeAnyLookup to also invoke findFreshMembershipForUpdate within an active read-only transaction and assert that it rejects the call with the writable-owner-transaction error. Reset transaction state as needed and preserve the existing no-interactions verification.
- Accepted Accept active read-only owner-transaction denial with no collaborator lookups; missing focused negative proof.
- Minor
Update POSITIVE_DECIMAL_PATTERN and isPositiveDecimal in MembershipAuthorityEventV1Codec to reject values greater than Long.MAX_VALUE, matching the bounded range contract of AccountAuthoritySourceEventV1Codec while still accepting the existing vector maximum. Add an out-of-range invalid mutation to the authority-event vectors.
- Rejected Canonical session integer strings and ADR0030 require arbitrary-precision membership wire values. The other codec bounds its own SQL owner source; it does not justify imposing Long.MAX_VALUE on this shared grammar. Persistence overflow remains an owner-boundary denial.
- Minor
Add a Reconsideration trigger to the retained 2026-10-06 entry in the “Remote test infrastructure” observation, stating that it should be revisited when the fixture owner confirms or retires the original authorization, or before any new remote infrastructure is provisioned.
- Accepted Accept explicit reconsideration trigger for remote provisioning authorization uncertainty, preserving existing observation.
- Hosted Review 3 CompletedRuntime 13m 02sFound: 2 Accepted: 0/1/1 Routed: 0
- Index the new payload-reference columns.Trivial
approved_tenant_payload_operation_idhas no index onaccount_tenant_membershipor onaccount_connect_scope_records. This affects two paths:- When a payload row is deleted, PostgreSQL checks each
ON DELETE RESTRICTforeign key with a lookup on the referencing table. Without an index, each check is a sequential scan. ApprovedLegacyTenantAssociationRepository.deleteExpiredApprovalPayloadsruns twoNOT EXISTSsubqueries per candidate on these columns.
V2 connect-scope rows are never deleted, so the scope table only grows. Each hourly cleanup batch therefore does more full scans over time. Add partial indexes on the non-null values.
♻️ Proposed change
+CREATE INDEX account_tenant_membership_approval_payload_idx + ON account_tenant_membership (approved_tenant_payload_operation_id) + WHERE approved_tenant_payload_operation_id IS NOT NULL; + +CREATE INDEX account_connect_scope_approval_payload_idx + ON account_connect_scope_records (approved_tenant_payload_operation_id) + WHERE approved_tenant_payload_operation_id IS NOT NULL;- Accepted Accept two non-null partial indexes for retained-payload FK and cleanup anti-join lookups; preserve generated provenance columns and retention semantics.
- When a payload row is deleted, PostgreSQL checks each
- Require a writable transaction in
findCanonical.MinorfindCanonicalcalls onlyrequireOwnerTransaction(), so it accepts a read-only transaction. The read path then callsreadCanonicalEvidenceByTokenHash, which callsverifyAccountIdentity. That method runsSELECT ... FROM accounts ... FOR UPDATE. PostgreSQL rejectsFOR UPDATEin aREAD ONLYtransaction. The caller gets a raw database error instead of the repository's explicit guard message.The earlier fix updated
findCanonicalEvidenceByTokenHashand the JOIN-operation readers but did not update this method.♻️ Proposed fix
public Optional<CanonicalJoinScopeV2> findCanonical(String connectScopeId) { - requireOwnerTransaction(); + requireWritableOwnerTransaction(); requireCanonicalDependencies();- Accepted Accept writable-owner guard before canonical lookup because downstream Account identity read locks rows; add read-only no-I/O denial proof.
- CLI Review 4 CompletedRuntime 3m 49sFound: 3 Accepted: 0/1/2 Routed: 0
- Trivial
Update the offset-format rejection assertion in CanonicalJoinScopeV2Test to use an expiry later than evaluatedAt while retaining the non-Z +00:00 offset form. Keep the assertion focused on canonical UTC format rather than timestamp ordering.
- Accepted Accepted Trivial proof correction: offset-format rejection expiry currently precedes evaluatedAt, so another guard could satisfy the test. Keep +00:00 but use a later expiry to isolate canonical UTC formatting; fix pending in current PR.
- Minor
Update the AA-1.3 row’s DeleteAccount description to state that AccountServiceImpl.deleteAccount throws ACCOUNT_DELETE_UNAVAILABLE after its JOIN and subscription checks and does not call AccountRepository.delete. Align the wording with the existing runtime-and-data.md description.
- Accepted Accepted Minor tracker drift: deleteAccount checks JOIN and subscriptions then throws ACCOUNT_DELETE_UNAVAILABLE without repository deletion. Correct AA-1.3 to match fail-closed owner implementation; documentation fix pending.
- Trivial
Update the status entry beginning “The historical hosted pass” to remove the obsolete per-run CI narrative, including historical hashes, run IDs, and resolved failures; retain only the current proof state that exact-head CI proof for the correction remains pending, and flag any obsolete transitional guidance.
- Accepted Accepted Trivial tracker cleanup: remove obsolete resolved per-run CI hashes/failure narrative. Preserve current honest proof state, noting exact d619 required CI is green and local physical PG remains unavailable; do not retain suggested stale pending state. Fix pending in current PR.
- CLI Review 5 CompletedRuntime 3m 24sFound: 2 Accepted: 0/1/0 Routed: 0
- Trivial
Replace variable-length LocalDateTime.toString() serialization in LegacyTenantSourceEvidence with a fixed, explicitly defined timestamp format in the digest preimage. Apply the same formatting to all three timestamp writes so producers generate identical accountEvidenceDigest values for the same timestamp.
- Rejected Typed LocalDateTime values have deterministic value-based toString across all three PostgreSQL projections. Equal timestamps already hash equally; fixed precision would change retained v1 digests without a demonstrated divergence or versioned migration.
- Minor
Update POSITIVE_DECIMAL_PATTERN and the isPositiveDecimal validation in MembershipAuthorityEventV1Codec to accept only positive values within the signed long range, matching AccountAuthoritySourceEventV1Codec. Add an invalid vector with an out-of-range counter, such as 9223372036854775808 for /outboxSequence, to the authority event vectors.
- Accepted Minor: membership codec accepts counters beyond the signed-long range used by actual Account BIGINT outbox and owner repositories; converge validation and shared invalid vectors while retaining >2^53 string values. Accepted current-PR fix pending; prepare locally during active Hosted.
- CLI Review 6 CompletedRuntime 3m 35sFound: 2 Accepted: 1/1/0 Routed: 0
- Minor
Align the validation status in the source stage summary with the exact-head CI and 535-unit-test results, while keeping this stage’s PostgreSQL proof marked as pending; update the corresponding validation statement in api-contracts.md to match.
- Accepted Minor current-PR doc drift: stage/API still claim pending validation despite attributable f086 required CI and reported focused535 cases. Align to exact tested head and preserve newer-head CI/physicalPG limits; bounded fix assigned.
- Major
Update the Account update flow around save and sourceEvidence.recordAccountUpdate so retained Accounts without V40 provenance do not fail with an internal state exception: enroll them through an explicit, validated baseline path before requiring V40 evidence, or block deployment and return a typed, user-facing error for those updates. Add a PostgreSQL test that exercises password reset for an Account inserted before V40.
- Accepted Major retained-data failure: pre-V40 security updates lack source baseline. Keep denial and no inferred enrollment; add typed unavailability, rollback and retained-password-reset proof plus activation limitation. Bounded fix assigned.
- CLI Review 7 CompletedRuntime 3m 42sFound: 3 Accepted: 0/0/3 Routed: 0
- Trivial
Update the namespace-mismatch test stub in TenantIdentityGrpcServiceTest to use the expected REQUEST_DIGEST for evidence with targetNamespace "other". Remove the derived otherNamespaceDigest value so the test isolates the namespace check from digest validation.
- Accepted Trivial current-PR proof correction: retain the expected request digest in the other-namespace stub to isolate the namespace mismatch; no production behavior change.
- Trivial
In
ApprovedLegacyTenantAssociationIntegrationTest, use the sharedclasspath:db/migrationlocation instead of a working-directory-relative filesystem path. Retain the generated schema name as a field sostopPostgres()can drop that test-owned schema withCASCADEbefore stopping the fixture; ensure fixture shutdown still occurs if schema cleanup fails.- Accepted Trivial current-PR fixture repair: use packaged canonical migrations and dispose only the owned schema before guaranteed fixture shutdown.
- Trivial
Update AccountCanonicalFirstJoinEventIntegrationTest to track each schema created by newTestContext and drop the tracked schemas after each test, following the cleanup pattern in AccountFirstJoinAuthorityStorageIntegrationTest. Use a thread-safe set if needed for the static schema tracker, and clear it after cleanup.
- Accepted Trivial current-PR test isolation: drop only per-test owned schemas on external PostgreSQL, including failed setup; preserve complete assertions.
- CLI Review 8 CompletedRuntime 4m 22sFound: 3 Accepted: 0/3/0 Routed: 0
- Minor
Update migrationRetainsV1AndStoresExactV2ScopeAndPendingIntentWithoutMembershipOrEvent and the other schema-creating test to track each generated schema, then add an @AfterEach cleanup that drops only tracked schemas after validating they match the test-owned naming and identifier rules.
- Accepted Minor: migration fixtures must dispose only their generated owned schemas; track exact identifiers and validate before teardown without weakening retained-data assertions.
- Minor
Extract the
SourceEvidenceUnavailableExceptiontoAUTH_UNAVAILABLEresponse mapping used bycompletePasswordResetinto a shared helper, then apply it inverifyEmailand other gRPC handlers that save security-relevant Account fields; keep unrelated exception mappings unchanged.- Accepted Minor: unsupported security-source writes must return stable AUTH_UNAVAILABLE in owning Account gRPC handlers; reuse existing mapping, preserve unrelated error behavior.
- Minor
Update canonicalUuid to reject the nil UUID in addition to enforcing canonical lowercase UUID format, so Account source events and stream identities cannot use the nil account ID.
- Accepted Minor: nil UUID is not canonical Account source identity; reject it at the existing decoder and preserve valid canonical UUIDs with focused vectors.
- CLI Review 9 CompletedRuntime 3m 38sFound: 4 Accepted: 0/3/1 Routed: 0
- Trivial
Bound the concurrency waits in the test using CountDownLatch and Future timeouts: replace the unbounded ready.await(), first.get(), and second.get() calls with bounded waits that fail clearly if coordination or appends stall. Also update the await(start) helper used by concurrentAppend to use a timeout, preserving the existing concurrency flow.
- Accepted Accepted current-PR test robustness: bound latch/future waits with clear timeouts while retaining concurrent append and rollback proof.
- Minor
Update
accountNodeso nullmutationKindsandloginAuthModesare represented as JSON nulls instead of dereferenced, allowingvalidateAccountto reject them with the codec’sIllegalArgumentException. Preserve array serialization for non-null lists.- Accepted Accepted current-PR codec defect: null mutation/login mode lists dereference before strict validation; preserve canonical arrays and prove IllegalArgumentException.
- Minor
In AccountRepository.save, reject lifecycle changes instead of silently restoring the stored state: before updating, compare a non-null entity lifecycle state with the locked row’s lifecycle state and throw an IllegalStateException when they differ. Keep saves with no requested lifecycle change unchanged.
- Accepted Accepted current-PR fail-closed improvement: generic save must reject requested lifecycle transitions before mutation; preserve dedicated lifecycle boundary and test no write/event.
- Minor
Update the VerifyEmail contract to document that retained pre-V40 Accounts whose required owner-proven authority baseline is unavailable fail with AUTH_UNAVAILABLE (HTTP 503), and the email-verification write does not commit. Reuse the existing retained Account prerequisite reference or add a shared note covering both VerifyEmail and CompletePasswordReset.
- Accepted Accepted current-PR documentation: VerifyEmail requires retained owner-proven baseline, returns AUTH_UNAVAILABLE/503 and commits no verification mutation.
- Subagent Review 1 CompletedModel: gpt-6.1-sol · MediumFound: 1 Accepted: 0 Routed: 1
- External PostgreSQL fixture runs retain their generated schemas and test dataMinor
At 8f186bd813dc554de3c93912044b4e0f2ed4c1a8 Account and Game Design fixtures stop only owned Testcontainers. External-mode AccountAuthorityCurrentnessIntegrationTest and GameTenantCreationRepositoryIntegrationTest/GameTenantIdentityRepositoryIntegrationTest create random schemas without teardown. Separately inspected AccountPlatformRestrictionOperationPostgresIntegrationTest at 6f46f85746ed9f8092731f15330856e7bd24a04a has the same gap. Use existing AccountJwtSignerStoragePostgresIntegrationTest precedent: register generated run-owned schemas before migrations, validate ownership/name, drop exact schemas in teardown without stopping or modifying unrelated external resources. No DB execution performed; runtime and memory claims remain unmeasured.
Route · PR #3010 → PR #3177 Accepted/FixedSupported independent Sol source finding. Retain as unassigned maintenance follow-up; no new front prerequisite or reopening of historical PR reviews. View routed finding
Routed Findings
Route 1 · PR #3010 → PR #3177 Accepted/FixedMinorExternal PostgreSQL fixture runs retain their generated schemas and test data
At 8f186bd813dc554de3c93912044b4e0f2ed4c1a8 Account and Game Design fixtures stop only owned Testcontainers. External-mode AccountAuthorityCurrentnessIntegrationTest and GameTenantCreationRepositoryIntegrationTest/GameTenantIdentityRepositoryIntegrationTest create random schemas without teardown. Separately inspected AccountPlatformRestrictionOperationPostgresIntegrationTest at 6f46f85746ed9f8092731f15330856e7bd24a04a has the same gap. Use existing AccountJwtSignerStoragePostgresIntegrationTest precedent: register generated run-owned schemas before migrations, validate ownership/name, drop exact schemas in teardown without stopping or modifying unrelated external resources. No DB execution performed; runtime and memory claims remain unmeasured.
Outcome: Merged5769a353/#3177 removes external modes; exact reviewed5-file patch, Sol0 findings, focused3 cases and all5 required CI pass. Original remote proof containers already retiredOct7 per completed retire-preview-test-fixtures; historical authorization remains unverified.
Earlier routing and proof
- Target history: PR #3177: Actual receiving fix: merged3177 retires both external fixture modes, eliminating future retained-server schema leakage; preserve source history.
Earlier decisions
- Routed Supported independent Sol source finding. Retain as unassigned maintenance follow-up; no new front prerequisite or reopening of historical PR reviews.
Unlinked items
no items unlinked