Skip to main content
Loading navigation
Back to prompt library

Build a Sparkplug B NDEATH Partition Simulator — implementation

Linked challenge: Build a Sparkplug B NDEATH Partition Simulator

Prompt source

implementation96 lines11 sectionsNo variables1 code block
## Build
Diagnose simulated Sparkplug B network partitions and edge broker dropouts. Formulate recovery rehearsal sequence runbooks for operational technology engineers without actuating physical network switches.

## User
OT Network Systems Engineer

## Workflow
1. Ingest simulated Sparkplug B NDEATH certificates and edge node heartbeat telemetry records.
2. Detect isolated subnets and dropped edge gateways across normalized topology graphs.
3. Synthesize a step-by-step reconnect and state resynchronization rehearsal playbook.
4. Export the validated recovery sequence for OT engineering review.

## Interface
Browser-based network topology canvas with step-by-step rehearsal timeline and sign-off modal.

## Data
Generate synthetic JSON event logs representing Sparkplug B node lifecycle payloads and birth/death certificates. Host via local mock HTTP server without credentials.
Starter examples below are synthetic. They are not downloaded records.

## Source
[Eclipse Sparkplug](https://raw.githubusercontent.com/eclipse-sparkplug/sparkplug/master/README.md)
Sparkplug B device lifecycle messages including birth certificates and last will & testament NDEATH notifications described in Source 2.

## Tools
langgraph, pydantic, fastapi.
LangGraph manages stateful multistep graph execution across diagnosis, validation, and rehearsal generation.
Local or hosted LLM with strong structured reasoning for topology recovery and state tracing.

## Deliverables
Submit runnable source, pinned dependencies, setup commands, a working interface, example outputs, and a recorded end-to-end demo. Include tests and an action log.

## Acceptance
- Identifies severed edge subnets within simulated network death records.
- Outputs step-by-step rehearsal actions with prerequisite connectivity checks.
- Rejects contradictory reconnection sequences before OT specialist review.

## Starter Examples
```json
[
  {
    "input": {
      "group_id": "Cell_A",
      "events": [
        {
          "timestamp": "2025-05-10T08:00:00Z",
          "node_id": "EdgeNode_01",
          "type": "NDEATH",
          "metrics": {
            "bdSeq": 14
          }
        },
        {
          "timestamp": "2025-05-10T08:00:05Z",
          "node_id": "EdgeNode_02",
          "type": "NDEATH",
          "metrics": {
            "bdSeq": 8
          }
        }
      ],
      "topology": {
        "gateway": "GW_North",
        "nodes": [
          "EdgeNode_01",
          "EdgeNode_02"
        ]
      }
    },
    "expected_output": {
      "root_cause_node": "GW_North",
      "impacted_nodes": [
        "EdgeNode_01",
        "EdgeNode_02"
      ],
      "rehearsal_steps": [
        "Verify physical link on GW_North uplink interface.",
        "Re-establish broker transport session for Cell_A group.",
        "Await NBIRTH packet validation before clearing partition alarm."
      ],
      "requires_escalation": false
    }
  },
  {
    "input": {
      "group_id": "Cell_B",
      "events": [],
      "topology": {
        "gateway": "GW_South",
        "nodes": [
          "EdgeNode_03"
        ]
      }
    },
    "expected_output": {
      "root_cause_node": "NONE",
      "impacted_nodes": [],
      "rehearsal_steps": [],
      "requires_escalation": false
    }
  }
]
```

## Safety
Simulation and rehearsal workflow only. External network changes and equipment writes are simulated in software.
Use mock external writes. Require human review before any real deployment.