PR #3147 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
- Subagent Review 1 CompletedModel: gpt-6-luna · XhighFound: 1 Accepted: 1 Routed: 0
- 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.
- Subagent Review 2 CompletedModel: gpt-6-luna · XhighFound: 0 Accepted: 0 Routed: 0
- No findings recorded for this run
- Subagent Review 3 CompletedModel: gpt-6-luna · XhighFound: 1 Accepted: 0 Routed: 0
- 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.
- Subagent Review 4 CompletedModel: gpt-6-luna · XhighFound: 2 Accepted: 1 Routed: 0
- 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.
- 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.
- Hosted Review 1 CompletedRuntime 9m 52sFound: 10 Accepted: 1/6/3 Routed: 0
- Require a writable transaction for every read that takes row locks.Minor
These reads take
FOR UPDATEorFOR KEY SHARElocks, but they only check that a transaction is active. PostgreSQL rejects row-lockingSELECTstatements in a read-only transaction, so these calls fail with rawDataAccessExceptions.readPreparedPublicationForRecoveryis also annotatedreadOnly = true, although its first call,readPreparedGenerationForRecovery, rejects read-only transactions.AccountJwtReadinessProbeRepositoryalready applies the writable check to its locked reads.services/account-service/src/main/java/net/firedevops/firemud/accountservice/repository/AccountJwtJwksPublicationRepository.java#L183-L186: removereadOnly = trueand callrequireWritableAccountTransaction().services/account-service/src/main/java/net/firedevops/firemud/accountservice/repository/AccountJwtJwksPublicationRepository.java#L75-L77: replacerequireAccountTransaction()withrequireWritableAccountTransaction()inreadCurrentIntent.services/account-service/src/main/java/net/firedevops/firemud/accountservice/repository/AccountJwtJwksPublicationRepository.java#L153-L155: replacerequireAccountTransaction()withrequireWritableAccountTransaction()inreadCurrentPublication.services/account-service/src/main/java/net/firedevops/firemud/accountservice/repository/AccountJwtValidatorInventoryRepository.java#L81-L88: replacerequireAccountTransaction()withrequireWritableAccountTransaction()inreadRequired.
📍 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-L77services/account-service/src/main/java/net/firedevops/firemud/accountservice/repository/AccountJwtJwksPublicationRepository.java#L153-L155services/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.
- Allow the owner-write bit on the root-owned parent directory.Minor
verifyRootOwnedAndNonWritableapplieswritable(directoryMode)to the parent directory, andwritableincludesOWNER_WRITE. The method already requires the directory owner to be UID 0, so a normal root-owned0755directory is rejected.AccountJwtJwksApiBinding.verifyProtectedDirectoryuseswritableByUntrustedfor 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.
- Reject
envFromon the selected container so the verifier runtime pin cannot be bypassed.MinorfindVerifiedContainerpinsFIREMUD_JWT_VERIFIER_CONFIGand rejectsSPRING_APPLICATION_JSON,JAVA_TOOL_OPTIONS, andJDK_JAVA_OPTIONS, but only when they appear inenv. The selected container'senvFromis never checked for these keys.rejectSigningMaterialEnvFromonly rejects asecretRefnamedjwt-signing-keys. AconfigMapReforsecretRefinenvFromcan therefore injectJAVA_TOOL_OPTIONSorSPRING_APPLICATION_JSONand change verifier behavior. The snapshot would still report the pinnedverifierConfigSha256. Per-Pod receipts later trust that digest as evidence of the runtime configuration. The narrowest fix is to reject any non-emptyenvFromon 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.
- Use a well-formed billing cutoff so the test proves that the
tenantBillingCutoffkey is forbidden.TrivialLine 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 ifPlayerBootstrapJwtProfileValidatoraccepts a well-formedtenantBillingCutoff. 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.
- Wrap delivery-consumer failures the same way as the delegation path.Minor
In
signReadinessProbeDigest, aRuntimeExceptionfromdeliveryConsumer.persistAttemptAndDeliverpropagates unchanged.signCommittedGameplayDelegationDigest(lines 317-322) andsignCommittedControlUiDigestreplace callback failures withinvalid()so that exception chains never keep the transient compact credential. Representative readiness probes are realcontrol-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.
- 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.
AccountJwtSignerStoragePostgresIntegrationTestalready usesAccountPostgresIntegrationFixtureand an@AfterEachschema cleanup.services/account-service/src/test/java/integration/net/firedevops/firemud/accountservice/repository/AccountJwtJwksPublicationPersistenceIntegrationTest.java#L339-L358: useAccountPostgresIntegrationFixture.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.
- 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.
- Bind
readiness_evidence_digestto the stored readiness proof.Minoraccount_jwt_signer_promotion_insert_guard()validatesNEW.readiness_evidence_digestonly through the lifecycle shape constraint. Its readiness query matchesreadiness_plan_digestand the verified probe entries, but it does not compareNEW.readiness_evidence_digestwith a digest derived from those entries.The Java repository computes
readinessEvidenceDigestfrom 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.
- Add a terminal abort path for an unprepared generation operation.Major
The desired-state guard has no transition from
generation_operation_idset andprepared_operation_idNULLto both fieldsNULL. If readiness evidence expires or a probe becomesABORTEDbefore promotion insertion, the promotion insert guard rejects the request. The generation operation can then remain pinned, and later generation requests remain blocked.abortPreparedBeforeMutationdoes not resolve this case. It requires the operation to be the currentprepared_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.
- Close the per-request
HttpClientafter each call.Trivialsendbuilds a newHttpClientfor 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 singleAccountJwtValidatorInventorySource.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+:AccountJwtValidatorInventorySourceusesList.getFirst(). On Java 21+,HttpClientimplementsAutoCloseable, 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.
- CLI Review 1 CompletedRuntime 3m 05sFound: 4 Accepted: 1/1/2 Routed: 0
- Make the negative promotion checks assert the specific V125 constraint.Trivial
These negative checks only expect
RuntimeException.insertDirectPromotionwrites a placeholderrequest_digest("a".repeat(64)) andexpected_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
DataAccessExceptionto itsPSQLExceptionand checkgetServerErrorMessage().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.
- the digest/preimage check (
- A dispatched promotion becomes permanently stuck in
PREPAREDwhen its readiness window expires.MajorcommitPreparedPromotionrequires an unexpired readiness plan and unexpired VERIFIED entries. The checks are inrequireUnexpiredCurrentReadinessProofand in the terminalUPDATE, which testsplan.expires_at_epoch_seconds > clock_timestamp(). The plan window is at most 300 seconds afternot_before. AfterreadAndMarkPreparedPromotionDispatchedcommits,abortPreparedBeforeMutationrejects the abort. The V106account_jwt_signer_operation_guardalso blocksABORTEDonceprivate_promotion_dispatched_at IS NOT NULL.AccountJwtReadinessProbeRepository.readPromotionProofreturnsOptional.empty()oncereadinessPlanOutOfWindowis 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.
verifyPreparedIsUnavailableblocks every ordinary signer read.readCurrentCommittedSignerthrows. 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
PREPAREDboundary, before dispatch. Bind the commit to the immutable proof that was frozen inreadiness_evidence_preimageandreadiness_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 V106COMMITTEDguard 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.
- Assert the exception type for the direct desired-state update.Trivial
This
assertThatThrownByhas no.isInstanceOf(...). Any exception passes the check, including a wiring or SQL syntax failure. Every other negative SQL check in these suites expectsDataAccessException. 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.
- 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 Statusrow. 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, andV125__account_jwt_signer_promotion_receipt_binding.sql. - Link the focused proof sources, for example
AccountJwtSignerStoragePostgresIntegrationTest.javaandAccountJwtReadinessStoragePostgresIntegrationTest.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 "
implementedandpartialrows 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.
- Name the existing capability row that owns this preparation, for example the
- Hosted Review 2 CompletedRuntime 10m 49sFound: 8 Accepted: 0/4/4 Routed: 0
- Bind the receiver's inventory coordinates to the protected snapshot.Minor
LocalIdentityrejects missing or malformed inventory coordinates, butreadCurrentProbeOwnernever uses them.requireLiveInventoryMatcheschecks only Account's stored snapshot against the live snapshot. A receiver can therefore provide arbitrary well-formed coordinates and still receive owner evidence.Compare
sourceInventoryRevisionandsourceInventoryDigestwith the authoritative live inventory binding values, then update the fixture. If these fields have no authority, remove them fromLocalIdentityinstead of validating unused data.- Accepted Accepted receiver selector must match authoritative inventory binding revision and digest; prove changed-coordinate denial.
- Validate representative claims before signing.Trivial
signReadinessProbeDigestserializesreadinessClaims(spec)and signs it without calling the selected profile validator. The current counter types,scopedRoles, and omittedtokenProfilematch 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.
- Verify the full directory chain for the shared protected root.Minor
AccountJwtJwksApiBinding.readCurrentProtectedStatecallsverifyProtectedDirectoryChain(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 readsvalidator-inventory.jsonfrom the same root, butverifyProtectedDirectory(PROTECTED_ROOT)checks only the leaf directory. A non-root writer on/etc/firemudcould 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.
- 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
114257031911in Validation run38067136500passed 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.
- Check the exception type for the direct desired-state
UPDATE.TrivialThis
assertThatThrownByhas 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, asAccountJwtJwksPublicationPersistenceIntegrationTestdoes. 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.
- 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-privateAccountJwtValidatorInventoryBinding.parseProtectedBytes. The file is located underunit/.../service/session/. The other unit tests in this cohort use the layoutunit/<package path>, for exampleAccountJwtReadinessTrustBindingTestunderunit/.../config/. Move the file tosrc/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.
- 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 anaccount_jwt_signer_generation_abort_receiptsrow existed forNEW.generation_operation_id(V106 Lines 588-590). This replacement drops that condition.The following sequence becomes possible in one transaction:
- Insert the abort receipt. Its insert guard sees no promotion row yet.
- Insert a
PROMOTE_PENDINGpromotion.state_row.generation_operation_idstill points at the operation, so this guard passes. - Clear the generation pointer through the abort CAS branch.
The deferred
account_jwt_generation_abort_terminal_guardthen passes. The result is a retainedPREPAREDpromotion 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) THENAdd 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.
- Remove the unused
requireExactCurrentIdentityhelper.TrivialNothing in this class calls
requireExactCurrentIdentity. PMD also reports it asUnusedPrivateMethod. The binding and trust checks it describes now run inreadAndLockCurrentResultandverifyIntentMatches. 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.
- CLI Review 2 CompletedRuntime 3m 20sFound: 3 Accepted: 0/3/0 Routed: 0
- Add the V99–V125 implementation and proof anchors to the
AA-1.3capability row.MinorThe 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
partialrows "name concrete production anchors". A reader who scans only the row cannot find this evidence.Add these anchors to the Implementation anchors cell:
AccountJwtSignerDesiredStateRepository.javaAccountJwtReadinessProbeRepository.javaV99__account_jwt_signer_desired_state.sqlV125__account_jwt_signer_promotion_receipt_binding.sql
Add these tests to the Proof anchors cell:
AccountJwtSignerStoragePostgresIntegrationTest.javaAccountJwtReadinessStoragePostgresIntegrationTest.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 Statusrow 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.
- Add
TRUNCATEguards to the two new evidence tables.MinorThe row triggers on
account_jwt_readiness_validator_podsandaccount_jwt_readiness_pod_receiptsblock UPDATE and DELETE.TRUNCATEdoes not fire row triggers. No table referencesaccount_jwt_readiness_pod_receiptsby foreign key, so a plainTRUNCATE account_jwt_readiness_pod_receiptssucceeds. It removes every per-Pod receipt and leaves the parent entriesVERIFIEDwithpod_receipt_countset. The migration header promises "one immutable production verification receipt per Pod". The other signer and inventory tables in this PR haveBEFORE TRUNCATEstatement guards, for exampleaccount_jwt_signer_desired_state_no_truncateand the snapshot TRUNCATE rejection inAccountJwtValidatorInventoryPersistenceIntegrationTest. 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.
- Use
IS DISTINCT FROMin the inventory guard. A missing JSON key now passes the guard.MinorThe guard compares JSON values with
<>. If a key is missing,->>and#>>return NULL, andNULL <> 'x'is NULL. The guard joins its checks withOR, so when every other check is false the whole condition is NULL. PL/pgSQL does not take anIFbranch whose condition is NULL. As a result:- A V1 plan without
inventoryStatus,schemaVersion, orvalidators[0].validatorIdis accepted. The check that keeps V1 plans "explicitly partial and Account-only" does not run. - A V2 plan with
validator_inventory_complete = trueand noinventoryStatuskey is accepted as complete. Line 285 does not enforce thePROTECTED_LIVE_COMPLETEmarker. - An incomplete V2 plan without
inventoryStatuspasses the ELSIF branch at line 298. That branch should requirePARTIAL_UNCONFIRMED. - A missing
schemaVersion(line 270) orproductionProfiles(line 274, wherejsonb_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 inCOALESCE(..., 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.
- A V1 plan without
- Hosted Review 3 CompletedRuntime 8m 11sFound: 7 Accepted: 0/6/1 Routed: 0
- Add the V99–V125 anchors to the
AA-1.3capability row.MinorThe
AA-1.3gap 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 "
implementedandpartialrows 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.
- Production:
- Check the full ancestor directory chain for the readiness binding file.Minor
verifyRootOwnedAndNonWritablechecks only the immediate parent (realParent). It does not check the ancestors.AccountJwtJwksApiBinding.verifyProtectedDirectoryChainandAccountJwtValidatorInventoryBinding.verifyProtectedDirectoryChaincheck 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
realParentup 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.
- 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
wrongIdentityreturnsclusterId = "other-cluster". The pre-insertrequireBinding(snapshot, binding, trustFence)call at Line 48 ofAccountJwtValidatorInventoryRepositoryrejects that value before any SQL runs. As a result, the test never runs theON CONFLICT DO NOTHINGinsert or theFOR UPDATEreadback. It also never callsrequireSameSnapshot. The unit testrejectsWrongClusterNamespaceOrIncarnationBeforeInsertalready covers the pre-insert rejection. The PostgreSQL immutability contract for a conflicting retry has no proof.Add a case that passes
requireBindingand still conflicts with the stored row. Keep the samedigestandcanonicalBytes, and change a field that onlyrequireSameSnapshotcompares, for exampleapiBindingRevision. 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.
- Block
TRUNCATEon the retained readiness evidence tables.MinorThe guards on
account_jwt_readiness_pod_receiptsandaccount_jwt_readiness_validator_podsare row-levelBEFORE INSERT OR UPDATE OR DELETEtriggers.TRUNCATEdoes not fire row-level triggers.account_jwt_readiness_pod_receiptsis a leaf table, so no foreign key blocks a plainTRUNCATEof it.TRUNCATE ... CASCADEon 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 TRUNCATEguards onaccount_jwt_signer_promotion_operationsandaccount_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.
- Record the newer physical proof and its head limit.Minor
Line 13 cites Account task
114264913703on607004fe786b. It also states that physical execution of the focused PostgreSQL suites "is not confirmed individually." The PR record has newer evidence:- Validation run
38081484419onc866902037passed Account job114299184683. - Artifact
11680472723physically ran the changed readiness case (1 passed, none skipped) and all three signer-storage PostgreSQL cases on PostgreSQL 18.6.
The current head
7b79a8860badds 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
607004feresult as historical. - Record the
c866902037artifact and its exact case counts. - State that the
7b79a8860bexpired-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.
- Validation run
- Freeze
signing_attempted_at_epoch_secondsin the V2ISSUED→VERIFIEDtransition.MinorThe V1
VERIFIEDbranch in V103 (Lines 380-381) rejects any change tosigning_attempted_at_epoch_seconds. The V2 branch has no such check. A V2VERIFIEDupdate can therefore rewrite the signing-attempt time to any value that the rowCHECKaccepts, 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.
- Bind the authority tuple to the locked snapshot before signing.Minor
When
spec.bound()is present, the signer replaces the snapshot-derivedauthorityTuplewith caller-provided data. Shape validation does not check that the Account fields, includingaccountSecurityCutoff, match the snapshot. The signer can therefore produce a credential with stale or mismatched Account authority data.BoundDelegationClaimsalso 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 shallowMap.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.
- CLI Review 3 CompletedRuntime 2m 39sFound: 2 Accepted: 0/1/1 Routed: 0
- 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.3row at Line 87. That edit addsAccountJwtSignerDesiredStateRepository,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.
- 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_secondsis 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.
- Hosted Review 4 CompletedRuntime 7m 34sFound: 1 Accepted: 0/1/0 Routed: 0
- 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 withaccount_jwt_validator_inventory_snapshots.The deferred closure guard derives expected entries and Pods from
snapshot_json, but derives required production profiles fromplan_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
profileswith the matrix validator’sapplicableProfiles.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
No routes recorded
Unlinked items
no items unlinked