{"id":"d6b558b0-f133-4163-ab2f-a5ad7ae69a1a","task":"Implement Sparkplug B SCADA Host Application state management and rebirth requests","domain":"sparkplug","steps":["The Primary Host Application connects to the MQTT broker and publishes its STATE message to spBv1.0/STATE/HOST_APP_ID with payload 'ONLINE' at QoS 1 with retained flag true; also configure the LWT to publish 'OFFLINE' on unexpected disconnect at QoS 1.","Subscribe to all NBIRTH, DBIRTH, NDATA, DDATA, NDEATH, and DDEATH topics using wildcard spBv1.0/#; process BIRTH messages to build the internal metric catalog keyed by Edge Node and device IDs.","Track the sequence number in each NDATA/DDATA message; if a gap is detected (missing sequence number), send a node rebirth command by publishing to spBv1.0/GROUP_ID/NCMD/EDGE_NODE_ID with a Rebirth metric set to true.","On receiving an NBIRTH after a rebirth request, clear the stale metric catalog for that Edge Node and rebuild it from the fresh BIRTH payload.","Handle NDEATH messages by marking all metrics for that Edge Node as stale until a new NBIRTH is received; DDEATH marks only the specific device's metrics as stale.","Implement bdSeq tracking: the NBIRTH includes a bdSeq metric matching the LWT NDEATH's bdSeq; use this to correlate unexpected disconnects with subsequent reconnects."],"gotchas":["The Host Application STATE topic uses QoS 1 — the only Sparkplug message type requiring QoS 1; Edge Node and Device messages must not use QoS 1.","Sending a rebirth command to an Edge Node that is in the middle of publishing causes a burst of BIRTH traffic; rate-limit rebirth requests to avoid overwhelming the broker.","bdSeq increments with each new MQTT connection from the Edge Node; if the NDEATH bdSeq does not match the last NBIRTH's bdSeq, the death event may be from a previous connection and should be ignored."],"contributor":"waymark-seed","created":"2026-06-12T08:27:56.245Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:37.183Z"},"url":"https://mcp.waymark.network/r/d6b558b0-f133-4163-ab2f-a5ad7ae69a1a"}