feat: add bounded shared grpc subscriptions and delivery scheduling
This commit is contained in:
@@ -21,7 +21,7 @@ The [implementation plan](../../2026-11-15-grpc-data-connections-implementation-
|
||||
| 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 | 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 | Passed; Astra approved | Complete gate 910/910 passed `20261116T084759.594405Z-42a294fc7f4f` after three Astra regression corrections; source and candidate reconciliation approved |
|
||||
| P06 | Streams/sharing/fair delivery | Pending | |
|
||||
| P06 | Streams/sharing/fair delivery | Passed | 347/347 applicable tests; Astra approved frozen source and evidence |
|
||||
| P07 | TLS/provisioning/node+cluster clients | Pending | |
|
||||
| P08 | Raw/UNS projection and adapter | Pending | |
|
||||
| P09 | Authoring/diagnostics/docs | Pending | |
|
||||
@@ -67,6 +67,8 @@ 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.
|
||||
|
||||
Further independent preparation adds a standalone six-process Compose scaffold and standard-library Modbus fixture with controlled values, bounded request/effect ledgers and response loss after a committed write. The device import and missing Compose file first failed the focused tests. Device tests subsequently passed 6/6; Compose checks initially passed 3/4 because the static test did not resolve shared environment anchors, then passed 4/4 after anchor-aware validation. These ten pure tests do not start sockets, images, SQL or clusters. The scaffold still needs actual P07 option/provisioning integration, production seeding, rig bring-up, probes and the complete scenario matrix. Its README explicitly marks it unready for integration execution.
|
||||
|
||||
## P05 execution notes
|
||||
|
||||
Runtime and SDK missing-API RED evidence is `20261116T062437.578601Z-6e2b4f1b2274` and `20261116T062507.986231Z-c09214fa8087`. The real DI composition test failed on the missing shared fence in `20261116T064939.908320Z-4dd869b001d4`; runtime registration now supplies one singleton without replacing an explicit registration. Rich actor creation initially failed all 19 startup checks because Akka constructor-based Props could not use the private rich constructor. An explicit indirect producer fixed creation, verified by one narrowly filtered positive test in `20261116T071454.486118Z-e187323e8fe5`; this was a diagnostic selection through the same discovery/TRX/source-identity guards, not a complete phase gate.
|
||||
@@ -99,6 +101,48 @@ The second complete P04 attempt (`20261116T051418.493232Z-1a9b4de9e45b`) passed
|
||||
|
||||
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.
|
||||
|
||||
## P06 execution notes
|
||||
|
||||
Contract/snapshot/scheduler missing-API RED runs are `20261116T090555.887076Z-88a1a655c97a` (domain), `20261116T090622.646503Z-69431655f988` (codec), and `20261116T090949.154052Z-f390d639aa3b` (Runtime). The initial implemented checkpoints passed three age-bound cases in `20261116T091759.726527Z-47842bcc7d04` and 17 Runtime snapshot/demand/filter/scheduler cases in `20261116T091915.704872Z-979135d67097`. These are partial checkpoints, not the completed P06 phase.
|
||||
|
||||
The first new-codec gate passed nine cases and failed two large-payload positive assertions in `20261116T091836.781413Z-d8ddfcedba28`: the test budget covered the wire frame but not conservative decoded ownership. Tests now explicitly distinguish wire size from retained-memory admission; production limits were preserved. The complete selected Commons contract/codec regression packet passed in `20261116T092030.559269Z-346643852cdf`.
|
||||
|
||||
Age means residence since normalized ingress into the origin cache, independently of optional source/server wall-clock timestamps; it is not a claim about physical sensor measurement age. Remote age has explicit unknown bounds. The additive readiness/age capability stays unadvertised until the actual subscription pipeline is wired. The physical acquisition capability and actual Modbus adapter must report every genuine read before legacy change/deadband filtering, acknowledge the applied nominal cadence/revision, and avoid replaying cached values as new acquisitions. Session/driver integration and Astra implementation approval remain pending.
|
||||
|
||||
Physical acquisition RED is `20261116T092213.780186Z-6e75dfd1fc3b` (missing polling overload; also corrected test cancellation analyzer calls) and `20261116T092313.306040Z-370aa67ce4d6` (all three Modbus capability assertions failed). The initial Modbus discovery attempt `20261116T092232.356497Z-194e5da4a6f3` was blocked by test cancellation analyzers, so it is not behavioral evidence. A subsequent shared-graph build exposed an internal capability self-call analyzer error; cancellation cleanup now uses a private shared teardown helper. The selected Core packet passed 46/46 in `20261116T092653.614865Z-b9ed343a2334`; the accompanying Modbus packet passed 22 and failed the added zero-revision rejection. Positive revision/incarnation validation corrected that case, and all 23 selected Modbus tests passed in `20261116T092821.814454Z-4024463d7fca`. Existing teardown has a bounded drain; late callbacks still require Runtime producer/revision fences.
|
||||
|
||||
The next Runtime integration packet produced expected missing session/demand API RED in `20261116T092616.984947Z-66d46b727bc0`. Actual stream delivery, atomic snapshot interests, process/principal retained-work accounting, final authorization, actor demand integration and allocation-bounded filters remain in progress. Root review additionally identified case-variant principal quota bypass and defensive payload copies during comparisons; their regression tests are included in that packet. No complete P06 gate or implementation approval is claimed yet.
|
||||
|
||||
[Astra's partial implementation review](p06-implementation-astra-review.md) identified quadratic aggregate churn and acceptance of timer-unsupported acquisition intervals. The timer boundary regression failed in `20261116T093305.697958Z-fa3bd0327df6` (three passed/one failed); acquisition-only duration admission then passed all four new Modbus cases in `20261116T093519.443159Z-996d88ad1e71`. The legacy subscription API remains unchanged. Incremental shared-demand aggregation and its allocation/work regression remain pending.
|
||||
|
||||
Directly delivered value frames need resource ownership that survives session disposal. The first ownership checkpoint `20261116T093216.693352Z-2db0e105997b` was blocked by incomplete Runtime production types: Abstractions.Tests transitively builds Runtime through Historian.Gateway. After a coordinated source freeze, the expected missing ResourceLease API RED was recorded in `20261116T093431.313767Z-ef4fa54f980a`. The additive frame lease, idempotent disposal and rejection of both leased and unleased record copies passed all four cases in `20261116T093704.423755Z-5feafefc60ff`. Actor desired/ack API RED is `20261116T093549.082848Z-403e19b7ba34`; unrelated sink/test-call typos were also corrected after that run. Actor/session integration is not yet verified. The phase selector now includes affected hub ownership/history, local catalog/read and actor subscription/lifetime regressions because those production paths change in P06; no full solution test is run here.
|
||||
|
||||
The three child actor cases passed in `20261116T094432.038923Z-6d193b687a72`: acknowledgment waits for the actual driver operation, and failed or unsupported acquisition replacements preserve a live legacy subscription. Earlier actor-checkpoint builds `20261116T094215.457791Z-72f90b742d04` and `20261116T094312.925616Z-6154cc7d41c9` were blocked by an unused partial-session field and test cancellation analyzer errors; they are not behavioral evidence. A focused 20-case Runtime packet then passed 19 and failed the aggregate-churn allocation regression in `20261116T094545.247524Z-87d37de0efa1`, confirming Astra's finding without a throughput/timing threshold. Counted extrema now replace full-interest rescans, but its green gate is pending the complete assembly's next compile checkpoint.
|
||||
|
||||
The next test-first packet covers physical establishment capacity across stopped/replaced actors, bounded late handle cleanup, actual Host merged demand and the shared bridge. Expected missing capacity/bridge/Host API RED is `20261116T094938.676145Z-40dbd55d4320`; an unrelated missing test namespace also needs correction. The capacity owner must be explicitly shared for the process, survive actor lifetimes, and retain its permit through the actual operation and cleanup even when cancellation is ignored. A demand acknowledgment boundary is an applied desired-revision fence, not a sample version or freshness claim; the session separately captures real origin partition watermarks and original ingress age after that acknowledgment. Idle/control-only sessions also require process/principal admission before allocating their queues and workers. All these integrations remain unapproved until their complete gate.
|
||||
|
||||
The combined checkpoint `20261116T100206.021944Z-b25026632dfd` executed 31 tests: **29 passed/two failed**. All six demand-sharing cases (including allocation churn and counted extrema), five filter cases, nine snapshot cases, three existing new actor cases, two bridge cases, and one actual Host demand merge case passed. Acquisition capacity had one pass and one deathwatch-harness failure caused by a legitimate disconnect notification preceding termination. Recovery admission had two passes and the expected failure at the still-unavailable subscription service. Neither this packet nor its compiler-blocked predecessor `20261116T095912.915565Z-a34b86c483b0` is a complete P06 gate. The predecessor identified cleanup-invoker analyzer typing, subsequently corrected while preserving no-retry actual-task observation. Actor reservations now cover active handles plus pending establishment/cleanup; final lifetime and post-stop tests remain required.
|
||||
|
||||
The next RED packet `20261116T100629.814124Z-bbbd8baf04d4` confirms missing snapshot principal-byte/rate/lifetime APIs and typed proven-undispatched Busy acknowledgments. Busy cleanup recovery must coalesce latest demand without blocking other drivers or retrying uncertain establishment. Raw callbacks must reject references outside the acknowledged desired set. Main session work also needs a resumable snapshot job, original-age preservation during concurrent ordinary updates, escaped-frame accounting, final authorization/sequence gates, idle admission, process fairness and target-aware local composition before enabling its port.
|
||||
|
||||
Fixture preparation commit `136c8a38e` used the older Sol model in error; that assignment was stopped and the user was informed. An independent review using the required `gpt-6.1-sol`/high model is recorded in the [draft fixture inventory](fixture-inventory-preparation.md). It identifies a required Modbus exception-response fix, limited fixture request-ledger evidence, and P12 local-endpoint/container-ownership seams that must be fixed before the full run. Its 64-project inventory is source inspection only and must be refreshed against final discovery/TRX. No Docker, SQL or full-suite execution is implied.
|
||||
|
||||
Expanded status, fake-clock timeout, bridge-work/fairness and Host lifecycle regressions first reached missing-API RED in `20261116T102033.317886Z-fe030bebd5db`. After the coherent overhaul, all **22** selected actor/acquisition cases passed in `20261116T103207.142491Z-f2c7a4f94f17` (six bridge, four child actor, three capacity, five status and four Host). The preceding attempt `20261116T102936.004453Z-8b5110c07719` was blocked by an unused field in the unfinished session engine. This 22-case result is a component checkpoint, not P06 approval. Astra's independent rereview verified those fixes but identified additional owner/tombstone lifetime, alarm-only merge, canceled-demand rollback and retired-handle legacy-event gaps. Their next test-first packet produced missing owner/key registration and Host-turn seam API RED in `20261116T104024.331048Z-91174ab24adc`; implementation/rereview remain pending.
|
||||
|
||||
The main session port is now constructible only through an explicitly injected local factory after stream admission; Host/network registration and default capability exposure remain absent. Resumable snapshots, modified-item writer barriers, principal fairness, command ownership/rates and physical quota lifetimes are still draft code. A stale-authentication-epoch subscription regression was authored before its guard, but no separate pre-fix behavioral RED was observed for that small correction; the positive-control/new-epoch and stale-epoch outcomes must pass the actual engine gate. Initial acquisition failure remains WaitingForInitialData without a sample; it does not invent Good/null values or claim the original Bad quality was transmitted before a real sample exists. Pre-ack callback dropping is an approved latency tradeoff only with honest Waiting and a subsequent genuine acquisition, not replayed freshness.
|
||||
|
||||
Delayed reservation commit produced actual timestamp RED in `20261116T104832.453678Z-1758fc97601e` (nine passed/one failed). Admission now captures the origin monotonic timestamp in the owned ingress reservation rather than refreshing it at commit. The first real engine packet passed 35/36 in `20261116T105127.719002Z-6c64769eb114`; its multi-alias snapshot test exposed an actual post-SnapshotEnd overflow because dirty traversal advanced more interests than free value slots. Capacity-limited resumable traversal and a stronger all-five-handles/explicit-heartbeat regression passed 36/36 in `20261116T105445.951505Z-23dc2a9591ff`. The selected independent Commons/Modbus packet passed 39 + 24 = 63 tests in `20261116T105648.129219Z-c0505982db88`.
|
||||
|
||||
Astra's next eight engine findings received diagnostic-only hooks and an actual pre-fix behavioral run. `20261116T111337.858796Z-822cd358d71d` executed 87 tests (69 passed/18 failed): ten engine failures reproduced the eight findings, including both post-Prepare stale-authority emissions, queued cadence, direct age bounds, invisible coalescing, spare-slot fairness, repeated snapshot-validation allocation, timer bookkeeping, and unopened cancellation/expiry. The other eight failures shared an unrelated Host startup problem: Receive handlers had been registered from PreStart instead of actor construction/Become. One narrowly selected Host case passed after that correction in `20261116T112616.645708Z-382c46b4cf80`, followed by all eight Host cases in `20261116T112828.508164Z-bfeaacf1ab99`. The earlier run's remaining physical classes passed seven bridge, seven actor, three capacity and five status cases; these component results do not substitute for a final combined gate.
|
||||
|
||||
Session corrections and the first aggregate-fence implementation passed all 54 focused cases in `20261116T114015.329991Z-4a96ebf2233e` (19 ordering, 19 snapshot, ten recovery, six fairness). A preceding discovery attempt `20261116T113546.146967Z-314d908e7dae` was blocked by test cancellation analyzers. Main code is frozen for independent rereview; aggregate counter/partition-boundary follow-ups and three further bridge lifecycle findings remain open. The latter cover owner refresh after Host restart with no live keys, admission ownership after a canceled Open reply, and already-captured retired callbacks during handler detachment. No P06 completion or final approval is claimed.
|
||||
|
||||
Independent P10 fixture protocol preparation now uses the specified Sol model and is committed as `92e6430e0`. Fourteen pure function/fake-stream tests first failed on refusal replies and missing total-request accounting, then passed after proper exception responses, bounded structural ledgers and preserved deliberate close-after-commit behavior. This exercises the actual handler with memory-only sockets; it is not a real network, Docker, SQL or CLI scenario gate. Those remain pending.
|
||||
|
||||
The aggregate hub correction was delegated to a separate Terra/xhigh owner while the actor owner held a read-only role. Immutable current-route attachment vectors, one-hub ownership, control in-progress markers, retirement helping, finite partition bounds, advancing cached history minima and per-item handoff checks now replace full-source validation scans. The focused aggregate follow-up passed all 22 snapshot tests in `20261116T115224.552541Z-89d4622a55af`; its independent review is pending. Ordinary sample changes preserve frozen snapshots. Control and routing exhaustion fail closed; the pre-existing ordinary watermark/ordinal overflow paths were not expanded in this change.
|
||||
|
||||
That same combined run executed 61 cases: 56 passed and five failed exactly in newly added reviewer regressions. Two Main failures reproduce a quiet return-to-baseline suppressing the Coalesced notice and a direct Modify acknowledgment escaping after revocation during commit cleanup. Three actor/bridge failures reproduce cached owner proof after an idle Host restart, uncertain Open reply admission leakage, and an already-captured old callback during handler detachment. The respective owners are fixing these after the observed behavioral RED; no final component or P06 approval is inferred. Earlier review suspicions of a direct *value* blocking-lock authorization gap were withdrawn after source inspection and are not represented as confirmed findings.
|
||||
|
||||
## 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. The agreed rich path shares a short dispatch/publication fence across actual authority, catalog, primary-verdict, route and driver-lifetime pointer changes; permission evaluation, callbacks and arbitrary driver code remain outside it. The dispatch mark is the documented linearization point immediately before the driver call on the same delegate path. Dispatched Unknown claims and physical-call/payload permits remain pinned until the actual task ends, even after observer retention expires. Real per-item endpoint switching belongs to the P07 connection-client gate, with mapped integration in P08; P05 must prove ordered partial executor outcomes without a fabricated failover client.
|
||||
@@ -118,3 +162,7 @@ Read-only security preparation confirmed that caller-supplied `DataView.Subject`
|
||||
Test-first domain/protocol changes and targeted review regressions produced recorded failures before correction. Final P01 run `20261116T024814.318745Z-3a06bbb5af5e` passed 15 Core.Abstractions and 36 Commons tests, including named existing protocol regressions, with no failures or skips. No broad unit or integration suite was run. [Astra checkpoint](p01-astra-review.md) approves P01 freeze only after cluster identity, original credential identity, array metadata, receiver-owned aggregate decoding, per-value element limits, pinned stream provenance, additive negotiation and structural/descriptor corrections.
|
||||
|
||||
The frozen facade is caller-bound through `IDataConnectionFactory` and `DataAuthenticatedContext`; no authenticated identity comes from protobuf claims. `DataWriteAdmission` retains original key/version/expiry. Capabilities carry cluster identity and independently advertised array-element limits. Compact and fallback stream decoding require expected serving identity. Array/byte storage uses defensive managed copies and separate disposable leases; pooling is deferred. Post-parse budget checks do not substitute for the P07 transport parse/decompression or P11 measured-memory gates.
|
||||
|
||||
### P06 final gate and approval
|
||||
|
||||
The frozen full P06 gate `20261116T121919.790393Z-0175b7fac86f` passed **347/347**, with zero failures or skips: Runtime 234, Abstractions 50, Commons 39, Modbus 24. Astra independently reconciled all four TRX files, HEAD, tracked diff and all 28 untracked production/test file hashes. [Final P06 review](p06-implementation-astra-review.md) approves the phase with no remaining actionable findings. This supersedes the earlier in-progress checkpoint notes; production network composition, Docker validation, benchmarks and final integrated review remain P07/P10/P11/P12 work.
|
||||
|
||||
@@ -0,0 +1,388 @@
|
||||
# P06 Astra implementation review — approved
|
||||
|
||||
**Final disposition: P06 approved.** All actionable findings in this review are closed by frozen-source rereview and the complete applicable P06 gate: **347 passed, zero failed, zero skipped** in `20261116T121919.790393Z-0175b7fac86f`. The final source/evidence reconciliation and scope limits are recorded at the end of this note. This approves Tasks 13/14 and the P06 implementation scope; it does not approve the later network integration or the completed overall feature.
|
||||
|
||||
The review began with dirty P06 work over baseline `65871d079` on `codex/grpc-data-connections`, against Tasks 13/14 and `p06-contract-astra-review.md`, and continued through the final frozen implementation at HEAD `92e6430e062cfde1a97d7142d46581f05c893091`. The final reviewed scope includes domain age/value and delivery ownership contracts, physical acquisition and Modbus/PollGroupEngine, protobuf/mapper extensions, demand/filter/scheduler/admission primitives, the session and target-aware local service, transport capacity, atomic snapshot/steady-interest capture, hub control fences/history, and the actual driver actor/Host bridge.
|
||||
|
||||
The sections below preserve the chronological checkpoints, original findings, and repair evidence. Their historical pending/open dispositions are superseded by the final disposition above and the final reconciliation below. The initial checkpoint deliberately excluded then-active session, actor, capture, and snapshot work; those components were subsequently frozen and independently reviewed. No tests, builds, Docker commands, or commits were run by this reviewer; source inspection and independent reading of coordinator-produced artifacts establish the review evidence.
|
||||
|
||||
## Finding dispositions
|
||||
|
||||
### P2 — Shared-interest churn performs quadratic work under the registry-wide lock
|
||||
|
||||
The original `UpstreamDemandRegistry.TryAdd` and `Remove` called `Update` while holding `_gate`. `Update` copied all settings with `e.Interests.Values.ToArray()` on every mutation (original `UpstreamDemandRegistry.cs:87-90`); `SubscriptionSettingsAggregator.Aggregate` validated and scanned the collection for both minima and the maximum trigger (`SubscriptionSettingsAggregator.cs:12-14`). Adding and then releasing N views of one shared source therefore performed Θ(N²) traversal/allocation, including when every view asked for identical settings. Because the lock belongs to the entire registry, this also delayed unrelated source/principal demand operations.
|
||||
|
||||
**Focused rereview: closed for the registry primitive.** The current entry maintains counted sampling/publishing intervals and triggers (`UpstreamDemandRegistry.cs:20-62`), updates them on add/removal, and derives desired settings from the extrema (`:126-129`). Multiplicity keeps an extreme present until its last holder leaves. There is no whole-interest traversal or copy in the mutation path; work is bounded by logarithmic access to distinct settings rather than total shared-view fan-out. The added tests cover add/remove allocation, duplicate extrema with unchanged revision, and trigger downgrade. The coordinator supplied an actual behavioral red run, `20261116T094545.247524Z-87d37de0efa1` (19 passed, 1 failed), with approximately 3.8 MB allocated by the original implementation for 64 additions, followed by 6/6 registry tests passing in `20261116T100956.692745Z-3b3534c093bc`. The bridge's separate aggregation finding below remains open.
|
||||
|
||||
### P2 — Acknowledged Modbus cadence can exceed the polling timer's supported range
|
||||
|
||||
The original `ModbusDriver.SubscribeAcquisitionAsync` rejected negative intervals but accepted every positive `TimeSpan` and reported the requested value as the supported nominal cadence (original `ModbusDriver.cs:2030-2046`). `PollGroupEngine` later passes the remaining interval directly to `Task.Delay` (`PollGroupEngine.cs:313-324`). A request such as `TimeSpan.MaxValue` returned an apparently valid acquisition acknowledgment, then the poll loop faulted after its initial read because the timer could not accept that duration. That exception is not caught by the delay branch.
|
||||
|
||||
**Focused rereview: closed for the new acquisition capability.** `MaxAcquisitionInterval` is the supported timer ceiling, `uint.MaxValue - 1` milliseconds (`ModbusDriver.cs:235-237`), and the new capability rejects larger durations before `_poll.Subscribe` (`:2035-2042`). The boundary test rejects one millisecond above the ceiling and `TimeSpan.MaxValue` before any physical read, then admits the exact ceiling. The coordinator reports 4/4 passing in `20261116T093519.443159Z-996d88ad1e71`. The legacy subscription API is unchanged; this closure covers the P06 acknowledgment path reviewed here.
|
||||
|
||||
## Reviewed behavior that is consistent with the contract direction
|
||||
|
||||
- `DataAgeBounds` validates nonnegative and ordered bounds, preserves unknown endpoints, uses checked elapsed-time addition, and requires a finite known upper bound to certify freshness. These are bounds on normalized origin-cache ingress age, not sensor measurement age.
|
||||
- Fallback and compact protobuf forms use additive optional age/readiness fields. The capability bit is explicit. Negotiated missing/invalid readiness and negative age reject; unnegotiated readiness remains unspecified. Stream decoding creates a lower bound without a finite upper bound. Unary decoding clears the former exact-looking `Age` and only derives an upper bound when a causal request elapsed duration is supplied.
|
||||
- `DataValue.ContentEquals` compares private immutable byte/array storage directly and checks array kind and dimensions. The source inspection found no payload copy on that comparison path. The newly added Runtime allocation regressions still require a green coordinator-owned run.
|
||||
- The acquisition callback is installed before the poll task starts, receives every completed reader result before legacy change/deadband filtering, and carries the supplied desired revision/producer incarnation. The documented trusted callback must synchronously copy borrowed mutable values and must not mutate producer storage. Callback completion can precede establishment acknowledgment. Bounded teardown does not eliminate late callbacks; the Runtime generation fence remains essential.
|
||||
- `ClientFilterState.ShouldDeliver` does not commit considered candidates. `Commit` retains a distinct value lease and disposes the previous baseline. Status/serving changes bypass a value deadband, and the large-integer path conservatively avoids double-conversion suppression.
|
||||
- The scheduler deduplicates dirty source entries and resumes round-robin interest slices instead of restarting a hot source on every change. Snapshot and transport reservation leases release once, and capacity is checked before the primitive grants a reservation.
|
||||
|
||||
## Ownership direction reviewed during this checkpoint
|
||||
|
||||
The coordinator identified that a direct `DataSubscriptionValues` frame can outlive its session. The domain implementation now accepts an optional `ResourceLease`, disposes samples once, and releases the lease in `finally` (`IDataServices.cs:107-122`). A custom copy constructor rejects all record copies, including frames without a resource lease, so `with` cannot silently alias independently disposable sample ownership. The focused tests cover repeat disposal, existing constructor use, and rejection of leased/unleased copies without harming the original. The coordinator reports 4/4 passing in `20261116T093704.423755Z-5feafefc60ff`. This domain fix is accepted.
|
||||
|
||||
The Runtime ownership integration remains pending: reserve before retaining payloads; transfer the lease with an escaped direct frame; keep transport-owned frame/prepared bytes and reservations until the actual prepare/write operation completes, including ignored cancellation. Regressions must still demonstrate a frame retained beyond session disposal and prepare/write tasks that ignore cancellation. Domain disposal tests alone do not establish those session-level lifetimes.
|
||||
|
||||
## Required final P06 obligations
|
||||
|
||||
The primitive tests and this partial inspection do not demonstrate the following integrated requirements. The final review must inspect the frozen implementation and its actual gate evidence:
|
||||
|
||||
- Actual driver subscription acknowledgment with desired revision and producer incarnation; legacy/alarm plus gRPC union; unsupported/faster demand failure and revised settings; callback-before-ack and superseded/late callbacks; final-interest removal without deleting legacy interest.
|
||||
- Atomic steady-interest registration and snapshot/version capture; ownership independent of finite snapshot payload leases; updates during the acknowledgment/capture gap represented by snapshot or catch-up; bounded reset when catch-up cannot be maintained.
|
||||
- One stream consumer and serialized writer; exclusive direct versus transport delivery mode; actual adapter acceptance as the commit boundary; final authority/lease/item revision checks; successful-delivery baseline independent of considered/pending work; late receipts unable to commit into a replacement epoch.
|
||||
- Removal acknowledgment after prior in-flight delivery settles and queued old revisions are canceled/rejected; modify/re-add revision behavior; failed/ambiguous writer invalidating the epoch; old prepared candidates re-evaluated against the committed baseline.
|
||||
- Quiet-stream credential/authority/session expiry from monotonic deadlines, including control-only watches; admission of a disclosed positive capped lifetime; command acknowledgment timeout reported as uncertain where appropriate.
|
||||
- Bounded command and pending-value ownership, due-interest rescheduling, control/data fairness under a hot source and abusive command stream, no actor/partition/authority lock held through a stalled writer, and bounded outstanding operations when cancellation is ignored.
|
||||
- Global and per-principal recovery concurrency/bytes, snapshot lifetime and bandwidth admission, plus jittered retry guidance. The current `SnapshotAdmissionScheduler` primitive only establishes global byte and global/per-principal slot limits; other required limits must be demonstrated by its integration or additional primitives.
|
||||
- Late age sampling from the retained ingress timestamp, receiver-local elapsed age advancement, and status/readiness transitions that cannot reset origin age or be concealed by value filtering. P07's unary caller must supply elapsed time from the causal request start; the mapper cannot prove that causality itself.
|
||||
- A final P06 manifest gate covering the new classes and affected contracts on the reviewed candidate, followed by Astra review of the complete session/actor/resource paths. No OPC UA, Host ingress, or Docker integration claim follows from this checkpoint.
|
||||
|
||||
## Coordinator-supplied evidence available at review start
|
||||
|
||||
The coordinator reported the following existing runs; this reviewer did not rerun them:
|
||||
|
||||
| Scope | Result | Run ID |
|
||||
| --- | --- | --- |
|
||||
| Domain age/contracts | 3/3 | `20261116T091759.726527Z-47842bcc7d04` |
|
||||
| Commons selected classes | 39/39 | `20261116T092030.559269Z-346643852cdf` |
|
||||
| Early Runtime primitives | 17/17 | `20261116T091915.704872Z-979135d67097` |
|
||||
| Core age/contracts and existing/new PollGroupEngine | 46/46 | `20261116T092653.614865Z-b9ed343a2334` |
|
||||
| Final Modbus packet | 23/23 | `20261116T092821.814454Z-4024463d7fca` |
|
||||
|
||||
The earlier Modbus packet in the Core-associated run had 22 passing tests and one positive-fence red test; the later 23/23 packet supersedes that focused failure. The later `ContentEquals`/Runtime allocation additions and the still-active session integration are not covered by the early Runtime result. Follow-up coordinator-supplied evidence is recorded with each finding and in the actor checkpoint below. Final source freeze/phase gate remain pending; no final P06 approval is implied.
|
||||
|
||||
## Subsequent frozen actor/bridge checkpoint
|
||||
|
||||
This focused checkpoint reviewed `DriverInstanceActor.cs`, `DriverHostActor.cs`, `DriverHostSubscriptionDemandSource.cs`, the acquisition capacity implementation, and the four new actor/bridge test classes over HEAD `136c8a38e` plus dirty P06 work. The session engine, local subscription service implementation, rate admission, and changing atomic-capture/history paths remain excluded from final approval. The known failed-read status/age issue was already assigned for test-first repair and is recorded below without duplicating that investigation. No reviewer tests, builds, Docker commands, or commits were run.
|
||||
|
||||
### P1 — An abandoned replacement can multiply outstanding operations behind one driver reservation
|
||||
|
||||
**Closed in the subsequent frozen rereview below; original finding follows.** When an acquisition is already active, a replacement retains `_activeCapacity` (`DriverInstanceActor.cs:2046-2055`). If establishment times out, the catch abandons the operation and the finally block clears `_pendingAcquisition` (`:2124-2131`), but no unresolved-operation/cleanup task is installed in the guard consulted by the next request. The old active reference keeps the shared driver reservation alive, so another replacement can retain it and start. Repeated replacements against a driver ignoring cancellation can therefore accumulate unbounded pending establishments and late cleanup operations behind a single charged driver key.
|
||||
|
||||
Keep every unresolved replacement charged against an explicit per-key operation limit until its backend and any returned handle cleanup actually settle. A later request rejected before dispatch can return typed Busy with that real completion boundary. The required regression starts with an active subscription, times out a blocked replacement, then tries multiple further replacements and proves that the physical operation count and retained references remain bounded. The existing abandoned-initial-establishment test covers a different path where the absence of `_activeCapacity` correctly makes the global driver-key reservation reject another establishment.
|
||||
|
||||
### P1 — Bridge cache reuse can acknowledge a retired producer
|
||||
|
||||
**Closed in the subsequent frozen rereview below; original finding follows.** `DriverHostSubscriptionDemandSource.ApplyAsync` returns cached `Applied` when reference names and requested interval match (`DriverHostSubscriptionDemandSource.cs:88-93`). Although `Applied` stores `Producer`, the shortcut never checks it against the current child/producer, and the bridge has no retirement/invalidation input. After a driver restart or reconnect, a same-settings acquisition can return Good and the old boundary even while the new child has failed or is still blocked from establishing by old cleanup capacity.
|
||||
|
||||
Validate the actual current producer and applied revision before reusing an acknowledgment, or invalidate the bridge cache on the relevant route/incarnation change. Add a regression with an acknowledged initial demand, a replacement child whose establishment cannot finish, and a same-settings Acquire that must not succeed from the retired producer's cache.
|
||||
|
||||
### P1 — Deployment can overwrite a newly acknowledged gRPC demand with an older complete set
|
||||
|
||||
**Closed for value-reference/producer changes in the subsequent frozen rereview; the newly discovered alarm-only case remains open below. Original finding follows.** While `HandleAcquisitionDemand` waits for the child's physical operation, `_acquisitionDemands` still contains the previously acknowledged set or no gRPC demand. A concurrent deployment's bulk `SendDesiredSubscriptions` uses that old state (`DriverHostActor.cs:4014-4017`, `:4073-4089`) and queues it to the child. When establishment succeeds, `OnAcquisitionApplyCompleted` stores the new demand but does not resend the merge against the latest legacy set (`:4126-4136`). The queued legacy-only/older message can then clear `_desiredAcquisition` and replace the physical subscription after the caller received Good.
|
||||
|
||||
Serialize or revision-fence the complete desired state across both deployment and gRPC changes, and ensure successful acknowledgment corresponds to the final current merged state. Add a real-Host regression that gates gRPC establishment, applies a changed legacy set while it is pending, releases establishment, and verifies the final physical references/cadence contain the latest legacy plus admitted gRPC demand.
|
||||
|
||||
### P1 — A final removal after the driver disappears can leave demand that resurrects later
|
||||
|
||||
**Closed in the subsequent frozen rereview below; original finding follows.** `StopChild` removes the child but does not clear `_acquisitionDemands` (`DriverHostActor.cs:4292-4301`). `HandleAcquisitionDemand` rejects an empty update before removing stored demand if there is no live eligible child (`:4094-4106`). If the final lease is released after the driver leaves the plan, the bridge forgets its local demand but the Host retains it. Re-adding the same driver ID later merges and installs that stale gRPC interest despite having no consumer.
|
||||
|
||||
Process logical demand removal independently of whether a child is currently alive, and clear definitively retired driver demand as appropriate. Preserve revision fencing so a stale removal cannot erase a newer demand. Add a remove-driver, release-final-lease, re-add-driver regression that proves the old gRPC references do not return.
|
||||
|
||||
### P2 — Bridge aggregation repeats whole-interest churn and blocks unrelated driver establishment
|
||||
|
||||
**Closed in the subsequent frozen rereview below; original finding follows.** The bridge scans every interest, copies the selected driver's entries, computes distinct sorted references, and finds the minimum interval before testing its unchanged-demand shortcut (`DriverHostSubscriptionDemandSource.cs:88-93`). Adding N identical shared views again performs quadratic traversal/allocation, including scanning unrelated drivers, despite the registry's counted-extrema fix. In addition, the bridge-wide `_serial` is held across the actual Host Ask (`:59-76`, `:105-106`), so one stalled first establishment delays every other driver until timeout. The current fairness test only covers waiting after a typed Busy result has already returned.
|
||||
|
||||
Use bounded per-driver counted reference/settings state and per-driver serialization or an equivalent fair bounded dispatcher. Verify identical-view allocation/work scaling and driver B's progress while driver A's first establishment acknowledgment remains gated.
|
||||
|
||||
### Additional callback and status obligations
|
||||
|
||||
- **Callback-before-ack dropping is an approved latency tradeoff; the subsequent frozen rereview verifies the new ordering regression below.** The raw callback accepts only the new active fence, while that fence is installed after the backend Subscribe task completes, so initial callbacks before return are discarded. The coordinator clarified that the opted-in Modbus path may deliberately wait for the next genuine acquisition because it reports unchanged values every poll. This is not a correctness finding or a requirement to buffer tentative samples. A bounded owned pending-sample optimization preserving original ingress time is optional later latency work, not a P06 approval condition.
|
||||
- **The failed-read age gap is closed in the subsequent frozen rereview below.** The previous raw path sent bad/null acquisition results through normal `TryPublish`, which could replace the cached value and refresh `Received`. A status-only transition must preserve the retained last value, original timestamps, and normalized ingress age. Before any initial value exists, WaitingForInitialData with no sample remains the approved behavior; this checkpoint does not request a new domain/protobuf status payload.
|
||||
- **Legacy restoration versus blocked retirement still needs explicit evidence.** The final gRPC removal can route through `HandleSubscribeAsync`; `UnsubscribeAsync` retires an acquisition handle asynchronously and returns before its cleanup finishes (`DriverInstanceActor.cs:2185-2190`), after which legacy Subscribe continues. The final review should demonstrate the intended bound on overlapping physical polls and behavior when that retirement ignores cancellation, including subsequent legacy changes. The existing Host restoration test uses immediate unsubscribe completion.
|
||||
|
||||
### Actor evidence and limits
|
||||
|
||||
The coordinator reports run `20261116T100956.692745Z-3b3534c093bc`: 21 executed, 20 passed, one expected unfinished-Main-service Unavailable failure. Within this checkpoint's scope, actor 4/4, acquisition capacity 2/2, bridge 4/4, Host 1/1, and registry 6/6 passed; recovery had 3 passing and the Main Unavailable failure. This supplies green evidence for the counted-extrema registry fix described earlier, closing that original finding in its own class. It does not address the bridge's separate aggregation finding above.
|
||||
|
||||
The passing tests demonstrate actual driver completion before acknowledgment, failed/unsupported establishment preserving legacy acquisition, raw-reference scope rejection, capacity retained across an abandoned initial establishment and old-handle cleanup, typed-undispatched Busy reconciliation, another driver progressing during an already-reported Busy wait, and a simple real-Host legacy/gRPC union with final restoration. Source inspection also confirms a local actor-ref restriction, producer/desired-revision checks on returned acknowledgments, source publication before actor mailbox forwarding, and late abandoned-handle cleanup owned independently of actor lifetime. These claims do not cover the additional interleavings identified above. All new findings require focused regressions and rereview before final P06 disposition.
|
||||
|
||||
## Frozen actor/bridge/status overhaul rereview
|
||||
|
||||
**Disposition: the prior fixes below are verified in source and supported by the coordinator's focused 22/22 run, but four newly identified findings remain open. This is not actor checkpoint completion or final P06 approval.** The session engine, local service, hub/atomic-capture integration, and transport capacity remain active and unverified outside this scope.
|
||||
|
||||
The coordinator reports `20261116T103207.142491Z-f2c7a4f94f17`: bridge 6/6, actor 4/4, acquisition capacity 3/3, status 5/5, Host 4/4; zero required skips. The preceding `20261116T102936.004...` attempt was blocked by an unused field in the active Main implementation and supplied no behavioral gate result. No test commands were run by this reviewer.
|
||||
|
||||
### Verified fixes
|
||||
|
||||
- **Abandoned replacement bound:** `PendingAcquisition.Finished` covers backend completion plus cleanup. `_abandonedAcquisition` survives the mailbox-level timeout, and the next request returns Busy with that task before retaining capacity or starting a backend operation (`DriverInstanceActor.cs:1974-2057`, `:2064-2076`, `:2191`). The fake-clock regression establishes an active handle, times out its replacement, proves another request does not increment physical calls, then proves Busy remains pending until late-handle unsubscribe finishes.
|
||||
- **Current producer acknowledgment:** every bridge Acquire now asks the local Host, including unchanged desired settings (`DriverHostSubscriptionDemandSource.cs:136-160`). Host sends through the current child and checks pending-child identity. The real restart regression does not permit Good while the replacement has not acknowledged.
|
||||
- **Value-reference deployment merge:** Host records the desired gRPC state before dispatch, suppresses obsolete complete-set pushes while pending, and compares the completed operation with current value references, cadence, and producer before releasing acknowledgment (`DriverHostActor.cs:4079-4085`, `:4132-4140`, `:4201-4207`). The real deployment regression covers replacement with the new legacy value set plus gRPC demand. The alarm-only omission is a separate open finding below.
|
||||
- **Removal while absent:** empty logical demand clears Host state before requiring a current child (`DriverHostActor.cs:4123-4130`). The removal/re-add regression proves no gRPC acquisition is recreated after final interest release while the driver is absent. Revision tombstone reclamation remains unresolved below.
|
||||
- **Bridge churn/fairness:** per-driver counted references and interval counts replace global-interest scans. A reference snapshot is materialized only when unique reference membership changes, and serialization belongs to each driver (`DriverHostSubscriptionDemandSource.cs:14-25`, `:105-134`). Deterministic `ReferenceVisitCount` coverage checks identical-view churn, and a gated first acknowledgment on A no longer prevents B from completing.
|
||||
- **Failed-read status and age:** bad/null raw acquisitions use `TryPublishAcquisitionStatus` (`DriverInstanceActor.cs:2150-2152`). That method avoids the publisher-wide gate, tries the source-slot gate without waiting, preserves the cached value/timestamps/ingress age through status-only publication, and invalidates on contention/admission failure (`SourceSamplePublisher.cs:368-397`). The regression retains value 42 and both original timestamps after fake time advances three minutes, changes quality/version, and preserves `ReceivedTimestamp`. Initial status without a value remains WaitingForInitialData/no sample; global-gate and slot-gate contention tests establish nonblocking behavior at those boundaries.
|
||||
- **Approved pre-ack ordering:** `Pre_ack_callback_is_dropped_and_waiting_ends_only_after_a_later_real_read` confirms Waiting/no sample before and after acknowledgment, then Ready only after a new explicit physical callback. This verifies the approved latency tradeoff; no buffered initial sample or fabricated freshness is claimed.
|
||||
|
||||
### P2 — Settled revision tombstones permanently consume concurrent-driver admission
|
||||
|
||||
**Original settled-history leak repaired in the later owner/key checkpoint below; uncertain-open admission remains a separate finding.** `_acquisitionRevisions` retains every driver ID ever touched, including settled empty demands, and `HandleAcquisitionDemand` uses its count against `MaxReservations` (`DriverHostActor.cs:4103-4123`). For a configured capacity of eight, eight sequential fully cleaned-up distinct driver IDs permanently deny a ninth even when no physical reservations or interests remain. This is bounded retained memory but unbounded loss of future availability over process lifetime. The revision namespace also lacks a demand-owner incarnation: a recreated bridge restarts its local counter below retained Host revisions.
|
||||
|
||||
Use a Host/bridge owner or catalog-generation barrier that fences stale messages while permitting safe reclamation of retired per-driver tombstones. Do not simply delete tombstones and accept stale queued updates, or redefine a concurrency limit as a hidden process-lifetime distinct-ID quota. Regress sequential distinct IDs beyond concurrent capacity, owner replacement, and delayed old-owner requests.
|
||||
|
||||
### P1 — Alarm-only deployment changes are lost while acquisition is pending
|
||||
|
||||
**Closed in the later owner/key checkpoint below; original finding follows.** `SendDesiredSubscriptions` suppresses child updates while acquisition is pending, but the completion comparison checks only value references, cadence, and producer (`DriverHostActor.cs:4201-4207`), omitting `AlarmReferences`. If a deployment changes only the legacy alarm set while physical establishment is gated, completion can return success with the old alarms and never send the new set. Compare the alarm portion of the complete desired state as well. Add a real-Host alarm-only deployment during pending acquisition and verify the actual alarm subscription receives the latest references.
|
||||
|
||||
### P1 — Canceled stronger demand can prevent rollback by reusing an old applied revision
|
||||
|
||||
**Closed in the later owner/key checkpoint below; original finding follows.** Bridge `ApplyAsync` reuses `existing.Revision` whenever the requested references and interval match its last successful `Applied` (`DriverHostSubscriptionDemandSource.cs:136-140`). Consider A applied at revision 1; adding B sends revision 2, then B's waiter cancels before the response. `state.Applied` remains revision 1. Reconciliation removes B, sees the old A-only desired set, and resends revision 1. The Host has already recorded revision 2 and rejects the rollback as stale (`DriverHostActor.cs:4105`). Reconciliation treats the ordinary failure as settled, so a late successful revision-2 establishment can leave canceled B polling indefinitely.
|
||||
|
||||
Track last-issued desired state separately from last successful application. Reuse a cached proof revision only when no newer desired revision was sent; rollback after an uncertain newer request needs a fresh revision. Regress active A, gated add B, cancel B, then late acknowledgment, and assert that final actual demand returns to A alone.
|
||||
|
||||
### P1 — Late old-handle legacy events bypass the acquisition fence after restoration
|
||||
|
||||
**Partially repaired: restored-handle staging is verified below, but the retirement/detachment transition remains open.** Final gRPC removal can retire the raw handle asynchronously and immediately establish the legacy subscription. Retirement clears `_activeAcquisition` and `_subscriptionHandle`; the newly attached legacy handler's `AcceptLegacyHandle` accepts every handle when no acquisition is active/pending (`DriverInstanceActor.cs:1944-1946`, `:2253-2256`, `:2297-2310`). If old-handle unsubscribe is still blocked, that old acquisition can emit its legacy `OnDataChange`/batch event into the new handler. The event is accepted, published into the source cache, and forwarded as current producer data even though the raw callback correctly rejects the old acquisition fence.
|
||||
|
||||
Keep obsolete handles fenced across the return to legacy operation, or wait for physical retirement before permitting the new publication path. Regress blocked old-handle cleanup, a late legacy event from that handle, and a genuine event from the restored legacy handle; only the current operation may update the cache and mailbox publication. This is the concrete correctness consequence of the earlier blocked-retirement coverage obligation.
|
||||
|
||||
## Frozen Main engine and snapshot checkpoint
|
||||
|
||||
**Disposition: partial review; changes required below. The 36/36 focused engine result does not establish final engine or P06 approval.** This checkpoint inspected the frozen `DataSubscriptionSession`, local subscription facade/factory changes, transport and snapshot admission, steady source interests, snapshot capture/history, and the previously reviewed domain ownership/age contracts. The actor/Host/bridge/status files are being repaired separately and were not re-approved here. Production Host DI, HTTP/2 adapters, and network ingress remain P07 work; default feature advertisement remains disabled without an explicit subscription factory.
|
||||
|
||||
The coordinator reports engine run `20261116T105445.951505Z-23dc2a9591ff`: snapshot 10/10, recovery 7/7, stream ordering 14/14, fairness 5/5, zero skips. The preceding `20261116T105127.719...` run had 35 passed and one genuine post-SnapshotEnd dirty-cursor overflow failure; the corrected resumable cursor uses available value capacity, and the test now requires deltas for all five views plus only the explicitly expected heartbeat. Domain stale-authority coverage was authored before implementation but had no observed prefix red run; no such red evidence is claimed. The reviewer ran no tests, builds, Docker commands, or commits.
|
||||
|
||||
### Main behavior verified in source
|
||||
|
||||
- Transport mode and direct enumeration are exclusive for a session. Network delivery awaits `PrepareAsync`, performs validation, awaits actual `WriteAsync`, and commits a value baseline only after successful completion. Abandoning the caller's wait does not dispose the underlying frame/prepared operation early: the physical task retains frame, transport reservation, and a session hold until it finishes. The final-check ordering finding below narrows what can currently be claimed about authorization at handoff.
|
||||
- Direct value frames transfer a resource lease to the recipient and keep that charge after session disposal. Item and session resource holds are explicit; record copying remains rejected. Considered versions and delivered filter baselines are distinct, and an obsolete handle's queued values are rejected before a remove acknowledgment is emitted by the serialized writer.
|
||||
- Modify stages tentative demand and snapshot state, commits replacements only at acknowledgment acceptance, and defers later commands across that barrier. Changed filters obtain a new item revision/handle boundary and an ordered replacement snapshot. Interval-only changes preserve the item baseline and recalculate its due time; queued candidates still need the cadence fix below.
|
||||
- Authorization resolves the local authoritative view, source, target, export scope, exact context authority epoch, and original caller key. Node and Cluster targets reach the target-aware subscription factory. Value publication reuses the independently authorized view gate; original key expiry is capped into a monotonic session timer. Explicitly opened quiet control-only sessions expire without renewal.
|
||||
- Partition capture registers steady metadata interest and captures immutable state/watermark under the same partition lock. Snapshot payload lifetime is independent of steady-interest lifetime. Indexed bounded change history supports resumable per-partition catch-up; a gap or epoch mismatch resets the stream. Snapshot data uses the retained ingress timestamp, and ingress timestamp capture occurs before delayed normalization/commit rather than at later cache draining.
|
||||
- Snapshot permits account for global/per-principal slots and bytes, retain ownership through escaped/in-flight values, expire monotonically, and charge actual snapshot send bytes against per-second windows. Rejection supplies deterministic principal jitter. Command input collections are copied under a reserved budget and command rate is shared by case-insensitive principal.
|
||||
|
||||
### P1 — Final authority validation precedes later potentially blocking work
|
||||
|
||||
**Transport repair verified in the later Main rereview below; a direct control-commit handoff finding remains separately open.** `DeliverAsync` validates `pending.Gate()` after Prepare, then executes eligibility and snapshot-rate admission before `WriteAsync` (`DataSubscriptionSession.cs:1111-1117`). Eligibility can read the hub under a partition lock. In addition, the value gate itself evaluates `item.View.CanPublish()` before `snapshotLease.IsReset` (`:933-935`), whose validation acquires partition locks. Authority or credential expiry while those subsequent operations are blocked can leave a stale successful authorization decision and still hand previously unsent bytes to the transport.
|
||||
|
||||
Perform potentially blocking snapshot/eligibility/rate work before the final authority/lease/revision validation, then place that last validation immediately before the actual write handoff without holding owner locks through the write. Add a deterministic regression that blocks post-Prepare validation, revokes authority, and proves `WriteAsync` is never entered. This concerns a substantial controllable validation gap, not bytes already handed to the transport.
|
||||
|
||||
### P2 — An eligible principal can be stranded behind a quota-blocked waiter
|
||||
|
||||
**Closed in the later Main rereview below; also originally identified by the coordinator's self-audit.** `SubscriptionTransportCapacity.ReserveAsync` registers/enqueues a waiter but does not call `GrantWaiters` (`SubscriptionTransportCapacity.cs:139-150`). With global capacity two and per-principal capacity one, A can hold one operation and queue another. B then queues because `_waiting != 0`, even though the other global slot is free, and cannot advance until some unrelated release/cancellation occurs. The current release-order fairness tests do not cover an idle eligible slot at enqueue time.
|
||||
|
||||
Run the grant logic after safe waiter registration/enqueue, preserving synchronous cancellation handling. Regress B receiving its reservation while A's active operation and quota-blocked waiter remain unresolved.
|
||||
|
||||
### P2 — Queued live candidates can violate the newly committed publishing deadline
|
||||
|
||||
**Closed in the later Main rereview below; original finding follows.** `MakeValue.Eligible` reevaluates current sample version and filter baseline but does not check the item's latest `NextDue` (`DataSubscriptionSession.cs:950-957`). While a live WriteAsync is blocked, another candidate may be prepared using the old due time. The first write's eventual commit moves `NextDue` from actual delivery time (`:943-946`), yet the queued candidate can be sent immediately afterward. This violates the admitted sampling/publishing cadence even though the value filter is reevaluated.
|
||||
|
||||
Recheck due eligibility at delivery and reschedule the latest candidate without losing its dirty/considered boundary. Use fake time and a blocked first live write to prove the next live write waits until the recomputed deadline.
|
||||
|
||||
### P2 — Per-frame snapshot validation rescans the entire snapshot
|
||||
|
||||
**Closed in the later frozen aggregate-hub checkpoint below; original finding follows.** `SnapshotLease.IsReset` repeatedly groups all captured items, computes partition minima, and validates every ticket under partition locks (`SnapshotLease.cs:43-53`). `PumpSnapshotsAsync` invokes it per item, and each value gate invokes it again (`DataSubscriptionSession.cs:852`, `:933-935`). A snapshot containing N distinct captured sources consequently performs Θ(N²) validation work with repeated grouping allocations while emitting N frames.
|
||||
|
||||
Cache immutable partition grouping/boundaries and use bounded incremental validation or per-item validation combined with partition epoch/history fences. Add deterministic work/allocation coverage for a large snapshot; the five-view correctness case does not establish scalable validation.
|
||||
|
||||
### P2 — Unsupported acknowledgment timer durations leave unqueued pending state
|
||||
|
||||
**Closed in the later Main rereview below; original finding follows.** `SendAsync` accepts any positive acknowledgment timeout, inserts `_ackByCommand` and `_ackDeadlines`, then calls `ArmAckTimer` (`DataSubscriptionSession.cs:201`, `:217-222`). `ITimer.Change` cannot schedule every positive TimeSpan; an input such as `TimeSpan.MaxValue` can throw at `:285`. The catch releases only the command byte charge, leaving the acknowledgment ID/deadline installed even though no Work was queued. Repeating this can exhaust command admission, including before Open has installed session expiry.
|
||||
|
||||
Validate, cap, or segment supported timer durations before mutating admission state, and roll back acknowledgment bookkeeping if timer setup fails. Regress unsupported upper-bound input followed by a valid command to demonstrate no retained pending entry or capacity loss.
|
||||
|
||||
### P2 — Unopened streams ignore lifetime cancellation and have no timeout
|
||||
|
||||
**Closed in the later Main rereview below; original finding follows.** `LocalSubscriptionService.SubscribeAsync` checks the supplied token once but does not pass or link it to the new session (`LocalSubscriptionService.cs:46-57`). `DataSubscriptionSession` allocates a worker and stream reservation immediately, while its expiry/tick timers are not created until Open (`DataSubscriptionSession.cs:182-195`, `:374-396`). A caller can allocate a stream, never send Open, and cancel the documented stream-lifetime token without releasing any of those resources until explicit disposal.
|
||||
|
||||
Link subscription lifetime cancellation to Stop and enforce a bounded unopened/handshake lifetime. Regress cancellation of an unopened stream releasing its principal/global reservation without requiring an additional Dispose call.
|
||||
|
||||
### P2 — Pressure coalescing is invisible on the stream
|
||||
|
||||
**Partially repaired in the later Main rereview below; suppressed replacement values still leave the notification pending indefinitely.** The writer drops an already queued candidate when a newer hub version exists (`DataSubscriptionSession.cs:950-957`) and schedules the source again, but the engine never emits `DataStreamControlKind.Coalesced`. Sequence numbers advance only for accepted deliveries, so the receiver has no explicit indication of this replacement. Task 14 requires coalescing/reset visibility; pressure reset is implemented, but this coalescing path is not visible.
|
||||
|
||||
Emit a bounded coalescing notification for replacing an already queued value, distinct from normal interval/deadband suppression. Verify its ordering and ability to use the reserved control capacity without generating an unbounded control stream.
|
||||
|
||||
### P2 — Direct handoff can expose an age upper bound sampled too early
|
||||
|
||||
**Closed in the later Main rereview below; original finding follows.** `MakeValue` creates `DataAgeBounds(age, age)` when a pending frame is taken (`DataSubscriptionSession.cs:959-964`). Direct enumeration subsequently runs the gate and commit before returning MoveNext (`:1060-1063`), potentially waiting on session/snapshot/partition locks. If time advances during that delay, the finite Upper is below the actual age at receipt and `IsFresh(maximum)` can incorrectly certify freshness. The wire mapper avoids this by sending only a lower bound; direct consumers receive the finite bound unchanged.
|
||||
|
||||
Carry a usable local monotonic age anchor for direct consumers, or do not claim a finite upper bound from the pre-handoff age sample. Add a gated direct handoff with fake-time advancement and verify that freshness cannot be certified from an outdated upper bound.
|
||||
|
||||
### Snapshot validation repair direction — design review only
|
||||
|
||||
**The quadratic-validation finding remains open.** The coordinator reports that the eight-finding regression packet first reached a missing-diagnostic-API red result (`20261116T110903.018133...`); this is not behavioral red evidence. Only diagnostic seams are authorized before the next behavioral run. The following is a proposed control/lifetime design, not a verified implementation or phase approval.
|
||||
|
||||
Cache the snapshot's immutable partition groups and history minima once. Validate the individual ticket/read fence at a value handoff, and validate cached partition control stamps, epochs, history boundaries, routing, and lifetime in O(partitions) for aggregate reset/End checks. Ordinary sample publication must not change the control stamp. Preserve `TryReadDelta`'s advancing history positions with an incremental minimum if that API continues advancing them; permanently retaining the initial minimum would introduce false overflow resets after all items have advanced.
|
||||
|
||||
A plain `IsRetired = true; increment partition stamp` is insufficient: preemption between those operations lets End accept an unchanged stamp after retirement is visible. Use an explicit in-progress control phase. A producer's immutable attachment state moves Active → Sealing → Retired. Sealing freezes the unique partition-signal set and rejects new attachments, but existing reads see retirement only after every frozen signal has entered its control phase. Publish Retired, then complete each signal. This requires no partition lock, callback wait, or source scan. A concurrent Retire caller observing Sealing must not return with retirement incomplete; it can independently bracket the same frozen vector and publish Retired, with harmless duplicate invalidations, rather than waiting for the first caller.
|
||||
|
||||
Attach each signal before publishing its source binding, using CAS against Active. An attachment that wins before Sealing is included in retirement; an attachment that loses must fail binding publication. SourceBindingFence needs the same attach-before-visibility rule for its single partition. Keep the producer vector scoped to one explicitly enforced hub owner and its latest routing epoch; reject stale epoch attachments and replace the vector on a newer epoch, because old snapshots already fail routing validation. Never append historical partition objects. A monotonic unique-partition set within one epoch is bounded by that epoch's partition count, with a conservative reset of previously touched partitions as the availability tradeoff. Cross-hub reuse cannot silently overwrite another hub's signals.
|
||||
|
||||
For a strictly bounded retirement path, an equivalent representation uses a separate atomic Sealing flag and an immutable attachment vector. Attachment checks Active, CAS-publishes its vector, then checks Active again before binding publication. Retirement sets Sealing first and reads the vector once; all attachments permitted to publish a binding are then represented, while a late speculative vector update must fail its second Active check. Attachment can use bounded retries and fail closed under contention. This avoids a retirement CAS loop competing indefinitely with attachment churn while preserving the logically frozen set of published bindings.
|
||||
|
||||
Each partition signal needs a generation plus an active-control count, either atomically represented together or updated with the necessary ordering: Begin marks active before changing generation; End changes generation before clearing active. Capture/validation requires an unchanged generation and no active control on both sides of the relevant observation. Control operations must be nonthrowing, and counter overflow must fail closed rather than allow an ABA match. Bracket every source-invalidating mutation, including the lock-free `Signal` path, status barriers, generation replacement, and binding/producer retirement; covering retirement alone leaves other invalidations invisible.
|
||||
|
||||
Required repair evidence includes attach versus Sealing, retirement paused before all partition signals are marked, capture/End overlapping a control phase, concurrent Retire callers, retirement during repartition, stale-epoch attachment rejection, repeated repartition with bounded retained signal references, and unchanged sample updates leaving snapshots valid. Large-snapshot work/allocation coverage remains required in addition to these correctness interleavings. No implementation tests were run by this reviewer.
|
||||
|
||||
## Frozen actor owner/key and legacy-restoration checkpoint
|
||||
|
||||
**Disposition: partial checkpoint; three findings below require changes. No actor completion or final P06 approval is given.** This rereview inspected the frozen Host, instance actor, demand bridge, acquisition capacity, staged source publication, and focused regressions at coordinator-reported HEAD `92e6430e0` plus P06 working changes. Session fixes and aggregate hub fencing remain active and outside this checkpoint.
|
||||
|
||||
The coordinator reports physical non-Host run `20261116T111337.858796...`: bridge 7/7, actor 7/7, capacity 3/3, status 5/5. Host cases initially failed at common startup because Receive handlers were registered from PreStart. After removing those invalid registrations, the real-Host merge case passed in `20261116T112616.645708...`, then all Host 8/8 passed in `20261116T112828.508164Z-bfeaacf1ab99`. These component runs cover 30 cases, with full-phase reconciliation still pending. The reviewer ran no tests or builds.
|
||||
|
||||
### Prior fix dispositions
|
||||
|
||||
- **Settled historical tombstones:** explicit owner and per-key generations now fence old commands while successful empty demand removes revision/key entries (`DriverHostActor.cs:4123-4168`, `:4220-4227`). Shared process-lifetime counters survive Host actor recreation. The capacity-two test opens/closes ten distinct keys, rejects an old key after reuse, rejects delayed old-owner registration/commands, and accepts a recreated owner. This repairs the original settled-history lifetime quota. The uncertain Open handshake below exposes a separate unreclaimed admission path.
|
||||
- **Alarm-only pending changes:** completion now compares AlarmReferences as part of the full desired state (`DriverHostActor.cs:4308-4313`). Both a same-child alarm-only change during pending establishment and a real deployment changing alarms through replacement are covered. The instance actor's unchanged-physical-demand shortcut still stores the new desired state and reconciles alarms. The original alarm-only finding is closed.
|
||||
- **Canceled expansion rollback:** the bridge records `LastIssuedRevision`, references, and interval before dispatch, independent of successful application (`DriverHostSubscriptionDemandSource.cs:161-174`). The gated cancellation regression observes a rollback revision greater than the hidden late expansion. The original revision-reuse finding is closed.
|
||||
- **Restored legacy callback ownership:** after an acquisition has been installed, legacy restoration stages pre-return callbacks with bounded owned SDK copies and independent optional hub reservations. Finish accepts only the returned handle; rejected staged samples are disposed. The retained ingress reservation preserves original callback receipt time (`DriverInstanceActor.cs:1983-2090`; `SourceSamplePublisher.cs:369-460`). Tests cover a blocked old cleanup with a late old event after restoration, all 130 quiet initial SDK values despite hub pressure/missing shapes, and a three-minute delayed acknowledgment preserving original hub age. This repairs the steady restored-handle case, but not the transition window below.
|
||||
|
||||
### P1 — An idle bridge cannot refresh its owner proof after Host restart
|
||||
|
||||
**Closed in the later five-fix checkpoint below; original finding follows.** A surviving bridge caches a successful `_ownerRegistration`. After all keys are released and the Host restarts, a new driver state has `KeyGeneration == 0`, so its first operation is Open using the old owner proof. Host rejects it, but `AcquisitionDemandOpened` carries no typed owner-invalid result and `ApplyAsync` returns immediately (`DriverHostSubscriptionDemandSource.cs:144-158`; `DriverHostActor.cs:4151-4157`). Only the later Apply response refreshes an invalid owner; this path never reaches Apply. Subsequent new-key acquires keep reusing the same stale cached proof and fail indefinitely.
|
||||
|
||||
Return an explicit invalid-owner outcome from Open and refresh the owner proof safely, or provide an equivalent bounded recovery protocol. Regress the actual bridge acquiring and releasing all interests, restarting its real Host, then successfully acquiring a new key. The existing Host restart test manually re-registers an owner and therefore does not establish bridge recovery.
|
||||
|
||||
### P2 — A canceled or timed-out Open can leak Host key admission
|
||||
|
||||
**Original hidden-Open cleanup path repaired in the later checkpoint below; lost Abort acknowledgment recovery remains separately open.** Host allocates `_acquisitionKeyGenerations[id]` before replying (`DriverHostActor.cs:4159-4168`), but the bridge awaits Open with the caller token and records the returned key only after receiving the acknowledgment (`DriverHostSubscriptionDemandSource.cs:153-158`). If cancellation or timeout hides that acknowledgment, Reject removes the interest. Cleanup sees empty references and `KeyGeneration == 0`, returns without closing the Host key (`:147-149`), then removes its DriverState. Repeating distinct abandoned opens fills the concurrent Host key quota permanently.
|
||||
|
||||
Keep ownership of an issued Open and its uncertain completion until its key is safely closed or definitively fenced; caller cancellation must not discard that cleanup obligation. Add a regression that gates the Open response after Host allocation, cancels the acquire, then proves distinct-key churn beyond concurrent capacity still succeeds. Preserve key-generation fencing when recovering an uncertain open.
|
||||
|
||||
### P1 — Retirement still briefly admits every legacy event handle
|
||||
|
||||
**Closed in the later five-fix checkpoint below; original finding follows.** `AcceptLegacyHandle` retains the broad fallback accepting any handle when no acquisition is pending/active (`DriverInstanceActor.cs:1976-1978`). `RetireAcquisitionHandle` clears the active fence and installed handle before removing the event handler (`:2450-2463`), and detachment clears LegacyAdmission before unsubscribing the delegate (`:2476-2490`). A callback during that boundary, including a delegate already captured before removal, sees no staging admission and no active acquisition, passes the fallback, and can publish the retired handle into the hub and mailbox. The passing regression fires its old event after replacement admission is already installed.
|
||||
|
||||
Once handle fencing has been enabled, fail closed in the fallback unless the callback matches a current installed handle. Initial callbacks should enter only through the explicit bounded staging gate. Regress an old callback during retirement/detachment as well as one invoked through a delegate captured before event removal; neither may publish. Preserve the existing restored initial-value and age regressions.
|
||||
|
||||
The bridge constructor in the reviewed source requires an explicit ownership allocator. P07 composition must supply the same process-lifetime allocator to Host and bridge, with one intended owner relationship; this checkpoint does not establish production DI or network exposure.
|
||||
|
||||
## Frozen Main repair rereview
|
||||
|
||||
**Disposition: partial checkpoint, with two concrete follow-ups below. Aggregate hub fencing and the latest actor repairs remain outside this source freeze; no final P06 approval is given.** The coordinator reports `20261116T114015.329991Z-4a96ebf2233e`, all 54 selected cases green: stream ordering 19, snapshot 19, recovery 10, fairness 6. The earlier `20261116T111337.858796...` run established behavioral red for all ten Main regressions, including the two forbidden transport writes, stale direct freshness, cadence, coalescing, and quota progress. Its overall 69 passed/18 failed included eight unrelated Host startup failures subsequently corrected and tested separately. The reviewer ran no commands to build or test.
|
||||
|
||||
### Verified Main repairs
|
||||
|
||||
- **Final transport authority:** delivery now orders Prepare, eligibility, snapshot rate admission, then Gate immediately before Write (`DataSubscriptionSession.cs:1161-1169`). The value gate evaluates snapshot/item state before its final view authority check (`:944-947`). Both regressions revoke authority while post-Prepare snapshot validation or live eligibility is blocked and require zero value writes. This closes the original network handoff finding. A separate direct control commit gap is documented below.
|
||||
- **Fair waiter progress:** ReserveAsync calls GrantWaiters after registration/enqueue, preserving the existing synchronous cancellation handling (`SubscriptionTransportCapacity.cs:139-152`). The capacity-two/per-principal-one regression proves B progresses while A remains active and A's second waiter stays blocked. Original finding closed.
|
||||
- **Queued cadence:** live eligibility checks current NextDue and schedules deferred reconsideration, restoring the considered boundary when necessary (`DataSubscriptionSession.cs:973-981`). The blocked-write regression observes a later candidate, commits the first write, proves the candidate has not sent, then advances fake time to its recomputed deadline. Original finding closed.
|
||||
- **Acknowledgment timer admission:** unsupported positive durations are rejected before command rate/memory/ID admission; timer setup failure removes the newly inserted ID and deadline (`DataSubscriptionSession.cs:207-229`). The oversized-timeout regression subsequently succeeds with the same command ID. Original finding closed.
|
||||
- **Unopened lifetime:** the subscription token reaches the worker's lifetime registration; a configurable, validated pre-Open timer defaults to ten seconds and is disposed at accepted Open or Stop (`LocalSubscriptionService.cs:48-57`; `DataSubscriptionSession.cs:187-200`, `:305-307`, `:396`, `:1180-1183`). Separate regressions release the sole stream slot after token cancellation and after a three-second unopened deadline, without relying on explicit disposal. Original finding closed.
|
||||
- **Direct age:** frames carry `DataAgeBounds(age, null)` (`DataSubscriptionSession.cs:985-989`), so time spent before direct handoff cannot produce a falsely finite upper bound. The gated fake-time regression cannot certify one-second freshness after a two-second delay. Original finding closed.
|
||||
- **Coalescing:** a one-bit marker generates one bounded control before a subsequent dequeued value, and the replacement-value regression proves its order and absence of the superseded version. This repairs the ordinary replacement path but leaves the quiet/suppressed-replacement case below open.
|
||||
- **Snapshot scaling:** session value gates now request per-item snapshot validation. Pump/Begin/End still rely on aggregate snapshot validity. The independently changing hub implementation and its lifecycle/counter proof require their own frozen rereview; the original quadratic-validation finding is not closed by this Main checkpoint alone.
|
||||
|
||||
### P2 — Coalescing remains invisible when the replacement is filtered out
|
||||
|
||||
**Closed in the later five-fix checkpoint below; original finding follows.** Eligibility sets `_coalesced` when it drops an already queued older value, but writers consume that marker only when dequeuing another IsValue frame (`DataSubscriptionSession.cs:967-970`, `:1093-1095`, `:1136-1138`). If delivered baseline is 1, queued 2 is superseded by a return to 1, the queued 2 is dropped and the newest 1 is correctly suppressed by the filter. No subsequent value exists to flush the pending notification, so a quiet stream or later heartbeats can leave this coalescing invisible indefinitely.
|
||||
|
||||
Flush the bounded notification independently of a future deliverable value while preserving stream order and reserved control capacity. Add a return-to-baseline, deadband, or status-only replacement case followed by quiet/control activity; the existing version-4 regression always supplies a later deliverable value.
|
||||
|
||||
### P2 — Direct Modify acknowledgment can cross a blocking commit after its final authority check
|
||||
|
||||
**Closed in the later five-fix checkpoint below; original finding follows.** DirectReader runs the pending gate, then Commit, then exposes Current/returns (`DataSubscriptionSession.cs:1103-1105`). For a Modify acknowledgment, CommitStaged checks view authority before snapshot validation and subsequently releases old demand/snapshot/interest ownership (`:647-664`). Those operations can acquire locks. Revocation during that commit validation or cleanup can therefore leave an unsent direct Good acknowledgment returned after authority is lost. The network path has already handed its acknowledgment to Write before commit, so this is specifically a direct handoff boundary.
|
||||
|
||||
Add a separate publication-authority check after direct commit work and immediately before handoff, with a deterministic direct Modify acknowledgment regression that revokes while commit validation/cleanup is gated. Do not simply rerun the entire pre-commit Gate: successful commits change staged state and dispose snapshots, making that precondition intentionally false afterward. An initial suspicion about a blocking budget lock in direct value Commit was withdrawn after source inspection: DataResourceBudget uses atomics and DataValue ownership does not run arbitrary cleanup. No direct-value P1 is claimed here.
|
||||
|
||||
## Frozen aggregate-hub checkpoint
|
||||
|
||||
**Disposition: the original quadratic snapshot-validation finding is closed in source and focused evidence; two additional hub findings below remain open. This is not full hub or P06 approval.** Reviewed frozen scope: ProducerFence, SourceBindingFence, PartitionControlSignal, partition capture/control/history, SnapshotLease, steady SourceInterestLease, the finite partition-count bound, and snapshot regressions. Current actor and session repair work was not re-approved here.
|
||||
|
||||
The coordinator reports snapshot 22/22 green in `20261116T115224.552541Z-89d4622a55af`. The complete selected packet had 61 executed, 56 passed, and five expected new actor/session regression failures; none was a snapshot failure. The larger existing P04 hub/bounds selection in the P06 manifest and the final phase gate remain pending. No tests, builds, Docker commands, or commits were run by this reviewer.
|
||||
|
||||
### Aggregate fence and scaling behavior verified
|
||||
|
||||
- SnapshotLease caches source-to-partition ownership and one cursor per participating partition. IsReset checks those cached cursors, with no source grouping or all-ticket validation on each call. IsItemCurrent adds the selected source's fence check; its aggregate prerequisite is bounded by the configured maximum of 256 partitions. The work/allocation regression performs 128 validations over 256 sources and bounds both allocations and partition visits. The original Θ(N²) finding is closed.
|
||||
- Each partition cursor maintains counted positions and a cached minimum; TryReadDelta advances the relevant count/minimum rather than rescanning all source positions. The advancing-history regression verifies repeated deltas remain valid as retained history progresses.
|
||||
- PartitionControlSignal increments its active count before its generation on Begin, and increments generation before decrementing active on End. Validation rejects active controls, negative generations, or permanent poison. Source invalidation, status admission, partition invalidation, and removal bracket their mutations. Generation replacement retires the old binding before replacing state. Ordinary value publication leaves the control stamp unchanged.
|
||||
- Producer retirement seals attachment before publishing retirement. Attach checks Active before and after CAS publication; Retire brackets every observed partition signal before making IsRetired true. A concurrent Retire caller can complete the same logical fence without waiting for a paused caller. Tests cover a two-partition partial Begin, concurrent helping, and retirement while a partition lock is held.
|
||||
- Attachments enforce one hub owner, reject older attachment epochs, replace rather than append old routing vectors, and use bounded retries. The finite partition bound limits a production vector's fan-out; repeated repartition coverage checks retained signal counts. Source bindings attach their one signal before source visibility. These paths take no partition lock during fence retirement.
|
||||
- Capture checks routing against the selected partition array, validates control stamps around capture, and rejects a missing ticket. Repartition rejects routing-epoch exhaustion before mutation. Counter-overflow tests establish permanent rejection after overflow; rejection in the interval before `_poisoned` publication follows from the negative-generation/active-count source ordering, not a separately gated test.
|
||||
|
||||
The existing unchecked sample watermark/ordinal exhaustion behavior was not expanded in this repair and remains future hardening rather than a new finding in this checkpoint.
|
||||
|
||||
### P2 — Nonblocking ticket proof accepts the old partition during a routing change
|
||||
|
||||
**Closed in the later frozen two-fix hub checkpoint below; original finding follows.** Repartition advances the hub routing epoch before disposing the old partitions and publishing the new array (`PartitionedSampleHub.cs:330-343`). `SamplePartition.IsTicketCurrentNonBlocking` checks the source/binding/producer fields but omits its captured `_routingEpoch` and disposed state (`SamplePartition.cs:106-112`). Hold an old partition lock and start repartition: the global epoch advances, disposal waits for that lock, and the nonblocking proof still returns true for an old ticket through the old array.
|
||||
|
||||
Snapshot capture now explicitly rejects this gap, but live session publication uses this nonblocking ticket proof. Add current routing/disposal validation to that proof and regress the lock-held gap deterministically. The check must remain nonblocking; waiting for partition disposal would defeat its purpose.
|
||||
|
||||
### P2 — Quiet source invalidation is invisible to steady interests after SnapshotEnd
|
||||
|
||||
**Closed in the later frozen two-fix hub checkpoint below; original finding follows.** After the finite SnapshotLease is released, `Invalidate(ticket, ...)` changes the source invalidation/control state without appending a history entry or changing the partition epoch (`SamplePartition.cs:132-149`, `:214`). ProducerFence.Retire similarly changes only the producer/control fences. A steady interest at the current watermark then takes `ReadInterestChanges`' early successful empty return (`:473-480`), while SourceInterestLease.IsReset checks only release, hub disposal, and routing. Without a later sample or generation bind, the session can continue heartbeats without reporting the invalidation or retirement.
|
||||
|
||||
Make steady interests observe a bounded control event or reset independently of future value traffic. Regress capture plus steady registration, dispose only the finite snapshot, then invalidate the source or retire its producer without publishing another sample; the interest/session must observe the control boundary. This does not require ordinary sample updates to invalidate frozen snapshots, nor an unbounded producer listener list. The new aggregate snapshot stamps alone do not repair this steady-state notification path.
|
||||
|
||||
## Frozen five-fix session/actor checkpoint
|
||||
|
||||
**Disposition: the five targeted repairs are verified below, with one new logical-abort recovery finding. The two hub findings remain pending and no overall P06 approval is given.** This rereview covered only the frozen session coalescing/direct-ack repair and actor owner/open/callback repair. The coordinator reports all applicable selected P06 runtime cases green, 228/228 in `20261116T115709.770041Z-202bd2543520`, including affected legacy regressions. The five targeted regressions had actual behavioral red evidence in `20261116T115224.552541Z-89d4622a55af`. Build and final-phase work remain coordinator-owned; the reviewer ran no tests, builds, Docker commands, or commits.
|
||||
|
||||
### Targeted repair dispositions
|
||||
|
||||
- **Quiet coalescing visibility closed:** both delivery loops check the single coalesced marker before waiting for or dequeuing the next outbound frame (`DataSubscriptionSession.cs:1089-1099`, `:1133-1142`). Thus a dropped candidate can produce its bounded control even when the newest sample is filtered out and no later value is queued. The return-to-baseline regression observes the notice, no superseded value, and no redundant baseline value; subsequent probe acknowledgment and heartbeat still progress.
|
||||
- **Direct Modify acknowledgment boundary closed:** direct acknowledgment handoff performs a post-commit session-authority check plus a separate per-change view-authority callback (`DataSubscriptionSession.cs:1106-1111`, `:637-643`). This callback does not rerun disposed snapshot or staged-state preconditions. The actual blocking old-demand lease regression revokes authority during commit cleanup and observes no returned acknowledgment. The earlier direct-value P1 suspicion remains withdrawn and is not actionable.
|
||||
- **Idle bridge Host restart closed:** Open now returns typed OwnerInvalid; the bridge invalidates its cached owner registration and obtains a new proof before retrying (`DriverHostSubscriptionDemandSource.cs:184-188`; `DriverHostActor.cs:4168-4173`). The regression uses the same surviving bridge after releasing its last key and restarting the real Host, waits for the replacement physical acknowledgment, then obtains Good.
|
||||
- **Hidden Open cleanup repaired:** the bridge preallocates a key from the shared process allocator, carries it in Open, and sends a matching Abort independently of caller cancellation when Open completion becomes uncertain (`DriverHostSubscriptionDemandSource.cs:164-181`, `:258-267`). Host abort uses owner/key matching and a scalar retired-key floor to reject late reopening without retaining historical key entries (`DriverHostActor.cs:4168-4238`). The capacity-two regression cancels six distinct opens after Host allocation while their replies are gated, then verifies zero retained Host keys after each cleanup. Recovery from a lost Abort acknowledgment is separately open below.
|
||||
- **Retire/detach callback window closed:** once handle fencing is enabled, the fallback requires a non-null current installed handle with reference identity equality (`DriverInstanceActor.cs:1976-1983`). A captured old delegate invoked synchronously during old-handle unsubscribe is rejected before the replacement staging gate exists; the genuine legacy initial value still reaches the mailbox and is the first hub version. Existing bounded 130-initial and original-age staging regressions remain in the passing selection.
|
||||
|
||||
### P2 — A lost logical Abort acknowledgment permanently poisons the bridge driver slot
|
||||
|
||||
**Closed by the final logical-abort source checkpoint and the complete 347/347 gate below; original finding follows.** `AbortOpenAsync` converts any Ask failure/timeout into false (`DriverHostSubscriptionDemandSource.cs:258-267`). That completed-false task remains in `DriverState.PendingOpenCleanup`: every subsequent ApplyAsync returns immediately at `:139-142`, and reconciliation cannot reclaim the driver because removal requires a null pending cleanup (`:343-350`). A transiently delayed or lost Abort acknowledgment therefore permanently disables the driver and consumes one bridge driver slot, even when Host processed the abort and later recovers.
|
||||
|
||||
This is a logical Open/Abort handshake before any acquisition dispatch, not an uncertain physical unsubscribe whose effects cannot safely be replayed. Abort already carries an idempotent, fenced owner/key identity. Retain bounded ownership while allowing safe logical-abort reconciliation or an owner-generation recovery barrier; do not discard the cleanup obligation or retain a completed-false sentinel forever. Regress an Abort response delayed beyond its timeout, then a responsive Host and fresh acquire, and require eventual cleanup/progress without recreating the bridge.
|
||||
|
||||
## Frozen two-fix hub checkpoint
|
||||
|
||||
**Disposition: both hub findings above are closed in source and focused evidence. No new concrete hub finding was identified in this pass. Final P06 approval remains pending the active bridge repair, its independent rereview, and the complete phase gate.** The coordinator reports snapshot 26/26 green in `20261116T121623.900158Z-93a293f4c25c`, following actual red cases in `20261116T121124.117185...` for the routing-gap proof and both quiet-control paths. The reviewer ran no tests, builds, Docker commands, or commits.
|
||||
|
||||
- **Routing gap closed:** IsTicketCurrentNonBlocking now checks hub disposal, partition disposal, and its captured routing epoch before observing source state, then rechecks them after the binding/producer proof (`SamplePartition.cs:106-115`). The regression holds the old partition lock, advances routing through concurrent repartition, and obtains false from the nonblocking ticket check before allowing disposal to finish.
|
||||
- **Quiet control propagation closed:** each partition control signal owns a separate leaf lifecycle counter. BeginQuiet enters both counters before source mutation or retirement publication, and EndQuiet completes them afterward. Source invalidation, removal, partition invalidation, producer retirement, and binding retirement use this path (`PartitionControlSignal.cs:10-18`; `SamplePartition.cs:134-151`, `:217-221`, `:250-257`, `:329-333`; `PartitionedSampleHub.cs:21-27`, `:69-76`). The existing sealing/helping protocol therefore covers steady interests as well as finite snapshots without waiting for partition locks.
|
||||
- **Atomic steady registration preserved:** capture takes both stamps around the existing partition-locked snapshot/interest registration and retains the lifecycle stamp in each interest cursor (`PartitionedSampleHub.cs:288-313`). SourceInterestLease.IsReset validates the bounded partition vector independently of change-history length, and TryReadChanges checks it before and after scanning (`SourceInterestLease.cs:53-87`). Both explicit invalidation and producer retirement are detected after disposing only the finite snapshot, with no later value required.
|
||||
- **Status/history behavior preserved:** normal admitted status barriers increment only the snapshot control signal (`SamplePartition.cs:226-238`). Their drained history entry remains observable to the steady interest. The new positive status-history regression requires the interest to remain valid and return the changed ticket; existing ordinary-value snapshot and lifetime/counter regressions remain in the 26/26 selection.
|
||||
|
||||
The lifecycle signal is intentionally partition-wide: a quiet invalidation can conservatively reset other steady interests sharing that partition. The vector remains bounded by the configured partition limit and introduces no per-source listener list or historical routing-vector accumulation. This checkpoint does not claim narrower invalidation isolation.
|
||||
|
||||
## Final logical-abort recovery source checkpoint
|
||||
|
||||
**Disposition: source review found no further actionable findings in this frozen repair. Final gate evidence remains pending, so this is not yet final P06 approval.** The coordinator reports actual same-driver lost-Abort-ack red evidence in `20261116T121124.117185...`, followed by the positive same-driver Host result in the subsequent 11-case Host selection. A separate cross-driver capacity-pressure regression then supplied the sole failure in a 38-case packet (37 passed, including all 26 snapshot cases). Its production repair was released only after that red result. The full manifest gate is running; no unobserved green result is claimed here.
|
||||
|
||||
The bridge now retains the uncertain owner/key and DriverState through failed logical cleanup. A fresh acquisition for that driver may retry the idempotent Abort after the bounded configured delay; capacity pressure from a different new driver schedules eligible inactive cleanup states using the existing per-driver coalescer (`DriverHostSubscriptionDemandSource.cs:91-100`, `:162-177`, `:368-407`). The new driver initially receives ResourceExhausted while the old ownership is retained. Successful cleanup reclaims the old slot, allowing a later admission attempt without reacquiring the old driver.
|
||||
|
||||
Each driver has one scheduled reconciliation and one serialized logical-abort attempt. A retry-request bit preserves pressure arriving while that work is already running. Without new demand or pressure, a failed result does not start an autonomous retry loop. The global bridge lock is not held across Host Ask, and physical Subscribe/Unsubscribe retry behavior is unchanged. Cleanup clears only after successful Abort or typed OwnerInvalid; cancellation of a new wait does not cancel the owned cleanup task. Host owner/key matching and the retired-key floor continue fencing delayed Open/Abort messages against replacement keys.
|
||||
|
||||
The same-driver regression loses the Abort response after Host has processed cleanup, waits for the observed timeout, then requires a fresh physical operation and its actual acknowledgment. The cross-driver regression fills the sole bridge slot with A's uncertain cleanup, requests B, permits the disclosed initial ResourceExhausted result, waits for A's reclamation, and then requires B's physical acknowledgment. Final green evidence for the complete frozen implementation is still required. The reviewer ran no tests, builds, Docker commands, or commits.
|
||||
|
||||
## Final P06 source and evidence reconciliation
|
||||
|
||||
**P06 approved, with no remaining actionable findings in the reviewed scope.** This final disposition supersedes every historical pending/open status above. The withdrawn direct-value P1 suspicion remains withdrawn; it is not an unresolved finding. The final logical-abort P2 is closed, including recovery prompted by capacity pressure from a different driver. Prior session, actor, domain/primitive, and hub repairs remain source-verified and are covered together by the final applicable selection.
|
||||
|
||||
The reviewer independently read [the complete P06 run record](../../../../artifacts/grpc-data/20261116T121919.790393Z-0175b7fac86f/unit/P06/run.json) and all four referenced TRX files. Each recorded result is Passed; there are no skipped/not-executed cases or platform exclusions in this run.
|
||||
|
||||
| Selected project | Executed | Passed | Failed | Skipped |
|
||||
| --- | ---: | ---: | ---: | ---: |
|
||||
| Runtime, including new P06 cases and affected legacy regressions | 234 | 234 | 0 | 0 |
|
||||
| Core.Abstractions, including contracts and PollGroupEngine | 50 | 50 | 0 | 0 |
|
||||
| Commons, including fallback/compact codecs and protobuf contracts | 39 | 39 | 0 | 0 |
|
||||
| Driver.Modbus, including affected legacy subscription behavior | 24 | 24 | 0 | 0 |
|
||||
| **Total** | **347** | **347** | **0** | **0** |
|
||||
|
||||
The frozen checkout was reconciled directly against the run identity:
|
||||
|
||||
- HEAD exactly matches `92e6430e062cfde1a97d7142d46581f05c893091`.
|
||||
- The complete tracked diff SHA-256 exactly matches `f81d6ce3c5a656d8867d6b278137e32135e8c69e13b202d7005e185ecbe88292`.
|
||||
- All 28 recorded untracked production/test files match their individual SHA-256 values, with no additional unrecorded files under `src/` or `tests/`. The fixture preparation note also matches. This review note changed after the run as authorized; its differing Markdown hash is not a source/test difference. The later P07 preparation note is likewise documentation-only.
|
||||
|
||||
The final TRX explicitly includes passing `Lost_abort_ack_is_reconciled_before_a_fresh_acquisition_uses_the_key` and `Capacity_pressure_reconciles_lost_abort_ack_for_an_inactive_different_driver`, as well as the quiet lifecycle, direct Modify authority, and return-to-baseline coalescing regressions. These close the remaining focused-evidence gaps; the passing gate is the final combined selection, not a sum of earlier partial runs.
|
||||
|
||||
Final source inspection confirms that a lost logical Abort response keeps the owner/key and driver slot charged until a successful fenced Abort or typed OwnerInvalid proves cleanup. Caller cancellation does not cancel that owned cleanup. New demand or capacity pressure requests one coalesced retry per driver; pressure arriving during cleanup is retained by a flag. There is no global Host Ask lock, per-update task accumulation, autonomous idle retry loop, or retry of uncertain physical Subscribe/Unsubscribe. Reclamation permits a subsequent different-driver admission without reacquiring the old driver.
|
||||
|
||||
### Approval boundary and remaining phases
|
||||
|
||||
- **P07 remains:** production Host DI must inject the same process-shared acquisition capacity/owner allocator into Host and bridge; concrete server/client transport, TLS/HTTP2 wiring, and network adapter acceptance semantics require their own implementation and evidence. P06's explicit local factory and fake delivery-sink tests do not constitute a deployed gRPC service. The default feature remains unadvertised without the explicit composition.
|
||||
- **P10 remains:** real Docker/system validation and the required multi-node, restart, cancellation, and transport conditions. This review makes no Docker or OPC UA integration claim.
|
||||
- **P11 remains:** measured throughput, latency, memory, and scaling evidence at the planned sizes. Allocation/work regressions establish the specific repaired bounds; they do not establish production benchmark targets. The approved callback-before-ack drop can wait for the next genuine acquisition and is a documented latency tradeoff. Quiet lifecycle resets are conservatively partition-wide.
|
||||
- **P12 remains:** final integrated Astra review of the completed implementation and its complete evidence. This P06 approval is a phase checkpoint, not that final feature approval.
|
||||
|
||||
The approved age contract continues to describe normalized origin-cache ingress age, not physical measurement age. Unknown stream upper bounds, honest WaitingForInitialData before a genuine usable acquisition, and successful-delivery-only baseline commitment remain part of the approved behavior.
|
||||
Reference in New Issue
Block a user