Skip to main content
Back to Prompt Library
implementation

Build the application

Inspect the original prompt language first, then copy or adapt it once you know how it fits your workflow.

Linked challenge: Build a Sparkplug B Industrial Network Outage Triage Reconciler

Format
Code-aware
Lines
101
Sections
11
Linked challenge
Build a Sparkplug B Industrial Network Outage Triage Reconciler

Prompt source

Original prompt text with formatting preserved for inspection.

101 lines
11 sections
No variables
1 code block
## Build
Evaluate simulated Sparkplug B edge node state transitions and death certificates to localize network outages. Formulate step-by-step recovery rehearsal playbooks for OT personnel.

## User
OT Network Systems Specialist

## Workflow
1. Ingest MQTT Sparkplug B edge node lifecycle events including NDEATH and NBIRTH messages.
2. Map communication dropouts against switch topology to identify common failure domains.
3. Simulate recovery step sequencing to avoid reconnection storms across edge nodes.
4. Publish an outage post-mortem and network recovery rehearsal playbook.

## Interface
Network topology graph showing edge node death timestamps, affected switch zones, and recovery rehearsal plan.

## Data
Simulated Sparkplug B telemetry packets containing seq numbers, NDEATH payloads, and bdSeq metrics.
Starter examples below are synthetic. They are not downloaded records.

## Source
[Eclipse Sparkplug](https://raw.githubusercontent.com/eclipse-sparkplug/sparkplug/master/README.md)
Leverages Sparkplug B state management, particularly bdSeq counters, NDEATH payloads, and edge node lifecycle tracking.

## Tools
langgraph, networkx, pydantic.
LangGraph manages stateful traversal through multi-switch topology failure graphs and recovery phases.
Local or hosted LLM with strong logical troubleshooting and network topology reasoning.

## 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
- Correlates NDEATH burst events to single upstream network switches.
- Validates bdSeq sequence continuity during node reconnection simulations.
- Generates an ordered recovery procedure minimizing simultaneous MQTT connection spikes.

## Starter Examples
```json
[
  {
    "input": {
      "broker": "tcp://broker.factory.local:1883",
      "outage_events": [
        {
          "timestamp": "2025-05-10T14:02:00Z",
          "topic": "spBv1.0/Plant1/NDEATH/LineA_Cell1",
          "bdSeq": 4
        },
        {
          "timestamp": "2025-05-10T14:02:01Z",
          "topic": "spBv1.0/Plant1/NDEATH/LineA_Cell2",
          "bdSeq": 8
        }
      ],
      "switch_topology": {
        "Switch_Core": [
          "Switch_LineA"
        ],
        "Switch_LineA": [
          "LineA_Cell1",
          "LineA_Cell2"
        ]
      }
    },
    "expected_output": {
      "isolated_fault_location": "Switch_LineA",
      "affected_nodes_count": 2,
      "rehearsal_sequence": [
        "Inspect Switch_LineA power/link",
        "Verify Switch_Core trunk",
        "Restore LineA_Cell1 then Cell2 staggered by 5s"
      ],
      "reconnection_storm_risk": "LOW"
    }
  },
  {
    "input": {
      "broker": "tcp://broker.factory.local:1883",
      "outage_events": [
        {
          "timestamp": "2025-05-10T15:00:00Z",
          "topic": "spBv1.0/Plant1/NDEATH/Warehouse_Sensors",
          "bdSeq": 12
        }
      ],
      "switch_topology": {
        "Switch_Core": [
          "Switch_LineA",
          "Switch_Warehouse"
        ],
        "Switch_Warehouse": [
          "Warehouse_Sensors"
        ]
      }
    },
    "expected_output": {
      "isolated_fault_location": "Warehouse_Sensors edge link",
      "affected_nodes_count": 1,
      "rehearsal_sequence": [
        "Check local patch cable at Warehouse_Sensors",
        "Verify edge node bdSeq re-birth"
      ],
      "reconnection_storm_risk": "NONE"
    }
  }
]
```

## Safety
Operates entirely on historical or mock telemetry; no remote network reconfiguration.
Use mock external writes. Require human review before any real deployment.

Adaptation plan

Keep the source stable, then change the prompt in a predictable order so the next run is easier to evaluate.

Keep stable

Hold the task contract and output shape stable so generated implementations remain comparable.

Tune next

Update libraries, interfaces, and environment assumptions to match the stack you actually run.

Verify after

Test failure handling, edge cases, and any code paths that depend on hidden context or secrets.