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 Plant Sensor Calibration and Spare-Parts Visit Scheduler

Format
Code-aware
Lines
110
Sections
11
Linked challenge
Build a Plant Sensor Calibration and Spare-Parts Visit Scheduler

Prompt source

Original prompt text with formatting preserved for inspection.

110 lines
11 sections
No variables
1 code block
## Build
Cross-reference simulated open62541 sensor drift flags with enterprise spare parts catalogs. Formulate technician calibration service itineraries and spare sensor pick tickets.

## User
Instrumentation Maintenance Coordinator

## Workflow
1. Ingest simulated open62541 OPC UA diagnostic nodes flagging analog sensor drift.
2. Cross-reference drifting sensors against enterprise warehouse stock for replacement probes.
3. Sequence calibration and replacement tasks based on plant physical zone adjacency.
4. Generate a technician service visit itinerary accompanied by warehouse pick tickets.

## Interface
Plant zone schematic showing drifting sensors, stock availability indicators, and itinerary checklist.

## Data
Create synthetic normalized open62541 diagnostic records and spare parts inventory manifests in local JSON fixtures.
Starter examples below are synthetic. They are not downloaded records.

## Source
[open62541 OPC UA](https://raw.githubusercontent.com/open62541/open62541/master/README.md)
OPC UA instrumentation diagnostic structures and status code nodes from open62541.

## Tools
pydantic-ai, fastapi, pandas.
Pydantic AI guarantees rigid data validation when joining telemetry anomaly codes with parts catalogs.
Instruction-tuned model capable of reliable multi-table matching and itinerary sequencing.

## 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 all sensors flagged with active calibration drift status codes.
- Matches sensor replacement requirements with in-stock part SKUs.
- Groups service visits by plant physical zone to minimize technician transit time.

## Starter Examples
```json
[
  {
    "input": {
      "sensor_diagnostics": [
        {
          "sensor_id": "TEMP_TANK_1",
          "zone": "ZONE_NORTH",
          "drift_detected": true,
          "part_type": "PT100_PROBE"
        },
        {
          "sensor_id": "PRESS_PIPE_4",
          "zone": "ZONE_NORTH",
          "drift_detected": true,
          "part_type": "4_20MA_TRANSMITTER"
        }
      ],
      "inventory": [
        {
          "part_sku": "SKU_PT100",
          "part_type": "PT100_PROBE",
          "qty_on_hand": 5
        },
        {
          "part_sku": "SKU_PRESS_TX",
          "part_type": "4_20MA_TRANSMITTER",
          "qty_on_hand": 2
        }
      ]
    },
    "expected_output": {
      "scheduled_zone": "ZONE_NORTH",
      "pick_ticket": [
        {
          "part_sku": "SKU_PT100",
          "quantity": 1,
          "target_sensor": "TEMP_TANK_1"
        },
        {
          "part_sku": "SKU_PRESS_TX",
          "quantity": 1,
          "target_sensor": "PRESS_PIPE_4"
        }
      ],
      "itinerary_order": [
        "TEMP_TANK_1",
        "PRESS_PIPE_4"
      ],
      "all_parts_available": true
    }
  },
  {
    "input": {
      "sensor_diagnostics": [
        {
          "sensor_id": "FLOW_METER_2",
          "zone": "ZONE_SOUTH",
          "drift_detected": true,
          "part_type": "MAG_FLOW_LINER"
        }
      ],
      "inventory": [
        {
          "part_sku": "SKU_MAG_LINER",
          "part_type": "MAG_FLOW_LINER",
          "qty_on_hand": 0
        }
      ]
    },
    "expected_output": {
      "scheduled_zone": "ZONE_SOUTH",
      "pick_ticket": [],
      "itinerary_order": [],
      "all_parts_available": false
    }
  }
]
```

## Safety
Advisory scheduling and pick ticket generation only. Warehouse inventory decrements and physical sensor swaps require human execution.
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.