Files
lmxopcua/docs/plans/evidence/grpc-data/p07-contract-astra-review.md
T

39 KiB
Raw Blame History

P07 serving-envelope and composition Astra review

Final disposition: P07 approved at its implementation/unit-gate boundary. The final reconciliation below, including the subsequent credential-expiry lease repair, supersedes the historical checkpoint dispositions. Frozen run 20261116T160335.804917Z-5a4994c32d15 passed 393/393 applicable tests, with no failures or skips; source identity and all five TRXs were independently reconciled. This is not whole-implementation, real TLS/CLI/Docker, relational migration, or P12 approval.

Initial checkpoint disposition (historical): additive serving envelopes were approved as the contract direction, subject to the constraints below. This preparation review inspected the committed P06 protocol, mapper, local authority/publication seams, configuration consistency policy, and Tasks 15/16 while implementation was active. No builds, tests, Docker commands, or commits were run by this reviewer.

Observed gap

CapabilitiesResponse has cluster identity and Serving; Sample and CompactValues also have Serving. BrowseResponse, MetadataResponse, ReadResponse, WriteResponse, and the outer SubscriptionFrame do not. Consequently, an empty/error-only read, metadata batch, write outcome, acknowledgment, or heartbeat cannot independently prove the serving identity negotiated for its operation/stream. Existing value decoders compare nested provenance with expectedServing, but DecodeControlOrAck and the collection response helpers have no equivalent identity argument/check (DataProtoMapper.cs:599-650, :1110-1165, :1209-1285).

Add an outer Serving field to all five missing response/frame messages, including every Ack/Control and both value encodings. At the reviewed baseline the available field numbers are BrowseResponse 7, MetadataResponse 2, ReadResponse 2, WriteResponse 2, and SubscriptionFrame 8. Preserve all existing numbers/oneofs and update the frozen contract tests. CapabilitiesResponse already has Serving at field 3 and needs no duplicate envelope.

Required contract constraints

  1. Explicit negotiation. Add a distinct capability flag or define a mandatory minor-version contract for serving envelopes; protocol major 1 or compact support alone is insufficient proof. An absent field from an older peer must not become the expected identity by default. The P07 strict client must fail closed when the required envelope contract is unavailable. A new capability flag may use the currently free CapabilitiesResponse field 12; if adopted, its domain default is false and advertisement is true only when all response paths honor the contract. Preserve additive old/new codec tests and pin the chosen version/fields.

  2. Validate before accepting effects. For every unary response and stream frame, validate the envelope against the authenticated operation/stream's expected node, boot incarnation, role, catalog epoch, and authority epoch before exposing content or updating handles, sequence, snapshot state, or cursors. Nested Sample/CompactValues provenance must also match that envelope and expected identity. Empty batches and control-only streams receive the same check. Validate browse lease/catalog provenance against its envelope; do not accept a lease from a different generation. A mismatch invalidates the route/stream and requires fresh authenticated discovery and, for subscriptions, a new epoch/snapshot. A control message cannot silently replace the stream's expected identity. The narrowly defined no-dispatch proof in item 6 is distinct from accepting successful data under changed role/epochs.

  3. Keep authentication and identity binding intact. Serving itself does not include cluster ID. The expected Serving must therefore remain bound to the validated cluster identity from capabilities, the selected endpoint, TLS trust/SAN policy, and the authenticated connection/credential generation. Do not treat a self-asserted NodeId, a caller-supplied expected identity, or a cached role hint as authentication. Node selection remains pinned even when unavailable. Endpoint/channel changes require a fresh capabilities proof; continuations and old handles cannot migrate with the URI alone. Capabilities discovery is the bootstrap exception to comparison with an already-negotiated Serving: authenticate it, validate configured cluster/node and structural fields, and then establish the candidate proof. It may honestly report Secondary, unknown role, or unready state; that does not establish an eligible Cluster route.

  4. Capture provenance, then final-check it. Capture the identity associated with the operation/session before materializing its response. Encode that identity, rather than attaching the latest Serving to older data or an earlier acknowledgment. After all potentially blocking preparation and immediately before publication, verify that the captured identity and original caller remain usable. Include original key/version/expiry, exact authenticated authority epoch, target policy, readiness, and operation/view authority. A generation change discards/closes the prepared response rather than relabeling it. The stream adapter must preserve P06's Prepare → final gate → actual WriteAsync → successful receipt boundary and retain ownership until actual completion even when cancellation is ignored. Unary publication likewise needs a final check after response construction/encoding work; a check only before invoking the local port is insufficient.

  5. Role eligibility is separate from supported operations. A Cluster route requires an authenticated, currently ready Primary for admission and data publication. Pinned Node cached reads/subscriptions on a nonprimary require the explicitly configured ReadyReplica consistency policy plus the existing Warm/Hot readiness verdict. Unknown/startup role is not a ready replica. A Write operation bit is only capability advertisement; the primary gate remains mandatory at admission and actual dispatch for both target modes. Demotion closes primary-only streams and invalidates routing hints. This preserves existing election semantics and makes no stronger split-brain fencing claim.

  6. Do not turn publication rejection into mutation replay permission. After dispatch, demotion, credential retirement, envelope mismatch, timeout, or loss of a response cannot change an item into RejectedBeforeDispatch. Keep the original bounded outcome observer and serving-incarnation precondition. If response validation prevents trusting a returned outcome, that item's result is ambiguous and must not be replayed. Only an authenticated, identity-valid, per-item RejectedBeforeDispatch result permits a new endpoint attempt; never retry a mixed batch wholesale. A definitive late outcome may be retained internally even when it cannot be published to the retired caller. If successful outcome reporting from an old primary is allowed later, it needs an explicit original-operation provenance contract; simply stamping the current primary identity is invalid.

    Preserve the planned stale-primary failover by distinguishing a trustworthy negative dispatch proof from current role eligibility. The same authenticated endpoint/node/boot can honestly reject an item before dispatch after demotion, and need not still be Primary merely to report that rejection. Define this exception explicitly: the response must be well formed, match the original endpoint/node/boot and request/item correlation, and the accepted item must be exactly RejectedBeforeDispatch. Changed role/catalog/authority fields do not permit accepting successful data or installing a new route identity. Fresh capabilities discovery is required before a new attempt. All other ambiguous items remain non-replayable. Treating every role mismatch as Unknown is conservative but forfeits this demotion-failover behavior; it must not be mistaken for the planned positive case. A different boot, malformed envelope, lost reply, or unauthenticated status is not this proof.

Existing local seams that P07 must complete

  • DataCapabilitiesProvider.Get samples live Serving/readiness and strips Write when role is not Primary (DataCapabilitiesProvider.cs:21-34). It does not itself enforce Cluster target eligibility, nor prove that an advertised operation remains authorized after preparation.
  • LocalDataServices.Ready, CanPublish, and CanUseSubscription validate catalog/readiness and identity but do not require Cluster Primary (LocalDataServices.cs:51-55, :78-79, :142-148). LocalDataConnection.CanPublish does not pass Target to that gate. Thus P07 must supply a target/consistency-aware publication boundary rather than assuming the existing boolean covers role policy.
  • AuthorizeSubscription currently derives ReadyReplica from any non-Primary Serving.Role (LocalDataServices.cs:117-120). The configuration entity already has an explicit Consistency defaulting to Primary, but DataTarget contains no consistency field. Preserve that configured policy through the connection/admission seam; do not infer permission to consume a replica from the server's reported role. A separate bound connection policy is sufficient; this does not require blindly adding client-controlled authorization fields to every request.
  • CanPublish checks original caller usability but does not itself compare context.AuthorityEpoch to the captured catalog's authority epoch; subscription admission/lifetime checks do compare the authority epoch. Host ingress/final gates must bind the exact authenticated authority snapshot for all methods. A usable key alone must not upgrade an old admitted context to a newer authority generation.
  • Browse/metadata/write domain return types have no batch Serving property. Their wire encoder must receive explicit captured provenance from a trustworthy facade/ingress context, including empty results. The current value-only mapper checks are not a substitute. Keep the strict remote path on helpers that require expected identity so an overload without that argument cannot accidentally bypass the contract.
  • The capability provider, catalog coordinator, source publisher, write registry/dispatch gate, acquisition capacity, and actual DriverHost must use the same real process NodeId/incarnation and current role authority. Do not create a second boot GUID for the data listener, relabel cached samples from another boot, or wire disconnected process owners merely to satisfy DI. Ready capability publication must describe a coherent currently active catalog/authority/role state.

Required focused evidence before implementation approval

  • Round-trip the new fields on every response and all four stream variants; reject missing negotiated envelopes, another node/boot/role/epoch, nested/envelope disagreement, and empty or denied-only batches with wrong identity. Check that rejected Ack/Control frames leave handles and sequence untouched.
  • Gate response preparation, then demote, change authority/catalog, revoke the original key, or expire it before publication. Require no old successful response/frame, including metadata and control-only traffic. Retain P06's blocked writer, ignored cancellation, and successful-write-only commitment regressions when the real sink is connected.
  • Show Cluster refusing ready Secondary and unknown role despite read capabilities, pinned Node refusing replica use under Primary policy, and explicit ReadyReplica accepting only a genuinely ready permitted replica. Node failures must not substitute a partner. Restart on the same endpoint must invalidate the old boot proof and renew stream state.
  • Show pre-dispatch rejection permitting only that item to retry, post-dispatch demotion and lost/malformed/mismatched write responses becoming non-replayable ambiguity, and credential/trust rotation retaining original in-flight outcome ownership.
  • Exercise the actual Host composition with one boot/role/authority/acquisition owner, plus existing WarmRoleAuthority/PrimaryGatePolicy tests if the role adapter changes. Actual TLS certificate/listener behavior and Docker wire evidence remain P10; passing fake-client/codec tests cannot establish those transport claims.

The normalized cache-ingress age contract and explicit unknown stream upper bound remain unchanged by this provenance addition. A serving envelope proves the validated source of a response; it does not turn cached value age into physical measurement age or prove exclusive device ownership.

Unary final-publication adapter direction

A narrow registered response-marshaller adapter is appropriate; a service-method/interceptor return check alone is not the final boundary. In pinned grpc-dotnet 2.76.0, the unary call handler awaits the user method and subsequently passes its response to the framework writer. The writer can await response startup before invoking the contextual serializer. Thus a guard in the service can precede further asynchronous work. Unary handler, framework writer.

The generated protobuf serializer uses GetBufferWriter after declaring its size. That can write directly to the response pipe before Complete, so forwarding its buffer requests to the real context and checking only Complete is too late. Serialize into a private bounded owned buffer, then run the captured authority/publication-lease guard inside the actual registered response marshaller, then call the real Complete(byte[]) exactly once. Disable framework response compression for this path (NoCompress): otherwise Complete performs compression after the guard and before writing the pipe. This is synchronous transport-buffer handoff, not a flush acknowledgment or proof of remote receipt. Headers may already have started; rejection must prevent the response message body. Serialization context implementation.

A custom BindServiceMethod/ServiceBinderBase wrapper can replace unary response marshallers while preserving generated request marshallers, names and service metadata. Keep the bind method's service parameter as the generated service base: the framework uses that type when checking handler base definitions. Discovery passes a null service instance, so registration must not capture a concrete call instance. Bind discovery, handler selection.

Associate each response with explicit bounded call-owned publication state; do not rely on an AsyncLocal assignment inside the completed user method being visible to its caller, or on an unbounded global response dictionary. Keep captured leases and byte reservations alive through marshalling/handoff. Supply idempotent call-completion cleanup when deadline/cancellation skips serialization, and retain a marshaller reference while physical preparation is running. Missing, retired, or already-consumed state rejects. A method-local finally must not release the state before the framework invokes the marshaller.

Required evidence is through the registered binding: revoke after method return/before serialization, revoke while private serialization is gated, and verify no real-context completion/body write; verify a positive body is handed off once, compression is disabled, and cancellation/deadline before serializer invocation releases ownership. This is a contract-direction review only; no adapter implementation or transport test is claimed complete.

First registered-binding source checkpoint — open

The coordinator subsequently implemented DataConnectionGrpcBinding.cs and GetCapabilities in the otherwise incomplete/unmapped service, and reports three registered-marshaller tests passing in 20261116T130009.001707Z-f4443cd19118. Source review confirms the generated-base bind signature, response-marshaller replacement, private bounded protobuf serialization, response-associated ConditionalWeakTable state, one-use protection, and HTTP-completion disposal registration. These are implementation observations, not final transport approval. The following findings remain open:

  • P1 — NoCompress is not enforced on the actual ASP.NET invocation path. PublicationBinder sets the flag only in its replacement handler delegates (DataConnectionGrpcBinding.cs:22-33). ASP.NET discovery passes a null service instance, producing null handlers; ProviderServiceBinder creates invocation delegates through reflection rather than using the supplied handler. The actual Execute/GetCapabilities method does not set the flag. Therefore Complete can still perform framework compression after the final guard. Set the policy in the real service/interceptor/call-bound marshaller state and verify the actual discovery/invocation path. The three capture-binder tests prove marshaller replacement, but do not exercise runtime WriteOptions. Pinned provider behavior.
  • P2 — Registration disposal during the publication callback can still permit handoff. Serialize reads _state before calling canPublish (DataConnectionGrpcBinding.cs:70). If that callback blocks, Dispose changes the state to 3, and the callback then returns true, execution still calls Complete. Recheck state after publication validation; put final cancellation/deadline checks after potentially blocking validation as well. Regress a gated callback, concurrent disposal, and zero Complete calls. This does not require a blocking global lock around transport handoff.
  • P2 — Configured unary timeout ownership ends before serialization. Execute disposes its timeout/linked sources on method return (DataConnectionGrpcService.cs:48-52), while the later marshaller registration checks only the gRPC context cancellation token (:66-68). With a longer or absent client deadline, configured server UnaryTimeout can expire during subsequent preparation without denying handoff. Retain its deadline state through HTTP completion, or capture a monotonic expiry for the final guard; test expiration during private serialization and correct release when serialization is skipped.

The new discovery gate is directionally consistent: it can report an honest unready/unknown-role snapshot while requiring exact current serving/authority and original caller usability. It does not use the stricter data-ready publication gate to suppress all unready discovery. This checkpoint found no additional discovery-gate defect. Remaining RPCs, middleware/Program composition, real binding wire tests, and the full P07 gate remain pending.

Stream publication-guard handoff direction

Approved as an additive direction, not yet an implementation approval: add an optional transport-neutral prepared-delivery capability exposing one-time SetPublicationGuard(Func<bool>). Runtime binds the existing PendingDelivery.Gate after successful Prepare and before Write. Host prepared deliveries require the binding, and invoke that exact Runtime predicate inside the registered marshaller after private byte preparation. This closes the interval in which the framework can await response startup after Runtime's earlier gate while only the source/producer proof changes, leaving the connection's Serving/catalog envelope unchanged.

Binding is one-time and disposal-aware; unbound, duplicate/replaced, retired, or disposed registration fails closed. Host identity/auth validation runs before the Runtime predicate, which is the final potentially blocking validation; final state/cancellation/deadline reads follow immediately before synchronous handoff. The predicate is observational: do not run eligibility selection, snapshot rate consumption, receipt commitment, or cursor advancement from the marshaller. False/throwing/unbound guards must fault the actual write or provide a negative receipt, never report a successful no-op write.

Runtime still commits baseline, sequence, cursor, and acknowledgment effects only after actual WriteAsync succeeds. Binding does not transfer or shorten ownership: pending delivery, frame/sample leases, byte reservation, session hold, prepared bytes, and registration stay owned until the physical write task settles, including when an outer wait is canceled and the transport ignores cancellation. A late callback after session retirement must observe invalid state without using prematurely released resources. Direct enumerable delivery retains its existing boundary.

Required focused evidence holds the writer between entry/startup and the registered marshaller, then invalidates the source ticket or retires the producer without changing Serving/catalog or first letting the session's ordinary tick close it. Releasing the writer must produce zero body handoffs and zero receipt commits. Include a snapshot/control or Modify acknowledgment case, a valid one-handoff/one-successful-receipt positive, unbound/double-bound/disposed rejection, and ignored-cancellation physical-lifetime accounting. These are regression requirements; no result or implementation closure is claimed here.

Observed-role source checkpoint

The reviewer independently read Runtime run 20261116T141626.988288Z-e977454116c3 (103/103 passed, zero skipped) and Host run 20261116T141558.244776Z-7bfca094cb86 (72/73 passed; the sole failure was the separately pending completed-credential-bundle replay regression). Existing role-policy cases and the new direct RedundancyRoleView provenance test passed. These results do not establish actual actor lifecycle behavior or completed P07 wiring.

RedundancyRoleView now stores Allowed, Generation, and ServingRole in one immutable volatile verdict under the existing dispatch fence. ServingRole starts Unknown independently of the existing policy's permissive single-node boot fallback; explicit observed role changes advance the generation even when Allowed is unchanged. This is the correct distinction, and it does not alter the existing election algorithm. DriverHostActor now publishes its cached _localRole through this new method when the real shared view is present.

P1 — An accepted snapshot without the local node retains stale serving-role provenance

DriverHostActor.OnRedundancyStateChanged intentionally leaves the legacy _localRole unchanged if a newly accepted snapshot omits this node (DriverHostActor.cs:2709–2723). The new PublishPrimaryVerdict forwards that cached value to PublishDataServingRole. Thus Primary followed by an accepted snapshot lacking the local entry still publishes Primary, and its generation need not change. A later P07 caller can treat stale provenance as current Primary even though the current snapshot supplies no local-role proof. The direct setter test cannot detect this actor adaptation error.

Preserve the legacy bool/gate behavior where required, but track the data-service observed role separately from that legacy cache: every accepted snapshot must derive the current data-serving role from local?.Role, publishing Unknown on omission and advancing its authority generation. Regress the actual DriverHostActor with the real shared RedundancyRoleView: Primary → accepted missing-local snapshot → Unknown, unchanged legacy verdict if intended, invalidated old publication proof, and positive recovery on a new explicit local role. Rejected older snapshots must not disturb the current accepted proof.

DriverHostActor.PostStop also currently leaves the last observed serving role in the shared view. The completed authority composition must define and test retirement/reset of that publisher so a stopped owner cannot leave a current serving proof indefinitely; actor restart starts Unknown again, but that alone does not prove the stopped interval. This lifecycle obligation is distinct from changing existing legacy write/historian policy. Source repair and actual actor regressions are pending; no whole-phase approval is granted.

Actual Host composition checkpoint — source review, gate pending

The coordinator subsequently added real DataConnectionRegistration/Program wiring and three actual DriverHostActor regressions. Frozen source now keeps _observedDataServingRole separate from the legacy cached role, sets it to local?.Role on each accepted snapshot, registers a monotonic role-owner lease, and retires only that owner on PostStop. Replaced owners cannot publish or retire the replacement. Counter exhaustion poisons role availability. These source changes address the missing-local/stopped/old-owner findings; their new full-gate result was pending when this review began. The review did not run tests/builds or modify production code.

Registration uses one process identity for the catalog, source publisher, and write registry; one shared dispatch fence/role view; one hub/clock; and one acquisition-capacity owner passed to the real DriverHostActor. A deferred facade resolves the actual ActorRegistry host rather than constructing another actor graph. The dedicated listener validates port conflicts, requires TLS except explicit development loopback, loads a current private-key certificate with SAN coverage for all allowed hosts, and uses the data middleware before mapped service dispatch. These observations are not wire/TLS evidence. The coordinator's separately tracked admission-class separation, final monotonic unary timeout, and existing secret-invalidator composition work are not duplicated here.

P1 — The actual OPC UA publisher is missing the shared catalog coordinator

Runtime/ServiceCollectionExtensions passes SourcePublisher, LocalCatalogCoordinator, write runtime, and acquisition owner to DriverHostActor, but the real OpcUaPublishActor.Props call still omits its already-supported shared catalogCoordinator/dataCatalog arguments. DriverHost stages its shared attempt and deliberately completes it itself only when no OPC UA publisher exists. OpcUaPublishActor.FinishRebuild completes that attempt only when its own coordinator is nonnull. In the actual enabled graph neither completes the shared generation, leaving Current null and data readiness permanently unavailable despite a successful address-space apply.

Inject the same coordinator/activation into the real publisher and add a positive real-composition apply/restore test. The registration test that expects facade creation to fail before an actor exists cannot establish successful activation. Source repair/evidence are pending.

P1 — Registration substitutes snapshot Primary for the existing Warm verdict

The consumer activation callback accepts DataServingRole Primary regardless of mode and accepts Secondary for artifact-declared Hot. It never reads the actual WarmRoleAuthority verdict owned by OpcUaPublishActor. Warm can be Standby despite a Primary snapshot (membership disagreement, endpoint not listening, or no accepted revisioned snapshot), and can be Active during the approved unreachable-primary path while its snapshot role is still Secondary. The callback therefore both admits forbidden Standby work and suppresses legitimate Warm activation. Serving capability readiness likewise lacks the existing Warm readiness decision.

Publish the existing accepted Warm verdict from OpcUaPublishActor through a shared owner-fenced view; do not duplicate election logic. Promotion publication follows the actual successful data-plane transition, while demotion denial precedes potentially blocking SDK/ServiceLevel work. Default/retired owners are Standby; stale owners cannot overwrite replacements. The same view and effective local WarmRedundancySettings must drive acquisition and serving readiness: artifact Hot cannot bypass a locally Warm Standby, since the existing actor explicitly retains local mode on artifact mismatch.

The minimal existing seams are OpcUaPublishActor.ApplyWarmTransition, PostStop, both Props factories, and its real Runtime registration. Extend OpcUaPublishActorWarmTests (transition order, unrevisioned/older snapshot, failed ServiceLevel, disagreement), EndpointStateTests, and actual owner stop/replacement cases. Notify runtime after publishing the shared verdict and outside its publication fence. Source repair/evidence are pending.

P1 — Role/owner generation is discarded before publication, allowing ABA revival

RedundancyRoleView advances PrimaryGeneration on role/owner changes, but the registration's Serving delegate emits only NodeId, Incarnation, Role and existing catalog/authority epochs. LocalCatalogCoordinator role wrappers preserve those epochs. A blocked old unary/frame can therefore survive Primary → Unknown/Secondary → Primary, or owner replacement followed by Primary, if its final gate sees only the final identical Serving tuple. The separate rich-write PrimaryGeneration proof does not protect ordinary metadata/read/control publication.

The coordinator's proposed additive ServingGeneration (wire Serving field 6) is the appropriate minimal direction: capture role/readiness/owner validity and generation atomically from one immutable snapshot, propagate it through full serving comparisons, and refresh catalog wrappers even when the role string returns unchanged. Poison on overflow. Include Warm owner/verdict transitions in the same effective proof. Network negotiation must require a positive generation for the new serving contract; default zero may remain for legacy/local fixtures but must not silently disable ABA protection on a peer claiming the new contract. No separate backing-source epoch is needed, and original sample versions/cache-ingress timestamps must not be refreshed by role changes. Require actual late-marshaller away/back and owner-replacement regressions plus fresh-request recovery. This is an approved direction, not yet a verified repair.

P1 — Outbound revocation is conditional on successful local catalog staging

StageCatalog calls _dataConnections.Apply only after authority installation and ParseLocalCatalogSnapshot. A newer desired artifact that removes consumers but fails unrelated local catalog/authority projection logs/returns first. BeginCatalogAttempt closes the origin catalog but does not deny the outbound runtime's old scope, so its previously acquired facades/streams can remain authorized indefinitely.

Introduce an outbound desired-attempt denial barrier independent of local export staging; activate the replacement only from validated scope and durable floor. Regress an actual host apply with an active outbound scope, a newer removal artifact plus local catalog failure, old-handle/stream denial and drain, and honest recovery. Keeping legacy driver topology on failed apply does not authorize retaining the old external data scope. Registry internals are being reviewed separately; this finding concerns the actual actor integration order. Source repair/evidence are pending.

This checkpoint remains open. No final P07, real TLS, Docker, or OPC UA integration approval is claimed.

Composition repair rereview — source verified, integrated gate pending

The four preceding composition findings are addressed in the frozen source inspected at this checkpoint:

  • The actual ServiceCollectionExtensions graph now calls DataConnectionPublisherProps.Create, which selects the shared catalog coordinator/activation, authority, Warm view, and outbound runtime. The real Host-to-publisher held-sink regression calls that same production factory and requires the catalog to remain unavailable before successful topology completion, then activate on the matching acknowledgment. This guards the dependency omission rather than manually supplying a different test-only Props graph.
  • Registration captures driver-role and Warm immutable state under the same shared dispatch fence, using TryEnter to keep acquisition callbacks nonblocking. Local Warm settings override artifact Hot; an unaccepted or retired Warm owner publishes an unavailable Standby serving identity. Actual accepted Warm transitions remain owned by OpcUaPublishActor, and its notifications run after the immutable publication leaves the fence.
  • ServingGeneration propagates through catalog role wrappers even when the role string returns unchanged. The checked combined role/Warm generation rejects exhaustion. WriteRouteProof now retains full Serving identity; the actual dispatch gate captures live coordinator.Serving before checking IsPublished and requires both catalog and live identity to equal the proof under the shared fence, alongside the existing route/driver/PrimaryGeneration checks. It does not take a deployment-runtime lock inside that fence.
  • DriverHost.BeginCatalogAttempt invokes the outbound BeginAttempt before empty/malformed input, authority installation, or local catalog parsing. The outbound runtime synchronously withdraws old routes and checks the latest attempt revision/generation before a delayed scope activation can install entries. The actual invalid-local-artifact regression holds an old import lease and verifies its cancellation and denied readiness after the failed newer apply.

Evidence is deliberately limited: the reviewer independently read run 20261116T152849.971443Z-55329afdc892: Host 87/87 passed; Runtime 207/210 passed, with both new Warm final-write fence regressions failing as expected before repair and one separate frozen-snapshot ordering failure. These results are not a green result for the repaired source. The reviewer also read 20261116T153431.302434Z-0add51a2b272: deployment activation 15/16 passed, with the transient scope-store retry regression failing before its repair. Final repair results and the complete applicable P07 gate remain required.

The new deployment-runtime availability findings are recorded in p07-remote-astra-review.md; the newly composed invalidator finding is recorded in p07-credential-astra-review.md. No whole-phase approval is granted.

Final P07 reconciliation and approval

The reviewer independently read artifacts/grpc-data/20261116T155343.945235Z-be0fbabc1a44/unit/P07/run.json and all five TRXs: 392/392 passed, zero failures/skips (Host 91, Runtime 219, Commons 41, Configuration 20, ControlPlane 21). Before these documentation edits, the current HEAD exactly matched b710bf9f74f04ede38b902fcffc7259e2e808aa1, git diff HEAD --binary SHA-256 matched f2fad373d196e951f6f39ec799e36845ddb9dcbe48931958a0e17eab627362f4, and all 50 recorded untracked production/test C#/proto/project hashes matched. The phase manifest includes the required new classes and affected existing auth, local service, stream, role, actor, write, codec, configuration, and sealing regressions. The reviewer ran no builds/tests, Docker commands, migrations, or commits.

All actionable P07 findings in these three review notes are closed at this boundary. The serving envelope/generation is negotiated and compared for every response category. Actual method execution enforces NoCompress; the registered response marshaller prepares private bounded bytes, checks publication authority and final disposed/cancellation/monotonic timeout state, then synchronously hands off the buffer. Runtime's exact prepared-delivery guard crosses framework startup awaits into that marshaller; receipt effects still follow successful actual WriteAsync. These unit seams prove the selected handoff boundary, not network flush or remote receipt.

The real production publisher factory, actual Host/publisher held-sink activation, observed-role owner lifecycle, accepted Warm publication, same-role ABA, final device-write Warm fences, and malformed-next-artifact outbound denial all pass. The final deployment-runtime fix keeps configured consumer scope independent of transient role observation, while role checks remain at worker creation, acquisition, and every borrowed-operation boundary. Actual role notifications still advance all route revisions and retire entries; BeginAttempt still immediately empties scope. Its last two-link regression was observed failing in 20261116T155211.129165Z-316e31f82ca8 and passes in the final run. Credential and remote lifecycle dispositions are recorded in their companion notes.

Approved phase-ordering variance: Task 15 originally schedules creation of GrpcDataTlsWireTests.cs and GrpcDataListenerIsolationWireTests.cs in P07, with execution in P10. Their creation moves to P10 alongside the actual TLS fixtures, rather than adding unexecutable placeholders here. Both classes remain required under Host.IntegrationTests/DataConnections, tagged Feature=GrpcData/Category=Integration, alongside the existing mesh boundary/auth integration selectors. No wire-test requirement or scenario is waived.

P10 still owns actual certificate/listener isolation, Docker/CLI/probe scenarios, deployed rotation/restart/failover, and relational migration/concurrency/rollback evidence. P11 owns workload/capacity measurements; P12 owns the full solution gate and separate final Astra review. This approval permits the P07 commit and dependent P08 work, without asserting those later outcomes.

Superseding final candidate — credential-expiry lease cap

P08 preparation identified one additional P2 before the P07 commit: Browse issued MaxMetadataLease even when the original authenticated target credential expired sooner. A consumer cannot infer that target-key expiry from its opaque bearer. The coordinator held the commit and captured actual behavioral RED in 20261116T160304.904551Z-9a7e5ce79d56 (local connection 5/6 passed; Browse_lease_never_outlives_the_original_target_credential failed). The reviewer independently read that TRX.

Frozen LocalDataServices now limits the branch lease to the smaller of MaxMetadataLease and the positive remaining original context.CredentialExpiresUtc measured with the same Clock. Expiry while finishing returns Denied with no lease. The continuation uses that exact capped duration and the existing request-start monotonic anchor, which is conservative rather than extending validity by response preparation time. The regression verifies a one-second original credential caps the lease and denies a later continuation after expiry. DataMetadata, including GetMetadata results, has no standalone authority lease; P08 caches must use the enclosing Browse lease/request-start boundary or obtain new authority, rather than inventing a duration for metadata objects.

The reviewer independently reconciled the fresh full run 20261116T160335.804917Z-5a4994c32d15: 393/393 passed, zero failures/skips (Host 91, Runtime 220, Commons 41, Configuration 20, ControlPlane 21). Before these Markdown edits, HEAD still matched b710bf9f74f04ede38b902fcffc7259e2e808aa1; tracked diff SHA-256 matched 55029f7b6c6323a87dd3d8b96a988928d1eaee5e3889e1f57c4b07e4bd5771ae; all 50 recorded new source/test hashes matched. This supersedes the earlier 392-case approval candidate. The additional finding is closed and P07 approval is reaffirmed, with the same explicit P10/P11/P12 obligations and TLS test-creation ordering variance. No builds/tests or commits were run by the reviewer.