feat: add immutable partitioned data publication hub

This commit is contained in:
Joseph Doherty
2026-11-16 01:13:10 -05:00
parent b2249ce2cb
commit 8f28a0eabf
47 changed files with 6184 additions and 173 deletions
+18 -2
View File
@@ -19,7 +19,7 @@ The [implementation plan](../../2026-11-15-grpc-data-connections-implementation-
| P01 | Domain/protobuf contracts | Passed; Astra freeze approved | 15 domain + 36 wire tests, zero failures/skips; run `20261116T024814.318745Z-3a06bbb5af5e` |
| P02 | Schema/artifact/consumer projection | Passed; Astra approved | 72 F + 31 P + 106 R, no failures/skips; final run `20261116T034337.311145Z-cd97a339f340` |
| P03 | Shared authorization and leases | Passed; Astra approved | 77 K + 89 O + 53 R + 19 H, no failures/skips; final run `20261116T034150.797719Z-8f107e03d8d5` |
| P04 | Immutable publication, hub and local ports | Pending | |
| P04 | Immutable publication, hub and local ports | Passed; Astra approved | 185 R + 16 A + 16 C + 77 O + 74 ScriptWorker + 88 MTConnect + 40 OpcUaClient = 496, no failures/skips; final run `20261116T060538.590404Z-b8ef1894731e` |
| P05 | Mutation tickets/outcomes | Pending | |
| P06 | Streams/sharing/fair delivery | Pending | |
| P07 | TLS/provisioning/node+cluster clients | Pending | |
@@ -67,13 +67,29 @@ Final [Astra P02/P03 review](p02-p03-astra-review.md) closes all five findings a
Independent Python helpers for local-context validation, fixture endpoint/manifest isolation, ownership-only cleanup, atomic secret files, bounded/redacted processes, deployment outcome polling and CLI result validation have test-first preparation evidence: initial discovery failed on missing modules; the focused combined run subsequently passed 44 tests. This is not the P10 gate. Concrete Compose, SQL/device/seeder, TLS/provisioning, runtime observation, CLI/probe scenarios and actual Docker integration remain pending. No containers or databases have been modified.
## P04 execution notes
Hub and source-feed expected missing-API RED runs: `20261116T035138.678709Z-921224df1e45` and `20261116T035253.701549Z-3677798d45ff`. The coordinated production graph then compiled while the Task10 test failed on the missing local catalog/facade APIs in `20261116T040451.917499Z-9fc5a1cf55f8`. [Publication review](p04-publication-astra-review.md) identified producer blocking, lifecycle, binding recovery and virtual freshness issues; correction candidates remain unapproved until their behavioral gate and rereview finish.
Acquisition retention is independent of served catalog activation: internal raw hub samples may carry the actual boot process identity with zero catalog/authority epochs. Public `DataSample.Validate` and wire codecs remain strict. A local facade must prove the active catalog/authority and current backing source, then attach current serving headers while preserving original value version/timestamps and monotonic receipt age. Charged cache-read resources remain owned until the recipient disposes `ReadResult`; publication guards fence retained replies after invalidation. The old SDK/actor delivery path remains separately copied and serialized and is outside the new hub's accounting; P11 must measure that overhead explicitly.
The second complete P04 attempt (`20261116T051418.493232Z-1a9b4de9e45b`) passed 155 Runtime, 16 Core.Abstractions, 16 Commons and 77 SDK tests. The gate then stopped because four Windows-only worker security tests explicitly skipped on macOS; this is not a completed P04 gate. Explicit, discoverable platform applicability is being added without relaxing unexpected-skip rejection. Astra additionally identified a legacy delivery regression under hub binding pressure: physical driver subscriptions must continue independently of the bounded new feed. Its correction and the production catalog activation integration remain pending. The follow-up publication review resolves H1/M2/M3 but leaves virtual retirement cleanup, legacy availability under hub pressure, source accounting across repartition, and case-insensitive origin cluster identity open. Task10 staging tests produced the expected missing-API RED in `20261116T052822.115386Z-041fa266b284`; implementation is in progress. The platform-aware runner regression suite passed 28 focused Python tests; the real platform-filtered C# gate has not yet run. Task10 staging subsequently passed all eight focused tests in `20261116T053226.727293Z-11a44bee32b8` after correcting an xUnit cancellation-token analyzer error. Source regression RED `20261116T053303.727269Z-0e8faa537de7` executed 35 tests (30 passed/five expected failures: binding contention, full hub, missing shape, virtual retirement and mixed-case cluster keys). Hub regression RED `20261116T053507.573526Z-b3f1ee05f515` executed 20 tests (15 passed/five expected failures: retained source charges across repartition and old-ticket retirement). The focused correction candidates passed 35/35 source tests in `20261116T054124.390909Z-bfd4f5cc2345` and 20/20 hub tests in `20261116T054353.930760Z-80fdd94dde21`, both with no skips. These do not replace the complete P04 gate. Staging follow-up RED `20261116T054026.209143Z-e6ba95281799` executed 18 tests (10 passed/eight expected failures): wrapper reuse, wrong serving-node provenance, headless/SDK same-revision retry after failed expected catalog activation, and all four cache/restore subscription-order cases. The 18 staging tests subsequently passed in `20261116T054720.800511Z-26d9fb40b300`. A later source review found the bounded 128-reference initial preparation could lose quiet tail values; the real 130-source test failed exactly at source-128 in `20261116T054854.714447Z-3f6eb6203de4` (35 passed/one expected failure). The source correction then passed all 36 tests in `20261116T055309.152744Z-9dee8a78ffeb`, including all 130 original initial values and prior pressure cases. Direct restore RED `20261116T055225.759147Z-001d468f9d9e` passed 18 staging tests and failed the real deferred-driver regression because it opened a third database context. The artifact-reuse correction passed all 19 staging tests in `20261116T055656.284057Z-33ba66cac80e`. The first complete gate then exposed nullable-timestamp comparison compilation errors in affected driver tests; explicit non-null assertions and value comparisons fixed them. Focused MTConnect 88/88 and OPC UA client 40/40 passed before the final complete P04 run passed all 496 applicable tests. Four explicitly declared Windows-only worker methods are verified during discovery and excluded on macOS; no applicable test is skipped. The final gate is `20261116T060538.590404Z-b8ef1894731e`. Staging review also requires deployment confirmation/retry to reflect catalog activation failure; a clean legacy topology apply alone must not suppress repair of the same desired data revision.
The P04 selector manifest adds only affected virtual/restart, timestamp/worker/history, domain-value and wire-read regression classes. Runtime desired-catalog staging now closes before physical driver replacement, shares an exact attempt with the SDK publisher, and also supports headless application/cache/restore. Source/hub and staging review findings have been corrected; see the final checkpoint disposition. P08 must consume independent original timestamps at the mapped SDK sink; carrying them in the compatible legacy envelope does not prove the SDK import boundary already preserves them.
## Later-phase integration obligations
P05 read-only preparation located the actual device invocation inside the resilience delegate, after actor dispatch and `Task.Yield`; final ticket validation must occur there. Capture the actual driver task for bounded late observation, because the resilience wrapper can time out first. Legacy Good acknowledgments without established device-application guarantees remain unconfirmed.
P06 must prove retained snapshot acquisition age survives transport/reconnect independently of optional wall-clock timestamps. Current unary `ReadResult` carries age, while subscription values do not yet carry an explicit age field; resolve this at the stream contract checkpoint rather than infer freshness from receipt. P07 should construct remote realm roots using the canonical cluster identity from validated capabilities, and compose source publishers with real atomic process/role provenance shared with the catalog coordinator.
## P00 verification
The runner tests first failed as expected while `run-unit-phase.py` was absent. After initial implementation, 18 fake-subprocess Python units passed. Astra found required existing regression classes were not enforced as strictly as new classes; four added regression tests failed before the correction. The final 22 Python tests passed, with red/green logs in `artifacts/grpc-data/p00-runner-regressions/`. The real P00 discovery/execution runner passed both counting-probe/reaper C# tests with no skips; the starting production graph compiled successfully. No solution test run or Docker mutation occurred. Raw TRX/commands/discovery identities remain in ignored artifacts. The runner validates discovery AND executed results for every required new class, retains parameterized class filters, and sanitizes both child environments. Astra approved P00 after the required-existing-class correction; see [checkpoint review](p00-astra-review.md).
## P03 preparation obligations
Read-only security preparation confirmed that caller-supplied `DataView.Subject` is a claim, never an ACL authority. P03 resolves subject/provenance against the active deployed catalog before either Raw/UNS fallback or cache lookup, and strictly caller-bound facades carry authenticated principal/key/version/original expiry. Revalidate the current key principal and credential version as well as expiry even without an authority-generation change. Deep-copy mutable authority inputs before publishing security snapshots. Failed desired-authority staging must close new mapped/data access rather than retain stale permissions. These obligations supplement the planned spoofed-subject, queued expiry, same-ID credential replacement, deep-copy mutation, and failed/empty apply tests; they are not yet implemented.
Read-only security preparation confirmed that caller-supplied `DataView.Subject` is a claim, never an ACL authority. P03 resolves subject/provenance against the active deployed catalog before either Raw/UNS fallback or cache lookup, and strictly caller-bound facades carry authenticated principal/key/version/original expiry. Revalidate the current key principal and credential version as well as expiry even without an authority-generation change. Deep-copy mutable authority inputs before publishing security snapshots. Failed desired-authority staging must close new mapped/data access rather than retain stale permissions. These obligations supplement the planned spoofed-subject, queued expiry, same-ID credential replacement, deep-copy mutation, and failed/empty apply tests. They were subsequently implemented and verified in P03, as recorded above.
## P01 verification and frozen contracts
@@ -0,0 +1,160 @@
# P04 Astra publication-boundary review
**Disposition: P04 approved. All source/hub and staging findings H1/H2/H3 and M1–M6 are resolved, and the complete applicable phase gate passed 496/496 with no failures or skips.** Review began against `d0af4d2148c172b0e3f001e8c1b8129cf16649be` plus the coordinator's frozen publication/hub candidate. The reviewer subsequently reread the corrected publication/hub code, actor integration, local catalog/browse/read services, Task 10 staging and corresponding tests. The reviewer ran no tests, builds, migrations or Docker, and changed only this document.
At the initial publication checkpoint, Task 10's catalog/policy facade and staging review remained pending; they are covered by the final review below. Production Host DI remains scheduled for P07. A compiling source/hub graph and the initial missing-API RED alone did not establish behavioral GREEN. Saved run `20261116T035138.678709Z-921224df1e45/unit/P04/run.json` records a failed discovery/build for the initial `GrpcDataPartitionTests` case; this is the scaffold RED, not an assertion-based reproduction of the findings below.
## Final phase evidence and candidate reconciliation
The complete applicable P04 gate `20261116T060538.590404Z-b8ef1894731e/unit/P04/run.json` passed:
| Project | Passed | Failed | Skipped |
|---|---:|---:|---:|
| Runtime | 185 | 0 | 0 |
| Core.Abstractions | 16 | 0 | 0 |
| Commons | 16 | 0 | 0 |
| OPC UA SDK | 77 | 0 | 0 |
| ScriptWorker | 74 | 0 | 0 |
| MTConnect | 88 | 0 | 0 |
| OPC UA Client | 40 | 0 | 0 |
| **Total** | **496** | **0** | **0** |
The reviewer independently inspected the final report and verified that every required new and existing class executed. The run and reviewed checkout have the same base `d0af4d2148c172b0e3f001e8c1b8129cf16649be`. The complete tracked `git diff HEAD --binary` digest matched **`40a4d33e94da9bd93e25b3eb172e1c7f21d3eb591a1aa52045c15fa3e2b1d9bd`**. All 23 recorded untracked-file digests matched, including all 22 production/test files, before this final review-only document update. No production change intervened after source approval. The two driver test adjustments explicitly assert a non-null original server timestamp before comparing `.Value`; the final MTConnect and OPC UA Client gates execute those assertions.
The manifest declares four Windows-only ScriptWorker methods as inapplicable on macOS. The reviewer checked the source platform guards, verified all four methods remain present in the saved discovery, and verified none appears in the executed TRX definitions/results. All 74 applicable ScriptWorker cases ran successfully. The runner verifies named exclusions during discovery, cannot exclude an entire required class, rejects an excluded method appearing in results, and continues rejecting unexpected skips. This is an applicability declaration, not a claim that Windows-specific behavior ran on macOS.
**Final approval covers P04 publication, ownership, partitioned cache/snapshot foundations, local caller-bound ports and deployment catalog staging.** It does not claim completion of later gRPC transports/streams/writes/mounts, production Host DI (P07), imported SDK timestamp consumption (P08), disposable integration fixtures or final feature validation. The historical checkpoint entries below retain the progression from open findings to their verified corrections; their earlier conditional/pending statements are superseded by this final disposition.
## Rereview evidence
Saved run `20261116T051418.493232Z-1a9b4de9e45b/unit/P04/run.json` records **155 Runtime, 16 Core.Abstractions, 16 Commons and 77 SDK passing tests**, with zero failures/skips in those completed projects. The overall run is **failed**, because the selected ScriptWorker run contained unexpected platform skips; no completed phase gate is inferred. The reviewer inspected the report and reconciled its recorded hashes for all 14 reread publication/hub/local-service source files and focused test files; each matched. Catalog staging is separately in progress and is not a new absence finding in this review.
The original findings below preserve their initial trigger. Resolution applies only where explicitly stated; additional concrete regressions found during rereview are recorded afterward.
## H1 — Remove blocking and partition-wide producer work
**Severity: High. Status: resolved in reviewed source and completed Runtime gate.** In the initial `Runtime/DataConnections/SourceSamplePublisher.cs`, capture, publication admission, commit and the `finally` in-flight decrement all took the global `_gate`. `RetireDriver` and `PublishDriverStatus` walked the driver's sources under that same gate; publication also invoked the serving provider and hub commit while holding it. A paused control operation or unrelated source could therefore block a driver callback before its mailbox enqueue. The initial `SamplePartition.InvalidatePartition` also synchronously traversed every source and released queued/dirty/change work when producer admission overflowed. Neither behavior meets Task 9's bounded nonblocking producer contract.
Use nonblocking source admission with an immediate generation/retirement fence, and move whole-partition cleanup off the producer thread. A rejected publication must invalidate readiness without waiting for another publisher or a partition worker. Exercise a real publisher with a deliberately blocked lifecycle/serving operation and an unrelated callback; also prove that overflow does not traverse a large source population on the caller thread. Include retirement and rebind races so the replacement does not allow stale samples through.
**Correction:** callback capture uses concurrent routes, commit uses per-source `Monitor.TryEnter`, and producer retirement shares an immediate fence with the hub. Partition invalidation advances an epoch and schedules cleanup. The repair queue is bounded at 4,096 entries, processes bounded batches and limits repeated repair attempts. The reviewer inspected blocked-status/unrelated-callback, immediate retirement, busy-partition and deferred-overflow-cleanup regressions included in the completed 155-test Runtime gate. These resolve the original blocking/traversal finding; the separate H3 and M4 findings still apply.
## H2 — Retire producer identity on supervision and unexpected termination
**Severity: High. Status: resolved, including the resource-lifetime residual.** `DriverInstanceActor.PostStop` (approximately line 2088 in the initial candidate) queues `ConnectivityChanged` and detaches handlers, but does not retire its source identity. `PostRestart` requests reprovisioning; `DriverHostActor.ReprovisionChild` (approximately line 4289) reinitializes the same ActorRef without changing the readonly source incarnation carried in Props. A callback retained by the previous actor instance can consequently capture a still-current producer ticket and publish after the restart or its status event. The ordinary deploy replacement path's retirement does not cover this case.
`VirtualTagActor.PostStop` at line 262 only cancels its timer and unregisters from the mux. `VirtualTagHostActor.OnChildTerminated` (approximately line 381) removes child/plan entries without retiring the producer. Unexpected termination can leave the hub's previous sample Ready, and the host retains the token for a later respawn. An asynchronous completion from an earlier actor instance must likewise not become a new acquisition in its replacement.
Retire the old producer synchronously at the actual lifecycle boundary, arrange a distinct valid identity for the replacement, and release/invalidate its old source state. Test supervision of the real driver actor with a retained old callback, and unexpected stop/restart of a real virtual actor with an old asynchronous evaluation. Verify unavailability during the gap, rejection of old work, and recovery only from the replacement's fresh acquisition.
**Rereview:** driver and virtual `PostStop` now retire the producer, and `PreStart` renews a retired identity. Virtual asynchronous completions carry a distinct actor incarnation checked before application. The real driver supervision and stopped-virtual-actor tests pass in the completed Runtime gate. However, `SourceSamplePublisher.RetireVirtualIncarnation` at approximately line 278 retires/removes only the producer fence, leaving its source ticket, routes and cached payload. `VirtualTagHostActor.OnApply` at lines 122–123 retires before attempting `TryCaptureVirtual`; that capture now fails, so `TryRemove` never runs. `SamplePartition.Current` denies the retired fence but does not mark the source Removed, and tombstone reclamation only handles Removed states. Repeated deletion of virtual IDs therefore retains source capacity and payload charges indefinitely. Remove the matching old binding after the immediate fence, preserving newer-incarnation protection, and verify actual virtual-host removal churn returns resource/source capacity.
## M1 — Reconcile publisher bindings after routing reset and failed initial bind
**Severity: Medium. Status: resolved, including the quiet-initial-batch residual.** The initial `SourceSamplePublisher.EnsureBinding` returned success whenever its private ticket's incarnation matched. `PartitionedSampleHub.Repartition` clears hub registrations but does not clear those private tickets. Subsequent publication then fails permanently while `EnsureBinding` continues to report success. Initial `EnsureDriverBinding` and `EnsureVirtualBinding` admission failures were also ignored by their actor callers, leaving a source with no route and no retry.
Check current hub routing when reconciling bindings and provide bounded recovery for temporary admission contention. Recovery must install a new unavailable generation and wait for a real acquisition; it must not replay a dropped value as fresh. Cover the actual publisher plus hub through repartition, failed initial driver bind and failed initial virtual bind, including a source whose initial callback is quiet afterward.
**Rereview:** the nonblocking ticket check, lifecycle advancement and bounded repair queue recover an actual publisher/hub after repartition; the dedicated test passes. H3 legacy-delivery independence is now corrected. M1 nevertheless remains open for the quiet initial batch residual documented in the focused correction review below.
## M2 — Publish real equal-value virtual acquisitions before legacy deduplication
**Severity: Medium. Status: resolved in reviewed source and completed Runtime gate.** The initial `VirtualTagActor.ApplyEvaluation` returned on equal value/status before calling the source publisher. Once hub overflow or contention invalidated that source, subsequent successful evaluations with the same value never reached the hub, so it remained unavailable indefinitely and acquisition age/timestamps did not advance.
Publish each actual completed evaluation before the optional SDK value/status deduplication. Keep `VirtualTagEvalResult.NoChange` and deploy `ReassertValue` excluded: neither represents a new acquisition. A real actor regression should publish an initial value, invalidate the hub, then complete a successful equal-value evaluation and verify recovery with that evaluation's actual timestamps.
**Correction:** `ApplyEvaluation` places source publication after the `NoChange` guard and before legacy deduplication. `Equal_fresh_virtual_evaluation_recovers_invalidated_hub_without_sdk_duplicate` exercises the real actor and hub, verifies the equal-value acquisition's timestamp and preserves SDK deduplication; it passes in the completed Runtime gate.
## M3 — Preserve held-value age and timestamps on virtual failures
**Severity: Medium. Status: resolved in reviewed source and completed Runtime gate.** The initial `VirtualTagActor.OnInputsBad` (approximately line 527) and `OnEvaluationFailed` (approximately line 561) call `PublishSource` with the previous `_lastValue` and the new failure trigger time. `PublishSource` creates a full acquisition with both timestamps set to that time. The partition consequently resets the monotonic received time too. A failure has changed quality, but the old payload is now represented as freshly acquired; an initial failure can also create a sample when no successful evaluation ever occurred.
Use the source status-only path for held-value failures. Preserve the previous acquisition's timestamps and monotonic age; without an acquired sample, keep waiting-for-initial-data semantics. The existing driver status path already demonstrates this distinction. Verify success at T1 followed by bad input/evaluator failure at T2 retains T1 and the original age, and that initial failure cannot create a fresh sample. Existing legacy SDK/historian presentation may remain separate.
**Correction:** both virtual failure paths call `PublishSourceStatus`, preserving the cached acquisition. The actual-actor initial-failure and later-failure theory passes, verifying absent initial sample, original timestamps, retained value/changed quality and unchanged monotonic received time.
## H3 — Keep legacy driver delivery independent of hub admission
**Severity: High. Status: resolved in the focused correction candidate.** `DriverInstanceActor.Subscribe` at approximately lines 1488–1507 first unsubscribes an existing handle, then returns before attaching callbacks or calling driver Subscribe whenever any `EnsureDriverBinding` fails. It retries the entire request every 250 ms. A full hub source/byte budget or unavailable declared shape can therefore prevent the physical subscription indefinitely; a subscription update can also tear down previously healthy SDK/mux/history delivery. The new bounded feed must not become an availability dependency for the established local path.
Proceed with the legacy subscription independently, fail the new source unavailable, and recover its binding through bounded work. Recovery must obtain a genuine fresh acquisition without replaying a dropped payload as fresh. Test a real actor against a deliberately full hub and verify driver Subscribe and legacy callback delivery continue, including an existing-subscription update. Replace the current test expectation that admission failure prevents the driver from subscribing.
## M4 — Retain source charges across repartition while owners remain
**Severity: Medium. Status: resolved in the focused correction candidate.** `SamplePartition.Dispose` at approximately line 435 releases every `SourceCharge` and decrements tracked-source count unconditionally. `PartitionedSampleHub.Repartition` calls it while recipient-owned reads and ingress reservations may still retain the old `SourceState`, ticket and source-key strings. Ordinary tombstone reclamation correctly waits for Readers, Reservations and Snapshots; repartition bypasses that protection and reopens node-wide capacity before this storage is released.
Retire the old partition and preserve each retained source charge/count until its final owner releases, with exactly-once accounting and no possibility of old ticket resurrection. Cover held read and ingress leases across repartition with long keys and tight source/byte limits; releasing the final lease should return capacity exactly once.
## M5 — Canonicalize the source cluster consistently
**Severity: Medium. Status: resolved in the focused correction candidate.** `LocalExportCatalog.Compilation.cs` around line 125 constructs driver source keys using `snapshot.ClusterId`. `DriverHostActor` around line 4034 passes the driver row's original `spec.ClusterId` into `EnsureDriverBinding`, which constructs the acquisition key from that string verbatim. Cluster membership/foreign-key matching accepts case variants, while `BackingSourceKey` record equality is case-sensitive. A driver row belonging to `CLUSTER-A` under canonical snapshot `cluster-a` can publish successfully into a cache key that its valid catalog never finds, leaving reads waiting for initial data.
Use the same trusted canonical origin-cluster identity at the shared source-key boundary. Preserve separately declared identity comparison rules for references and serving identities. Add a catalog/producer parity regression using mixed-case cluster foreign keys and the canonical cluster root. No virtual FolderPath hierarchy finding is raised: the current composer emits an empty virtual FolderPath.
## Reviewed boundaries and outstanding integration obligations
- `OwnedDataSample` estimates and rejects unsupported/oversized payloads before hub copying. The supported array/byte payload is copied before actor enqueue, and downstream legacy envelopes copy producer-owned arrays too. The hub's immutable `DataValue` retention is independently disposable and budgeted. Legacy actor/sink queues and arbitrary nested legacy payload serialization remain outside the new hub's bounded-ingress claim.
- Original driver source/server timestamps are independently optional; the source feed does not duplicate the legacy collapsed timestamp. Status-only hub updates preserve acquisition timestamps and receive age. Initial status without a value does not manufacture Good/null.
- Reservation, cache, read and snapshot ownership have explicit release paths. Shared budgeting includes source records, admitted payloads, controls, retained references and snapshot items across partitions. New binding identity fences prevent an old ticket from targeting a fresh binding even when key and numeric generation are reused. Ordinary source reclamation waits for reads, ingress reservations and snapshots, and its churn/owner-lifetime regressions pass; the H2 virtual-retirement and M4 repartition residuals remain.
- Snapshot capture retains immutable samples with partition watermarks and epoch checks. Cancellation, expiry, overflow, removal and repartition must reset/release the snapshot, and an independent delta read carries its own charge. Later stream/frame writers must retain their own charged references and perform the final publication gate; this checkpoint does not establish P06 wire delivery safety.
- Internal pre-activation acquisition may carry zero catalog/authority epochs. Public `DataSample.Validate` and wire codecs remain strict. The reviewed local read facade checks current catalog/authority, current source identity, type and caller policy before overlaying the trusted serving header, preserving original payload, version, age and timestamps. Returned values retain global resource charges and expose a publication lease invalidated by source/partition or authority changes. The quiet provisional-acquisition and prepared-response invalidation tests pass. Final transport use of that gate remains a later obligation.
- Local browse/metadata/read uses an origin-only immutable catalog, caller-bound credentials, export and local ACL decisions, bounded pages, and authenticated continuations tied to the caller and serving generation. Unknown, denied, initial, invalidated and over-age reads remain distinct. Imported views are excluded. Unsupported write/subscription adapters remain explicitly unavailable at this stage. Production catalog staging/Host activation is a separately scheduled review, not a new absence finding here.
- Task 10 and Host wiring remain review obligations: actual singleton ownership/disposal, shared catalog projection, activation failure/no-op/authority transitions, local policy and caller binding, missing/denied/waiting/over-age read results, capability availability, and source lifecycle/repartition recovery through the production graph. This document does not approve those unfinished boundaries or the complete gRPC feature.
All original and rereview findings were sent directly to the coordinator. Final disposition requires the remaining corrections, separate production-staging review and the coordinator's complete applicable gate, with saved candidate identity reconciled to the source reviewed here. The current partial pass is not P04 or complete-feature approval.
## Task 10 staging review
**Disposition: incomplete pending the agreed correction batch and M6.** The focused run `20261116T053226.727293Z-11a44bee32b8/unit/P04/run.json` passed all eight `GrpcDataCatalogStagingTests`, with no failures/skips. The reviewer inspected its report and confirmed the recorded `LocalCatalogCoordinator.cs` and staging-test hashes match the reviewed files. This is a focused staging pass, not a full P04 gate. The reviewed paths include `CatalogAttempt`, provisional activation authority, `ParseLocalCatalogSnapshot`, normal apply, cached boot, restore, headless completion and the joined publisher attempt. Production Host DI remains scheduled for P07 and is not an absence finding here.
The coordinator already identified three corrections before this review; they are recorded as agreed work, not new findings: cache a coherent role-adjusted catalog wrapper rather than allocating a new one on every access; fail eligibility closed when supplied serving NodeId differs from the host's local NodeId; and move cached/restore publisher sends after fallible desired-subscription work. These require the worker's tests-first correction and rereview.
The attempt coordinator uses exact object identity for authority installation, staging and completion; an older attempt cannot reinstall authority or activate its catalog after `BeginAttempt` closes it. The activation epoch advances even for a repeated artifact hash, so the staged token cannot revive an earlier completed catalog. Credentials are installed independently before catalog compilation and driver reconciliation; failed catalog topology does not roll back an already parsed revocation. Joined publisher requests do not begin a second activation, and publisher completion activates only the matching staged attempt. `PlanReady`/`PlanFailed` from another actor incarnation are rejected, while completion from a superseded attempt is rejected by the coordinator. These are sound source boundaries in the reviewed candidate. Actual stale-plan interleavings and corrected cache/restore failure paths still need applicable evidence.
### M6 — Make failed expected catalog activation retryable through deployment dispatch
**Severity: Medium. Status: resolved in final staging rereview.** `DriverHostActor.HandleArtifactForApply` around lines 3066–3068 ignores a false result from `LocalCatalogCoordinator.Complete`, then headless `AwaitAddressSpaceOutcomeThenAck` around line 3127 marks the revision confirmed and sends a clean Applied acknowledgment. With an SDK publisher, `FinishRebuild` around lines 1216–1219 also ignores failed catalog completion and reports only the sink outcome. A failed expected catalog stage or activation with successful legacy topology can therefore be recorded as clean. `HandleDispatchFromSteady` around lines 2859–2869 subsequently short-circuits the same revision, preventing operator redispatch from retrying catalog repair.
Keep legacy availability independent, but include failure of an expected data catalog in deployment degraded/unconfirmed status. Ordinary artifacts with no expected data catalog must retain their compatibility behavior. Test an actual host dispatch with a transient catalog-stage failure followed by redispatch of the same revision, verifying a new attempt and eventual readiness. The existing same-revision test invokes `BeginAttempt` directly and does not exercise the host dispatch short-circuit.
The staging corrections and M6 were sent to the coordinator. This review stops at the requested checkpoint while source/hub and staging workers apply their separate verified corrections; it makes no overall phase approval.
## Focused source/hub correction review
The source run `20261116T054124.390909Z-bfd4f5cc2345` passed **35/35**, and the hub run `20261116T054353.930760Z-80fdd94dde21` passed **20/20**, both with zero failures/skips. The reviewer inspected both saved reports and reconciled the recorded hashes for the publisher, partition/hub/snapshot sources and their two focused test classes; each matched. Staging files were actively being corrected separately and were excluded from this focused rereview. These results do not constitute the full P04 gate.
- **H2 resolved:** virtual retirement immediately closes the producer fence, then removes only the route whose producer object matches that retired identity. Registering a replacement cleans the previous binding too. Real virtual-actor churn with a one-source limit returns capacity, and stale retirement cannot close a replacement. The prior fence-only leak is corrected.
- **H3 resolved:** failed initial hub admission no longer prevents physical Subscribe or legacy callback delivery. Initial binding work and subsequent retries are bounded batches; a single versioned timer with capped backoff cannot accumulate retry messages or tear down the active subscription. Missing and unsupported shapes remain unavailable in the new feed while legacy delivery proceeds. Recovery waits for an actual new source event and never replays the dropped payload as fresh. The full-hub and missing/unsupported-shape actor regressions pass. The remaining initial-batch coverage issue is M1 below.
- **M4 resolved:** a source now has a registry metadata owner plus an owner for every retained read, reservation and snapshot. Partition disposal retires old binding fences and releases only the registry owner. The source byte charge and tracked-source count are released exactly once when the last metadata owner goes away. Ordinary reclamation, failed old commit, repeated disposal and repartition remain fenced. Four long-key cases cover read/reservation retention against both byte and source-count limits; a separate regression rejects the old ticket after partition disposal.
- **M5 resolved:** shared driver and virtual source-key factories canonicalize only the origin-cluster string with invariant uppercase. Driver/reference, virtual ID, node and incarnation remain opaque and case-preserving. The catalog and producers both use these factories. The case-parity regression verifies canonical cluster equality and distinguishes opaque identifier variants.
### M1 residual — Preserve quiet initial acquisitions beyond the preparation batch
`DriverInstanceActor.HandleSubscribeAsync` around line 1506 prepares only `SourceBindingBatchSize` (128) references before calling the driver's Subscribe for the entire list. `PublishSource` around line 1986 only captures an existing route and silently returns when none exists. Consequently, even with ample hub capacity and valid types, a driver subscribing more than 128 quiet sources and synchronously emitting its initial batch loses every new acquisition after the first 128. The later timer creates those bindings but does not obtain a fresh acquisition; those sources remain waiting indefinitely if the device values do not change. The existing corrected tests each use one source and do not cover this ordinary healthy case.
Complete healthy initial preparation in bounded stages without waiting indefinitely for failed admissions, or use an equivalent nonblocking callback-admission/fresh-acquisition strategy. Preserve H3's legacy availability under pressure and the prohibition on replaying an old payload as fresh. Add an actual actor/driver regression with at least 129 quiet initial values and sufficient hub capacity, verifying that every admissible source obtains its real initial sample.
This residual was sent directly to the coordinator. Source/hub findings H2/H3/M4/M5 are closed; M1 remains open. Staging corrections, M6 and the full phase gate remain separate pending work.
## Final targeted M1 correction review
**M1 resolved.** The reviewer inspected the actual RED TRX from `20261116T054854.714447Z-3f6eb6203de4`: the 130-source sole-initial-batch actor test failed because `source-128` had no admitted ticket. The subsequent focused run `20261116T055309.152744Z-9dee8a78ffeb` passed **36/36**, zero failures/skips, including that regression and the H3 pressure cases. Recorded publisher, hub/partition and source-test hashes match the reread candidate.
When a current driver callback has no route, it now attempts admission using the registered trusted shape and current producer incarnation. Admission uses `Monitor.TryEnter` for both the publisher control gate and an existing per-source gate; creating a new slot under the already-held control gate cannot wait behind a competing creator. The hub retains its nonblocking admission and retirement checks. The callback then recaptures the valid ticket and publishes that same actual acquisition, preserving its original timestamps. It neither queues a historical payload for later replay nor makes legacy subscription success depend on hub admission. Missing shapes, retired producers, contention and capacity rejection remain fail-closed for the new feed while the legacy callback proceeds.
The actual batch-capable driver regression emits all 130 initial values once, verifies one legacy subscription and one full legacy batch, then verifies every hub source, value and original timestamp. H2/H3/M4/M5 remain resolved; no additional source/hub blocker was found in this narrow review. Staging files were excluded, and neither this focused pass nor these source resolutions approve the overall P04 phase.
## Final staging source rereview
**M6 and the three agreed staging corrections are resolved.** The reviewer inspected `20261116T055656.284057Z-33ba66cac80e/unit/P04/run.json`, which passed **19/19 staging tests**, zero failures/skips. Recorded coordinator, catalog/local-service and staging-test hashes matched the reread candidate. The source/hub corrections remain resolved by their earlier focused gates; this pass did not reopen unrelated source/hub work.
- `LocalCatalogCoordinator.Current` caches a role-adjusted wrapper using compare/exchange. Reads make a bounded number of lock-free identity/role/activity checks and return unavailable during unresolved churn; the producer never waits on the coordinator's staging lock. The role transition reuses the immutable node catalog and does not change acquisition timestamps, version or monotonic receive age. The role-wrapper identity and retained-acquisition regression passes.
- Host and standalone publisher staging require the serving NodeId to match the actual actor's local NodeId. Coordinator staging also checks the exact serving node against enabled, non-maintenance membership in the authority's cluster. The materialized snapshot parser requires one eligible node and one enabled matching cluster before supplying a snapshot. Failed eligibility does not roll back independently installed credentials.
- Cache boot and Direct restore perform desired-subscription work before sending publisher completion work. Throwing work closes the attempt and prevents the send. Direct restore reuses its loaded `appliedBlob`, eliminating the redundant database read; the regression limits the DB factory to Bootstrap plus artifact load and observes the real deferred driver's Subscribe references. Four cache/restore ordering/failure cases pass.
- A failed **expected** catalog activation now contributes degraded/unconfirmed deployment status in both headless and publisher-backed apply. Actual host redispatch of the same revision retries and advances the attempt epoch after a transient provenance failure; both variants pass. Artifacts without data configuration, or with well-formed empty data sections, preserve clean legacy behavior. Cache boot remains unconfirmed until a subsequent real dispatch; Direct restore marks failed or unconfirmed expected catalog work accordingly.
- Exact attempt identity, staged-epoch activation, stale-attempt authority rejection and independent revocation behavior remain intact. Catalog failure does not undo parsed key revocation; a previously completed catalog stays inactive after a new attempt, including a repeated revision hash. The joined host/publisher path uses one attempt and waits for successful topology before serving it.
No remaining source blocker was found in this final staging scope. The source checkpoint is approved **conditional on the complete applicable P04 gate and reconciliation of its candidate identity**. Production Host DI is still P07; transport final-send use of the publication lease and imported SDK timestamp consumption remain later planned obligations. This source approval does not imply completion of the whole gRPC feature.