yau-plant-assistant/db/seed/historian_items.csv
Claude 3d19b186da Key the whole seed on the CI Server item name
45 of the 65 rows in db/seed/tags.csv had a PS_* name as their PRIMARY
KEY, and historian_items.csv, alarm_bits.csv, the fixtures, two Cube
models and the exam all referenced them. They are gone. The tag seed is
now keyed on the CI Server item for everything the historian carries -
AID.WRPS.STN.LEVEL - and on the instrument tag for the 20 field devices
that never reach SCADA.

gen_historian_items.py reads db/seed/scada-source/ by default, so it runs
for anyone with a clone: --wrps is now --source. The tag match is the item
name itself, an identity lookup, and the TAG_FOR_ITEM special case is
deleted - all 49 item names are unique, which the old point names were
not. scada_point in the output is replaced by ci_station, ci_point and
poll_group; 001_schema.sql and deploy.sh's upsert follow.

Regenerated, and it comes out the same shape it went in: 49 items, 45
answerable, 4 deliberately excluded, three groups at 5 s, 30 s and on
change. Every historian_items.tag_id and alarm_bits.tag_id resolves to a
tags.csv row. No duplicate keys.

THE ONE NAME THAT WAS AMBIGUOUS, AND NEARLY COST US

PS_STN_HIGH_LEVEL_ALARM named two different things in the old delivery:
the high level alarm STATUS BIT on coil 10, and the alarm SETPOINT on
holding register 1032. Building the rename map from that file kept
whichever came last, so the status bit was silently renamed onto the
setpoint. check_mapping() refused to write and named the item that no
longer resolved - which is the only reason this is a paragraph in a commit
message rather than a defect.

Had it gone through, alarm bit 0 - wet well high level - would have
pointed at the setpoint. "How many high level alarms last week" would have
counted setpoint changes and returned a small, plausible, confident,
wrong number. That check exists because the same ambiguity caused the
first Phase 5 finding in August. It has now bitten twice.

NOT YET VERIFIED: pytest api/tests could not be run here - this machine
has neither fastapi nor psycopg. The tests are unchanged and reference no
PS_ name, but they have not been run. pg-ai on lin001 still holds the old
keys and must be reloaded, Cube pre-aggregations rebuilt, and the Phase 1
gate re-run. eval/testset.jsonl changed, so the 78-case exam - never yet
run - should be run after.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-01 19:00:38 +10:00

13 KiB

1item_nametag_idexclusion_reasonsection_pathsectionattributesection_descriptiondescriptioneng_unitvalue_formatconv_typehas_signphys_lowphys_higheng_gainraw_to_enghis_groupscan_interval_secondslife_timeci_stationci_pointpoll_groupiec_addressmodbus_kindmodbus_addressdata_typepoint_time_zone
2AID.WRPS.PU301.RUN_CMDAID.WRPS.PU301.RUN_CMDAID.WRPS.PU301PU301RUN_CMDPump PU-301Run commandDigital001001.0valueWRPS_EVENT1 weeksWRPS_PLCPU301_RUN_CMDPS_STATUS_BITS%QX0.0coil0BooleanDate+time GMT
3AID.WRPS.PU302.RUN_CMDAID.WRPS.PU302.RUN_CMDAID.WRPS.PU302PU302RUN_CMDPump PU-302Run commandDigital001001.0valueWRPS_EVENT1 weeksWRPS_PLCPU302_RUN_CMDPS_STATUS_BITS%QX0.1coil1BooleanDate+time GMT
4AID.WRPS.PU303.RUN_CMDAID.WRPS.PU303.RUN_CMDAID.WRPS.PU303PU303RUN_CMDPump PU-303Run commandDigital001001.0valueWRPS_EVENT1 weeksWRPS_PLCPU303_RUN_CMDPS_STATUS_BITS%QX0.2coil2BooleanDate+time GMT
5AID.WRPS.PU301.RUNNINGAID.WRPS.PU301.RUNNINGAID.WRPS.PU301PU301RUNNINGPump PU-301RunningDigital001001.0valueWRPS_EVENT1 weeksWRPS_PLCPU301_RUNNINGPS_STATUS_BITS%QX0.3coil3BooleanDate+time GMT
6AID.WRPS.PU302.RUNNINGAID.WRPS.PU302.RUNNINGAID.WRPS.PU302PU302RUNNINGPump PU-302RunningDigital001001.0valueWRPS_EVENT1 weeksWRPS_PLCPU302_RUNNINGPS_STATUS_BITS%QX0.4coil4BooleanDate+time GMT
7AID.WRPS.PU303.RUNNINGAID.WRPS.PU303.RUNNINGAID.WRPS.PU303PU303RUNNINGPump PU-303RunningDigital001001.0valueWRPS_EVENT1 weeksWRPS_PLCPU303_RUNNINGPS_STATUS_BITS%QX0.5coil5BooleanDate+time GMT
8AID.WRPS.PU301.AVAILABLEAID.WRPS.PU301.AVAILABLEAID.WRPS.PU301PU301AVAILABLEPump PU-301AvailableDigital001001.0valueWRPS_EVENT1 weeksWRPS_PLCPU301_AVAILABLEPS_STATUS_BITS%QX0.6coil6BooleanDate+time GMT
9AID.WRPS.PU302.AVAILABLEAID.WRPS.PU302.AVAILABLEAID.WRPS.PU302PU302AVAILABLEPump PU-302AvailableDigital001001.0valueWRPS_EVENT1 weeksWRPS_PLCPU302_AVAILABLEPS_STATUS_BITS%QX0.7coil7BooleanDate+time GMT
10AID.WRPS.PU303.AVAILABLEAID.WRPS.PU303.AVAILABLEAID.WRPS.PU303PU303AVAILABLEPump PU-303AvailableDigital001001.0valueWRPS_EVENT1 weeksWRPS_PLCPU303_AVAILABLEPS_STATUS_BITS%QX1.0coil8BooleanDate+time GMT
11AID.WRPS.STN.IN_AUTOAID.WRPS.STN.IN_AUTOAID.WRPS.STNSTNIN_AUTOWaterloo Road PS - station wide measurements and statusStation in autoDigital001001.0valueWRPS_EVENT1 weeksWRPS_PLCSTN_IN_AUTOPS_STATUS_BITS%QX1.1coil9BooleanDate+time GMT
12AID.WRPS.STN.HIGH_LEVELAID.WRPS.STN.HIGH_LEVELAID.WRPS.STNSTNHIGH_LEVELWaterloo Road PS - station wide measurements and statusHigh level alarmDigital001001.0valueWRPS_EVENT1 weeksWRPS_PLCSTN_HIGH_LEVELPS_STATUS_BITS%QX1.2coil10BooleanDate+time GMT
13AID.WRPS.STN.SPILL_ACTIVEAID.WRPS.STN.SPILL_ACTIVEAID.WRPS.STNSTNSPILL_ACTIVEWaterloo Road PS - station wide measurements and statusSpill activeDigital001001.0valueWRPS_EVENT1 weeksWRPS_PLCSTN_SPILL_ACTIVEPS_STATUS_BITS%QX1.3coil11BooleanDate+time GMT
14AID.WRPS.PU301.TRIPPEDAID.WRPS.PU301.TRIPPEDAID.WRPS.PU301PU301TRIPPEDPump PU-301TrippedDigital001001.0valueWRPS_EVENT1 weeksWRPS_PLCPU301_TRIPPEDPS_STATUS_BITS%QX1.4coil12BooleanDate+time GMT
15AID.WRPS.PU302.TRIPPEDAID.WRPS.PU302.TRIPPEDAID.WRPS.PU302PU302TRIPPEDPump PU-302TrippedDigital001001.0valueWRPS_EVENT1 weeksWRPS_PLCPU302_TRIPPEDPS_STATUS_BITS%QX1.5coil13BooleanDate+time GMT
16AID.WRPS.PU303.TRIPPEDAID.WRPS.PU303.TRIPPEDAID.WRPS.PU303PU303TRIPPEDPump PU-303TrippedDigital001001.0valueWRPS_EVENT1 weeksWRPS_PLCPU303_TRIPPEDPS_STATUS_BITS%QX1.6coil14BooleanDate+time GMT
17AID.WRPS.STN.LEVELAID.WRPS.STN.LEVELAID.WRPS.STNSTNLEVELWaterloo Road PS - station wide measurements and statusWet well level%999.9Linear1-5465460.016666666666666666value / 60WRPS_ONE_SEC51 weeksWRPS_PLCSTN_LEVELPS_PUBLISHED%QW0holding0Signed 16-bitDate+time GMT
18AID.WRPS.STN.INFLOWAID.WRPS.STN.INFLOWAID.WRPS.STNSTNINFLOWWaterloo Road PS - station wide measurements and statusInflowm3/h9999.9Linear1-11796.4811796.120.36value * 0.36WRPS_ONE_SEC51 weeksWRPS_PLCSTN_INFLOWPS_PUBLISHED%QW1holding1Signed 16-bitDate+time GMT
19AID.WRPS.STN.DISCHARGEAID.WRPS.STN.DISCHARGEAID.WRPS.STNSTNDISCHARGEWaterloo Road PS - station wide measurements and statusTotal discharge flowm3/h9999.9Linear1-11796.4811796.120.36value * 0.36WRPS_ONE_SEC51 weeksWRPS_PLCSTN_DISCHARGEPS_PUBLISHED%QW2holding2Signed 16-bitDate+time GMT
20AID.WRPS.STN.PUMPS_RUNNINGAID.WRPS.STN.PUMPS_RUNNINGAID.WRPS.STNSTNPUMPS_RUNNINGWaterloo Road PS - station wide measurements and statusPumps runningcount9Linear1-32768327671.0valueWRPS_THIRTY_SEC301 weeksWRPS_PLCSTN_PUMPS_RUNNINGPS_PUBLISHED%QW3holding3Signed 16-bitDate+time GMT
21AID.WRPS.STN.SPEEDAID.WRPS.STN.SPEEDAID.WRPS.STNSTNSPEEDWaterloo Road PS - station wide measurements and statusCommon drive speed%999.9Linear1-655365530.2value * 0.2WRPS_ONE_SEC51 weeksWRPS_PLCSTN_SPEEDPS_PUBLISHED%QW4holding4Signed 16-bitDate+time GMT
22AID.WRPS.STN.TIME_TO_SPILLAID.WRPS.STN.TIME_TO_SPILLAID.WRPS.STNSTNTIME_TO_SPILLWaterloo Road PS - station wide measurements and statusTime to spill weir (32767 = drawing down)s99999Linear1-32768327671.0valueWRPS_THIRTY_SEC301 weeksWRPS_PLCSTN_TIME_TO_SPILLPS_PUBLISHED%QW5holding5Signed 16-bitDate+time GMT
23AID.WRPS.STN.TIME_TO_LSHHAID.WRPS.STN.TIME_TO_LSHHAID.WRPS.STNSTNTIME_TO_LSHHWaterloo Road PS - station wide measurements and statusTime to LSHH (32767 = drawing down)s99999Linear1-32768327671.0valueWRPS_THIRTY_SEC301 weeksWRPS_PLCSTN_TIME_TO_LSHHPS_PUBLISHED%QW6holding6Signed 16-bitDate+time GMT
24AID.WRPS.STN.NET_ACCUMAID.WRPS.STN.NET_ACCUMAID.WRPS.STNSTNNET_ACCUMWaterloo Road PS - station wide measurements and statusNet accumulation (signed)m3/h9999.9Linear1-11796.4811796.120.36value * 0.36WRPS_ONE_SEC51 weeksWRPS_PLCSTN_NET_ACCUMPS_PUBLISHED%QW7holding7Signed 16-bitDate+time GMT
25AID.WRPS.PU301.RUN_HOURSAID.WRPS.PU301.RUN_HOURSAID.WRPS.PU301PU301RUN_HOURSPump PU-301Run hoursh99999Linear1-32768327671.0valueWRPS_EVENT1 weeksWRPS_PLCPU301_RUN_HOURSPS_PUBLISHED%QW8holding8Signed 16-bitDate+time GMT
26AID.WRPS.PU302.RUN_HOURSAID.WRPS.PU302.RUN_HOURSAID.WRPS.PU302PU302RUN_HOURSPump PU-302Run hoursh99999Linear1-32768327671.0valueWRPS_EVENT1 weeksWRPS_PLCPU302_RUN_HOURSPS_PUBLISHED%QW9holding9Signed 16-bitDate+time GMT
27AID.WRPS.PU303.RUN_HOURSAID.WRPS.PU303.RUN_HOURSAID.WRPS.PU303PU303RUN_HOURSPump PU-303Run hoursh99999Linear1-32768327671.0valueWRPS_EVENT1 weeksWRPS_PLCPU303_RUN_HOURSPS_PUBLISHED%QW10holding10Signed 16-bitDate+time GMT
28AID.WRPS.STN.VOL_TO_SPILLAID.WRPS.STN.VOL_TO_SPILLAID.WRPS.STNSTNVOL_TO_SPILLWaterloo Road PS - station wide measurements and statusVolume remaining to spillm39999Linear1-32768327671.0valueWRPS_THIRTY_SEC301 weeksWRPS_PLCSTN_VOL_TO_SPILLPS_PUBLISHED%QW11holding11Signed 16-bitDate+time GMT
29AID.WRPS.STN.STATEAID.WRPS.STN.STATEAID.WRPS.STNSTNSTATEWaterloo Road PS - station wide measurements and statusStation state (enum 3.1)9Linear1-32768327671.0valueWRPS_EVENT1 weeksWRPS_PLCSTN_STATEPS_PUBLISHED%QW12holding12Signed 16-bitDate+time GMT
30AID.WRPS.PU301.STATEAID.WRPS.PU301.STATEAID.WRPS.PU301PU301STATEPump PU-301Pump state (enum 3.2)9Linear1-32768327671.0valueWRPS_EVENT1 weeksWRPS_PLCPU301_STATEPS_PUBLISHED%QW13holding13Signed 16-bitDate+time GMT
31AID.WRPS.PU302.STATEAID.WRPS.PU302.STATEAID.WRPS.PU302PU302STATEPump PU-302Pump state (enum 3.2)9Linear1-32768327671.0valueWRPS_EVENT1 weeksWRPS_PLCPU302_STATEPS_PUBLISHED%QW14holding14Signed 16-bitDate+time GMT
32AID.WRPS.PU303.STATEAID.WRPS.PU303.STATEAID.WRPS.PU303PU303STATEPump PU-303Pump state (enum 3.2)9Linear1-32768327671.0valueWRPS_EVENT1 weeksWRPS_PLCPU303_STATEPS_PUBLISHED%QW15holding15Signed 16-bitDate+time GMT
33AID.WRPS.STN.DUTY_PUMPAID.WRPS.STN.DUTY_PUMPAID.WRPS.STNSTNDUTY_PUMPWaterloo Road PS - station wide measurements and statusCurrent duty pump (0 = none, 1-3)9Linear1-32768327671.0valueWRPS_EVENT1 weeksWRPS_PLCSTN_DUTY_PUMPPS_PUBLISHED%QW16holding16Signed 16-bitDate+time GMT
34AID.WRPS.STN.ALARM_WORDAID.WRPS.STN.ALARM_WORDAID.WRPS.STNSTNALARM_WORDWaterloo Road PS - station wide measurements and statusAlarm bitmask (section 6) - READ AS UNSIGNED99999Linear00655351.0valueWRPS_EVENT1 weeksWRPS_PLCSTN_ALARM_WORDPS_PUBLISHED%QW17holding17Unsigned 16-bitDate+time GMT
35AID.WRPS.STN.CMD_ACKAID.WRPS.STN.CMD_ACKAID.WRPS.STNSTNCMD_ACKWaterloo Road PS - station wide measurements and statusCommand acknowledge (echoes %MW1)99Linear1-32768327671.0valueWRPS_EVENT1 weeksWRPS_PLCSTN_CMD_ACKPS_PUBLISHED%QW20holding20Signed 16-bitDate+time GMT
36AID.WRPS.SP.MODEAID.WRPS.SP.MODEAID.WRPS.SPSPMODEOperator setpoints and commandsStation mode: 1 = auto, 2 = off9Linear1-32768327671.0valueWRPS_EVENT1 weeksWRPS_PLCSP_MODEPS_SETPOINTS%MW0holding1024Signed 16-bitDate+time GMT
37AID.WRPS.SP.CMD_WORDAID.WRPS.SP.CMD_WORDAID.WRPS.SPSPCMD_WORDOperator setpoints and commandsCommand word (section 3.3)99Linear1-32768327671.0valueWRPS_EVENT1 weeksWRPS_PLCSP_CMD_WORDPS_SETPOINTS%MW1holding1025Signed 16-bitDate+time GMT
38AID.WRPS.SP.CMD_PARAMAID.WRPS.SP.CMD_PARAMAID.WRPS.SPSPCMD_PARAMOperator setpoints and commandsCommand parameter (pump number)9Linear1-32768327671.0valueWRPS_EVENT1 weeksWRPS_PLCSP_CMD_PARAMPS_SETPOINTS%MW2holding1026Signed 16-bitDate+time GMT
39AID.WRPS.SP.LEVEL_SPAID.WRPS.SP.LEVEL_SPAID.WRPS.SPSPLEVEL_SPOperator setpoints and commandsLevel control setpoint%999.9Linear1-5465460.016666666666666666value / 60WRPS_EVENT1 weeksWRPS_PLCSP_LEVEL_SPPS_SETPOINTS%MW3holding1027Signed 16-bitDate+time GMT
40AID.WRPS.SP.START_DUTYAID.WRPS.SP.START_DUTYAID.WRPS.SPSPSTART_DUTYOperator setpoints and commandsStart duty level%999.9Linear1-5465460.016666666666666666value / 60WRPS_EVENT1 weeksWRPS_PLCSP_START_DUTYPS_SETPOINTS%MW4holding1028Signed 16-bitDate+time GMT
41AID.WRPS.SP.START_P2AID.WRPS.SP.START_P2AID.WRPS.SPSPSTART_P2Operator setpoints and commandsStart pump 2 level%999.9Linear1-5465460.016666666666666666value / 60WRPS_EVENT1 weeksWRPS_PLCSP_START_P2PS_SETPOINTS%MW5holding1029Signed 16-bitDate+time GMT
42AID.WRPS.SP.START_P3AID.WRPS.SP.START_P3AID.WRPS.SPSPSTART_P3Operator setpoints and commandsStart pump 3 level%999.9Linear1-5465460.016666666666666666value / 60WRPS_EVENT1 weeksWRPS_PLCSP_START_P3PS_SETPOINTS%MW6holding1030Signed 16-bitDate+time GMT
43AID.WRPS.SP.STOP_ALLAID.WRPS.SP.STOP_ALLAID.WRPS.SPSPSTOP_ALLOperator setpoints and commandsStop all level%999.9Linear1-5465460.016666666666666666value / 60WRPS_EVENT1 weeksWRPS_PLCSP_STOP_ALLPS_SETPOINTS%MW7holding1031Signed 16-bitDate+time GMT
44AID.WRPS.SP.HIGH_ALARMAID.WRPS.SP.HIGH_ALARMAID.WRPS.SPSPHIGH_ALARMOperator setpoints and commandsHigh level alarm%999.9Linear1-5465460.016666666666666666value / 60WRPS_EVENT1 weeksWRPS_PLCSP_HIGH_ALARMPS_SETPOINTS%MW8holding1032Signed 16-bitDate+time GMT
45AID.WRPS.SP.MIN_SPEEDAID.WRPS.SP.MIN_SPEEDAID.WRPS.SPSPMIN_SPEEDOperator setpoints and commandsMinimum drive speed%999.9Linear1-655365530.2value * 0.2WRPS_EVENT1 weeksWRPS_PLCSP_MIN_SPEEDPS_SETPOINTS%MW9holding1033Signed 16-bitDate+time GMT
46AID.WRPS.SP.SERVICE_HRSAID.WRPS.SP.SERVICE_HRSAID.WRPS.SPSPSERVICE_HRSOperator setpoints and commandsService intervalh99999Linear1-32768327671.0valueWRPS_EVENT1 weeksWRPS_PLCSP_SERVICE_HRSPS_SETPOINTS%MW10holding1034Signed 16-bitDate+time GMT
47AID.WRPS.SIM.INFLOWsimulation control, not a plant measurement - answering from it would report the scenario driver as though it were the real inflowAID.WRPS.SIMSIMINFLOWSimulation control - simulation build onlymanual inflow (mode 0)m3/h9999.9Linear1-11796.4811796.120.36value * 0.36WRPS_EVENT1 weeksWRPS_PLCSIM_INFLOWPS_SIM_CONTROL%MW20holding1044Signed 16-bitDate+time GMT
48AID.WRPS.SIM.SCENARIOsimulation control, not a plant measurementAID.WRPS.SIMSIMSCENARIOSimulation control - simulation build onlyscenario 0=man 1=diurnal 2=wet 3=ref9Linear1-32768327671.0valueWRPS_EVENT1 weeksWRPS_PLCSIM_SCENARIOPS_SIM_CONTROL%MW21holding1045Signed 16-bitDate+time GMT
49AID.WRPS.SIM.RESETsimulation control, not a plant measurementAID.WRPS.SIMSIMRESETSimulation control - simulation build onlywrite 1 to reset scenario, self-clearing9Linear1-32768327671.0valueWRPS_EVENT1 weeksWRPS_PLCSIM_RESETPS_SIM_CONTROL%MW22holding1046Signed 16-bitDate+time GMT
50AID.WRPS.SIM.TIME_SCALEsimulation control - a non-unity time scale means wall-clock durations in the history are compressed and must not be quoted as real durationsAID.WRPS.SIMSIMTIME_SCALESimulation control - simulation build onlytime scale 1-120x999Linear1-32768327671.0valueWRPS_EVENT1 weeksWRPS_PLCSIM_TIME_SCALEPS_SIM_CONTROL%MW23holding1047Signed 16-bitDate+time GMT