29 KiB
P07 credential and scope Astra review
Final disposition: approved for P07. The final reconciliation below supersedes the historical open dispositions. The superseding full P07 run 20261116T160335.804917Z-5a4994c32d15 passed 393/393 applicable tests with zero failures/skips, including Host 91, Configuration 20, and ControlPlane 21. Actual TLS, deployed rotation/restart, SQL migration/concurrency, and final implementation approval remain later gates.
Earlier checkpoint disposition (historical): five original findings and normal scope-history reclamation were repaired; failed trust retirement/reintroduction and observation-admission races remained open. This initial read-only review covered the frozen DataConnectionSecretProvisioner, DataConnectionCredentialResolver, DataConnectionSecretChangeHandler, DataConnectionTrustPolicy/store, DataConnectionSecurityProvider, and their four Host test classes while startup/composition and the remote client were still being implemented. No builds, tests, Docker commands, or commits were run by the reviewer. The original findings below are retained chronologically; the final repair dispositions and evidence are recorded at the end.
Findings
P2 — A transient import failure permanently consumes the mounted bundle version
ApplyAsync persists every entry as Version=V/Pending=true before encryption/payload writes and its final commit (DataConnectionSecretProvisioner.cs:108-124). Its validation then rejects every future bundle with a version less than or equal to V (:103-106). A transient payload store/encryption failure, cancellation after the first save, or crash before the final save leaves a Pending entry that cannot be completed by replaying the identical mounted bundle after recovery/restart. The existing failed-store test proves denial, but does not test recovery.
Persist an immutable attempt identity and support safe resumption of that same attempt, or provide an equivalent durable transaction recovery protocol. A different payload under the same version must still reject. Regress failure after pending persistence, partial multi-entry writes, and failure of the final commit; restart and replay the identical bundle must eventually make its correctly committed entries usable without inventing a higher operator version. Recovery must never expose mixed/partially committed state.
P2 — Committed credential versions are not bound to their stored payloads
The durable state records only Version, Deleted, and Pending (DataConnectionSecretProvisioner.cs:22-27). The resolver decrypts the current secret row and labels it with that independently stored version (DataConnectionCredentialResolver.cs:19-24). After a successful V2 import, an external editor or delayed store/replication update can replace the payload with an old V1 row; the resolver returns the old bearer labeled V2. The tombstoned-row test covers Deleted=true, but not replacement of an active committed payload.
The packet owner confirmed the intended contract: external replacement must fail closed until explicitly reprovisioned at a higher version. Bind the committed version to an authenticated encrypted-state content hash or appropriate durable store revision and verify it on resolve. Regress active V2 followed by an old or different payload row; it must not return that replacement as V2. The same operation/content identity can support the safe pending retry above. Never include plaintext bearer values in diagnostics or unencrypted version metadata.
P2 — A failed scope-removal deletion is forgotten permanently
SetScopeAsync saves the reduced scope and tombstones first, then deletes orphaned payload rows (DataConnectionSecretProvisioner.cs:73-85). If DeleteAsync fails, replay of the same scope/version returns before cleanup (:69-70). A later scope version computes orphaned references from the already-reduced scope, so the failed deletion is no longer discoverable. Logical resolution remains denied, which is correct, but the retired encrypted material has no durable cleanup obligation and may remain indefinitely.
Retain resumable deletion work until actual store cleanup completes, with safe idempotent retry after restart or same-scope replay. Preserve deny-before-cleanup and shared-reference ownership: a reference still used by an allowed connection cannot be deleted. Regress a failed delete after state persistence, restart, and successful cleanup without resurrecting access; include a shared-reference positive.
P2 — Historical state has no lifetime bound or reclamation rule
DataCredentialState.Versions retains every historical secret reference, including tombstones. The trust store likewise retains every historical connection entry/removal marker. DataConnectionSecurityProvider._observed retains every ResolveAsync ID forever, including failed and non-HTTPS lookups, and every secret invalidation scans all those IDs (DataConnectionSecurityProvider.cs:14, :24, :34). A one-MiB bundle-file limit bounds one import only; small sequential deployments with new IDs grow the persisted state and in-process invalidation work without bound.
Define bounded live-state ownership and a safe generation/version barrier for retired history, or an explicit bounded persistence protocol with a recovery/reclamation path. Do not solve this solely by permanently exhausting a quota after enough historical IDs. The observed-ID set should reflect currently owned connections or use another bounded invalidation mechanism. Regress sequential distinct-ID/reference churn and failed lookups while retaining downgrade/stale-bundle protection and progress for a fresh active connection.
P2 — Trust policy does not enforce the required SAN identity
DataConnectionTrustPolicy.Validate ignores the request URI and only rejects a supplied name-mismatch flag before custom-chain validation (DataConnectionTrustPolicy.cs:23-33). Its positive unit test creates a CN-only certificate with no SAN and expects it to pass when given SslPolicyErrors.None. That does not establish the plan's explicit DNS/IP SAN identity contract and depends on the platform's hostname policy.
Check the requested endpoint's DNS/IP SAN explicitly, with common-name fallback disabled, while preserving custom-root chain and server-auth validation. The official .NET 10 MatchesHostname API exposes an allowCommonName choice; its default is true. Add actual CA-issued server-leaf positives, absent/wrong SAN, IP SAN, wrong root, removed root, and wrong usage/expired-leaf negatives as appropriate. The existing injected NameMismatch case alone is not SAN coverage. Real TLS/listener/certificate rotation remains P10 evidence.
P2 — One throwing notification subscriber can prevent required retirement fan-out
DataConnectionSecretChangeHandler invokes multicast actions directly (DataConnectionSecretChangeHandler.cs:8-11), and the security provider similarly invokes its Changed event directly. The provisioner calls these notifications after persisting a pending import or reduced scope and before finishing all entries/connections. A throwing first subscriber prevents later subscribers and later connection notifications; a rotation can therefore leave required retirement listeners uninformed while durable state has already changed. Store denial on future resolution does not itself cancel an already active stream.
Make required retirement notification fan-out resilient to individual callback failure and preserve/retry any operation-wide obligations. Errors may be reported, but cannot silently skip other affected connections. Test two listeners where the first throws and the second receives the retirement, plus a multi-connection shared-reference rotation/removal. Compose this with the existing invalidator and Galaxy notification path rather than replacing them. Do not run arbitrary blocking subscriber work under the global state semaphore if the integration can reenter credential resolution.
Reviewed properties and integration obligations
- Scope is persisted before removed connections are notified/deleted, and the resolver rejects missing, Pending, or Deleted entries. Explicit tombstones prevent the already-tested retired-row resurrection. Shared references are retained while another allowed connection still names them. These are useful foundations; the recovery and active-payload-binding gaps above remain.
- Node/owner checks and the reference allowlist precede bundle payload mutation. Import writes encrypted payloads using the existing secret-store pattern, and credential/entry ToString methods redact values. The bounded reader supports atomic file replacement by opening with delete sharing; it does not by itself supply a production bundle watcher or restricted-file deployment policy.
- Trust is independently versioned, persists empty-root removal markers, uses custom-root trust and server-auth application policy, and rejects explicit name mismatch. Roots are copied from public certificate bytes. These observations do not establish real TLS behavior, and the SAN finding remains open.
- The four test classes include an actual SQLite/encryption restart test, but no execution result was supplied for this packet. They currently do not cover the new failure/recovery cases, changed-event composition, active streams/outcome observers, or packet lifecycle bounds.
- Host has not yet composed the bundle reader/provisioner, current allowlist, trust store, and change handler into startup/runtime lifecycle. The existing
SecretChangeSignallingInvalidatorstill calls only its inner invalidator and Galaxy directory at this checkpoint; adding the data notification must preserve both. This is a known uncompleted composition boundary, not a claim that final Host wiring is defective. - Credential/trust resolution is split across awaits. The actively implemented remote channel code currently captures a security-generation value before resolution and rejects changed generations before installing a channel. Keep that invariant and regress rotation/removal during resolution; a retired snapshot must not install a new channel after its retirement event. The active remote code was not reviewed as final.
- Scope/credential/trust retirement must deny new dispatch, retire channels and quiet streams, and retain only bounded observers for already dispatched mutations. A callback notification alone is not final evidence of those effects. No credential or trust rotation may replay a mutation or relabel its original outcome ownership.
The coordinator and packet owner received each finding for test-first correction. Final packet closure requires frozen repaired source and actual focused evidence, followed by the complete P07 review/gate after Host and remote composition are finished.
First frozen repair rereview
The coordinator supplied 20261116T130336.930026Z-3b0156408b84. The reviewer independently read its run record and TRX: the selected Host component packet passed 29/29, zero failed/skipped, including all 19 credential/trust cases in the four reviewed classes. This is not the full P07 gate.
- Interrupted-import recovery repaired: pending entries now persist their intended content/deletion hash; an equal-version retry is accepted only while Pending and only for identical content. A changed payload under that version still rejects. The focused interrupted-version test proves denial after the initial failed write, changed-payload rejection, restart, and successful identical retry.
- Committed payload/version binding repaired: resolution hashes the decrypted payload and requires the committed encrypted-state hash. The active-row replacement regression returns unavailable rather than labeling replacement material with the stored version.
- Deletion recovery repaired: removed refs and affected connections become durable PendingDeletes/PendingNotices before work. Exact-scope replay completes those obligations rather than returning immediately; successful deletion is persisted per reference. Reintroduced/live refs are excluded from deletion. The restart-after-delete-failure regression passes.
- SAN enforcement repaired: validation explicitly matches RequestUri.IdnHost with common-name fallback disabled before custom-root chain validation. The focused tests now reject CN-only identity and validate a CA-issued SAN leaf against the correct/wrong issuer. Real wire trust rotation remains P10.
- Notification fan-out repaired: each subscriber and each affected connection is attempted despite individual exceptions, then failures are aggregated. Scope notices remain durable for same-version retry, and trust updates remain PendingNotice/unresolvable until successful notification. Tests cover a throwing first subscriber, same-scope notification retry, and same-version trust notification recovery. Final composition must still preserve the existing invalidator/Galaxy path and actual stream retirement.
Still open — a finite historical cap permanently exhausts availability
The repair limits Versions and trust history to 256 entries, but does not reclaim absent historical entries (DataConnectionSecretProvisioner.cs:134-135; DataConnectionTrustPolicy.cs:63). After 256 sequential retired refs/connection IDs, a fresh active ID is permanently rejected even when the live scope is empty. SecurityProvider similarly caps _observed without removal; 256 failed HTTPS lookups can prevent a later valid connection from resolving. The new tests assert failure at the historical cap, not progress after churn. The memory growth is bounded, but the original availability/lifetime finding remains unresolved.
The coordinator/worker proposed a durable scope-generation floor as the next repair direction. That is sound if every credential bundle and trust update must carry the exact current authoritative generation; floor and allowlist are atomically persisted before retirement/reclamation; and absent history is reclaimed only after cleanup and no remaining live reference. The floor must survive offline restart and come from a trusted monotonic deployed-scope revision. A process-local authority/catalog epoch, wall clock, or local increment that turns an old artifact into a fresh scope is insufficient.
Include generation in immutable retry identity and reject an old generation even when its material Version is larger. Unchanged allowed references may retain already committed material; new updates must use the current generation. Regress removal/reintroduction of the same reference, old high-version bundle/trust replay after restart, failed cleanup, and more than 256 sequential IDs while a fresh active ID still progresses. Provider observation must track live ownership or another reclaimable bounded invalidation set. This direction has not yet been source-reviewed or tested as an implementation.
Scope-floor repair checkpoint — two paths still open
The next frozen repair adds an exact persisted scope generation to credential bundles and trust updates, includes it in equal-version pending retry identity, and removes retired credential versions after successful physical deletion. Trust also persists an allowlist/floor before notifying removal and reclaiming absent entries. Source inspection verifies those normal-path barriers. The reviewer read the actual TRX for 20261116T131308.089661Z-57464278e345: 32 executed, 31 passed, one failed. The failure is the separately identified Root publication-disposal race; the credential/trust scope-generation churn cases passed. This is not an all-green component or phase claim.
Two remaining concrete paths prevent closing the lifetime/reclamation work:
P2 — Failed trust retirement can reactivate old trust on reintroduction
ApplyScope persists removed IDs in PendingNotices but leaves their trust Entries intact until notification completes. If removal notification fails, then a newer scope reintroduces the same ID, CompleteScope clears the notice and retains the old Entry because it is once again in Scope (DataConnectionTrustPolicy.cs:63-68, :79-85). Resolve then returns the retired CA without a new current-generation SetAsync.
Regress scope 1 containing A and an old CA; scope 2 empty with a throwing observer; scope 3 containing A after observer recovery. Trust must remain unavailable until explicitly provisioned under scope 3. Mark the entry retired durably when scope removal is persisted, or reclaim all pending-retired entries even when the ID has been reintroduced before cleanup. Preserve the successful notification/retry and unchanged-live-reference cases.
P2 — Observation admission can race past the removal notification
SecurityProvider awaits IsEligibleAsync, then inserts the ID into _observed. Scope can be removed after eligibility completes but before that insertion: OnConnectionChanged removes nothing, the resolver then inserts the now-retired ID, later credential lookup returns null, and the stale observation remains. Repeating this window with distinct IDs exhausts the 256 cap despite empty live scope (DataConnectionSecurityProvider.cs:24-32). The client's separate security-generation check prevents installation of a stale channel, but does not reclaim this provider state.
Fence observation admission against scope/change generation or use an equivalent owned conditional-cleanup protocol. Regress the eligibility-to-registration window deterministically and require eventual fresh-ID progress; do not remove another live observation merely because one concurrent resolve failed.
Authoritative central scope revision direction
A bounded singleton central state row containing a positive checked scope revision, canonical current allowlist fingerprint, and concurrency token is an appropriate minimal durable source. It needs no historical-ID dictionary. This is a design decision only; migration/composer integration is not yet reviewed.
- Increment only when effective scope changes. No-op scope reuses the revision, while A → B → A advances twice. Serialize the positive revision into every newly sealed artifact, including the empty/removal scope.
- Canonicalize the effective owner/consumer/connection-to-secret-and-trust allowlists using admission's identity semantics and scope-affecting enabled state. Exclude rowversions and timestamps from the semantic fingerprint.
- Serialize revision assignment with the validated draft. Current ComposeDeploymentAsync reads and commits the DraftSnapshotFactory transaction before later validation/composition. Allocating a new scope revision afterward can let delayed composer A seal an old allowlist with a revision newer than composer B's intervening removal. Lock the state row before reading the draft and hold an outer transaction through validation, compare/increment, composition and Deployment persistence, or use a snapshot-version CAS that retries the entire read/validate/compose. DraftSnapshotFactory already honors an existing transaction.
- Commit the state row and sealed deployment artifact together, and dispatch only after commit. A conflict retries the entire snapshot; do not reuse an old validated snapshot with a freshly allocated generation. Counter exhaustion must fail before changing authority.
- Keep ConfigComposer.Compose pure over its supplied snapshot, including the selected scope revision. SnapshotAndFlatten/drift probes must remain read-only and must not advance the counter. Extend no-op hash stability, concurrent sealing, rollback, and schema/model-compliance tests for the additive row/field.
- Consumers persist the floor across offline restarts. Missing/stale versions after a known floor cannot overwrite it or reactivate connections, including legacy/empty-artifact parsing. Intentional rollback requires a newly sealed higher scope generation rather than replay of an old artifact. Restoring central storage to an older counter cannot reset consumer floors.
The proposed transaction boundary and consumer-floor rules were sent to the coordinator before migration work. The two local failure/race findings above remain open, and complete Host composition/full P07 review is still required.
Frozen repair and central source checkpoint
The reviewer independently read run 20261116T134802.525866Z-44c634f2fd5c and its TRX: 192 selected cases passed with zero failed/skipped, including Host 66 and all current credential/trust cases. The two preceding local findings are repaired: trust entries are marked Retired in the same saved removal state, and completion removes retired entries even if a later scope reintroduces the ID. Resolve denies Retired. The failed-retirement/reintroduction regression passed. SecurityProvider captures a change generation before eligibility and admits an observation only after credential/trust resolution, under the generation lock; all scope/secret events advance that generation. The eligibility-to-observation removal regression passed, and failed resolves no longer enter the observed set. Together with the earlier verified repairs and scope-churn/restart cases, this closes the prior local credential findings at the reviewed component boundary. Final activation/rotation wiring is still pending.
ComposeDeploymentAsync now starts a Serializable transaction and takes the singleton scope-state write lock before DraftSnapshotFactory reads the draft. The factory reuses the outer transaction. The scope revision/fingerprint, Deployment artifact, and ConfigEdit are saved together; transaction commit precedes DispatchDeployment. This source ordering implements the approved stale-composer barrier. Pure ConfigComposer takes the scope version from its supplied snapshot, while read-only factory/drift paths do not advance it. The new singleton migration seeds ID 1/version 0, constrains singleton identity/nonnegative revision, and adds rowversion. Migration/model changes postdate the 192-case run and are not covered by that result; no SQL application was performed by this reviewer.
P2 — Central and consumer identifier semantics disagree
DataConnectionScopeRevision uppercases owner, consumer, connection, and secret-owner identifiers, so a case-only ID change intentionally retains the same scope generation. Local credential/trust scopes instead use Ordinal dictionaries/sets; bundle owner/node checks and the hashed durable state namespaces use raw case. For example, the central Link → link no-op yields the same version, but SetScopeAsync rejects {link: reference} after {Link: reference} at that version. Changing owner/node case can also select a different durable floor namespace even though the central identity is unchanged. Secret references correctly remain case-sensitive and must not be folded.
Use one canonical identifier representation or matching case-insensitive identity semantics across central fingerprint, credential/trust state names, scopes, bundle validation, and consumer activation. Regress the combined fingerprint-to-consumer path, mixed-case restart/state lookup, and stale-bundle rejection across case-only edits. Do not infer this agreement from the passing pure fingerprint case-insensitivity test. Repair/evidence are pending.
Central evidence still required
The current Configuration two-case helper packet and one ControlPlane artifact test do not exercise ComposeDeploymentAsync. Required local coverage should use the real actor for no-op seals (same version/hash), A → B → A and final empty removal (state matches embedded artifact), invalid draft/no dispatch/no authority change, save failure/no dispatch, checked version exhaustion, and read-only SnapshotAndFlatten. InMemory failure-before-save is useful but must not be described as relational rollback/concurrent-lock proof.
Applicable existing local-only selections are ControlPlane ConfigComposerTests, AdminOperationsActorSingleSnapshotTests, and the AdminOperationsActorTests.StartDeployment_* methods; Configuration DraftSnapshotFactoryTests and design-time GrpcDataSchemaModelTests. The latter currently assumes the latest migration is AddGrpcDataConnections; the new scope migration makes that assertion stale. Locate the intended prior migration by identity when checking its down script, and add new singleton model/seed/check/up/down-script assertions. Update schema documentation/table expectations for ScopeState.
SchemaComplianceTests, RawSchemaIntegrityTests, DraftSnapshotFactorySqlServerTests, and ConfigComposerSqlServerHashStabilityTests require real SQL fixtures and are not local unit selections. Actual concurrent seal serialization, lock release on validation rejection, and rollback of state plus artifact on commit failure require explicit relational evidence; mock command ordering is not equivalent. Full P07 approval remains pending Host/DI/actor activation and the final integrated gate.
Composed invalidator checkpoint — P2 unrelated connections are retired
The real SecretsRegistration now passes DataConnectionSecretChangeHandler to SecretChangeSignallingInvalidator. DataConnectionSecurityProvider.OnSecretChanged ignores the supplied SecretName and retires every observed connection. Consequently, rotating one data credential first sends the provisioner's precise per-reference notifications, then its ordinary invalidator call retires all other data links. Editing an unrelated Galaxy secret also drains the whole data connection set. The existing runtime test for a direct per-connection security event does not exercise this composed path.
Resolve and retain bounded connection-to-reference provenance with each successful observation, or use an immutable current-scope reference map, so a secret notification retires exactly its current users. Preserve the first-resolution/in-flight generation barrier and removal cleanup; narrowing the fanout must not restore the previously fixed observation race. Do not synchronously reread the store from the callback: provisioning invokes the invalidator while holding DataConnectionSecretProvisioner.Gate, making that approach deadlock-prone.
Required composed coverage uses the real invalidator, provider, and runtime: rotating A cancels A's old lease while distinct-reference B remains current; an unrelated secret cancels neither; a shared reference cancels all its users. The coordinator identified the composition concern and the reviewer independently confirmed the source path. Repair and actual regression evidence remain pending; this is not whole-phase approval.
Final credential, invalidation, and scope closure
The final run and source identity were independently reconciled as recorded in p07-contract-astra-review.md. Host 91/91, Configuration 20/20, and ControlPlane 21/21 pass, with no failures or skips. This closes the earlier identifier-casing, completed-bundle replay, and composed-invalidator findings as well as the previously verified durable floor/tombstone/pending-cleanup/observation-race repairs.
Canonical references remain secret:data/... in scope/history/artifacts; all physical store operations use the one StoreName conversion that strips the exact secret: prefix. Both central validation and Host scope admission reject uppercase suffix aliases, matching the pinned SecretName normalization. Owner/node/connection identities use consistent canonical casing. Completed identical bundles are replayable after restart, while changed payloads at the same version and externally overwritten committed payloads fail closed. The reviewer independently read the actual Host three-case RED in 20261116T154508.671279Z-4ce9d3d0e4b0 and central two-case uppercase RED in 20261116T154756.981334Z-ba1d43a247b0; the repairs are green in the final frozen gate.
Successful security observations now retain their resolved physical SecretName in the bounded observation map. Secret invalidation selects only matching users; an unrelated/Galaxy secret leaves data links current and a shared reference retires all its users. The existing global in-flight generation check remains, including when no successful observation exists yet. Callback processing performs no store read and therefore does not reenter the provisioner's held gate. The composed invalidator/provider/runtime regression passes, and the final Runtime two-link regression additionally verifies that a transient role read during A's change does not strand B.
The central local gate now covers monotonic change/reversion/empty/no-op behavior at the revision helper, actual actor unchanged-scope sealing and failure-before-save/no-dispatch/retry, affected validation/single-snapshot/composer regressions, and design-time singleton migration/model/script assertions. This layered evidence is accepted for the P07 unit boundary; it is not an assertion that every state transition was separately exercised through a relational actor fixture. Serializable locking before the draft read and transaction-through-artifact-save remain source-verified. Actual SQL lock ordering/concurrency, rollback on commit failure, and migration application are explicit P10 obligations, not inferred from InMemory tests.
No actionable credential/scope finding remains for P07. The final phase approval and explicit TLS test-creation timing variance are recorded in the contract review; no real network, SQL, Docker, or P12 approval is implied.
The superseding 393-case run additionally closes the original target-credential expiry cap on Browse leases/continuations; the finding, narrow Runtime repair, actual RED, and new candidate identity are reconciled in p07-contract-astra-review.md. The credential/trust/central source reviewed here is unchanged by that repair and all its selected cases remain green.