docs(grpc-data): A1-core — drivers section (hooks, tests, mutations, L4, deviations)
This commit is contained in:
@@ -6,10 +6,11 @@ agent's). Branch `worktree-agent-ad44f71fa7ab46039`, based on master `cbb5b396`.
|
||||
|
||||
## Drivers part — progress log (resume from here; detail in "Drivers" at the end)
|
||||
|
||||
- **Done:** Galaxy (`b7f742ef`), OpcUaClient (`4e984b16`), FOCAS (`dbbc35e8`), AbCip (`8f1be256`), Heidenhain (`add4bc81`)
|
||||
— each with its own `*InitialAlarmStateSignalTests` + a mutation red check.
|
||||
- **In progress:** MTConnect.
|
||||
- **Next:** Runtime rig test with a real driver (widen `StartRig` to `IDriver`), manifest entries, L4 (`A1-L4.md`), gates.
|
||||
- **Done:** all six native sources implement `IAlarmInitialStateSignal` — Galaxy (`b7f742ef`), OpcUaClient (`4e984b16`),
|
||||
FOCAS (`dbbc35e8`), AbCip (`8f1be256`), Heidenhain (`add4bc81`), MTConnect (`9167ea23`); real-driver Runtime rig
|
||||
(`141e4412`); L4 harness + evidence `A1-L4.md` (`3c2cf96a`).
|
||||
- **In progress:** final gates (see "Drivers — gates").
|
||||
- **Next:** reviewer sign-off; Galaxy / Heidenhain L4 legs when their rigs are reachable.
|
||||
|
||||
## Progress log (resume from here)
|
||||
|
||||
@@ -158,3 +159,75 @@ now also receives the new `MarkConditionsKnown` that follows the first projectio
|
||||
- **`MaxConditions` per hold is a parameter** (default 1,000). A2 should pass the mapping's configured `MaxConditions`.
|
||||
- **The hub never pushes; readers poll `Watermark`/`Read`.** A2 decides on a wake signal. It must not run under the
|
||||
node manager's `Lock`.
|
||||
|
||||
## Drivers (the six native sources, T2 (ii)/(iii)/(vi)/(vii)/(viii)/(ix), L4)
|
||||
|
||||
### Hook points (plan §5.1 table)
|
||||
|
||||
Every driver raises the signal synchronously on the same thread and path as its `OnAlarmEvent`, after the events it covers.
|
||||
It is raised under the same lock and the same handler/subscription gate as those events (G5). `ConditionIds` are the RawPaths
|
||||
the completed read established (G1).
|
||||
|
||||
| Driver | Hook | Covers | G5 gate |
|
||||
|---|---|---|---|
|
||||
| Galaxy | `GatewayGalaxyAlarmFeed.Dispatch`, `SnapshotComplete` case → new feed event `IGalaxyAlarmFeed.SnapshotDelivered` (default no-op accessors, so test fakes compile), raised on **every** sentinel including each reopened stream's; `GalaxyDriver.OnAlarmFeedSnapshotDelivered` re-raises it | the live subscription's refs (`_alarmSubscriptionRefs`, replaced with the single handle in `SubscribeAlarmsAsync`) | no live handle ⇒ nothing |
|
||||
| OpcUaClient | `RouteAlarmEvent`: `IsRefreshEnd(fields)` is checked before projection, under `_alarmStateLock`; `SequentialPublishing = true` on the alarm subscription (options now built by `BuildAlarmSubscriptionOptions`); `TryConditionRefreshAsync`'s "unsupported" catch → `ReportRefreshUnsignalable` ⇒ `Unsignalable: true` | that subscription's `RemoteAlarmSubscription.AlarmRefs` (the RawPaths of its source index) | handle not in `_alarmSubscriptions` ⇒ nothing |
|
||||
| FOCAS | `FocasAlarmProjection.Tick` end (reached only after `NoteAlarmReadSucceeded(host)`; `TickFailed` raises nothing) | that host's subscribed `ALARM:` tags | superseded subscription or no `OnAlarmEvent` handler ⇒ nothing |
|
||||
| AbCip | `AbCipAlarmProjection.Tick` end | ALMD nodes whose `InAlarm` read Good; ALMA nodes whose every plan ref read Good | subscription no longer the registered one in `_subs` ⇒ nothing |
|
||||
| Heidenhain | `HeidenhainAlarmProjection.OnWalk`, after the Good-walk diff (new optional ctor arg `initialState`) | that host's subscribed `ALARM:` tags | no current subscription or no handler ⇒ nothing; a non-Good walk returns before it |
|
||||
| MTConnect | `EmitConditionTransitions`, after the events of a **full** emission (`touchedDataItemIds == null`: subscribe resync, the restarted pump's first act, comms-loss recovery) **or of a `/current` re-baseline** (`baselineRead`, from `ApplyAndFanOut(..., baseline: true)`), only over a tracker with `HasBaseline` (new, set by `Apply(baseline: true)`, reset by `Clear`) | subscribed conditions with a known, non-`Unavailable` level | no subscription or no handler ⇒ nothing |
|
||||
|
||||
### Tests (A1 manifest: one entry per driver test project, filter `(Feature=GrpcData&Phase=A1)`)
|
||||
|
||||
| Test | Pins | Mutation (red, then restored) |
|
||||
|---|---|---|
|
||||
| `GalaxyInitialAlarmStateSignalTests` (4) | real `GatewayGalaxyAlarmFeed` over test streams: (ii) snapshot events then the signal; no signal before the sentinel; (xi) a sentinel while unsubscribed raises nothing; (vii) a reopened stream re-signals, and a deploy-added ref (re-subscribe) is covered by the NEXT sentinel, not by the subscribe | G5 check removed + a fallback ref ⇒ the G5 test is red |
|
||||
| `OpcUaClientInitialAlarmStateSignalTests` (5) | (iii) F1: the refresh "returned" with nothing signalled, refreshed event, then `RefreshEnd` ⇒ signal last; released subscription ⇒ nothing; (vi) unsupported refresh ⇒ `Unsignalable` with the refs; (ix) config pin `SequentialPublishing`; **(ix) G2 through the real SDK `Subscription`** (worker started via `StartKeepAliveTimer`, messages fed to `SaveMessageInCache` by reflection): seq 2 (`RefreshEnd`) arrives 300 ms before seq 1 (the refreshed Active event) ⇒ delivered 1, 2 | `SequentialPublishing = false` ⇒ both the pin and the SDK out-of-order test are red (before the 300 ms gap was added the SDK test was green on the mutation, so it was not discriminating) |
|
||||
| `FocasInitialAlarmStateSignalTests` (3) | real poll loop: (ii) Raise then signal covering the device; (viii) G1 two CNCs, one failing ⇒ every signal names only the reachable one; (xi) no handler ⇒ no signal | signal over `sub.References` instead of the device's tags ⇒ G1 test red |
|
||||
| `AbCipInitialAlarmStateSignalTests` (4) | real ALMD poll loop over fake runtimes: (ii); (viii) G1 two controllers, B's reads throw ⇒ only A; (xi) an unregistered subscription's tick and a released subscription ⇒ nothing | establish before the Good check + drop the live gate ⇒ the G1 and stale tests are red |
|
||||
| `HeidenhainInitialAlarmStateSignalTests` (3) | `OnWalk` per host: (ii); (viii) G1 host 2 failing ⇒ only host 1, then host 2 signals once Good; (xi) no handler / unsubscribed ⇒ nothing | signal over all subscribed tags ⇒ G1 test red |
|
||||
| `MTConnectInitialAlarmStateSignalTests` (4) | (ii) standing Fault in `/current` ⇒ Raise then signal, an unobserved condition excluded; Unavailable excluded; a `/sample` delta does not signal, an Agent-restart re-baseline does; (xi) no handler ⇒ nothing | Unavailable check removed ⇒ the Unavailable test is red |
|
||||
| R `RealDriverInitialStateSignalTests` (2) | **the real `FocasDriver` through the real `DriverHostActor` + `DriverInstanceActor`** (`StartRig(IDriver, …)`): (ii) the Active `AlarmStateUpdate` precedes the `MarkConditionsKnown`; (viii) unreachable CNC B is never marked, F5 diagnostic counts B alone (1), A stays known | FOCAS signals before its events ⇒ (ii) red |
|
||||
|
||||
`NativeAlarmSignalTestBase.StartRig` gained an `IDriver` overload (`(Host, Publish, Hub)` + an optional readiness predicate). The
|
||||
fake-driver overload delegates to it, so the existing tests are unchanged.
|
||||
|
||||
### L4
|
||||
|
||||
See `A1-L4.md`. The measured p99 values, from quality Good, are:
|
||||
|
||||
- OpcUaClient: 0.64 s (1.37 s with connect);
|
||||
- FOCAS: 0.26 s;
|
||||
- MTConnect: about 0 s (0.12 s with connect);
|
||||
- AbCip: 1.0 s, on a private same-image ab_server, because the shared fixture has no ALMD.
|
||||
|
||||
`ConditionKnownSignalTimeout` stays at 120 s for every type, which is at least 29× the measured p99. The Galaxy and
|
||||
Heidenhain legs are **blocked**: Galaxy needs the VPN and mxaccessgw, and Heidenhain has no fixture.
|
||||
|
||||
### Deviations (each with a reason)
|
||||
|
||||
- **Galaxy covers the subscription's refs, not "every condition of the feed".** The feed is unfiltered, but the host routes
|
||||
only the subscribed RawPaths, so the subscribed set is exactly what a sentinel establishes on this driver.
|
||||
- **Galaxy: a subscribe never signals by itself.** A condition added by a deploy while the stream is open waits for the next
|
||||
sentinel, which comes only on a stream reopen. Until then F5 diagnoses it.
|
||||
- This is by design (vii): the snapshot that preceded the subscribe may have carried that alarm while it was unroutable.
|
||||
- Open question: should the driver ask the gateway for a fresh snapshot on a changed subscription set?
|
||||
- **OpcUaClient: no signal suppression on an SDK-reported sequence gap during a refresh.** Plan G2 says such a `RefreshEnd`
|
||||
"does not signal".
|
||||
- The SDK 2.0.1 surface the driver sees (the per-item `Notification` callback) exposes no per-message gap or republish
|
||||
failure, so this was not implemented.
|
||||
- With `SequentialPublishing` the worker waits for the missing sequence number (republish) before delivering later ones.
|
||||
- Residual: a gap the SDK gives up on could let a `RefreshEnd` signal over a lost refreshed event. Logged here as an open
|
||||
question for the reviewer.
|
||||
- **MTConnect also signals on a mid-stream `/current` re-baseline** (OUT_OF_RANGE / Agent restart), not only on the subscribe
|
||||
resync and the pump's first act. A re-baseline is a complete re-read, and without the signal a restarted Agent's
|
||||
conditions would wait for the next reconnect.
|
||||
- **MTConnect never signals a condition with no observation at all** (`tracker.Get == null`), as well as excluding
|
||||
Unavailable. Never observed is not established.
|
||||
- **AbCip G5 is "still the registered subscription"**, because AbCip delivers events with no handler gate. A tick racing an
|
||||
unsubscribe raises nothing.
|
||||
- **The OpcUaClient (vi) test uses a seam** (`ReportRefreshUnsupportedForTest`) instead of a server that refuses
|
||||
ConditionRefresh. The catch → `ReportRefreshUnsignalable` wiring itself is covered only by review.
|
||||
- **The Runtime end-to-end rig uses FOCAS only.** Galaxy's `InitializeAsync` with injected seams also starts its deploy
|
||||
watcher and platform seed, so the other drivers are covered at driver level, where the ordering contract lives.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user