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 Water Network District Metered Area Inflow Reconciler
Format
Code-aware
Lines
67
Sections
11
Linked challenge
Build a Water Network District Metered Area Inflow Reconciler
Prompt source
Original prompt text with formatting preserved for inspection.
67 lines
11 sections
No variables
1 code block
## Build
Correlate supervisory flowmeter telemetry with minimum night flow benchmarks to identify hidden pipeline leaks. Generate prioritized acoustic sounding inspection orders for municipal water leak detection teams.
## User
Water Distribution Loss Control Specialist
## Workflow
1. Ingest hourly inflow telemetry and customer automated meter reading feeds for designated District Metered Areas (DMAs).
2. Compute Minimum Night Flow (MNF) between 02:00 and 04:00 to isolate legitimate baseline consumption.
3. Model expected hydraulic background losses using WNTR pressure-dependent demand calculations.
4. Synthesize field inspection work orders targeting pipe clusters where unexplained night flows exceed threshold tolerances.
## Interface
Time-series chart showing DMA inlet flows, night flow thresholds, and an inspection dispatch queue with map overlays.
## Data
Synthesize 15-minute resolution DMA flowmeter logs, meter billing sums, and EPANET/WNTR pipe models.
Starter examples below are synthetic. They are not downloaded records.
## Source
[Water Network Tool for Resilience](https://raw.githubusercontent.com/USEPA/WNTR/main/README.md)
Applies WNTR hydraulic analysis routines to calculate theoretical background leakage based on average operating pressure across the DMA.
## Tools
langfuse, wntr, scipy.
Langfuse provides observability and operational tracing for multi-step hydraulic anomaly detection and dispatch pipelines.
Local Python execution runtime with hosted LLM for structuring water loss inspection briefs.
## 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
- Calculates Net Night Flow by subtracting customer AMR night usage from bulk meter night inflow.
- Triggers leak inspection alerts when unexplained night loss exceeds 20% of minimum inflow.
- Outputs prioritized street inspection vectors with localized pressure monitoring points.
## Starter Examples
```json
[
{
"input": {
"dma_id": "DMA-DEIRA-02",
"bulk_night_flow_m3h": 68.5,
"customer_amr_night_m3h": 18.2,
"average_pressure_bar": 3.8,
"total_pipe_length_km": 14.5
},
"expected_output": {
"net_night_loss_m3h": 50.3,
"allowable_background_loss_m3h": 12.4,
"unexplained_loss_m3h": 37.9,
"leak_alert": true,
"recommended_action": "Deploy acoustic correlators along sector mains A and B"
}
},
{
"input": {
"dma_id": "DMA-DEIRA-05",
"bulk_night_flow_m3h": 22,
"customer_amr_night_m3h": 14.5,
"average_pressure_bar": 3.2,
"total_pipe_length_km": 8
},
"expected_output": {
"net_night_loss_m3h": 7.5,
"allowable_background_loss_m3h": 6.8,
"unexplained_loss_m3h": 0.7,
"leak_alert": false,
"recommended_action": "Routine monitoring, no immediate dispatch required"
}
}
]
```
## Safety
Leak detection dispatches are diagnostic surveys; no valve operations or system pressure adjustments should be executed without utility authorization.
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.