Merge #921/#927: live gates — H05 against a pinned pre-H2 origin (wire tap proves no new-shape frame) and A09 native-ack driver-failure revert under the service principal; CLI read --attribute
This commit is contained in:
@@ -121,6 +121,8 @@ otopcua-cli read -u opc.tcp://localhost:4840/OtOpcUa -n "ns=3;s=DEV.ScanState" -
|
||||
| Flag | Description |
|
||||
|------|-------------|
|
||||
| `-n` / `--node` | Node ID to read (required) |
|
||||
| `--max-age` | Maximum cached value age in milliseconds (0–2147483647; default 0). Value attribute only |
|
||||
| `-a` / `--attribute` | Attribute to read instead of the value (case-insensitive): `Value` (default), `Historizing`, `AccessLevel`, `UserAccessLevel`, `DataType`, `ValueRank`, `ArrayDimensions`, `MinimumSamplingInterval`, `NodeClass`, `BrowseName`, `DisplayName`, `EventNotifier`. The output gains an `Attribute:` line. Used by the #921 gate to show a projected variable's `Historizing` is False when its origin lacks the history feature |
|
||||
|
||||
Output:
|
||||
|
||||
|
||||
@@ -200,6 +200,10 @@ the bit (see "Mixed versions" below); the AdminUI editor shows a reminder.
|
||||
**Negotiation.** The capabilities probe always asks for `history`; an origin advertises it only when a historian backend
|
||||
is configured. Other calls carry the header only toward an endpoint that advertised it. An origin without a historian, a
|
||||
pre-H2 origin, or a call without the header answers unsupported — the v1 responses are unchanged.
|
||||
Live-gated against a real pre-H2 origin (#921, `docs/plans/evidence/grpc-data-ext/H05-v1-origin.md`): a pre-H2 origin
|
||||
ignores the probe's header (capabilities byte-identical with and without it), so the consumer's projected variables have
|
||||
`Historizing` False, HistoryRead answers `BadHistoryOperationUnsupported` locally, and no HistoryRead or feature-headed data
|
||||
call is sent. (Sent anyway, a HistoryRead is refused `PERMISSION_DENIED` by the old data listener's v1 method allowlist.)
|
||||
|
||||
**Limits.**
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
# #927 — live gate: driver-failure ack revert through DriverHostActor under the connection service principal
|
||||
|
||||
A2b (remote `CallConditionMethod`) had been gated live only for a scripted condition. The path where a remote ack of a
|
||||
**native** condition reaches a driver that fails it, and DriverHostActor reverts the node (`RevertNativeAlarmAck`,
|
||||
`AlarmStateUpdate(EstablishesState: false)`), was unit-tested only (`ConditionMethodNodeManagerTests`, A2.md "Driver failure
|
||||
revert seen in the stream"). This adds scenario **A09** to `scripts/validation/grpc-data/conditions_scenarios.py` and runs it.
|
||||
|
||||
## How the driver is made to fail (a real failure, no seam)
|
||||
|
||||
The conditions profile's SOURCE `OpcUaClient` driver `source-opcua` watches the run-owned `opc-plc:2.14.10 --alm` native alarm
|
||||
`EastTankYellow`. A09 `docker compose pause`s the `opcplc` container immediately before the consumer's ack. The driver is still
|
||||
`Connected` (its keep-alive has not yet noticed), so `OpcUaClientDriver.AcknowledgeAsync` sends the upstream
|
||||
`AcknowledgeableConditionType.Acknowledge` call and gets **no reply**; the SDK call fails with a `ServiceResultException`
|
||||
(request timeout) inside the 5 s ack window, `DriverInstanceActor.HandleAcknowledgeAsync` reports `AlarmAckFailed`, and
|
||||
DriverHostActor reverts. The container is unpaused in the scenario's `finally` (and again by the per-scenario restore if it
|
||||
was left paused). Pausing also freezes opc-plc's own alarm cycling, so no upstream transition can explain the
|
||||
Unacknowledged that follows the ack.
|
||||
|
||||
**Why not an upstream refusal.** The option the issue suggests — an upstream that answers the Acknowledge with a Bad status
|
||||
(stale EventId, already acked) — does **not** revert today: `OpcUaClientDriver.AcknowledgeAsync` only logs a per-ack Bad
|
||||
result (and an ack whose condition id resolves to nothing), by design (`docs/drivers/OpcUaClient.md`: "a reply still returns
|
||||
normally, including per-ack refusals … a refusal is the server answering"), to keep refusals off the AlarmAcknowledge breaker.
|
||||
`DriverOperationRefusedException` now exists for exactly that (breaker-exempt, reverts), so an upstream refusal leaving the
|
||||
node Acknowledged is a gap — reported as a follow-up, not changed here (it reverses a documented driver decision). A
|
||||
no-reply transport failure is the failure class the driver does surface, and it exercises the whole revert path.
|
||||
|
||||
## Result — run `a927-1`, 2026-11-28, HEAD `cdbbe22a9`: A09 **PASS** (12/12)
|
||||
|
||||
`rig.py up --conditions` → `seed` → 85 s → `deploy --timeout 300` → `conditions_scenarios.py --only A09` → `rig.py down`
|
||||
(0 run containers, 0 run volumes).
|
||||
|
||||
| Check | Evidence |
|
||||
|---|---|
|
||||
| native condition present on both sides, Unacknowledged | consumer `EastTankYellow` `Inactive, Unacknowledged` (opaque `ns=6;s=c1.…` id), origin `ns=2;s=opcua/opcplc/EastTankYellow` same record time |
|
||||
| caller gets Good | 15:13:40 `opcplc` paused; consumer CLI `ack` ⇒ `Acknowledge successful` (plan §5.6 step 5: native ⇒ Good, `AcceptedUnconfirmed`; the failure reaches the caller as the revert) |
|
||||
| audit records the remote call | origin `source-1`: `Data-connection condition method Acknowledge by fixture-consumer (key …) on Raw:…:opcua/opcplc/EastTankYellow op a3-…: AcceptedUnconfirmed 0x00000000; on behalf of fixture-cli` — the connection's **service principal** (`fixture-consumer`) on behalf of the end user |
|
||||
| the driver really failed | 15:13:46 `DriverInstance source-opcua: native-alarm acknowledge of opcua/opcplc/EastTankYellow failed` |
|
||||
| DriverHostActor reverted (EstablishesState: false) | 15:13:46 `DriverHost source-1:4053: … did not reach the alarm system (the upstream acknowledge failed (ServiceResultException)); reverting the condition to unacknowledged` — `RevertNativeAlarmAck` is the only producer of that line and of an `EstablishesState: false` update |
|
||||
| origin node applied, then reverted | origin Server-object events after the ack: `Inactive, Acknowledged` → `Inactive, Unacknowledged` (nothing else: upstream frozen) |
|
||||
| consumer saw the reverted delta | consumer events after the ack: `Inactive, Acknowledged` → `Inactive, Unacknowledged`; same ConditionId, a new EventId |
|
||||
| positive control | 15:13:48 unpaused; 30 s later the condition was `Active, Unacknowledged` (opc-plc had re-activated it; whether the paused call was later applied upstream is not observable from this state); a second consumer ack of the current EventId ⇒ Good and **no** new revert line in the next 15 s |
|
||||
|
||||
Evidence files (removed with the run folder; copies taken before `down`): `evidence/A4S-A09.json`, `A4S-results.md`, the CLI
|
||||
`*.process.json` logs.
|
||||
|
||||
## Not covered
|
||||
|
||||
- The upstream-refusal flavour (Bad per-ack status) — it does not revert; follow-up above.
|
||||
- `/alerts` (alarm-history) rows for the ack and its revert were not asserted.
|
||||
@@ -0,0 +1,59 @@
|
||||
# #921 — H05 live gate against a real pre-H2 (v1) origin
|
||||
|
||||
The H3 gate replaced H05 ("v1 origin ⇒ unsupported") with an origin export that drops HistoryRead (H3.md "Not verified /
|
||||
substitutions"). That removes `Historizing` before any wire call, so the plan §4.3 mixed-version row "new consumer → v1 origin"
|
||||
was never exercised live. This gate runs it against a SOURCE pair built from a pinned pre-H2 commit.
|
||||
|
||||
## Rig additions (`scripts/validation/grpc-data/`, README "Pinned pre-H2 SOURCE")
|
||||
|
||||
- `rig.py up --source-revision <sha>`: `resolve_pinned_source_revision` requires X0 `a15912539` to be an ancestor (a pre-X0
|
||||
node rejects the whole snapshot once a newer bit is authored), H2 `ef938b435` **not** to be one, and no `rpc HistoryRead` in
|
||||
that revision's `data_connection.proto`. **`0c86edc19`** (the #918 merge, between H1 and H2 on master's first-parent line)
|
||||
passes; it is post-X0 (tolerant readers, feature header parsed with `SupportedFeatures = None`), its
|
||||
`LocalDataServices.Implemented()` has no HistoryRead and its proto has no HistoryRead RPC — a genuine v1 origin.
|
||||
- The rig `git archive`s it into the run folder, adds one rig file (`node-probe/WireTap.cs`, ASP.NET Core only, compiled
|
||||
unchanged against the pinned tree) and builds the pinned tree's own Dockerfile (`compose.source-pinned.yml`). CONTROL and
|
||||
CONSUMER run this checkout. `verify_candidate` checks SOURCE stamps against the pinned revision and export hash, the other
|
||||
four against this checkout. Unit tests: `PinnedSourceRevisionTests` (6, incl. the real `0c86edc1` / H2 commits).
|
||||
- **Wire tap** (`GRPC_DATA_WIRE_TAP=1`, only on the pinned SOURCE): per data-listener request, one line at arrival (gRPC path,
|
||||
`x-otopcua-data-features` value, remote address — before authentication) and one at completion (gRPC status). No credential
|
||||
or body.
|
||||
- `Client.CLI read --attribute <name>` (new; `Historizing`, `AccessLevel`, …) for a real OPC UA attribute read.
|
||||
- `history_v1_origin_gate.py` (H05V1) and probe `--scenario history-v1-origin`.
|
||||
|
||||
## Result — run `h05v1-1`, 2026-11-28 15:20–15:26 UTC: **PASS, 25/25 checks**
|
||||
|
||||
`rig.py up --history --source-revision 0c86edc1 --timeout 1500` → `seed` → 80 s → `deploy --timeout 300` (all six nodes
|
||||
applied the HEAD-built artifact, including the pinned SOURCE pair) → `history_v1_origin_gate.py` → `down` (0 containers,
|
||||
0 volumes, 0 images left). SOURCE has a SqlServer historian and historizes `counter` (the `--history` overlay).
|
||||
|
||||
| Assertion | Observed |
|
||||
|---|---|
|
||||
| builds | `source-1/2` stamp `0c86edc194bf…` (pinned export hash `1111f654…`); `control-*`, `consumer-*` stamp HEAD `cdbbe22a9` |
|
||||
| projected Raw + UNS `counter` `Historizing` | `False` (Good) on both; `AccessLevel` = 1 (CurrentRead, no HistoryRead bit) |
|
||||
| control: origin's own `counter` | `Historizing` `True`, `AccessLevel` = 13 (HistoryRead bit set); projected value Read Good on both realms |
|
||||
| `historyread` on projected Raw / UNS `counter` | `HistoryRead of ns=4;s=p1.… failed: BadHistoryOperationUnsupported (0x80720000).` (UNS `ns=5` same) |
|
||||
| control: `historyread` on the origin's node | Good, 30–31 rows in the window |
|
||||
| diagnostics (CONSUMER page, prerendered) | `Negotiated features none (v1 behaviour) · origin history not advertised · projected history reads good 0 · uncertain 0 · bad 0` |
|
||||
| diagnostics (SOURCE page) | `Exports with dropped unknown operation bits: export-raw: HistoryRead; export-uns: HistoryRead — this node's build is older than a feature authored here; the dropped bits grant nothing until the node is upgraded.` |
|
||||
| tap, consumer window (12 arrivals, all from the two consumer containers, no other remote) | methods `GetCapabilities, Browse, GetMetadata, Read` (control: the consumer's v1 traffic is there); **no** `HistoryRead` / `CallConditionMethod`; the only arrivals carrying the feature header are the capability probes (`history,conditions`, plan §4.1: the probe always asks) |
|
||||
| tap positive control (probe `history-v1-origin`, both origins) | capabilities with `history,conditions` byte-identical to capabilities without (operations 31, no `history`, no `conditions`); a HistoryRead with header `history` arrives at the tap with that header and completes **`grpc-status 7` (PERMISSION_DENIED)** |
|
||||
|
||||
**Finding (harness expectation, not a product defect).** The first pass (same run) failed two expectations of mine, both
|
||||
corrected in the harness and re-run green:
|
||||
1. A sent HistoryRead is refused **PERMISSION_DENIED**, not the UNIMPLEMENTED the issue/plan text guessed. At `0c86edc1`,
|
||||
`DataConnectionEndpoints` admits only its six v1 methods (`GetCapabilities, Browse, GetMetadata, Read, Write, Subscribe`) on
|
||||
the data listener and refuses any other path before gRPC routing. A current consumer never sends one (the tap shows it), so
|
||||
this only affects a hand-rolled caller; documented in `DataConnections.md`.
|
||||
2. The first projected value Read answered `BadWaitingForInitialData`; the gate now retries only that status (bounded 60 s),
|
||||
as every mapped positive read on this rig does (README).
|
||||
|
||||
The re-run used `--pinned-build` (harness and probe source edited after `up`; images unchanged, probe republished).
|
||||
|
||||
Evidence (run folder removed by `down`; copies taken before): `evidence/H05V1-results.json`, `probe/source-1/wire-tap.jsonl`.
|
||||
|
||||
## Not covered
|
||||
|
||||
- Subscribe / Write from the consumer to the v1 origin did not occur in the window (the gate reads via the CLI); the H2/A2
|
||||
recorded-v1-client gates cover the header-less shapes of those calls.
|
||||
- Conditions against a v1 origin (`--conditions` with a pinned SOURCE) were not run.
|
||||
@@ -173,7 +173,7 @@ Round 3 was itself an independent (Fable) verification of the round-2 commits
|
||||
|
||||
- **H05**: the rig builds no pinned v1 image, so "v1 origin" is substituted by an origin that does not advertise history for the
|
||||
principal (export without bit 32). The v1 wire shape itself is covered by the H2 recorded-v1-client gates; the live v1-origin
|
||||
path is follow-up **#921**.
|
||||
path is follow-up **#921** — since run live against a pinned pre-H2 origin (`0c86edc1`), PASS 25/25: `H05-v1-origin.md`.
|
||||
- **H01 tie clusters**: not representable live on either backend — SqlServer `hist.Sample` PK `(TagId, SourceTimeUtc)`, QuestDB
|
||||
`DEDUP UPSERT KEYS(ts, tag)` keep one sample per timestamp. Tie paging is proven by the H1 port fuzz (10k seeds).
|
||||
- **ReadyReplica consistency** on projected history and the Gateway backend (H4) were not run.
|
||||
|
||||
Reference in New Issue
Block a user