Commit Graph

7 Commits

Author SHA1 Message Date
Joseph Doherty d6f2a1b5e2 fix(alarms): a scripted condition's Part 9 method returns the engine's verdict (#937)
Before: the alarm-commands topic is fire-and-forget, so an OPC UA method (and a
remote gRPC-data condition method) returned Good even when the engine rejected
the command because its last load failed.

- ScriptedAlarmCommandReadinessView: the host's latest load outcome; the node
  manager's handler refuses BadInvalidState before the SDK applies anything
  while the last load failed (lock-free read).
- Bounded ask: inside CallAsync (off Lock) each local request runs base.Call
  alone; the handler only STARTS AlarmCommandAsker (broadcast for the peer +
  DriverHostActor -> ScriptedAlarmHostActor.ExecuteAlarmCommand on the local
  engine, CommandId-deduplicated) and the Call awaits the verdict: refused =>
  BadInvalidState, no answer => BadTimeout OutcomeUnknown.
- Remote CallConditionMethod: ExecuteConditionMethodAsync => DriverConfirmedFailure
  / OutcomeUnknown on the origin.
- Host ownership uses the latest plan set (stable across a load in flight and a
  failed load's half-built set).
- Docs: ScriptedAlarms.md (verdicts, residual, duplicate-activation trade-off),
  DataConnections.md, rules/alarms.md. Live leg scenario F937 + seeder
  scripted_predicate mutation.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-28 09:40:35 -05:00
Joseph Doherty dc5ed011ce test(grpc-data): A03 phase 1 permits exactly one RefreshRequired after the held-set takeover (still forbids extra condition events); docs: the deploy hold settles on any completion, is bounded, reports held, and resyncs once
Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-25 04:07:58 -05:00
Joseph Doherty 7425b4c4fe test(grpc-data): A03 native D7 probe uses AddComment (a forwarded native ack froze opc-plc's EastTankYellow at the origin for the rest of a4s-4) 2026-11-25 02:28:20 -05:00
Joseph Doherty 42e3800f2c test(grpc-data): A4 part 2 — A03 gap via pause+stop, origin watcher + re-assert mirror check, latest-EventId positive control; duplicate-transition checks (A03/A06/A07); docs: folder-first event item still refused BadNotSupported (workaround: i=2253 first) 2026-11-25 02:04:30 -05:00
Joseph Doherty 9ea50c11b2 test(grpc-data): A4 live scenarios part 2 harness — A03 origin failover (same-incarnation stream reset via mapping revision bump, clear-and-re-raise in the gap, RefreshRequired, BadEventIdUnknown, refreshed EventId acks), A06 consumer Primary change across both nodes + second CONSUMER principal fixture-cli-alt, A07 consumer restart refresh-vs-barrier; CLI alarms prints EventType (names RefreshStart/End/Required) 2026-11-25 01:44:58 -05:00
Joseph Doherty 6bf7dc8930 test(grpc-data): A4 scenarios — native alarm on EastTank?Yellow (cycles live), condition mappings WriteThrough (DataMappingOperationsInvalid), folders subscribe after demand opens, ConfirmedState read, origin audit for A08 denial 2026-11-25 01:23:14 -05:00
Joseph Doherty 304e8b1b7d test(grpc-data): A4 live scenarios part 1 harness — run-owned opc-plc --alm, native alarm + 2 referencing equipment + 3 condition mappings, UNS-only origin principal, no-grant consumer principal; probe condition-records; node-probe alert-transitions; conditions_scenarios.py (A01/A02/A04/A05/A08) 2026-11-25 01:05:53 -05:00