FireMUD Delivery Status

PR data refreshed

PR #3147 review history

Account: passive signer and readiness storage foundation

Unit 1A · identity, Account and public JOIN

Review rounds

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

Hosted CodeRabbit4 completed
10/10/08/8/07/7/01/1/0
CLI CodeRabbit3 completed
4/4/03/3/02/2/0
Subagent Review4 completed
1/1/00/0/01/0/02/1/0

Recorded review history

Reviews and findings

  1. Subagent Review 1 CompletedModel: gpt-6-luna · Xhigh
    Found: 1 Accepted: 1 Routed: 0
    1. Inventory misses private signer exposure via auxiliary containers and Secret projectionsMajor

      Fresh broad54-file review completed at exactb7c2304e15 clean tree; SQL, repositories, bindings, carriers, source selection, tests and status docs covered. Recorded after completed pass, not contemporaneous start. Runtime receiver/activation/consumer and local Docker gaps remain declared.

      • Accepted Verified target omits envFrom/projected Secret and all-container inspection. Reuse complete guard and regression source from preserved3122 commit6a4efb89; no activation or new authorization.
  2. Subagent Review 2 CompletedModel: gpt-6-luna · Xhigh
    Found: 0 Accepted: 0 Routed: 0
    1. No findings recorded for this run
  3. Subagent Review 3 CompletedModel: gpt-6-luna · Xhigh
    Found: 1 Accepted: 0 Routed: 0
    1. Alternate Secret copies might evade fixed signer-material guardMajor
      • Rejected No supported bypass: fixed jwt-signing-keys refs are rejected; a copied key assumes unauthorized duplication. Inventory is passive, non-authorizing, and readiness requires separate per-Pod receipts. Reviewer withdrew after scope verification.
  4. Subagent Review 4 CompletedModel: gpt-6-luna · Xhigh
    Found: 2 Accepted: 1 Routed: 0
    1. Large inventory may exceed readiness receipt closure boundMinor
      • Rejected Already fail-closed: planCurrent invokes expectedPods whose aggregate bound256 throws InventoryPlanConflictException before transaction can commit. Same bound is enforced during closure; no oversized complete durable plan was shown.
    2. Prepared dispatch returns pre-update promotion evidenceMinor
      • Accepted Confirmed: method verifies refreshed promotion but returns pre-update evidence. Return the verified promotion while retaining original state/result; prove sticky dispatch and replay without weakening authority guards.
  5. Hosted Review 1 CompletedRuntime 9m 52s
    Found: 10 Accepted: 1/6/3 Routed: 0
    1. Require a writable transaction for every read that takes row locks.Minor

      These reads take FOR UPDATE or FOR KEY SHARE locks, but they only check that a transaction is active. PostgreSQL rejects row-locking SELECT statements in a read-only transaction, so these calls fail with raw DataAccessExceptions. readPreparedPublicationForRecovery is also annotated readOnly = true, although its first call, readPreparedGenerationForRecovery, rejects read-only transactions. AccountJwtReadinessProbeRepository already applies the writable check to its locked reads.

      • services/account-service/src/main/java/net/firedevops/firemud/accountservice/repository/AccountJwtJwksPublicationRepository.java#L183-L186: remove readOnly = true and call requireWritableAccountTransaction().
      • services/account-service/src/main/java/net/firedevops/firemud/accountservice/repository/AccountJwtJwksPublicationRepository.java#L75-L77: replace requireAccountTransaction() with requireWritableAccountTransaction() in readCurrentIntent.
      • services/account-service/src/main/java/net/firedevops/firemud/accountservice/repository/AccountJwtJwksPublicationRepository.java#L153-L155: replace requireAccountTransaction() with requireWritableAccountTransaction() in readCurrentPublication.
      • services/account-service/src/main/java/net/firedevops/firemud/accountservice/repository/AccountJwtValidatorInventoryRepository.java#L81-L88: replace requireAccountTransaction() with requireWritableAccountTransaction() in readRequired.

      📍 Affects 2 files

      • services/account-service/src/main/java/net/firedevops/firemud/accountservice/repository/AccountJwtJwksPublicationRepository.java#L183-L186 (this comment)
      • services/account-service/src/main/java/net/firedevops/firemud/accountservice/repository/AccountJwtJwksPublicationRepository.java#L75-L77
      • services/account-service/src/main/java/net/firedevops/firemud/accountservice/repository/AccountJwtJwksPublicationRepository.java#L153-L155
      • services/account-service/src/main/java/net/firedevops/firemud/accountservice/repository/AccountJwtValidatorInventoryRepository.java#L81-L88
      • Accepted Locked publication/inventory reads accept read-only transactions and recovery annotation contradicts its writable owner read. Require writable transaction before SQL.
    2. Allow the owner-write bit on the root-owned parent directory.Minor

      verifyRootOwnedAndNonWritable applies writable(directoryMode) to the parent directory, and writable includes OWNER_WRITE. The method already requires the directory owner to be UID 0, so a normal root-owned 0755 directory is rejected. AccountJwtJwksApiBinding.verifyProtectedDirectory uses writableByUntrusted for the same check, which accepts owner write. The two bindings therefore disagree. With the current check, the readiness binding fails closed on almost every real mount. Use the untrusted-write check for the directory and keep the stricter check for the file.

      🐛 Proposed fix

               || writable(fileMode)
      -        || writable(directoryMode)) {
      +        || directoryMode.contains(PosixFilePermission.GROUP_WRITE)
      +        || directoryMode.contains(PosixFilePermission.OTHERS_WRITE)) {
      
      • Accepted Root-owned 0755 parent is rejected by OWNER_WRITE despite trusted ownership; permit root-owner write only on directory, retain immutable file and deny group/other writes.
    3. Reject envFrom on the selected container so the verifier runtime pin cannot be bypassed.Minor

      findVerifiedContainer pins FIREMUD_JWT_VERIFIER_CONFIG and rejects SPRING_APPLICATION_JSON, JAVA_TOOL_OPTIONS, and JDK_JAVA_OPTIONS, but only when they appear in env. The selected container's envFrom is never checked for these keys. rejectSigningMaterialEnvFrom only rejects a secretRef named jwt-signing-keys. A configMapRef or secretRef in envFrom can therefore inject JAVA_TOOL_OPTIONS or SPRING_APPLICATION_JSON and change verifier behavior. The snapshot would still report the pinned verifierConfigSha256. Per-Pod receipts later trust that digest as evidence of the runtime configuration. The narrowest fix is to reject any non-empty envFrom on the selected validator container.

      🛡️ Proposed fix

      --- "a/services/account-service/src/main/java/net/firedevops/firemud/accountservice/service/session/AccountJwtValidatorInventorySource.java"
      +++ "b/services/account-service/src/main/java/net/firedevops/firemud/accountservice/service/session/AccountJwtValidatorInventorySource.java"
      @@ -626,8 +626,13 @@
           if (selected == null || !expected.image().equals(text(selected.get("image")))) {
             throw new InventoryUnavailableException();
           }
           JsonNode env = selected.get("env");
      +    JsonNode envFrom = selected.get("envFrom");
      +    if (envFrom != null && !envFrom.isNull() && (!envFrom.isArray() || !envFrom.isEmpty())) {
      +      // Bulk environment sources can override JVM/Spring options outside the pinned config.
      +      throw new InventoryUnavailableException();
      +    }
           JsonNode configNode = null;
           Set<String> environmentNames = new LinkedHashSet<>();
           if (env != null && !env.isNull()) {
             if (!env.isArray() || env.size() > 256) {
      
      • Accepted Selected validator envFrom can inject JVM/Spring overrides outside pinned runtime config. Reject nonempty or malformed envFrom and prove ConfigMap/Secret cases.
    4. Use a well-formed billing cutoff so the test proves that the tenantBillingCutoff key is forbidden.Trivial

      Line 34 sets the per-tenant cutoff to Map.of(). The validator can reject this value because the inner cutoff object is empty or malformed. In that case, the test passes even if PlayerBootstrapJwtProfileValidator accepts a well-formed tenantBillingCutoff. The test name claims that the player-bootstrap profile rejects any billing cutoff. Use a complete cutoff object so the only reason for rejection is the presence of the key.

      ♻️ Proposed test fix

      -    tuple.put("tenantBillingCutoff", Map.of("22222222-2222-4222-8222-222222222222", Map.of()));
      +    tuple.put(
      +        "tenantBillingCutoff",
      +        Map.of(
      +            "22222222-2222-4222-8222-222222222222",
      +            Map.of(
      +                "tenantAuthorityGeneration", 2L,
      +                "tenantBillingSequence", 3L,
      +                "outboxStreamKey",
      +                "account:tenant-billing:v1:tenant/22222222-2222-4222-8222-222222222222",
      +                "outboxSequence", 4L)));
      
      • Accepted Empty tenant billing cutoff weakens profile prohibition proof. Use independently well-formed cutoff and prove presence is rejected.
    5. Wrap delivery-consumer failures the same way as the delegation path.Minor

      In signReadinessProbeDigest, a RuntimeException from deliveryConsumer.persistAttemptAndDeliver propagates unchanged. signCommittedGameplayDelegationDigest (lines 317-322) and signCommittedControlUiDigest replace callback failures with invalid() so that exception chains never keep the transient compact credential. Representative readiness probes are real control-ui, player-bootstrap, and delegation-profile tokens signed by the pending key. A downstream transport exception message or cause can carry those bytes into logs. Apply the same redaction here.

      🛡️ Proposed fix

      --- "a/services/account-service/src/main/java/net/firedevops/firemud/accountservice/service/session/AccountMountedJwtSignerBundle.java"
      +++ "b/services/account-service/src/main/java/net/firedevops/firemud/accountservice/service/session/AccountMountedJwtSignerBundle.java"
      @@ -208,8 +208,13 @@
             } catch (Exception ex) {
               throw invalid();
             }
             deliveryBytes = compactBytes.clone();
      -      deliveryConsumer.persistAttemptAndDeliver(result, deliveryBytes);
      +      try {
      +        deliveryConsumer.persistAttemptAndDeliver(result, deliveryBytes);
      +      } catch (RuntimeException failure) {
      +        // Callback exception chains must never retain the transient compact credential.
      +        throw invalid();
      +      }
             if (!sha256(deliveryBytes).equals(result.compactTokenSha256())) {
               throw invalid();
             }
      
      • Accepted Readiness delivery callback propagates a potentially credential-bearing exception unlike other signing paths. Redact without retaining causes and prove byte cleanup.
    6. Use the shared PostgreSQL fixture and clean up per-run schemas.Trivial

      Both tests duplicate the Testcontainers and external-URL bootstrap. Each run creates a random schema that is never dropped, so schemas accumulate when the tests use the external loopback database. AccountJwtSignerStoragePostgresIntegrationTest already uses AccountPostgresIntegrationFixture and an @AfterEach schema cleanup.

      • services/account-service/src/test/java/integration/net/firedevops/firemud/accountservice/repository/AccountJwtJwksPublicationPersistenceIntegrationTest.java#L339-L358: use AccountPostgresIntegrationFixture.dataSource(schema), record each created schema, and drop it in @AfterEach.
      • services/account-service/src/test/java/integration/net/firedevops/firemud/accountservice/repository/AccountJwtValidatorInventoryPersistenceIntegrationTest.java#L219-L238: make the same change and remove the duplicate container and URL validation code.

      📍 Affects 2 files

      • services/account-service/src/test/java/integration/net/firedevops/firemud/accountservice/repository/AccountJwtJwksPublicationPersistenceIntegrationTest.java#L339-L358 (this comment)
      • services/account-service/src/test/java/integration/net/firedevops/firemud/accountservice/repository/AccountJwtValidatorInventoryPersistenceIntegrationTest.java#L219-L238
      • Accepted Two PostgreSQL fixtures duplicate bootstrap and leak run-owned schemas on loopback backend. Reuse fixture and clean exact created schemas without broad deletion.
    7. Use jOOQ's stop token.Minor

      jOOQ 3.21 uses [jooq ignore stop] by default. [jooq ignore end] does not close the ignored region. Later DDL in this migration can therefore be omitted from generated sources.

      --- a/services/account-service/src/main/resources/db/migration/V109__account_jwt_validator_inventory_snapshots.sql
      +++ b/services/account-service/src/main/resources/db/migration/V109__account_jwt_validator_inventory_snapshots.sql
      @@ -64,4 +64,4 @@ CREATE TRIGGER account_jwt_validator_inventory_snapshot_no_truncate
           BEFORE TRUNCATE ON account_jwt_validator_inventory_snapshots
           FOR EACH STATEMENT EXECUTE FUNCTION account_jwt_validator_inventory_snapshot_immutable_guard();
      --- [jooq ignore end]
      +-- [jooq ignore stop]
      
      • Accepted V109 ends ignored SQL with end rather than configured default stop. Correct unreleased token and prove subsequent generated DDL remains visible.
    8. Bind readiness_evidence_digest to the stored readiness proof.Minor

      account_jwt_signer_promotion_insert_guard() validates NEW.readiness_evidence_digest only through the lifecycle shape constraint. Its readiness query matches readiness_plan_digest and the verified probe entries, but it does not compare NEW.readiness_evidence_digest with a digest derived from those entries.

      The Java repository computes readinessEvidenceDigest from the canonical readiness proof and compares it during promotion preparation, but direct SQL inserts can bypass that application check. If this column is used as readiness proof, the database guard can accept an unrelated well-formed digest. Derive the digest from the exact verified evidence in the guard, or enforce that all inserts use the repository path that performs this comparison.

      • Accepted Promotion DB guard checks readiness plan/probes but not canonical evidence digest. Bind stored digest to exact verified evidence and test direct SQL tampering.
    9. Add a terminal abort path for an unprepared generation operation.Major

      The desired-state guard has no transition from generation_operation_id set and prepared_operation_id NULL to both fields NULL. If readiness evidence expires or a probe becomes ABORTED before promotion insertion, the promotion insert guard rejects the request. The generation operation can then remain pinned, and later generation requests remain blocked.

      abortPreparedBeforeMutation does not resolve this case. It requires the operation to be the current prepared_operation_id.

      Add an owner-authorized abort transition for an unprepared generation operation. Clear generation_operation_id, preserve both active fences, and require durable terminal generation evidence. Do not allow the transition to activate or promote the generated key.

      • Accepted Unprepared generation cannot be terminally abandoned when readiness fails, permanently pinning generation. Add exact owner-bound durable abort evidence and preserve active fences; no activation.
    10. Close the per-request HttpClient after each call.Trivial

      send builds a new HttpClient for every Kubernetes API call and never closes it. Each client owns a selector-manager thread and connection pool, and these stay alive until garbage collection. A single AccountJwtValidatorInventorySource.observe() sends about 3 identity calls plus 6 or more inventory calls per validator, and each call leaves one client open. The project targets Java 21+: AccountJwtValidatorInventorySource uses List.getFirst(). On Java 21+, HttpClient implements AutoCloseable, so a try-with-resources block releases it.

      ♻️ Proposed fix

      --- "a/services/account-service/src/main/java/net/firedevops/firemud/accountservice/config/AccountJwtJwksApiBinding.java"
      +++ "b/services/account-service/src/main/java/net/firedevops/firemud/accountservice/config/AccountJwtJwksApiBinding.java"
      @@ -293,12 +293,15 @@
             throw new BindingRejectedException();
           }
       
      -    HttpClient client;
      -    try {
      -      client = createHttpClient(credentialSnapshot.caBytes());
      -    } catch (Exception ex) {
      -      throw new BindingRejectedException();
      -    }
      +    final HttpClient client;
      +    try {
      +      client = createHttpClient(credentialSnapshot.caBytes());
      +    } catch (Exception ex) {
      +      throw new BindingRejectedException();
      +    }
      +    try (client) {
      +      // existing request construction, recheck, and send logic
      +    }
           if ((call == ApiCall.READ_VALIDATOR_DEPLOYMENT
                   || call == ApiCall.LIST_VALIDATOR_PODS
                   || call == ApiCall.READ_VALIDATOR_REPLICA_SET)
      
      • Accepted Per-call HttpClient is created before request validation and never closed; bound its lifetime on success and failure without changing API trust or recheck semantics.
  6. CLI Review 1 CompletedRuntime 3m 05s
    Found: 4 Accepted: 1/1/2 Routed: 0
    1. Make the negative promotion checks assert the specific V125 constraint.Trivial

      These negative checks only expect RuntimeException. insertDirectPromotion writes a placeholder request_digest ("a".repeat(64)) and expected_active_generation_marker_json = "{}". Other guards may reject those values before the V125 readiness checks run. In that case, both direct inserts still pass, but they do not prove the two new checks:

      • the digest/preimage check (account_jwt_signer_promotion_readiness_digest)
      • the proof-projection check (account_jwt_signer_promotion_readiness_binding)

      The two update checks have the same weakness for account_jwt_signer_promotion_immutable.

      Assert the expected constraint name or message on each failure. For example, unwrap the DataAccessException to its PSQLException and check getServerErrorMessage().getConstraint(). The test then fails if the trigger rejects the row for an unrelated reason.

      Also applies to: 679-706

      • Accepted Accepted focused proof correction: promotion negatives use broad RuntimeException and placeholder request/marker data, so unrelated guards can mask readiness digest/binding or immutable-trigger failure. Build valid surrounding tuple and assert exact PostgreSQL constraints. Fix pending in3147.
    2. A dispatched promotion becomes permanently stuck in PREPARED when its readiness window expires.Major

      commitPreparedPromotion requires an unexpired readiness plan and unexpired VERIFIED entries. The checks are in requireUnexpiredCurrentReadinessProof and in the terminal UPDATE, which tests plan.expires_at_epoch_seconds > clock_timestamp(). The plan window is at most 300 seconds after not_before. After readAndMarkPreparedPromotionDispatched commits, abortPreparedBeforeMutation rejects the abort. The V106 account_jwt_signer_operation_guard also blocks ABORTED once private_promotion_dispatched_at IS NOT NULL. AccountJwtReadinessProbeRepository.readPromotionProof returns Optional.empty() once readinessPlanOutOfWindow is true. After that point, no valid proof exists for the commit.

      Trigger: the materializer RPC or the ConfigMap CAS is slow, or its response is lost. Reconciliation then runs after the plan's expires_at_epoch_seconds. This is the uncertain-mutation case that the dispatch marker documents.

      Consequence: the operation can neither commit nor abort. verifyPreparedIsUnavailable blocks every ordinary signer read. readCurrentCommittedSigner throws. No new generation can start. The signer lifecycle for the environment stays wedged. The only recovery is manual database intervention against immutable-evidence triggers.

      Correction: separate the two freshness checks. Check readiness freshness at the PREPARED boundary, before dispatch. Bind the commit to the immutable proof that was frozen in readiness_evidence_preimage and readiness_evidence_digest, not to wall-clock plan validity. If an explicit expiry is still required, define a forward-recovery path for an expired dispatched promotion. That path must not need a fresh plan for the same generation. Change both this method and the V106 COMMITTED guard together.

      • Accepted Accepted Major: dispatched PREPARED cannot abort, while commit/proof expire, wedging quarantine. Check fresh readiness before dispatch; terminal commit must verify immutable exact frozen proof plus genuine resource/trust/fence evidence per ADR0014. No inference or safety weakening. Fix pending.
    3. Assert the exception type for the direct desired-state update.Trivial

      This assertThatThrownBy has no .isInstanceOf(...). Any exception passes the check, including a wiring or SQL syntax failure. Every other negative SQL check in these suites expects DataAccessException. Assert the same type here, so the test proves that the trigger rejected the update.

      Proposed fix

           assertThatThrownBy(
               () ->
                   inTransaction(
                       context,
                       () ->
                           context
                               .dsl()
                               .execute(
                                   "UPDATE account_jwt_signer_desired_states "
                                       + "SET record_version = record_version + 1, "
                                       + "generation_operation_id = NULL "
                                       + "WHERE environment_id = ?",
      -                            BINDING.environmentId())));
      +                            BINDING.environmentId())))
      +        .isInstanceOf(org.jooq.exception.DataAccessException.class);
      
      • Accepted Accepted Trivial proof correction: direct desired-state UPDATE currently accepts any exception; assert jOOQ DataAccessException so unrelated wiring failures cannot satisfy the denial test. Fix pending in3147.
    4. Link the new section to its owning capability row and to its anchors.Minor

      The new section describes V99–V125, the repositories, and three named classes. It does not link any repository-local production anchor, focused proof source, or owning Capability Status row. The adjacent restricted-continuation section links its exact anchors and proof suites. Without links, a reader cannot find the owning capability or the evidence that the status and proof limits refer to.

      Make these changes:

      • Name the existing capability row that owns this preparation, for example the AA-* row. Confirm that its gap text still covers the signer, readiness, and validator-inventory storage.
      • Link the production anchors, for example AccountJwtSignerDesiredStateRepository.java, AccountJwtReadinessProbeRepository.java, V99__account_jwt_signer_desired_state.sql, and V125__account_jwt_signer_promotion_receipt_binding.sql.
      • Link the focused proof sources, for example AccountJwtSignerStoragePostgresIntegrationTest.java and AccountJwtReadinessStoragePostgresIntegrationTest.java. Mark them as not yet physically executed.

      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 Partially accepted Minor: link owning AA capability and actual signer/readiness production/proof anchors. Keep runtime incomplete. Exact CI integration task executed but individual suites/skips unknown; do not claim all physical proof unrun. Fix pending.
  7. Hosted Review 2 CompletedRuntime 10m 49s
    Found: 8 Accepted: 0/4/4 Routed: 0
    1. Bind the receiver's inventory coordinates to the protected snapshot.Minor

      LocalIdentity rejects missing or malformed inventory coordinates, but readCurrentProbeOwner never uses them. requireLiveInventoryMatches checks only Account's stored snapshot against the live snapshot. A receiver can therefore provide arbitrary well-formed coordinates and still receive owner evidence.

      Compare sourceInventoryRevision and sourceInventoryDigest with the authoritative live inventory binding values, then update the fixture. If these fields have no authority, remove them from LocalIdentity instead of validating unused data.

      • Accepted Accepted receiver selector must match authoritative inventory binding revision and digest; prove changed-coordinate denial.
    2. Validate representative claims before signing.Trivial

      signReadinessProbeDigest serializes readinessClaims(spec) and signs it without calling the selected profile validator. The current counter types, scopedRoles, and omitted tokenProfile match the validators' present contracts. However, a later validator change can allow this method to sign a probe that the target validator rejects, producing readiness failure without identifying the claim-shape mismatch.

           claims.put("membershipVersion", Map.of());
           claims.put("issuanceFence", initialCounter);
      +    if (GameSessionAccountDelegationProfile.PROFILE.equals(spec.tokenProfile())) {
      +      net.firedevops.firemud.common.security.GameSessionAccountDelegationJwtProfileValidator
      +          .validateClaims(claims);
      +    } else if (ControlUiJwtProfileValidator.PROFILE.equals(spec.tokenProfile())) {
      +      ControlUiJwtProfileValidator.validateClaims(claims, 1);
      +    } else if (PlayerBootstrapJwtProfileValidator.PROFILE.equals(spec.tokenProfile())) {
      +      PlayerBootstrapJwtProfileValidator.validateClaims(claims);
      +    }
           return claims;
      
      • Accepted Accepted validate representative readiness claims through the selected existing profile validator before signing; preserve reserved canary behavior.
    3. Verify the full directory chain for the shared protected root.Minor

      AccountJwtJwksApiBinding.readCurrentProtectedState calls verifyProtectedDirectoryChain(TRUST_ROOT). That method checks root ownership and the absence of group or other write on every ancestor of /etc/firemud/account-jwt-api. This binding reads validator-inventory.json from the same root, but verifyProtectedDirectory(PROTECTED_ROOT) checks only the leaf directory. A non-root writer on /etc/firemud could rename the root and replace it between reads. The API binding blocks this case. The inventory binding accepts it. Apply the same chain check to the inventory binding so that both bindings give the same guarantee for one root.

      🛡️ Proposed fix

      --- "a/services/account-service/src/main/java/net/firedevops/firemud/accountservice/config/AccountJwtValidatorInventoryBinding.java"
      +++ "b/services/account-service/src/main/java/net/firedevops/firemud/accountservice/config/AccountJwtValidatorInventoryBinding.java"
      @@ -481,7 +481,9 @@
               || !path.equals(path.toRealPath())) {
             throw unavailable();
           }
      -    verifyProtectedDirectory(PROTECTED_ROOT);
      +    for (Path current = PROTECTED_ROOT; current != null; current = current.getParent()) {
      +      verifyProtectedDirectory(current);
      +    }
           BasicFileAttributes before =
               Files.readAttributes(path, BasicFileAttributes.class, LinkOption.NOFOLLOW_LINKS);
           Set<PosixFilePermission> mode = Files.getPosixFilePermissions(path, LinkOption.NOFOLLOW_LINKS);
      
      • Accepted Accepted protected-path parity: validate every ancestor root ownership and write permissions, not just the leaf directory; retain symlink and immutable-file checks.
    4. Make the recorded proof counts match the evidence for this head.Minor

      Line 13 states 727 Account unit cases "having zero failures, errors, or skips". The PR description reports 738 parsed Account unit tests with one skipped root-ownership fixture. The PR description also reports that exact-head Account job 114257031911 in Validation run 38067136500 passed the physical integration task. This entry instead says physical PostgreSQL proof and exact published-head CI "remain required".

      The tracker is the canonical reader-facing record of implementation status and validation. A reader cannot tell which snapshot the 727/154 counts belong to. A reader also cannot tell whether the skip claim is still true.

      Make these changes:

      • If 727/154 is an earlier snapshot, name its head and mark it as historical.
      • Record the 738-test result with its one skip.
      • Record the exact-head job 114257031911. State its limit: the job log does not expose case or skip totals.
      • Keep the remaining requirement for develop-based CI after the parent merges.

      As per coding guidelines: "Keep its status, implementation record, validation, gaps, decisions, and service-map sections aligned". As per path instructions: "Review docs for canonical-current-state consistency."

      • Accepted Accepted evidence correction: distinguish historical local counts from exact published-head physical task success and unknown case totals; keep runtime/develop closure unclaimed.
    5. Check the exception type for the direct desired-state UPDATE.Trivial

      This assertThatThrownBy has no .isInstanceOf(...) or message check. The test passes if any exception is thrown. That includes a SQL syntax error, a missing column after a later migration, or a transaction-template failure. As a result, the test does not prove that the desired-state guard trigger rejected the bypass.

      Assert DataAccessException, as AccountJwtJwksPublicationPersistenceIntegrationTest does. You can also check the constraint name that the trigger raises.

      ♻️ Proposed fix

      --- "a/services/account-service/src/test/java/integration/net/firedevops/firemud/accountservice/repository/AccountJwtSignerStoragePostgresIntegrationTest.java"
      +++ "b/services/account-service/src/test/java/integration/net/firedevops/firemud/accountservice/repository/AccountJwtSignerStoragePostgresIntegrationTest.java"
      @@ -306,19 +306,20 @@
                           () -> desired.abortUnpreparedGeneration(BINDING, trust, changedResult)))
               .isInstanceOf(AccountJwtSignerDesiredStateRepository.IdempotencyConflictException.class);
       
           assertThatThrownBy(
      -        () ->
      -            inTransaction(
      -                context,
      -                () ->
      -                    context
      -                        .dsl()
      -                        .execute(
      -                            "UPDATE account_jwt_signer_desired_states "
      -                                + "SET record_version = record_version + 1, "
      -                                + "generation_operation_id = NULL "
      -                                + "WHERE environment_id = ?",
      -                            BINDING.environmentId())));
      +            () ->
      +                inTransaction(
      +                    context,
      +                    () ->
      +                        context
      +                            .dsl()
      +                            .execute(
      +                                "UPDATE account_jwt_signer_desired_states "
      +                                    + "SET record_version = record_version + 1, "
      +                                    + "generation_operation_id = NULL "
      +                                    + "WHERE environment_id = ?",
      +                                BINDING.environmentId())))
      +        .isInstanceOf(org.jooq.exception.DataAccessException.class);
       
           var receipt =
               inTransaction(context, () -> desired.abortUnpreparedGeneration(BINDING, trust, result));
      
      • Accepted Accepted same proof defect as current CLI finding1: assert exact database rejection rather than any exception; one shared fix.
    6. Move the test to the directory that matches its package.Trivial

      This file declares package net.firedevops.firemud.accountservice.config;. It needs that package to call the package-private AccountJwtValidatorInventoryBinding.parseProtectedBytes. The file is located under unit/.../service/session/. The other unit tests in this cohort use the layout unit/<package path>, for example AccountJwtReadinessTrustBindingTest under unit/.../config/. Move the file to src/test/java/unit/net/firedevops/firemud/accountservice/config/. This keeps the package and directory aligned for IDEs and for per-directory test filters.

      • Accepted Accepted align unit test path with actual config package without changing test content or visibility.
    7. Restore the abort-receipt exclusion in the promotion insert guard.Minor

      The V106 version of account_jwt_signer_promotion_insert_guard() rejected a promotion when an account_jwt_signer_generation_abort_receipts row existed for NEW.generation_operation_id (V106 Lines 588-590). This replacement drops that condition.

      The following sequence becomes possible in one transaction:

      1. Insert the abort receipt. Its insert guard sees no promotion row yet.
      2. Insert a PROMOTE_PENDING promotion. state_row.generation_operation_id still points at the operation, so this guard passes.
      3. Clear the generation pointer through the abort CAS branch.

      The deferred account_jwt_generation_abort_terminal_guard then passes. The result is a retained PREPARED promotion for an aborted generation. The design document states that prepared promotion after abandonment remains rejected. The database no longer enforces that.

      Proposed fix

               OR result_row.observed_resource_version IS DISTINCT FROM NEW.expected_private_secret_resource_version
      -        OR result_row.public_key_fingerprint IS DISTINCT FROM NEW.target_public_key_fingerprint THEN
      +        OR result_row.public_key_fingerprint IS DISTINCT FROM NEW.target_public_key_fingerprint
      +        OR EXISTS (
      +            SELECT 1 FROM account_jwt_signer_generation_abort_receipts AS abort_receipt
      +             WHERE abort_receipt.operation_id = NEW.generation_operation_id) THEN
      

      Add an integration case that inserts an abort receipt and then a promotion in one transaction. Assert that the promotion insert is rejected.

      • Accepted Accepted restore aborted-generation exclusion lost in V125 and prove same-transaction abort/promotion insertion rejection.
    8. Remove the unused requireExactCurrentIdentity helper.Trivial

      Nothing in this class calls requireExactCurrentIdentity. PMD also reports it as UnusedPrivateMethod. The binding and trust checks it describes now run in readAndLockCurrentResult and verifyIntentMatches. A second, unused copy of those checks can mislead readers about which code enforces the trust fence. Delete the method.

      ♻️ Proposed fix

      --- "a/services/account-service/src/main/java/net/firedevops/firemud/accountservice/repository/AccountJwtJwksPublicationRepository.java"
      +++ "b/services/account-service/src/main/java/net/firedevops/firemud/accountservice/repository/AccountJwtJwksPublicationRepository.java"
      @@ -671,23 +671,6 @@
           }
         }
       
      -  private static void requireExactCurrentIdentity(
      -      Binding binding,
      -      TrustFence trust,
      -      GenerationResult result,
      -      String apiBindingDigest,
      -      String apiConfigRevision) {
      -    if (!result.binding().equals(binding)
      -        || !result.trustFence().equals(trust)
      -        || !result.trustFence().bindingDigest().equals(trust.bindingDigest())
      -        || !result.trustFence().configRevision().equals(trust.configRevision())) {
      -      throw new AccountJwtSignerDesiredStateRepository.BindingMismatchException(
      -          "Account JWT publication trust identity changed");
      -    }
      -    requireDigest(apiBindingDigest, "protected ConfigMap API binding digest");
      -    requireRevision(apiConfigRevision, "protected ConfigMap API configuration revision");
      -  }
      -
         private static byte[] canonicalJson(Object value) {
           try {
             return Rfc8785CanonicalJson.canonicalizeUtf8(JSON.writeValueAsString(value));
      
      • Accepted Accepted remove unused private identity helper; live locking and intent validation remain canonical enforcement.
  8. CLI Review 2 CompletedRuntime 3m 20s
    Found: 3 Accepted: 0/3/0 Routed: 0
    1. Add the V99–V125 implementation and proof anchors to the AA-1.3 capability row.Minor

      The row's gap text now covers V99–V125 signer lifecycle, readiness, and validator-inventory storage. The anchor cells do not list any of that code. The new anchors appear only in the prose section at Line 15. The tracker contract says the capability rows are "the complete scan-first status surface" and that partial rows "name concrete production anchors". A reader who scans only the row cannot find this evidence.

      Add these anchors to the Implementation anchors cell:

      • AccountJwtSignerDesiredStateRepository.java
      • AccountJwtReadinessProbeRepository.java
      • V99__account_jwt_signer_desired_state.sql
      • V125__account_jwt_signer_promotion_receipt_binding.sql

      Add these tests to the Proof anchors cell:

      • AccountJwtSignerStoragePostgresIntegrationTest.java
      • AccountJwtReadinessStoragePostgresIntegrationTest.java

      The gap text already says that per-suite execution is not individually confirmed. Keep that qualifier.

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

      • Accepted Accepted #3147 documentation obligation: AA-1.3 scan-first row omits the signer/readiness production and focused proof anchors added by this PR. Add canonical links without upgrading activation/completion; verified physical suite evidence may replace only stale proof wording.
    2. Add TRUNCATE guards to the two new evidence tables.Minor

      The row triggers on account_jwt_readiness_validator_pods and account_jwt_readiness_pod_receipts block UPDATE and DELETE. TRUNCATE does not fire row triggers. No table references account_jwt_readiness_pod_receipts by foreign key, so a plain TRUNCATE account_jwt_readiness_pod_receipts succeeds. It removes every per-Pod receipt and leaves the parent entries VERIFIED with pod_receipt_count set. The migration header promises "one immutable production verification receipt per Pod". The other signer and inventory tables in this PR have BEFORE TRUNCATE statement guards, for example account_jwt_signer_desired_state_no_truncate and the snapshot TRUNCATE rejection in AccountJwtValidatorInventoryPersistenceIntegrationTest. Add the same guard to both new tables.

      🛡️ Proposed addition

      CREATE FUNCTION account_jwt_readiness_pod_evidence_no_truncate()
      RETURNS trigger
      LANGUAGE plpgsql
      AS $$
      BEGIN
          RAISE EXCEPTION 'Account JWT readiness Pod evidence is retained' USING ERRCODE = '23514';
      END;
      $$;
      
      CREATE TRIGGER account_jwt_readiness_validator_pods_no_truncate
          BEFORE TRUNCATE ON account_jwt_readiness_validator_pods
          FOR EACH STATEMENT EXECUTE FUNCTION account_jwt_readiness_pod_evidence_no_truncate();
      CREATE TRIGGER account_jwt_readiness_pod_receipts_no_truncate
          BEFORE TRUNCATE ON account_jwt_readiness_pod_receipts
          FOR EACH STATEMENT EXECUTE FUNCTION account_jwt_readiness_pod_evidence_no_truncate();
      
      • Accepted Accepted #3147 retained-evidence defect: V123 has row UPDATE/DELETE guards but no BEFORE TRUNCATE guards on validator_pods/pod_receipts. Add statement guards and physical SQL rejection/no-loss proof; fix pending while Hosted active.
    3. Use IS DISTINCT FROM in the inventory guard. A missing JSON key now passes the guard.Minor

      The guard compares JSON values with <>. If a key is missing, ->> and #>> return NULL, and NULL <> 'x' is NULL. The guard joins its checks with OR, so when every other check is false the whole condition is NULL. PL/pgSQL does not take an IF branch whose condition is NULL. As a result:

      • A V1 plan without inventoryStatus, schemaVersion, or validators[0].validatorId is accepted. The check that keeps V1 plans "explicitly partial and Account-only" does not run.
      • A V2 plan with validator_inventory_complete = true and no inventoryStatus key is accepted as complete. Line 285 does not enforce the PROTECTED_LIVE_COMPLETE marker.
      • An incomplete V2 plan without inventoryStatus passes the ELSIF branch at line 298. That branch should require PARTIAL_UNCONFIRMED.
      • A missing schemaVersion (line 270) or productionProfiles (line 274, where jsonb_array_length(NULL) is NULL) also passes.

      The V125 comments say these triggers fence direct SQL callers as well as the repository. This NULL propagation weakens that fence. Line 271 already uses IS DISTINCT FROM, so use the same form for every text comparison. Wrap each array length in COALESCE(..., 0).

      🛡️ Proposed fix (representative lines)

      -           OR matrix ->> 'inventoryStatus' <> 'PARTIAL_UNCONFIRMED'
      -           OR matrix ->> 'schemaVersion' <> '1'
      -           OR jsonb_array_length(matrix -> 'validators') <> 1
      -           OR matrix #>> '{validators,0,validatorId}' <> 'account-service'
      -           OR jsonb_array_length(matrix #> '{validators,0,applicableProfiles}') <> 3
      +           OR matrix ->> 'inventoryStatus' IS DISTINCT FROM 'PARTIAL_UNCONFIRMED'
      +           OR matrix ->> 'schemaVersion' IS DISTINCT FROM '1'
      +           OR COALESCE(jsonb_array_length(matrix -> 'validators'), 0) <> 1
      +           OR matrix #>> '{validators,0,validatorId}' IS DISTINCT FROM 'account-service'
      +           OR COALESCE(jsonb_array_length(matrix #> '{validators,0,applicableProfiles}'), 0) <> 3
      ...
      -       OR matrix ->> 'schemaVersion' <> '2'
      +       OR matrix ->> 'schemaVersion' IS DISTINCT FROM '2'
      ...
      -       OR jsonb_array_length(matrix -> 'productionProfiles') <> 3 THEN
      +       OR COALESCE(jsonb_array_length(matrix -> 'productionProfiles'), 0) <> 3 THEN
      ...
      -        IF matrix ->> 'inventoryStatus' <> 'PROTECTED_LIVE_COMPLETE'
      +        IF matrix ->> 'inventoryStatus' IS DISTINCT FROM 'PROTECTED_LIVE_COMPLETE'
      ...
      -    ELSIF matrix ->> 'inventoryStatus' <> 'PARTIAL_UNCONFIRMED' THEN
      +    ELSIF matrix ->> 'inventoryStatus' IS DISTINCT FROM 'PARTIAL_UNCONFIRMED' THEN
      
      • Accepted Accepted #3147 fail-closed SQL defect: V123 JSON guard uses nullable comparisons/array lengths, so omitted required V1/V2 fields can bypass IF rejection. Make missing/null/malformed required fields reject and add raw SQL negatives; fix pending while Hosted active.
  9. Hosted Review 3 CompletedRuntime 8m 11s
    Found: 7 Accepted: 0/6/1 Routed: 0
    1. Add the V99–V125 anchors to the AA-1.3 capability row.Minor

      The AA-1.3 gap cell now describes V99–V125 signer, readiness, and validator-inventory storage. The anchor columns do not list that production or proof code.

      Line 15 names these anchors, but only in narrative text:

      • Production: AccountJwtSignerDesiredStateRepository.java, AccountJwtReadinessProbeRepository.java, V99, V125.
      • Proof: AccountJwtSignerStoragePostgresIntegrationTest.java, AccountJwtReadinessStoragePostgresIntegrationTest.java.

      The tracker contract makes capability rows the complete scan-first status surface. Add these files to the row's "Implementation anchors" and "Proof anchors" cells.

      As per coding guidelines: "the capability rows are the complete scan-first status surface" and "implemented and partial rows name concrete production anchors."

      • Accepted Accepted AA-1.3 row anchors; overlaps current accepted CLI finding1 and is fixed in the same batch, not another implementation obligation.
    2. Check the full ancestor directory chain for the readiness binding file.Minor

      verifyRootOwnedAndNonWritable checks only the immediate parent (realParent). It does not check the ancestors. AccountJwtJwksApiBinding.verifyProtectedDirectoryChain and AccountJwtValidatorInventoryBinding.verifyProtectedDirectoryChain check root ownership and the absence of group or other write on every ancestor. The readiness binding gives a weaker guarantee for the same threat. Assume a non-root principal can write to any ancestor directory. That principal can rename the root-owned parent and put a replacement directory in its place between reads. A root-owned file in the replacement directory would then pass this check. The readiness binding gates the readiness RPC trust. It must not accept a weaker filesystem fence than the API and inventory bindings.

      Walk realParent up to the filesystem root and apply the same owner and untrusted-write checks to each directory.

      🛡️ Proposed fix

           Path realParent = parent.toRealPath();
           Object fileOwner = Files.getAttribute(file, "unix:uid", LinkOption.NOFOLLOW_LINKS);
      -    Object directoryOwner = Files.getAttribute(realParent, "unix:uid", LinkOption.NOFOLLOW_LINKS);
           Set<PosixFilePermission> fileMode =
               Files.getPosixFilePermissions(file, LinkOption.NOFOLLOW_LINKS);
      -    Set<PosixFilePermission> directoryMode = Files.getPosixFilePermissions(realParent);
           if (!(fileOwner instanceof Number fileUid)
               || fileUid.longValue() != 0L
      -        || !(directoryOwner instanceof Number directoryUid)
      -        || directoryUid.longValue() != 0L
      -        || writable(fileMode)
      -        || writableByUntrusted(directoryMode)) {
      +        || writable(fileMode)) {
             throw new IOException("Protected readiness binding ownership is invalid");
           }
      +    for (Path current = realParent; current != null; current = current.getParent()) {
      +      Object directoryOwner = Files.getAttribute(current, "unix:uid", LinkOption.NOFOLLOW_LINKS);
      +      Set<PosixFilePermission> directoryMode =
      +          Files.getPosixFilePermissions(current, LinkOption.NOFOLLOW_LINKS);
      +      if (!(directoryOwner instanceof Number directoryUid)
      +          || directoryUid.longValue() != 0L
      +          || writableByUntrusted(directoryMode)) {
      +        throw new IOException("Protected readiness binding ownership is invalid");
      +      }
      +    }
         }
      
      • Accepted Accepted: readiness binding must enforce root ownership and no untrusted write on every ancestor, consistent with existing protected bindings.
    3. This test does not reach the stored-digest readback check.Trivial

      The test name says that different bytes cannot reuse a stored digest. The mock wrongIdentity returns clusterId = "other-cluster". The pre-insert requireBinding(snapshot, binding, trustFence) call at Line 48 of AccountJwtValidatorInventoryRepository rejects that value before any SQL runs. As a result, the test never runs the ON CONFLICT DO NOTHING insert or the FOR UPDATE readback. It also never calls requireSameSnapshot. The unit test rejectsWrongClusterNamespaceOrIncarnationBeforeInsert already covers the pre-insert rejection. The PostgreSQL immutability contract for a conflicting retry has no proof.

      Add a case that passes requireBinding and still conflicts with the stored row. Keep the same digest and canonicalBytes, and change a field that only requireSameSnapshot compares, for example apiBindingRevision. Then assert the rejection, and assert that the stored row is unchanged.

      🧪 Proposed addition

      +    InventorySnapshot conflictingMetadata = mock(InventorySnapshot.class);
      +    when(conflictingMetadata.observedAt()).thenReturn(observedAt);
      +    when(conflictingMetadata.environmentId()).thenReturn(environmentId);
      +    when(conflictingMetadata.clusterId()).thenReturn(candidate.clusterId());
      +    when(conflictingMetadata.clusterIncarnationUid()).thenReturn(CLUSTER_UID);
      +    when(conflictingMetadata.namespace()).thenReturn(namespace);
      +    when(conflictingMetadata.namespaceUid()).thenReturn(NAMESPACE_UID);
      +    when(conflictingMetadata.apiBindingRevision()).thenReturn("api-r2");
      +    when(conflictingMetadata.apiBindingDigest()).thenReturn(apiBindingDigest);
      +    when(conflictingMetadata.inventoryBindingRevision()).thenReturn(inventoryBindingRevision);
      +    when(conflictingMetadata.inventoryBindingDigest()).thenReturn(inventoryBindingDigest);
      +    when(conflictingMetadata.digest()).thenReturn(digest);
      +    when(conflictingMetadata.canonicalBytes()).thenReturn(canonicalBytes);
      +    assertThatThrownBy(
      +            () ->
      +                inTransaction(
      +                    context,
      +                    () -> repository.persistOrReadback(conflictingMetadata, BINDING, trust())))
      +        .isInstanceOf(
      +            AccountJwtValidatorInventoryRepository.InventorySnapshotUnavailableException.class);
      +    assertThat(count(context, "account_jwt_validator_inventory_snapshots")).isEqualTo(1L);
      
      • Accepted Accepted focused proof gap: valid owner binding with conflicting same-digest metadata must reach stored snapshot readback and preserve evidence.
    4. Block TRUNCATE on the retained readiness evidence tables.Minor

      The guards on account_jwt_readiness_pod_receipts and account_jwt_readiness_validator_pods are row-level BEFORE INSERT OR UPDATE OR DELETE triggers. TRUNCATE does not fire row-level triggers.

      account_jwt_readiness_pod_receipts is a leaf table, so no foreign key blocks a plain TRUNCATE of it. TRUNCATE ... CASCADE on the plan, entry, or Pod tables also bypasses every "evidence is retained" guard in V103 and V123. The delivery-claim table in V107 has the same gap.

      V106 already sets the pattern for retained evidence. It adds statement-level BEFORE TRUNCATE guards on account_jwt_signer_promotion_operations and account_jwt_signer_generation_abort_receipts. Add the same guards to these tables.

      Proposed addition (forward migration)

      CREATE FUNCTION account_jwt_readiness_no_truncate()
      RETURNS TRIGGER LANGUAGE plpgsql AS $$
      BEGIN
          RAISE EXCEPTION 'Account JWT readiness evidence cannot be truncated' USING ERRCODE = '23514';
      END;
      $$;
      CREATE TRIGGER account_jwt_readiness_plans_no_truncate
          BEFORE TRUNCATE ON account_jwt_readiness_probe_plans
          FOR EACH STATEMENT EXECUTE FUNCTION account_jwt_readiness_no_truncate();
      -- repeat for account_jwt_readiness_probe_entries, account_jwt_readiness_validator_pods,
      -- account_jwt_readiness_pod_receipts, account_jwt_readiness_delivery_claims
      
      • Accepted Accepted retained-evidence TRUNCATE denial across all five readiness tables, including cascading paths; overlaps CLI2 for two tables.
    5. Record the newer physical proof and its head limit.Minor

      Line 13 cites Account task 114264913703 on 607004fe786b. It also states that physical execution of the focused PostgreSQL suites "is not confirmed individually." The PR record has newer evidence:

      • Validation run 38081484419 on c866902037 passed Account job 114299184683.
      • Artifact 11680472723 physically ran the changed readiness case (1 passed, none skipped) and all three signer-storage PostgreSQL cases on PostgreSQL 18.6.

      The current head 7b79a8860b adds the expired-dispatch readiness scenario. That scenario has not yet executed physically.

      Line 15 says the suite counts are unavailable, which is also stale.

      Make these changes:

      • Mark the 607004fe result as historical.
      • Record the c866902037 artifact and its exact case counts.
      • State that the 7b79a8860b expired-dispatch case still needs exact-head physical execution.

      As per coding guidelines: "Keep its status, implementation record, validation, gaps, decisions, and service-map sections aligned". As per path instructions: "Review docs for canonical-current-state consistency."

      • Accepted Accepted proof-record correction; use verified current 7b79 PG18.6 artifact, not the now-stale review claim that expiry proof is unrun. Historical 607 remains labelled.
    6. Freeze signing_attempted_at_epoch_seconds in the V2 ISSUED → VERIFIED transition.Minor

      The V1 VERIFIED branch in V103 (Lines 380-381) rejects any change to signing_attempted_at_epoch_seconds. The V2 branch has no such check. A V2 VERIFIED update can therefore rewrite the signing-attempt time to any value that the row CHECK accepts, which is any value in [planned_issued_at, expires_at).

      The immutability check at Lines 534-552 does not cover this column. The V125 promotion proof does not include it either. The rewritten value would therefore pass promotion unnoticed.

      The other V2 branches (PLANNED → ISSUED, ABORTED, EXPIRED, CLEANED) all keep this column fixed. Add the same check here.

      Proposed fix

                  OR NEW.target_kid IS DISTINCT FROM OLD.target_kid
                  OR NEW.compact_token_sha256 IS DISTINCT FROM OLD.compact_token_sha256
      +           OR NEW.signing_attempted_at_epoch_seconds
      +                IS DISTINCT FROM OLD.signing_attempted_at_epoch_seconds
                  OR NEW.verified_at_epoch_seconds IS NULL
      
      • Accepted Accepted immutable signing-attempt timestamp across V2 ISSUED-to-VERIFIED; raw SQL rejection proof required.
    7. Bind the authority tuple to the locked snapshot before signing.Minor

      When spec.bound() is present, the signer replaces the snapshot-derived authorityTuple with caller-provided data. Shape validation does not check that the Account fields, including accountSecurityCutoff, match the snapshot. The signer can therefore produce a credential with stale or mismatched Account authority data.

      BoundDelegationClaims also shallow-copies its outer maps. A caller can mutate a nested authority map after construction and before serialization.

      Build the final tuple from the snapshot, overlay only tenant-scoped fields, reject mismatches in every Account-scoped field, and recursively copy nested maps before validation.

      --- "a/services/account-service/src/main/java/net/firedevops/firemud/accountservice/service/session/AccountMountedJwtSignerBundle.java"
      +++ "b/services/account-service/src/main/java/net/firedevops/firemud/accountservice/service/session/AccountMountedJwtSignerBundle.java"
      @@ -274,12 +274,32 @@
             headerFields.put("typ", "JWT");
             header = canonicalJsonBytes(headerFields);
             Map<String, Object> delegation = delegationClaims(identity, authority);
             if (spec.bound().isPresent()) {
               var bound = spec.bound().orElseThrow();
      +        @SuppressWarnings("unchecked")
      +        Map<String, Object> snapshotTuple =
      +            new LinkedHashMap<>((Map<String, Object>) delegation.get("authorityTuple"));
      +        for (String field :
      +            List.of(
      +                "issuerAuthGeneration", "accountAuthorityGeneration", "accountSecurityCutoff")) {
      +          if (!Objects.equals(snapshotTuple.get(field), bound.authorityTuple().get(field))) {
      +            throw invalid();
      +          }
      +        }
      +        snapshotTuple.put(
      +            "tenantAuthorityGeneration",
      +            bound.authorityTuple().get("tenantAuthorityGeneration"));
      +        snapshotTuple.put(
      +            "membershipAuthorityGeneration",
      +            bound.authorityTuple().get("membershipAuthorityGeneration"));
      +        if (bound.authorityTuple().containsKey("tenantBillingCutoff")) {
      +          snapshotTuple.put(
      +              "tenantBillingCutoff", bound.authorityTuple().get("tenantBillingCutoff"));
      +        }
               delegation.put("tenantId", bound.tenantId());
      -        delegation.put("authorityTuple", bound.authorityTuple());
      +        delegation.put("authorityTuple", snapshotTuple);
               delegation.put("membershipVersion", bound.membershipVersion());
             }
             net.firedevops.firemud.common.security.GameSessionAccountDelegationJwtProfileValidator
                 .validateClaims(delegation);
             claims = canonicalJsonBytes(delegation);
      

      In BoundDelegationClaims, replace the shallow Map.copyOf(authorityTuple) with a recursive immutable map copy and validate the copied value.

      • Accepted Accepted: bound signer must retain locked Account authority and reject mismatches; recursively freeze nested maps before validation. No activation.
  10. CLI Review 3 CompletedRuntime 2m 39s
    Found: 2 Accepted: 0/1/1 Routed: 0
    1. Remove the claim that capability status rows did not change.Minor

      Line 13 ends with "Existing capability status rows and prior gates remain unchanged." The same change edits the AA-1.3 row at Line 87. That edit adds AccountJwtSignerDesiredStateRepository, AccountJwtReadinessProbeRepository, the V99/V123/V125 anchors, the two PostgreSQL proof anchors, and new gap text. The tracker therefore contradicts itself about its own status surface.

      The tracker contract requires the status, implementation record, validation, and gaps sections to stay aligned. Change the sentence so it states what actually changed:

      Proposed wording fix

      -... with Account-local consequences in [Account Runtime and Data](../../architecture/microservices/account-service/runtime-and-data.md#implementation-status). Existing capability status rows and prior gates remain unchanged.
      +... with Account-local consequences in [Account Runtime and Data](../../architecture/microservices/account-service/runtime-and-data.md#implementation-status). The `AA-1.3` row adds these passive anchors and proof limits only; its `partial` / `drift-found` status and all other capability rows and prior gates remain unchanged.
      

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

      • Accepted Minor tracker inconsistency: AA-1.3 gained passive anchors and proof limits; preserve its partial/drift-found state but correct unchanged-row claim in current PR.
    2. Reduce the dependence on real elapsed time in the dispatched-recovery test.Trivial

      The plan expires 70 seconds after databaseNow. All pre-dispatch work must finish before that deadline. That work includes two RSA-3072 key generations, eight signing cycles, twelve receipt transactions, and several repository restarts. Line 940 asserts that the plan has not yet expired. On a slow or busy CI runner, that assertion can fail at random. The test then waits up to 75 more seconds, so every run takes over a minute.

      Move the post-expiry recovery checks (lines 1023-1061) into a separate test. That test can insert plan, entry, and receipt rows whose expires_at_epoch_seconds is a few seconds ahead. Alternatively, raise the headroom and tag this scenario as a slow test so it runs outside the default fast suite.

      • Accepted Minor proof reliability issue: broad negative/restart scenario must finish inside70s before real expiry. Separate lawful dispatched-expiry proof from bulky negatives; retain real PostgreSQL clock, production dispatch/receipts/commit and all guards. RSA setup count overstated.
  11. Hosted Review 4 CompletedRuntime 7m 34s
    Found: 1 Accepted: 0/1/0 Routed: 0
    1. Minor

      <Bind the V2 matrix to the protected inventory snapshot.

      account_jwt_readiness_plan_inventory_guard() validates the matrix independently. It does not compare the matrix validator IDs or profiles with account_jwt_validator_inventory_snapshots.

      The deferred closure guard derives expected entries and Pods from snapshot_json, but derives required production profiles from plan_row.applicability_matrix_json. A direct SQL caller can therefore pair a complete matrix with a different snapshot inventory. The Java plan builder normally derives both from the same snapshot, so this is a database defense-in-depth gap.

      Compare both validator ID sets and each snapshot validator’s profiles with the matrix validator’s applicableProfiles.

      Suggested closure-guard check

           IF actual_entry_count <> expected_entry_count
              OR actual_pod_count <> expected_pod_count
              OR actual_entry_count > 256 OR actual_pod_count > 256
      +       OR EXISTS (
      +            (SELECT value ->> 'validatorId'
      +               FROM jsonb_array_elements(snapshot_json -> 'validators')
      +             EXCEPT
      +             SELECT value ->> 'validatorId'
      +               FROM jsonb_array_elements(
      +                    plan_row.applicability_matrix_json::jsonb -> 'validators'))
      +            UNION ALL
      +            (SELECT value ->> 'validatorId'
      +               FROM jsonb_array_elements(
      +                    plan_row.applicability_matrix_json::jsonb -> 'validators')
      +             EXCEPT
      +             SELECT value ->> 'validatorId'
      +               FROM jsonb_array_elements(snapshot_json -> 'validators')))
      +       OR EXISTS (
      +            SELECT 1
      +              FROM jsonb_array_elements(snapshot_json -> 'validators') AS snapshot_validator(value)
      +              JOIN jsonb_array_elements(
      +                    plan_row.applicability_matrix_json::jsonb -> 'validators') AS matrix_validator(value)
      +                ON matrix_validator.value ->> 'validatorId'
      +                 = snapshot_validator.value ->> 'validatorId'
      +             WHERE snapshot_validator.value -> 'profiles'
      +                 IS DISTINCT FROM matrix_validator.value -> 'applicableProfiles')
              OR EXISTS (
      
      • Accepted Minor but useful database invariant gap: deferred V2 closure derives rows from protected snapshot while complete matrix is independently validated. Bind exact validator ID/profile sets to immutable snapshot, with direct SQL mismatch and valid closure proof; no activation.

Routed Findings

0 Open0 Accepted/Fixed0 Rejected

No routes recorded

Unlinked items

no items unlinked