FireMUD Delivery Status

PR data refreshed

PR #3172 review history

Review rounds

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

Hosted CodeRabbit2 completed
3/3/01/1/0
CLI CodeRabbit3 completed
1/1/02/2/01/1/0

Recorded review history

Reviews and findings

  1. CLI Review 1 CompletedRuntime 1m 54s
    Found: 1 Accepted: 0/1/0 Routed: 0
    1. Add the V137 restriction anchors to the AA-1.3 anchor cells.Minor

      The AA-1.3 gap cell now describes "V137 immutable revision/current-result receipts, exact SQL source-head dispatch, and protective-category lifecycle sync". The row's implementation anchors do not list V137__account_platform_restriction_revision_receipts.sql or AccountPlatformRestrictionOperationRepository.java. The proof anchors also do not list the new focused tests:

      • AccountPlatformRestrictionOperationPostgresIntegrationTest.java
      • AccountPlatformRestrictionOperationRepositoryTest.java
      • AccountAuthoritySourceEventReadbackTest.java

      Without these links, the status row describes a capability that has no production or proof anchor. Add the migration and the repository to the implementation anchors. Add the focused tests to the proof anchors.

      As per coding guidelines: "implemented and partial rows name concrete production anchors" and trackers must "Keep its status, implementation record, validation, gaps... aligned when a domain boundary changes."

      • Accepted Accepted Minor: AA-1.3 describes restriction receipts/dispatch but omits V137 repository and focused proof anchors. Add canonical links only; preserve status/limits.
  2. Hosted Review 1 CompletedRuntime 5m 54s
    Found: 3 Accepted: 0/3/0 Routed: 0
    1. Map a NONRESTRICTED security lock to "not security_locked", not to active.Minor

      Both the SQL lifecycle sync and the Java projection check treat a cleared protective lock as "lifecycle must be active". The design states that security_locked projects only account_security_lock. A cleared lock must not move or require any other lifecycle state.

      The SQL trigger tries to reactivate deactivated_pending_delete accounts. The transition guard then rejects the transaction, so the lock cannot be cleared after a pending-delete transition. The Java check reports the projection as unavailable for pending-delete accounts.

      • services/account-service/src/main/resources/db/migration/V137__account_platform_restriction_revision_receipts.sql#L619-L628: update security_locked → active only for NONRESTRICTED. Update active → security_locked only for RESTRICTED.
      • services/account-service/src/main/java/net/firedevops/firemud/accountservice/repository/AccountPlatformRestrictionOperationRepository.java#L524-L529: require RESTRICTED ⇔ lifecycle_state = 'security_locked'. Do not require active for NONRESTRICTED.

      📍 Affects 2 files

      • services/account-service/src/main/resources/db/migration/V137__account_platform_restriction_revision_receipts.sql#L619-L628 (this comment)
      • services/account-service/src/main/java/net/firedevops/firemud/accountservice/repository/AccountPlatformRestrictionOperationRepository.java#L524-L529
      • Accepted Accepted Minor: security lock projects only security_locked. NONRESTRICTED must preserve pending-delete/deleted lifecycle rather than force active; SQL sync and readback must enforce matching lock bit.
    2. Use the immediate pre-V137 migration target.Minor

      context("126") stops before V126.1, V126.2, and V126.3. The test therefore covers unrelated migrations together with V137 instead of testing the direct V137 upgrade. These migrations alter StartSession and control-UI tables, not the accounts columns used by AccountRepository.save.

      Use 126.3 as the target:

      -    Context context = context("126");
      +    Context context = context("126.3");
      
      • Accepted Accepted Minor: V126.3 is immediate pre-V137 schema; isolate upgrade fixture to126.3 instead of126.
    3. Add implementation and proof anchors for the new restriction slice to the AA-1.3 row.Minor

      The gap cell now claims these new parts:

      • the closed restriction event variant
      • the V137 receipts
      • the SQL source-head dispatch
      • the lifecycle sync

      The "Implementation anchors" cell does not link any production file that implements them. The "Proof anchors" cell does not link any new focused test.

      Add these implementation anchors:

      • V137__account_platform_restriction_revision_receipts.sql
      • AccountPlatformRestrictionOperationRepository.java
      • AccountPlatformRestrictionMutationRequest.java
      • AccountSecurityStateAuthorityEventV1Codec.java
      • AccountAuthoritySourceEventReadback.java

      Add these proof anchors:

      • AccountPlatformRestrictionOperationPostgresIntegrationTest.java
      • AccountPlatformRestrictionOperationRepositoryTest.java
      • AccountSecurityStateAuthorityEventV1CodecTest.java
      • AccountAuthoritySourceEventReadbackTest.java

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

      • Accepted Accepted Minor: extend AA-1.3 canonical restriction implementation/proof anchors only, preserving status and limits.
  3. CLI Review 2 CompletedRuntime 2m 04s
    Found: 2 Accepted: 1/1/0 Routed: 0
    1. Reject a security-lock RESTRICTED result that the lifecycle sync cannot apply.Major

      This UPDATE changes accounts.lifecycle_state only when the account is active (for RESTRICTED) or security_locked (for NONRESTRICTED). In every other state, the update silently does nothing, and the transaction still commits. On the read side, AccountPlatformRestrictionOperationRepository.requireLifecycleProjection (Java lines 518-532) requires state == RESTRICTED ⇔ lifecycle_state == 'security_locked'.

      Trigger: an account_security_lock RESTRICTED revision on an account in deactivated_pending_delete (or deleted).

      • The operation, revision, and current projection commit with RESTRICTED.
      • The lifecycle stays deactivated_pending_delete.
      • Every later readCurrentProjection throws RestrictionProjectionUnavailableException.
      • That includes requireCurrentPostState on the latest-event path, so readCurrentIssuerAccountSources and every closed-source readback for the account fail.
      • That also includes the FOR UPDATE read in persistWithoutOwnerProof. A recovery NONRESTRICTED revision therefore cannot be written either.

      The account stays unreadable until an operator repairs it by hand. The integration test only covers the NONRESTRICTED-on-pending-deletion case, so it does not catch this.

      The same invariant can break from other writers. A legacy ACCOUNT_SECURITY_STATE_CHANGED or AccountRepository lifecycle change can move a security_locked account to deactivated_pending_delete (the support-reviewed transition) while the lock projection is still RESTRICTED.

      The write path is default-denied today, so this does not affect production yet. Close the gap before the proof receiver is connected:

      • In SQL, raise an exception in this sync function when the UPDATE affects zero rows and the account is not already in the target lifecycle.
      • In Java, reject a RESTRICTED security-lock request in persistWithoutOwnerProof unless the locked lifecycle is active or security_locked.
      • Decide what the invariant should be for other lifecycle writers. Either guard them or relax requireLifecycleProjection for non-active/non-locked states, and document the choice.

      🛡️ Proposed SQL guard

           UPDATE accounts SET lifecycle_state =
               CASE operation_row.result_state
                   WHEN 'RESTRICTED' THEN 'security_locked'
                   ELSE 'active'
               END
               WHERE account_uuid = NEW.account_uuid
                 AND ((operation_row.result_state = 'RESTRICTED'
                         AND lifecycle_state = 'active')
                     OR (operation_row.result_state = 'NONRESTRICTED'
                         AND lifecycle_state = 'security_locked'));
      +    IF operation_row.result_state = 'RESTRICTED' AND NOT EXISTS (
      +        SELECT 1 FROM accounts
      +        WHERE account_uuid = NEW.account_uuid AND lifecycle_state = 'security_locked') THEN
      +        RAISE EXCEPTION 'Account security-lock result cannot be projected onto the current lifecycle'
      +            USING ERRCODE = '23514', CONSTRAINT = 'account_authority_account_security_event_mismatch';
      +    END IF;
           RETURN NULL;
      
      • Accepted Accepted Major: RESTRICTED mutation on non-active/nonlocked lifecycle must roll back, not leave unreadable projection. Preserve canonical lock equivalence; guard source writes/precheck and independently prove rollback; legacy writer consistency needs scoped evidence.
    2. Add the missing ; separators in the AA-1.3 anchor lists.Minor

      The Implementation anchors cell has two spaces between [V137__account_platform_restriction_revision_receipts.sql](...) and [AccountPlatformRestrictionMutationRequest.java](...), with no ;. The Proof anchors cell has the same gap between [AccountAuthoritySourceEventReadbackTest.java](...) and [AccountSecurityStateAuthorityEventV1CodecTest.java](...). Every other entry in this row is separated by ; . The tracker contract requires repository-local, resolvable evidence anchors. dev-tools/tests/architecture-doc-contracts.sh validates these cells. If that script splits entries on ;, it reads each pair as one malformed anchor, and the contract check can fail.

      The row also omits AccountGenerationProjectionRestrictionDispatchTest.java and RuntimeMembershipAuthorityEvidenceValidatorRestrictionDispatchTest.java. Both test the new dispatch paths. Consider adding them as proof anchors.

      📝 Proposed fix

      -...V137__account_platform_restriction_revision_receipts.sql)  [AccountPlatformRestrictionMutationRequest.java](...
      +...V137__account_platform_restriction_revision_receipts.sql); [AccountPlatformRestrictionMutationRequest.java](...
      -...AccountAuthoritySourceEventReadbackTest.java)  [AccountSecurityStateAuthorityEventV1CodecTest.java](...
      +...AccountAuthoritySourceEventReadbackTest.java); [AccountSecurityStateAuthorityEventV1CodecTest.java](...
      

      As per coding guidelines: "Evidence targets must be repository-local and resolvable".

      • Accepted Accepted Minor: two missing anchor separators remain; normalize AA-1.3 and add actual dispatch proof anchors.
  4. Hosted Review 2 CompletedRuntime 4m 43s
    Found: 1 Accepted: 1/0/0 Routed: 0
    1. Select the security-lock source kind from the requested state. The current fixture cannot create a RESTRICTED lock.Major

      For every ACCOUNT_SECURITY_LOCK request, commitDraft uses SourceKind.ACCOUNT_SECURITY_RECOVERY. AccountPlatformRestrictionMutationRequest.validateOwnerSource rejects ACCOUNT_SECURITY_RECOVERY with any state other than NONRESTRICTED. This guard is at Lines 169-172 of AccountPlatformRestrictionMutationRequest.java.

      Some tests call commitDraft(..., ACCOUNT_SECURITY_LOCK, RESTRICTED):

      • Line 298 in restrictedSecurityLockOnActiveAccountProjectsLockedLifecycle.
      • Line 360 in legacyLifecycleExitRejectsFinalRestrictedMismatchAndRollsBackItsReceipt.

      In those calls, the request constructor throws IllegalArgumentException before persistence. Both tests then fail when PostgreSQL executes them. Locally, the cases skip without Docker, so the PR's local test results do not show this failure. The tests that need a restricted projection never get one.

      Use ACCOUNT_SECURITY_POLICY for RESTRICTED and ACCOUNT_SECURITY_RECOVERY for NONRESTRICTED.

      🐛 Proposed fix

      --- "a/services/account-service/src/test/java/integration/net/firedevops/firemud/accountservice/repository/AccountPlatformRestrictionOperationPostgresIntegrationTest.java"
      +++ "b/services/account-service/src/test/java/integration/net/firedevops/firemud/accountservice/repository/AccountPlatformRestrictionOperationPostgresIntegrationTest.java"
      @@ -555,14 +555,12 @@
                         currentProjection == null
                             ? categoryBirth.resultId()
                             : currentProjection.get("result_id", UUID.class);
                     var sourceKind =
                         category == Category.ACCOUNT_SECURITY_LOCK
      -                      ? net.firedevops.firemud.accountservice.dto
      -                          .AccountPlatformRestrictionMutationRequest.SourceKind
      -                          .ACCOUNT_SECURITY_RECOVERY
      -                      : net.firedevops.firemud.accountservice.dto
      -                          .AccountPlatformRestrictionMutationRequest.SourceKind
      -                          .LOGGING_ADMIN_MODERATION;
      +                      ? (state == RestrictionState.RESTRICTED
      +                          ? SourceKind.ACCOUNT_SECURITY_POLICY
      +                          : SourceKind.ACCOUNT_SECURITY_RECOVERY)
      +                      : SourceKind.LOGGING_ADMIN_MODERATION;
                     var request =
                         new AccountPlatformRestrictionMutationRequest(
                             UUID.randomUUID(),
      
      • Accepted Verified commitDraft recovery source rejects RESTRICTED before SQL persistence. Use policy for restricted, recovery for nonrestricted; preserve punitive moderation. Bounded accepted fixture fix.
  5. CLI Review 3 CompletedRuntime 2m 04s
    Found: 1 Accepted: 1/0/0 Routed: 0
    1. Select the security-lock source kind from the desired state.Major

      commitDraft always uses ACCOUNT_SECURITY_RECOVERY for ACCOUNT_SECURITY_LOCK. AccountPlatformRestrictionMutationRequest.validateOwnerSource rejects ACCOUNT_SECURITY_RECOVERY with RESTRICTED. The request constructor therefore throws IllegalArgumentException before the draft persistence runs.

      These tests call commitDraft(..., ACCOUNT_SECURITY_LOCK, RESTRICTED):

      • restrictedSecurityLockOnActiveAccountProjectsLockedLifecycle
      • legacyLifecycleExitRejectsFinalRestrictedMismatchAndRollsBackItsReceipt

      Both tests fail during setup. The tracker lists this suite as AA-1.3 proof, so the first physical PostgreSQL run will fail.

      Proposed fix

                     var sourceKind =
                         category == Category.ACCOUNT_SECURITY_LOCK
      -                      ? net.firedevops.firemud.accountservice.dto
      -                          .AccountPlatformRestrictionMutationRequest.SourceKind
      -                          .ACCOUNT_SECURITY_RECOVERY
      -                      : net.firedevops.firemud.accountservice.dto
      -                          .AccountPlatformRestrictionMutationRequest.SourceKind
      -                          .LOGGING_ADMIN_MODERATION;
      +                      ? (state == RestrictionState.RESTRICTED
      +                          ? SourceKind.ACCOUNT_SECURITY_POLICY
      +                          : SourceKind.ACCOUNT_SECURITY_RECOVERY)
      +                      : SourceKind.LOGGING_ADMIN_MODERATION;
      
      • Accepted Verified desired-state/source mismatch in commitDraft against validateOwnerSource. Policy for RESTRICTED, recovery for NONRESTRICTED; bounded fixture correction locally in canonical Account gate.

Routed Findings

0 Open0 Accepted/Fixed0 Rejected

No routes recorded

Unlinked items

no items unlinked