diff --git a/.claude/rules/drivers.md b/.claude/rules/drivers.md index 1f6d69121..e6bf7ac18 100644 --- a/.claude/rules/drivers.md +++ b/.claude/rules/drivers.md @@ -154,6 +154,12 @@ non-`Healthy` state **and** its `LastSuccessfulRead` has been frozen for 90 s. T an outage: no audit, no counter), and the retired child's late Bad no longer stamps value nodes while a replacement exists — so a Restart now cancels the old audit itself (#1053 keeps the latch). Supervision restarts and deploy removals/disables are unchanged. ScadaBridge sees the brief Bad. `DriverHostRespawnValueNodeGapTests`. + #1113: a config-change respawn KEEPS an outstanding comms latch like Restart, and every apply trims latches to the + refs still routed (`TrimCommsLatchesToIndex` — a dropped ref is never audited); the audit Warning names the nodes' + real status (`still BadWaitingForInitialData` after a respawn/Restart). A STUB child's value nodes go + `BadConfigurationError` (`StampStubbedDriverValueNodes`, after each apply's rebuild Tell + after a Restart into a + stub). A slow-connecting replacement stays `BadWaitingForInitialData` (accepted). The gRPC origin hub is covered by + the producer fence (`RetireCurrentDriver` at the stop), not the node stamp — `GrpcDataRespawnOriginGapTests`. - **Every dedup on the recovery path is keyed on (value, status), not value.** A device that comes back usually comes back holding the same reading, so a value-only dedup swallows the recovery and the node stays Bad forever — the v3-gate trap, now closed in the Calculation driver, the virtual-tag actor and diff --git a/docs/DriverLifecycle.md b/docs/DriverLifecycle.md index 49a580cd2..d5187a3df 100644 --- a/docs/DriverLifecycle.md +++ b/docs/DriverLifecycle.md @@ -649,6 +649,12 @@ supervision restart (same driver object — unchanged, still covered by that chi disable (`RemovedInputStatus` + node removal). ScadaBridge sees a brief Bad per respawn/Restart — accepted. Pinned by `DriverHostRespawnValueNodeGapTests` (both seams, both interleavings, no-latch with a positive control). +- **A slow-connecting replacement reads `BadWaitingForInitialData`, not `BadNoCommunication` — accepted (#1113, owner + decision).** The stamp says "a new driver object, no value yet"; it does not change while the replacement's initialise is + still retrying, because the replacement has not lost anything — it has not connected yet. The nodes go + `BadNoCommunication` only if the replacement connects and then loses its device (its own comms-loss stamp, latched and + audited as usual). An operator watching a node stuck at `BadWaitingForInitialData` after a respawn should check the + driver's status on `/hosts` (Connecting / Reconnecting), not the node. - **A stub replacement reads `BadConfigurationError` (#1113).** When the replacement (or a freshly deployed driver) is a STUB — no factory for its type on this node, the factory rejected its config, or the type is not allowed on the node's roles — it never publishes, so `BadWaitingForInitialData` would be a promise that cannot be kept.