yau-plant-assistant/db/seed/alarm_bits.csv
Claude 8aba1f7f5c Rebuild the stand-in historian on CI Server item names
The three open Phase 5 findings were one defect: the stand-in was keyed on
CI Server POINT names (PS_STN_WET_WELL_LEVEL) when the historian is keyed on
CI Server ITEM names (AID.WRPS.STN.LEVEL). Modbus carries register numbers,
not names, so those two layers are free to differ - and do. Reconciling
against the register map, as planned, would only have proved the first three
namespaces agreed with each other.

Rebuilt from WRPS/05-scada/modbus, so item names, sample rates, retention and
timestamp semantics come from the machine rather than from a guess.

(a) Level tag does not join. PS_STN_WET_WELL_LEVEL becomes a tag row in its
    own right; LIT-101 is marked NOT HISTORISED - a field input on %IW0 that
    never reaches SCADA. It was the only seed row carrying two addresses.
    public.historian_items holds the item-to-tag mapping, generated by
    scripts/gen_historian_items.py and enforced non-empty at generate, at
    deploy and at verify.

(b) first_alarm/last_alarm returned UTC. Converted inside the measure, so it
    stays in Cube and happens once. Aggregate first, convert after - the other
    order picks the wrong row across a DST fall-back. Returned as a formatted
    string with a companion site_timezone measure. Storage being UTC is now
    confirmed, not assumed: all 49 points carry TIME_ZONE "Date+time GMT" and
    every history group CORRECT_DAYLIGHT=0. This answers Phase 4 task 4.

(c) High level alarm filed against the wrong equipment. Both sides were right
    about different things; the defect was asserting equipment twice. The
    history now carries no equipment column at all - faithful, since CI
    Server's section tree stops at the station and three pumps. Equipment is
    reached bit -> tag -> equipment via public.alarm_bits.

Alarms are derived, not stored: CI Server's ALARM_HISTORY group is empty
because every item imports with alarming off. Decomposing the alarm word needs
no configuration that does not exist.

Three things the SCADA config changed that were never filed as faults:
  - retention is 7 days, not 30. The advisory path was reporting a month of
    evidence drawn from a week of data
  - the analogue rate is 5 s, not 60. Two measures multiplied sample counts by
    a hardcoded 60 - a twelvefold overstatement that read as plausible
  - the deadband warning in process_values.yml was wrong and was steering
    people away from the correct measure

db/002_fixtures.sql now asserts its own counts at load and cross-checks the
alarm derivation against two independent signals. Those prove the pipeline,
not the plant.

db/README-standin-historian.md documents removal: the seam between generation
and contract, and twelve assumptions about imh that are NOT confirmed. Two of
them fail silently.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-31 11:42:02 +10:00

17 lines
3.1 KiB
CSV

bit,alarm_type,priority,tag_id,alarm_text,description
0,HIGH_LEVEL,2,PS_STN_HIGH_LEVEL_ALARM,Wet well high level,"Wet well level above the high level alarm setpoint (%MW8, default 5200 mm = 86.7%). The discrete item AID.WRPS.STN.HIGH_LEVEL mirrors this bit; the two are cross-checked at fixture load."
1,HIGH_HIGH_LEVEL,1,LSHH-102,Wet well high high level,"LSHH-102 wet at 5500 mm (91.7%). Forces all available pumps to 50 Hz and bypasses min-off timers. The switch itself is a field input and is not historised - this bit is the only record of it."
2,LOW_LOW_LEVEL,1,LSLL-103,Dry run lockout,"LSLL-103 dry. Stops all pumps and latches the dry-run lockout, which needs a manual reset. Field input, not historised - this bit is the only record."
3,SPILL,1,PS_STN_SPILL_ACTIVE,Spill over the weir,"Level over the 6000 mm weir crest. An environmental reportable event - report the count plainly and never round it. The discrete item AID.WRPS.STN.SPILL_ACTIVE mirrors this bit."
4,PUMP_TRIP,1,PS_PU301_TRIPPED,PU-301 tripped,"PU-301 tripped on thermal TE-312, vibration above 11.0 mm/s, or no-flow on PIT-311. Trips LATCH and clear only on the reset command."
5,PUMP_TRIP,1,PS_PU302_TRIPPED,PU-302 tripped,"PU-302 tripped on thermal TE-322, vibration above 11.0 mm/s, or no-flow on PIT-321. Trips LATCH and clear only on the reset command."
6,PUMP_TRIP,1,PS_PU303_TRIPPED,PU-303 tripped,"PU-303 tripped on thermal TE-332, vibration above 11.0 mm/s, or no-flow on PIT-331. Trips LATCH and clear only on the reset command."
7,SEAL_LEAK,3,MSE-313,PU-301 seal leak,"MSE-313 moisture detected. Alarm only - a seal leak does NOT remove availability (WRPS-PRO-001 section 5.5) and the pump keeps running."
8,SEAL_LEAK,3,MSE-323,PU-302 seal leak,"MSE-323 moisture detected. Alarm only; availability is unaffected."
9,SEAL_LEAK,3,MSE-333,PU-303 seal leak,"MSE-333 moisture detected. Alarm only; availability is unaffected."
10,HIGH_VIBRATION,2,VE-314,PU-301 high vibration,"VE-314 above the 7.1 mm/s alarm threshold. Above 11.0 mm/s the unit trips and bit4 sets as well. There is no vibration trend in the historian - the instrument is a field input."
11,HIGH_VIBRATION,2,VE-324,PU-302 high vibration,"VE-324 above the 7.1 mm/s alarm threshold. Above 11.0 mm/s the unit trips and bit5 sets as well."
12,HIGH_VIBRATION,2,VE-334,PU-303 high vibration,"VE-334 above the 7.1 mm/s alarm threshold. Above 11.0 mm/s the unit trips and bit6 sets as well."
13,LEVEL_SIGNAL_FAULT,1,LIT-101,Wet well level signal fault,"LIT-101 frozen or out of range - no change greater than 1 mm for 10 minutes with a pump running. Priority 1: losing the level signal on a well that can spill is a priority 1 condition. While this is active, AID.WRPS.STN.LEVEL is not trustworthy and any level answer over the window must say so."
14,MAINS_FAILURE,1,XA-502,Mains supply failure,"XA-502 unhealthy. Station is on loss of supply."
15,SETPOINT_REJECTED,3,PS_STN_ALARM_BITMASK,Setpoint write rejected,"A SCADA setpoint write was rejected by the PLC as out of range and the previous value was retained. There is no dedicated instrument for this condition - the bitmask is the only record of it, so the tag is the bitmask itself."