feat: host tls data service and route node and cluster connections

This commit is contained in:
Joseph Doherty
2026-11-16 11:07:34 -05:00
parent b710bf9f74
commit 5ea64b4b6c
95 changed files with 9878 additions and 87 deletions
+51 -1
View File
@@ -22,7 +22,7 @@ The [implementation plan](../../2026-11-15-grpc-data-connections-implementation-
| P04 | Immutable publication, hub and local ports | Passed; Astra approved | 185 R + 16 A + 16 C + 77 O + 74 ScriptWorker + 88 MTConnect + 40 OpcUaClient = 496, no failures/skips; final run `20261116T060538.590404Z-b8ef1894731e` |
| P05 | Mutation tickets/outcomes | Passed; Astra approved | Complete gate 910/910 passed `20261116T084759.594405Z-42a294fc7f4f` after three Astra regression corrections; source and candidate reconciliation approved |
| P06 | Streams/sharing/fair delivery | Passed | 347/347 applicable tests; Astra approved frozen source and evidence |
| P07 | TLS/provisioning/node+cluster clients | Pending | |
| P07 | TLS/provisioning/node+cluster clients | Passed; Astra approved | 393/393 applicable tests, zero failures/skips; final frozen run `20261116T160335.804917Z-5a4994c32d15` |
| P08 | Raw/UNS projection and adapter | Pending | |
| P09 | Authoring/diagnostics/docs | Pending | |
| P10 | Local Docker/CLI/probe integration | Pending | |
@@ -166,3 +166,53 @@ The frozen facade is caller-bound through `IDataConnectionFactory` and `DataAuth
### P06 final gate and approval
The frozen full P06 gate `20261116T121919.790393Z-0175b7fac86f` passed **347/347**, with zero failures or skips: Runtime 234, Abstractions 50, Commons 39, Modbus 24. Astra independently reconciled all four TRX files, HEAD, tracked diff and all 28 untracked production/test file hashes. [Final P06 review](p06-implementation-astra-review.md) approves the phase with no remaining actionable findings. This supersedes the earlier in-progress checkpoint notes; production network composition, Docker validation, benchmarks and final integrated review remain P07/P10/P11/P12 work.
## P07 execution notes
P06 was committed as `b710bf9f7` after approval. Credential missing-API RED is `20261116T123426.173714Z-b6d2bd79e693`; its predecessor `20261116T123338.015389Z-cb0d09ea2adb` caught a missing Xunit import. Remote client missing-API RED is `20261116T123443.452207Z-f447b54a2741`. Astra identified absent serving provenance in empty/error-only unary batches and Ack/Control frames. The additive negotiated response identity extension produced missing-field RED in `20261116T123631.004789Z-c4162d89dd31`, then passed the two new envelope cases and affected existing codec cases in `20261116T123708.013339Z-733e48c76e87`. This is a contract checkpoint, not the P07 phase gate or production network verification.
### P07 component checkpoints and open work
These are targeted component gates, not P07 approval. Dedicated listener policy passed three cases in `20261116T124514.748312Z-81f57a2816c5`. The first Runtime gate `20261116T124421.560971Z-3e0cb57452c4` ran 13 cases (ten passed, three actual role-policy REDs); those fixes plus affected local-read/P06 ordering/recovery passed **59/59** in `20261116T125221.449960Z-a59846699d1c`. Cluster/default Node require Primary, while explicit Node ReadyReplica permits only an actual ready Secondary. Caller authority epoch and target mode participate in final publication.
Credential/trust behavioral RED `20261116T125329.808299Z-78cbe8de8f60` ran 23 cases (19 passed, four failed: overwritten active secret/version binding, durable deletion retry, SAN identity). Notification fan-out RED is `20261116T125519.025923Z-d690c1a866db` (four passed/one failed). Exact same-version notice replay RED is `20261116T130133.632281Z-29545a84cb26` (nine passed/two failed). Their repaired Host component plus listener/auth/binding tests passed **29/29** in `20261116T130336.930026Z-3b0156408b84`; this predates subsequent floor and lifecycle regressions.
Additive serving envelopes are explicitly negotiated through `response_serving_identity`; all empty/error-only unary results and outer stream frames carry Serving. The registered contextual marshaller serializes into a bounded private buffer, then revalidates capture-bound publication before synchronous `Complete(byte[])`. Real service execution enforces NoCompress; this is transport-buffer acceptance, not socket flush or client receipt. Initial binder three-case gate passed `20261116T130009.001707Z-f4443cd19118`. Disposal during blocked final validation produced actual RED in `20261116T131308.089661Z-57464278e345` (31/32 passed), then post-guard state/cancellation checks were corrected. The same run passed scoped generation floors, >256 sequential-ID churn and stale high-version replay after restart. Trust removal/reintroduction subsequently produced actual RED in `20261116T132449.788119Z-5bbb43ed42fb` (13/14 passed); its fix passed the next checkpoint. Observation registration across scope removal produced actual RED in `20261116T133022.795892Z-850aefb609e5` (21/22 passed); repair awaits its next gate.
Remote lifecycle tests first reproduced bounded-retirement, item-budget renewal and browse-lease mismatch in `20261116T130221.847789Z-21fac311a351` (11/15 passed). Corrected duplex harnesses reached real mutable-command, value-version and connection-disposal RED in `20261116T131620.409467Z-354683c116e5` (15/18 passed). Their subsequent component checkpoint `20261116T132916.652106Z-dca2192d7e9c` passed 22/25: two failures were the intentionally missing Runtime final-publication binding, while the proposed unary physical-work failure timed out before its intended assertion and was **not** evidence of a quota escape. Astra inspected pinned grpc-dotnet 2.76 and confirmed unary ResponseAsync retains admission through actual Send/body work; no blanket HTTP tracker was added.
The latest Runtime checkpoint `20261116T134445.606174Z-21b953ccfa43` executed **42 cases: 36 passed/six actual REDs**. Passing cases include the public local composition, source invalidation at late stream serialization (snapshot value and SnapshotEnd), a valid handoff/receipt, ignored-cancellation physical write retention, and corrected ignored unary Send/body admission. Five remaining remote REDs are preheaders duplex disposal (with/without reader), stream setup admission before discovery, reconnect epoch reuse and no-primary backoff. The sixth reproduces source invalidation during unary publication authority validation; root changed the order to leave the fast source proof last, pending rerun. Preliminary compile blockers `20261116T134244.500978Z-eed6e685cbb4` and `20261116T130823.613210Z-d2b84c729d71` were nullable/assertion and test-cancellation errors, not behavioral proof.
Safe credential history reclamation additionally requires a durable authoritative scope generation from central sealing. Missing API REDs are `20261116T134421.362584Z-5376bf1211c7` (Configuration) and `20261116T134423.343227Z-f43f8e65c786` (ControlPlane). The approved direction uses one bounded row locked before the validated draft read, unchanged-scope stable fingerprint/version, and one transaction through artifact save; empty/removal artifacts carry a positive version. Pure composition and drift probes do not mutate the revision. This implementation and its generated migration remain pending. Dedicated TLS listener binding, full production DI/role/actor wiring, deployed-scope application/bundle lifecycle, wire integration tests and complete phase approval also remain pending. No Docker or full solution tests have run.
The first complete CURRENT P07 unit selector checkpoint `20261116T134802.525866Z-44c634f2fd5c` passed **192/192** with zero skips: Host 66, Runtime 82, Commons 41, Configuration 2, ControlPlane 1. It verifies the current remote receipt/setup/backoff/reconnect repairs, final source/publication guard, observed-ID/trust fixes and initial central pure revision/artifact cases. **This is not P07 completion:** Program/actor/DI wiring and deployed scope/bundle activation are not yet implemented; affected sealing regressions, generated migration checks and final phase Astra review are still required. The earlier Runtime behavioral RED `20261116T134445.606174Z-21b953ccfa43` executed 42 (36 passed/six expected new failures), including five remote lifecycle/backoff/epoch findings plus the root read-source recheck. Root nullable-assert compile blocker `20261116T134244.500978Z-eed6e685cbb4` was corrected before that behavioral run. The source guard fix and remote repairs are green in the 192-case checkpoint.
### P07 real composition and lifecycle follow-up
Real Program/Kestrel/DI/actor wiring is now implemented in the working tree; it is not yet phase approved or committed. The old wiring-preparation document is a historical checklist. Actual observed-role owner regressions (missing local snapshot, stopped publisher and superseded publisher) were captured in `20261116T143717.808806Z-1f4e725b2aa4` and now pass. Independent Astra source review then found missing OPC UA publisher catalog injection, a Warm verdict bypass, role-generation ABA and outbound scope surviving failed local staging; these remain explicitly tracked until final reconciliation.
`20261116T151314.060929Z-4848bb946446` passed Host 80/80 and Runtime 119/122, with three newly staged failures for credential rotation, identical artifact replay and bearer rendering. Those were repaired. Pending-command byte limits now follow the configured connection value across all of its streams; its missing-API RED was `20261116T151540.477969Z-f582458ed72d`. Secret invalidation composes the cache, Galaxy directory and data notification independently; public trust bundle APIs bound aggregate root count and DER bytes. Their API RED was `20261116T151548.692271Z-7ee23ed569f7` (an unrelated test import error was corrected before behavioral execution).
`20261116T151707.477456Z-43f007c122a4` reproduced unary starvation when a long stream occupied the only common admission slot. Unary and stream admission now use separate finite lanes. A final monotonic unary budget check after publication validation supplements timer cancellation. Both pass in the later Host gate.
The serving contract now includes additive `ServingGeneration`, with positive generation required by the negotiated remote response-identity contract. `20261116T152240.519810Z-7fe192135f72` executed Runtime 167 cases, 165 passing and two actual failures: a same-role ABA revived an old local publication permit, and a remote advertising generation zero was accepted. Coordinator generation comparison and remote negotiation were repaired. Actual Warm actor tests passed, covering accepted transitions, endpoint disagreement, blocked demotion callbacks, and stale owner fencing.
`20261116T152849.971443Z-55329afdc892` passed Host **87/87**, including the real enabled deferred facade, durable scope barrier, composed invalidator, trust limits and local Warm-over-Hot artifact case. Runtime passed **207/210**: two new regressions proved that a Warm transition after policy capture still dispatched the device write; the internal write proof and final shared fence now retain full Serving identity. The third failure was a stream-ordering fixture attempting nonblocking ingress while its snapshot reader held the partition lock. That test now arranges successful ingress under the existing partition test seam, leaving contention/invalidation behavior covered separately; its affected gate is still pending.
The production OPC UA publisher Props factory is shared with an actual DriverHost-to-publisher held-sink unit. Missing factory API was observed in `20261116T153139.282043Z-0a556b90b0c8`; a subsequent compile check identified the actual Akka resolver type rather than IServiceProvider, which is being corrected. New deployment-attempt barriers synchronously deny old routes before local parsing, and reject stale Apply completions. A transient local scope-store failure currently lacks a scheduled retry; a focused regression is staged before its correction. No Docker/SQL migration apply/live CLI or full-solution test gate has run.
`20261116T154135.539005Z-3185338d739f` passed Runtime 215/218 and Host 87/87. The two expected failures confirmed null/exception local-security resolution needed the same bounded retry timer; both were repaired. The third exposed an invalid actor-test fixture reference (`data/key` instead of required `secret:data/key`), not a production timing defect; parser preconditions now fail immediately. Correcting that fixture exposed the actual Host conversion bug: canonical references were being passed directly to SecretName, which rejects the colon.
The separately continued component runs at `154508` / `154535` / `154631` / `154635` / `154639` passed Runtime 218, Commons 41, Configuration 9 and ControlPlane 21, while Host passed 88/91 with actual failures for canonical physical-store conversion, collateral invalidation, and uppercase physical aliases. Additional Host tests were staged during that sequential batch, so it is not treated as a frozen aggregate candidate. Direct pinned-library testing confirmed SecretName lowercases names. Host now strips only the exact `secret:` prefix when accessing physical rows, keeps canonical references in scope/history, rejects uppercase aliases, and records each successful connection observation's physical SecretName. Unrelated/Galaxy changes preserve data connections; shared-reference users retire together. Central lowercase-alias rejection was actual RED in `20261116T154756.981334Z-ba1d43a247b0` (five passed/two failed), followed by matching validator repair.
The fresh frozen full P07 candidate `20261116T154916.700793Z-ba7f397be1ea` passed **391/391**, zero failures/skips: Host 91, Runtime 218, Commons 41, Configuration 20, ControlPlane 21. This is not final approval: Astra then identified a retained canceled B entry after A's security change raced a transient role read. `20261116T155211.129165Z-316e31f82ca8` reproduced it (22/23 deployment-activation cases passed). The agreed correction makes manager scope represent configured consumer authorization/lifetime, while worker creation, TryAcquire and every lease boundary enforce current role; actual role notifications still retire all entries/epochs and newer artifact attempts still empty manager scope immediately. The owning worker is implementing that final focused repair before a fresh full phase gate and Astra reconciliation.
### P07 final phase gate and Astra approval
After that final repair, frozen run `20261116T155343.945235Z-be0fbabc1a44` passed **392/392**, zero failures/skips: Host 91, Runtime 219, Commons 41, Configuration 20, ControlPlane 21. Astra independently reconciled all five TRXs, HEAD `b710bf9f74f04ede38b902fcffc7259e2e808aa1`, tracked diff SHA-256 `f2fad373d196e951f6f39ec799e36845ddb9dcbe48931958a0e17eab627362f4`, and all 50 recorded new production/test file hashes before review-document edits. [Final contract/composition review](p07-contract-astra-review.md), [credential/scope review](p07-credential-astra-review.md), and [remote/runtime review](p07-remote-astra-review.md) approve P07 with no remaining actionable findings at this phase boundary. Earlier in-progress statements above are historical.
The accepted ordering variance moves creation of Task 15's `GrpcDataTlsWireTests` and `GrpcDataListenerIsolationWireTests` to P10 with their actual TLS fixtures; both remain required integration classes/scenarios alongside the existing mesh auth/boundary selectors. No wire-test requirement is waived. P10 still requires actual TLS/listener isolation, Docker/CLI/probes, deployed credential rotation/restart/failover, and SQL migration/concurrency/rollback evidence. P11 measurements and the P12 full-solution/final Astra gate remain pending. P07 approval permits its commit and dependent P08 work, without claiming those later results.
Before commit, P08 preparation found that a Browse lease/continuation could outlive the original authenticated target credential. The commit was held. Actual RED `20261116T160304.904551Z-9a7e5ce79d56` passed 5/6 local-connection cases; the repair caps both durations by positive remaining original credential lifetime and denies expiry during completion. GetMetadata objects have no separate lease, so P08 must retain the Browse/request-start authority boundary. The superseding frozen full run `20261116T160335.804917Z-5a4994c32d15` passed **393/393**, zero failures/skips (H91/R220/C41/K20/P21). Astra independently reconciled all five TRXs, unchanged HEAD, tracked diff SHA-256 `55029f7b6c6323a87dd3d8b96a988928d1eaee5e3889e1f57c4b07e4bd5771ae`, and all 50 new source/test hashes before review-document edits, then reaffirmed P07 approval. This is the final approved P07 candidate; the later-phase obligations above remain unchanged.
@@ -0,0 +1,139 @@
# Draft fixture inventory preparation — final refresh required
Prepared 2026-11-16 by independent Sol reviewer. **DRAFT: refresh against the final P12 HEAD and actual discovery/TRX.** This is source inspection only, not integration execution, fixture availability evidence, a final environment map, or an assertion that all tests pass. New GrpcData classes and their requirements are changing during P06–P10.
Scope: reviewed the seven files committed in `136c8a38e` under `scripts/validation/grpc-data/` and scanned every repository `.csproj` for `IsTestProject`/`Microsoft.NET.Test.Sdk`, then test source for category traits, fixture constructors, environment access, conditional skips, platform checks, and shared endpoints. Found **64 test projects**, all under `tests/`; `SparkplugSimulator` is an executable fixture helper, not a test project. No build, test discovery/execution, Docker, SQL, network, or hardware command was run by this reviewer. The coordinator reported 10 pure fixture tests green; no actual Docker/SQL gate was reported.
## Independent P10 scaffold review
**Required P10 fix — Modbus refusal responses (P2).** `device/server.py:138-141` closes the socket on every `ValueError` from its protocol handler instead of sending a Modbus exception PDU. The sparse readable map at lines 28–29 has holes 1–9 and 13–19. Production `src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Modbus.Contracts/ModbusDriverOptions.cs:129-132` defaults `MaxReadGap=8`; tags at 10–12 and 20 can therefore form a read block across unmapped 13–19. Production `ModbusDriver.cs:1264-1315` distinguishes device refusal (permits prohibition/bisection and individual-read fallback) from transport failure. This fixture turns the former into the latter. Unsupported FC23 also closes instead of returning exception01; when FC23 is opted in, `ModbusDriver.cs:1813-1856` cannot take same-request FC16 fallback. This does not prove current unimplemented seed rows would trigger it, but it is a real protocol/setup gap to close before selecting those rows. Add wire framing/error tests first, then return exception01/02/03 as appropriate (or intentionally provide a dense readable map); preserve deliberate close-after-commit solely for the response-loss fault. Current pure tests exercise functions and expect `ValueError`, so cannot establish socket behavior.
**Additional fixture evidence gap.** The read ledger increments only after a valid mapped read (`server.py:48-56`); write effects count only successful bounded mutations (`58-70`). There is no total request/rejected-write ledger. This suffices to count committed effects for the existing response-loss action, but it cannot independently prove every device-call-count assertion or distinguish a rejected write reaching the fixture from no request reaching it. Match the later D-scenario claims to the evidence actually captured, or extend the fixture ledger before claiming those cases.
No independent LDAP/build-platform defect found: disabled LDAP exits `LdapOptionsValidator.cs:35`; the Dockerfile intentionally matches `docker-dev/Dockerfile`'s amd64 build/portable publish/native runtime pattern. SQL/Compose parsing, actual migration, host startup, and daemon/resource ownership remain unverified. Known P07 TLS/provisioning and P10 seeding/orchestration work is explicitly pending in README and is not reported as an additional surprise defect. This scaffold is **not integration ready**.
## Assembly map
Assembly names below omit only the common `ZB.MOM.WW.OtOpcUa.` prefix. Each corresponds to `tests/**/<full-name>/<full-name>.csproj`. Categories are literal category traits observed in that assembly's own source; they do not mean every test has that category. Linked conformance and helper files must be included when P12 computes actual discovered names. `unclassified` is intentional and must not become an exclusion. `L` means no external software service prerequisite identified by this scan; many such tests create local actors, sockets, SDK servers, SQLite/temp files, fake servers, or subprocesses and still need normal filesystem/process resources. It does not certify execution or platform parity.
| Assembly suffix | Observed categories | Fixture/gate groups |
|---|---|---|
| `Client.CLI.Tests` | unclassified | L |
| `Client.Shared.Tests` | Unit | L |
| `Client.UI.Tests` | unclassified | L |
| `Cluster.Tests` | unclassified | L |
| `Commons.Tests` | Unit | L |
| `Configuration.Tests` | Authorization, SchemaCompliance, Unit | SQL-CFG |
| `Core.Abstractions.Tests` | Unit | L |
| `Core.AlarmHistorian.Tests` | Unit | L |
| `Core.ScriptedAlarms.Tests` | Unit | L |
| `Core.Scripting.Tests` | Unit | L + child-process recursion gate |
| `Core.Tests` | Integration, Unit | L |
| `Core.VirtualTags.Tests` | Unit | L |
| `Driver.AbCip.Cli.Tests` | Unit | L |
| `Driver.AbLegacy.Cli.Tests` | Unit | L |
| `Driver.Cli.Common.Tests` | Unit | L |
| `Driver.FOCAS.Cli.Tests` | Unit | L |
| `Driver.Modbus.Cli.Tests` | Unit | L |
| `Driver.S7.Cli.Tests` | Unit | L |
| `Driver.TwinCAT.Cli.Tests` | Unit | L |
| `Driver.Ab.Transport.Tests` | unclassified | L |
| `Driver.AbCip.IntegrationTests` | Integration, LiveIntegration, Unit | AB-CIP |
| `Driver.AbCip.Tests` | Unit | L |
| `Driver.AbLegacy.IntegrationTests` | Integration | AB-LEGACY |
| `Driver.AbLegacy.Tests` | Unit | L |
| `Driver.Calculation.Tests` | Unit | L |
| `Driver.FOCAS.IntegrationTests` | unclassified | FOCAS |
| `Driver.FOCAS.Tests` | Unit | L |
| `Driver.Galaxy.Browser.Tests` | Unit | L |
| `Driver.Galaxy.Tests` | Integration, Unit | L + MXGW |
| `Driver.Heidenhain.Tests` | LiveIntegration, Unit | L + HEIDENHAIN |
| `Driver.Historian.Gateway.Tests` | LiveIntegration | L + HISTGW |
| `Driver.Historian.QuestDb.IntegrationTests` | SlowUnit | QUESTDB + LONG |
| `Driver.Historian.QuestDb.Tests` | unclassified | L |
| `Driver.Historian.Sql.Common.Tests` | unclassified | L |
| `Driver.Historian.SqlServer.IntegrationTests` | unclassified | SQL-HIST |
| `Driver.Historian.SqlServer.Tests` | unclassified | L |
| `Driver.MTConnect.IntegrationTests` | Integration | MTCONNECT |
| `Driver.MTConnect.Tests` | Unit | L |
| `Driver.Modbus.Addressing.Tests` | Unit | L |
| `Driver.Modbus.IntegrationTests` | Integration | MODBUS |
| `Driver.Modbus.Tests` | Unit | L |
| `Driver.Mqtt.IntegrationTests` | Integration, LiveIntegration | MQTT |
| `Driver.Mqtt.Tests` | SlowUnit, Unit | L |
| `Driver.OpcUaClient.Browser.IntegrationTests` | Integration | OPC + NAT |
| `Driver.OpcUaClient.Browser.Tests` | Unit | L |
| `Driver.OpcUaClient.IntegrationTests` | Integration | OPC |
| `Driver.OpcUaClient.Tests` | Unit | L |
| `Driver.S7.IntegrationTests` | Integration, Reconnect | S7 |
| `Driver.S7.Tests` | Unit | L |
| `Driver.Sql.Browser.Tests` | unclassified | L |
| `Driver.Sql.IntegrationTests` | Blackhole, Integration | SQL-POLL + PG + MYSQL + ORACLE + ODBC + BLACKHOLE |
| `Driver.Sql.Tests` | Unit | L |
| `Driver.TwinCAT.IntegrationTests` | Integration | TWINCAT |
| `Driver.TwinCAT.Tests` | Unit | L |
| `AdminUI.Tests` | Unit | SQL-CFG + discovery gate |
| `ControlPlane.Tests` | SchemaCompliance, Unit | SQL-CFG |
| `Host.IntegrationTests` | ArtifactBoundary, Failover, Integration, Unit | HOST + PROBES + MODBUS |
| `Host.Tests` | Unit | L |
| `OpcUaServer.IntegrationTests` | E2E, Integration, Perf | SDK + AVEVA + LONG |
| `OpcUaServer.Tests` | Benchmark, Unit | L + BENCH |
| `Runtime.Tests` | Unit | L |
| `ScriptWorker.Tests` | Perf, ScriptWorker | WORKER + LONG + WINDOWS |
| `Security.Tests` | unclassified | L |
| `Analyzers.Tests` | Unit | L |
## Fixture/environment groups and source evidence
Paths under `tests/Drivers/` below abbreviate the corresponding full assembly directory from the table; paths under `tests/Server/` and `tests/Core/` do likewise. All endpoint values must be generated from run-owned loopback resources. Do not reuse tracked examples, inherited credentials/endpoints, or defaults pointing to `10.100.0.35`, `10.100.0.48`, corporate/VPN hosts, or other shared hardware.
| Group | Exact environment/settings and fixture behavior | Source evidence / preparation needed |
|---|---|---|
| SQL-CFG | `OTOPCUA_CONFIG_TEST_SERVER`, `OTOPCUA_CONFIG_TEST_SA_PASSWORD`; remove `OTOPCUA_UNIT_ONLY_DISCOVERY` from **discovery and execution** final children | `Configuration.Tests/SchemaComplianceFixture.cs:20-54` always migrates real SQL and reaps prefix databases; `ControlPlane.Tests/Harness/SqlServerTestDatabase.cs:17-34` also always migrates and defaults shared SQL; `AdminUI.Tests/AdminUiSqlServerFixture.cs:146-225` probes/skips/reaps and has unit-only bypass. Disposable SQL must be configured before discovery, including AdminUI attributes. |
| SQL-HIST | `HISTORIAN_SQL_TEST_CONNECTION` | `Historian.SqlServer.IntegrationTests/SqlHistorianFixture.cs`; local SQL with permission for generated databases; absent connection skips. Includes linked `tests/Drivers/Historian.Conformance/**/*.cs`. |
| QUESTDB | `HISTORIAN_QUESTDB_TEST_CONNECTION`; `HISTORIAN_QUESTDB_STRESS_SECONDS` opt-in | `Historian.QuestDb.IntegrationTests/QuestDbFixture.cs`, `LiveWriteReadRaceStressTests.cs:28-40`; QuestDB 10.0.1 PG-wire + HTTP fixture, isolated table prefixes; connection absence skips. Linked shared conformance tests must be counted. |
| SQL-POLL | `SQL_TEST_ENDPOINT`, `SQL_TEST_USER`, `SQL_TEST_PASSWORD`; alternative `Sql__ConnectionStrings__Fixture` | `Sql.IntegrationTests/SqlPollServerFixture.cs:45-60,218-254,315-334`; generated SQL driver schema and tables inside fixed `SqlPollFixture` database. Child env must reject a stale alternate connection string overriding the owned endpoint. |
| PG | `SQL_PG_ENDPOINT`, `SQL_PG_USER`, `SQL_PG_PASSWORD` | `Sql.IntegrationTests/PostgresReadTests.cs`; seed `Docker/postgres/seed-pg.sql`; postgres:17-alpine. |
| MYSQL | `SQL_MYSQL_ENDPOINT`, `SQL_MYSQL_USER`, `SQL_MYSQL_PASSWORD` | `Sql.IntegrationTests/MySqlReadTests.cs:433-439`; image mysql:8.4 + `Docker/mysql/seed-mysql.sql`. Not started by existing CI helper. |
| ORACLE | `SQL_ORACLE_ENDPOINT`, `SQL_ORACLE_USER`, `SQL_ORACLE_PASSWORD`, `SQL_ORACLE_SERVICE` | `Sql.IntegrationTests/OracleReadTests.cs:348-366`; gvenzl/oracle-free:23-slim + `Docker/oracle/seed-oracle.sql`, default service FREEPDB1. Local image/platform availability unknown, not inferred unavailable. |
| ODBC | `SQL_ODBC_CONNECTION_STRING` | `Sql.IntegrationTests/OdbcReadTests.cs:25-28,150-158`; requires local driver manager and installed vendor ODBC driver plus seeded backend. Software prerequisite, not hardware by default. Availability unknown. |
| BLACKHOLE | `SQL_BLACKHOLE_ENDPOINT`, `SQL_BLACKHOLE_USER`, `SQL_BLACKHOLE_PASSWORD`; clear `SQL_BLACKHOLE_DOCKER_SSH` | `Sql.IntegrationTests/SqlBlackholeTimeoutTests.cs:61-88,140-195,395-404`; requires separate disposable SQL because test pauses/unpauses it. **Current fixed name `otopcua-sql-blackhole` is not ownership-safe and ignores generated endpoint's resource ID. Must adapt before enabling.** Existing port14330 guard alone does not prove ownership. |
| OPC | `OPCUA_SIM_ENDPOINT` | `OpcUaClient.IntegrationTests/OpcPlcFixture.cs`, `OpcUaClient.Browser.IntegrationTests/OpcPlcProbe.cs`; opc-plc:2.14.10, anonymous/test options, local advertised port must match host port for ordinary fixture. Defaults shared host if unset. |
| NAT | `OPCUA_NAT_ENDPOINT`, `OPCUA_NAT_SERVER_CERT` | `OpcUaClient.Browser.IntegrationTests/NatPublishedEndpointBrowseTests.cs:48,132`; separate opc-plc:2.14.10 with unreachable advertised `.invalid` hostname/port and fresh copied public certificate. Missing cert silently leaves secure positive cases unexercised. Use per-run certificate/output directory. |
| MODBUS | `MODBUS_SIM_ENDPOINT`, `MODBUS_RTU_SIM_ENDPOINT`, `MODBUS_SIM_PROFILE` | `Modbus.IntegrationTests/{ModbusSimulatorFixture,ModbusRtuOverTcpFixture}.cs`, profile-gated `DL205/`, `Mitsubishi/`, `S7/`, `ExceptionInjectionTests.cs`; local pymodbus:3.13.0 profiles standard/dl205/mitsubishi/s7_1500/rtu_over_tcp/exception_injection. Needs separate profile runs; one standard simulator does not cover all profile-gated cases. P10's small custom simulator does not substitute for these existing fixtures. |
| S7 | `S7_SIM_ENDPOINT`, `S7_SIM_ALLOW_WRITES=1` only for local simulator; `S7_RECONNECT_BOUNCE_CMD`, `S7_TIMEOUT_OUTAGE_START_CMD`, `S7_TIMEOUT_OUTAGE_STOP_CMD`; `S7_TIMER_NUMBER_ADDRESSING` real-CPU gate | `S7.IntegrationTests/Snap7ServerFixture.cs` defaults shared; local python-snap7:1.0 s7_1500 image/profile. Command gates require generated commands targeting only owned container IDs, never inherited SSH commands. Timer/counter real-CPU assertions explicitly differ from simulator; record separately. |
| AB-CIP | `AB_SERVER_ENDPOINT`, `AB_SERVER_COMPOSE_PROFILE`, `AB_SERVER_PROFILE=abserver`, `AB_SERVER_ALLOW_WRITES=1` against local simulator only | `AbCip.IntegrationTests/{AbServerFixture,AbServerProfile,AbServerProfileGate,IntegrationWriteGate}.cs`, `TransportMatrix.cs`; patched libplctag ab_server controllogix/compactlogix/micro800/guardlogix profiles. Compose profiles share a fixed host port; run-owned remapping/sequential profile execution required. Emulate profile requires separate proprietary fixture and must be recorded unavailable unless supplied locally. |
| AB-LEGACY | `AB_LEGACY_ENDPOINT`, `AB_LEGACY_CIP_PATH`, `AB_LEGACY_COMPOSE_PROFILE`, `AB_SERVER_ALLOW_WRITES=1` only against local simulator | `AbLegacy.IntegrationTests/AbLegacyServerFixture.cs:39-159`, `TransportMatrix.cs`, `IntegrationWriteGate.cs`; ab_server slc500/micrologix/plc5 profiles. Explicit endpoint plus profile pin required; otherwise discovery attributes probe shared host/family ports. |
| AB excluded live evidence | Clear `AB_DIFF_ENDPOINT` plus related `AB_DIFF_PATH/FAMILY/TAGS/COUNT_OPENS/MAX_TAGS/MAX_TEMPLATES/PACE_MS`, `AB_LAT_TAGS/PASSES/PASS_GAP_MS`, `AB_LAT_ENFORCE`; do not enable `AB_HW_WRITE_APPROVED`, `AB_HW_WRITE_GATEWAY`, `AB_HW_WRITE_STRING_TAG`, `AB_HW_WRITE_DRYRUN`, `AB_HW_WRITE_GAP_SECONDS`, `AB_EVID_IDLE`, `AB_EVID_BROWSE`, `AB_EVID_MIX`/related tag controls against shared targets. `AB_LEASE_SOAK_CYCLES` tunes local soak. | `AbCip.IntegrationTests/Differential/`, `HardwareGate/`, `NativeLeaseReleaseSoakTests.cs`; exact unavailable/skipped names and reasons belong in final TRX inventory. Profile mismatch and differential/hardware opt-in skips are distinct from absent basic software fixtures. |
| FOCAS | `OTOPCUA_FOCAS_SIM_ENDPOINT`, `OTOPCUA_FOCAS_SIM_PROFILE` | `FOCAS.IntegrationTests/FocasSimFixture.cs:25-57`; existing Python focas-mock image built from `Docker/focas-mock`, seeded/reset via mock admin API and series profiles. Managed wire tests do not automatically require proprietary native FOCAS DLLs. Defaults shared host if unset. |
| MTCONNECT | `MTCONNECT_AGENT_ENDPOINT`, `MTCONNECT_WRITE_TARGET` | `MTConnect.IntegrationTests/MTConnectAgentFixture.cs:44-93`, `MTConnectAgentIntegrationTests.cs`; mtconnect/agent:2.7.0.12 **and adapter** with seeded device model and changing source; model-shape-dependent skips must be audited. Write target must be isolated supported writable item. |
| MQTT | `MQTT_FIXTURE_ENDPOINT`, `MQTT_FIXTURE_PLAIN_ENDPOINT`, `MQTT_FIXTURE_USERNAME`, `MQTT_FIXTURE_PASSWORD`, `MQTT_FIXTURE_CA_CERT`, `MQTT_FIXTURE_TOPIC_PREFIX` | `Mqtt.IntegrationTests/MqttFixture.cs:51-125`; Mosquitto2.0.22 TLS+plain listeners, generated credentials/CA and retained JSON publisher. Sparkplug live tests drive `SparkplugEdgeNode` in process; the standalone Sparkplug executable is for manual/live UI fixture use, not a required background service for those tests (`SparkplugSimulator/Program.cs:5-11`). If launched for other gates its controls are `MQTT_SIM_HOST/PORT/USE_TLS/GROUP/NODES/INTERVAL_SECONDS/CA_CERT/ALLOW_UNTRUSTED` and `MQTT_FIXTURE_USERNAME/PASSWORD`; do not confuse them with fixture client names. Include structured-metric and primary-host cases; broker alone is insufficient for retained JSON cases. |
| HOST | `OTOPCUA_HARNESS_USE_SQL`, `OTOPCUA_HARNESS_SQL_HOST`, `OTOPCUA_HARNESS_USE_LDAP`, `OTOPCUA_HARNESS_LDAP_HOST` | `Host.IntegrationTests/TwoNodeClusterHarness.cs:207-210,376-390,558-564`; default mode uses EF InMemory+stub LDAP; opt-in SQL hardcodes password `OtOpcUa!Harness123`, opt-in LDAP uses fixed port3894 and known fixture service identity. Generated SQL must match or harness must gain explicit credential input. Host real-mode fixture needs isolated GLAuth config from its compose. Decide whether/how real mode is exercised explicitly; default passing cases prove stub mode. |
| PROBES | **No endpoint env seam exists yet** | `Host.IntegrationTests/DriverProbeHandshakeE2eTests.cs:31-41` hardcodes shared DockerHost10.100.0.35, GalaxyHost10.100.0.48, local ports4840/14330; reachability probes occur before skip. Required P12 preparation: supply local owned endpoints for each protocol plus correct cross-protocol negative targets. Setting plan-table env variables cannot prevent forbidden network access here. `DriverTestConnectE2eTests.cs` does honor MODBUS_SIM_ENDPOINT but assumes wrong port9999 is unused. |
| SDK | Local `ServerEventRig`/SDK wire servers, transient PKI and ports; no external endpoint normally required | `OpcUaServer.IntegrationTests` SDK fixtures; additional GrpcData classes must be refreshed after P10. |
| TWINCAT | `TWINCAT_TARGET_HOST`, `TWINCAT_TARGET_NETID`, `TWINCAT_TARGET_PORT` | `TwinCAT.IntegrationTests/TwinCATXarFixture.cs:54-109`; Windows XAR runtime, valid trial/license, bilateral AMS routes, fixture PLC program and native ADS prerequisites. Not a Docker replacement. Unset NetId prevents probe; record exact skipped test names rather than enabling an arbitrary inherited target. |
| HEIDENHAIN | `HEIDENHAIN_LSV2_HOST`, `HEIDENHAIN_LSV2_PORT`, `OTOPCUA_HEIDENHAIN_INSPECT_PASSWORD` | `Heidenhain.Tests/HeidenhainLiveIntegrationTests.cs:20-31,64,96,166`; real-controller gate; in-process LSV2 simulator tests already exist separately and are not evidence of real-controller execution. |
| HISTGW | `HISTGW_GATEWAY_ENDPOINT`, `HISTGW_GATEWAY_APIKEY`, `HISTGW_TEST_TAG`, `HISTGW_WRITE_SANDBOX_TAG`, `HISTGW_BOOL_SANDBOX_TAG`, `HISTGW_ALARM_SOURCE`, `HISTGW_GATEWAY_ALLOW_UNTRUSTED` | `Historian.Gateway.Tests/Live/GatewayLiveFixture.cs:49-95`; local HistorianGateway with writable/history/event backend, correctly scoped key and dedicated sandbox tags. No local gateway hosting fixture found in this repo; available service/build/license not checked. Do not infer all gateway cases inherently require hardware, or route to documented VPN example. |
| MXGW | `MXGW_ENDPOINT`, `GALAXY_MXGW_API_KEY`, `MXGW_WRITE_WAIT_DISABLED`; alarm ack `GALAXY_904_ACK_USER`, `GALAXY_904_ACK_PASSWORD`, `GALAXY_904_ALARM_REF`; `D1_SMOKE_OUT` evidence output | `Galaxy.Tests/Runtime/GatewayGalaxy*LiveTests.cs`, `GalaxyPickerAckBeforeSnapshotLiveTests.cs`; actual Galaxy/MxAccessGateway backend with writable metering/alarm scenario. No matching local production backend fixture found; licensing/backend availability unknown. New gRPC rig is not a substitute for these product-specific cases. |
| AVEVA | `HISTGW_GATEWAY_ENDPOINT/APIKEY/ALLOW_UNTRUSTED`, `HISTGW_WRITE_SANDBOX_TAG`, `OTOPCUA_AVEVA_GATE_900`, `OTOPCUA_AVEVA_GATE_TAGS/WINDOWS/EVENT_SOURCES/EVENT_WINDOW/GALAXY_REFS/LABEL/OUT`, `OTOPCUA_AVEVA_GATE_STRICT_ENDPOINT/STRICT_CONTAINER/STRICT_SET_CEILING` | `OpcUaServer.IntegrationTests/AvevaGateway*LiveGateTests.cs`; real AVEVA history/alarm capabilities, data windows, optional strict gateway configuration. Strict-container control must not mutate inherited/shared containers. Availability unknown; absent required proprietary backend is explicit unavailable coverage. |
| WORKER | `OTOPCUA_SCRIPTWORKER_TEST_PATH` | `ScriptWorker.Tests/TestSupport.cs:42-46`, `WorkerEntryTests.cs:96`; some apphost gates require published self-contained worker path. Default build output does not prove this leg ran. Core scripting recursion child controls `OTOPCUA_RECURSION_CHILD_SCENARIO/RESULT` are parent-managed; normal parent run deliberately skips child-only test. |
| WINDOWS | `OTOPCUA_ISOLATION_INSTALLER_E2E=1` only in dedicated elevated Windows installer gate | `ScriptWorker.Tests/WorkerIsolationTests.cs:65-100`, `InstallerLayoutIsolationTests.cs:30-40`; Windows ACL/restricted-token/launch and installer service/firewall tests unavailable on macOS. Do not enable installer gate as part of local macOS final run. Some other tests return early by platform; a passing test can contain unexecuted platform branches. |
| LONG | `OTOPCUA_SDK2_SOAK`, `OTOPCUA_SDK2_SOAK_MODE/SECONDS/OUTPUT`, `OTOPCUA_SOAK_BUILD_SHA`, `OTOPCUA_SDK2_CLOSE_CONTROL`, `OTOPCUA_SDK2_SATURATION_CONTROL/OBSERVER/RUN_ID`, `OPCUA_CERTIFICATE_LEAK_TRACKING`; `OTOPCUA_EVENT_PERF`, `OTOPCUA_EVENT_PERF_OUT/REPORTS/ROUNDS`; `OTOPCUA_SCRIPT_PERF`, `OTOPCUA_SCRIPT_PERF_SECONDS/OUT`; QuestDB stress above | Explicit final-tier decision required for each. `Sdk2LifecycleSoakTests.cs:41-60` full/late-slope defaults2h and diagnostic is60–120s; `Sdk2LifecycleLateSlopeTests.cs:36-40` qualifies LinuxARM64/WindowsX64, exact .NET10.0.14 and leak tracking, so macOS diagnostic is not late-slope qualification. Folder/Script perf opt-ins skip by default. Record disabled cases as not executed, never silently call a no-filter run complete. |
| BENCH and knobs | `OTOPCUA_BENCH`; `OTOPCUA_PAGING_FUZZ_ITERATIONS`; **do not** set `OTOPCUA_SPARKPLUG_GOLDEN_REGEN` | OpcUaServer NodeManagerLockTimeBenchmark default executes assertions but enforces wall-clock budgets only with BENCH; paging knob controls fuzz iteration count. Golden regen mutates checked-in vectors, not a fixture requirement. |
## Required owned local software fixture set
1. SQL Server for configuration/AdminUI/control-plane/historian/poll tests, plus separate pausable SQL for blackhole; PostgreSQL17 seeded, QuestDB10.0.1, MySQL8.4 seeded, Oracle Free23 seeded, ODBC manager/vendor driver and suitable seeded backend. Isolate database/table prefixes. Optional Host real-SQL requires its hardcoded credential to be accommodated explicitly.
2. opc-plc2.14.10 ordinary fixture and separate NAT fixture with copied fresh public cert. Remap ordinary advertised/listen/published ports consistently. Isolated local Host gRPC rig supplies new-feature wire/CLI/node-probe cases only after seeding/TLS/provisioning/deploy/readiness work is complete.
3. Existing full Modbus simulator profiles and RTU-over-TCP, python-snap7 s7_1500 with owned lifecycle commands, patched AB CIP profiles, AB Legacy profiles, Python FOCAS mock, MTConnect Agent+adapter, Mosquitto TLS/plain+retained JSON publisher and generated CA/credentials; Sparkplug live tests start controlled simulator nodes in process.
4. Optional real-Host GLAuth fixture with its seeded service identity and fixed3894 constraint. A self-contained ScriptWorker apphost is a software build prerequisite for one gate.
5. Product backends for historian/Galaxy/AVEVA gates need separate availability determination; do not label absent endpoint variables a permanent software limitation without checking an allowed local option. TwinCAT XAR licensing/native runtime and real Heidenhain/controller-specific cases remain separate unavailable device/platform coverage where absent.
No availability check was performed for images, Docker daemon/context, local ports, credentials, local gateway sources, ODBC drivers, self-contained worker output, native libraries, licensing, or device fixtures. Source presence is not running-fixture evidence.
## Final-run orchestration work still required
- `scripts/ci/integration-fixtures.sh:103` uses name-only `docker rm -f`; `up` calls it globally, failed starts remove by name again, published ports lack loopback binding, certificate output path is global, local suffix can be empty, and printed exports include passwords. **Do not invoke current helper for P12 local gate.** Implement explicit local-owned mode with local socket/context validation, mandatory unique owner/suffix, manifest/label validation, collision-safe loopback ports, restricted JSON child environment, per-run paths and owned cleanup; preserve CI mode separately.
- Existing helper provisions only SQL/PostgreSQL/QuestDB/opc-plc/NAT and emits exports without altering its parent environment. It does not provide config-test variables or the other required software fixtures. `run-final.py` must parse structured allowlisted output, explicitly inject real variables before discovery, remove unit-only discovery mode and replace unit-phase environment stripping. Do not `eval` logs or inherit unrelated endpoints/SSH commands. Discovery-time AdminUI/AB/TwinCAT attributes matter.
- Fix hardcoded Host probes and blackhole ownership seams before a no-category-filter run. They cannot be solved by an environment table alone. Audit all resolved targets fail-closed before processes start; no call to a forbidden shared host is permitted, including a reachability probe that would then skip.
- Refresh the 64-project/source map after new classes land; reconcile actual discovered project/test names with solution membership, source-linked test files and every GrpcData class. Capture nonzero discovered/executed expected classes, full per-assembly counts, every skipped name/reason, disabled long modes, platform early returns and required fixture readiness. No executed counts are asserted here. The plan's12,000 floor is a guard, not coverage proof.
@@ -0,0 +1,159 @@
# P07 serving-envelope and composition Astra review
**Final disposition: P07 approved at its implementation/unit-gate boundary.** The final reconciliation below, including the subsequent credential-expiry lease repair, supersedes the historical checkpoint dispositions. Frozen run `20261116T160335.804917Z-5a4994c32d15` passed 393/393 applicable tests, with no failures or skips; source identity and all five TRXs were independently reconciled. This is not whole-implementation, real TLS/CLI/Docker, relational migration, or P12 approval.
**Initial checkpoint disposition (historical): additive serving envelopes were approved as the contract direction, subject to the constraints below.** This preparation review inspected the committed P06 protocol, mapper, local authority/publication seams, configuration consistency policy, and Tasks 15/16 while implementation was active. No builds, tests, Docker commands, or commits were run by this reviewer.
## Observed gap
`CapabilitiesResponse` has cluster identity and Serving; Sample and CompactValues also have Serving. BrowseResponse, MetadataResponse, ReadResponse, WriteResponse, and the outer SubscriptionFrame do not. Consequently, an empty/error-only read, metadata batch, write outcome, acknowledgment, or heartbeat cannot independently prove the serving identity negotiated for its operation/stream. Existing value decoders compare nested provenance with expectedServing, but DecodeControlOrAck and the collection response helpers have no equivalent identity argument/check (`DataProtoMapper.cs:599-650`, `:1110-1165`, `:1209-1285`).
Add an outer Serving field to all five missing response/frame messages, including every Ack/Control and both value encodings. At the reviewed baseline the available field numbers are BrowseResponse 7, MetadataResponse 2, ReadResponse 2, WriteResponse 2, and SubscriptionFrame 8. Preserve all existing numbers/oneofs and update the frozen contract tests. CapabilitiesResponse already has Serving at field 3 and needs no duplicate envelope.
## Required contract constraints
1. **Explicit negotiation.** Add a distinct capability flag or define a mandatory minor-version contract for serving envelopes; protocol major 1 or compact support alone is insufficient proof. An absent field from an older peer must not become the expected identity by default. The P07 strict client must fail closed when the required envelope contract is unavailable. A new capability flag may use the currently free CapabilitiesResponse field 12; if adopted, its domain default is false and advertisement is true only when all response paths honor the contract. Preserve additive old/new codec tests and pin the chosen version/fields.
2. **Validate before accepting effects.** For every unary response and stream frame, validate the envelope against the authenticated operation/stream's expected node, boot incarnation, role, catalog epoch, and authority epoch before exposing content or updating handles, sequence, snapshot state, or cursors. Nested Sample/CompactValues provenance must also match that envelope and expected identity. Empty batches and control-only streams receive the same check. Validate browse lease/catalog provenance against its envelope; do not accept a lease from a different generation. A mismatch invalidates the route/stream and requires fresh authenticated discovery and, for subscriptions, a new epoch/snapshot. A control message cannot silently replace the stream's expected identity. The narrowly defined no-dispatch proof in item 6 is distinct from accepting successful data under changed role/epochs.
3. **Keep authentication and identity binding intact.** Serving itself does not include cluster ID. The expected Serving must therefore remain bound to the validated cluster identity from capabilities, the selected endpoint, TLS trust/SAN policy, and the authenticated connection/credential generation. Do not treat a self-asserted NodeId, a caller-supplied expected identity, or a cached role hint as authentication. Node selection remains pinned even when unavailable. Endpoint/channel changes require a fresh capabilities proof; continuations and old handles cannot migrate with the URI alone. Capabilities discovery is the bootstrap exception to comparison with an already-negotiated Serving: authenticate it, validate configured cluster/node and structural fields, and then establish the candidate proof. It may honestly report Secondary, unknown role, or unready state; that does not establish an eligible Cluster route.
4. **Capture provenance, then final-check it.** Capture the identity associated with the operation/session before materializing its response. Encode that identity, rather than attaching the latest Serving to older data or an earlier acknowledgment. After all potentially blocking preparation and immediately before publication, verify that the captured identity and original caller remain usable. Include original key/version/expiry, exact authenticated authority epoch, target policy, readiness, and operation/view authority. A generation change discards/closes the prepared response rather than relabeling it. The stream adapter must preserve P06's Prepare → final gate → actual WriteAsync → successful receipt boundary and retain ownership until actual completion even when cancellation is ignored. Unary publication likewise needs a final check after response construction/encoding work; a check only before invoking the local port is insufficient.
5. **Role eligibility is separate from supported operations.** A Cluster route requires an authenticated, currently ready Primary for admission and data publication. Pinned Node cached reads/subscriptions on a nonprimary require the explicitly configured ReadyReplica consistency policy plus the existing Warm/Hot readiness verdict. Unknown/startup role is not a ready replica. A Write operation bit is only capability advertisement; the primary gate remains mandatory at admission and actual dispatch for both target modes. Demotion closes primary-only streams and invalidates routing hints. This preserves existing election semantics and makes no stronger split-brain fencing claim.
6. **Do not turn publication rejection into mutation replay permission.** After dispatch, demotion, credential retirement, envelope mismatch, timeout, or loss of a response cannot change an item into RejectedBeforeDispatch. Keep the original bounded outcome observer and serving-incarnation precondition. If response validation prevents trusting a returned outcome, that item's result is ambiguous and must not be replayed. Only an authenticated, identity-valid, per-item RejectedBeforeDispatch result permits a new endpoint attempt; never retry a mixed batch wholesale. A definitive late outcome may be retained internally even when it cannot be published to the retired caller. If successful outcome reporting from an old primary is allowed later, it needs an explicit original-operation provenance contract; simply stamping the current primary identity is invalid.
Preserve the planned stale-primary failover by distinguishing a trustworthy **negative dispatch proof** from current role eligibility. The same authenticated endpoint/node/boot can honestly reject an item before dispatch after demotion, and need not still be Primary merely to report that rejection. Define this exception explicitly: the response must be well formed, match the original endpoint/node/boot and request/item correlation, and the accepted item must be exactly RejectedBeforeDispatch. Changed role/catalog/authority fields do not permit accepting successful data or installing a new route identity. Fresh capabilities discovery is required before a new attempt. All other ambiguous items remain non-replayable. Treating every role mismatch as Unknown is conservative but forfeits this demotion-failover behavior; it must not be mistaken for the planned positive case. A different boot, malformed envelope, lost reply, or unauthenticated status is not this proof.
## Existing local seams that P07 must complete
- `DataCapabilitiesProvider.Get` samples live Serving/readiness and strips Write when role is not Primary (`DataCapabilitiesProvider.cs:21-34`). It does not itself enforce Cluster target eligibility, nor prove that an advertised operation remains authorized after preparation.
- `LocalDataServices.Ready`, `CanPublish`, and `CanUseSubscription` validate catalog/readiness and identity but do not require Cluster Primary (`LocalDataServices.cs:51-55`, `:78-79`, `:142-148`). `LocalDataConnection.CanPublish` does not pass Target to that gate. Thus P07 must supply a target/consistency-aware publication boundary rather than assuming the existing boolean covers role policy.
- `AuthorizeSubscription` currently derives ReadyReplica from any non-Primary Serving.Role (`LocalDataServices.cs:117-120`). The configuration entity already has an explicit Consistency defaulting to Primary, but DataTarget contains no consistency field. Preserve that configured policy through the connection/admission seam; do not infer permission to consume a replica from the server's reported role. A separate bound connection policy is sufficient; this does not require blindly adding client-controlled authorization fields to every request.
- `CanPublish` checks original caller usability but does not itself compare `context.AuthorityEpoch` to the captured catalog's authority epoch; subscription admission/lifetime checks do compare the authority epoch. Host ingress/final gates must bind the exact authenticated authority snapshot for all methods. A usable key alone must not upgrade an old admitted context to a newer authority generation.
- Browse/metadata/write domain return types have no batch Serving property. Their wire encoder must receive explicit captured provenance from a trustworthy facade/ingress context, including empty results. The current value-only mapper checks are not a substitute. Keep the strict remote path on helpers that require expected identity so an overload without that argument cannot accidentally bypass the contract.
- The capability provider, catalog coordinator, source publisher, write registry/dispatch gate, acquisition capacity, and actual DriverHost must use the same real process NodeId/incarnation and current role authority. Do not create a second boot GUID for the data listener, relabel cached samples from another boot, or wire disconnected process owners merely to satisfy DI. Ready capability publication must describe a coherent currently active catalog/authority/role state.
## Required focused evidence before implementation approval
- Round-trip the new fields on every response and all four stream variants; reject missing negotiated envelopes, another node/boot/role/epoch, nested/envelope disagreement, and empty or denied-only batches with wrong identity. Check that rejected Ack/Control frames leave handles and sequence untouched.
- Gate response preparation, then demote, change authority/catalog, revoke the original key, or expire it before publication. Require no old successful response/frame, including metadata and control-only traffic. Retain P06's blocked writer, ignored cancellation, and successful-write-only commitment regressions when the real sink is connected.
- Show Cluster refusing ready Secondary and unknown role despite read capabilities, pinned Node refusing replica use under Primary policy, and explicit ReadyReplica accepting only a genuinely ready permitted replica. Node failures must not substitute a partner. Restart on the same endpoint must invalidate the old boot proof and renew stream state.
- Show pre-dispatch rejection permitting only that item to retry, post-dispatch demotion and lost/malformed/mismatched write responses becoming non-replayable ambiguity, and credential/trust rotation retaining original in-flight outcome ownership.
- Exercise the actual Host composition with one boot/role/authority/acquisition owner, plus existing WarmRoleAuthority/PrimaryGatePolicy tests if the role adapter changes. Actual TLS certificate/listener behavior and Docker wire evidence remain P10; passing fake-client/codec tests cannot establish those transport claims.
The normalized cache-ingress age contract and explicit unknown stream upper bound remain unchanged by this provenance addition. A serving envelope proves the validated source of a response; it does not turn cached value age into physical measurement age or prove exclusive device ownership.
## Unary final-publication adapter direction
**A narrow registered response-marshaller adapter is appropriate; a service-method/interceptor return check alone is not the final boundary.** In pinned grpc-dotnet 2.76.0, the unary call handler awaits the user method and subsequently passes its response to the framework writer. The writer can await response startup before invoking the contextual serializer. Thus a guard in the service can precede further asynchronous work. [Unary handler](https://github.com/grpc/grpc-dotnet/blob/v2.76.0/src/Grpc.AspNetCore.Server/Internal/CallHandlers/UnaryServerCallHandler.cs), [framework writer](https://github.com/grpc/grpc-dotnet/blob/v2.76.0/src/Grpc.AspNetCore.Server/Internal/PipeExtensions.cs).
The generated protobuf serializer uses GetBufferWriter after declaring its size. That can write directly to the response pipe before Complete, so forwarding its buffer requests to the real context and checking only Complete is too late. Serialize into a private bounded owned buffer, then run the captured authority/publication-lease guard inside the actual registered response marshaller, then call the real Complete(byte[]) exactly once. Disable framework response compression for this path (NoCompress): otherwise Complete performs compression after the guard and before writing the pipe. This is synchronous transport-buffer handoff, not a flush acknowledgment or proof of remote receipt. Headers may already have started; rejection must prevent the response message body. [Serialization context implementation](https://github.com/grpc/grpc-dotnet/blob/v2.76.0/src/Grpc.AspNetCore.Server/Internal/HttpContextSerializationContext.cs).
A custom BindServiceMethod/ServiceBinderBase wrapper can replace unary response marshallers while preserving generated request marshallers, names and service metadata. Keep the bind method's service parameter as the generated service base: the framework uses that type when checking handler base definitions. Discovery passes a null service instance, so registration must not capture a concrete call instance. [Bind discovery](https://github.com/grpc/grpc-dotnet/blob/v2.76.0/src/Grpc.AspNetCore.Server/Model/Internal/BinderServiceModelProvider.cs), [handler selection](https://github.com/grpc/grpc-dotnet/blob/v2.76.0/src/Grpc.AspNetCore.Server/Model/Internal/ProviderServiceBinder.cs).
Associate each response with explicit bounded call-owned publication state; do not rely on an AsyncLocal assignment inside the completed user method being visible to its caller, or on an unbounded global response dictionary. Keep captured leases and byte reservations alive through marshalling/handoff. Supply idempotent call-completion cleanup when deadline/cancellation skips serialization, and retain a marshaller reference while physical preparation is running. Missing, retired, or already-consumed state rejects. A method-local finally must not release the state before the framework invokes the marshaller.
Required evidence is through the registered binding: revoke after method return/before serialization, revoke while private serialization is gated, and verify no real-context completion/body write; verify a positive body is handed off once, compression is disabled, and cancellation/deadline before serializer invocation releases ownership. This is a contract-direction review only; no adapter implementation or transport test is claimed complete.
## First registered-binding source checkpoint — open
The coordinator subsequently implemented `DataConnectionGrpcBinding.cs` and GetCapabilities in the otherwise incomplete/unmapped service, and reports three registered-marshaller tests passing in `20261116T130009.001707Z-f4443cd19118`. Source review confirms the generated-base bind signature, response-marshaller replacement, private bounded protobuf serialization, response-associated ConditionalWeakTable state, one-use protection, and HTTP-completion disposal registration. These are implementation observations, not final transport approval. The following findings remain open:
- **P1 — NoCompress is not enforced on the actual ASP.NET invocation path.** PublicationBinder sets the flag only in its replacement handler delegates (`DataConnectionGrpcBinding.cs:22-33`). ASP.NET discovery passes a null service instance, producing null handlers; ProviderServiceBinder creates invocation delegates through reflection rather than using the supplied handler. The actual Execute/GetCapabilities method does not set the flag. Therefore Complete can still perform framework compression after the final guard. Set the policy in the real service/interceptor/call-bound marshaller state and verify the actual discovery/invocation path. The three capture-binder tests prove marshaller replacement, but do not exercise runtime WriteOptions. [Pinned provider behavior](https://github.com/grpc/grpc-dotnet/blob/v2.76.0/src/Grpc.AspNetCore.Server/Model/Internal/ProviderServiceBinder.cs).
- **P2 — Registration disposal during the publication callback can still permit handoff.** Serialize reads `_state` before calling canPublish (`DataConnectionGrpcBinding.cs:70`). If that callback blocks, Dispose changes the state to 3, and the callback then returns true, execution still calls Complete. Recheck state after publication validation; put final cancellation/deadline checks after potentially blocking validation as well. Regress a gated callback, concurrent disposal, and zero Complete calls. This does not require a blocking global lock around transport handoff.
- **P2 — Configured unary timeout ownership ends before serialization.** Execute disposes its timeout/linked sources on method return (`DataConnectionGrpcService.cs:48-52`), while the later marshaller registration checks only the gRPC context cancellation token (`:66-68`). With a longer or absent client deadline, configured server UnaryTimeout can expire during subsequent preparation without denying handoff. Retain its deadline state through HTTP completion, or capture a monotonic expiry for the final guard; test expiration during private serialization and correct release when serialization is skipped.
The new discovery gate is directionally consistent: it can report an honest unready/unknown-role snapshot while requiring exact current serving/authority and original caller usability. It does not use the stricter data-ready publication gate to suppress all unready discovery. This checkpoint found no additional discovery-gate defect. Remaining RPCs, middleware/Program composition, real binding wire tests, and the full P07 gate remain pending.
## Stream publication-guard handoff direction
**Approved as an additive direction, not yet an implementation approval:** add an optional transport-neutral prepared-delivery capability exposing one-time `SetPublicationGuard(Func<bool>)`. Runtime binds the existing PendingDelivery.Gate after successful Prepare and before Write. Host prepared deliveries require the binding, and invoke that exact Runtime predicate inside the registered marshaller after private byte preparation. This closes the interval in which the framework can await response startup after Runtime's earlier gate while only the source/producer proof changes, leaving the connection's Serving/catalog envelope unchanged.
Binding is one-time and disposal-aware; unbound, duplicate/replaced, retired, or disposed registration fails closed. Host identity/auth validation runs before the Runtime predicate, which is the final potentially blocking validation; final state/cancellation/deadline reads follow immediately before synchronous handoff. The predicate is observational: do not run eligibility selection, snapshot rate consumption, receipt commitment, or cursor advancement from the marshaller. False/throwing/unbound guards must fault the actual write or provide a negative receipt, never report a successful no-op write.
Runtime still commits baseline, sequence, cursor, and acknowledgment effects only after actual WriteAsync succeeds. Binding does not transfer or shorten ownership: pending delivery, frame/sample leases, byte reservation, session hold, prepared bytes, and registration stay owned until the physical write task settles, including when an outer wait is canceled and the transport ignores cancellation. A late callback after session retirement must observe invalid state without using prematurely released resources. Direct enumerable delivery retains its existing boundary.
Required focused evidence holds the writer between entry/startup and the registered marshaller, then invalidates the source ticket or retires the producer without changing Serving/catalog or first letting the session's ordinary tick close it. Releasing the writer must produce zero body handoffs and zero receipt commits. Include a snapshot/control or Modify acknowledgment case, a valid one-handoff/one-successful-receipt positive, unbound/double-bound/disposed rejection, and ignored-cancellation physical-lifetime accounting. These are regression requirements; no result or implementation closure is claimed here.
## Observed-role source checkpoint
The reviewer independently read Runtime run `20261116T141626.988288Z-e977454116c3` (103/103 passed, zero skipped) and Host run `20261116T141558.244776Z-7bfca094cb86` (72/73 passed; the sole failure was the separately pending completed-credential-bundle replay regression). Existing role-policy cases and the new direct RedundancyRoleView provenance test passed. These results do not establish actual actor lifecycle behavior or completed P07 wiring.
RedundancyRoleView now stores Allowed, Generation, and ServingRole in one immutable volatile verdict under the existing dispatch fence. ServingRole starts Unknown independently of the existing policy's permissive single-node boot fallback; explicit observed role changes advance the generation even when Allowed is unchanged. This is the correct distinction, and it does not alter the existing election algorithm. DriverHostActor now publishes its cached `_localRole` through this new method when the real shared view is present.
### P1 — An accepted snapshot without the local node retains stale serving-role provenance
`DriverHostActor.OnRedundancyStateChanged` intentionally leaves the legacy `_localRole` unchanged if a newly accepted snapshot omits this node (`DriverHostActor.cs:2709–2723`). The new `PublishPrimaryVerdict` forwards that cached value to `PublishDataServingRole`. Thus Primary followed by an accepted snapshot lacking the local entry still publishes Primary, and its generation need not change. A later P07 caller can treat stale provenance as current Primary even though the current snapshot supplies no local-role proof. The direct setter test cannot detect this actor adaptation error.
Preserve the legacy bool/gate behavior where required, but track the data-service observed role separately from that legacy cache: every accepted snapshot must derive the current data-serving role from `local?.Role`, publishing Unknown on omission and advancing its authority generation. Regress the actual DriverHostActor with the real shared RedundancyRoleView: Primary → accepted missing-local snapshot → Unknown, unchanged legacy verdict if intended, invalidated old publication proof, and positive recovery on a new explicit local role. Rejected older snapshots must not disturb the current accepted proof.
DriverHostActor.PostStop also currently leaves the last observed serving role in the shared view. The completed authority composition must define and test retirement/reset of that publisher so a stopped owner cannot leave a current serving proof indefinitely; actor restart starts Unknown again, but that alone does not prove the stopped interval. This lifecycle obligation is distinct from changing existing legacy write/historian policy. Source repair and actual actor regressions are pending; no whole-phase approval is granted.
## Actual Host composition checkpoint — source review, gate pending
The coordinator subsequently added real DataConnectionRegistration/Program wiring and three actual DriverHostActor regressions. Frozen source now keeps `_observedDataServingRole` separate from the legacy cached role, sets it to `local?.Role` on each accepted snapshot, registers a monotonic role-owner lease, and retires only that owner on PostStop. Replaced owners cannot publish or retire the replacement. Counter exhaustion poisons role availability. These source changes address the missing-local/stopped/old-owner findings; their new full-gate result was pending when this review began. The review did not run tests/builds or modify production code.
Registration uses one process identity for the catalog, source publisher, and write registry; one shared dispatch fence/role view; one hub/clock; and one acquisition-capacity owner passed to the real DriverHostActor. A deferred facade resolves the actual ActorRegistry host rather than constructing another actor graph. The dedicated listener validates port conflicts, requires TLS except explicit development loopback, loads a current private-key certificate with SAN coverage for all allowed hosts, and uses the data middleware before mapped service dispatch. These observations are not wire/TLS evidence. The coordinator's separately tracked admission-class separation, final monotonic unary timeout, and existing secret-invalidator composition work are not duplicated here.
### P1 — The actual OPC UA publisher is missing the shared catalog coordinator
`Runtime/ServiceCollectionExtensions` passes SourcePublisher, LocalCatalogCoordinator, write runtime, and acquisition owner to DriverHostActor, but the real OpcUaPublishActor.Props call still omits its already-supported shared catalogCoordinator/dataCatalog arguments. DriverHost stages its shared attempt and deliberately completes it itself only when no OPC UA publisher exists. OpcUaPublishActor.FinishRebuild completes that attempt only when its own coordinator is nonnull. In the actual enabled graph neither completes the shared generation, leaving Current null and data readiness permanently unavailable despite a successful address-space apply.
Inject the same coordinator/activation into the real publisher and add a positive real-composition apply/restore test. The registration test that expects facade creation to fail before an actor exists cannot establish successful activation. Source repair/evidence are pending.
### P1 — Registration substitutes snapshot Primary for the existing Warm verdict
The consumer activation callback accepts DataServingRole Primary regardless of mode and accepts Secondary for artifact-declared Hot. It never reads the actual WarmRoleAuthority verdict owned by OpcUaPublishActor. Warm can be Standby despite a Primary snapshot (membership disagreement, endpoint not listening, or no accepted revisioned snapshot), and can be Active during the approved unreachable-primary path while its snapshot role is still Secondary. The callback therefore both admits forbidden Standby work and suppresses legitimate Warm activation. Serving capability readiness likewise lacks the existing Warm readiness decision.
Publish the existing accepted Warm verdict from OpcUaPublishActor through a shared owner-fenced view; do not duplicate election logic. Promotion publication follows the actual successful data-plane transition, while demotion denial precedes potentially blocking SDK/ServiceLevel work. Default/retired owners are Standby; stale owners cannot overwrite replacements. The same view and effective **local** WarmRedundancySettings must drive acquisition and serving readiness: artifact Hot cannot bypass a locally Warm Standby, since the existing actor explicitly retains local mode on artifact mismatch.
The minimal existing seams are OpcUaPublishActor.ApplyWarmTransition, PostStop, both Props factories, and its real Runtime registration. Extend OpcUaPublishActorWarmTests (transition order, unrevisioned/older snapshot, failed ServiceLevel, disagreement), EndpointStateTests, and actual owner stop/replacement cases. Notify runtime after publishing the shared verdict and outside its publication fence. Source repair/evidence are pending.
### P1 — Role/owner generation is discarded before publication, allowing ABA revival
RedundancyRoleView advances PrimaryGeneration on role/owner changes, but the registration's Serving delegate emits only NodeId, Incarnation, Role and existing catalog/authority epochs. LocalCatalogCoordinator role wrappers preserve those epochs. A blocked old unary/frame can therefore survive Primary → Unknown/Secondary → Primary, or owner replacement followed by Primary, if its final gate sees only the final identical Serving tuple. The separate rich-write PrimaryGeneration proof does not protect ordinary metadata/read/control publication.
The coordinator's proposed additive ServingGeneration (wire Serving field 6) is the appropriate minimal direction: capture role/readiness/owner validity and generation atomically from one immutable snapshot, propagate it through full serving comparisons, and refresh catalog wrappers even when the role string returns unchanged. Poison on overflow. Include Warm owner/verdict transitions in the same effective proof. Network negotiation must require a positive generation for the new serving contract; default zero may remain for legacy/local fixtures but must not silently disable ABA protection on a peer claiming the new contract. No separate backing-source epoch is needed, and original sample versions/cache-ingress timestamps must not be refreshed by role changes. Require actual late-marshaller away/back and owner-replacement regressions plus fresh-request recovery. This is an approved direction, not yet a verified repair.
### P1 — Outbound revocation is conditional on successful local catalog staging
StageCatalog calls `_dataConnections.Apply` only after authority installation and ParseLocalCatalogSnapshot. A newer desired artifact that removes consumers but fails unrelated local catalog/authority projection logs/returns first. BeginCatalogAttempt closes the origin catalog but does not deny the outbound runtime's old scope, so its previously acquired facades/streams can remain authorized indefinitely.
Introduce an outbound desired-attempt denial barrier independent of local export staging; activate the replacement only from validated scope and durable floor. Regress an actual host apply with an active outbound scope, a newer removal artifact plus local catalog failure, old-handle/stream denial and drain, and honest recovery. Keeping legacy driver topology on failed apply does not authorize retaining the old external data scope. Registry internals are being reviewed separately; this finding concerns the actual actor integration order. Source repair/evidence are pending.
This checkpoint remains open. No final P07, real TLS, Docker, or OPC UA integration approval is claimed.
## Composition repair rereview — source verified, integrated gate pending
The four preceding composition findings are addressed in the frozen source inspected at this checkpoint:
- The actual ServiceCollectionExtensions graph now calls DataConnectionPublisherProps.Create, which selects the shared catalog coordinator/activation, authority, Warm view, and outbound runtime. The real Host-to-publisher held-sink regression calls that same production factory and requires the catalog to remain unavailable before successful topology completion, then activate on the matching acknowledgment. This guards the dependency omission rather than manually supplying a different test-only Props graph.
- Registration captures driver-role and Warm immutable state under the same shared dispatch fence, using TryEnter to keep acquisition callbacks nonblocking. Local Warm settings override artifact Hot; an unaccepted or retired Warm owner publishes an unavailable Standby serving identity. Actual accepted Warm transitions remain owned by OpcUaPublishActor, and its notifications run after the immutable publication leaves the fence.
- ServingGeneration propagates through catalog role wrappers even when the role string returns unchanged. The checked combined role/Warm generation rejects exhaustion. WriteRouteProof now retains full Serving identity; the actual dispatch gate captures live coordinator.Serving before checking IsPublished and requires both catalog and live identity to equal the proof under the shared fence, alongside the existing route/driver/PrimaryGeneration checks. It does not take a deployment-runtime lock inside that fence.
- DriverHost.BeginCatalogAttempt invokes the outbound BeginAttempt before empty/malformed input, authority installation, or local catalog parsing. The outbound runtime synchronously withdraws old routes and checks the latest attempt revision/generation before a delayed scope activation can install entries. The actual invalid-local-artifact regression holds an old import lease and verifies its cancellation and denied readiness after the failed newer apply.
Evidence is deliberately limited: the reviewer independently read run `20261116T152849.971443Z-55329afdc892`: Host 87/87 passed; Runtime 207/210 passed, with both new Warm final-write fence regressions failing as expected before repair and one separate frozen-snapshot ordering failure. These results are not a green result for the repaired source. The reviewer also read `20261116T153431.302434Z-0add51a2b272`: deployment activation 15/16 passed, with the transient scope-store retry regression failing before its repair. Final repair results and the complete applicable P07 gate remain required.
The new deployment-runtime availability findings are recorded in `p07-remote-astra-review.md`; the newly composed invalidator finding is recorded in `p07-credential-astra-review.md`. No whole-phase approval is granted.
## Final P07 reconciliation and approval
The reviewer independently read `artifacts/grpc-data/20261116T155343.945235Z-be0fbabc1a44/unit/P07/run.json` and all five TRXs: **392/392 passed, zero failures/skips** (Host 91, Runtime 219, Commons 41, Configuration 20, ControlPlane 21). Before these documentation edits, the current HEAD exactly matched `b710bf9f74f04ede38b902fcffc7259e2e808aa1`, `git diff HEAD --binary` SHA-256 matched `f2fad373d196e951f6f39ec799e36845ddb9dcbe48931958a0e17eab627362f4`, and all 50 recorded untracked production/test C#/proto/project hashes matched. The phase manifest includes the required new classes and affected existing auth, local service, stream, role, actor, write, codec, configuration, and sealing regressions. The reviewer ran no builds/tests, Docker commands, migrations, or commits.
All actionable P07 findings in these three review notes are closed at this boundary. The serving envelope/generation is negotiated and compared for every response category. Actual method execution enforces NoCompress; the registered response marshaller prepares private bounded bytes, checks publication authority and final disposed/cancellation/monotonic timeout state, then synchronously hands off the buffer. Runtime's exact prepared-delivery guard crosses framework startup awaits into that marshaller; receipt effects still follow successful actual WriteAsync. These unit seams prove the selected handoff boundary, not network flush or remote receipt.
The real production publisher factory, actual Host/publisher held-sink activation, observed-role owner lifecycle, accepted Warm publication, same-role ABA, final device-write Warm fences, and malformed-next-artifact outbound denial all pass. The final deployment-runtime fix keeps configured consumer scope independent of transient role observation, while role checks remain at worker creation, acquisition, and every borrowed-operation boundary. Actual role notifications still advance all route revisions and retire entries; BeginAttempt still immediately empties scope. Its last two-link regression was observed failing in `20261116T155211.129165Z-316e31f82ca8` and passes in the final run. Credential and remote lifecycle dispositions are recorded in their companion notes.
**Approved phase-ordering variance:** Task 15 originally schedules creation of `GrpcDataTlsWireTests.cs` and `GrpcDataListenerIsolationWireTests.cs` in P07, with execution in P10. Their creation moves to P10 alongside the actual TLS fixtures, rather than adding unexecutable placeholders here. Both classes remain required under `Host.IntegrationTests/DataConnections`, tagged Feature=GrpcData/Category=Integration, alongside the existing mesh boundary/auth integration selectors. No wire-test requirement or scenario is waived.
P10 still owns actual certificate/listener isolation, Docker/CLI/probe scenarios, deployed rotation/restart/failover, and relational migration/concurrency/rollback evidence. P11 owns workload/capacity measurements; P12 owns the full solution gate and separate final Astra review. This approval permits the P07 commit and dependent P08 work, without asserting those later outcomes.
## Superseding final candidate — credential-expiry lease cap
P08 preparation identified one additional P2 before the P07 commit: Browse issued MaxMetadataLease even when the original authenticated target credential expired sooner. A consumer cannot infer that target-key expiry from its opaque bearer. The coordinator held the commit and captured actual behavioral RED in `20261116T160304.904551Z-9a7e5ce79d56` (local connection 5/6 passed; Browse_lease_never_outlives_the_original_target_credential failed). The reviewer independently read that TRX.
Frozen LocalDataServices now limits the branch lease to the smaller of MaxMetadataLease and the positive remaining original context.CredentialExpiresUtc measured with the same Clock. Expiry while finishing returns Denied with no lease. The continuation uses that exact capped duration and the existing request-start monotonic anchor, which is conservative rather than extending validity by response preparation time. The regression verifies a one-second original credential caps the lease and denies a later continuation after expiry. DataMetadata, including GetMetadata results, has no standalone authority lease; P08 caches must use the enclosing Browse lease/request-start boundary or obtain new authority, rather than inventing a duration for metadata objects.
The reviewer independently reconciled the fresh full run `20261116T160335.804917Z-5a4994c32d15`: **393/393 passed, zero failures/skips** (Host 91, Runtime 220, Commons 41, Configuration 20, ControlPlane 21). Before these Markdown edits, HEAD still matched `b710bf9f74f04ede38b902fcffc7259e2e808aa1`; tracked diff SHA-256 matched `55029f7b6c6323a87dd3d8b96a988928d1eaee5e3889e1f57c4b07e4bd5771ae`; all 50 recorded new source/test hashes matched. This supersedes the earlier 392-case approval candidate. The additional finding is closed and **P07 approval is reaffirmed**, with the same explicit P10/P11/P12 obligations and TLS test-creation ordering variance. No builds/tests or commits were run by the reviewer.
@@ -0,0 +1,146 @@
# P07 credential and scope Astra review
**Final disposition: approved for P07.** The final reconciliation below supersedes the historical open dispositions. The superseding full P07 run `20261116T160335.804917Z-5a4994c32d15` passed 393/393 applicable tests with zero failures/skips, including Host 91, Configuration 20, and ControlPlane 21. Actual TLS, deployed rotation/restart, SQL migration/concurrency, and final implementation approval remain later gates.
**Earlier checkpoint disposition (historical): five original findings and normal scope-history reclamation were repaired; failed trust retirement/reintroduction and observation-admission races remained open.** This initial read-only review covered the frozen `DataConnectionSecretProvisioner`, `DataConnectionCredentialResolver`, `DataConnectionSecretChangeHandler`, `DataConnectionTrustPolicy`/store, `DataConnectionSecurityProvider`, and their four Host test classes while startup/composition and the remote client were still being implemented. No builds, tests, Docker commands, or commits were run by the reviewer. The original findings below are retained chronologically; the final repair dispositions and evidence are recorded at the end.
## Findings
### P2 — A transient import failure permanently consumes the mounted bundle version
`ApplyAsync` persists every entry as Version=V/Pending=true before encryption/payload writes and its final commit (`DataConnectionSecretProvisioner.cs:108-124`). Its validation then rejects every future bundle with a version less than or equal to V (`:103-106`). A transient payload store/encryption failure, cancellation after the first save, or crash before the final save leaves a Pending entry that cannot be completed by replaying the identical mounted bundle after recovery/restart. The existing failed-store test proves denial, but does not test recovery.
Persist an immutable attempt identity and support safe resumption of that same attempt, or provide an equivalent durable transaction recovery protocol. A different payload under the same version must still reject. Regress failure after pending persistence, partial multi-entry writes, and failure of the final commit; restart and replay the identical bundle must eventually make its correctly committed entries usable without inventing a higher operator version. Recovery must never expose mixed/partially committed state.
### P2 — Committed credential versions are not bound to their stored payloads
The durable state records only Version, Deleted, and Pending (`DataConnectionSecretProvisioner.cs:22-27`). The resolver decrypts the current secret row and labels it with that independently stored version (`DataConnectionCredentialResolver.cs:19-24`). After a successful V2 import, an external editor or delayed store/replication update can replace the payload with an old V1 row; the resolver returns the old bearer labeled V2. The tombstoned-row test covers Deleted=true, but not replacement of an active committed payload.
The packet owner confirmed the intended contract: external replacement must fail closed until explicitly reprovisioned at a higher version. Bind the committed version to an authenticated encrypted-state content hash or appropriate durable store revision and verify it on resolve. Regress active V2 followed by an old or different payload row; it must not return that replacement as V2. The same operation/content identity can support the safe pending retry above. Never include plaintext bearer values in diagnostics or unencrypted version metadata.
### P2 — A failed scope-removal deletion is forgotten permanently
`SetScopeAsync` saves the reduced scope and tombstones first, then deletes orphaned payload rows (`DataConnectionSecretProvisioner.cs:73-85`). If DeleteAsync fails, replay of the same scope/version returns before cleanup (`:69-70`). A later scope version computes orphaned references from the already-reduced scope, so the failed deletion is no longer discoverable. Logical resolution remains denied, which is correct, but the retired encrypted material has no durable cleanup obligation and may remain indefinitely.
Retain resumable deletion work until actual store cleanup completes, with safe idempotent retry after restart or same-scope replay. Preserve deny-before-cleanup and shared-reference ownership: a reference still used by an allowed connection cannot be deleted. Regress a failed delete after state persistence, restart, and successful cleanup without resurrecting access; include a shared-reference positive.
### P2 — Historical state has no lifetime bound or reclamation rule
`DataCredentialState.Versions` retains every historical secret reference, including tombstones. The trust store likewise retains every historical connection entry/removal marker. `DataConnectionSecurityProvider._observed` retains every ResolveAsync ID forever, including failed and non-HTTPS lookups, and every secret invalidation scans all those IDs (`DataConnectionSecurityProvider.cs:14`, `:24`, `:34`). A one-MiB bundle-file limit bounds one import only; small sequential deployments with new IDs grow the persisted state and in-process invalidation work without bound.
Define bounded live-state ownership and a safe generation/version barrier for retired history, or an explicit bounded persistence protocol with a recovery/reclamation path. Do not solve this solely by permanently exhausting a quota after enough historical IDs. The observed-ID set should reflect currently owned connections or use another bounded invalidation mechanism. Regress sequential distinct-ID/reference churn and failed lookups while retaining downgrade/stale-bundle protection and progress for a fresh active connection.
### P2 — Trust policy does not enforce the required SAN identity
`DataConnectionTrustPolicy.Validate` ignores the request URI and only rejects a supplied name-mismatch flag before custom-chain validation (`DataConnectionTrustPolicy.cs:23-33`). Its positive unit test creates a CN-only certificate with no SAN and expects it to pass when given SslPolicyErrors.None. That does not establish the plan's explicit DNS/IP SAN identity contract and depends on the platform's hostname policy.
Check the requested endpoint's DNS/IP SAN explicitly, with common-name fallback disabled, while preserving custom-root chain and server-auth validation. The official [.NET 10 MatchesHostname API](https://learn.microsoft.com/en-us/dotnet/api/system.security.cryptography.x509certificates.x509certificate2.matcheshostname?view=net-10.0) exposes an `allowCommonName` choice; its default is true. Add actual CA-issued server-leaf positives, absent/wrong SAN, IP SAN, wrong root, removed root, and wrong usage/expired-leaf negatives as appropriate. The existing injected NameMismatch case alone is not SAN coverage. Real TLS/listener/certificate rotation remains P10 evidence.
### P2 — One throwing notification subscriber can prevent required retirement fan-out
`DataConnectionSecretChangeHandler` invokes multicast actions directly (`DataConnectionSecretChangeHandler.cs:8-11`), and the security provider similarly invokes its Changed event directly. The provisioner calls these notifications after persisting a pending import or reduced scope and before finishing all entries/connections. A throwing first subscriber prevents later subscribers and later connection notifications; a rotation can therefore leave required retirement listeners uninformed while durable state has already changed. Store denial on future resolution does not itself cancel an already active stream.
Make required retirement notification fan-out resilient to individual callback failure and preserve/retry any operation-wide obligations. Errors may be reported, but cannot silently skip other affected connections. Test two listeners where the first throws and the second receives the retirement, plus a multi-connection shared-reference rotation/removal. Compose this with the existing invalidator and Galaxy notification path rather than replacing them. Do not run arbitrary blocking subscriber work under the global state semaphore if the integration can reenter credential resolution.
## Reviewed properties and integration obligations
- Scope is persisted before removed connections are notified/deleted, and the resolver rejects missing, Pending, or Deleted entries. Explicit tombstones prevent the already-tested retired-row resurrection. Shared references are retained while another allowed connection still names them. These are useful foundations; the recovery and active-payload-binding gaps above remain.
- Node/owner checks and the reference allowlist precede bundle payload mutation. Import writes encrypted payloads using the existing secret-store pattern, and credential/entry ToString methods redact values. The bounded reader supports atomic file replacement by opening with delete sharing; it does not by itself supply a production bundle watcher or restricted-file deployment policy.
- Trust is independently versioned, persists empty-root removal markers, uses custom-root trust and server-auth application policy, and rejects explicit name mismatch. Roots are copied from public certificate bytes. These observations do not establish real TLS behavior, and the SAN finding remains open.
- The four test classes include an actual SQLite/encryption restart test, but no execution result was supplied for this packet. They currently do not cover the new failure/recovery cases, changed-event composition, active streams/outcome observers, or packet lifecycle bounds.
- Host has not yet composed the bundle reader/provisioner, current allowlist, trust store, and change handler into startup/runtime lifecycle. The existing `SecretChangeSignallingInvalidator` still calls only its inner invalidator and Galaxy directory at this checkpoint; adding the data notification must preserve both. This is a known uncompleted composition boundary, not a claim that final Host wiring is defective.
- Credential/trust resolution is split across awaits. The actively implemented remote channel code currently captures a security-generation value before resolution and rejects changed generations before installing a channel. Keep that invariant and regress rotation/removal during resolution; a retired snapshot must not install a new channel after its retirement event. The active remote code was not reviewed as final.
- Scope/credential/trust retirement must deny new dispatch, retire channels and quiet streams, and retain only bounded observers for already dispatched mutations. A callback notification alone is not final evidence of those effects. No credential or trust rotation may replay a mutation or relabel its original outcome ownership.
The coordinator and packet owner received each finding for test-first correction. Final packet closure requires frozen repaired source and actual focused evidence, followed by the complete P07 review/gate after Host and remote composition are finished.
## First frozen repair rereview
The coordinator supplied `20261116T130336.930026Z-3b0156408b84`. The reviewer independently read its run record and TRX: the selected Host component packet passed **29/29, zero failed/skipped**, including all 19 credential/trust cases in the four reviewed classes. This is not the full P07 gate.
- **Interrupted-import recovery repaired:** pending entries now persist their intended content/deletion hash; an equal-version retry is accepted only while Pending and only for identical content. A changed payload under that version still rejects. The focused interrupted-version test proves denial after the initial failed write, changed-payload rejection, restart, and successful identical retry.
- **Committed payload/version binding repaired:** resolution hashes the decrypted payload and requires the committed encrypted-state hash. The active-row replacement regression returns unavailable rather than labeling replacement material with the stored version.
- **Deletion recovery repaired:** removed refs and affected connections become durable PendingDeletes/PendingNotices before work. Exact-scope replay completes those obligations rather than returning immediately; successful deletion is persisted per reference. Reintroduced/live refs are excluded from deletion. The restart-after-delete-failure regression passes.
- **SAN enforcement repaired:** validation explicitly matches RequestUri.IdnHost with common-name fallback disabled before custom-root chain validation. The focused tests now reject CN-only identity and validate a CA-issued SAN leaf against the correct/wrong issuer. Real wire trust rotation remains P10.
- **Notification fan-out repaired:** each subscriber and each affected connection is attempted despite individual exceptions, then failures are aggregated. Scope notices remain durable for same-version retry, and trust updates remain PendingNotice/unresolvable until successful notification. Tests cover a throwing first subscriber, same-scope notification retry, and same-version trust notification recovery. Final composition must still preserve the existing invalidator/Galaxy path and actual stream retirement.
### Still open — a finite historical cap permanently exhausts availability
The repair limits Versions and trust history to 256 entries, but does not reclaim absent historical entries (`DataConnectionSecretProvisioner.cs:134-135`; `DataConnectionTrustPolicy.cs:63`). After 256 sequential retired refs/connection IDs, a fresh active ID is permanently rejected even when the live scope is empty. SecurityProvider similarly caps `_observed` without removal; 256 failed HTTPS lookups can prevent a later valid connection from resolving. The new tests assert failure at the historical cap, not progress after churn. The memory growth is bounded, but the original availability/lifetime finding remains unresolved.
The coordinator/worker proposed a durable scope-generation floor as the next repair direction. That is sound if every credential bundle and trust update must carry the exact current authoritative generation; floor and allowlist are atomically persisted before retirement/reclamation; and absent history is reclaimed only after cleanup and no remaining live reference. The floor must survive offline restart and come from a trusted monotonic deployed-scope revision. A process-local authority/catalog epoch, wall clock, or local increment that turns an old artifact into a fresh scope is insufficient.
Include generation in immutable retry identity and reject an old generation even when its material Version is larger. Unchanged allowed references may retain already committed material; new updates must use the current generation. Regress removal/reintroduction of the same reference, old high-version bundle/trust replay after restart, failed cleanup, and more than 256 sequential IDs while a fresh active ID still progresses. Provider observation must track live ownership or another reclaimable bounded invalidation set. This direction has not yet been source-reviewed or tested as an implementation.
## Scope-floor repair checkpoint — two paths still open
The next frozen repair adds an exact persisted scope generation to credential bundles and trust updates, includes it in equal-version pending retry identity, and removes retired credential versions after successful physical deletion. Trust also persists an allowlist/floor before notifying removal and reclaiming absent entries. Source inspection verifies those normal-path barriers. The reviewer read the actual TRX for `20261116T131308.089661Z-57464278e345`: 32 executed, 31 passed, one failed. The failure is the separately identified Root publication-disposal race; the credential/trust scope-generation churn cases passed. This is not an all-green component or phase claim.
Two remaining concrete paths prevent closing the lifetime/reclamation work:
### P2 — Failed trust retirement can reactivate old trust on reintroduction
ApplyScope persists removed IDs in PendingNotices but leaves their trust Entries intact until notification completes. If removal notification fails, then a newer scope reintroduces the same ID, CompleteScope clears the notice and retains the old Entry because it is once again in Scope (`DataConnectionTrustPolicy.cs:63-68`, `:79-85`). Resolve then returns the retired CA without a new current-generation SetAsync.
Regress scope 1 containing A and an old CA; scope 2 empty with a throwing observer; scope 3 containing A after observer recovery. Trust must remain unavailable until explicitly provisioned under scope 3. Mark the entry retired durably when scope removal is persisted, or reclaim all pending-retired entries even when the ID has been reintroduced before cleanup. Preserve the successful notification/retry and unchanged-live-reference cases.
### P2 — Observation admission can race past the removal notification
SecurityProvider awaits IsEligibleAsync, then inserts the ID into `_observed`. Scope can be removed after eligibility completes but before that insertion: OnConnectionChanged removes nothing, the resolver then inserts the now-retired ID, later credential lookup returns null, and the stale observation remains. Repeating this window with distinct IDs exhausts the 256 cap despite empty live scope (`DataConnectionSecurityProvider.cs:24-32`). The client's separate security-generation check prevents installation of a stale channel, but does not reclaim this provider state.
Fence observation admission against scope/change generation or use an equivalent owned conditional-cleanup protocol. Regress the eligibility-to-registration window deterministically and require eventual fresh-ID progress; do not remove another live observation merely because one concurrent resolve failed.
## Authoritative central scope revision direction
A bounded singleton central state row containing a positive checked scope revision, canonical current allowlist fingerprint, and concurrency token is an appropriate minimal durable source. It needs no historical-ID dictionary. This is a design decision only; migration/composer integration is not yet reviewed.
- Increment only when effective scope changes. No-op scope reuses the revision, while A → B → A advances twice. Serialize the positive revision into every newly sealed artifact, including the empty/removal scope.
- Canonicalize the effective owner/consumer/connection-to-secret-and-trust allowlists using admission's identity semantics and scope-affecting enabled state. Exclude rowversions and timestamps from the semantic fingerprint.
- **Serialize revision assignment with the validated draft.** Current ComposeDeploymentAsync reads and commits the DraftSnapshotFactory transaction before later validation/composition. Allocating a new scope revision afterward can let delayed composer A seal an old allowlist with a revision newer than composer B's intervening removal. Lock the state row before reading the draft and hold an outer transaction through validation, compare/increment, composition and Deployment persistence, or use a snapshot-version CAS that retries the entire read/validate/compose. DraftSnapshotFactory already honors an existing transaction.
- Commit the state row and sealed deployment artifact together, and dispatch only after commit. A conflict retries the entire snapshot; do not reuse an old validated snapshot with a freshly allocated generation. Counter exhaustion must fail before changing authority.
- Keep ConfigComposer.Compose pure over its supplied snapshot, including the selected scope revision. SnapshotAndFlatten/drift probes must remain read-only and must not advance the counter. Extend no-op hash stability, concurrent sealing, rollback, and schema/model-compliance tests for the additive row/field.
- Consumers persist the floor across offline restarts. Missing/stale versions after a known floor cannot overwrite it or reactivate connections, including legacy/empty-artifact parsing. Intentional rollback requires a newly sealed higher scope generation rather than replay of an old artifact. Restoring central storage to an older counter cannot reset consumer floors.
The proposed transaction boundary and consumer-floor rules were sent to the coordinator before migration work. The two local failure/race findings above remain open, and complete Host composition/full P07 review is still required.
## Frozen repair and central source checkpoint
The reviewer independently read run `20261116T134802.525866Z-44c634f2fd5c` and its TRX: 192 selected cases passed with zero failed/skipped, including Host 66 and all current credential/trust cases. **The two preceding local findings are repaired:** trust entries are marked Retired in the same saved removal state, and completion removes retired entries even if a later scope reintroduces the ID. Resolve denies Retired. The failed-retirement/reintroduction regression passed. SecurityProvider captures a change generation before eligibility and admits an observation only after credential/trust resolution, under the generation lock; all scope/secret events advance that generation. The eligibility-to-observation removal regression passed, and failed resolves no longer enter the observed set. Together with the earlier verified repairs and scope-churn/restart cases, this closes the prior local credential findings at the reviewed component boundary. Final activation/rotation wiring is still pending.
`ComposeDeploymentAsync` now starts a Serializable transaction and takes the singleton scope-state write lock **before** DraftSnapshotFactory reads the draft. The factory reuses the outer transaction. The scope revision/fingerprint, Deployment artifact, and ConfigEdit are saved together; transaction commit precedes DispatchDeployment. This source ordering implements the approved stale-composer barrier. Pure ConfigComposer takes the scope version from its supplied snapshot, while read-only factory/drift paths do not advance it. The new singleton migration seeds ID 1/version 0, constrains singleton identity/nonnegative revision, and adds rowversion. Migration/model changes postdate the 192-case run and are not covered by that result; no SQL application was performed by this reviewer.
### P2 — Central and consumer identifier semantics disagree
DataConnectionScopeRevision uppercases owner, consumer, connection, and secret-owner identifiers, so a case-only ID change intentionally retains the same scope generation. Local credential/trust scopes instead use Ordinal dictionaries/sets; bundle owner/node checks and the hashed durable state namespaces use raw case. For example, the central Link → link no-op yields the same version, but SetScopeAsync rejects `{link: reference}` after `{Link: reference}` at that version. Changing owner/node case can also select a different durable floor namespace even though the central identity is unchanged. Secret references correctly remain case-sensitive and must not be folded.
Use one canonical identifier representation or matching case-insensitive identity semantics across central fingerprint, credential/trust state names, scopes, bundle validation, and consumer activation. Regress the combined fingerprint-to-consumer path, mixed-case restart/state lookup, and stale-bundle rejection across case-only edits. Do not infer this agreement from the passing pure fingerprint case-insensitivity test. Repair/evidence are pending.
### Central evidence still required
The current Configuration two-case helper packet and one ControlPlane artifact test do not exercise ComposeDeploymentAsync. Required local coverage should use the real actor for no-op seals (same version/hash), A → B → A and final empty removal (state matches embedded artifact), invalid draft/no dispatch/no authority change, save failure/no dispatch, checked version exhaustion, and read-only SnapshotAndFlatten. InMemory failure-before-save is useful but must not be described as relational rollback/concurrent-lock proof.
Applicable existing **local-only** selections are ControlPlane `ConfigComposerTests`, `AdminOperationsActorSingleSnapshotTests`, and the `AdminOperationsActorTests.StartDeployment_*` methods; Configuration `DraftSnapshotFactoryTests` and design-time `GrpcDataSchemaModelTests`. The latter currently assumes the latest migration is AddGrpcDataConnections; the new scope migration makes that assertion stale. Locate the intended prior migration by identity when checking its down script, and add new singleton model/seed/check/up/down-script assertions. Update schema documentation/table expectations for ScopeState.
`SchemaComplianceTests`, `RawSchemaIntegrityTests`, `DraftSnapshotFactorySqlServerTests`, and `ConfigComposerSqlServerHashStabilityTests` require real SQL fixtures and are not local unit selections. Actual concurrent seal serialization, lock release on validation rejection, and rollback of state plus artifact on commit failure require explicit relational evidence; mock command ordering is not equivalent. Full P07 approval remains pending Host/DI/actor activation and the final integrated gate.
## Composed invalidator checkpoint — P2 unrelated connections are retired
The real SecretsRegistration now passes DataConnectionSecretChangeHandler to SecretChangeSignallingInvalidator. DataConnectionSecurityProvider.OnSecretChanged ignores the supplied SecretName and retires every observed connection. Consequently, rotating one data credential first sends the provisioner's precise per-reference notifications, then its ordinary invalidator call retires all other data links. Editing an unrelated Galaxy secret also drains the whole data connection set. The existing runtime test for a direct per-connection security event does not exercise this composed path.
Resolve and retain bounded connection-to-reference provenance with each successful observation, or use an immutable current-scope reference map, so a secret notification retires exactly its current users. Preserve the first-resolution/in-flight generation barrier and removal cleanup; narrowing the fanout must not restore the previously fixed observation race. Do not synchronously reread the store from the callback: provisioning invokes the invalidator while holding DataConnectionSecretProvisioner.Gate, making that approach deadlock-prone.
Required composed coverage uses the real invalidator, provider, and runtime: rotating A cancels A's old lease while distinct-reference B remains current; an unrelated secret cancels neither; a shared reference cancels all its users. The coordinator identified the composition concern and the reviewer independently confirmed the source path. Repair and actual regression evidence remain pending; this is not whole-phase approval.
## Final credential, invalidation, and scope closure
The final run and source identity were independently reconciled as recorded in `p07-contract-astra-review.md`. Host 91/91, Configuration 20/20, and ControlPlane 21/21 pass, with no failures or skips. This closes the earlier identifier-casing, completed-bundle replay, and composed-invalidator findings as well as the previously verified durable floor/tombstone/pending-cleanup/observation-race repairs.
Canonical references remain `secret:data/...` in scope/history/artifacts; all physical store operations use the one StoreName conversion that strips the exact `secret:` prefix. Both central validation and Host scope admission reject uppercase suffix aliases, matching the pinned SecretName normalization. Owner/node/connection identities use consistent canonical casing. Completed identical bundles are replayable after restart, while changed payloads at the same version and externally overwritten committed payloads fail closed. The reviewer independently read the actual Host three-case RED in `20261116T154508.671279Z-4ce9d3d0e4b0` and central two-case uppercase RED in `20261116T154756.981334Z-ba1d43a247b0`; the repairs are green in the final frozen gate.
Successful security observations now retain their resolved physical SecretName in the bounded observation map. Secret invalidation selects only matching users; an unrelated/Galaxy secret leaves data links current and a shared reference retires all its users. The existing global in-flight generation check remains, including when no successful observation exists yet. Callback processing performs no store read and therefore does not reenter the provisioner's held gate. The composed invalidator/provider/runtime regression passes, and the final Runtime two-link regression additionally verifies that a transient role read during A's change does not strand B.
The central local gate now covers monotonic change/reversion/empty/no-op behavior at the revision helper, actual actor unchanged-scope sealing and failure-before-save/no-dispatch/retry, affected validation/single-snapshot/composer regressions, and design-time singleton migration/model/script assertions. This layered evidence is accepted for the P07 unit boundary; it is not an assertion that every state transition was separately exercised through a relational actor fixture. Serializable locking before the draft read and transaction-through-artifact-save remain source-verified. Actual SQL lock ordering/concurrency, rollback on commit failure, and migration application are explicit P10 obligations, not inferred from InMemory tests.
No actionable credential/scope finding remains for P07. The final phase approval and explicit TLS test-creation timing variance are recorded in the contract review; no real network, SQL, Docker, or P12 approval is implied.
The superseding 393-case run additionally closes the original target-credential expiry cap on Browse leases/continuations; the finding, narrow Runtime repair, actual RED, and new candidate identity are reconciled in `p07-contract-astra-review.md`. The credential/trust/central source reviewed here is unchanged by that repair and all its selected cases remain green.
@@ -0,0 +1,19 @@
# P07 read-only preparation — NOT implementation
P06 source and its final gate/review remain in progress. This note is a map, not approval or evidence of P07 implementation. Coordinator owns `Program.cs` and shared DI; settle packet interfaces before edits.
## Existing boundaries
- `src/Server/ZB.MOM.WW.OtOpcUa.Host/Program.cs`: pre-host `AddZbSecrets` and SQLite migration at 118–129; role-gated `AddOtOpcUaLocalDb` at 273–279; `AddOtOpcUaSecrets` at 629; one `AddGrpc` interceptor chain at 658–675; explicit Kestrel h2c takeover and existing-binding reconstruction at 679–783; auth middleware only on admin at 803–809; mesh maps at 817–822. Any added listener must join the binding reconstruction, preserve UI bindings, and check actual local port/host on each RPC: endpoint routing alone does not isolate listeners.
- `Host/Configuration/MeshGrpcEndpoints.cs` maps LocalDb sync, artifact/central command, telemetry/node command with `AllowAnonymous`; the interceptors are the fail-closed authentication boundary, and the explicit metadata bypasses admin cookie fallback. Data ingress needs its own equally explicit fail-closed auth plus listener admission; mesh services must also be barred from the data port. Disabled means unmapped. TLS HTTP/2 is dedicated; cleartext only explicit loopback development.
- `Host/Configuration/SecretsRegistration.cs` selects local SQLite or opt-in pair replication and decorates `ISecretCacheInvalidator`. `SecretChangeSignallingInvalidator.Invalidate(SecretName)` calls the inner invalidator then optional Galaxy directory; compose any data change notification, do not replace either. Existing production write pattern in `AdminUI/ApiKeyAck/ApiKeyGalaxyAckIdentityService.cs` uses `_cipher.Encrypt(name, value, SecretContentType.Text) with { Description, CreatedBy, UpdatedBy }`, `_store.UpsertAsync(row, ct)`, then `_invalidator?.Invalidate(name)`. Mint target keys with `IApiKeyAdminService.CreateAsync(string name, string principal, DateTime? expiresUtc, string? notes, CancellationToken ct)`; only the returned string contains the plaintext. Grant scoped exports separately.
- Pinned `Directory.Packages.props`: Secrets 0.6.2, Secrets.Abstractions 0.6.6, Secrets.Replicator.AkkaDotNet 0.6.2, Grpc.AspNetCore/Grpc.Net.Client 2.76.0, Google.Protobuf 3.34.1. Installed 0.6.2 and 0.6.6 packages contain DLL and README but **no XML documentation**; do not infer unverified library methods from older XML. Check the pinned package README and existing call sites for any additional operation.
- `Runtime/DataConnections/LocalDataServices.cs` exposes `IDataConnectionFactory.Create(DataAuthenticatedContext, DataTarget)`; its constructor accepts the catalog provider, hub, policy, capabilities, clock and optional caller write/subscription factories. Without a factory it does not advertise the corresponding operation. `DataWriteRuntime.ForCaller(context, Func<IActorRef?>)` is public, but `LocalSubscriptionService`, `DriverHostSubscriptionDemandSource`, its `SubscriptionAcquisitionCapacity` dependency and session limits are internal. Add a narrow **public Runtime composition seam** that owns construction/lifetime; do not use `InternalsVisibleTo` for Host. `LocalCatalogCoordinator(activation, authority, Func<ServingIdentity>)` and `SourceSamplePublisher(hub, Func<ServingIdentity?>, originClusterId)` require the same actual boot NodeId/incarnation and current role provenance as the facade. Share authority/dispatch fence, clock and process acquisition owner with write and driver-host paths. Verify Host actor construction actually receives those instances; creating disconnected singletons is insufficient. Feature remains false until fully wired.
## Packet and test-first boundaries
1. **Secret/trust lifecycle:** Host `Configuration/DataConnectionSecretProvisioner.cs`, `DataConnectionCredentialResolver.cs`, `DataConnectionSecretChangeHandler.cs`, `DataConnectionTrustPolicy.cs` and their four manifest Host tests. Define a narrow local bundle reader, current consumer scope/reference allowlist provider, durable monotonic version/tombstone store and credential/channel retirement notifications. On removal deny and drain before deleting an unshared reference; persist tombstones and current allowlist so an old mounted bundle cannot resurrect it after offline DB-less restart. Validate expected owner cluster and actual consumer NodeId per bundle, encrypt into local `ISecretStore`, never publish bearer in central deployment artifacts or offer an upload endpoint. Atomic replacement, encryption/store failure and partial updates must fail closed. Credential and independent trust versions retire matching channels/streams; retain dispatched write outcome observers without replay. Exercise existing Galaxy invalidation. Test two independently provisioned replicas and independent pairs, downgrade/wrong-scope/missing-secret, deletion and offline restart, and trust old/new/removal.
2. **Remote client:** Runtime `GrpcDataConnection.cs`, `DataConnectionManager.cs`, `ClusterEndpointSelector.cs`, `DataConnectionRoleAdapter.cs` and manifest `GrpcDataConnectionClientTests`, `GrpcDataEndpointSelectionTests`, `GrpcDataConsumerScopeTests`. Identity of a bounded cached channel includes endpoint, credential version and trust fingerprint. Node selection remains pinned; cluster selection authenticates capabilities and selects ready Primary, with unknown role/no primary unready and bounded backoff. Retry read/query within original causal budget; retry writes only individually typed `RejectedBeforeDispatch`, never unknown or a lost reply. Scope changes drain handles; stream epochs renew after channel/role changes. Construct realm roots from validated capability cluster identity. Confirm mapper and generated proto fields, version 1.1, age/readiness and decode/transport bounds before coding; no assumed field names.
3. **Coordinator-owned ingress and composition:** `Host/Grpc/DataConnectionGrpcService.cs`, `Configuration/DataConnectionOptions.cs`, `DataConnectionOptionsValidator.cs`, `DataConnectionAuthInterceptor.cs`, `DataConnectionEndpoints.cs`, plus Program/shared DI and Runtime public composition seam. Manifest `GrpcDataListenerTests`, `GrpcDataIngressAuthTests`, `GrpcDataServiceDispatchTests` should prove disabled mapping, listener and method admission, cookie behavior, key/pepper/authority failures, partial batches, final per-response publication gates and bounded parsing. Stream delivery must await real `WriteAsync` success before acknowledging baseline; expiry/revocation closes quiet streams. Separate unary and stream timeout policies, disable automatic write retries/hedges. Integration wire tests are P10, including real TLS/cert rotation and actual caller DI for the public NodeProbe fixture; no production network-control hook.
Manifest H regressions: `DriverWriteBoundsBindingTests`, `ApiKeyStoreRegistrationTests`, `ApiKeyAuthenticationTests`, `SecretsPreHostContentRootSourceTests`; R role regressions `WarmRoleAuthorityTests` and `PrimaryGatePolicyTests` if role adapter changes. P10 also runs `MeshGrpcAnonymousMetadataTests`, `MeshGrpcAuthStackTests`, `MeshGrpcBoundaryTests` and the new TLS/listener wire tests. P06 focused tests and current review remain separate gates.
@@ -0,0 +1,133 @@
# P07 remote lifecycle Astra review
**Final disposition: approved for P07.** The final reconciliation below closes the historical remote and deployment-runtime findings. The superseding full P07 run `20261116T160335.804917Z-5a4994c32d15` passed 393/393 applicable tests with zero failures/skips; Runtime passed 220/220. Later integration/scaling/full-implementation gates remain pending.
**Initial checkpoint disposition (historical): the initial remote packet was not approved; the findings below required correction and focused evidence.** This source review covered the frozen `DataConnectionManager`, `GrpcDataConnection`, `ClusterEndpointSelector`, `DataConnectionRoleAdapter`, and their initial tests. New regression test preparation began while review continued; no new failing/passing result was inferred from test source. No builds, tests, Docker commands, or commits were run by this reviewer. The earlier coordinator run `20261116T125221.449960Z-a59846699d1c` recorded 59/59 passed, zero failed/skipped, for the initial focused packet and affected session/role tests; its run record was independently read. It did not close the new findings or establish final Host integration.
## Findings
### P1 — Retired channels are uncharged while physical cleanup can remain blocked
`RetireAll` clears the entire active channel dictionary, discards each CancelAsync task, and queues a separate Channel.Dispose callback (`GrpcDataConnection.cs:70-78`). A subsequent acquisition can immediately create another channel under the same maxChannels allowance. Repeated security changes while a handler's Dispose is blocked accumulate old physical channels, callbacks, and queued disposal work without a bound tied to admission.
Keep retired physical ownership charged until cleanup actually completes, with a bounded/coalesced retirement path and explicit admission behavior while saturated. Do not make a global lock wait for arbitrary transport disposal. Regress one allowed channel, gated handler disposal, repeated security rotations/new acquisitions, and eventual progress after releasing cleanup. A logical dictionary removal or cancellation request is not physical completion.
### P1 — Scope revision churn admits unlimited unresolved cancellation generations
`DataConnectionManager.ApplyScope` removes the old State, starts and discards CancelAsync, then immediately admits the replacement (`DataConnectionManager.cs:44-50`). Dispose similarly drops all states before cancellation callbacks complete; ScopeLease.Dispose has no ownership effect (`:63-76`). With maximumConnections=1, a blocked registered cancellation callback and repeated revisions create an unbounded sequence of retained old states/tasks while the active dictionary still contains only one entry.
Give retired scope generations explicit bounded ownership through actual callback/lifetime cleanup and coalesce newer desired revisions. Retire outside the global lock while preserving immediate denial of the old generation. A replacement must not evade capacity merely by changing its revision or ID. Regress blocked cleanup, repeated same/different IDs, outstanding leases, and recovery to the latest desired revision after cleanup completes. Preserve stale-generation denial after scope removal/readdition.
### P2 — Discovery and failover renew an item's original write budget
The client records one batch start time but sends each item with `min(original item.RemainingBudget, remaining batch budget)` (`GrpcDataConnection.cs:249-251`). It never subtracts elapsed discovery, first-attempt, or retry-metadata time from the item's own original budget. An item with 500 ms remaining in a five-second batch can still be dispatched for another 500 ms after discovery already consumed 600 ms.
Track each original item expiry against the same monotonic start and reduce it across all work/attempts. Do not dispatch an expired item; retain the proper no-dispatch result without preventing still-live items from progressing. Regress delayed capabilities and retry metadata with fake time, including mixed short/long item budgets and the original batch deadline. Never restart the item budget when changing endpoints or semantic preconditions for a proven rejection.
### P2 — The receiver accepts retired-handle reuse and sample-version regressions
Ack validation rejects collisions only with the currently active `_handles` dictionary (`GrpcDataConnection.cs:417-443`). Remove and Modify delete old entries, so a later acknowledgment can reuse a retired numeric handle/revision for another view. A late old value then passes the ordinary handle lookup. Separately, ReadAllAsync validates frame sequence and serving identity but does not track per-handle sample versions before yielding values (`:384-399`, `:454-457`). A new frame sequence with a lower sample version is therefore exposed.
Enforce the contract's epoch-local no-reuse and monotonic value rules with bounded state and an explicit reset/admission policy when its bound is reached. Do not assume opaque handles are ordered unless that becomes an explicit negotiated contract. Regress remove/add and modify reuse, a late old value after the attempted reuse, and sample version 100 followed by 99 under the next valid frame sequence. A legitimate new stream epoch/new handle must still establish a fresh baseline.
### P2 — Acknowledged commands retain timers and caller-owned payload graphs
Every SendAsync stores the original caller command and starts an independent expiration task (`GrpcDataConnection.cs:350-368`). Successful acknowledgment removes only the pending dictionary entry (`:447-451`); the delay task still captures the complete command until the original timeout or stream cancellation. A healthy acknowledged burst can retain up to the lifetime command cap (100,000) worth of item lists/timers, with no pending-byte charge. The pending-count limit does not bound this already-acknowledged retention.
The command's IReadOnlyList may also be backed by a mutable caller collection. Because pending state retains that same object, mutation after SendAsync can change later acknowledgment expectations even though different items were actually sent.
Admit bounded owned command state before asynchronous work, copying the necessary semantic/ack identity and enforcing local count/byte limits. Release its deadline and retained state on acknowledgment or failure. A bounded shared deadline scheduler or correctly canceled per-command ownership can work; successful ACKs must not leave full payload graphs sleeping until timeout. Regress acknowledged churn with long timeouts and bounded outstanding work/bytes, plus caller collection mutation after send. Retain duplicate-command fencing without allowing unlimited historical IDs.
## Source properties and remaining evidence
- The selector now requires the expected cluster, explicit Node pin, ready state, and either Primary or an explicitly permitted Secondary replica read. Unknown roles deny. The role adapter delegates Warm/Hot decisions without performing an election. These helpers do not establish final Host role gating by themselves.
- Channel identity includes credential version and trust fingerprint. A generation captured before security resolution is checked before installation, which rejects a retired security snapshot. The initial test source includes rotation during resolution. Preserve this when introducing owned retirement accounting.
- Unary response envelopes and nested read samples are checked against selected provenance. Mutation retries are limited to explicit rejected items; initial lost replies become OutcomeUnknown. The implemented demotion exception accepts only an entirely rejected batch from the same node/boot. This is a conservative subset of the contract discussion, not permission to replay other items after a role mismatch.
- Original per-item budget handling above remains incorrect despite the correctly retained batch start. A passing lost-reply test does not establish all retry/deadline semantics.
- Stream count must have a receiver-owned local ceiling independent of a peer-advertised MaxStreams. A new test for this was being authored during review; its production/API repair and actual result are not claimed here.
- The initial tests mainly cover selector/scope helpers, unary fake-wire paths, and security-resolution generation. Add actual duplex fake-wire lifecycle cases for command ownership, acknowledgment timeout, handle reuse/version regression, retirement while reads/writes are blocked, and final release of stream/transport work. Cancellation that stops waiting must not release quota for still-owned physical work or allow unlimited replacements.
- Verify bounded no-ready-primary backoff, channel retirement under failure/churn, scope/revision removal, and fresh stream epochs/snapshots after role or endpoint changes at the completed connection-manager boundary. No ready-endpoint or reconnect behavior is established by an immediate one-pass selector loop alone.
- Credential/trust rotation may close the client route and produce an ambiguous result, but cannot replay or relabel an already dispatched mutation. The original origin-side bounded outcome observer must survive; final Host/remote tests must establish that composition rather than infer it from token cancellation.
These are source findings and concrete regression requirements, not a final network/TLS/Docker review. Packet closure requires frozen repairs and actual focused results, followed by the full P07 gate and integrated source review.
## Follow-up: physical HTTP ownership, 2026-11-16
The current source repairs the initial channel/scope accounting direction: retired channels remain included in channel admission until both cancellation callbacks and actual channel disposal finish; retired manager states retain their slots until cancellation completes and all scope leases release. `GrpcDataConnection.DisposeAsync` retains its scope lease until its active work, streams, and retired channels drain. These observations supersede the old implementation descriptions above; full packet evidence/disposition remains pending.
The coordinator reported Runtime run `20261116T132916.652106Z-dca2192d7e9c` as 22 passed / 3 failed. Two failures were the deliberately unbound prepared-publication guard regressions. The ignored-HTTP-cancellation case timed out because it awaited the first unary result before releasing its intentionally blocked handler. That timeout is **not evidence that unary admission was released early**. The repaired handle/list/sample-version and original-item-budget cases passed in that reported run. This reviewer did not run the tests.
### Unary Send/body reads: no demonstrated need for a raw HTTP tracker
The exact pinned [grpc-dotnet v2.76.0 GrpcCall source](https://github.com/grpc/grpc-dotnet/blob/v2.76.0/src/Grpc.Net.Client/Internal/GrpcCall.cs) was independently inspected. `CancelCall` (lines 424–450) completes the overall `_callTcs` and requests cancellation but does not complete unary `_responseTcs`. `RunCall` directly awaits raw HTTP SendAsync (493–496) and, for a unary response, the body read (563–568). Its response task is completed only afterward (602/647). Current `QueryAsync` and `WriteAsync` retain `_unaryCapacity` and `_activeWork` through that actual ResponseAsync await. An ignored Send cancellation or body-read cancellation therefore keeps the current unary admission charged. Do not add a blanket HTTP wrapper on the basis of the timeout above.
The correct regression holds the raw work, asserts the first unary task is still incomplete and another call is rejected by unary admission, then releases raw work before awaiting the first task and proves recovery. A handler's `Disposed` signal alone precedes completion of `FinishChannelRetirementAsync`; a generic capacity exception can otherwise accidentally assert the retiring-channel charge instead of the unary charge.
### P1 — Duplex disposal can release its slot before preheaders HTTP work ends
Current `SubscribeAsync` returns immediately after starting the duplex call (`GrpcDataConnection.cs:397–408`). `RemoteSubscription.ClosePhysicalAsync` marks `_physicalClosed` when `lifetime.Cancel` and `call.Dispose` return. With no active Send/MoveNext, this releases `_activeStreams`, although the pinned gRPC `RunCall` can still be awaiting a raw `/Subscribe` SendAsync that ignores cancellation. A MoveNext waiting for response headers does not fix this: cancellation eagerly cancels `ClientStreamReader.HttpResponseTcs`, allowing that operation to finish before raw Send ends. Repeated open/dispose on one unchanged channel can therefore exceed the configured physical stream bound.
A narrow completion receipt is available without a raw handler/content wrapper: retain the owned stream through `call.ResponseHeadersAsync` as well as disposal and current operation counts. In the pinned source, `GetResponseHeadersCoreAsync:308` awaits the distinct `_httpResponseTcs`, which is set only after raw Send completes or throws (`RunCall:497/637`). Neither cancellation, deadline cancellation, nor Dispose eagerly completes that TCS. This proves preheaders Send completion, not body-read/write completion; keep the existing operation ownership for those phases. Require actual no-reader and preheaders-reader negative regressions, bounded replacement denial, and recovery after releasing the handler. Repair/evidence are pending.
### P1 — Subscription discovery runs before bounded admission
`SubscribeAsync:375–391` increments the unbounded `_activeWork` counter, then performs `SelectAsync`/GetCapabilities before reserving `_activeStreams`; it never takes `_unaryCapacity`. Concurrent subscription setup can thus launch arbitrarily many blocked capabilities HTTP operations despite both local limits being one. Reserve a bounded local stream/setup slot before discovery, validate the peer limit after discovery, and transfer that same reservation into the returned stream. Release it only after actual setup/owned transport work settles, including failure and cancellation. A deterministic regression must block capabilities discovery and prove a second setup is rejected without invoking another Send. Repair/evidence are pending.
These two new findings are confined to duplex/setup ownership. They do not justify changing the already-held unary path, and neither the source direction nor the reported partial run constitutes full P07 approval.
## Frozen repair checkpoint: 192 selected tests
The reviewer independently read `20261116T134802.525866Z-44c634f2fd5c/unit/P07/run.json` and all five TRX files: **192 passed, zero failed/skipped** (Host 66, Runtime 82, Commons 41, Configuration 2, ControlPlane 1). This is a component checkpoint, not completed P07 integration. Host mapping, DI/actor composition, and deployed-scope/bundle activation remain unimplemented at this point.
The frozen remote source now retains channel retirement through actual disposal/cancellation and manager scope retirement through callbacks plus outstanding leases. Per-item write time is reduced by elapsed discovery/attempt time. ACK expectations use an owned copy from the encoded command; retired numeric handles remain fenced with bounded history, and sample versions cannot regress. The focused cases for those changes passed. Query/discovery backoff has bounded exponential delay with jitter, security change clears it, and a bounded per-connection stream-ID/epoch fence denies reuse. The normal installed-stream path now awaits the exact pinned gRPC ResponseHeadersAsync receipt before physical-close completion; both no-reader/preheaders-reader regressions passed. Local stream reservation now precedes discovery, and its blocked-discovery regression passed. Ignored unary Send and body-read cases passed while keeping existing unary admission charged. No raw HTTP wrapper was added or is required by those cases.
### P1 — Disposal between duplex creation and registration bypasses the new receipt
In `SubscribeAsync`, the raw duplex call and RemoteSubscription (which captures `_headersReceipt`) are created before `_sync` is acquired to install the stream. If connection disposal wins that race, the `_disposed` branch calls `call.Dispose()` and throws. The catch disposes lifetime and the outer finally releases the setup reservation and `_activeWork`, without awaiting the constructed subscription's headers receipt. An ignored preheaders raw Send can therefore outlive all stream/scope ownership on this failure path. The passing installed-stream tests do not cover it.
Require a deterministic after-call-creation/before-installation race with connection disposal and an ignored raw Send. Every path after raw call creation must transfer ownership to a closing subscription or retain/await its physical completion before releasing setup/scope charges. Do not wait for transport cleanup under `_sync`. Source repair and actual regression are pending.
### P2 — Canceled command timers still capture uncharged acknowledged metadata
`ExpireUnacknowledgedAsync(PendingCommand pending)` captures the record containing ClientIds/Removed arrays across Task.Delay. A successful ACK removes that record and releases `_pendingBytes`, then cancels/disposes the timer. Its queued cancellation continuation can still retain the record and arrays until it executes. A rapid ACK burst can therefore retain substantially more metadata than the current pending-byte allowance while only the much smaller historical command-ID charge remains. The mutable-list test establishes copying, but there is no acknowledged-churn/retained-byte regression in this checkpoint.
Make the expiration task capture only a small command ID plus timer/identity token, using the pending dictionary to resolve live work at expiry, or retain the byte charge until the actual expiration task exits. Add deterministic delayed-cleanup/ACK-churn coverage. This is a command-state ownership issue; it does not call for a transport wrapper. Repair/evidence are pending.
## Remote repair closure: Runtime 103/103
The reviewer independently read run `20261116T141626.988288Z-e977454116c3` and its TRX: **103 Runtime cases passed, zero failed/skipped**, including the two latest regressions and the earlier installed/preheaders/discovery/ignored-cancellation cases. The frozen `GrpcDataConnection` and manager repairs close the remote findings recorded above at this component boundary.
- Failed stream installation now transfers the reservation to the created subscription even when connection disposal wins; asynchronous cleanup remains outside `_sync`, the captured headers receipt still owns preheaders raw Send, and the stream remains counted until that receipt and active operations complete. The deterministic disposal-before-install regression verifies connection disposal and scope replacement remain blocked until the raw handler is released.
- The expiry task now receives only command ID, timeout, and timer; it compares timer identity against the live dictionary entry. It does not capture PendingCommand or its item arrays across the delay. The regression delays the canceled timer continuation and uses a WeakReference to prove the acknowledged PendingCommand can be collected before that continuation resumes.
No additional actionable defect was found in this frozen remote client/manager rereview. This is **not P07 approval**: the newly authored deployment registry/activation path was explicitly outside this review, and real Host DI, deployed scope/bundle application, final role authority, and integrated gates remain outstanding. The separately reviewed observed-role actor issue is recorded in `p07-contract-astra-review.md`.
## Deployment-runtime source checkpoint — availability findings open
The registry now owns one reconciliation worker, bounded desired definitions, the existing manager's active/retiring capacity, and connection retirement tasks through physical client cleanup. BeginAttempt denies routes before fallible local artifact processing, and matching attempt/generation checks prevent old asynchronous scope activation from reopening them. No additional physical-transport ownership defect was established in this inspection. The scope-store retry defect already under coordinator repair is not counted again here.
### P2 — A transient role-read failure can permanently empty the connection manager
Registration's coherent role capture uses TryEnter, returning Unknown on temporary dispatch-fence contention. ApplyManagerScopeLocked converts that one false eligibility observation into an empty manager scope (`DataConnectionDeploymentRuntime.cs:175–180`). ReconcileAsync can subsequently observe an active role and valid credentials but calls manager.Acquire against the still-empty scope; the denial is swallowed and no retry or scope reinstatement follows (`:277–314`). The same transient false during reconciliation can exit its only worker pass. No actual role transition need occur to wake it again.
Keep acquisition fail-closed during contention, but reconcile the manager's desired scope after a current eligible observation and retain one bounded retry for temporary uncertainty. Regress false only on the initial eligibility read, as well as contention lasting through the first reconciliation pass; after release, the configured route must become acquirable without another artifact, credential, or role event. Source repair and observed regression results are pending.
### Related unresolved boundary — transient credential/trust reads
The scope retry alone does not cover ResolveAsync failures: reconciliation catches those exceptions or receives null and leaves that configured connection absent without another wake. The concrete Host credential resolver deliberately converts store exceptions into false/null, so retrying only thrown runtime exceptions is insufficient. Extend the existing owned backoff mechanism to a typed temporary resolution result or bounded retries for unresolved current entries, preserving immediate event wakeups and disarming on newer attempt/disposal. Regress a fail-once local credential/trust store read with no unrelated external event. This is part of the availability repair, not a request for per-entry tasks or extra device/network polls.
No P07 approval is granted at this checkpoint; tests/builds were not run by the reviewer.
## Final Runtime repair closure
The reviewer independently verified the frozen final P07 run and all five TRXs: 392/392 passed, including Runtime 219/219. Candidate identity is reconciled in `p07-contract-astra-review.md`. Earlier Runtime 218/218 in `20261116T154535.379541Z-6ea9fe4e2f4b` established the original scope-store, transient-role, and null/exception security-resolution repairs, but did not close the subsequently discovered two-link case.
That final case was observed failing in `20261116T155211.129165Z-316e31f82ca8` (deployment activation 22/23): rotating A during a transient false role read canceled B's manager token while retaining B as a Ready entry. The repaired ApplyManagerScopeLocked now always represents the validated configured consumer allowlist, independent of role observation. A's security change advances only A's route revision. B's lease remains current, while A retires and recovers. The same regression passes in the final gate.
This separation does not open Standby access: reconciliation checks current role before creating a client, TryAcquire checks it before issuing a handle, and every borrowed-operation boundary checks it again. The raw manager/client entry remains private. Explicit NotifyConsumerRoleChanged still clears all entries and advances every route revision to drain prior physical work; BeginAttempt still applies an empty manager scope before parsing a newer artifact. Existing actual owner/role and Warm tests remain green.
One owned timer and one coalesced worker now recover current unresolved local material and transient role/scope reads with bounded backoff. Null and thrown security results are both covered; newer attempts and disposal disarm the timer, and delayed results must match the latest generation. No per-entry retry task or device poll was added. Existing physical channel/stream/header-receipt/cancellation accounting and command metadata ownership remain verified by the full selected gate.
No actionable remote/runtime finding remains for P07. This approval does not claim deployed network failover, TLS behavior, CLI interoperability, or capacity measurements; those remain P10/P11, with final integrated review in P12.
The later pre-commit credential-expiry lease finding is closed in the superseding 393-case candidate. Browse branch leases and continuations now share a duration capped by the original target credential's remaining lifetime; GetMetadata objects carry no standalone lease. Source identity, actual RED, all five final TRXs, and the reaffirmed approval are recorded in `p07-contract-astra-review.md`. No remote transport/lifetime source changed for that narrow repair.
@@ -0,0 +1,37 @@
# P07 wiring preparation — historical checklist
This checklist predates the production wiring. Program/Kestrel, shared actor/DI dependencies, local bundle loading, observed-role owners and deployed-scope activation have since been implemented in the P07 working tree. The sections below preserve the original obligations; they do not describe current missing files. Current verification and unresolved review findings are recorded in [the execution ledger](README.md) and [Astra contract review](p07-contract-astra-review.md). P07 remains in progress and has no final approval.
## Shared local composition
Use actual `IClusterRoleInfo.LocalNode.Value` and `ClusterId`, plus one process boot incarnation. Register one DataWriteDispatchFence before DataPlaneAuthorityState and RedundancyRoleView resolve, so their optional constructor arguments use that same fence. Share TimeProvider.System registration, CatalogActivation, LocalCatalogCoordinator, hub, SourceSamplePublisher, DataOperationPolicy, DataCapabilitiesProvider, DataWriteRuntime, DriverWriteBounds and SubscriptionAcquisitionCapacity.
RedundancyRoleView currently exposes only primary verdict/generation (generation zero at startup). Need the actual Primary/Secondary/Unknown role alongside its existing verdict, published from the SAME DriverHostActor handler/fence; do not infer Secondary from arbitrary false, or invent an election. Unknown startup cannot advertise ready. Existing WarmRoleAuthority/PrimaryGate tests become applicable if modified.
Runtime ServiceCollectionExtensions currently passes NONE of SourceSamplePublisher, LocalCatalogCoordinator, DataWriteRuntime, SubscriptionAcquisitionCapacity or writeClock to DriverHostActor.Props. Add the actual shared instances, not disconnected singletons. Those optional Props parameters already exist. Root owns this file and Program.
LocalDataRuntimeComposition is now public and worker-owned: it receives an ACTUAL local host IActorRef and the shared dependencies; it owns the one demand registry/bridge/transport capacity and exposes Services/AcquisitionCapacity. Construct after host registration. A stable Host IDataConnectionFactory wrapper should lazily resolve this composition inside Create, so the startup window returns an honest Unavailable instead of failing gRPC service activation. DataWriteRuntime itself must exist before Host actor construction and can resolve its host lazily through ActorRegistry.
## Dedicated ingress
Host options/auth/middleware, all six RPC implementations, private-buffer contextual binding and PreparedDataSubscription exist but are UNMAPPED. Extend the SAME Program Kestrel binding reconstruction block: adding a Listen call otherwise drops URLS/HTTP_PORTS UI bindings. Use dedicated HTTPS HTTP/2, configured certificate plus private key, explicit host and actual local port checks. Preserve mesh/UI binding behavior; reject conflicts. Current legacy block refuses to replay existing HTTPS bindings because certificate settings are not modeled. Do not silently disable an explicitly enabled data service or fall back to plaintext.
Map only when enabled, with AllowAnonymous metadata so AdminUI cookies do not intercept authenticated RPCs; actual API-key middleware/interceptor remains fail-closed. Put admission before routing/auth parsing so unauthorized/oversized/concurrent work is bounded before protobuf allocation. Configure per-service MaxReceiveMessageSize and MaxSendMessageSize. Real service execution sets NoCompress, since ASP.NET discovery passes null service and discards generated binder handler wrappers. Registered marshaller serializes privately and checks capture-bound authority immediately before real Complete(byte[]); this is buffer handoff, not client receipt.
Finish finite unary pre-parse lifetime in middleware (own linked RequestAborted/deadline through real HTTP completion). Execute currently retains its own timeout CTS until response cleanup and its marshaller guard rechecks that token after validation. Duplex initial capability timeout is separate; subscription uses actual context cancellation and P06 finite session/pre-Open lifetime. Prepared frame owns encoded bytes through actual Write completion; Runtime now binds PendingDelivery.Gate exactly once across the framework StartAsync window. Do not commit cursors/baselines/Ack effects inside the marshaller.
## Deployed scope and local bundles
Central worker owns authoritative DataConnectionScopeVersion (exact PascalCase artifact root + DraftSnapshot property), bounded singleton row and sealing transaction. Lock before reading the validated draft; commit row + artifact before dispatch. No-op scope stable; A-to-B-to-A increments; empty removals positive; drift/pure composition read-only. Root still needs generated EF migration and model checks; never apply against shared SQL.
Runtime artifact parser and actual DriverHost/catalog path must publish validated deployed connection scope, including EMPTY/legacy cases, into a bounded latest-desired controller. Durable central version, never process epoch/time/hash ordering. Stale/missing version cannot overwrite an established floor or reactivate old imports. Desired scope must synchronously drain/deny prior manager epochs before asynchronous local store work; readiness only after floor/allowlist persisted. A newer desired scope must preempt old completion so it cannot enable old connections. Root must implement this seam; no callback currently exists.
Suggested controller/worker split (not yet finalized): synchronous desired generation + immediate manager drain, bounded latest-item background worker to persist credential/trust scopes and load restricted mounted bundles, then atomically enable only the still-current scope. Local origin catalog should fail closed during the allowlist durability barrier; missing individual outbound secrets/trust should mark THOSE imports AuthFailed, not pretend they are ready. Keep unrelated committed material when scope advances. Bundle removal alone is not revocation. Root must decide exact activation seam in LocalCatalogCoordinator/DriverHostActor without blocking actor callbacks or holding dispatch fence across I/O.
Credential worker APIs now require exact persisted ScopeVersion on each bundle/trust update. Scope generation allows safe retired-ID history reclamation. Security provider emits scoped retirement notifications and separately versioned trust fingerprints. Compose SecretChangeSignallingInvalidator with existing inner/Galaxy callbacks even if one consumer throws. Integrate actual local store/cipher/cache invalidator and a bounded atomic bundle reader/watch path. Check successful identical bundle replay/restart semantics: provisioner currently rejects complete same-version apply; mounted already-applied bundles must not break offline restart or silently accept changed same-version material. No secret upload endpoint or central bearer.
Trust material also needs a restricted local provisioning source (versioned per-consumer CA bundle or equivalent operator-mounted inputs), independent of credentials and scoped to current generation. Root options currently include only CredentialBundlePath and server certificate paths; trust bundle consumption is not wired. Trust rotation must retire channels/streams without replaying in-flight writes; rolling restart for server certificate rotation, no unsupported hot reload.
## Validation still required
Add real Host service-dispatch/middleware regressions beyond the current capability fixture, finite deadline/cleanup and late serialized Read source proof, actual DI/role/actor composition tests, new scope parsing/stale/empty/durability tests, central transactional concurrency/fault/no-op tests, migration checks. Per-phase runner uses only applicable selectors; no full solution run yet. Real TLS/listener wire tests belong Host.IntegrationTests/P10. Docker/OPC UA CLI integration, scaling benchmarks and full solution/Astra final remain P10/P11/P12.