perf: measure grpc fanout and recovery bounds

This commit is contained in:
Joseph Doherty
2026-11-17 22:01:27 -05:00
parent 29fec57fac
commit 4cf3acb1c5
14 changed files with 3444 additions and 0 deletions
@@ -0,0 +1,386 @@
# P10/P11 harness Astra checkpoint review
## Current status — 2026-11-17, Hot continuity checkpoint
**P10, P11 and P12 remain open.** The timestamp Runtime gate completed **631/631**, the causal SDK timestamp gate **7/7**, Hot-route continuity **100/100**, Host continuity **93/93**, and projection-validity/classifier checks **11/11**, all without failures or skips. Nine final warm/outage Python suites passed **131 tests**; the registry helper passed **8** and the separate D11 authenticated-browse preparation passed **2**. These are focused gates, not phase completion.
The prior timestamp candidate's actual scenario report passed **D04 (417 assertions), D12 (173), D13 (217)** and failed **D06, D09, D10, D11, D14**. The Hot-continuity candidate rebuild now reports normal deployment and actual catalog readiness in `artifacts/grpc-data/hot-continuity-candidate-rebuild.log`. Its refreshed P11 packet passed **102/102 rows across 89 exact methods**, zero skips/source gaps; actual scenario reruns have no completed result at this checkpoint. The required complete **15-row D01–D14 including D01a matrix**, all **ten actual workload profiles**, the **unfiltered 64-project full suite** and **final integrated Astra review** remain outstanding. Historical entries below retain their original candidate scope; the appended checkpoint supersedes stale running/pending counts.
**Disposition: not approved for phase completion, 2026-11-17.** Astra (`gpt-6-astra`, xhigh) reviewed the scenario/probe, fixture, workload and compact-negotiation source against implementation-plan Tasks 20–23. The full Docker scenario matrix and workloads had not run. Repairs to the scenario matrix began during this review; the findings below describe the reviewed pre-repair source and remain open until independently reconciled with their replacement assertions and actual evidence.
The reviewer ran no builds, tests or Docker commands and edited only this note. Earlier P11 fairness/recovery source approval remains scoped to that implementation; it does not establish workload or integration completion. P12 final review is separate.
## Open findings
### F1 — P1: scenario-name coverage can pass an incomplete required matrix
`scripts/validation/grpc-data/scenarios.py:46` validates only the ordered D01–D14 rows, nonzero assertion counts and restoration. `scenarios.json` supplies descriptive strings, not executable topology × caller × target policy × realm × operation requirements. In the reviewed source, D09 secondary read/write and D07 pinned unavailability use only default Raw; disabled/maintenance Cluster endpoint exclusion is absent. A successful `all` report therefore need not prove the approved matrix.
Require explicit cells populated only from successful operations and their observed caller/target/serving identity. Fail completeness when a required cell is absent or mismatched. Preserve the same-pair direct-runtime positive write and local standby mapped-write rejection as separate cells.
Also reconcile the required assertions inside each row: D03 initially renames an existing child to `new-child` rather than creating one; D05 checks direct origin paging without establishing cold mapped Pending versus empty/unavailable or the SDK-lock boundary; D06 lacks quiet browse-lease expiry and an explicit unauthorized-emission interval; D12 does not establish existing consumer-local Raw/UNS and command/telemetry continuity. Equivalent named wire tests may supply evidence, but descriptions alone do not.
### F2 — P1: UA failover may pass using only pre-fault notifications
`scenarios.py:658` invokes the live CLI fault with `require_gap=False`. `cli_gate.py:174–201` accepts two changing Good values anywhere, a final Good notification and a Good summary. These may all precede the stopped consumer; the independent partner probe does not prove that the original CLI reconnected. Record the actual fault boundary and require subsequent CLI delivery through the intended partner. Add a negative parser/orchestration case containing only pre-fault Good output. Record revoke/reauthorize boundaries for D06 as well, so unauthorized-interval payloads cannot disappear into an aggregate Good/Bad/Good result.
### F3 — P1: TLS negatives do not establish deployed consumer trust enforcement
`probe/Program.cs:177–204` implements a separate SAN/CA callback. The wrong-CA/SAN cases instruct that callback to reject an otherwise valid server; they would pass even if the production consumer handler accepted the wrong certificate. Exercise the actual caller's DI connection with an owned mismatched certificate or scoped trust configuration.
D14's retirement proof also tests the reverse direction: `rig.py:792–800` retires the old CA from the consumer, but `probe/Program.cs:90–99` tests an old-CA external client against the new server certificate. That rejection does not prove the consumer discarded its old root. After retirement, present the original certificate on an owned pinned SOURCE endpoint, require the actual consumer to reject it, then restore the new certificate and require recovery.
The planned Host TLS/listener integration classes remain absent at this checkpoint. Existing mesh regressions and the external probe must not silently replace the missing production trust boundary. Document exact equivalent selectors if implementation uses different class names.
### F4 — P1: required P11 adversarial evidence is not a completion prerequisite
`workload.py:403–411` runs read/metadata and an optional single-CLI failover before measurement. Workload clients use one `consumer-source` connection/principal/target. The ten profiles do not themselves exercise same-origin different pinned-node/principal isolation, producer array reuse, ingress saturation, revocation during encoding or a concurrent reconnect storm. Source/readiness invalidation and catch-up memory also need their required deterministic evidence.
The report's coverage-limits text acknowledges separate evidence, but `passed` does not require it. Add a required evidence/selector manifest connecting every Task23 obligation to executed, non-skipped focused tests or workload actions. This permits reuse of applicable tests without mislabeling the profiles as complete coverage.
### F5 — P2: physical-sharing accounting does not assert sharing
`workload.py:131–152` checks nonnegative counters, resource limits and at least one applied physical reference. It does not relate physical acquisitions to unique sources versus logical registrations/views. A regression creating one physical interest per registration can pass. Establish the expected unique physical cardinality for each experiment, accounting explicitly for legacy source demand, and validate the observed owner counters against it. D04's device-effect count is not an acquisition-sharing assertion.
### F6 — P2: clients and running images can represent different dirty candidates
`scenarios.py:116–135` publishes clients from the current tree hash without comparing it to the rig's captured source-tree hash or running image build stamp. `rig.load` checks context/manifest validity, while the final workload report records HEAD. New clients can therefore test an older Host image under the same HEAD. Reconcile actual image stamps, manifest and published binaries before mutations, and reject mismatches. A defined source-only identity can avoid rebuilds solely for review/evidence documentation changes.
### F7 — P2: encoding counters need concrete owner identity
`workload.py:244–263` checks revision, scope version and artifact revision across measurement. Those identify configuration, not a concrete `GrpcDataConnection` instance. Replacing an owner with unchanged configuration can reset its counters without detection when new totals exceed the prior values. Record a per-instance diagnostic identity, or equivalent evidence that rejects any owner replacement during the interval.
## Source and evidence observations
The harness uses actual deployed node DI for direct operations, validates portable CLI output rather than exit status alone, retains restricted/redacted evidence, restores mutations and uses bounded process deadlines. These are useful foundations; they do not resolve the missing assertions above.
The compact-negotiation repair has no new source blocker in this bounded review. No-header clients retain fallback behavior; version-1 opt-in is explicit; invalid/duplicate negotiation and unsolicited compact responses fail closed. Preparation reserves before encoding and enforces transport size; client encoding counters advance after provenance, handle and version validation. The reviewer independently parsed `20261117T032802.107002Z-bcf9b9c00e7f/unit/P11`: **157/157 passed**, zero failed/skipped (Runtime118, SDK2, Host29, Commons8).
Root reported the existing P10 mesh and SDK wire gates as 24/24 and 28/28 respectively. Neither those focused gates nor the 157-unit checkpoint establish the unexecuted full D01–D14 matrix or P11 workloads. Final dispositions require repaired assertion coverage, actual candidate-matched runs and review of their results.
## Repair checkpoint — 2026-11-17
The following dispositions supersede the initial source observations where stated. They do not approve either phase: the full Docker matrix/workloads remain unexecuted, the adversarial packet predates the subsequent cold-read change, and the new blockers below require repair.
| Finding | Re-review disposition |
|---|---|
| F1 | Source substantially repaired: an exact required-cell registry checks caller, configured target mode/consistency, origin realm, serving node/role and successful operation evidence. Both realms now cover pinned loss/secondary behavior; maintenance exclusion and genuine child creation are present. The separately identified D05/D06/D12 boundary evidence still requires final reconciliation, and actual matrix results remain pending. |
| F2 | Temporal observations are bounded and collected once per complete line, and authorization withdrawal now has a measured quiet interval. Still open: the live observer rejects the actual numeric Good format; post-stop arrival alone also needs protection against delayed pre-stop buffered notifications. |
| F3 | Production `DataConnectionTrustPolicy` is now exercised by real Kestrel TLS/listener tests, and Docker contexts present mismatched or retired server identities to the actual caller. The certificate context has a concrete undefined-variable blocker below. Actual Docker negatives remain pending. |
| F4 | Source repaired: eleven mandatory obligations map to exact non-skipped test selectors; the prerequisite independently reconciles discovery, TRX hashes, candidate inputs and command exits before and after measurement. The recorded packet has 25 passing cases, but must be rerun for the changed candidate. |
| F5 | Source repaired: actual acknowledged registrations determine unique source/view expectations, observations reject excessive physical references and require consecutive settled cardinalities. Legacy demand is explicitly separated and linked to its real-host merge test. Actual measurements remain pending. |
| F6 | Host component repaired: every running Host stamp and published tools are checked against compiled inputs. Device-image inputs still need separate identity verification; the Python device is intentionally absent from the Host hash. |
| F7 | Closed in this scope: each `GrpcDataConnection` has an immutable `AccountingInstanceId`, carried in diagnostics and required unchanged across encoding measurements. The focused client gate passed 47/47. |
### New R1 — P1: mapped SDK writes still reject the production default budget
`OtOpcUaSdkServer.cs:417` supplies a 4 MiB write budget, while production registration supplies the default 1 MiB `MaxPendingBytes` as the adapter's `MaxUnaryBytes`. `ProjectedDataAccess.WriteAsync` still compares the unmodified 4 MiB maximum against that capacity and rejects every otherwise-authorized scalar write before dispatch. The analogous read path was fixed, but the write path was not. Narrow the request maximum before payload admission/reservation/dispatch, retaining oversized-value rejection and physical ownership through ignored cancellation. Require the composed default-limit write regression.
### New R2 — P2: actual TLS fixture contexts reference an undefined variable
`rig.py:956`, inside `_server_identity_material(self, node, material)`, calls `apply(original)` although that name does not exist in the helper. Wrong-CA and retired-CA experiments raise `NameError` instead of presenting their test certificates. Test installation during the yielded context and restoration afterward, using the supplied material.
### New R3 — P2: live fault observer misses numeric Good statuses
`scenarios.py:479` recognizes `(Good|Bad[^)]*)`, excluding the actual `Good [0x00000000]` form already supported by `cli_gate.is_good_status`. Consequently the live observer never becomes ready for those valid notifications. Share the status parser and cover fragmented lines with the actual format.
For conclusive D10 evidence, also require a value produced only after the old consumer has stopped, or an observed reconnect to the intended partner followed by data. A delayed pre-stop notification received after the stop boundary must not satisfy recovery.
### Additional reviewed changes and evidence
The cold-read clamp correctly narrows the request maximum before both reservation and remote dispatch. Its focused TRX contains 3/3 passing cases following the recorded one-case behavioral failure. The additive finite-age Client.Shared overload preserves the existing zero-age call path; the CLI validates a finite, bounded age and keeps its default at zero. The new API gate was still pending when this source checkpoint was requested, so no test result is claimed for it here.
Independently inspected evidence: `p10-host-production-tls-confirmation` is 5/5 passed; `p11-accounting-instance` is 47/47; `p10-cold-read-budget-green` is 3/3; the required adversarial packet reports 25/25 across eleven obligations with no skips. The TLS tests use the production trust handler, assert certificate-authentication failure before facade creation, and verify TLS versus UI/h2c listener separation. These are focused results, not the still-pending full Docker matrix or P11 workloads.
## Default-budget and fault-proof repair checkpoint — 2026-11-17
**Disposition: the reviewed repairs have no additional material source finding; P10/P11 phase approval remains pending actual matrix and workload evidence.** This pass used filesystem reads only, launched no shell/build/test/Docker commands, and changed only this review note.
- **R1 closed in the reviewed component.** `ProjectedDataAccess.WriteAsync:490–503` now narrows the SDK maximum to the configured ceiling before payload-size admission, byte reservation and dispatch. Physical completion still owns the demand/value/reservation in `WriteCoreAsync`'s `finally`; caller timeout cannot release that capacity early. The independently parsed `p10-default-budget-unit-and-wire-confirmation` TRX has **48/48 passed**, zero failed/skipped, including default-limit composed SDK read/write, oversized-write rejection and ignored-cancellation capacity ownership. The separate CLI/API checkpoint `20261117T035530.779802Z-bc549ed8bba5/unit/P10` has **57/57 passed** (Host1, Shared3, CLI21, Runtime32). The explicit finite-age overload does not change the zero-age contract.
- **R2 closed in source.** `rig.py:974` installs the supplied `material`, and `finally` restores the prior identity. The fixture regression checks the actual files within the context and restoration after an exception. Root reports the rig packet as 37/37; this pass inspected the regression source rather than claiming an independently parsed Python test artifact.
- **R3 and F2 closed in source.** `NotificationLines` uses the shared notification parser and numeric-Good predicate. `ControlledFixtureSource` reserves a unique high-range value before the fault, excludes that range from ordinary production, serializes the set with the producer, and holds the sentinel until the original CLI observes it. `live_cli_fault` produces it only after stop and any reauthorization callback complete, while the old node remains stopped. Buffered pre-fault ordinary values cannot satisfy this proof. Failed sets release the producer pause. The validator rejects earlier sentinel observations and retains the explicit unauthorized quiet interval. Root reports 17 passing scenario cases; their relevant negative/regression assertions were source-reviewed here.
- **F6 device component repaired in source.** `device_tree_hash` covers the fixture Dockerfile and protocol/ledger implementation. `verify_candidate` requires both the manifest hash and the running device's `/fixture/source-hash` to equal current inputs, in addition to all six Host stamps. The reviewed candidate test expects all seven running components to be checked.
D06 now obtains both realms' actual positive metadata-lease durations, performs a bounded quiet wait without explicit renewing browse/read/metadata requests, requires denial, then requires browse/read renewal. D12 now verifies ordinary SOURCE Raw/UNS reads after every withdrawal, exact required-node deployment acknowledgements, and an authenticated CONTROL-to-SOURCE call to the existing telemetry service. The latter requires the actual `source-modbus` driver-health snapshot, matching correlation, SOURCE cluster and reporting-node identity; an unrelated telemetry envelope cannot pass.
For D05, `p10-sdk-lock-probe` independently records **1/1 passed** for `GrpcDataSdkBrowseWireTests.Cursor_expiring_during_a_remote_fetch_cannot_publish_or_be_replaced`; the test takes the actual SDK lock from another thread while a page fetch is held. This closes the lock-instrumentation evidence gap. The final matrix reconciliation must still name the applicable cold mapped **Pending versus empty/unavailable** evidence: `scenario_D05` itself exercises direct paging/revision and does not establish all those mapped states. Existing applicable wire selectors may supply this evidence.
The refreshed adversarial packet at `runs/grpc-data-local/adversarial-evidence/packet.json` reports **26 executed, zero skipped, all passed**, eleven obligations and all four discovery/test command exits zero, completed `2026-11-17T04:09:52.935864+00:00`. This is the packet's recorded result, not a claim that subsequently changed fixture source has the same identity. Its mandatory candidate reconciliation must run again after any covered-input change.
Root identified an additional TLS-negative precision improvement during this pass: wrong-SAN `Unavailable` could otherwise be attributed to HTTP Host rejection after an incorrectly accepted TLS handshake. A fixture-only pre-auth data-listener request counter with healthy-before/after controls is being added. That new source and its actual Docker evidence are not approved by this checkpoint. The production-policy TLS/listener wire evidence remains valid within its recorded candidate. Full Docker D01–D14 results, ten workload profiles and P12 final review remain open.
## Capability handshake and canonical-root checkpoint — 2026-11-17
**Disposition: no new material source blocker in this bounded review. Full matrix/workload execution remains required before phase approval.** The reviewer again launched no commands, builds, tests or Docker operations and edited only this note.
`GrpcDataConnection.SelectAsync:232–246` now decodes capability discovery using the finite locally understood kind-count bound, independent of a one-item operation's response budget. It rejects excessive or duplicate wire kinds before mapping. Operation responses still use `Limits(budget, capabilities)`, retaining the caller's item/byte limits and the peer's advertised ceilings. Original request timeout, target/role/serving-generation checks and cancellation remain in force. Independently parsed evidence establishes **4/4 intended failures** in `p10-handshake-cardinality-red`, followed by **52/52 passed** in `p10-handshake-client-green` and **25/25 passed** in `p10-handshake-codec-gate`, with zero failed/skipped in both green packets. The client regressions cover successful one-item Read/Browse, oversized operation responses after a successful handshake, duplicate kinds and excessive distinct kinds.
Fixture browse container identity is now separate from physical leaf/authorization paths. The seed writes the actual equipment ID into the UNS mapping and `fixture.browse_roots`; scenarios and workloads require this explicit value rather than deriving a container from a display path. `ProbeEngine.CanonicalBrowseViewAsync` accepts only Good metadata for the exact requested address and realm, with no remote mapping, and uses that returned origin view for Browse/continuation. The deliberate forged-subject Read negative remains on its original path. These are fixture corrections, not a relaxation of production source authorization. Public-CA probe loading now uses certificate-only PEM parsing rather than requiring an unrelated private key. Root reports actual TLS Raw/UNS metadata and one-item browse success in the canonical-root debug artifact; this pass did not independently parse that diagnostic artifact.
The TLS-negative precision repair is source-reviewed. `NodeProbeStartup` registers a fixture-only startup filter that increments an atomic request count on port4057 before the Host pipeline and exposes only the count plus a per-process GUID through the existing file probe. D13/D14 require the same observer and zero HTTP arrivals before/after the actual consumer negatives. The separate control handshake validates the exact installed public leaf, its appropriate test CA and expected SAN on the owned endpoint without sending HTTP or granting that test trust to the consumer. Restoring the identity requires actual consumer readiness/read success and a positive HTTP count. This prevents HTTP Host rejection from being misreported as TLS enforcement; deployed execution is still pending.
The D05 linkage now names `GrpcDataSdkBrowseReadinessTests.Actual_sdk_browse_reports_the_selected_parents_state_even_when_acl_is_off`, with **2/2 passing** cases in `p10-cold-browse-state`. These invoke the actual SDK Browse entry with controlled Pending/Unavailable readiness and assert distinct `BadWaitingForInitialData`/`BadNoCommunication` outcomes rather than an empty Good branch. This is focused SDK state-mapping evidence; the separate one-case held-fetch wire probe establishes the SDK-lock boundary. Neither is represented as a completed Docker cold-cache scenario. Final D05 reconciliation must retain those exact component scopes alongside the actual paging/revision matrix result.
The fixture Dockerfile now restores/publishes the Host dependency graph serially and separately restores the fixture helper graphs. It continues to copy only the probe assembly/deps into Host output, preserving Host-resolved dependency versions. This packaging source review makes no claim about the in-progress rebuild or resumed six-node health. Root reports 167 passing Python cases; that aggregate was not independently parsed here. Candidate hashes and mandatory adversarial evidence must be reconciled after these covered-source changes, before final matrix/workload claims.
## Baseline physical-acquisition checkpoint — 2026-11-17
**Disposition: P1 compatibility finding open; this repair is not source-approved yet.** The actual Modbus defect is valid: unchanged genuine polls must refresh source-cache receipt age without fabricating a native value change or replacing the original sample timestamps. The new real-Modbus gated-transport regression checks that distinction. Root reports an observed behavioral failure against the prior Runtime binary; the replacement gate is not a clean result.
### R4 — P1: acquisition capability does not guarantee the ordinary native subscription feed
`DriverInstanceActor.cs:1892–1903` replaces ordinary `ISubscribable.SubscribeAsync` with `SubscribeAcquisitionAsync` for every source implementing `IAcknowledgedAcquisitionSource` when a publisher/capacity owner exists. The existing acquisition interface promises genuine acquisition callbacks and acknowledgment fencing; it does **not** promise that this method also establishes the driver's ordinary initial/COV/status event feed. A conforming driver may implement those feeds separately. The new callback publishes to the source hub, while ordinary parent/SDK publication still depends on native events, so this substitution can silently remove local updates.
The existing `ManyInitialDriver`, `DelayedLegacyDriver` and retiring-handle fixtures are concrete examples of that valid distinction. Their native initial events occur only through `SubscribeAsync`. Root's current replacement gate confirmed timeouts in `Restoration_preserves_all_130_synchronous_legacy_initials_despite_hub_pressure_and_missing_shapes` and `Retiring_acquisition_handle_cannot_publish_through_the_replacement_legacy_handler`. These are genuine compatibility regressions; changing those fixtures to emit extra native events would conceal the missing contract.
Require an explicit opt-in guaranteeing that the acknowledged baseline handle preserves the ordinary native subscription feed. A derived marker capability is preferred because this is a stable implementation guarantee, not mutable selection policy; a documented default-false property is also viable. Modbus can opt in because its acquisition handle uses the same underlying poll/native-COV machinery. Drivers lacking the guarantee must retain the existing legacy path. Preserve the existing regression assertions, then rerun both the new quiet-Modbus proof and affected lifecycle/legacy tests. No second ongoing physical subscription should be introduced.
Other reviewed mechanics retain the existing bounded acquisition owner, active-fence checks, reference allowlist and abandoned-operation cleanup. `stageSources: false` correctly avoids treating the staged native callback as an additional acquisition receipt when the physical callback owns source freshness. The existing health-tick reconciliation can retry a missing desired subscription after a transient establishment failure. These observations do not close R4 or establish a passing final candidate. The reviewer ran no tests/builds/Docker commands and edited only this note.
## Baseline capability repair closure — 2026-11-17
**R4 closed; this baseline repair is source-approved with focused green evidence.** The additive `IAcknowledgedBaselineAcquisitionSource : IAcknowledgedAcquisitionSource` explicitly guarantees that the returned handle preserves ordinary initial/native value/status events and acquisition callbacks on the same physical subscription. Modbus opts into that capability; `DriverInstanceActor.HandleSubscribeAsync` now requires the marker before substituting the acknowledged baseline. Other acquisition-capable drivers retain ordinary `SubscribeAsync` behavior.
The four existing separate-feed fixtures remain unmarked, with their legacy restoration and ownership assertions intact. A dedicated marker fixture checks that the first acquisition also reaches the native parent path, a subsequent unchanged acquisition does not fabricate another native change, and source receipt/version advance while original source/server timestamps remain unchanged. The real Modbus test checks the same quiet-poll distinction through its actual polling implementation. Modbus still uses one `PollGroupEngine` handle; source callbacks remain active-fence/reference guarded, native pre-ack events use bounded staging, and teardown retains physical capacity through actual cleanup. No further material finding was identified in this bounded lifecycle review.
Independently parsed checkpoints:
- `artifacts/grpc-data/baseline-freshness-red`: **1 executed, 1 failed**, the observed pre-repair freshness regression.
- `artifacts/grpc-data/baseline-freshness-capability-green/results.trx`: **31/31 passed**, zero failed/skipped, including real quiet Modbus freshness, explicit-marker native delivery, all130 legacy initials, delayed original-ingress preservation, retiring-handle rejection and captured-old-delegate fencing.
- `artifacts/grpc-data/baseline-modbus-acquisition`: **4/4 passed**, zero failed/skipped, for the existing Modbus acquisition cases.
This closure supersedes the immediately preceding open R4 disposition. It approves this source component for the next candidate build, not P10/P11 phase completion. The rebuilt Docker candidate, full matrix/workloads, updated candidate identity and P12 final review remain required. The reviewer ran no builds/tests/Docker commands and changed only this note.
## Preparatory integrated source audit — 2026-11-17
**Disposition: preparatory review only, with integrated-path findings requiring repair/reconciliation.** This pass examined the uncommitted production changes together with the committed implementation and the design's final-authority, one-hop, mapped-ACL, bounded-ownership and age-evidence requirements. The reviewer used read-only source commands, ran no builds/tests/Docker operations, and edited only this note. This is not the final Astra review or an assertion that every implementation path has been reapproved.
### R5 — P1: mapped anchor names bypass local grants with legacy ACL disabled — repaired
The original `OtOpcUaNodeManager.Permits` anchor branch converted `LocalSubject` to a local namespace NodeId and called `AuthorizeIfRequired`. That method passed `localBypass: !Enabled`; the actual-namespace classifier correctly skipped mapped authorization for this fabricated local ID, then the legacy bypass allowed it. Consequently an ungranted caller could learn configured mapping anchor names through parent Browse/Translate with `Security:Acl:Enabled=false`. Descendant/value gates did not make that anchor disclosure acceptable.
The reviewed repair carries a detached copy of the deployed placement's `NodeScope` on `ProjectedAnchorDefinition`. It validates the realm/path/branch, checks live placement before and after authorization, and invokes shared `DataOperationPolicy.AuthorizeLocal` with the original caller's key/version/expiry independently of the legacy switch. Missing scope/authorizer denies. This also avoids treating a fabricated UNS local NodeId as a live folder. Scope retention is included in the anchor charge. Independently parsed `artifacts/grpc-data/mapped-anchor-acl-green/results.trx`: **5/5 passed**, zero failed/skipped, including actual Raw and UNS parent Browse/Translate, a narrow allowed anchor, denied sibling, and ordinary local ACL-off control. **R5 is source/evidence closed in this component**, subject to final candidate reconciliation.
### R6 — P1: real remote stream age cannot satisfy mapped finite freshness — open
`DataProtoMapper.DecodeSubscriptionAgeReadiness` correctly returns a lower bound with no finite upper bound for an unsolicited wire update. `GrpcDataConnection.ReadAllAsync` preserves that result. `ProjectedDataAccess.Cohort.RunAsync` nevertheless requires `item.AgeBounds.IsFresh(demand.MaximumSampleAge)` before accepting any stream value, and all such demands require a positive finite maximum age. Thus the first actual remote snapshot/value stops the cohort. Composed fixtures supplying already finite bounds did not exercise this transport boundary.
Do not weaken `IsFresh` or infer zero transport delay. The agreed repair direction is a bounded, negotiated subscription freshness challenge that requires Subscribe permission, not an implicit Read grant. A per-stream nonce may amortize the proof across frames if the server captures that nonce **before** computing each frame's origin age and retains the pair immutably through preparation/write. Receiver elapsed time since the nonce's pre-send start then conservatively bounds server queue plus network time. Unknown/evicted/expired nonces cannot borrow the latest nonce's proof. Periodic renewal must provide a bounded quiet-source complete snapshot without an extra physical poll. Greater sample version alone must not inherit an older witness: staged legacy initials may commit with an earlier captured receipt timestamp. Add the actual remote client → registry → SDK monitored-item path and delayed-frame/renewal/quiet-source regressions.
Related queue residence must be preserved. The current `FrameEvent` has no receiver timestamp, and the cohort assigns `ReceivedTimestamp` only when processing the frame. Once finite evidence is available, stamp receipt before the event queue and advance bounds through queue and snapshot holds; otherwise that delay would freshen data. A unary validation alternative must also preserve its own causal timing and cannot silently require Read for a Subscribe-only grant.
### R7 — P2: mapped array writes copy before node-wide admission — open
`ProjectedDataAccess.WriteAsync` calls `EncodeValue` before reserving `_unaryCount`/`_unaryBytes`. For arrays, `EncodeValue` allocates an object array, boxes elements and constructs the owned typed value before the payload-size/capacity checks. Oversized or already quota-blocked requests can therefore allocate large uncharged copies; concurrent rejected writes bypass the intended owned-memory bound. The prior MaxBytes clamp fixed dispatch admission but not this ordering.
Perform bounded nonallocating shape/size preflight, reserve capacity before encoding, release on failed encoding/admission, and transfer the charge through actual `WriteCoreAsync` completion. Preserve ignored-cancellation ownership. Regressions can use pre-created arrays and current-thread allocation measurements while one physical operation holds capacity, avoiding an implementation-only encode hook; rejected work must not allocate in proportion to the array length or reach dispatch.
### R8 — P2: unregister can strand delivered projected mailbox ownership — source repaired, evidence pending
`DependencyMuxActor.RemoveSubscriber` previously cleared queued mailbox entries and unconditionally called `Context.Unwatch`. With `retainDelivered:true`, `ProjectedCoalescingMailbox.Clear` intentionally leaves delivered values/charges retained. Their mailbox entry is disposed only on the subscriber's `Terminated` message or whole-Mux shutdown. Unregistering a live subscriber before it stops therefore suppresses the later cleanup; PostStop's unregister can encounter the same ordering. Repeated churn can permanently consume the bounded global quota and subscriber slots.
The staged repair retains death-watch while a projected mailbox exists and reuses that mailbox on re-registration. It does not release delivered values while a live consumer may still own them; termination removes/disposes the retained mailbox. Source inspection verifies that narrow change. The required regression must establish that capacity remains held while the unregistered consumer is alive and is reclaimed after termination, including repeated churn. Root/worker reported the observed negative case; final green evidence had not yet been independently reconciled at this note's update.
### Other checked boundaries
No additional high-confidence finding was identified in the reviewed one-hop catalog classification, exact serving-generation write dispatch fence, prepared transport publication guard, baseline marker selection, or compact opt-in paths. Origin catalogs reject mapped/nonlocal namespaces and resolve exports against origin-owned views. The device write gate rechecks original credential/version/expiry, active catalog/authority, exact route and full serving proof under the shared dispatch fence. Transport serialization retains the final publication callback after private byte preparation. These are bounded source observations, not substitutes for the still-required full candidate matrix, workloads and suite results.
## Integrated repair source checkpoint — 2026-11-17
**R7 and R8 are source-verified; final green evidence reconciliation remains pending. R6 remains open until the complete nonce/SDK path and adversarial regressions pass.** No implementation files or tests were changed by this reviewer.
For R7, `FitsWriteBudget` checks borrowed array shape/count and bounded string storage without boxing or copying. `WriteAsync` reserves the unary count, full bounded byte allowance and demand hold before `EncodeValue`; captured string lengths are checked again against caller mutation. Every pre-transfer exit releases ownership, while `WriteCoreAsync` retains the value and reservation until actual physical completion. Root reports the two original allocation regressions failed against the prior binary, including a corrected fitting 20,000-element quota case, and the first repaired focused run passed both. Final aggregate evidence is still to be reconciled.
For R8, retaining DeathWatch while a projected mailbox exists permits the unconditional `Terminated` cleanup to dispose it even when an earlier unregister already detached interests. Re-registration reuses the retained mailbox, and live consumers do not lose their delivered-value charge early. Root reports the observed quota-retention failure in `projected-mux-lifetime-red`; the subsequent test correction distinguishes the legitimately present replacement mailbox from the terminated subscriber's ownership.
The staged R6 protocol uses an explicit capability and bounded per-stream freshness witnesses, preserving the lower-only semantics of uncorrelated frames. Review identified and directed these additional repair obligations:
- Repeated challenges must not fill ordinary lifetime command history. The staged client reserves a monotonic freshness sequence namespace, rejects reuse/older sequences, retains only sixteen proof starts, and keeps pending command quota until ACK. Require a successful-renewal test beyond the ordinary history ceiling.
- A challenge snapshots already-active handles. Ordinary deltas for a later frozen item must not overtake that item's snapshot and trigger the client's version-regression fence. The staged server counts challenged handles, defers their `ConsiderAsync`, then marks current sources dirty after snapshot completion. Require a multi-item snapshot with a changing later item.
- ACK precedes snapshot completion, so ACK-only client pacing can accumulate snapshots beyond the principal's limits. The staged server now defers challenge capture through the existing bounded command barrier while any snapshot remains outstanding. It reuses scheduler permits, frozen snapshot/history/lifetime gates, outbound charges and byte-rate admission rather than creating another polling path. Require a multi-batch renewal with held or rate-limited output.
- Finite proof age must retain the timestamp at which the client calculated its upper bound. The staged per-value local `FreshnessObservedTimestamp` is now carried into cohort queue and publication checks; re-anchoring it at a later async continuation would omit delay. Require the held-continuation/queued-snapshot expiry regression.
- A new valid observation of the same immutable acquisition need not have identical age bounds or observation timestamp. SDK candidate deduplication may omit only those observational equalities while retaining positive exact source version, source identity, clock, full serving/local view/generation, status, original timestamps and structural value. The existing candidate must still be fresh for this monitored item's age limit and retain its original proof. An expired notification or Republish must never adopt a later witness. Require healthy-item deduplication, expired old evidence denial and fresh acquisition recovery on the actual SDK path.
The reviewer source-checked the staged history, ordering, snapshot-admission and timestamp changes. Their focused and integrated results, the SDK candidate repair, current candidate identity, full matrix/workloads and final suite are not approved by this preparatory checkpoint.
## SDK witness and stream lifetime review — 2026-11-17
The source-frozen `SameObservedStatus` repair is semantically narrow: it removes the DataValue info-type marker only when the low twelve status bits equal exactly `0x400`. Actual information bits, other info types, severity, subcode, StructureChanged and SemanticsChanged remain significant. Multiple matching candidates remain ambiguous and fail closed. `FreshForDemand` checks the monitored item's own maximum age as well as the publication proof. A fresh existing candidate retains its original evidence; a separately fresh complete observation after expiry retires the old binding and SDK queue before accepting new evidence. Held old notifications and Republish do not acquire the newer witness. No further source finding was identified in those repairs.
Independently parsed `artifacts/grpc-data/stream-freshness-semantic-status-green/results.trx`: **7/7 passed**, zero failed/skipped. It covers the actual gRPC-client-to-SDK initial finite-age delivery, quiet expired acquisition denial/new-version recovery, decoder observation timestamp, queued snapshot expiry, immutable already-captured nonce, more than1,024 renewals/reuse rejection, and unregister/termination mailbox quota reclamation. This closes R8's focused evidence obligation. R6 still requires the held multi-item and multi-batch snapshot bounds evidence plus full candidate reconciliation.
### R9 — P1: ordinary stream expiry permanently disposes the SDK monitored item's demand — open
`ProjectedDataAccess.Cohort.RunAsync` opens a stream with a fixed one-minute `SessionLifetime` (current line757). Its `finally` (current lines929–950) removes cohort ownership, invalidates sources, and calls `Dispose` on every retained demand. `ProjectedMonitoredItem.RequestBaseline` then rejects the disposed demand. `RevalidateMonitoredItems` checks only `HasCurrentDemand` and suppresses the item; it does not reacquire it. `TryAcquireProjectedItem` is called when the monitored item is created, not by a recovery loop. Thus even normal session expiry permanently stops an existing mapped monitored item, and transport termination follows the same path. This is a source-established liveness defect, not a claim based solely on the missing test.
Separate the logical subscription's ownership from a physical stream attempt. A still-authorized demand needs bounded sequential reconnect/backoff, retaining the old attempt's physical quota until actual completion, retiring old source evidence, and requiring a fresh complete snapshot before readiness. Withdrawal, credential expiry and invalidated local authority must still prevent retries. A serving change additionally requires current projection/metadata and original caller reauthorization; it must not replace the serving fields on an old frozen proof. Require an actual existing SDK monitored item to recover after controlled session expiry and transport loss without client recreation, plus withdrawal during retry and ignored-cancellation quota tests.
The same repair must handle compatible metadata renewal: `Demand.IsValid` captures an exact proof reference and definition guard, while `TryResolveProjected`/`TryPinProjected` only return currently valid committed metadata and do not renew it. Preserving the old demand unchanged or polling those methods indefinitely cannot recover an SDK-only mapping after lease expiry. Preserve the original logical caller/operation, mapping/origin identity, node lifetime and compatible shape; acquire and reauthorize a new immutable pinned binding through bounded existing metadata preparation/application work. Old source states and queued evidence retain their old proof. Require lease-expiry recovery without an unrelated client Browse or fabricated grants. The reconnect owner received these constraints and the lock-order/attempt-generation/physical-capacity hazards.
### Explicit repair status at this checkpoint
| Finding | Status |
|---|---|
| R1 default mapped write budget | Closed with scoped source and focused evidence; final candidate reconciliation pending. |
| R2 TLS fixture undefined variable | Source closed; actual candidate-matched Docker negatives remain pending. |
| R3 live numeric-Good parser | Source closed with regression coverage reported; actual fault matrix remains pending. |
| R4 baseline capability compatibility | Closed with independently parsed31/31 and4/4 focused gates. |
| R5 mapped anchor ACL bypass | Closed with source and independently parsed5/5 actual SDK gate. |
| R6 remote stream freshness | Open pending complete nonce/SDK/adversarial evidence and integration reconciliation. |
| R7 pre-admission write copies | Source repaired; initial focused positives reported, final green reconciliation pending. |
| R8 retained Mux mailbox | Closed with source and independently parsed7/7 focused packet containing its lifetime regression. |
| R9 stream lifetime recovery | Open; repair and observed regression evidence required. |
This remains a preparatory source audit. No P10/P11 phase or P12 final approval is issued.
## R9 metadata-renewal contract decision — 2026-11-17
Root authorized the necessary additive renewal contract after the same-existing-SDK-item lifetime regression failed waiting for a replacement stream. The accepted design is an **explicit per-item metadata lease on successful GetMetadata**, with an advertised capability. `MaxMetadataLease` is only a ceiling and cannot be converted into a lease grant. This section approves the design direction, not the implementation or pending tests.
The two principals retain distinct authorization boundaries. The origin service principal must pass the existing Metadata/export policy; that policy is not broadened. The consumer reauthorizes the monitored item's original caller key/version/expiry for **Subscribe**, without requiring a local Browse/Read grant or fabricating a configured capability. A peer lacking the lease capability or denying Metadata cannot supply renewal authority. The response must retain exact correlation/view/realm/address, same-response full Serving and catalog/authority epochs, positive bounded duration and original origin credential-expiry cap. The consumer anchors the lease at the monotonic start before the request, then intersects the mapping cap and original caller expiry; response/continuation delay cannot renew it.
Renewal replaces only the existing exact node proof. It does not fabricate a Browse page, parent completeness, sibling visibility or cursor. Require the full prior origin DataView, including canonical Subject, rather than address alone: an address-preserving move outside the configured remote-root subtree must not silently retain its former local placement. Local mapping identity/revision, trusted scope/ancestry, node lifetime and compatible BrowseName/type/rank/dimensions remain constrained. A verified target-serving change may establish a new source binding, but all old source/sample witnesses must retire; no old proof's serving fields are overwritten.
The implementation must reserve bounded physical and cache ownership before renewal work/copies, hold it through ignored cancellation, and atomically install only after rechecking original caller, current mapping, exact node, route and new lease. Old pinned proof ownership survives until its actual users release it. The owner was advised to keep lock ordering and per-attempt source-owner keys explicit. Required evidence includes the same SDK item/session recovering after ordinary stream expiry, metadata-lease expiry without client Browse, and target failover; withdrawal during retry and held physical work must remain fail-closed and bounded. Root will request frozen-source/evidence re-review. R9 remains open.
## Frozen protocol/client/mapper re-review — 2026-11-17
**Scoped source disposition: no additional blocker in the frozen R6 protocol/client/session/SDK repair or metadata lease codec/client contract.** The active R9 reconnect, exact-node metadata issuance/commit and compatible demand binding are excluded from this approval. The latest protocol tests still require the planned broad rerun and final candidate reconciliation.
The nonce is captured before the origin computes frame age and is never replaced during encoding. The client accepts a finite upper bound only for a known pre-send nonce in its sixteen-entry map, retains the local observation timestamp, and leaves unknown/evicted/oversized or unnegotiated witnesses without a finite upper bound. Both client and server enforce increasing bounded freshness identifiers; successful renewals do not consume ordinary lifetime command history. Challenge snapshots reuse the existing scheduler, frozen capture, byte rate and outbound ownership. Snapshot deferral prevents additional captures from accumulating behind a held snapshot, and challenged-handle gating prevents later ordinary deltas overtaking frozen versions. Existing current-handle, original authority and final publication fences remain active.
The metadata extension uses capability field15 and per-item lease field5, with supported minor5 offered by the client. Codec encode/decode requires a successful non-null metadata item and positive lease epochs/duration. The client verifies the response's outer Serving and negotiated lease epoch/duration ceiling, strips authority from unnegotiated or non-exact-view responses, and attaches only its own timestamp captured before endpoint selection and transport. Neither peer clocks nor capability limits manufacture a lease. Existing bootstrap metadata behavior remains distinct from exact-item renewal authority.
Independently parsed focused evidence: `metadata-and-freshness-codec-green` **82/82**, `stream-freshness-semantic-status-green` **7/7**, and `reconnect-and-metadata-component-gate` **12/12**, all with zero failures/skips. The latter records component execution only; it does not approve the concurrently evolving R9 implementation. Root additionally reports the held33-handle overlapping-snapshot wire case **1/1** and Subscribe-with-Read-denied/revoked-challenge pair **2/2**. Their source assertions were reviewed: the second snapshot remains deferred, all handles retain nondecreasing versions, fresh values reach the actual SDK, and revoked authority cannot acquire the challenge snapshot. Newly added minor-offer, unknown/evicted nonce and size cases await the broader rerun.
R6's frozen source repair is accepted within this component scope; its final integrated evidence remains pending. R9 remains open. R1–R5, R7 and R8 retain the explicit dispositions above. No phase or final implementation approval is issued.
## R9 draft implementation review — 2026-11-17
**R9 remains open.** This pass read the frozen draft while Root ran its component gate; no reviewer tests/builds or implementation edits were performed. The following actionable findings were sent promptly to Root and the owner.
- **P1 — pending attempts cannot sustain published evidence.** `Cohort.TrackSource` constructs `AttemptProof` before Open/Add, and its constructor immediately increments `SourceState._activeAttempts`. `IsAttemptValid` accepts any positive count in the era. A second stream with its Open still unacknowledged can therefore keep the first stream's old evidence valid after the last proven stream ends. Separate resource ownership from proven per-source coverage. Promote coverage only after a validated current, finite-age complete baseline; equal-version baselines may establish coverage even when global value publication is deduplicated. If proven coverage reaches zero, advance the era irreversibly before any pending attempt can promote. Root reports actual negative cases captured; repaired evidence remains pending.
- **P1 — coverage must end when the source's final handle leaves.** The remove-ACK path releases the logical demand but does not close that SourceState's attempt proof. Its evidence dictionary survives until the whole stream ends. A stream remaining open for unrelated source T can thus incorrectly sustain old evidence for removed source S. Track proven handle membership per source and retire coverage when its last current handle leaves, including remove/add recovery gaps.
- **P2 — exact renewal can leave a cache-only partial commit.** The resolver callback commits `_cache.TryRenewExact`, then rechecks authority; the SDK also rechecks after the callback. A failing post-commit guard leaves the SDK definition old while the cache has replaced the old proof. The next retry still supplies the old proof, which `TryRenewExact` rejects whenever a different current proof exists, even if the old pin remains in `_retiredByProof`. Require a prepared transaction/conditional rollback or explicit consistent successor adoption. Test cache commit followed by guard failure, restored eligibility, and successful retry without client recreation.
- **P2 — full-capacity cohort migration performs quadratic work under the owner lock.** `RenewInvalidDemandsAsync` uses `survivors.Any(d => !group.Any(...))` when it must rekey an existing cohort at `MaxStreams`. N surviving demands in one replacement group cause O(N²) reference comparisons while `_owner._sync` blocks unrelated admission. Precompute reference-identity group membership outside that lock and perform linear membership checks.
The authority-restoration path also needs the agreed R9 suspension boundary. `AttemptBegan` clears active placements; `RefreshAnchors` currently removes the old anchors, and `TryRemoveProjectedAnchor` retires child lifetimes and permanently retires their monitored items. Compatible authority restoration cannot preserve the same item after that terminal action. The reviewed repair direction retains only existing bounded, charged node lifetimes during a pending catalog attempt, with old authority guards already inactive; completed verified placement either renews exact compatible mapping/connection/parent/full view/scope/ancestry or terminally removes deleted, disabled or incompatible nodes. Old authority and retired lifetimes must never be reactivated.
**Withdrawn diagnosis:** stable `SourceState` identity across an era change does not itself prevent SDK rebinding in the current source. `WarmStandby.ObserveSample` already requires `original.IsValid` when deciding `sameSource`, so an ended-era binding forces the next complete snapshot to replace the SDK queue binding. The reviewer verified that guard and withdrew the additional identity-token finding. A new identity token per era is not required by this review. Root reports the same-item test already consumes Good before loss and recovers afterward; an old-notification Republish denial assertion is being strengthened.
The draft otherwise retains explicit origin metadata leases, original local Subscribe authorization, exact origin-view/shape checks, bounded fetch-slot ownership through physical disposal, and demand repinning outside the owner lock. These observations do not close the findings or establish final source approval.
## Continuous peer coverage clarification — 2026-11-17
**Decision:** losing one cadence's transport does not require erasing an already accepted immutable SDK sample while another **proven** cadence continuously covers the exact same source and serving/target/principal/export/authority context. The original monitored-item demand must remain live and authorized, and the sample must still satisfy its original finite age bound. Its held notification may therefore remain Publish/Republish eligible until that original evidence expires. Peer traffic, challenge renewal or reconnect must not replace its timestamp, age bound or proof.
This follows the approved design's shared immutable source ownership and rule that removing one consumer cannot cancel another consumer's demand (§4 and §6a). The new-stream-epoch/fresh-snapshot requirement (§5) governs the replacement attempt and future delivery; it does not require discarding valid accepted shared evidence solely because its original cadence ended. If proven coverage reaches zero even briefly, or source/serving/authority changes, the old era remains permanently invalid after recovery. Unrelated sources, pending Opens and registrations that never completed their own baseline cannot bridge that gap. A disposed or revoked monitored item independently denies delivery.
Frame admission remains distinct: continuous shared evidence cannot authorize new queued frames from an ended or cancelled attempt. Those still require their own current attempt/stream epoch/handle and final publication checks. The owner was explicitly reminded to retain that boundary.
Accordingly, a test requiring old slow-cadence Republish to fail immediately despite a continuously proven exact-source fast peer would impose an unnecessary stricter contract. The approved regression instead holds slow reconnect, verifies the old notification while peer coverage and original freshness remain valid, then advances beyond the original sample age and requires denial without using metadata expiry as a substitute. Conversely, removing the final S handle while only unrelated T remains must invalidate old S evidence permanently; re-add may produce a new valid complete baseline while T stays continuous. This clarification changes no evidence result or phase approval.
## R9 frozen source and Runtime evidence closure — 2026-11-17
**R9 and its associated coverage, renewal, migration and suspension findings are closed for this source checkpoint. No additional material source blocker was identified. The frozen repair is approved for the next candidate build.** This is not P10/P11 phase completion or P12 final implementation approval. Root's related SDK/Host gates were still being reconciled at review time; the complete current-candidate Docker matrix, workloads and final suite remain required.
The reviewer reread the frozen `ProjectedDataAccess`, exact resolver/cache renewal, mapping deployment/anchor reconciliation and SDK renewal/evidence paths at worktree HEAD `ee2c388ef1bceb84fa70bc0b37536c9517d937a8` plus the pending implementation changes. The following supersedes the open R9 draft findings above:
- **Proven coverage:** constructing an attempt proof does not count pending Open/Add work. Promotion requires a validated, current, finite-age complete baseline. Each acknowledged command owns its serialized snapshot boundary; a sibling's baseline cannot establish readiness for another handle. Only that handle's completed empty/expired boundary allows its next fresh delta to become a complete recovery baseline. Equal-version deduplication may establish proven coverage without fabricating a new sample. Removing the final proven handle closes that source's coverage even if unrelated sources keep the stream open. Zero coverage advances the era irreversibly. Continuously proven peers preserve only the already accepted sample's original evidence, as clarified above.
- **Physical ownership and retry:** a logical SDK demand survives ordinary stream expiry/loss. Each attempt gets a new stream identity/epoch, checks its own frames/handles, closes coverage, and awaits actual pump, stream and connection cleanup before another attempt opens. Ignored cancellation therefore retains the existing bounded cohort and ownership. Retries use bounded backoff. Renewal shares the existing unary count/byte reservation and resolver fetch slots through actual connection disposal; caller disposal or revoked original authority cannot authorize a replacement attempt.
- **Exact renewal and bounded retry:** renewal uses an explicit authenticated metadata-item lease, original local Subscribe authorization, full origin view, compatible shape and current mapping/connection/scope/ancestry. It does not create Browse visibility, sibling grants or another physical subscription. Cache-only partial commits can now be retried through an exact retained predecessor/descendant lineage. A valid current descendant must match the serving and metadata; unrelated bindings cannot be overwritten. Cache count/byte limits remain enforced, and a node cannot accumulate a chain of pinned predecessors. SDK renewal preserves only an active compatible lifetime and rechecks the authority after the cache callback. Demand installation repins the actual committed proof outside the owner lock.
- **Migration and suspension:** migration builds reference-identity membership sets before entering the owner lock, replacing the quadratic nested scan. Mapping transitions serialize with anchor reconciliation through `TransitionGate`, without holding the mapping catalog gate across SDK calls. Pending/failed deployment retains existing charged lifetimes behind inactive authority. A completed deployment renews only an exact compatible placement; removed or incompatible placements are retired. Old source/sample proofs do not become valid when compatible authority returns.
Independently parsed `artifacts/grpc-data/renewal-snapshot-coverage-gate/results.trx`: **156 executed, 156 passed, zero failed/skipped**. Its SHA256 is `08e2480238b7e2ce16e118445435e08c08ea9614e88b00d39a060aabce6baf28`. The concrete rows include pending-second-Open and last-source-removal negatives, all original cadence-sharing/recovery cases, expired-cache recovery, cache-commit/SDK-guard retry, one-node predecessor bounds, held physical disposal/cancel, same-item metadata expiry without client Browse, quiet live-stream renewal, Subscribe-only caller/export, compatible deployment restoration, actual framed gRPC new-primary recovery and pinned-node refusal, and continuous-peer original-age expiry. They also include the nonce lifetime/unknown-or-evicted witness/size/minor5 and held multi-batch snapshot cases. This reconciles the integrated Runtime evidence for R6/R9; it does not replace the outstanding candidate-wide gates.
The narrow final-runner identity review found no new blocker: comparison uses sorted execution-input paths with actual bytes and permission mode, independently of HEAD/index status. An identical commit or prose/evidence edit does not invalidate executed code; executable/test/fixture/toolchain changes do. Unsafe paths and symlinks are rejected, and the public NAT DER fixture is included. Root reports its pure helper suite at **23/23**; the reviewer did not execute that suite or treat it as final-suite evidence.
R1–R5, R7 and R8 retain their previously recorded component dispositions and remaining candidate obligations. No finding has been silently dropped, and the withdrawn SDK identity-token diagnosis remains withdrawn. The reviewer ran no tests, builds or Docker commands and edited only this review note.
## R10 Host dispatch and readiness checkpoint — 2026-11-17
**Bounded approval recorded from Astra `/root/astra_remaining_gate_review`: the Host freshness dispatch repair and readiness corrections are accepted for the next integrated candidate.** This receipt does not approve phase completion or the final implementation.
The production `DataConnectionGrpcService` dispatcher omitted `ChallengeSubscriptionFreshness` and returned `InvalidArgument` before reaching the supported session command. The repair dispatches it under both feature flags with bounded validation. The observed RED `artifacts/grpc-data/host-freshness-command-red/results.trx` executed one case and failed it (SHA256 `d7085d31b536b74215fa2e1c54025cdd3ce92f79b434d1f56249de6ff9ef5499`). Replacement evidence is **32/32** real Host wire cases in `host-freshness-dispatch-wire-green/results.trx` (SHA256 `749cbaa49aa18cdbfa531049ff32c812d76a219ade5a091afa6f0c8deb879aa0`) and **86/86** Host command units in `host-challenge-dispatch-unit-green/results.trx` (SHA256 `ab47c580c9150170d4d299b362955a19ece89eae804474a6c5c8f53edf042d87`), zero failures/skips. The ledger editor independently parsed these counters and hashes; this note does not claim another reviewer test execution.
The same scoped review accepted readiness checks against both pair endpoints and the exact `/OtOpcUa` endpoint path, plus the migrator's `--no-build --configuration Release` invocation. Actual rebuilt-candidate matrix execution remains required.
## R11 write observation budget checkpoint — 2026-11-17
**Bounded approval recorded from the same Astra review: R11's default budget repair is accepted.** The SDK's previous five-second default and the probe's ten-second observation window could expire before the origin's default 26-second `GatewayAsk` bound. SDK maximum/default is now 30 seconds, retaining the original operation started time and respecting a shorter caller hint. Single-write and deduplication probes observe for 40 and 70 seconds respectively; the CLI observes for 60 seconds.
`artifacts/grpc-data/write-default-bound-red/results.trx` contains two theory rows: the default 30-second expectation failed while the explicit five-second hint passed. The replacement `write-default-bound-green/results.trx` passed **29/29**, zero failures/skips (SHA256 `6a98c1bf775dad3b4881e091664df7c9f19b1013d18164f7f41b59a0055a2ee1`). `write-probe-deadline-green.log` records **28/28** Python checks. The ledger editor independently parsed the TRX and read that log. These focused results do not demonstrate a successful current-image Docker write.
At this checkpoint, D01 alone passed in the earlier all-scenario attempt. The newer focused D01a Subscribe succeeded but its write failed against the old image; D03 encountered transient Browse `BadNoCommunication`; D04 changing mapped-value checks remain unfinished. Native physical CLI changing-value delivery succeeds, while mapped freshness investigation continues. P11 workload profiles and the unfiltered full-solution suite have not run. Final Astra approval is pending; P10/P11/P12 remain open.
## Client rejected-item status and alarm cleanup checkpoint — 2026-11-17
The actual unknown-node data wire regression `artifacts/grpc-data/client-rejected-subscription-status/results.trx` failed **1/1** because `service.SubscribeAsync` did not throw for the rejected monitored item. The shared data/event admission helper now inspects per-item `Status.Error` after `ApplyChanges`, removes the failed item and throws the exact Bad status. Actual wire confirmation passed **1/1** in `client-rejected-subscription-status-green/results.trx`; related units passed **21/21** in `client-subscription-status-unit-green/results.trx`, zero failures/skips. This checkpoint records that narrow correction, not general integration completion.
**Bounded Astra disposition from `/root/astra_remaining_gate_review`: the P2 alarm assignment/cleanup finding is closed.** The original path assigned the alarm subscription before Add admission; replay had the same issue. Two intended regressions failed in `alarm-rejected-item-red/results.trx`. The repair's `CleanupFailedAlarmSubscriptionAsync` clears only a matching subscription instance and its intent, uses a five-second cancellation token for Delete, disposes the failed subscription, and preserves the original admission exception. Replacement evidence `alarm-rejected-item-green/results.trx` passed **103/103**, zero failures/skips (SHA256 `55ed02da582d0f49e707a4cdcf710a5582f5bf949eeba24bac2691a12efd2dbc`). The ledger editor independently parsed these TRX counts and the hash. No independent strict wall-clock cleanup bound is claimed.
## Deployed wrapper freshness and diagnostic checkpoint — 2026-11-17
**Open P1 from the same Astra review:** deployed `ScopedSubscription` hides the freshness interface and rejects challenge commands. Direct session freshness support therefore does not prove that the production mapped wrapper can produce a finite age upper bound. `artifacts/grpc-data/deployed-freshness-wrapper-red/results.trx` executed and failed **2/2** intended cases. A repair is staged, with green confirmation and scoped approval pending at this checkpoint. This finding remains open here.
The P11 deterministic registry expanded from 52 to **55 exact methods**, including actual deployed-wrapper finite-age, capability/revocation and unsupported-peer coverage. The packet has not yet been refreshed, so the expanded registry is a required evidence set rather than a passing packet. Mapped diagnostic instrumentation has **40/40** SDK feature passes (`mapped-diagnostics-sdk-feature-green/results.trx`) and **73/73** Runtime passes (`mapped-diagnostics-runtime-green/results.trx`), zero failures/skips, independently parsed by the ledger editor. Root reports a clean node probe build. These checks are bounded diagnostic evidence; P10/P11/P12 and final Astra approval remain open.
## Deployed freshness closure and pending P11 packet refresh — 2026-11-17
**Bounded Astra disposition from `/root/astra_remaining_gate_review`: the deployed-wrapper P1 source finding is closed.** `ScopedSubscription` now delegates freshness using the minimum of inner, batch and monitored-item limits, retains the original Subscribe authorization guard, enforces count/byte bounds, and preserves unsupported-peer behavior. The real deployed `RemoteSubscription`-to-SDK finite-age case is included in `artifacts/grpc-data/deployed-freshness-wrapper-green/results.trx`: **56/56 passed**, zero failures/skips, SHA256 `a816a7393130c8425e09047c334ef0f0b213c1d7ebcecc583c26f8fafe55af2c`. The ledger editor independently parsed the counters/hash. This supersedes the preceding open wrapper source status; actual rebuilt-candidate D04 remains unclosed.
The first full execution of the 55-method P11 registry produced **58 theory-expanded rows: 57 passed, one failed**, recorded in `artifacts/grpc-data/runs/grpc-data-local/adversarial-evidence-red-snapshot-stamp-1794905771205268000/packet.json`. The failed `Snapshot_waiting_for_end_cannot_publish_after_its_freshness_expires` case observed the expired pending value 7 instead of fresh value 42. Root confirmed a fixture race caused by a missing local observation timestamp. The fixture now sets `SnapshotObservedTimestamp = Clock.GetTimestamp()` before `StartSubscription`, retaining the strict assertion. Focused class confirmation `p11-pending-snapshot-stamped-green/results.trx` passed **44/44**, zero failures/skips (SHA256 `6e0032f84a1830123dfa558bc4936a5eab685c1da31ce7002f3d07e1a0c9a9d5`). The ledger editor independently parsed both the failed packet and focused green counters/hash.
The full packet is rerunning at this checkpoint; no refreshed packet pass is claimed. The new Docker candidate is building, and no actual D04 closure is claimed. The SDK instrumentation feature gate remains **40 passed** as recorded above. P10/P11/P12, workload measurements, the unfiltered full suite and final Astra approval remain open.
## Actual mapped Subscribe and write prerequisites checkpoint — 2026-11-17
**Astra `/root/astra_remaining_gate_review` independently approved the bounded changes and actual notification parsing recorded here.** The wrapper-fixed actual D04 mapped Subscribe delivered **10 distinct values, all 10 Good, with no errors**. Evidence is `artifacts/grpc-data/current-fixed-D04.log` and `artifacts/grpc-data/runs/grpc-data-local/evidence/D04-subscribe-6411ce4a.process.json` (plus its validated JSON/summary). The next CLI Write failed during its preliminary type-inference Read with `BadWaitingForInitialData`. Thus this proves changing mapped Subscribe, not completion of D04 or the full matrix.
`WriteCommand` now accepts an optional explicit `--type` for numeric/string primitives. An explicit type bypasses the inference Read, rejects invalid input before connecting, parses invariantly and preserves exact `UInt16` values; omitted type retains legacy inference. The harness supplies `UInt16`. Behavioral RED `cli-explicit-write-type-red/results.trx` executed 32 cases with **28 failed/four passed**; replacement `cli-explicit-write-type-green/results.trx` passed **32/32**, zero failures/skips. `cli-explicit-write-type-python-green.log` passed **27/27** Python checks. The ledger editor independently parsed these counters and read the Python log.
A separate deployed write gate found `DataConnection` still defaulted to a five-second timeout, capping all writes despite the SDK's 30-second budget. The entity default and fixture seed now use 30 seconds, preserving explicitly stored shorter values. The actual deployed SDK write RED `deployed-default-write-timeout-red/results.trx` failed the default case and passed the explicit-short case. Replacement `deployed-default-write-timeout-green/results.trx` passed **58/58**, zero failures/skips (SHA256 `df59372f806ee00c551c23d4f0799e76016fbeedc6e666df3f64705c82823b58`), independently parsed by the ledger editor. Only the existing owned fixture was upgraded through its existing seed mutation path: full connection timeout set to 30, normal deployment, then snapshot confirmed 30. Restore does not normalize stored timeouts.
The preceding P11 packet did pass **58/58** rows, archived at `artifacts/grpc-data/runs/grpc-data-local/adversarial-evidence-passed58-before-cli-default-fix-1794906299552481000/packet.json`; the ledger editor independently parsed that result. The subsequent source changes invalidate it for the current candidate. The expanded **56-method** packet, expected to execute **60 rows**, is running at this checkpoint; no current packet pass is claimed. A new Docker image is building. P10's complete actual matrix, P11 workload measurements, P12's unfiltered full suite and final Astra approval remain open.
## Ingress mailbox defect, bounded repair and current deterministic packet — 2026-11-17
The subsequent actual D04 run failed on interleaved Good/Bad delivery (`artifacts/grpc-data/d04-ingress-diagnostics.log`), so the earlier successful mapped Subscribe does not establish full D04 success. Live SOURCE1 before/after counters in `runs/grpc-data-local/evidence/source-1-before-origin-counters.json` and `D04-uns-source-1-after-1794907193154816000.json` isolated cache-gate contention: `ReserveLock` increased **6**, `CommitLock` **4**, and duplicate `ExternalInvalidate` **10**. SOURCE1 `InterestQuiet` increased **7** and `InterestReset` **14**. Separately, Root reports CONSUMER `ProjectedStreamDiagnostics.ResetHistory` increased **7**, accounting for all seven wire resets. `ExternalInvalidate` mirrors the six Reserve and four Commit events; these are duplicate observations, not unique acquisitions. Capacity refusal, history gap, partition invalidation and invalid commit remained **zero**. The ledger editor read these exact counters. This confirmed a production ingress defect rather than a passing integration checkpoint.
**Bounded Astra disposition from `/root/astra_remaining_gate_review`: the mailbox findings are closed for the reviewed source checkpoint.** All value admission now uses a bounded per-partition concurrent FIFO and atomic dirty cells independently of the cache gate. Source CAS protects metadata pins; bytes and copy permits are reserved before copying. Immediate fences, post-current checks and a per-source committing CAS prevent stale or overlapping admission. Finite entry controls plus 128-value worker slices preserve fairness; cleanup retains exact ownership and original timestamps. Astra also reviewed the design §6a clarification; its status is authorized/in progress, with Root's minor wording correction applied.
Test-first artifacts record the intended failures: `ingress-mailbox-admission-red/results.trx` **one held-gate failure**; `ingress-mailbox-races-red/results.trx` **four race failures/one disposed-source pass**; `ingress-mailbox-loss-fence-red/results.trx`, `ingress-mailbox-control-fairness-red/results.trx` and `ingress-mailbox-same-source-red/results.trx` **one failure each**. Final Runtime feature gate `ingress-mailbox-reviewed-runtime-green/results.trx` passed **620/620**, zero failures/skips, including ten new mailbox cases (SHA256 `06a0cdf94e338c74cbcde0be7bb59d2095760ecabfb2bd09e97245b0046f5936`). Astra independently parsed the 620-result packet; the ledger editor independently verified its counters/hash and the RED counts. Test-only reconciliation updates the old held-gate assertion, makes the internal `ProcessPending` helper drain worker slices fully, and corrects the old catalog staging expectation to R9's invalid-anchor retention while pending followed by one removal after completed unmapping.
The expanded **64-exact-method** deterministic P11 packet now passed **70/70** theory-expanded rows with **zero source gaps**, recorded in `artifacts/grpc-data/runs/grpc-data-local/adversarial-evidence/packet.json` and `p11-current64-adversarial.log`; the ledger editor independently parsed the method/result counts and log. This supersedes the prior pending packet status for the current source checkpoint. The mailbox candidate image is building. Actual D04 retest and the full Docker matrix remain pending, as do P11 workload measurements, P12's unfiltered full suite and final Astra approval. No phase completion is claimed.
## Observer, sample fidelity, cursor and process cleanup checkpoint — 2026-11-17
**Bounded Astra disposition from `/root/astra_remaining_gate_review`: the observer, cleanup and redaction findings are closed for this source checkpoint.** The typed bundle observer reports only committed credential/trust scope and entry versions plus deletion/retirement flags, without reading secret payloads. Scope-only readiness waits for both exact committed scopes; absent entries do not imply a key commit. Interrupted notifications/import retry and pending retirement/delete work cannot publish committed readiness prematurely. `bundle-pending-retirement-red/results.trx` failed **3/3** intended cases; `bundle-pending-retirement-host-green/results.trx` passed **93/93**, zero failures/skips, superseding the earlier **88/88** `bundle-commit-host-feature-green` gate. The ledger editor independently parsed these TRX counts.
Sample fidelity and cursor evidence remain distinct from broad Docker scenario completion. `d03-sdk-sample-fidelity/results.trx` passed **1/1**, preserving one controlled mapped SDK sample's independent timestamps, quality, value and version. Live-read parsing validates each read against its own completion time and explicit clock allowance, rejecting invalid/future timestamps and value/quality mismatches without rewriting legitimate independent cached times. `d05-sdk-consumed-cursor-wire/results.trx` passed **1/1**, exercising session-bound BrowseNext and per-child authority rechecks. Raw origin continuation checks preserve exact ordered replay and require invalidation after an actual serving revision change; replay rules do not fabricate SDK cursor reuse. The ledger editor parsed both wire TRX counters and read the corresponding parser test coverage.
Cancellation and fault cleanup now cancel/collect the owned process group, retain bounded failure evidence and preserve the original failure. The silent, TERM-ignoring descendant case is covered after parent collection, not merely while a parent remains alive. Streaming redaction exposes complete safe notification lines before EOF while denying split, overlapping and UTF-8 boundary secret leakage. The observed RED logs are `process-cancellation-red.log` (two missing-API errors), `live-fault-process-cleanup-red.log` (one failure), `process-silent-descendant-red.log` (one failed/three executed), and `live-stream-redaction-red.log` (one failed/two executed). The reconciled Python evidence totals **136 passes**: the eleven `test_*-cleanup-current-green.log` suites, with the four `test_*-group-final-green.log` replacements for process cancellation, fault evidence, CLI gate and redaction (the process suite increases from two to three cases). All report OK. This is scoped behavioral evidence, without an independent universal wall-clock cleanup guarantee.
The rebuilt current candidate completed normal deployment and actual catalog readiness (`artifacts/grpc-data/bundle-port-ready-candidate-rebuild.log`). The expanded **70-exact-method** deterministic P11 packet passed **79/79** rows with **zero source gaps** in `artifacts/grpc-data/runs/grpc-data-local/adversarial-evidence/packet.json`, indexed by `p11-current70-adversarial.log`; the ledger editor independently parsed these counts. The registry helper separately passed **7/7** (`p11-bundle-fidelity-registry-unit.log`). These replace the earlier image-building and smaller deterministic packet checkpoint, not the remaining phase obligations. The full actual P10 matrix, actual P11 workload measurements, P12 unfiltered full-suite execution and final Astra approval remain pending. This evidence checkpoint is frozen after this update.
## Unary age, absolute write deadline, mixed queue and secondary-policy checkpoint — 2026-11-17
The latest bounded review corrections preserve local monotonic age through unary observation and establish the absolute write deadline before preflight. F1's `unary-freshness-delay-red/results.trx` failed **1/1**; projected confirmation `unary-age-observation-green/results.trx` passed **46/46**, and connection-client confirmation `unary-wire-observation-green/results.trx` passed **53/53**. F2's `write-absolute-deadline-red/results.trx` failed **2/2**; the combined Runtime `final-age-write-runtime-green/results.trx` passed **121/121**. Independent cohort retry jitter also had its intended **1/1** RED (`cohort-retry-jitter-red`); the repaired `Concurrent_cohort_retries_use_independently_sampled_delays` case passed, and Astra approved the scoped source correction.
The mixed outbound queue finding required separate causal evidence. `cohort-jitter-reviewed-runtime-green/results.trx` executed **624**, passing **623** and failing concurrent snapshot ordering. The diagnostic `runtime-snapshot-aggregate-trace/results.trx` then passed **624/624** but did not close the finding. `mixed-outbound-dirty-red/results.trx` reproduced the original 12+1+1 pressure pattern as **one failure**, with Root reporting EOF at sequence 17. `AvailableValueSlots` now uses the minimum of remaining value slots and total channel slots at all three sites. The first repaired ordering packet passed **22/23**: a test barrier race captured eight rather than six. Moving that barrier under the gate retained the intended assertion; `mixed-outbound-ordering-barrier-green/results.trx` passed **23/23**, zero failures/skips. Astra independently approved this bounded queue source repair.
Actual D02 previously failed after **414 assertions**, after mapped Read/Browse had passed: secondary-write policy refusal incorrectly backed off an immediately following Read. `secondary-write-read-backoff-red/results.trx` failed **1/1**; `secondary-write-read-backoff-green/results.trx` passed **54/54**, zero failures/skips. Astra approved this scoped P07 correction. P12's S7 publication and ScriptWorker publication preparations separately passed **24** and **27** Python checks (`s7-publication-green.log`, `p12-worker-publish-green.log`) and received bounded approval. They do not constitute P12 full-suite execution.
The ledger editor independently parsed the cited RED/GREEN TRX counts and publication logs. Previous-candidate actual scenarios passed **D01a: 761 assertions** (`current-D01a.log`), **D03: 377**, and **D05: 237** (`current-focused-results.json`). These remain previous-candidate evidence. At this checkpoint `final-reviewed-runtime-grpc-green` is still running (expected 626 tests, no completed result observed), `reviewed-queue-secondary-candidate-rebuild.log` reports a build in progress, and the expanded **78-method**, zero-gap P11 registry awaits a refreshed execution packet. No current packet pass, rebuild success or final approval is claimed. P10's full matrix, P11 actual workload profiles and P12's unfiltered full suite remain open. The two evidence documents are frozen after this update.
## Timestamp fidelity, Hot continuity and outage preparation checkpoint — 2026-11-17
The previously running Runtime gate is superseded by `artifacts/grpc-data/timestamp-reviewed-runtime-grpc-green/results.trx`: **631/631 passed**, zero failures/skips. The causal SDK timestamp gate `sdk-source-timestamp-causal-green/results.trx` passed **7/7**. Its cases distinguish coalesced evidence using unique original source timestamps, reject ambiguous evidence when source timestamps are absent or not requested, prevent an older duplicate consuming newer evidence, and verify actual SDK recovery from an older snapshot under both healthy-notification timings. This focused evidence does not establish the complete Docker matrix.
Hot route continuity preserves an existing eligible Hot read route across known Primary/Secondary transitions while a changed eligibility epoch invalidates retained leases and metadata proofs, including missed Unknown/owner-replacement transitions. Host-effective Warm/None policy still drains imports even when the artifact says Hot; retained non-Hot metadata cannot revive after an intervening ineligible transition. `hot-route-continuity-final-green/results.trx` passed **100/100**, and `hot-continuity-host-final-green/results.trx` passed **93/93**, zero failures/skips. The preceding Host attempt `hot-continuity-host-green/results.trx` passed **92** and failed **one**: its withdrawal test expected only `InvalidOperationException`, while the revoked lease correctly observed cancellation. The precise async test now accepts cancellation only when that lease token is canceled, or the exact current-scope refusal; it still rejects reaching the network. The projection-validity/classifier gate `projection-validity-probe-classifier-green/results.trx` passed **11/11**.
The nine `test_*-warm-outage-final-green.log` suites all report OK, totaling **131 passes**: CLI gate 28, consumer-failover preparation 2, export-withdrawal fixtures 3, extended source outage 16, live-fault failure evidence 2, rig 45, scenarios 28, Warm secondary fixture 3 and Warm startup fixture 4. `adversarial-continuity-registry-green.log` separately passed **8**. D11's `test_control_outage_preparation-red.log` recorded **two intended failures**; replacement `test_control_outage_preparation-green.log` passed **2/2**, requiring authenticated browse in each realm while CONTROL is offline immediately before each mapped positive, and preventing a positive after rejected browse while restoring controls. These Python fixtures validate orchestration; they do not claim actual outage scenario success.
The ledger editor independently parsed all cited TRX counters, Python logs and `timestamp-failed-targets-results.json`. That previous-candidate actual report passed **D04: 417**, **D12: 173**, **D13: 217 assertions**, with restoration recorded. It failed **D06 after 188**, **D09 after 103**, **D10 after 137**, **D11 after 58** and **D14 after 204 assertions**. D06/D09 failed the production probe; D10 lacked the held post-fault recovery sentinel; D11 returned a non-Good read; D14 failed its wire process. These failures remain honest historical evidence and cannot be relabeled by focused green tests.
`hot-continuity-candidate-rebuild.log` now reports the rebuilt owned Hosts started, normal deployment completed and actual catalog readiness reached. The refreshed `p11-hot-continuity-adversarial.log` and `runs/grpc-data-local/adversarial-evidence/packet.json` record **102/102 passed theory-expanded rows across 89 exact methods and 12 obligations**, zero skipped/source gaps/unexpected results, with all eight discovery/test command exits zero; completed `2026-11-17T13:45:35.543286+00:00`. The ledger editor independently parsed this packet and log. This supersedes the prior 78-method pending status. Actual current-candidate scenario reruns remain pending; a live D10 observation is not a completed scenario result. The full 15-row actual matrix, all ten actual workloads, unfiltered 64-project suite and final integrated Astra approval remain outstanding. This bounded evidence update is frozen; it makes no new independent Astra approval claim.
@@ -0,0 +1,13 @@
# P11 fairness and recovery source checkpoint
Astra (`gpt-6-astra`, xhigh) approved this bounded source checkpoint on 2026-11-17. This is not P11 workload/phase approval or the final P12 implementation approval.
The reviewed repairs serialize snapshot Begin/value/End jobs, leave ordinary deltas independent, retain shared-source ownership across cadences, and preserve recovery obligations. A globally byte-bounded detached latest admitted sample allows quiet recovery without resetting its original age, timestamp, Serving or version. Cache replacement/invalidation/disposal release ownership. Separate local mapping identifiers retain separate publication routes while sharing compatible upstream cohorts.
Actual SDK recovery exposed two additional delivery defects. Complete replays now raise a value change event even when the installed value/status/timestamps are unchanged. To preserve an already queued healthy item, immutable original `SourceVersion` flows through the internal publisher boundary. Deduplication requires a complete replay, positive identical version, stable source identity, clock, full Serving, local route/generation, original receipt/age, status/timestamps and structural typed payload. The original healthy candidate and its charge/proof remain intact. Missing versions do not deduplicate; supplied nonpositive versions fail closed.
Astra independently parsed `20261117T025529.943019Z-1062c49155e0`: **91/91 passed**, zero failures/skips (Runtime71, SDK2, Host18). The full-graph wire packet `20261117T030417.795956Z-root-and-recovery-wire` passed **9/10**, including both quiet and held-healthy recovery cases; its sole failure is a separate UNS realm-root mount test outside this approval. That root resolution is being repaired and must pass separately. The actual healthy-item RED is `20261117T024848.279375Z-p11-healthy-evidence-red` (one passed, one failed with false BadUserAccessDenied).
The actual earlier SDK quiet recovery RED is `20261117T023617.141850Z-p11-composed-recovery-wire`: the sink accepted a complete current baseline but its monitored item received no event. Seven wire cases then passed after the change-mask repair (`20261117T024215.619014Z-p11-sdk-complete-mask-wire`). Earlier source-level REDs and accounting evidence remain in their artifact manifests; test-compilation failures are not counted as behavioral evidence.
Measured workloads, Docker/CLI final-candidate scenarios, final full-suite fixtures/results/skip inventory and the final integrated Astra review remain required. No universal tag/client/subscription capacity is asserted.
@@ -0,0 +1,833 @@
{
"schema_version": 1,
"description": "Required focused deterministic evidence BEFORE P11 timing; source selectors are obligations, never execution claims. Missing source, zero discovery, skipped/failed rows or candidate drift fail the packet.",
"obligations": [
{
"id": "authority-isolation",
"description": "Same origin remains isolated across pinned targets and principals; metadata overlap requires exact authority and provenance. Fixture negative-classification evidence is distinct from actual D06/D14 wire proof.",
"tests": [
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataMetadataRenewalCacheCapacityTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataMetadataRenewalCacheTests.Browse_refuses_cross_serving_replacement_of_a_healthy_or_different_placement"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataMetadataRenewalCacheCapacityTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataMetadataRenewalCacheTests.Browse_replaces_an_expired_identical_placement_but_refuses_a_third_charged_serving"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataMetadataRenewalCacheCapacityTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataMetadataRenewalCacheTests.Only_the_same_expired_overlap_can_add_a_recovery_pin_without_a_new_cache_entry"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataMetadataRenewalCacheCapacityTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataMetadataRenewalCacheTests.Invalid_recovery_pair_never_adds_a_pin_or_charge"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataMetadataRenewalCacheCapacityTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataMetadataRenewalCacheTests.Two_pinned_retired_proofs_cannot_admit_a_third_physical_entry"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataProjectedPageGenerationWireTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Reauthorizing_a_page_rejects_incompatible_or_retired_children_and_failed_authority"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataFixtureMutationRevisionTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataFixtureMutationRevisionTests.Key_only_preserves_narrow_mapping_placement_and_every_entity_field"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataFixtureMutationRevisionTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataFixtureMutationRevisionTests.Configuration_mutation_still_inherits_connection_placement_and_advances_revisions"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataFixtureMutationRevisionTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataFixtureMutationRevisionTests.Credential_only_actions_preserve_connection_mapping_and_export_revisions"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataFixtureMutationRevisionTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataFixtureMutationRevisionTests.Expiry_with_only_its_expiry_parameter_preserves_placement_revisions"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataFixtureMutationRevisionTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataFixtureMutationRevisionTests.Real_and_mixed_configuration_mutations_still_advance_every_selected_revision"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataFixtureMutationRevisionTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataFixtureMutationRevisionTests.Missing_or_unrecognized_key_action_never_classifies_as_credential_only"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataMetadataRenewalCacheTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataMetadataRenewalCacheTests.Overlap_is_one_charged_predecessor_and_never_extends_its_original_lease"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataMetadataRenewalCacheTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataMetadataRenewalCacheTests.Changed_authority_or_provenance_cannot_bridge_existing_evidence"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataMetadataRenewalContinuityWireTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Unknown_route_provenance_does_not_create_a_proactive_overlap"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataProbeFailureClassifierTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataProbeFailureClassifierTests.Exact_authenticated_target_ineligibility_is_distinct_from_unknown_failure"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataProbeFailureClassifierTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataProbeFailureClassifierTests.Transport_tls_rpc_backoff_and_unknown_messages_never_prove_target_ineligibility"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataProbeFailureClassifierTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataProbeFailureClassifierTests.Chains_are_limited_to_eight_frames_and_truncation_is_not_accepted_as_target_proof"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataProbeFailureClassifierTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataProbeFailureClassifierTests.Security_material_absence_and_unknown_phase_are_fixed_codes"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataProbeFailureClassifierTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataProbeFailureClassifierTests.Missing_read_on_exact_ready_pinned_primary_accepts_only_explicit_wrapped_permission_denied"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataProbeFailureClassifierTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataProbeFailureClassifierTests.Read_denial_rejects_transport_tls_target_backoff_wrong_rpc_and_incomplete_chains"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataProbeFailureClassifierTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataProbeFailureClassifierTests.Read_denial_requires_missing_negotiated_read_and_exact_source_primary_configuration"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataProbeFailureClassifierTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataProbeFailureClassifierTests.Wrapped_read_denial_cannot_pass_during_another_operation_phase"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataProbeFailureClassifierTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataProbeFailureClassifierTests.Retired_ca_accepts_known_rpc_status_only_with_exact_typed_transport_tls_chain"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataProbeFailureClassifierTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataProbeFailureClassifierTests.Retired_ca_rejects_generic_rpc_errors_wrong_phase_unknown_frames_and_truncation"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataWorkloadAccountingTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataWorkloadAccountingTests.Logical_sharing_counts_preserve_principal_and_pinned_target_boundaries"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataDemandSharingTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataDemandSharingTests.Ref_counts_are_shared_only_within_the_full_upstream_authority_key"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.IntegrationTests/GrpcDataSdkBrowseWireTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.IntegrationTests/ZB.MOM.WW.OtOpcUa.OpcUaServer.IntegrationTests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.OpcUaServer.IntegrationTests.GrpcDataSdkBrowseWireTests.Parent_browse_and_translate_enforce_each_anchor_grant_with_legacy_acl_disabled"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataProjectedStreamReconnectWireTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Subscribe_only_sdk_caller_renews_exact_node_without_browse_read_or_extra_subscription"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataDeployedWriteDeadlineTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Deployed_sdk_write_honors_default_and_explicit_short_connection_deadlines"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Host.Tests/DataConnections/GrpcDataBundleCommitObserverTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Host.Tests/ZB.MOM.WW.OtOpcUa.Host.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Host.Tests.DataConnections.GrpcDataBundleCommitObserverTests.Scope_only_observation_waits_for_pending_retirement_completion"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Host.Tests/DataConnections/GrpcDataBundleCommitObserverTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Host.Tests/ZB.MOM.WW.OtOpcUa.Host.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Host.Tests.DataConnections.GrpcDataBundleCommitObserverTests.Scope_observation_waits_for_interrupted_bundle_notice_and_import_retry"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Host.Tests/DataConnections/GrpcDataBundleCommitObserverTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Host.Tests/ZB.MOM.WW.OtOpcUa.Host.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Host.Tests.DataConnections.GrpcDataBundleCommitObserverTests.Observer_requires_both_committed_versions_and_never_reads_the_secret_payload"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Host.IntegrationTests/DataConnections/GrpcDataSampleFidelityTlsWireTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Host.IntegrationTests/ZB.MOM.WW.OtOpcUa.Host.IntegrationTests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Host.IntegrationTests.DataConnections.GrpcDataSampleFidelityTlsWireTests.Production_tls_read_preserves_one_controlled_samples_independent_timestamps_status_value_and_version"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataSdkSampleFidelityWireTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Sdk_mapped_read_preserves_one_controlled_samples_independent_timestamps_quality_value_and_version"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.IntegrationTests/GrpcDataSdkBrowseWireTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.IntegrationTests/ZB.MOM.WW.OtOpcUa.OpcUaServer.IntegrationTests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.OpcUaServer.IntegrationTests.GrpcDataSdkBrowseWireTests.BrowseNext_is_session_bound_and_rechecks_page_authority_before_each_child"
}
]
},
{
"id": "producer-array-reuse",
"description": "Immutable producer ownership copies single and batch mutable payloads before caller reuse.",
"tests": [
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataSampleOwnershipTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataSampleOwnershipTests.Single_callback_copies_bytes_before_the_producer_reuses_them"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataSampleOwnershipTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataSampleOwnershipTests.Batch_callback_copies_the_collection_and_each_mutable_array"
}
]
},
{
"id": "ingress-saturation",
"description": "Bounded ingress and unary write admission refuse before owned copy, preserve physical ownership until completion, enforce the original write deadline, and invalidate old Good source data on overflow.",
"tests": [
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataIngressOverflowTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataIngressOverflowTests.Admission_rejects_before_copy_and_synchronously_invalidates_previously_good_cache"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataIngressOverflowTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataIngressOverflowTests.Dirty_table_exhaustion_invalidates_partition_and_resets_existing_consumers"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataIngressOverflowTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataIngressOverflowTests.In_flight_copy_cannot_restore_readiness_after_an_overflow_fence"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataProjectedWriteAdmissionTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataProjectedAccessTests.Full_write_quota_rejects_large_array_without_encoding_and_restores_capacity_after_completion"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataProjectedWriteAdmissionTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataProjectedAccessTests.Oversized_array_is_rejected_without_encoding_or_dispatch"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataIngressMailboxAdmissionTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataIngressMailboxAdmissionTests.Loss_signal_during_value_current_validation_cannot_restore_old_good_sample"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataIngressMailboxAdmissionTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataIngressMailboxAdmissionTests.Overlapping_same_source_commit_fails_closed_before_newer_value_can_overtake"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataIngressMailboxAdmissionTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataIngressMailboxAdmissionTests.In_flight_commit_finishing_after_disposal_releases_transferred_sample_and_source_pin"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataIngressMailboxAdmissionTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataIngressMailboxAdmissionTests.Finite_control_backlog_cannot_starve_an_unrelated_admitted_value"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataIngressMailboxAdmissionTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataIngressMailboxAdmissionTests.Producer_commits_while_cache_gate_is_held_and_auto_drain_preserves_complete_observation"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataIngressMailboxRaceTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataIngressMailboxRaceTests.Queued_reserved_value_cannot_cross_a_later_source_fence"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataIngressMailboxRaceTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataIngressMailboxRaceTests.Mailbox_keeps_original_receipt_age_and_releases_owned_bytes"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataIngressMailboxRaceTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataIngressMailboxRaceTests.Late_commit_after_disposal_rejects_without_taking_payload_and_releases_charge_once"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataWriteAdmissionTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataWriteAdmissionTests.Slow_route_resolution_cannot_extend_the_original_write_deadline"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataWriteAdmissionTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataWriteAdmissionTests.Batch_preflight_time_counts_against_the_write_deadline"
}
]
},
{
"id": "revocation-during-encoding",
"description": "Revocation while the actual protobuf encoder is blocked fences body handoff and drains ownership charges.",
"tests": [
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataAdversarialRecoveryTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataAdversarialRecoveryTests.Revocation_while_protobuf_values_are_encoding_fences_handoff_and_drains_charges"
}
]
},
{
"id": "reconnect-storm-after-active-loss",
"description": "Concurrent clients reconnect after active loss, obtain fresh snapshots and drain old streams; retry backoff resets only after a proven healthy baseline.",
"tests": [
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataMetadataRenewalContinuityWireTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Accepted_bad_complete_baselines_do_not_reset_reconnect_backoff"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataMetadataRenewalRetryTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataProjectedAccessTests.Accepted_healthy_complete_baseline_resets_retry_backoff_for_each_new_outage"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Host.IntegrationTests/DataConnections/GrpcDataReconnectStormWireTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Host.IntegrationTests/ZB.MOM.WW.OtOpcUa.Host.IntegrationTests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Host.IntegrationTests.DataConnections.GrpcDataReconnectStormWireTests.Concurrent_reconnects_after_active_loss_get_new_snapshots_and_drain_old_streams"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataProjectedRetryJitterTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataProjectedAccessTests.Concurrent_cohort_retries_use_independently_sampled_delays"
}
]
},
{
"id": "source-readiness-invalidation",
"description": "Quiet steady interests and late serialized values cannot preserve readiness after invalidation; compatible metadata handoff preserves independently valid source and sample evidence, including SDK-normalized Bad values without borrowing another acquisition's proof.",
"tests": [
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataExpiredOverlapFailoverWireTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Expired_overlap_after_stream_loss_cannot_block_same_item_new_primary_recovery"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataExpiredOverlapFailoverWireTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Two_cadences_release_expired_overlap_without_borrowing_witnesses_during_failover"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataExpiredOverlapFailoverWireTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.New_primary_renews_same_monitored_item_after_a_prior_mapped_read"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataProjectedPageGenerationWireTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Key_only_generation_change_reauthorizes_the_whole_page_after_one_active_child_renews"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataSdkItemDiagnosticsTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Fixture_sdk_item_diagnostics_report_live_suppressed_and_retired_states"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataSdkItemDiagnosticsTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Fixture_sdk_item_diagnostics_bound_results_and_do_not_serialize_item_objects"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataSuppressedTombstoneWireTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Tombstoning_a_suppressed_projected_item_retires_health_and_demand_before_client_delete"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataMetadataRenewalContinuityWireTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Snapshot_request_during_held_renewal_remove_is_coalesced_without_a_second_remove"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataMetadataRenewalPredecessorWireTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Live_predecessor_cadence_publishes_ordinary_delta_after_peer_adopts_next_authority"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataSdkBadQualityEvidenceTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Bad_source_snapshot_retains_matching_evidence_at_the_sdk_notification_boundary"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataSdkBadQualityEvidenceTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Bad_null_sdk_notification_cannot_borrow_unproven_sample_evidence"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataSdkBadQualityEvidenceTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Single_bad_null_sample_without_source_timestamp_keeps_original_witness"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataMetadataRenewalContinuityWireTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Bad_source_quality_is_preserved_during_complete_metadata_handoff"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataMetadataRenewalContinuityWireTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Missing_successor_snapshot_cannot_be_replaced_by_a_later_ordinary_delta"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataMetadataRenewalPublisherTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataMetadataRenewalPublisherTests.Pre_admission_expired_predecessor_never_retires_a_proven_successor"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataMetadataRenewalPublisherTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataMetadataRenewalPublisherTests.Only_an_explicitly_retired_predecessor_may_be_dropped_without_retiring_the_live_route"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataMetadataRenewalContinuityWireTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Two_sdk_cadences_renew_before_expiry_without_reviving_old_notification_evidence"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataMetadataRenewalContinuityWireTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Cache_commit_followed_by_sdk_rejection_retries_with_the_actual_committed_proof"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataSdkSourceLossTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Failed_first_sdk_item_construction_removes_new_fanout_and_component_reference"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataSuppressedItemRecoveryWireTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Suppressed_sdk_item_receives_fresh_snapshot_after_held_metadata_renewal_without_another_revalidation"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataSdkSourceLossTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Disabled_sdk_item_does_not_keep_a_ghost_loss_control"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataSdkSourceLossTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Failed_sdk_item_construction_releases_candidate_and_fanout_ownership"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataSdkSourceLossTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Retiring_an_sdk_item_removes_its_health_entry_before_timer_or_demand_reuse"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataSdkSourceLossTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Throwing_current_authority_sanitizes_a_loss_notification"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataSdkSourceLossTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Partial_sdk_queue_drain_retains_a_pending_loss_control_once"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataSdkSourceLossTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Sdk_item_reports_source_loss_then_recovers_on_a_new_complete_baseline"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataSdkSourceLossTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Sdk_item_reports_stale_silent_source_without_closing_a_live_stream"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataSdkSourceLossTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Sdk_item_does_not_report_source_loss_while_an_exact_proven_peer_remains"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataSdkSourceLossTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Queued_sdk_loss_status_cannot_override_a_recovered_baseline"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataSdkSourceLossTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Replayed_sdk_loss_status_never_reveals_data_after_authority_is_suspended"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataSdkSourceLossTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Dequeued_old_loss_is_suppressed_when_a_new_baseline_wins_before_delivery"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataSnapshotTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataSnapshotTests.Steady_interest_detects_quiet_source_invalidation_after_snapshot_disposal"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataTransportPublicationTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataTransportPublicationTests.Late_transport_serialization_revalidates_source_without_a_catalog_change"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataFederatedBrowseTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataFederatedBrowseTests.Empty_complete_page_expires_with_its_authority_lease"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataStreamFreshnessWireTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Grpc_stream_snapshot_reaches_an_sdk_monitored_item_with_finite_age"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataStreamFreshnessWireTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Grpc_quiet_renewal_does_not_rejuvenate_expired_sample_and_new_version_recovers"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataStreamFreshnessWireTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Subscribe_only_export_delivers_fresh_sdk_value_while_read_is_denied"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataProjectedAccessTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataProjectedAccessTests.Decoder_observation_time_is_not_replaced_by_later_pump_time"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataProjectedStreamReconnectWireTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Existing_sdk_monitored_item_recovers_after_upstream_stream_ends"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataProjectedStreamReconnectWireTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Existing_sdk_monitored_item_renews_expired_metadata_without_another_client_browse"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataProjectedStreamReconnectWireTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Quiet_live_stream_renews_expired_metadata_without_client_browse_or_forced_close"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataProjectedStreamReconnectWireTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Existing_sdk_item_stays_denied_during_deployment_and_recovers_after_compatible_authority_returns"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataProjectedStreamReconnectWireTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Metadata_retry_recovers_after_cache_commit_loses_the_sdk_guard_race"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataFramedLifecycleWireTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Framed_grpc_new_primary_rebinds_same_subscribe_only_sdk_item_and_rejects_old_republish"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataFramedLifecycleWireTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Framed_grpc_pinned_sdk_item_never_substitutes_healthy_other_node_and_old_republish_is_denied"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataCrossCadenceProofWireTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Lost_cadence_retains_only_original_freshness_while_another_cadence_covers_the_source"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataDeployedFreshnessWireTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Deployed_framed_grpc_challenge_delivers_finite_age_to_sdk_monitored_item"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataDeployedFreshnessWireTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Deployed_framed_grpc_challenge_respects_batch_limit_and_scope_revocation"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataDeployedFreshnessWireTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Deployed_scope_does_not_advertise_challenges_for_unsupported_stream"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataSecondaryWriteBackoffTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataSecondaryWriteBackoffTests.Rejected_secondary_write_does_not_back_off_immediate_replica_read"
}
]
},
{
"id": "catch-up-memory",
"description": "Snapshot catch-up overflow resets explicitly; cancellation, steady transition and global admission release and bound retained payload.",
"tests": [
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataSnapshotTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataSnapshotTests.Catch_up_overflow_resets_snapshot_instead_of_silently_losing_deltas"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataSnapshotTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataSnapshotTests.Cancellation_and_deadline_actively_release_all_snapshot_resources"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataSnapshotTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataSnapshotTests.Snapshot_admission_is_global_and_rejects_before_retaining_more_payload"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataWorkloadAccountingTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataWorkloadAccountingTests.Snapshot_disposal_releases_snapshot_charge_while_steady_interest_remains_owned"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/VirtualTags/GrpcDataProjectedMuxLifetimeTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.VirtualTags.GrpcDataProjectedMuxLifetimeTests.Unregister_then_terminate_releases_delivered_quota_and_allows_new_subscriber"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataFreshnessHistoryTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataFreshnessHistoryTests.More_than_1024_challenges_release_history_and_reused_sequences_are_rejected"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataFederatedBrowseTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataFederatedBrowseTests.Exact_renewal_allows_one_pinned_predecessor_for_a_one_node_mapping"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataProjectedReconnectLifetimeTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataProjectedAccessTests.Pending_second_open_cannot_preserve_or_revive_the_last_proven_source_era"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataProjectedReconnectLifetimeTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataProjectedAccessTests.Removing_last_source_handle_closes_its_coverage_even_when_cohort_has_another_source"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataProjectedReconnectLifetimeTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataProjectedAccessTests.New_cadence_accepts_equal_version_baseline_when_cached_evidence_has_expired"
}
]
},
{
"id": "concurrent-browse",
"description": "Concurrent identical browse waiters share bounded origin work and cancelled work remains charged until physical completion.",
"tests": [
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataFederatedBrowseTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataFederatedBrowseTests.Concurrent_identical_browse_waiters_share_one_bounded_origin_fetch"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataFederatedBrowseTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataFederatedBrowseTests.Cancelled_queued_fetches_remain_bounded_until_physical_work_finishes"
}
]
},
{
"id": "quiet-hot-fairness",
"description": "Hot source traversal and a hot writer cannot strand other work or principals.",
"tests": [
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataDeliveryFairnessTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataDeliveryFairnessTests.Changing_hot_source_during_traversal_does_not_restart_or_starve_other_work"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataDeliveryFairnessTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataDeliveryFairnessTests.A_waiting_principal_gets_the_next_physical_writer_slot_before_a_hot_stream_reacquires_it"
}
]
},
{
"id": "stalled-writer-snapshot",
"description": "Frozen snapshots and unary freshness retain original monotonic evidence across delays; missing renewal snapshot completion expires its old attempt, and ignored cancellation retains physical capacity until completion.",
"tests": [
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataMetadataRenewalContinuityWireTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Acknowledged_renewal_without_snapshot_end_expires_and_releases_its_old_attempt"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataMetadataRenewalContinuityWireTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Ignored_metadata_cancellation_keeps_physical_quota_until_the_rpc_actually_finishes"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataSdkRenewalEvidenceTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Same_acquisition_successor_refreshes_only_health_evidence_not_queued_or_republished_proof"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataSdkTimestampEvidenceTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Sdk_older_duplicate_cannot_consume_newer_timestamp_evidence"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataSdkTimestampEvidenceTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Sdk_uses_unique_source_timestamp_to_select_coalesced_value_evidence"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataSdkTimestampEvidenceTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Sdk_rejects_ambiguous_evidence_when_source_timestamp_was_not_requested"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataSdkTimestampEvidenceTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Sdk_rejects_ambiguous_evidence_when_origin_source_timestamps_are_absent"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataComposedBrowseWireTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Actual_sdk_monitored_item_recovers_from_an_older_snapshot_using_the_quiet_current_cadence"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataStreamOrderingTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataStreamOrderingTests.Snapshot_larger_than_queue_finishes_frozen_values_before_a_racing_delta"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataStreamOrderingTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataStreamOrderingTests.A_write_ignoring_cancellation_retains_frame_and_capacity_until_its_actual_completion"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataProjectedAccessTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataProjectedAccessTests.Snapshot_waiting_for_end_cannot_publish_after_its_freshness_expires"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataFreshnessChallengeTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataFreshnessChallengeTests.Challenge_does_not_relabel_a_value_whose_age_was_already_captured"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataFreshnessChallengeTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataFreshnessChallengeTests.Revoked_authority_cannot_obtain_a_challenge_snapshot"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataFreshnessBatchWireTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConfiguredDiscoveryWireTests.Multi_batch_challenge_preserves_versions_and_serializes_overlapping_snapshots"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataProjectedReconnectLifetimeTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataProjectedAccessTests.Reconnect_waits_for_uncancellable_physical_dispose_and_cancelled_demand_never_reopens"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataProjectedReconnectLifetimeTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataProjectedAccessTests.Revoked_mapping_during_retry_does_not_reopen_or_revive_old_evidence"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataProjectedReadFreshnessTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataProjectedAccessTests.Delayed_unary_result_cannot_reanchor_an_expired_sample"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataProjectedReadFreshnessTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataProjectedAccessTests.Unstamped_unary_result_uses_conservative_pre_call_anchor"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataConnectionClientTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataConnectionClientTests.Unary_read_carries_its_local_age_observation_but_never_serializes_it"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataStreamOrderingTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataStreamOrderingTests.Dirty_aliases_wait_when_snapshot_controls_leave_only_two_outbound_slots"
}
]
},
{
"id": "legacy-physical-sharing",
"description": "The real DriverHost merges legacy and grpc reference sets, and accounting remains charged through physical apply/removal acknowledgements.",
"tests": [
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/Drivers/GrpcDataDriverHostDemandTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.Drivers.GrpcDataDriverHostDemandTests.Real_host_merges_legacy_refs_then_restores_them_after_last_grpc_interest"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataWorkloadAccountingTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataWorkloadAccountingTests.Applied_physical_count_waits_for_ack_and_remains_until_cleanup_ack"
}
]
},
{
"id": "consumer-role-continuity",
"description": "Only continuously eligible Hot roles retain routes; detached metadata proofs survive borrower release but never revive after role or owner loss, and Hot proof reads remain valid during unrelated dispatch-fence contention.",
"tests": [
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Host.Tests/DataConnections/GrpcDataRuntimeRegistrationTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Host.Tests/ZB.MOM.WW.OtOpcUa.Host.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Host.Tests.DataConnections.GrpcDataRuntimeRegistrationTests.Healthy_origin_catalog_stays_ready_while_another_thread_holds_the_dispatch_fence"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataHotRouteContinuityTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataHotRouteContinuityTests.Hot_eligible_role_transitions_preserve_the_existing_route_but_epoch_aba_invalidates_it"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataHotRouteContinuityTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataHotRouteContinuityTests.Host_effective_non_hot_mode_drains_even_when_artifact_is_hot"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataHotRouteContinuityTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataHotRouteContinuityTests.Retained_metadata_guard_survives_borrower_disposal_but_not_unobserved_epoch_loss"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataHotRouteContinuityTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataHotRouteContinuityTests.Non_hot_retained_metadata_does_not_revive_after_missed_ineligible_transition"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataHotRouteContinuityTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataHotRouteContinuityTests.Read_epoch_is_stable_between_known_roles_and_changes_on_unknown_and_owner_replacement"
},
{
"source": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataHotRouteContinuityTests.cs",
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"selector": "ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections.GrpcDataHotRouteContinuityTests.Hot_retained_guard_reads_role_without_waiting_for_dispatch_fence"
}
]
}
]
}
@@ -0,0 +1,240 @@
#!/usr/bin/env python3
"""Run only the exact deterministic selectors required before P11 measurement.
A registry entry declares an obligation, not a pass. Missing source/selection,
failed or skipped theory rows, stale inputs and altered TRX all fail closed.
This runner never runs a solution command or starts Docker/fixtures.
"""
import argparse
from datetime import datetime, timezone
import hashlib
import importlib.util
import json
import os
from pathlib import Path
import re
import subprocess
import sys
import time
import xml.etree.ElementTree as ET
HERE = Path(__file__).resolve().parent
ROOT = HERE.parents[2]
REGISTRY = HERE / 'p11-adversarial-evidence.json'
REQUIRED = {'authority-isolation', 'producer-array-reuse', 'ingress-saturation', 'revocation-during-encoding',
'reconnect-storm-after-active-loss', 'source-readiness-invalidation', 'catch-up-memory', 'concurrent-browse',
'quiet-hot-fairness', 'stalled-writer-snapshot', 'legacy-physical-sharing', 'consumer-role-continuity'}
spec = importlib.util.spec_from_file_location('p11_unit_environment', HERE / 'run-unit-phase.py')
phase = importlib.util.module_from_spec(spec)
spec.loader.exec_module(phase)
class AdversarialError(RuntimeError):
pass
def digest(path):
return hashlib.sha256(Path(path).read_bytes()).hexdigest()
def private_json(path, value):
fd = os.open(path, os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o600)
with os.fdopen(fd, 'w') as stream:
json.dump(value, stream, indent=2)
stream.write('\n')
def registry(path=REGISTRY, root=ROOT):
document = json.loads(Path(path).read_text())
rows = document.get('obligations')
if document.get('schema_version') != 1 or not isinstance(rows, list) or len(rows) != len(REQUIRED) or {row.get('id') for row in rows} != REQUIRED:
raise AdversarialError('every required adversarial obligation must be registered exactly once')
for row in rows:
if not isinstance(row.get('description'), str) or not row['description'] or not isinstance(row.get('tests'), list) or not row['tests']:
raise AdversarialError('each obligation needs exact test selectors and a description')
for case in row['tests']:
if set(case) != {'source', 'project', 'selector'} or not re.fullmatch(r'[A-Za-z_]\w*(?:\.[A-Za-z_]\w*){2,}', case['selector']):
raise AdversarialError('only exact fully qualified method selectors are permitted')
for name, suffix in (('source', '.cs'), ('project', '.csproj')):
relative = Path(case[name])
if relative.is_absolute() or '..' in relative.parts or not case[name].startswith('tests/') or relative.suffix != suffix:
raise AdversarialError('test inputs must be exact repository-relative source/project paths')
return document
def source_gaps(document, root=ROOT):
missing = []
for obligation in document['obligations']:
for case in obligation['tests']:
source, project = root / case['source'], root / case['project']
cls, method = case['selector'].rsplit('.', 2)[-2:]
if not source.is_file() or not project.is_file() or not re.search(r'\bclass\s+' + re.escape(cls) + r'\b', source.read_text()) or not re.search(r'\b' + re.escape(method) + r'\s*\(', source.read_text()):
missing.append({'obligation': obligation['id'], **case, 'reason': 'required exact test source/project/method is absent'})
return missing
def input_identity(root=ROOT):
result = subprocess.run(['git', 'ls-files', '--cached', '--others', '--exclude-standard', '-z'], cwd=root, capture_output=True, check=True)
names = sorted(set(filter(None, result.stdout.decode().split('\0'))))
files = {}
for name in names:
path = root / name
included = name.startswith(('src/', 'tests/')) or name.startswith('scripts/validation/grpc-data/') or name == 'scripts/ci/ci.runsettings' or '/' not in name and path.suffix in {'.json', '.props', '.targets', '.rsp', '.slnx', '.config'}
if included and path.is_file() and not path.is_symlink() and path.suffix in {'.cs', '.csproj', '.props', '.targets', '.rsp', '.slnx', '.json', '.config', '.runsettings', '.py', '.sh', '.proto', '.razor', '.css', '.js', '.resx'}:
files[name] = digest(path)
if not files:
raise AdversarialError('candidate input inventory is empty')
combined = hashlib.sha256(json.dumps(files, sort_keys=True, separators=(',', ':')).encode()).hexdigest()
import rig
return {'input_sha256': combined, 'files': files, 'runtime_source_tree_hash': rig.source_tree_hash()}
def selector_filter(cases):
return '|'.join('FullyQualifiedName=' + selector for selector in sorted({case['selector'] for case in cases}))
def commands(project, cases, directory):
base = ['dotnet', 'test', project, '-c', 'Release', '-m:1', '-p:TestTfmsInParallel=false', '--settings', 'scripts/ci/ci.runsettings', '--filter', selector_filter(cases)]
return base + ['--list-tests'], base + ['--no-build', '--logger', 'trx', '--results-directory', str(directory)]
def result_rows(directory):
rows = []
directory = Path(directory)
for path in ([directory] if directory.is_file() else sorted(directory.rglob('*.trx'))):
tree = ET.parse(path).getroot()
methods = {}
for definition in tree.findall('.//{*}UnitTest'):
method = definition.find('{*}TestMethod')
if method is not None:
methods[definition.get('id')] = method.get('className', '').split(',')[0] + '.' + method.get('name', '')
for result in tree.findall('{*}Results/{*}UnitTestResult'):
selector = methods.get(result.get('testId'))
if not selector or selector.endswith('.'):
raise AdversarialError('TRX row has no exact method identity')
message = result.find('.//{*}Message')
rows.append({'selector': selector, 'test': result.get('testName') or selector, 'outcome': result.get('outcome'),
'reason': message.text if message is not None else None, 'trx': str(path.resolve()), 'trx_sha256': digest(path)})
return rows
def reconcile(document, discovered, rows, root=ROOT):
obligations = []
required_selectors = {case['selector'] for item in document['obligations'] for case in item['tests']}
unexpected = [row for row in rows if row['selector'] not in required_selectors]
for item in document['obligations']:
evidence = []
for case in item['tests']:
selected = [row for row in rows if row['selector'] == case['selector']]
names = discovered.get(case['selector'], [])
# Discovery owns concrete theory names; all discovered rows must run.
passed = bool(names) and len(selected) == len(names) and {row['test'] for row in selected} == set(names) and all(row['outcome'] == 'Passed' for row in selected)
evidence.append({**case, 'source_sha256': digest(root / case['source']) if (root / case['source']).is_file() else None,
'discovered': names, 'result_count': len(selected), 'results': selected, 'passed': passed})
obligations.append({'id': item['id'], 'description': item['description'], 'tests': evidence, 'passed': all(case['passed'] for case in evidence)})
gaps = source_gaps(document, root)
return {'obligations': obligations, 'source_gaps': gaps, 'unexpected_results': unexpected,
'executed': sum(row['outcome'] != 'NotExecuted' for row in rows), 'skipped': sum(row['outcome'] == 'NotExecuted' for row in rows),
'passed': not gaps and not unexpected and all(item['passed'] for item in obligations)}
def checked_packet(path, registry_path=REGISTRY):
"""Independently re-read current inputs and TRXs; never trust a passed bit."""
path = Path(path).resolve()
if not path.is_file() or path.is_symlink() or os.name != 'nt' and path.stat().st_mode & 0o077:
raise AdversarialError('restricted passing adversarial packet is required before performance sampling')
packet = json.loads(path.read_text())
document = registry(registry_path)
if packet.get('schema_version') != 1 or packet.get('passed') is not True or packet.get('registry_sha256') != digest(registry_path) or packet.get('identity') != input_identity():
raise AdversarialError('adversarial packet is incomplete or belongs to another candidate')
discovered = packet.get('discovery')
selectors = {case['selector'] for item in document['obligations'] for case in item['tests']}
if not isinstance(discovered, dict) or set(discovered) != selectors or any(not isinstance(names, list) or not names or len(set(names)) != len(names) or any(name.split('(', 1)[0] != selector for name in names) for selector, names in discovered.items()):
raise AdversarialError('adversarial packet discovery is missing')
projects = {case['project'] for item in document['obligations'] for case in item['tests']}
expected_exits = {str(index) + '-' + label for index in range(len(projects)) for label in ('discovery', 'test')}
exits = packet.get('command_exit_codes')
if not isinstance(exits, dict) or set(exits) != expected_exits or any(type(value) is not int or value != 0 for value in exits.values()):
raise AdversarialError('adversarial packet command completion evidence is missing or failed')
rows = []
files = packet.get('trx_files')
if not isinstance(files, dict) or not files:
raise AdversarialError('adversarial packet needs actual TRX evidence')
for name, sha in files.items():
trx = Path(name)
if not trx.is_absolute() or not trx.resolve().is_relative_to(path.parent) or trx.is_symlink() or not trx.is_file() or digest(trx) != sha:
raise AdversarialError('adversarial TRX is missing, changed or outside the packet')
rows.extend(result_rows(trx))
# A new result beside frozen files is not silently omitted from reconciliation.
if {str(trx.resolve()) for trx in path.parent.rglob('*.trx')} != set(files):
raise AdversarialError('adversarial TRX inventory changed')
actual_files = {row['trx']: row['trx_sha256'] for row in rows}
if actual_files != files:
raise AdversarialError('adversarial TRX inventory changed')
report = reconcile(document, discovered, rows)
if not report['passed'] or report['executed'] < 1 or report['skipped'] or any(packet.get('command_exit_codes', {}).values()):
raise AdversarialError('required adversarial cases did not all execute and pass')
return {'path': str(path), 'sha256': digest(path), 'input_sha256': packet['identity']['input_sha256'],
'runtime_source_tree_hash': packet['identity']['runtime_source_tree_hash'], 'executed': report['executed'],
'obligations': [row['id'] for row in report['obligations']], 'passed': True}
def run(run_id, registry_path=REGISTRY):
import rig
from processes import run_process
if not rig._RUN_PATTERN.fullmatch(run_id):
raise AdversarialError('safe unique run id required')
os.umask(0o077)
directory = ROOT / 'artifacts/grpc-data/runs' / run_id / 'adversarial-evidence'
directory.mkdir(parents=True, mode=0o700, exist_ok=False)
document = registry(registry_path)
identity = input_identity()
grouped = {}
for item in document['obligations']:
for case in item['tests']:
if not any(gap['selector'] == case['selector'] for gap in source_gaps(document)):
grouped.setdefault(case['project'], {})[case['selector']] = case
discovered = {}; rows = []; exits = {}
started = time.monotonic()
for index, (project, cases) in enumerate(sorted(grouped.items())):
target = directory / str(index); target.mkdir(mode=0o700)
discover, execute = commands(project, cases.values(), target / 'trx')
for label, command in (('discovery', discover), ('test', execute)):
private_json(target / (label + '.command.json'), command)
result = run_process(command, timeout=1800, cwd=ROOT, environment=phase.unit_environment(), max_output_bytes=32 * 1024 * 1024)
for suffix, value in (('stdout', result.stdout), ('stderr', result.stderr)):
fd = os.open(target / (label + '.' + suffix + '.log'), os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o600)
with os.fdopen(fd, 'w') as stream: stream.write(value)
exits[str(index) + '-' + label] = result.returncode or int(result.timed_out or result.truncated)
if label == 'discovery':
names = phase.discover_names(result.stdout)
for selector in cases:
discovered[selector] = [name for name in names if name.split('(', 1)[0] == selector]
if exits[str(index) + '-' + label] or any(not discovered[name] for name in cases):
break
rows.extend(result_rows(target / 'trx'))
report = reconcile(document, discovered, rows)
report.update(schema_version=1, run_id=run_id, identity=identity, registry_sha256=digest(registry_path),
discovery=discovered, command_exit_codes=exits, duration_seconds=time.monotonic() - started,
completed_at_utc=datetime.now(timezone.utc).isoformat(), trx_files={row['trx']: row['trx_sha256'] for row in rows})
report['passed'] = report['passed'] and not any(exits.values()) and identity == input_identity()
private_json(directory / 'packet.json', report)
return directory / 'packet.json', report
def main(argv=None):
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('--run-id', required=True)
parser.add_argument('--registry', type=Path, default=REGISTRY)
args = parser.parse_args(argv)
try:
path, report = run(args.run_id, args.registry)
print(json.dumps({'packet': str(path), 'passed': report['passed'], 'executed': report['executed'], 'missing_source': len(report['source_gaps'])}))
return 0 if report['passed'] else 1
except Exception as error:
print('P11 adversarial gate failed: ' + type(error).__name__ + '; inspect restricted evidence', file=sys.stderr)
return 2
if __name__ == '__main__':
raise SystemExit(main())
@@ -0,0 +1,134 @@
import copy
import importlib.util
import json
import os
from pathlib import Path
import sys
import tempfile
import unittest
from unittest.mock import patch
HERE = Path(__file__).resolve().parents[1]
sys.path.insert(0, str(HERE))
spec = importlib.util.spec_from_file_location('p11_adversarial_tests', HERE / 'run-p11-adversarial.py')
gate = importlib.util.module_from_spec(spec)
spec.loader.exec_module(gate)
class P11AdversarialTests(unittest.TestCase):
def fixture(self, root):
project = 'tests/Example/Example.Tests.csproj'
source = 'tests/Example/Cases.cs'
(root / source).parent.mkdir(parents=True)
(root / source).write_text('namespace Example; class Cases { public void Case() {} }')
(root / project).write_text('<Project/>')
case = {'source': source, 'project': project, 'selector': 'Example.Cases.Case'}
return {'schema_version': 1, 'obligations': [{'id': 'test-obligation', 'description': 'Actual deterministic assertion', 'tests': [case]}]}
def trx(self, root, outcome='Passed', name='Example.Cases.Case', suffix=''):
path = root / ('results' + suffix + '.trx')
path.write_text(f'<TestRun><TestDefinitions><UnitTest id="1"><TestMethod className="Example.Cases" name="Case"/></UnitTest></TestDefinitions><Results><UnitTestResult testId="1" testName="{name}" outcome="{outcome}"><Output><ErrorInfo><Message>reason</Message></ErrorInfo></Output></UnitTestResult></Results></TestRun>')
return path
def test_registry_covers_every_obligation_with_exact_methods_and_source_paths(self):
document = gate.registry()
self.assertEqual(gate.REQUIRED, {row['id'] for row in document['obligations']})
for obligation in document['obligations']:
self.assertTrue(obligation['tests'])
for case in obligation['tests']:
self.assertNotIn('~', case['selector'])
self.assertTrue(case['project'].endswith('.csproj'))
def test_only_exact_selected_projects_methods_are_executed(self):
cases = [{'selector': 'Example.Cases.First'}, {'selector': 'Example.Cases.Second'}]
discovery, execute = gate.commands('tests/Example/Example.Tests.csproj', cases, '/private/trx')
self.assertEqual(execute[:3], ['dotnet', 'test', 'tests/Example/Example.Tests.csproj'])
expression = execute[execute.index('--filter') + 1]
self.assertEqual(expression, 'FullyQualifiedName=Example.Cases.First|FullyQualifiedName=Example.Cases.Second')
self.assertNotIn('Category', expression)
self.assertNotIn('--no-build', discovery)
self.assertIn('--no-build', execute)
def test_consumer_role_continuity_registers_all_exact_methods(self):
obligation = next(row for row in gate.registry()['obligations'] if row['id'] == 'consumer-role-continuity')
methods = {case['selector'].rsplit('.', 1)[-1] for case in obligation['tests']}
self.assertEqual(methods, {
'Hot_eligible_role_transitions_preserve_the_existing_route_but_epoch_aba_invalidates_it',
'Host_effective_non_hot_mode_drains_even_when_artifact_is_hot',
'Retained_metadata_guard_survives_borrower_disposal_but_not_unobserved_epoch_loss',
'Non_hot_retained_metadata_does_not_revive_after_missed_ineligible_transition',
'Read_epoch_is_stable_between_known_roles_and_changes_on_unknown_and_owner_replacement',
'Hot_retained_guard_reads_role_without_waiting_for_dispatch_fence',
'Healthy_origin_catalog_stays_ready_while_another_thread_holds_the_dispatch_fence',
})
def test_actual_passes_need_nonzero_discovery_and_all_theory_rows(self):
with tempfile.TemporaryDirectory() as folder:
root = Path(folder); document = self.fixture(root)
self.trx(root, name='Example.Cases.Case(value: 1)')
rows = gate.result_rows(root)
discovery = {'Example.Cases.Case': ['Example.Cases.Case(value: 1)']}
self.assertTrue(gate.reconcile(document, discovery, rows, root)['passed'])
discovery['Example.Cases.Case'].append('Example.Cases.Case(value: 2)')
self.assertFalse(gate.reconcile(document, discovery, rows, root)['passed'])
self.assertFalse(gate.reconcile(document, {}, rows, root)['passed'])
self.assertFalse(gate.reconcile(document, discovery, [], root)['passed'])
def test_skipped_failed_and_missing_source_never_become_synthetic_passes(self):
for outcome in ('NotExecuted', 'Failed', 'Inconclusive'):
with self.subTest(outcome=outcome), tempfile.TemporaryDirectory() as folder:
root = Path(folder); document = self.fixture(root); self.trx(root, outcome)
report = gate.reconcile(document, {'Example.Cases.Case': ['Example.Cases.Case']}, gate.result_rows(root), root)
self.assertFalse(report['passed'])
with tempfile.TemporaryDirectory() as folder:
root = Path(folder); document = self.fixture(root); self.trx(root)
(root / document['obligations'][0]['tests'][0]['source']).unlink()
report = gate.reconcile(document, {'Example.Cases.Case': ['Example.Cases.Case']}, gate.result_rows(root), root)
self.assertFalse(report['passed'])
self.assertEqual(len(report['source_gaps']), 1)
def test_unexpected_method_is_a_failure(self):
with tempfile.TemporaryDirectory() as folder:
root = Path(folder); document = self.fixture(root); self.trx(root)
rows = gate.result_rows(root)
rows.append({**rows[0], 'selector': 'Example.Cases.Other'})
self.assertFalse(gate.reconcile(document, {'Example.Cases.Case': ['Example.Cases.Case']}, rows, root)['passed'])
def test_packet_rechecks_real_trx_hash_and_candidate_not_just_passed_bit(self):
with tempfile.TemporaryDirectory() as folder:
root = Path(folder); document = self.fixture(root); trx = self.trx(root)
registry = root / 'registry.json'; registry.write_text(json.dumps(document))
packet = root / 'packet.json'
identity = {'input_sha256': 'same-candidate', 'runtime_source_tree_hash': 'runtime', 'files': {}}
payload = {'schema_version': 1, 'passed': True, 'registry_sha256': gate.digest(registry), 'identity': identity,
'discovery': {'Example.Cases.Case': ['Example.Cases.Case']}, 'command_exit_codes': {'0-discovery': 0, '0-test': 0},
'trx_files': {str(trx.resolve()): gate.digest(trx)}}
gate.private_json(packet, payload)
real_reconcile = gate.reconcile
with patch.object(gate, 'registry', return_value=document), patch.object(gate, 'input_identity', return_value=identity), patch.object(gate, 'reconcile', side_effect=lambda d, n, r: real_reconcile(d, n, r, root)):
self.assertTrue(gate.checked_packet(packet, registry)['passed'])
self.trx(root, 'NotExecuted')
with self.assertRaises(gate.AdversarialError): gate.checked_packet(packet, registry)
payload['trx_files'][str(trx.resolve())] = gate.digest(trx)
packet.write_text(json.dumps(payload))
with self.assertRaises(gate.AdversarialError): gate.checked_packet(packet, registry)
self.trx(root)
payload['trx_files'][str(trx.resolve())] = gate.digest(trx)
payload['identity'] = {'input_sha256': 'old-candidate'}
packet.write_text(json.dumps(payload))
with self.assertRaises(gate.AdversarialError): gate.checked_packet(packet, registry)
def test_invalid_registry_patterns_or_missing_obligations_fail(self):
document = gate.registry()
with tempfile.TemporaryDirectory() as folder:
path = Path(folder) / 'registry.json'
for mutate in ('pattern', 'missing'):
modified = copy.deepcopy(document)
if mutate == 'pattern': modified['obligations'][0]['tests'][0]['selector'] += '*'
else: modified['obligations'].pop()
path.write_text(json.dumps(modified))
with self.assertRaises(gate.AdversarialError): gate.registry(path)
if __name__ == '__main__':
unittest.main()
@@ -0,0 +1,361 @@
import copy
from contextlib import contextmanager, nullcontext
import importlib.util
import json
from pathlib import Path
import sys
import tempfile
from types import SimpleNamespace
import unittest
from unittest.mock import Mock, call, patch
HERE = Path(__file__).resolve().parents[1]
sys.path.insert(0, str(HERE))
import workload
class WorkloadResultsTests(unittest.TestCase):
def setUp(self):
self.document = json.loads((HERE / 'workload-profiles.json').read_text())
self.profile = copy.deepcopy(self.document['profiles'][0])
def observations(self):
process = {'workingSet64': 100, 'managedBytes': 80, 'totalProcessorMilliseconds': 10}
diagnostics = {'connectionId': 'consumer-source', 'revision': 1, 'scopeVersion': 1, 'artifactRevision': 'fixture', 'accountingInstanceId': 'owner-one',
'compactFrameCount': 0, 'fallbackFrameCount': 0, 'serializedValueFrameBytes': 0}
return {'profile': workload.probe_options(self.profile, {'raw': 'modbus/plc/scalar', 'uns': 'area/line/plc/scalar'}),
'elapsedSeconds': 2,
'clients': [{'client': 0, 'failure': None, 'acknowledged': 1, 'snapshots': 1, 'rejected': 0, 'unreadySamples': 0, 'controls': {'SnapshotEnd': 1},
'items': [{'id': 'r0', 'sourceId': 'scalar', 'realm': 'Raw', 'samples': 3, 'typedValueBytes': 24, 'changesAfterMidpoint': 1, 'hotTailMilliseconds': 100,
'firstSnapshotMilliseconds': 100, 'requireChanges': True, 'changes': 2}]}],
'processBefore': process, 'processAfter': {**process, 'totalProcessorMilliseconds': 110},
'diagnosticsBefore': {'connections': [diagnostics]},
'diagnosticsAfter': {'connections': [{**diagnostics, 'compactFrameCount': 2, 'serializedValueFrameBytes': 100}]},
'bytesDefinition': 'typed value protobuf only'}
def summarize(self, observation=None):
return workload.summarize_measurement(observation or self.observations(), self.profile,
{'read_total': 12}, {'read_total': 22}, 2)
def test_catalog_has_real_smoke_steady_fanout_recovery_and_payload_profiles(self):
workload.validate_profiles(self.document)
self.assertEqual({'smoke', 'steady', 'fan-out', 'recovery'}, {row['group'] for row in self.document['profiles']})
typed = next(row for row in self.document['profiles'] if row['id'] == 'typed-payloads')
options = workload.probe_options(typed, {'raw': 'modbus/plc/scalar', 'uns': 'area/line/plc/scalar'})
self.assertEqual([('UInt16', -1), ('Array', 1), ('String', -1)], [(item['expectedKind'], item['expectedRank']) for item in options['sources']])
self.assertEqual('modbus/plc/vector', options['sources'][1]['rawPath'])
def test_measures_actual_acks_counters_and_elapsed_time(self):
measured = self.summarize()
self.assertEqual(1, measured['acknowledged_registrations'])
self.assertEqual(1.5, measured['delivered_samples_per_second'])
self.assertEqual(8, measured['typed_value_bytes_per_sample'])
self.assertEqual(5, measured['device_read_requests_per_second'])
self.assertAlmostEqual(.05, measured['caller_process_cpu_core_equivalents'])
self.assertEqual(2, measured['compact_value_frames'])
self.assertEqual(100 / 3, measured['serialized_value_frame_bytes_per_sample'])
self.assertNotIn('capacity', measured)
self.assertIn('not inferred', measured['leak_verdict'])
def test_missing_or_null_accounting_does_not_mean_zero(self):
valid = [{'activeStreams': 0, 'activeCalls': 0, 'registrationCount': 0}]
self.assertTrue(workload.connections_drained(valid))
for rows in (None, [], [{}], [{**valid[0], 'registrationCount': None}], [{**valid[0], 'activeCalls': 1}]):
with self.subTest(rows=rows):
self.assertFalse(workload.connections_drained(rows))
def test_refuses_inferred_admission_missing_snapshot_or_hot_starvation(self):
for field, value in [('acknowledged', 0), ('snapshots', 0), ('rejected', 1), ('unreadySamples', 1), ('failure', 'Unavailable')]:
observed = self.observations()
observed['clients'][0][field] = value
with self.subTest(field=field), self.assertRaises(workload.WorkloadError):
self.summarize(observed)
observed = self.observations()
observed['clients'][0]['items'][0]['changes'] = 0
with self.assertRaises(workload.WorkloadError):
self.summarize(observed)
def test_rejects_wrong_measured_configuration_and_missing_memory(self):
observed = self.observations()
observed['profile']['clients'] = 2
with self.assertRaises(workload.WorkloadError):
self.summarize(observed)
observed = self.observations()
observed['processAfter']['workingSet64'] = None
with self.assertRaises(workload.WorkloadError):
self.summarize(observed)
def test_rejects_fake_unbounded_or_ambiguous_dimensions(self):
for field, value in [('clients', True), ('clients', 65), ('source_hz', float('nan')),
('sources', ['not-a-fixture-source']), ('workers', 10), ('slow_clients', 2),
('hub_partitions', True), ('hub_partitions', 17), ('compact_batches', 1)]:
document = copy.deepcopy(self.document)
document['profiles'][0][field] = value
with self.subTest(field=field), self.assertRaises(workload.WorkloadError):
workload.validate_profiles(document)
def test_rejects_duplicate_profile_ids_and_instantaneous_settle(self):
document = copy.deepcopy(self.document)
document['profiles'][1]['id'] = document['profiles'][0]['id']
with self.assertRaises(workload.WorkloadError):
workload.validate_profiles(document)
document = copy.deepcopy(self.document)
document['accounting']['consecutive_drained_observations'] = 1
with self.assertRaises(workload.WorkloadError):
workload.validate_profiles(document)
def test_counter_reset_cannot_be_a_rate(self):
observed = self.observations()
observed['processAfter']['totalProcessorMilliseconds'] = 0
with self.assertRaises(workload.WorkloadError):
self.summarize(observed)
def test_actual_origin_counts_remain_separate_and_cleanup_requires_all_owners(self):
demand = dict.fromkeys(('logicalInterests', 'sharingGroups', 'registryInterests', 'trackedDrivers',
'desiredPhysicalReferences', 'appliedPhysicalReferences', 'retiringDrivers'), 0)
hub = {'snapshotItems': 0, 'interestItems': 0, 'retainedBytes': 256, 'maximumRetainedBytes': 1024}
observed = {'originAccounting': {'workload': {'demand': demand, 'hub': hub,
'reservedDrivers': 1, 'maximumReservedDrivers': 4}}}
self.assertTrue(workload.origin_drained(observed))
for value in (0, 2, True, 1.0, None):
other = copy.deepcopy(observed)
other['originAccounting']['workload']['reservedDrivers'] = value
with self.subTest(reserved_drivers=value):
self.assertFalse(workload.origin_drained(other))
for category, fields in (('demand', demand), ('hub', ('snapshotItems', 'interestItems'))):
for field in fields:
other = copy.deepcopy(observed)
other['originAccounting']['workload'][category][field] = 1
with self.subTest(category=category, field=field):
self.assertFalse(workload.origin_drained(other))
held = copy.deepcopy(observed)
held['originAccounting']['workload']['demand']['appliedPhysicalReferences'] = 1
held['originAccounting']['workload']['demand']['logicalInterests'] = 8
self.assertFalse(workload.origin_drained(held))
measured = workload.validate_origin_samples([held])
self.assertEqual(1, measured['maximum_applied_physical_references'])
self.assertEqual(8, measured['maximum_logical_interests'])
with self.assertRaises(workload.WorkloadError):
workload.validate_origin_samples([observed])
held['originAccounting']['workload']['hub']['retainedBytes'] = 1025
with self.assertRaises(workload.WorkloadError):
workload.validate_origin_samples([held])
def test_origin_settle_requires_consecutive_accounting_from_the_exact_deployed_source(self):
runner = object.__new__(workload.WorkloadRunner)
peers = ('source-1', 'source-2')
runner.manifest = {'nodes': {node: {'node_id': node + ':4053', 'cluster_id': 'SOURCE'} for node in peers},
'deployment': {'id': '7a4154db-48d5-4250-ad10-53e890dda436', 'revision_hash': 'revision'}}
demand = dict.fromkeys(('logicalInterests', 'sharingGroups', 'registryInterests', 'trackedDrivers',
'desiredPhysicalReferences', 'appliedPhysicalReferences', 'retiringDrivers'), 0)
drained = {'self': 'akka.tcp://otopcua@source-1:4053', 'deploymentId': '7a4154db48d54250ad1053e890dda436', 'artifactRevision': 'revision',
'members': [{'host': node, 'port': 4053, 'status': 'Up'} for node in peers],
'originAccounting': {'workload': {'demand': demand, 'hub': {'snapshotItems': 0, 'interestItems': 0},
'reservedDrivers': 1}}}
held = copy.deepcopy(drained)
held['originAccounting']['workload']['demand']['retiringDrivers'] = 1
observations = [drained, held, drained, drained, drained]
runner.probe = Mock(side_effect=observations)
with patch.object(workload.time, 'sleep'):
self.assertEqual(runner.settle_origin('source-1', self.document['accounting']), observations)
self.assertEqual(runner.probe.call_args_list, [call('source-1', 'topology', timeout=5)] * len(observations))
for field, value in (('self', 'akka.tcp://otopcua@source-2:4053'), ('deploymentId', 'stale'), ('artifactRevision', 'stale'),
('members', drained['members'][:1]), ('members', [drained['members'][0], {'host': 'foreign', 'port': 4053, 'status': 'Up'}])):
runner.probe = Mock(return_value={**drained, field: value})
with self.subTest(field=field, value=value), self.assertRaisesRegex(workload.WorkloadError, 'identity'):
runner.settle_origin('source-1', self.document['accounting'])
def test_partition_variant_requires_actual_origin_partition_count(self):
demand = dict.fromkeys(('logicalInterests', 'sharingGroups', 'registryInterests', 'desiredPhysicalReferences', 'appliedPhysicalReferences'), 1)
observed = {'originAccounting': {'workload': {'demand': demand, 'hub': {'retainedBytes': 16, 'maximumRetainedBytes': 1024, 'partitionCount': 4},
'reservedDrivers': 1, 'maximumReservedDrivers': 4}}}
workload.validate_origin_samples([observed], 4)
with self.assertRaises(workload.WorkloadError):
workload.validate_origin_samples([observed], 1)
del observed['originAccounting']['workload']['hub']['partitionCount']
with self.assertRaises(workload.WorkloadError):
workload.validate_origin_samples([observed], 4)
def test_encoding_requires_actual_accepted_frames_and_stable_accounting_owner(self):
for field, value in [('compactFrameCount', 0), ('fallbackFrameCount', 1), ('serializedValueFrameBytes', None), ('revision', 2), ('accountingInstanceId', 'owner-two')]:
observed = self.observations()
observed['diagnosticsAfter']['connections'][0][field] = value
with self.subTest(field=field), self.assertRaises(workload.WorkloadError):
self.summarize(observed)
self.profile['compact_batches'] = False
observed = self.observations()
observed['diagnosticsAfter']['connections'][0].update(compactFrameCount=0, fallbackFrameCount=2)
self.assertEqual(2, self.summarize(observed)['fallback_value_frames'])
def test_controlled_matrix_changes_exactly_one_real_dimension(self):
workload.validate_profiles(self.document)
self.assertEqual({'hub_partitions', 'compact_batches'}, {row['dimension'] for row in self.document['comparisons']})
document = copy.deepcopy(self.document)
variant = next(profile for profile in document['profiles'] if profile['id'] == document['comparisons'][0]['variant'])
variant['clients'] += 1
with self.assertRaises(workload.WorkloadError):
workload.validate_profiles(document)
document = copy.deepcopy(self.document)
document['profiles'][0].update(clients=2, overlap=False)
with self.assertRaises(workload.WorkloadError):
workload.validate_profiles(document)
document = copy.deepcopy(self.document)
document['profiles'][0]['sources'].append('counter')
with self.assertRaises(workload.WorkloadError):
workload.validate_profiles(document)
def test_comparison_reports_observed_ratios_and_incomplete_selection(self):
comparison = self.document['comparisons'][0]
metrics = {'delivered_samples_per_second': 2, 'caller_process_cpu_core_equivalents': 0,
'device_read_requests_per_second': 1, 'typed_value_bytes_per_sample': 8,
'serialized_value_frame_bytes_per_sample': 100}
rows = [{'id': comparison['baseline'], 'passed': True, 'measurements': metrics},
{'id': comparison['variant'], 'passed': True, 'measurements': {**metrics, 'delivered_samples_per_second': 3}}]
report = workload.summarize_comparisons(self.document, rows)
self.assertEqual('measured', report[0]['status'])
self.assertEqual(1.5, report[0]['measurements']['delivered_samples_per_second']['variant_to_baseline'])
self.assertIsNone(report[0]['measurements']['caller_process_cpu_core_equivalents']['variant_to_baseline'])
self.assertEqual('not-selected', report[1]['status'])
rows[1]['passed'] = False
self.assertEqual('failed', workload.summarize_comparisons(self.document, rows)[0]['status'])
def test_bounded_admission_counts_accepted_handles_separately_from_rejected_clients(self):
self.profile.update(clients=2, admission_limit=1)
observed = self.observations()
observed['clients'].append({'client': 1, 'rejectedBeforeStream': True, 'failure': None, 'acknowledged': 0})
measured = self.summarize(observed)
self.assertEqual(1, measured['acknowledged_registrations'])
self.assertEqual(1, measured['clients_rejected_before_stream'])
observed['clients'][1]['acknowledged'] = 1
with self.assertRaises(workload.WorkloadError):
self.summarize(observed)
def sharing_observations(self, profile, accepted=None):
views = [(source, realm) for source in profile['sources'] for realm in ('Raw', 'Uns')[:profile['views_per_source']]]
clients = []
for client in range(profile['clients']):
if accepted is not None and client not in accepted:
clients.append({'client': client, 'rejectedBeforeStream': True, 'acknowledged': 0})
continue
items = []
for index in range(profile['registrations_per_client']):
slot = index if profile['overlap'] else client * profile['registrations_per_client'] + index
source, realm = views[slot % len(views)]
items.append({'id': 'r' + str(index), 'sourceId': source, 'realm': realm})
clients.append({'client': client, 'items': items, 'acknowledged': len(items)})
return {'clients': clients}
def sharing_samples(self, expected):
return [{'originAccounting': {'workload': {'capturedAtUtc': '2026-11-17T10:00:0' + str(index) + 'Z',
'demand': {'logicalInterests': expected['logical_interests'], 'registryInterests': expected['registry_interests'],
'sharingGroups': expected['sharing_groups'], 'desiredPhysicalReferences': expected['physical_references'],
'appliedPhysicalReferences': expected['physical_references'], 'trackedDrivers': 1, 'retiringDrivers': 0},
'hub': {'retainedBytes': 256, 'maximumRetainedBytes': 1024, 'partitionCount': 4},
'reservedDrivers': 1, 'maximumReservedDrivers': 4}}} for index in range(3)]
def test_sharing_derives_unique_sources_authority_proofs_and_actual_logical_admission(self):
profile = next(item for item in self.document['profiles'] if item['id'] == 'fan-out')
expected = workload.sharing_expectation(profile, self.sharing_observations(profile))
self.assertEqual(64, expected['logical_interests'])
self.assertEqual(4, expected['sharing_groups'])
self.assertEqual(2, expected['physical_references'])
self.assertFalse(expected['legacy_scope']['included_in_observed_demand_owner'])
self.assertEqual(7, expected['legacy_scope']['expected_legacy_grpc_reference_union'])
samples = self.sharing_samples(expected)
measured = workload.validate_origin_samples(samples, 4, expected)
self.assertEqual(3, measured['consecutive_steady_observations'])
self.assertEqual(expected, measured['sharing_expectation'])
def test_one_physical_reference_per_registration_cannot_pass_overlap_experiment(self):
profile = next(item for item in self.document['profiles'] if item['id'] == 'fan-out')
expected = workload.sharing_expectation(profile, self.sharing_observations(profile))
samples = self.sharing_samples(expected)
samples[1]['originAccounting']['workload']['demand']['appliedPhysicalReferences'] = expected['logical_interests']
with self.assertRaises(workload.WorkloadError): workload.validate_origin_samples(samples, 4, expected)
def test_single_good_snapshot_or_replayed_observation_does_not_establish_sharing(self):
expected = workload.sharing_expectation(self.profile, self.observations())
samples = self.sharing_samples(expected)
with self.assertRaises(workload.WorkloadError): workload.validate_origin_samples(samples[:1], 4, expected)
with self.assertRaises(workload.WorkloadError): workload.validate_origin_samples([samples[0]] * 3, 4, expected)
samples[1]['originAccounting']['workload']['demand']['appliedPhysicalReferences'] = 0
with self.assertRaises(workload.WorkloadError): workload.validate_origin_samples(samples, 4, expected)
def test_nonoverlap_and_bounded_admission_count_only_actual_admitted_source_views(self):
profile = next(item for item in self.document['profiles'] if item['id'] == 'interval-deadband')
observed = self.sharing_observations(profile)
expected = workload.sharing_expectation(profile, observed)
self.assertEqual((4, 4, 2), (expected['logical_interests'], expected['sharing_groups'], expected['physical_references']))
observed['clients'][1]['items'][0]['realm'] = 'Uns'
with self.assertRaises(workload.WorkloadError): workload.sharing_expectation(profile, observed)
profile = next(item for item in self.document['profiles'] if item['id'] == 'bounded-admission')
expected = workload.sharing_expectation(profile, self.sharing_observations(profile, accepted={2}))
self.assertEqual((1, 1, 1), (expected['logical_interests'], expected['sharing_groups'], expected['physical_references']))
def test_missing_or_stale_adversarial_packet_blocks_before_hardware_or_timing(self):
instance = workload.WorkloadRunner.__new__(workload.WorkloadRunner)
instance.rig = SimpleNamespace(folder=Path('/private/rig'))
instance.manifest = {'source_tree_hash': 'current'}
instance.hardware = Mock()
with patch.object(workload, 'adversarial_preflight', side_effect=workload.WorkloadError('missing')):
with self.assertRaises(workload.WorkloadError): instance.run_workloads(self.document)
with patch.object(workload, 'adversarial_preflight', return_value={'runtime_source_tree_hash': 'stale'}):
with self.assertRaises(workload.WorkloadError): instance.run_workloads(self.document)
instance.hardware.assert_not_called()
with tempfile.TemporaryDirectory() as folder:
with self.assertRaises(workload.WorkloadError): workload.adversarial_preflight(Path(folder) / 'missing-packet.json')
def test_recovery_prepares_the_recreated_callers_raw_leaf_before_faulting(self):
for browse_ready in (True, False):
with self.subTest(browse_ready=browse_ready), tempfile.TemporaryDirectory() as folder:
events = Mock()
runner = object.__new__(workload.WorkloadRunner)
previous_manifest = {'source_tree_hash': 'current', 'consumer': 'consumer-2'}
refreshed_manifest = {**previous_manifest, 'run_id': 'test', 'consumer': 'consumer-1', 'source': 'source-1'}
runner.manifest = previous_manifest
runner.rig = SimpleNamespace(folder=Path(folder), load=Mock(return_value=refreshed_manifest),
seed_helper=Mock(), hub_partitions=lambda _: nullcontext())
@contextmanager
def compact_batches(enabled):
events.recreate_consumers(enabled)
yield
runner.rig.compact_batches = compact_batches
runner.primary = lambda pair: runner.manifest[pair]
runner.hardware = Mock()
runner.save = Mock()
runner.baseline = events.baseline
runner.probe = events.probe
runner.wait_connection_ready = events.wait_connection_ready
runner.cli = events.cli
runner.changing = events.changing
runner.changing.return_value = nullcontext()
runner.live_cli_fault = events.live_cli_fault
runner.wait_pair_topology = events.wait_pair_topology
runner.settle = events.settle
runner.settle.side_effect = workload.WorkloadError('stop after recovery preflight')
if not browse_ready:
runner.cli.side_effect = workload.ScenarioError('projected leaf missing from Browse')
with patch.object(workload, 'adversarial_preflight', return_value={'runtime_source_tree_hash': 'current'}):
report = runner.run_workloads(self.document, selected=['recovery'])
expected = [call.recreate_consumers(True), call.probe('consumer-1', 'read'),
call.probe('consumer-1', 'metadata'), call.wait_connection_ready('consumer-1', 'raw'),
call.cli('browse', 'consumer-1', 'raw', recursive=True)]
if browse_ready:
expected.extend([call.changing(), call.live_cli_fault('consumer-1', 'source-1', require_gap=True),
call.wait_pair_topology('source'),
call.settle('consumer-1', self.document['accounting'])])
self.assertEqual(expected + [call.baseline()], events.mock_calls)
row = report['rows'][0]
self.assertEqual(row['failure'], 'WorkloadError: stop after recovery preflight' if browse_ready
else 'ScenarioError: projected leaf missing from Browse')
self.assertTrue(row['restored'])
self.assertFalse(row['passed'])
if __name__ == '__main__':
unittest.main()
@@ -611,6 +611,51 @@
]
}
],
"P11": [
{
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/ZB.MOM.WW.OtOpcUa.Runtime.Tests.csproj",
"filter": "(Feature=GrpcData&Phase=P11)|FullyQualifiedName~.GrpcDataStreamOrderingTests.|FullyQualifiedName~.GrpcDataDeliveryFairnessTests.|FullyQualifiedName~.GrpcDataRecoveryAdmissionTests.|FullyQualifiedName~.GrpcDataProjectedAccessTests.|FullyQualifiedName~.GrpcDataConnectionClientTests.",
"new_classes": [
"GrpcDataWorkloadAccountingTests"
],
"existing_classes": [
"GrpcDataProjectedAccessTests",
"GrpcDataStreamOrderingTests",
"GrpcDataDeliveryFairnessTests",
"GrpcDataRecoveryAdmissionTests",
"GrpcDataConnectionClientTests"
]
},
{
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.Tests/ZB.MOM.WW.OtOpcUa.OpcUaServer.Tests.csproj",
"filter": "(Feature=GrpcData&Phase=P11)|FullyQualifiedName~.GrpcDataSdkProjectionTests.",
"new_classes": [
"GrpcDataSdkSampleEvidenceTests"
],
"existing_classes": [
"GrpcDataSdkProjectionTests"
]
},
{
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Host.Tests/ZB.MOM.WW.OtOpcUa.Host.Tests.csproj",
"filter": "FullyQualifiedName~.GrpcDataProjectionRoutingTests.|FullyQualifiedName~.GrpcDataCompactNegotiationTests.|FullyQualifiedName~.GrpcDataRuntimeRegistrationTests.",
"new_classes": [
"GrpcDataCompactNegotiationTests"
],
"existing_classes": [
"GrpcDataProjectionRoutingTests",
"GrpcDataRuntimeRegistrationTests"
]
},
{
"project": "tests/Core/ZB.MOM.WW.OtOpcUa.Commons.Tests/ZB.MOM.WW.OtOpcUa.Commons.Tests.csproj",
"filter": "FullyQualifiedName~.GrpcDataCompactCodecTests.",
"new_classes": [],
"existing_classes": [
"GrpcDataCompactCodecTests"
]
}
],
"P10": [
{
"project": "tests/Server/ZB.MOM.WW.OtOpcUa.Host.Tests/ZB.MOM.WW.OtOpcUa.Host.Tests.csproj",
@@ -0,0 +1,261 @@
{
"schema_version": 1,
"description": "Small measured fixture experiments, not advertised capacity. Limits are experiment safety bounds, not throughput promises.",
"accounting": {
"settle_seconds": 15,
"consecutive_drained_observations": 3,
"sample_interval_seconds": 0.5
},
"profiles": [
{
"id": "smoke",
"group": "smoke",
"sources": [
"scalar"
],
"clients": 1,
"registrations_per_client": 1,
"views_per_source": 1,
"duration_seconds": 6,
"sampling_ms": 100,
"publishing_ms": 100,
"source_hz": 2,
"deadband": null,
"slow_clients": 0,
"slow_client_ms": 0,
"browse_burst": 0,
"browse_workers": 1,
"overlap": true,
"hub_partitions": 4,
"compact_batches": true
},
{
"id": "steady",
"group": "steady",
"sources": [
"scalar",
"counter",
"array0",
"array1",
"array2"
],
"clients": 2,
"registrations_per_client": 10,
"views_per_source": 2,
"duration_seconds": 12,
"sampling_ms": 100,
"publishing_ms": 200,
"source_hz": 4,
"deadband": null,
"slow_clients": 0,
"slow_client_ms": 0,
"browse_burst": 8,
"browse_workers": 2,
"overlap": true,
"hub_partitions": 4,
"compact_batches": true
},
{
"id": "typed-payloads",
"group": "steady",
"sources": [
"scalar",
"vector",
"text"
],
"clients": 2,
"registrations_per_client": 6,
"views_per_source": 2,
"duration_seconds": 12,
"sampling_ms": 100,
"publishing_ms": 200,
"source_hz": 4,
"deadband": null,
"slow_clients": 0,
"slow_client_ms": 0,
"browse_burst": 8,
"browse_workers": 2,
"overlap": true,
"hub_partitions": 1,
"compact_batches": true
},
{
"id": "fan-out",
"group": "fan-out",
"sources": [
"scalar",
"counter"
],
"clients": 8,
"registrations_per_client": 8,
"views_per_source": 2,
"duration_seconds": 12,
"sampling_ms": 100,
"publishing_ms": 100,
"source_hz": 4,
"deadband": null,
"slow_clients": 1,
"slow_client_ms": 750,
"browse_burst": 32,
"browse_workers": 4,
"overlap": true,
"hub_partitions": 4,
"compact_batches": true
},
{
"id": "quiet-hot-fairness",
"group": "fan-out",
"sources": [
"scalar",
"array0"
],
"clients": 4,
"registrations_per_client": 4,
"views_per_source": 2,
"duration_seconds": 12,
"sampling_ms": 100,
"publishing_ms": 100,
"source_hz": 8,
"deadband": null,
"slow_clients": 1,
"slow_client_ms": 1000,
"browse_burst": 32,
"browse_workers": 4,
"overlap": true,
"hub_partitions": 4,
"compact_batches": true
},
{
"id": "interval-deadband",
"group": "steady",
"sources": [
"scalar",
"counter"
],
"clients": 2,
"registrations_per_client": 2,
"views_per_source": 2,
"duration_seconds": 12,
"sampling_ms": 250,
"publishing_ms": 500,
"source_hz": 4,
"deadband": 2,
"slow_clients": 0,
"slow_client_ms": 0,
"browse_burst": 0,
"browse_workers": 1,
"overlap": false,
"hub_partitions": 4,
"compact_batches": true
},
{
"id": "recovery",
"group": "recovery",
"sources": [
"scalar",
"counter"
],
"clients": 2,
"registrations_per_client": 4,
"views_per_source": 2,
"duration_seconds": 8,
"sampling_ms": 100,
"publishing_ms": 100,
"source_hz": 4,
"deadband": null,
"slow_clients": 0,
"slow_client_ms": 0,
"browse_burst": 8,
"browse_workers": 2,
"overlap": true,
"recovery_preflight": true,
"hub_partitions": 4,
"compact_batches": true
},
{
"id": "bounded-admission",
"group": "steady",
"sources": [
"scalar"
],
"clients": 4,
"registrations_per_client": 1,
"views_per_source": 1,
"duration_seconds": 6,
"sampling_ms": 100,
"publishing_ms": 100,
"source_hz": 2,
"deadband": null,
"slow_clients": 0,
"slow_client_ms": 0,
"browse_burst": 0,
"browse_workers": 1,
"overlap": true,
"admission_limit": 1,
"hub_partitions": 4,
"compact_batches": true
},
{
"id": "typed-partitions-4",
"group": "steady",
"sources": [
"scalar",
"vector",
"text"
],
"clients": 2,
"registrations_per_client": 6,
"views_per_source": 2,
"duration_seconds": 12,
"sampling_ms": 100,
"publishing_ms": 200,
"source_hz": 4,
"deadband": null,
"slow_clients": 0,
"slow_client_ms": 0,
"browse_burst": 8,
"browse_workers": 2,
"overlap": true,
"hub_partitions": 4,
"compact_batches": true
},
{
"id": "typed-fallback",
"group": "steady",
"sources": [
"scalar",
"vector",
"text"
],
"clients": 2,
"registrations_per_client": 6,
"views_per_source": 2,
"duration_seconds": 12,
"sampling_ms": 100,
"publishing_ms": 200,
"source_hz": 4,
"deadband": null,
"slow_clients": 0,
"slow_client_ms": 0,
"browse_burst": 8,
"browse_workers": 2,
"overlap": true,
"hub_partitions": 1,
"compact_batches": false
}
],
"comparisons": [
{
"id": "partition-count",
"baseline": "typed-payloads",
"variant": "typed-partitions-4",
"dimension": "hub_partitions"
},
{
"id": "encoding",
"baseline": "typed-payloads",
"variant": "typed-fallback",
"dimension": "compact_batches"
}
]
}
+571
View File
@@ -0,0 +1,571 @@
#!/usr/bin/env python3
"""Measured, bounded workloads against an already deployed run-owned LocalRig.
No capacity claim is inferred from profile input. Cardinalities come from actual
acknowledgements, rates from elapsed monotonic time and fixture counters, and
memory from the operating system/runtime. Missing accounting stays unavailable.
"""
import argparse
from contextlib import contextmanager
import hashlib
import importlib.util
import json
import math
from pathlib import Path
import platform
import threading
import time
import rig
from scenarios import ScenarioError, ScenarioRunner, restricted_json, fixture_browse_root
class WorkloadError(RuntimeError):
pass
def adversarial_preflight(path):
"""Required deterministic evidence is reconciled before any timing starts."""
spec = importlib.util.spec_from_file_location('p11_adversarial_gate', Path(__file__).with_name('run-p11-adversarial.py'))
gate = importlib.util.module_from_spec(spec)
spec.loader.exec_module(gate)
try:
return gate.checked_packet(path)
except (gate.AdversarialError, OSError, ValueError, KeyError) as error:
raise WorkloadError('passing current-candidate P11 adversarial packet required before measurement') from error
def sharing_expectation(profile, observations):
"""Count actual admitted source/view cohorts using the probe's exact indexing.
All selected clients use one principal, Cluster/Primary target and one cadence.
Raw and UNS have distinct export proofs, so registry cohorts remain separate;
physical references are deduplicated by driver/source across those proofs.
The observed demand owner excludes legacy poll-group references. The seeded
driver already has all seven legacy sources at200ms; their union stays seven.
The real-host legacy merge is a separate mandatory adversarial selector.
"""
views = [(source, realm) for source in profile['sources'] for realm in ('Raw', 'Uns')[:profile['views_per_source']]]
cohorts = set(); sources = set(); logical = 0
for client in observations['clients']:
if client.get('rejectedBeforeStream') is True:
continue
items = {item['id']: item for item in client['items']}
for index in range(profile['registrations_per_client']):
slot = index if profile['overlap'] else client['client'] * profile['registrations_per_client'] + index
expected = views[slot % len(views)]
item = items.get('r' + str(index), {})
if (item.get('sourceId'), item.get('realm')) != expected:
raise WorkloadError('observed source/view registration does not match sharing experiment')
logical += 1; sources.add(expected[0]); cohorts.add(expected)
if not logical or logical != sum(client.get('acknowledged', 0) for client in observations['clients']):
raise WorkloadError('sharing expectation requires actual acknowledged registrations')
return {'logical_interests': logical, 'registry_interests': logical, 'sharing_groups': len(cohorts),
'physical_references': len(sources), 'driver_count': 1,
'source_ids': sorted(sources), 'source_export_cohorts': sorted(cohorts),
'principal': 'fixture-consumer', 'target': 'Cluster:SOURCE:Primary',
'sampling_ms': profile['sampling_ms'], 'publishing_ms': profile['publishing_ms'], 'deadband': profile['deadband'],
'legacy_scope': {'included_in_observed_demand_owner': False, 'seeded_legacy_unique_references': 7,
'seeded_legacy_sampling_ms': 200, 'expected_legacy_grpc_reference_union': 7,
'merge_evidence_obligation': 'legacy-physical-sharing'}}
_FIELDS = {"id", "group", "sources", "clients", "registrations_per_client", "views_per_source", "duration_seconds",
"sampling_ms", "publishing_ms", "source_hz", "deadband", "slow_clients", "slow_client_ms", "browse_burst",
"browse_workers", "overlap", "hub_partitions", "compact_batches", "recovery_preflight", "admission_limit"}
_SOURCES = {"scalar", "counter", "array0", "array1", "array2", "vector", "text"}
# The seed's deployed 200 ms poll group keeps one acknowledged physical reservation.
_RESIDENT_ORIGIN_DRIVERS = ("source-modbus",)
def finite(value, low, high):
return type(value) in (int, float) and math.isfinite(value) and low <= value <= high
def validate_profiles(document):
if not isinstance(document, dict) or document.get("schema_version") != 1:
raise WorkloadError("unsupported workload schema")
profiles = document.get("profiles")
if not isinstance(profiles, list) or not 1 <= len(profiles) <= 64:
raise WorkloadError("bounded nonempty profiles required")
seen = set()
for profile in profiles:
if not isinstance(profile, dict) or set(profile) - _FIELDS or _FIELDS - {"recovery_preflight", "admission_limit"} - set(profile):
raise WorkloadError("unknown or missing profile field")
identity = profile["id"]
if not isinstance(identity, str) or not rig._RUN_PATTERN.fullmatch(identity) or identity in seen:
raise WorkloadError("safe unique profile id required")
seen.add(identity)
if profile["group"] not in {"smoke", "steady", "fan-out", "recovery"}:
raise WorkloadError("unknown workload group")
sources = profile["sources"]
if (not isinstance(sources, list) or not sources or any(not isinstance(source, str) or source not in _SOURCES for source in sources)
or len(set(sources)) != len(sources)):
raise WorkloadError("profile requires known actual fixture sources")
for name, low, high in (("clients", 1, 64), ("registrations_per_client", 1, 256), ("views_per_source", 1, 2),
("duration_seconds", 2, 90), ("sampling_ms", 0, 10000), ("publishing_ms", 0, 10000),
("slow_clients", 0, 64), ("slow_client_ms", 0, 5000), ("browse_burst", 0, 1024), ("browse_workers", 1, 32),
("hub_partitions", 1, 16)):
if type(profile[name]) is not int or not low <= profile[name] <= high:
raise WorkloadError("profile integer outside bounded experiment range")
if (profile["clients"] * profile["registrations_per_client"] > 4096
or profile["slow_clients"] > profile["clients"] or not finite(profile["source_hz"], .1, 20)
or type(profile["overlap"]) is not bool or type(profile["compact_batches"]) is not bool
or type(profile.get("recovery_preflight", False)) is not bool
or profile["registrations_per_client"] * (1 if profile["overlap"] else profile["clients"]) < len(sources) * profile["views_per_source"]
or (not profile["overlap"] and profile["clients"] * profile["registrations_per_client"] > len(sources) * profile["views_per_source"])
or (profile["deadband"] is not None and not finite(profile["deadband"], 0, 65535))):
raise WorkloadError("invalid workload dimensions")
if "admission_limit" in profile and (type(profile["admission_limit"]) is not int or not 1 <= profile["admission_limit"] < profile["clients"]):
raise WorkloadError("admission experiment must exceed its independent configured stream bound")
accounting = document.get("accounting", {})
if (set(accounting) != {"settle_seconds", "consecutive_drained_observations", "sample_interval_seconds"}
or not finite(accounting["settle_seconds"], 1, 120)
or type(accounting["consecutive_drained_observations"]) is not int
or not 2 <= accounting["consecutive_drained_observations"] <= 10
or not finite(accounting["sample_interval_seconds"], .1, 5)):
raise WorkloadError("explicit bounded physical-drain accounting required")
comparisons = document.get("comparisons", [])
if not isinstance(comparisons, list) or len(comparisons) > 32:
raise WorkloadError("bounded controlled comparisons required")
by_id = {profile["id"]: profile for profile in profiles}
comparison_ids = set()
for comparison in comparisons:
if (not isinstance(comparison, dict) or set(comparison) != {"id", "baseline", "variant", "dimension"}
or not isinstance(comparison["id"], str) or not rig._RUN_PATTERN.fullmatch(comparison["id"])
or comparison["id"] in comparison_ids or comparison["baseline"] not in by_id or comparison["variant"] not in by_id
or comparison["dimension"] not in {"hub_partitions", "compact_batches"}):
raise WorkloadError("invalid controlled comparison")
comparison_ids.add(comparison["id"])
left, right = by_id[comparison["baseline"]], by_id[comparison["variant"]]
if {key for key in left.keys() | right.keys() if left.get(key) != right.get(key)} != {"id", comparison["dimension"]}:
raise WorkloadError("comparison must change exactly one measured dimension")
return document
def probe_options(profile, origin_paths):
sources = []
for name in profile["sources"]:
sources.append({"id": name, "rawPath": origin_paths["raw"].rsplit("/", 1)[0] + "/" + name,
"unsPath": origin_paths["uns"].rsplit("/", 1)[0] + "/" + name,
"expectedKind": {"vector": "Array", "text": "String"}.get(name, "UInt16"), "expectedRank": 1 if name == "vector" else -1,
"requireChanges": name in {"scalar", "counter", "vector", "text"}})
return {"profileId": profile["id"], "sources": sources, "clients": profile["clients"],
"registrationsPerClient": profile["registrations_per_client"], "viewsPerSource": profile["views_per_source"],
"durationSeconds": profile["duration_seconds"], "samplingMilliseconds": profile["sampling_ms"],
"publishingMilliseconds": profile["publishing_ms"], "deadband": profile["deadband"],
"slowClientCount": profile["slow_clients"], "slowClientMilliseconds": profile["slow_client_ms"],
"browseBurst": profile["browse_burst"], "browseWorkers": profile["browse_workers"], "overlap": profile["overlap"],
"requireAllAdmitted": "admission_limit" not in profile,
"hubPartitions": profile["hub_partitions"], "compactBatches": profile["compact_batches"]}
def connections_drained(rows):
"""Null/missing activity counters cannot prove retirement."""
return isinstance(rows, list) and bool(rows) and all(isinstance(row, dict) and all(
type(row.get(field)) is int and row[field] == 0 for field in ("activeStreams", "activeCalls", "registrationCount")) for row in rows)
def origin_drained(observation):
origin = observation.get("originAccounting") if isinstance(observation, dict) else None
accounting = origin.get("workload") if isinstance(origin, dict) else None
if not isinstance(accounting, dict):
return False
demand, hub = accounting.get("demand"), accounting.get("hub")
return (isinstance(demand, dict) and isinstance(hub, dict)
and all(type(demand.get(field)) is int and demand[field] == 0 for field in
("logicalInterests", "sharingGroups", "registryInterests", "trackedDrivers", "desiredPhysicalReferences", "appliedPhysicalReferences", "retiringDrivers"))
and type(accounting.get("reservedDrivers")) is int and accounting["reservedDrivers"] == len(_RESIDENT_ORIGIN_DRIVERS)
and all(type(hub.get(field)) is int and hub[field] == 0 for field in ("snapshotItems", "interestItems")))
def validate_origin_samples(samples, expected_partitions=None, sharing=None, consecutive=3):
if not samples:
raise WorkloadError("actual origin accounting samples missing")
maximum_applied = 0
stable = longest_stable = 0
timestamps = set()
for sample in samples:
accounting = sample.get("originAccounting", {}).get("workload")
if not isinstance(accounting, dict):
raise WorkloadError("origin owner accounting unavailable")
demand, hub = accounting.get("demand", {}), accounting.get("hub", {})
fields = ("logicalInterests", "sharingGroups", "registryInterests", "desiredPhysicalReferences", "appliedPhysicalReferences")
if (any(type(demand.get(field)) is not int or demand[field] < 0 for field in fields)
or (expected_partitions is not None and (type(hub.get("partitionCount")) is not int or hub["partitionCount"] != expected_partitions))
or not finite(hub.get("retainedBytes"), 0, 2**63) or not finite(hub.get("maximumRetainedBytes"), 1, 2**63)
or hub["retainedBytes"] > hub["maximumRetainedBytes"]
or not finite(accounting.get("reservedDrivers"), 0, 2**31)
or not finite(accounting.get("maximumReservedDrivers"), 1, 2**31)
or accounting["reservedDrivers"] > accounting["maximumReservedDrivers"]):
raise WorkloadError("origin bounded resource invariant failed")
maximum_applied = max(maximum_applied, demand["appliedPhysicalReferences"])
if sharing is not None:
limits = {'logicalInterests': sharing['logical_interests'], 'registryInterests': sharing['registry_interests'],
'sharingGroups': sharing['sharing_groups'], 'desiredPhysicalReferences': sharing['physical_references'],
'appliedPhysicalReferences': sharing['physical_references']}
if any(demand[key] > limit for key, limit in limits.items()):
raise WorkloadError('physical sharing/cardinality exceeds unique admitted source or authority cohorts')
captured = accounting.get('capturedAtUtc')
if not isinstance(captured, str) or not captured or captured in timestamps:
raise WorkloadError('sharing requires distinct actual origin accounting observations')
timestamps.add(captured)
settled = all(demand[key] == limit for key, limit in limits.items()) and demand.get('trackedDrivers') == sharing['driver_count'] and demand.get('retiringDrivers') == 0
stable = stable + 1 if settled else 0
longest_stable = max(longest_stable, stable)
if maximum_applied < 1:
raise WorkloadError("no actual acknowledged physical acquisition observed")
if sharing is not None and longest_stable < consecutive:
raise WorkloadError('sharing cardinality never reached consecutive acknowledged steady observations')
return {"maximum_applied_physical_references": maximum_applied,
"maximum_logical_interests": max(row["originAccounting"]["workload"]["demand"]["logicalInterests"] for row in samples),
"maximum_retained_bytes": max(row["originAccounting"]["workload"]["hub"]["retainedBytes"] for row in samples),
"sharing_expectation": sharing, "consecutive_steady_observations": longest_stable}
def summarize_comparisons(document, rows):
"""Compare measured runs without treating a ratio as a capacity guarantee."""
by_id = {row["id"]: row for row in rows}
results = []
for comparison in document.get("comparisons", []):
result = dict(comparison)
left, right = by_id.get(comparison["baseline"]), by_id.get(comparison["variant"])
result["status"] = "not-selected" if left is None or right is None else "measured" if left["passed"] and right["passed"] else "failed"
if result["status"] == "measured":
fields = ("delivered_samples_per_second", "caller_process_cpu_core_equivalents", "device_read_requests_per_second", "typed_value_bytes_per_sample", "serialized_value_frame_bytes_per_sample")
result["measurements"] = {field: {"baseline": left["measurements"][field], "variant": right["measurements"][field],
"variant_to_baseline": right["measurements"][field] / left["measurements"][field] if left["measurements"][field] else None} for field in fields}
results.append(result)
return results
def summarize_measurement(observations, profile, ledger_before, ledger_after, elapsed_seconds):
"""Reconcile real probe evidence independently of its passed bit."""
if not finite(elapsed_seconds, .001, 300) or not isinstance(observations, dict):
raise WorkloadError("invalid measurement duration")
expected = probe_options(profile, {"raw": "modbus/plc/scalar", "uns": "area/line/plc/scalar"})
echo = observations.get("profile")
if not isinstance(echo, dict) or any(echo.get(key) != value for key, value in expected.items()):
raise WorkloadError("probe did not measure the requested dimensions")
clients = observations.get("clients")
if not isinstance(clients, list) or len(clients) != profile["clients"] or {client.get("client") for client in clients} != set(range(profile["clients"])):
raise WorkloadError("client measurement coverage incomplete")
measured_elapsed = observations.get("elapsedSeconds")
if not finite(measured_elapsed, .001, 120):
raise WorkloadError("actual stream sampling window missing")
samples = byte_count = registrations = 0
rejected_clients = 0
for client in clients:
if "admission_limit" in profile and client.get("rejectedBeforeStream") is True:
if client.get("failure") is not None or client.get("acknowledged") != 0:
raise WorkloadError("admission rejection has inconsistent evidence")
rejected_clients += 1
continue
count = profile["registrations_per_client"]
if (client.get("failure") is not None or client.get("acknowledged") != count or client.get("snapshots") != count
or client.get("rejected") != 0 or client.get("unreadySamples") != 0
or not isinstance(client.get("items"), list) or len(client["items"]) != count
or {item.get("id") for item in client["items"]} != {"r" + str(index) for index in range(count)}
or client.get("controls", {}).get("SnapshotEnd", 0) < 1):
raise WorkloadError("registration admission/initialization mismatch")
registrations += client["acknowledged"]
for item in client["items"]:
if (type(item.get("samples")) is not int or item["samples"] < 1
or type(item.get("typedValueBytes")) is not int or item["typedValueBytes"] < 1
or not finite(item.get("firstSnapshotMilliseconds"), 0, 120000)
or item.get("sourceId") not in profile["sources"]
or (item.get("sourceId") in {"scalar", "counter", "vector", "text"} and (type(item.get("changes")) is not int or item["changes"] < 1))
or (item.get("sourceId") in {"scalar", "counter", "vector", "text"} and client["client"] >= profile["slow_clients"]
and (type(item.get("changesAfterMidpoint")) is not int or item["changesAfterMidpoint"] < 1
or not finite(item.get("hotTailMilliseconds"), 0, 5000)))):
raise WorkloadError("per-registration progress evidence missing")
samples += item["samples"]
byte_count += item["typedValueBytes"]
if "admission_limit" in profile and (rejected_clients < 1 or registrations < 1 or
registrations > profile["admission_limit"] * profile["registrations_per_client"]):
raise WorkloadError("independent configured admission bound not observed")
before, after = observations.get("processBefore"), observations.get("processAfter")
if not isinstance(before, dict) or not isinstance(after, dict):
raise WorkloadError("actual process measurements missing")
for row in (before, after):
if any(not finite(row.get(field), 0, 2**63) for field in ("workingSet64", "managedBytes", "totalProcessorMilliseconds")):
raise WorkloadError("actual memory/CPU counters unavailable")
cpu_ms = after["totalProcessorMilliseconds"] - before["totalProcessorMilliseconds"]
source_reads = ledger_after.get("read_total", -1) - ledger_before.get("read_total", -1)
if cpu_ms < 0 or source_reads < 0:
raise WorkloadError("measurement counter reset")
encoding = encoding_measurement(observations, profile)
return {"acknowledged_registrations": registrations, "delivered_samples": samples,
"clients_rejected_before_stream": rejected_clients,
"stream_sampling_seconds": measured_elapsed, "fixture_counter_window_seconds": elapsed_seconds,
"delivered_samples_per_second": samples / measured_elapsed,
"typed_value_bytes": byte_count, "typed_value_bytes_per_sample": byte_count / samples,
"device_read_requests": source_reads, "device_read_requests_per_second": source_reads / elapsed_seconds,
"caller_process_cpu_core_equivalents": cpu_ms / (measured_elapsed * 1000),
"working_set_change_bytes": after["workingSet64"] - before["workingSet64"],
"managed_change_bytes": after["managedBytes"] - before["managedBytes"],
**encoding, "serialized_value_frame_bytes_per_sample": encoding["serialized_value_frame_bytes"] / samples,
"source_rate_definition": "actual fixture Modbus read requests; requests may batch multiple registers",
"bytes_definition": observations.get("bytesDefinition"),
"leak_verdict": "not inferred from instantaneous GC/working-set differences"}
def encoding_measurement(observations, profile):
counters = ("compactFrameCount", "fallbackFrameCount", "serializedValueFrameBytes")
snapshots = []
for key in ("diagnosticsBefore", "diagnosticsAfter"):
diagnostics = observations.get(key)
rows = diagnostics.get("connections") if isinstance(diagnostics, dict) else None
if not isinstance(rows, list):
raise WorkloadError("actual encoding accounting missing")
matches = [row for row in rows if isinstance(row, dict) and row.get("connectionId") == "consumer-source"]
if len(matches) != 1 or any(type(matches[0].get(field)) is not int or matches[0][field] < 0 for field in counters):
raise WorkloadError("actual encoding accounting missing")
snapshots.append(matches[0])
before, after = snapshots
if any(before.get(field) != after.get(field) or before.get(field) is None for field in ("revision", "scopeVersion", "artifactRevision", "accountingInstanceId")):
raise WorkloadError("encoding accounting owner changed")
delta = {field: after[field] - before[field] for field in counters}
expected = "compactFrameCount" if profile["compact_batches"] else "fallbackFrameCount"
unexpected = "fallbackFrameCount" if profile["compact_batches"] else "compactFrameCount"
if any(value < 0 for value in delta.values()) or delta[expected] < 1 or delta[unexpected] != 0 or delta["serializedValueFrameBytes"] < 1:
raise WorkloadError("requested encoding not observed on accepted value frames")
return {"compact_value_frames": delta["compactFrameCount"], "fallback_value_frames": delta["fallbackFrameCount"],
"serialized_value_frame_bytes": delta["serializedValueFrameBytes"],
"wire_bytes_definition": "accepted serialized protobuf value frames; excludes HTTP/2 and TLS overhead"}
class WorkloadRunner(ScenarioRunner):
@contextmanager
def origin_samples(self, origin, samples):
done = threading.Event()
failures = []
def sample():
try:
while not done.is_set():
samples.append(self.probe(origin, "topology", timeout=5))
done.wait(.5)
except Exception as error:
failures.append(type(error).__name__)
worker = threading.Thread(target=sample, daemon=True)
worker.start()
try:
yield
finally:
done.set()
worker.join(timeout=7)
if worker.is_alive() or failures:
raise WorkloadError("actual origin accounting sampler failed to retire")
@contextmanager
def source_updates(self, profile):
done = threading.Event()
failures = []
initial_values = self.device()["writable"]
initial = initial_values["20"]
touched_addresses = ([20] if "scalar" in profile["sources"] else []) + ([24, 25, 26] if "vector" in profile["sources"] else []) + ([40] if "text" in profile["sources"] else [])
updates = []
def update():
value = initial
try:
while not done.wait(1 / profile["source_hz"]):
value = (value + max(1, int(profile["deadband"] or 0) + 1)) % 65536
if "counter" in profile["sources"]:
self.device("advance", steps=max(1, int(profile["deadband"] or 0) + 1))
if "scalar" in profile["sources"]:
self.device("set", address=20, value=value)
if "vector" in profile["sources"]:
for offset in range(3):
self.device("set", address=24 + offset, value=(value + offset) % 65536)
if "text" in profile["sources"]:
self.device("set", address=40, value=((65 + value % 26) << 8) | 66)
updates.append(time.monotonic())
except Exception as error:
failures.append(type(error).__name__)
worker = threading.Thread(target=update, daemon=True)
worker.start()
try:
yield updates
if failures:
raise WorkloadError("actual fixture producer failed")
finally:
done.set()
worker.join(timeout=6)
if worker.is_alive():
raise WorkloadError("fixture producer did not retire")
for address in touched_addresses:
self.device("set", address=address, value=initial_values[str(address)])
def settle(self, caller, accounting):
deadline = time.monotonic() + accounting["settle_seconds"]
consecutive = 0
rows = []
while time.monotonic() < deadline:
observations = self.probe(caller, "topology", timeout=5)
rows.append(observations)
consecutive = consecutive + 1 if connections_drained(observations.get("connections")) else 0
if consecutive >= accounting["consecutive_drained_observations"]:
return rows
time.sleep(accounting["sample_interval_seconds"])
raise WorkloadError("physical streams/calls/registrations did not settle")
def settle_origin(self, origin, accounting):
expected_members = {self.node_id(node) for node, metadata in self.manifest["nodes"].items() if metadata["cluster_id"] == "SOURCE"}
expected_node = self.node_id(origin)
deployment = self.manifest["deployment"]
if len(expected_members) != 2 or expected_node not in expected_members or not deployment.get("id") or not deployment.get("revision_hash"):
raise WorkloadError("origin drain requires the deployed SOURCE pair identity")
# The manifest uses a canonical UUID and the runtime artifact uses compact hexadecimal.
expected_deployment_id = deployment["id"].replace("-", "")
deadline = time.monotonic() + accounting["settle_seconds"]
consecutive = 0
rows = []
while time.monotonic() < deadline:
observed = self.probe(origin, "topology", timeout=5)
members = observed.get("members")
if (observed.get("self") != f"akka.tcp://otopcua@{expected_node}"
or observed.get("deploymentId") != expected_deployment_id
or observed.get("artifactRevision") != deployment["revision_hash"]
or not isinstance(members, list) or len(members) != len(expected_members)
or {f"{member.get('host')}:{member.get('port')}" for member in members
if isinstance(member, dict) and member.get("status") == "Up"} != expected_members):
raise WorkloadError("origin accounting identity does not match the deployed SOURCE pair")
rows.append(observed)
consecutive = consecutive + 1 if origin_drained(observed) else 0
if consecutive >= accounting["consecutive_drained_observations"]:
return rows
time.sleep(accounting["sample_interval_seconds"])
raise WorkloadError("origin demand and hub items did not drain to zero with exactly one resident reservation")
def hardware(self):
info = json.loads(self.rig.compose("version", "--format", "json"))
docker = json.loads(rig.run_command([*self.rig.docker, "info", "--format", "{{json .}}"], environment=self.rig.environment))
resources = [row for row in self.rig.inspect_resources() if row["kind"] == "container"]
containers = []
for resource in resources:
inspect = json.loads(rig.run_command([*self.rig.docker, "container", "inspect", resource["id"]], environment=self.rig.environment))[0]
host = inspect.get("HostConfig", {})
containers.append({"id": resource["id"], "service": resource["labels"].get("com.docker.compose.service"),
"image_id": inspect.get("Image"), "limits": {key: host.get(key) for key in
("Memory", "MemorySwap", "NanoCpus", "CpuQuota", "CpuPeriod", "CpusetCpus")}})
return {"host_architecture": platform.machine(), "host_platform": platform.platform(), "compose": info,
"docker": {key: docker.get(key) for key in ("Architecture", "OSType", "NCPU", "MemTotal", "KernelVersion", "ServerVersion")},
"containers": containers, "tls": "TLS 1.2/1.3 with run-owned CA and exact DNS SAN verification",
"compression": "no explicit gRPC compression configured", "encoding": "explicit compact opt-in/opt-out; actual accepted wire frame counters measured",
"serialization_ceilings": ["DriverHostActor driver calls and SDK NodeManager operations retain their production serialization gates"],
"unavailable_breakdowns": ["CPU per actor/partition", "retained/pool/cache bytes unless exposed by actual owner counters"]}
def run_workloads(self, document, selected=None, adversarial_packet=None):
document = validate_profiles(document)
profiles = [profile for profile in document["profiles"] if selected is None or profile["id"] in selected or profile["group"] in selected]
if not profiles or (selected and set(selected) - {value for profile in document["profiles"] for value in (profile["id"], profile["group"])}):
raise WorkloadError("unknown or empty workload selection")
adversarial_path = adversarial_packet or self.rig.folder / 'adversarial-evidence' / 'packet.json'
adversarial = adversarial_preflight(adversarial_path)
if adversarial['runtime_source_tree_hash'] != self.manifest.get('source_tree_hash'):
raise WorkloadError('adversarial packet and deployed rig belong to different candidates')
self.folder = self.rig.folder / "workload-evidence"
self.folder.mkdir(mode=0o700, exist_ok=True)
self.active = "P11"
self.deadline = time.monotonic() + 120
self.save("hardware.json", self.hardware())
self.rig.seed_helper("snapshot")
rows = []
for profile in profiles:
self.active = "P11-" + profile["id"]
self.deadline = time.monotonic() + 480
started = time.monotonic()
error = None
restored = False
row = {"id": profile["id"], "configuration": profile}
try:
with self.rig.hub_partitions(profile["hub_partitions"]), self.rig.compact_batches(profile["compact_batches"]):
self.manifest = self.rig.load()
caller = self.primary("consumer")
origin = self.primary("source")
if "admission_limit" in profile:
baseline = restricted_json((self.rig.folder / "seed" / "baseline.json").resolve())
connection = next(item for item in baseline["Connections"] if item["DataConnectionId"] == "consumer-source")
connection["MaxStreams"] = profile["admission_limit"]
self.mutate(upsert_connection=connection)
# Deterministic correctness runs before timed sampling.
self.probe(caller, "read")
self.probe(caller, "metadata")
if profile.get("recovery_preflight"):
self.prepare_positive_projection(caller, "raw")
with self.changing():
self.live_cli_fault(caller, self.primary("source"), require_gap=True)
self.wait_pair_topology("source")
origin = self.primary("source")
row["drained_before"] = self.settle(caller, document["accounting"])
row["origin_drained_before"] = self.settle_origin(origin, document["accounting"])
ledger_before = self.device()
measured_start = time.monotonic()
row["origin_samples"] = []
with self.origin_samples(origin, row["origin_samples"]), self.source_updates(profile) as updates:
observed = self.probe(caller, "workload", timeout=profile["duration_seconds"] + 20,
workload=probe_options(profile, self.manifest["fixture"]["origin_paths"]),
workloadUnsNamespaceUri=self.manifest["fixture"]["namespace_uris"]["uns"],
workloadBrowseRoots={realm: fixture_browse_root(self.manifest["fixture"], realm) for realm in ("raw", "uns")})
elapsed = time.monotonic() - measured_start
ledger_after = self.device()
row["measurements"] = summarize_measurement(observed, profile, ledger_before, ledger_after, elapsed)
row["measurements"]["actual_producer_ticks"] = len(updates)
row["measurements"]["origin"] = validate_origin_samples(row["origin_samples"], profile["hub_partitions"],
sharing_expectation(profile, observed), document['accounting']['consecutive_drained_observations'])
row["observations"] = observed
row["drained_after"] = self.settle(caller, document["accounting"])
row["origin_drained_after"] = self.settle_origin(origin, document["accounting"])
except Exception as failure:
error = type(failure).__name__ + (": " + str(failure) if isinstance(failure, (WorkloadError, ScenarioError)) else "")
finally:
try:
self.manifest = self.rig.load()
self.baseline()
restored = True
except Exception as failure:
error = (error + "; " if error else "") + "restoration " + type(failure).__name__
row.update(passed=error is None, failure=error, restored=restored, duration_seconds=time.monotonic() - started)
rows.append(row)
self.save("workload-results.json", {"schema_version": 1, "rows": rows, "complete": len(rows) == len(profiles), "passed": False})
adversarial_error = None
try:
if adversarial_preflight(adversarial_path) != adversarial:
raise WorkloadError('adversarial evidence changed during measurement')
except WorkloadError as failure:
adversarial_error = str(failure)
report = {"schema_version": 1, "run_id": self.manifest["run_id"], "source_revision": self.manifest.get("source_revision"),
"passed": adversarial_error is None and all(row["passed"] and row["restored"] for row in rows), "complete": True, "rows": rows,
"adversarial_evidence": adversarial, "adversarial_evidence_error": adversarial_error,
"capacity_claim": None, "comparisons": summarize_comparisons(document, rows),
"origin_drain_expectation": {"seeded_resident_driver_ids": list(_RESIDENT_ORIGIN_DRIVERS),
"reserved_driver_count": len(_RESIDENT_ORIGIN_DRIVERS), "workload_demand_and_hub_items": 0},
"coverage_limits": ["array0/1/2 names are UInt16 scalars; vector is the actual array payload and text is the string payload",
"Hub partition count is configured and observed; it is not an independent runtime worker-count setting",
"Deterministic prerequisites are linked by the required candidate-matched adversarial packet; workload measurements do not extrapolate capacity"]}
self.save("workload-results.json", report)
self.save("index.json", {"files": [{"path": path.name, "sha256": hashlib.sha256(path.read_bytes()).hexdigest(), "bytes": path.stat().st_size}
for path in sorted(self.folder.iterdir()) if path.is_file() and path.name != "index.json"]})
return report
def main(argv=None):
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--run-id", required=True)
parser.add_argument("--profiles", type=Path, default=Path(__file__).with_name("workload-profiles.json"))
parser.add_argument("--select", action="append", help="profile id or group; repeatable")
parser.add_argument("--manifest", type=Path)
parser.add_argument("--adversarial-packet", type=Path, help="restricted passing current-candidate packet; defaults to this rig's adversarial-evidence/packet.json")
args = parser.parse_args(argv)
try:
document = validate_profiles(json.loads(args.profiles.read_text()))
report = WorkloadRunner(args.run_id, manifest_path=args.manifest).run_workloads(document, args.select, args.adversarial_packet)
print(json.dumps({"passed": report["passed"], "profiles": [row["id"] for row in report["rows"]]}))
return 0 if report["passed"] else 1
except Exception as error:
print("grpc-data workload: " + type(error).__name__ + "; restricted diagnostics retained")
return 2
if __name__ == "__main__":
raise SystemExit(main())
@@ -0,0 +1,194 @@
using Grpc.Core;
using Microsoft.AspNetCore.Server.Kestrel.Core;
using Shouldly;
using Xunit;
using ZB.MOM.WW.OtOpcUa.Core.Abstractions.DataConnections;
using ZB.MOM.WW.OtOpcUa.Host.Configuration;
using ZB.MOM.WW.OtOpcUa.Runtime.DataConnections;
namespace ZB.MOM.WW.OtOpcUa.Host.IntegrationTests.DataConnections;
[Trait("Category", "Integration"), Trait("Feature", "GrpcData"), Trait("Phase", "P11")]
public sealed class GrpcDataReconnectStormWireTests
{
[Fact(Timeout = 60000)]
public async Task Concurrent_reconnects_after_active_loss_get_new_snapshots_and_drain_old_streams()
{
const int clients = 4;
using var active = new ControlledOrigin(new("node-a", "old-boot", "Primary", 1, 1, 1), 42, true);
using var standby = new ControlledOrigin(new("node-b", "new-boot", "Primary", 1, 1, 2), 43, false);
await using var first = await GrpcDataWireFixture.StartAsync(HttpProtocols.Http2, new(active.Create));
await using var second = await GrpcDataWireFixture.StartAsync(HttpProtocols.Http2, new(standby.Create));
var trust = new DataConnectionTrustPolicy(1, [first.Ca, second.Ca]);
var security = new EndpointSecurity(first, second, trust);
using var manager = new DataConnectionManager("consumer", 1);
manager.ApplyScope(new Dictionary<string, IReadOnlySet<string>> { ["link"] = new HashSet<string> { "consumer" } });
var endpointA = new UriBuilder("https", "localhost", first.TlsAddress.Port).Uri;
var endpointB = new UriBuilder("https", "localhost", second.TlsAddress.Port).Uri;
await using var connection = new GrpcDataConnection("link", new(DataTargetMode.Cluster, "cluster", null),
[endpointA, endpointB], security, manager.Acquire("link"), 65536, 2,
eligibleNodeIds: new HashSet<string> { "node-a", "node-b" }, maxStreams: clients, maxMonitoredItems: 8);
var token = TestContext.Current.CancellationToken;
var old = await Task.WhenAll(Enumerable.Range(0, clients).Select(i => OpenAsync(connection, i, 1, token)));
try
{
await Task.WhenAll(old.Select(x => ReadSnapshotAsync(x.Reader, active.Serving, 42, token)));
active.ActiveStreams.ShouldBe(clients);
await Should.ThrowAsync<InvalidOperationException>(() => connection.SubscribeAsync(token));
active.ActiveStreams.ShouldBe(clients, "the stream limit must reject before another physical subscription");
using var value = DataValue.FromScalar(DataValueKind.Int32, 8);
var request = new WriteBatch([new("write", "operation-1", View, value, 1, "old-boot", TimeSpan.FromSeconds(5), 1)], Budget);
var outcome = await connection.WriteAsync(request, token);
outcome.ShouldHaveSingleItem().Outcome.State.ShouldBe(DataWriteState.OutcomeUnknown);
active.WriteCalls.ShouldBe(1); standby.WriteCalls.ShouldBe(0);
active.Lose(); standby.Promote();
await Task.WhenAll(old.Select(async x =>
{
try
{
while (await x.Reader.MoveNextAsync())
{
var frame = x.Reader.Current;
if (frame is DataSubscriptionValues values)
{ values.Dispose(); throw new InvalidOperationException("An old stream delivered values after its origin was lost."); }
}
}
catch (Exception ex) when (ex is RpcException or OperationCanceledException or System.IO.IOException) { }
finally { await x.Reader.DisposeAsync(); await x.Stream.DisposeAsync(); }
}));
await active.Drained.Task.WaitAsync(TimeSpan.FromSeconds(10), token);
active.ActiveStreams.ShouldBe(0);
await first.StopAsync();
standby.WriteCalls.ShouldBe(0, "an ambiguous write is never replayed after failover");
var renewed = await Task.WhenAll(Enumerable.Range(0, clients).Select(i => OpenAsync(connection, i, 2, token)));
try
{
await Task.WhenAll(renewed.Select(x => ReadSnapshotAsync(x.Reader, standby.Serving, 43, token)));
standby.ActiveStreams.ShouldBe(clients);
standby.WriteCalls.ShouldBe(0);
}
finally
{
foreach (var item in renewed) { await item.Reader.DisposeAsync(); await item.Stream.DisposeAsync(); }
}
await standby.Drained.Task.WaitAsync(TimeSpan.FromSeconds(10), token);
standby.ActiveStreams.ShouldBe(0);
}
finally
{
active.Lose(); standby.Lose();
foreach (var item in old) { await item.Reader.DisposeAsync(); await item.Stream.DisposeAsync(); }
}
}
private static readonly DataBudget Budget = new(TimeSpan.FromSeconds(5), 8, 65536);
private static readonly DataView View = new(new("cluster", "urn:test", "string", "source"), DataRealm.Raw, null, 0, "source");
private static readonly DataSubscriptionSettings Settings = new(TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(1), DataChangeTrigger.StatusValue, null);
private static async Task<(IDataSubscription Stream, IAsyncEnumerator<DataSubscriptionFrame> Reader)> OpenAsync(GrpcDataConnection connection, int index, long epoch, CancellationToken token)
{
var stream = await connection.SubscribeAsync(token);
try
{
await stream.SendAsync(new OpenSubscription("storm-" + index, epoch, "open", TimeSpan.FromSeconds(5),
[new("item", View, Settings)], false, TimeSpan.FromSeconds(30), Budget), token);
return (stream, stream.ReadAllAsync(token).GetAsyncEnumerator(token));
}
catch { await stream.DisposeAsync(); throw; }
}
private static async Task ReadSnapshotAsync(IAsyncEnumerator<DataSubscriptionFrame> reader, ServingIdentity serving, int expected, CancellationToken token)
{
(await reader.MoveNextAsync().AsTask().WaitAsync(TimeSpan.FromSeconds(10), token)).ShouldBeTrue();
reader.Current.ShouldBeOfType<DataSubscriptionAck>().Items.ShouldHaveSingleItem().Status.ShouldBe(DataItemStatus.Good);
(await reader.MoveNextAsync().AsTask().WaitAsync(TimeSpan.FromSeconds(10), token)).ShouldBeTrue();
reader.Current.ShouldBeOfType<DataSubscriptionControl>().Kind.ShouldBe(DataStreamControlKind.SnapshotBegin);
(await reader.MoveNextAsync().AsTask().WaitAsync(TimeSpan.FromSeconds(10), token)).ShouldBeTrue();
using (var values = reader.Current.ShouldBeOfType<DataSubscriptionValues>())
{
values.IsSnapshot.ShouldBeTrue();
var sample = values.Items.ShouldHaveSingleItem().Sample; sample.Serving.ShouldBe(serving); sample.Value.GetScalar().ShouldBe(expected);
}
(await reader.MoveNextAsync().AsTask().WaitAsync(TimeSpan.FromSeconds(10), token)).ShouldBeTrue();
reader.Current.ShouldBeOfType<DataSubscriptionControl>().Kind.ShouldBe(DataStreamControlKind.SnapshotEnd);
}
private sealed class EndpointSecurity(GrpcDataWireFixture first, GrpcDataWireFixture second, DataConnectionTrustPolicy trust) : IDataConnectionSecurityProvider
{
public event Action<string>? Changed { add { } remove { } }
public ValueTask<DataConnectionSecurity?> ResolveAsync(string connectionId, Uri endpoint, CancellationToken token) =>
ValueTask.FromResult<DataConnectionSecurity?>(new("credential", trust.Fingerprint,
endpoint.Port == first.TlsAddress.Port ? first.Bearer : second.Bearer, trust.CreateHandler));
}
private sealed class ControlledOrigin(ServingIdentity serving, int value, bool ready) : IDisposable
{
private int _ready = ready ? 1 : 0, _active, _writeCalls;
private readonly CancellationTokenSource _lost = new();
internal readonly TaskCompletionSource Drained = new(TaskCreationOptions.RunContinuationsAsynchronously);
internal ServingIdentity Serving => serving;
internal int InitialValue => value;
internal int ActiveStreams => Volatile.Read(ref _active);
internal int WriteCalls => Volatile.Read(ref _writeCalls);
internal void Promote() => Volatile.Write(ref _ready, 1);
internal void Lose() { Volatile.Write(ref _ready, 0); _lost.Cancel(); if (ActiveStreams == 0) Drained.TrySetResult(); }
public void Dispose() => _lost.Dispose();
internal IDataConnection Create(DataTarget target) => new Connection(this, target);
private sealed class Connection(ControlledOrigin owner, DataTarget target) : IDataConnection, IDataConnectionPublicationGate, IDataConnectionDiscoveryGate
{
public DataTarget Target => target;
public TimeProvider Clock => TimeProvider.System;
public bool CanPublish(ServingIdentity expected) => Volatile.Read(ref owner._ready) != 0 && expected == owner.Serving;
public bool CanPublishCapabilities(DataCapabilities expected) => expected.Serving == owner.Serving && expected.Readiness == (Volatile.Read(ref owner._ready) != 0 ? DataReadiness.Ready : DataReadiness.Unavailable);
public Task<DataCapabilities> GetCapabilitiesAsync(DataBudget budget, CancellationToken token) => Task.FromResult(new DataCapabilities(1, 3,
owner.Serving, Volatile.Read(ref owner._ready) != 0 ? DataReadiness.Ready : DataReadiness.Unavailable,
DataOperations.Subscribe | DataOperations.Write, new HashSet<DataValueKind> { DataValueKind.Int32 },
new(16, 16, 65536, 8, 4, 65536, TimeSpan.FromSeconds(5), TimeSpan.FromMinutes(1), TimeSpan.FromSeconds(5)),
true, 1, "cluster", true, true, true));
public Task<IDataSubscription> SubscribeAsync(CancellationToken token)
{ Interlocked.Increment(ref owner._active); return Task.FromResult<IDataSubscription>(new Stream(owner)); }
public Task<IReadOnlyList<WriteItemResult>> WriteAsync(WriteBatch request, CancellationToken token)
{ Interlocked.Increment(ref owner._writeCalls); throw new RpcException(new Status(StatusCode.Unavailable, "Simulated lost write reply after dispatch.")); }
public Task<DataBrowseBranch> BrowseAsync(BrowseRequest request, CancellationToken token) => throw new NotSupportedException();
public Task<IReadOnlyList<DataItemResult<DataMetadata>>> GetMetadataAsync(MetadataRequest request, CancellationToken token) => throw new NotSupportedException();
public Task<IReadOnlyList<ReadResult>> ReadAsync(ReadRequest request, CancellationToken token) => throw new NotSupportedException();
public ValueTask DisposeAsync() => ValueTask.CompletedTask;
}
private sealed class Stream(ControlledOrigin owner) : IDataSubscriptionTransport
{
private readonly TaskCompletionSource<OpenSubscription> _open = new(TaskCreationOptions.RunContinuationsAsynchronously);
private int _disposed;
public Task SendAsync(DataSubscriptionCommand command, CancellationToken token)
{ _open.TrySetResult((OpenSubscription)command); return Task.CompletedTask; }
public IAsyncEnumerable<DataSubscriptionFrame> ReadAllAsync(CancellationToken token) => throw new NotSupportedException();
public async Task RunDeliveryAsync(IDataSubscriptionDeliverySink sink, CancellationToken token)
{
using var linked = CancellationTokenSource.CreateLinkedTokenSource(token, owner._lost.Token);
var open = await _open.Task.WaitAsync(linked.Token);
var handle = new DataItemHandle(open.SubscriptionId, open.StreamEpoch, 1, 1);
async Task Send(DataSubscriptionFrame frame)
{
try
{
using var prepared = await sink.PrepareAsync(frame, 16384, linked.Token);
((IDataPreparedSubscriptionPublication)prepared).SetPublicationGuard(() => Volatile.Read(ref owner._ready) != 0 && !owner._lost.IsCancellationRequested);
await sink.WriteAsync(prepared, linked.Token);
}
finally { (frame as IDisposable)?.Dispose(); }
}
await Send(new DataSubscriptionAck(open.SubscriptionId, open.StreamEpoch, 1, open.CommandId,
[new(open.Items[0].ClientItemId, DataItemStatus.Good, handle, open.Items[0].Settings, null)]));
await Send(new DataSubscriptionControl(open.SubscriptionId, open.StreamEpoch, 2, DataStreamControlKind.SnapshotBegin, [], 1, 1, null));
await Send(new DataSubscriptionValues(open.SubscriptionId, open.StreamEpoch, 3, true,
[new(handle, new(DataValue.FromScalar(DataValueKind.Int32, owner.InitialValue), 0, null, null, owner.Serving, 1), new(TimeSpan.Zero, TimeSpan.Zero), DataReadiness.Ready)]));
await Send(new DataSubscriptionControl(open.SubscriptionId, open.StreamEpoch, 4, DataStreamControlKind.SnapshotEnd, [], 1, 1, null));
try { await Task.Delay(Timeout.Infinite, linked.Token); } catch (OperationCanceledException) when (linked.IsCancellationRequested) { }
}
public ValueTask DisposeAsync()
{
if (Interlocked.Exchange(ref _disposed, 1) == 0 && Interlocked.Decrement(ref owner._active) == 0) owner.Drained.TrySetResult();
return ValueTask.CompletedTask;
}
}
}
}
@@ -0,0 +1,143 @@
using Grpc.Core;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Options;
using Shouldly;
using Xunit;
using ZB.MOM.WW.OtOpcUa.Commons.DataConnections;
using ZB.MOM.WW.OtOpcUa.Configuration.Entities;
using ZB.MOM.WW.OtOpcUa.Core.Abstractions.DataConnections;
using ZB.MOM.WW.OtOpcUa.Core.Authorization;
using ZB.MOM.WW.OtOpcUa.Host.Configuration;
using ZB.MOM.WW.OtOpcUa.Host.Grpc;
using ZB.MOM.WW.OtOpcUa.Host.OpcUa;
using W = ZB.MOM.WW.OtOpcUa.Commons.Protos.DataConnection.V1;
namespace ZB.MOM.WW.OtOpcUa.Host.Tests.DataConnections;
[Trait("Category", "Unit"), Trait("Feature", "GrpcData"), Trait("Phase", "P11")]
public sealed class GrpcDataCompactNegotiationTests
{
[Theory]
[InlineData(false, false)]
[InlineData(true, true)]
public async Task Stream_uses_compact_only_after_explicit_supported_opt_in(bool optIn, bool compact)
{
var headers = new Metadata(); if (optIn) headers.Add("x-data-compact-codec", "1");
var fixture = Create(headers, peerSupportsCompact: true);
var writer = new Writer();
await fixture.Service.Subscribe(new Reader(), writer, fixture.Context);
var frame = writer.Frames.ShouldHaveSingleItem();
(frame.CompactValues is not null).ShouldBe(compact);
(frame.Values is not null).ShouldBe(!compact);
frame.Serving.ShouldNotBeNull();
}
[Fact]
public async Task Opt_in_does_not_override_a_server_without_the_codec()
{
var fixture = Create(new Metadata { { "x-data-compact-codec", "1" } }, peerSupportsCompact: false);
var writer = new Writer(); await fixture.Service.Subscribe(new Reader(), writer, fixture.Context);
writer.Frames.ShouldHaveSingleItem().Values.ShouldNotBeNull();
}
[Theory]
[InlineData("2", false)]
[InlineData("1", true)]
public async Task Invalid_or_duplicate_codec_header_is_rejected(string value, bool duplicate)
{
var headers = new Metadata { { "x-data-compact-codec", value } };
if (duplicate) headers.Add("x-data-compact-codec", "1");
var fixture = Create(headers, peerSupportsCompact: true);
var failure = await Should.ThrowAsync<RpcException>(() => fixture.Service.Subscribe(new Reader(), new Writer(), fixture.Context));
failure.StatusCode.ShouldBe(StatusCode.InvalidArgument);
}
private static (DataConnectionGrpcService Service, CallContext Context) Create(Metadata headers, bool peerSupportsCompact)
{
var (bearer, id, hash) = ApiKeySecret.Generate("pepper");
var authority = new DataPlaneAuthorityState();
authority.Apply("cluster", "v1", [new ApiKey { ApiKeyId = id, Name = "test", Principal = "peer", SecretHash = hash, Enabled = true }],
[], new Dictionary<AclScopeRef, IReadOnlyList<NodeAclPath>>());
var authenticator = new DataConnectionAuthenticator(authority, Options.Create(new ApiKeyOptions { Pepper = "pepper" }), TimeProvider.System);
var options = new DataConnectionOptions { Enabled = true, ListenPort = 9443, AllowedHosts = ["source.local"], CertificatePath = "server.pem" };
var context = new CallContext(headers); var http = new DefaultHttpContext();
http.Connection.LocalPort = 9443; http.Request.Protocol = "HTTP/2"; http.Request.Scheme = "https"; http.Request.Method = "POST";
http.Request.Host = new HostString("source.local", 9443); http.Request.Path = context.Method;
http.Items[typeof(DataAuthenticatedContext)] = authenticator.Authenticate(bearer);
http.Items[typeof(DataTarget)] = new DataTarget(DataTargetMode.Node, "cluster", "node");
context.UserState["__HttpContext"] = http;
return (new DataConnectionGrpcService(new Factory(peerSupportsCompact), Options.Create(options), authenticator), context);
}
private sealed class Factory(bool compact) : IDataConnectionFactory
{ public IDataConnection Create(DataAuthenticatedContext context, DataTarget target) => new Connection(target, compact); }
private sealed class Connection(DataTarget target, bool compact) : IDataConnection, IDataConnectionPublicationGate
{
internal static readonly ServingIdentity Serving = new("node", "boot", "Primary", 1, 1, 1);
public DataTarget Target => target;
public TimeProvider Clock => TimeProvider.System;
public bool CanPublish(ServingIdentity expectedServing) => expectedServing == Serving;
public Task<DataCapabilities> GetCapabilitiesAsync(DataBudget budget, CancellationToken token) => Task.FromResult(new DataCapabilities(1, 3, Serving, DataReadiness.Ready,
DataOperations.Subscribe, new HashSet<DataValueKind> { DataValueKind.Int32 },
new(16, 16, 65536, 16, 4, 65536, TimeSpan.FromSeconds(5), TimeSpan.FromMinutes(1), TimeSpan.FromSeconds(5)), compact, compact ? 1 : 0, "cluster", true, true));
public Task<IDataSubscription> SubscribeAsync(CancellationToken token) => Task.FromResult<IDataSubscription>(new Subscription());
public Task<DataBrowseBranch> BrowseAsync(BrowseRequest request, CancellationToken token) => throw new NotSupportedException();
public Task<IReadOnlyList<DataItemResult<DataMetadata>>> GetMetadataAsync(MetadataRequest request, CancellationToken token) => throw new NotSupportedException();
public Task<IReadOnlyList<ReadResult>> ReadAsync(ReadRequest request, CancellationToken token) => throw new NotSupportedException();
public Task<IReadOnlyList<WriteItemResult>> WriteAsync(WriteBatch request, CancellationToken token) => throw new NotSupportedException();
public ValueTask DisposeAsync() => ValueTask.CompletedTask;
}
private sealed class Subscription : IDataSubscriptionTransport
{
private readonly TaskCompletionSource _opened = new(TaskCreationOptions.RunContinuationsAsynchronously);
public Task SendAsync(DataSubscriptionCommand command, CancellationToken token) { _opened.TrySetResult(); return Task.CompletedTask; }
public IAsyncEnumerable<DataSubscriptionFrame> ReadAllAsync(CancellationToken token) => throw new NotSupportedException();
public async Task RunDeliveryAsync(IDataSubscriptionDeliverySink sink, CancellationToken token)
{
await _opened.Task.WaitAsync(token);
using var frame = new DataSubscriptionValues("s", 1, 1, true,
[new(new("s", 1, 1, 1), new(DataValue.FromScalar(DataValueKind.Int32, 42), 0, null, null, Connection.Serving, 1), new(TimeSpan.Zero, TimeSpan.Zero), DataReadiness.Ready)]);
using var prepared = await sink.PrepareAsync(frame, 16384, token);
((IDataPreparedSubscriptionPublication)prepared).SetPublicationGuard(() => true);
await sink.WriteAsync(prepared, token);
}
public ValueTask DisposeAsync() => ValueTask.CompletedTask;
}
private sealed class Reader : IAsyncStreamReader<W.SubscriptionCommand>
{
private int _read;
public W.SubscriptionCommand Current { get; private set; } = null!;
public async Task<bool> MoveNext(CancellationToken token)
{
if (Interlocked.Exchange(ref _read, 1) == 0)
{
Current = DataProtoMapper.EncodeCommand(new OpenSubscription("s", 1, "open", TimeSpan.FromSeconds(5), [], false,
TimeSpan.FromMinutes(1), new(TimeSpan.FromSeconds(5), 1, 4096)));
return true;
}
await Task.Delay(Timeout.Infinite, token); return false;
}
}
private sealed class Writer : IServerStreamWriter<W.SubscriptionFrame>
{
public List<W.SubscriptionFrame> Frames { get; } = [];
public WriteOptions? WriteOptions { get; set; }
public Task WriteAsync(W.SubscriptionFrame frame) { Frames.Add(frame); return Task.CompletedTask; }
public Task WriteAsync(W.SubscriptionFrame frame, CancellationToken cancellationToken) => WriteAsync(frame);
}
private sealed class CallContext(Metadata headers) : ServerCallContext
{
protected override string MethodCore => DataConnectionEndpoints.ServicePrefix + "Subscribe";
protected override string HostCore => "source.local";
protected override string PeerCore => "ipv4:127.0.0.1:0";
protected override DateTime DeadlineCore => DateTime.MaxValue;
protected override Metadata RequestHeadersCore => headers;
protected override CancellationToken CancellationTokenCore => TestContext.Current.CancellationToken;
protected override Metadata ResponseTrailersCore { get; } = [];
protected override Status StatusCore { get; set; }
protected override WriteOptions? WriteOptionsCore { get; set; }
protected override AuthContext AuthContextCore => new(null, new Dictionary<string, List<AuthProperty>>());
protected override ContextPropagationToken CreatePropagationTokenCore(ContextPropagationOptions? options) => throw new NotSupportedException();
protected override Task WriteResponseHeadersAsyncCore(Metadata responseHeaders) => Task.CompletedTask;
}
}
@@ -0,0 +1,56 @@
using Shouldly;
using Xunit;
using ZB.MOM.WW.OtOpcUa.Core.Abstractions;
using ZB.MOM.WW.OtOpcUa.Core.Abstractions.DataConnections;
namespace ZB.MOM.WW.OtOpcUa.OpcUaServer.Tests.DataConnections;
[Trait("Category", "Unit"), Trait("Feature", "GrpcData"), Trait("Phase", "P11")]
public sealed class GrpcDataSdkSampleEvidenceTests
{
[Fact]
public void Status_match_only_normalizes_an_empty_datavalue_info_type()
{
ProjectedMonitoredItem.SameObservedStatus(0x00000400u, 0u).ShouldBeTrue();
ProjectedMonitoredItem.SameObservedStatus(0x80000400u, 0x80000000u).ShouldBeTrue();
ProjectedMonitoredItem.SameObservedStatus(0x00000480u, 0u).ShouldBeFalse();
ProjectedMonitoredItem.SameObservedStatus(0x00001400u, 0u).ShouldBeFalse();
ProjectedMonitoredItem.SameObservedStatus(0x40000400u, 0u).ShouldBeFalse();
ProjectedMonitoredItem.SameObservedStatus(0x00000800u, 0u).ShouldBeFalse();
}
[Fact]
public void Repeat_observation_matches_the_same_source_acquisition_without_replacing_queued_evidence()
{
var identity = new object();
var timestamp = new DateTime(2026, 1, 1, 0, 0, 0, DateTimeKind.Utc);
var sample = new ProjectedValueWrite(DataRealm.Raw, "projected", 1,
new ServingIdentity("node", "incarnation", "Primary", 1, 1, 1),
new DataValueSnapshot(new[] { 1, 2 }, 0, timestamp, timestamp),
new DataAgeBounds(TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(2)), 123,
new Proof(identity), SourceVersion: 7);
var replay = sample with
{
Snapshot = sample.Snapshot with { Value = new[] { 1, 2 } },
Proof = new Proof(identity), IsCompleteSnapshot = true
};
ProjectedMonitoredItem.SameAcquisition(sample, replay).ShouldBeTrue();
ProjectedMonitoredItem.SameAcquisition(sample, replay with { SourceVersion = 8 }).ShouldBeFalse();
ProjectedMonitoredItem.SameAcquisition(sample, replay with { SourceVersion = null }).ShouldBeFalse();
ProjectedMonitoredItem.SameAcquisition(sample, replay with { SourceVersion = 0 }).ShouldBeFalse();
ProjectedMonitoredItem.SameAcquisition(sample, replay with { Proof = new Proof(new object()) }).ShouldBeFalse();
ProjectedMonitoredItem.SameAcquisition(sample, replay with { ReceivedTimestamp = 124 }).ShouldBeTrue();
ProjectedMonitoredItem.SameAcquisition(sample, replay with { OriginAgeBounds = new(TimeSpan.Zero, TimeSpan.FromSeconds(2)) }).ShouldBeTrue();
ProjectedMonitoredItem.SameAcquisition(sample, replay with { Serving = replay.Serving with { ServingGeneration = 2 } }).ShouldBeFalse();
ProjectedMonitoredItem.SameAcquisition(sample, replay with { Snapshot = replay.Snapshot with { ServerTimestampUtc = timestamp.AddTicks(1) } }).ShouldBeFalse();
ProjectedMonitoredItem.SameAcquisition(sample, replay with { Snapshot = replay.Snapshot with { Value = new[] { 1, 3 } } }).ShouldBeFalse();
}
private sealed class Proof(object identity) : IProjectedSamplePublicationProof
{
public bool IsValid => true;
public object SourceIdentity => identity;
public TimeProvider Clock => TimeProvider.System;
public void Invalidate() { }
}
}
@@ -0,0 +1,105 @@
using System.Collections;
using Google.Protobuf;
using Shouldly;
using Xunit;
using ZB.MOM.WW.OtOpcUa.Commons.DataConnections;
using ZB.MOM.WW.OtOpcUa.Core.Abstractions.DataConnections;
using ZB.MOM.WW.OtOpcUa.Runtime.DataConnections;
namespace ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections;
[Trait("Category", "Integration"), Trait("Feature", "GrpcData"), Trait("Phase", "P11")]
public sealed class GrpcDataAdversarialRecoveryTests
{
[Fact(Timeout = 30000)]
public async Task Revocation_while_protobuf_values_are_encoding_fences_handoff_and_drains_charges()
{
var demand = new DeferredSubscriptionDemand(); demand.Accept();
var capacity = new SubscriptionTransportCapacity(1, 1, 1_000_000);
var limits = new SubscriptionSessionLimits(16, 16, 100_000, TimeSpan.FromMinutes(1));
LocalDataFixture? fixture = null;
using (fixture = new LocalDataFixture(subscriptions: context => new LocalSubscriptionService(fixture!.Services, context,
new(DataTargetMode.Node, "cluster", "node-a"), demand, limits, capacity)))
{
fixture.Publish(42);
var baseline = fixture.Hub.Resources.RetainedBytes;
await using var connection = fixture.Connection();
await using var subscription = await connection.SubscribeAsync(TestContext.Current.CancellationToken);
using var sink = new HeldEncoderSink();
var delivery = ((IDataSubscriptionTransport)subscription).RunDeliveryAsync(sink, TestContext.Current.CancellationToken);
var settings = new DataSubscriptionSettings(TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(1), DataChangeTrigger.StatusValue, null);
await subscription.SendAsync(new OpenSubscription("s", 1, "open", TimeSpan.FromSeconds(5),
[new("one", fixture.Raw, settings)], false, TimeSpan.FromSeconds(30), LocalDataFixture.Budget), TestContext.Current.CancellationToken);
try
{
await sink.EncoderEntered.Task.WaitAsync(TimeSpan.FromSeconds(5), TestContext.Current.CancellationToken);
capacity.ActiveOperations.ShouldBe(1);
fixture.Hub.Resources.RetainedBytes.ShouldBeGreaterThan(baseline);
fixture.Activation.Begin("revoke-while-encoding");
}
finally { sink.Release(); }
await sink.Encoded.Task.WaitAsync(TimeSpan.FromSeconds(5), TestContext.Current.CancellationToken);
await sink.Disposed.Task.WaitAsync(TimeSpan.FromSeconds(5), TestContext.Current.CancellationToken);
await delivery.WaitAsync(TimeSpan.FromSeconds(5), TestContext.Current.CancellationToken);
await subscription.DisposeAsync();
sink.ValueHandoffs.ShouldBe(0, "revoked bytes must never reach the transport write boundary");
capacity.ActiveOperations.ShouldBe(0);
fixture.Hub.Resources.RetainedBytes.ShouldBe(baseline);
capacity.Snapshots.TryAcquire("peer", 1, out var next).ShouldBeTrue(); next!.Dispose();
}
}
private sealed class HeldEncoderSink : IDataSubscriptionDeliverySink, IDisposable
{
private readonly ManualResetEventSlim _release = new();
internal readonly TaskCompletionSource EncoderEntered = new(TaskCreationOptions.RunContinuationsAsynchronously);
internal readonly TaskCompletionSource Encoded = new(TaskCreationOptions.RunContinuationsAsynchronously);
internal readonly TaskCompletionSource Disposed = new(TaskCreationOptions.RunContinuationsAsynchronously);
internal int ValueHandoffs;
public async ValueTask<IDataPreparedSubscriptionDelivery> PrepareAsync(DataSubscriptionFrame frame, long reservedBytes, CancellationToken cancellationToken)
{
if (frame is not DataSubscriptionValues values)
return new Prepared(DataProtoMapper.EncodeControlOrAck(frame).ToByteArray(), false, this);
// The production mapper is actively enumerating the real session's owned sample
// when authority is revoked. The adapter holds only borrowed references; the session
// remains the sole owner of the original frame and its resource leases.
var borrowed = new DataSubscriptionValues(values.SubscriptionId, values.StreamEpoch, values.Sequence, values.IsSnapshot,
new HeldItems(values.Items, EncoderEntered, _release));
var bytes = await Task.Run(() => DataProtoMapper.EncodeValues(borrowed, true, subscriptionAgeReadiness: true).ToByteArray());
Encoded.TrySetResult();
return new Prepared(bytes, true, this);
}
public ValueTask WriteAsync(IDataPreparedSubscriptionDelivery prepared, CancellationToken cancellationToken)
{
var value = (Prepared)prepared;
if (value.IsValue && value.Guard?.Invoke() == true) Interlocked.Increment(ref ValueHandoffs);
return ValueTask.CompletedTask;
}
internal void Release() => _release.Set();
public void Dispose() { _release.Set(); _release.Dispose(); }
private sealed class Prepared(byte[] bytes, bool value, HeldEncoderSink owner) : IDataPreparedSubscriptionPublication
{
internal bool IsValue => value;
internal Func<bool>? Guard;
public long RetainedBytes => bytes.Length;
public void SetPublicationGuard(Func<bool> guard) => Guard = guard;
public void Dispose() { if (value) owner.Disposed.TrySetResult(); }
}
private sealed class HeldItems(IReadOnlyList<DataSubscriptionValue> items, TaskCompletionSource entered, ManualResetEventSlim release)
: IReadOnlyList<DataSubscriptionValue>
{
public int Count => items.Count;
public DataSubscriptionValue this[int index] => items[index];
public IEnumerator<DataSubscriptionValue> GetEnumerator()
{
foreach (var item in items)
{
entered.TrySetResult();
if (!release.Wait(TimeSpan.FromSeconds(10))) throw new TimeoutException("Encoder gate was not released.");
yield return item;
}
}
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
}
}
}
@@ -0,0 +1,102 @@
using Akka.Actor;
using Shouldly;
using Xunit;
using ZB.MOM.WW.OtOpcUa.Core.Abstractions.DataConnections;
using ZB.MOM.WW.OtOpcUa.Runtime.DataConnections;
using ZB.MOM.WW.OtOpcUa.Runtime.Drivers;
using ZB.MOM.WW.OtOpcUa.Runtime.Tests.Harness;
namespace ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections;
[Trait("Feature", "GrpcData"), Trait("Category", "Unit"), Trait("Phase", "P11")]
public sealed class GrpcDataWorkloadAccountingTests : RuntimeActorTestBase
{
[Fact]
public void Logical_sharing_counts_preserve_principal_and_pinned_target_boundaries()
{
var registry = new UpstreamDemandRegistry(8, 8);
var key = new DemandSharingKey(HubTest.Ticket("driver", "tag").Key,
new(DataTargetMode.Node, "cluster", "node-a"), DataConsistency.Primary, "principal", "export", 1, 1);
var settings = new DataSubscriptionSettings(TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(1), DataChangeTrigger.StatusValue, null);
registry.TryAdd(key, settings, out var first).ShouldBeTrue();
registry.TryAdd(key, settings, out var overlapping).ShouldBeTrue();
registry.TryAdd(key with { PrincipalId = "other" }, settings, out var principal).ShouldBeTrue();
registry.TryAdd(key with { Target = key.Target with { ExpectedNodeId = "node-b" } }, settings, out var pinned).ShouldBeTrue();
registry.CaptureAccounting().ShouldBe((3, 4));
first!.Dispose(); overlapping!.Dispose();
registry.CaptureAccounting().ShouldBe((2, 2));
principal!.Dispose(); pinned!.Dispose();
registry.CaptureAccounting().ShouldBe((0, 0));
}
[Fact]
public void Snapshot_disposal_releases_snapshot_charge_while_steady_interest_remains_owned()
{
using var hub = HubTest.Create(partitions: 1);
var ticket = HubTest.Ticket("driver", "tag");
HubTest.BindAndPublish(hub, ticket, 1, 42);
hub.ProcessPending();
var before = hub.CaptureAccounting();
before.TrackedSources.ShouldBe(1);
before.SnapshotItems.ShouldBe(0);
before.InterestItems.ShouldBe(0);
hub.TryCaptureInterestSnapshot([ticket], HubTest.Budget, CancellationToken.None, out var snapshot, out var interest).ShouldBeTrue();
try
{
var during = hub.CaptureAccounting();
during.SnapshotItems.ShouldBe(1); during.InterestItems.ShouldBe(1);
during.RetainedBytes.ShouldBeGreaterThan(before.RetainedBytes);
snapshot!.Dispose();
var steady = hub.CaptureAccounting();
steady.SnapshotItems.ShouldBe(0); steady.InterestItems.ShouldBe(1);
steady.RetainedBytes.ShouldBeLessThan(during.RetainedBytes);
}
finally { snapshot!.Dispose(); interest!.Dispose(); }
var after = hub.CaptureAccounting();
after.SnapshotItems.ShouldBe(0); after.InterestItems.ShouldBe(0);
after.RetainedBytes.ShouldBe(before.RetainedBytes);
}
[Fact]
public async Task Applied_physical_count_waits_for_ack_and_remains_until_cleanup_ack()
{
var probe = CreateTestProbe();
var host = Sys.ActorOf(Props.Create(() => new OwnerProxy(probe.Ref)));
using var source = new DriverHostSubscriptionDemandSource(host, new UpstreamDemandRegistry(8, 8), 8, 8,
PresenceBudget, new SubscriptionAcquisitionCapacity(8));
var view = new DataView(new("cluster", "urn:raw", "string", "tag"), DataRealm.Raw, null, 0, "subject");
var authorized = new SubscriptionAuthorizedView(view, SourceKey.ForDriver("cluster", "driver", "tag", "node", "inc"),
new("node", "inc", "Primary", 1, 1),
new(view, "tag", "Variable", DataValueKind.Int32, -1, [], false, DataOperations.Subscribe, 1, "tag", null, false),
"principal", "export", new(DataTargetMode.Node, "cluster", "node"), DataConsistency.Primary, () => true);
var settings = new DataSubscriptionSettings(TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(1), DataChangeTrigger.StatusValue, null);
var token = TestContext.Current.CancellationToken;
var pending = source.AcquireAsync(authorized, settings, token).AsTask();
var apply = probe.ExpectMsg<DriverHostActor.ApplyAcquisitionDemand>(PresenceBudget, cancellationToken: token);
var admitted = source.CaptureAccounting();
admitted.LogicalInterests.ShouldBe(1); admitted.DesiredPhysicalReferences.ShouldBe(1);
admitted.AppliedPhysicalReferences.ShouldBe(0);
probe.Reply(new DriverInstanceActor.AcquisitionDemandApplied(apply.DesiredRevision, 7, settings.SamplingInterval, true));
var lease = (await pending.WaitAsync(PresenceBudget, token)).Lease.ShouldNotBeNull();
source.CaptureAccounting().AppliedPhysicalReferences.ShouldBe(1);
lease.Dispose();
var removal = probe.ExpectMsg<DriverHostActor.ApplyAcquisitionDemand>(PresenceBudget, cancellationToken: token);
var retiring = source.CaptureAccounting();
retiring.LogicalInterests.ShouldBe(0); retiring.DesiredPhysicalReferences.ShouldBe(0);
retiring.AppliedPhysicalReferences.ShouldBe(1); retiring.RetiringDrivers.ShouldBe(1);
probe.Reply(new DriverInstanceActor.AcquisitionDemandApplied(removal.DesiredRevision, 7, TimeSpan.Zero, true));
await source.WaitForDriverIdleForTest("driver").WaitAsync(PresenceBudget, token);
source.CaptureAccounting().AppliedPhysicalReferences.ShouldBe(0);
}
private sealed class OwnerProxy : ReceiveActor
{
public OwnerProxy(IActorRef target)
{
Receive<DriverHostActor.RegisterAcquisitionOwner>(_ => Sender.Tell(new DriverHostActor.AcquisitionOwnerRegistered(true, 1)));
Receive<DriverHostActor.OpenAcquisitionDemand>(message => Sender.Tell(new DriverHostActor.AcquisitionDemandOpened(true, message.RequestedKeyGeneration)));
Receive<DriverHostActor.AbortOpenAcquisitionDemand>(_ => Sender.Tell(new DriverHostActor.AcquisitionOpenAborted(true)));
Receive<DriverHostActor.ApplyAcquisitionDemand>(message => target.Forward(message));
}
}
}