Industrial-AIOps Energy

v0.2.1
io.github.industrial-aiops/iaiops-energy Checked 1 hour ago Published 17 days ago

Read-only IEC-104, DNP3 and IEC 61850 monitoring with governed MCP tools for energy systems.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

protocols_supported

[READ][risk=low] Capability map — protocols, status, tools, connection params. Call this to discover what iaiops can do before choosing a protocol/tool. Lists implemented protocols (OPC-UA incl. HDA, Modbus, S7comm, Mitsubishi MC, MTConnect, MQTT/Sparkplug B full-decode, EtherNet/IP Logix) and the EtherCAT roadmap stub, plus cross-protocol analytics (OEE/downtime, asset inventory, CoV), each with its read/write tools and the endpoint params it needs. Also reports whether this server runs under the no-egress gate, so a model is TOLD the posture instead of having…

site_readiness

[READ][risk=low] Which scenarios THIS site can run today, and what each gap needs. The companion to `protocols_supported`, one altitude down. That one says what the product can do; this says what this installation can do — and calling the first without the second is how an agent plans a scenario the site has no inputs for. Contacts nothing: no device, no network, no historian. It is derived from `config.yaml` and the local store, which is what makes it runnable against a site nobody has authorised you to probe — the site that most needs it. Three states,…

ParameterTypeDescription
dbstring

onboarding_status

[READ][risk=low] Where this site is on the path from a network to an answer. One altitude below `site_readiness`. That one lists every scenario and what each is waiting for; this one answers the smaller, earlier question a caller actually has first — **which journey this site is on, and which single command comes next** on it. There are two, with different first steps: devices — no UNS yet: scan → endpoints → point list → what each point MEANS → collect → ask the question uns — data already in an MQTT/UNS broker: connect â…

ParameterTypeDescription
dbstring
trackstring

onboarding_config_draft

[READ][risk=low] The config.yaml endpoints a stored scan can justify. Closes the gap where a site scanned forty devices and then retyped all forty by hand. Reads a stored scan; writes nothing. `config.yaml` is edited by a person, exactly as with `iaiops tags apply`. **Every drafted field says whether the scan established it.** A field with `value: null` was NOT established, and its `caution` says what it is waiting for — do not fill one in and do not drop it. Dropping it lets the protocol default apply in silence, which is how a Modbus gateway gets read at unit…

ParameterTypeDescription
dbstring
scan_idstring

health_summary

[DEPRECATED → opcua_health_summary][READ][risk=low] Classify OPC-UA tags. Classifies tag node-ids against warn/alarm thresholds. Returns ok/warn/alarm/unknown counts plus the offending tags. Thresholds come from config tags, or per-ref overrides in ``thresholds``. Args: endpoint: Endpoint name from config. node_ids: Tag node ids to evaluate; omit to use configured tags. thresholds: Optional {ref: {warn_high, alarm_high, warn_low, alarm_low}}.

ParameterTypeDescription
endpoint
node_ids
thresholds

anomaly_scan

[DEPRECATED → opcua_anomaly_scan][READ][risk=low] Statistical outlier scan. Samples a node over a bounded window and flags statistical outliers. Computes mean/stddev/min/max and flags samples outside mean ± sigma*stddev. Simple statistics only — no ML, no persisted model. Args: node_id: The OPC-UA node id to scan. endpoint: Endpoint name from config. samples: Max samples (capped server-side). interval_ms: Delay between samples in milliseconds. sigma: Outlier band width in standard deviations.

ParameterTypeDescription
node_id *string
endpoint
interval_msinteger
samplesinteger
sigmanumber

diagnose_dataflow

[READ][risk=low] Localize a 'no data' break across an endpoint's reachable hops. Probes connect → read(ref) → freshness → variance and returns a verdict with per-hop detail and a recommended action. The #1 OT triage: distinguishes "cannot connect" (network/PLC down) from "comms OK but value stale" (upstream/field/source) from "good status but flatline" (sensor stuck). Args: endpoint: Endpoint name from config (any protocol). ref: Tag/node/address/device to read (OPC-UA node id, Modbus address, S7 address string, MELSEC device). Omit to te…

ParameterTypeDescription
endpoint
flatline_epsnumber
freshness_threshold_sinteger
ref
series

historian_health

[READ][risk=low] Bad-tag / flatline / gap detection over a provided series. Pure analysis over an injected sample series — no live historian needed. Args: series: Samples — scalars or {value, timestamp (ISO-8601), quality|good}. gap_threshold_s: Time gap (seconds) between consecutive samples that counts as a data gap (default 60). flatline_eps: Spread at/below which the series counts as flatline. Returns dict: {samples, numeric_samples, bad_quality_count, flatline (bool), gap_count, gaps:[{after, gap_seconds}], stdev, verdi…

ParameterTypeDescription
series *array
flatline_epsnumber
gap_threshold_snumber

alarm_bad_actors

[READ][risk=low] ISA-18.2 alarm-flood analysis over a list of alarm events. Args: events: Alarm/condition events — {source, timestamp (ISO-8601), priority?, state? (ACTIVE/RTN/ACK)}. window_minutes: Analysis window; omitted → inferred from event timestamps. chatter_window_s: A source with >=3 transitions inside this window chatters. standing_s: An alarm active longer than this is 'standing/stale' (default 24h). top_n: How many top offenders to return. Returns dict: {event_count, window_minutes, alarms_per_hour, isa_18_2:…

ParameterTypeDescription
events *array
chatter_window_snumber
standing_snumber
top_ninteger
window_minutes

tag_health

[READ][risk=low] Rank tag offenders by bad-quality / flatline / range / anomaly. Args: tags: Per-tag dicts — {ref, label?, samples:[scalars or {value, good|quality}], warn_high?, alarm_high?, warn_low?, alarm_low?}. thresholds: Optional {ref: {warn_high, alarm_high, warn_low, alarm_low}} override. Returns dict: {evaluated, overall ('ok'|'warn'|'alarm'), offender_count, offenders:[{ref, label, samples, latest, flags:[...], anomaly_count, severity (0..3)}], results:[...]}. Flags include bad_quality, flatline, out_of_range_warn/alarm…

ParameterTypeDescription
tags *array
thresholds

subscription_health

[READ][risk=low] Health of a sequenced subscription feed (OPC-UA or Sparkplug B). Detects dropped notifications (sequence gaps), duplicates / out-of-order, a high republish-rejection rate, and overloaded channels — the classic Kepware "too many tags on one channel → republish/queue-flush dropouts" fault. Args: sequence: Sequence numbers actually received, in arrival order. republish_requested: How many republish requests were made. republish_rejected: How many were rejected (server couldn't keep up). tags_per_channel: {channel/endpoint: tag…

ParameterTypeDescription
sequence *array
max_tags_per_channelinteger
republish_rejectedinteger
republish_requestedinteger
tags_per_channel
wrap_at

downtime_root_cause

[READ][risk=low] AI downtime root-cause copilot — cited verdict, ADVISORY only. Correlates whatever evidence you supply around a downtime/incident window — alarm events, tag samples, a diagnose_dataflow verdict, a machine-state series — ranks candidate root causes, and cites the REAL signals behind each. Read-first: it proposes a human-approved, undoable (MOC-gated) action but executes nothing. Anti-hallucination: only signals present in the input are cited; thin evidence downgrades to 'insufficient_evidence' with a 'recommended_next_data' list rather than a…

ParameterTypeDescription
window *object
alarms
cause_weights
dataflow
include_graphboolean
lead_window_snumber
state_series
tags

downtime_root_cause_live

[READ][risk=low] AI downtime RCA copilot that GATHERS its own live evidence. Same advisory, read-only, evidence-cited contract as downtime_root_cause — but instead of hand-injecting evidence you give an endpoint + incident window and it pulls the evidence itself: a cross-protocol diagnose_dataflow probe, a short sampled series per ref (so flatline/bad-quality/anomaly surface via tag_health), and active OPC-UA conditions. Light read load; non-destructive; nothing executed. The gathered bundle is echoed under 'collected_evidence' (no hidden inputs). Args:…

ParameterTypeDescription
endpoint
include_alarmsboolean
include_graphboolean
interval_msinteger
lead_window_snumber
refs
sample_countinteger
window

learn_cause_weights

[READ][risk=low] Learn a per-site RCA {cause: weight} profile from history. Derives a per-site cause-weight profile from a corpus of CONFIRMED past incidents so downtime_root_cause adapts to what THIS site's evidence actually predicts. Pure + explainable: each weight is the smoothed signal→cause precision relative to chance (>1 = evidence for that cause is reliable here, <1 = often misleading) — no black box. Anti-overfit: Laplace smoothing + a per-cause min-sample guard, and a fall-back to the shipped defaults when the corpus is too thin. Feed the returned 'ca…

ParameterTypeDescription
history *array
min_samplesinteger
smoothingnumber

rca_corpus_from_maintenance

[READ][risk=low] Turn a CMMS/work-order export into the RCA incident corpus. Auto-builds the labeled history learn_cause_weights needs from closed maintenance records: an explicit taxonomy cause column wins; else a built-in EN/中文 CMMS synonym table (extendable via 'synonyms'); else UNAMBIGUOUS keyword inference over the row's free text using the copilot's own cause keywords. Rows it cannot map land in 'unmapped' with the reason — never silently guessed. 'signals' come from an explicit column or the symptom/alarm text (may stay empty — no fabricated evidence…

ParameterTypeDescription
rows *array
learnboolean
min_samplesinteger
smoothingnumber
synonyms

data_quality_scorecard

[READ][risk=low] Fleet data-TRUST scorecard across endpoints' tag feeds. Scores each tag 0-100 on whether its data can be BELIEVED — staleness, dead heartbeat, bad-quality, flatline, gaps, anomaly — then rolls up per endpoint and across the fleet. NOT process health (it does not score whether a value is alarming, only whether it is trustworthy). Pure analysis over provided feeds. Args: feeds: Per-endpoint feeds — {endpoint, tags:[{ref, label?, samples:[scalars or {value, good|quality, timestamp?}], expected_update_s?, heartbeat?}]}. defau…

ParameterTypeDescription
feeds *array
default_staleness_snumber
now

data_quality_fleet_rollup

[READ][risk=low] Cross-endpoint fleet rollup of data-TRUST: worst tags + bad quality. Builds on data_quality_scorecard to give a fleet-wide view: endpoints ranked by their single worst tag, bad-quality tag counts aggregated across every endpoint, and a first-class liveness rollup (dead-heartbeat / flatline). Staleness and gap budgets are configurable per tag (staleness_s / gap_threshold_s) and per feed, so a slow daily counter is not judged like a 1Hz sensor. Pure analysis. Args: feeds: Per-endpoint feeds — {endpoint, staleness_s?, tags:[{ref, label?,…

ParameterTypeDescription
feeds *array
default_staleness_snumber
now
top_ninteger

heartbeat_health

[READ][risk=low] Is a heartbeat/watchdog tag still alive? (liveness check). A heartbeat must keep CHANGING; a flatlined one means the upstream is dead even when comms/quality look fine. With timestamped samples + max_interval_s, also flags the longest stall. Args: series: Heartbeat samples — scalars or {value, timestamp?} (a counter/toggle). max_interval_s: Max allowed gap between changes; exceeding it = not alive. Returns dict: {alive (bool), samples, distinct_transitions, spread, longest_stall_s, reason}. Example: heartbeat_health(series=…

ParameterTypeDescription
series *array
max_interval_s

downtime_attribution

[READ][risk=low] Which stoppage started it, and which ones were downstream of it. RCA weights evidence by TIME alone — a signal before onset counts, one after counts less. That is the honest half of the axis. Run `downtime_root_cause` per asset after one upstream stop and every downstream machine comes back with its own confident local root cause: each internally consistent, each citing real signals, and all but one about a machine that stopped because it was starved. The distinguishing fact is not in the evidence — it is the line's topology. Two rules dec…

ParameterTypeDescription
stoppages *array
max_lead_snumber
sitestring

alarm_flood_analysis

[READ][risk=low] ISA-18.2 deep alarm-flood analysis: episodes + chattering + stale + advice. Deepens alarm_bad_actors: detects flood *episodes* (start/end/count/peak rate/ top contributors + each episode's first-out annunciation, per ISA-18.2's >=10 alarms per 10 min per operator), alarms chattering ACTIVE↔CLEARED, standing/ stale alarms, and percent-time-in-flood vs the ISA-18.2 targets (~1-2 alarms/ 10 min steady state, <1% time in flood). Also returns an ISA-18.2 'load_profile' (per-bucket rate band + peak period + trend) and per-source 'suppression_advice' (d…

ParameterTypeDescription
duration_sinteger
endpoint
events
load_bucket_snumber
max_episodesinteger
max_rowsinteger
stale_after_snumber
thresholdinteger
window_snumber

alarm_cascade

[READ][risk=low] Collapse an alarm flood into cascades + each cascade's first-out root. Answers "which alarm to look at first" when 100+ alarms hit in minutes: groups annunciations into cascades (a new cascade starts after a quiet gap > window_s) and reports the FIRST-OUT alarm (earliest in the burst) as the likely root, plus downstream members and any chattering sources. First-out is a transparent heuristic cited by timestamp — NOT causal (use downtime_root_cause for causality). Pass 'events' for pure analysis, or an endpoint to collect live via the OPC-UA active-co…

ParameterTypeDescription
duration_sinteger
endpoint
events
min_cascadeinteger
window_snumber

alarm_rationalization_worksheet

[READ][risk=low] ISA-18.2 alarm-rationalization worksheet (CSV or inline rows). One row per alarm source, count-descending: count, % of total annunciations, chattering?, flood contributor?, and a recommendation stub — the starting document for an ISA-18.2 rationalization review. Pass 'events' for pure analysis, or an endpoint to collect live via the same OPC-UA active-condition scan the RCA copilot uses. With out_path the full worksheet is written as CSV and the path returned; otherwise bounded inline rows (truncation noted). Args: endpoint: Endpoint nam…

ParameterTypeDescription
duration_sinteger
endpoint
events
out_path
thresholdinteger
window_snumber

alarm_event_clusters

[READ][risk=low] Collapse ten phrasings of one fault into one row. `alarm_bad_actors` ranks by SOURCE, which answers "which instrument is noisiest" and not "which fault is noisiest". A plant that words one condition ten ways — `PT-101 HIGH`, `PT-102 HIGH`, `PT-103 high alarm` — gets ten bad actors and no sign that they are one problem, so a rationalization meeting works the list top-down and fixes the same thing three times. This groups the same events by what they SAY instead of by who said it. Clustering is **exact equality of a normalized string, not simila…

ParameterTypeDescription
events *array
min_countinteger
top_ninteger

asset_inventory

[READ][risk=low] Actively fingerprint endpoints into an asset register. Connects to each target with our own protocol client and reads its identity call (S7 CPU info, EtherNet/IP controller info, OPC-UA server build info, Modbus device identification FC43, Mitsubishi CPU type, MTConnect device model), aggregating vendor/model/firmware/serial per device. Honest scope: ACTIVE fingerprinting (we connect to each device), NOT passive SPAN/tap discovery. Only finds devices we are configured to reach. Args: endpoints: Endpoint names to fingerprint; omit to finge…

ParameterTypeDescription
endpoints

device_advisory_check

[READ][risk=low] Which scanned devices fall inside a mounted advisory's stated range. `iaiops scan` already reads vendor / model / firmware / serial and then does nothing with them. This closes that loop — and deliberately stops short of where a vulnerability scanner would go. **It reports that a device falls inside an advisory's stated range. Nothing more.** Not "vulnerable", not "exploitable", no severity score. Whether a published issue is reachable on a particular machine depends on configuration, network position and compensating controls that a read-only…

ParameterTypeDescription
devices *array
library_path *string

cross_protocol_asset_model

[READ][risk=low] Fuse per-protocol tag feeds into ONE unified asset model. Unifies the two per-protocol tag models (OPC-UA address-space discovery + Modbus register templates) into one cross-protocol asset/tag/alias model. Tags are re-classified with the SAME semantic classifier the OPC-UA layer uses, grouped into assets ACROSS protocols (a ``Line1`` OPC-UA folder + a ``Line1`` Modbus block become one asset), and each gets a canonical alias ``<site>.<asset>.<class_or_name>``. Advisory only — aliases are SUGGESTIONS, never a server-side rename (OT-dangerous).…

ParameterTypeDescription
feeds *array
site

adopt_alias_map

[READ][risk=low][PERSIST] Adopt + persist the canonical alias map for a site. Writes a local owner-only advisory JSON file (NOT an OT-device write — hence risk=low); see the persistence note below. Runs the cross-protocol asset model over ``feeds``, extracts the adopted map ``{canonical_alias: {ref, protocol, asset, name, class}}``, and persists it as the site's baseline (owner-only JSON under the iaiops home). Re-running overwrites the baseline. Advisory — the map is a SUGGESTION, never a server-side rename (OT-dangerous). Args: feeds: Per-protoc…

ParameterTypeDescription
feeds *array
site

diff_alias_map

[READ][risk=low] Diff a fresh discovery run against the adopted baseline. Loads the site's previously adopted alias map, re-runs the cross-protocol asset model over ``feeds``, and reports how the address space moved: tags added / removed / renamed (same ref, new alias) / reclassified (same ref+alias, new semantic class), plus a stable|changed verdict. Adopt a baseline first with ``adopt_alias_map``. Args: feeds: Fresh per-protocol tag feeds (same shape as adopt_alias_map). site: Site label whose baseline to diff against. Default 'site'. Returns di…

ParameterTypeDescription
feeds *array
site

oee_compute

[READ][risk=low] OEE = Availability × Performance × Quality (+ loss/energy depth). Args: planned_time_s: Planned production time (seconds). run_time_s: Actual running time (seconds) — planned minus downtime. ideal_cycle_time_s: Ideal/nameplate cycle time per part (seconds). total_count: Total parts produced. good_count: Good (non-reject) parts produced. breakdown_time_s: Optional — unplanned-stop seconds (splits availability loss). setup_time_s: Optional — changeover/setup seconds (splits availability loss). minor_sto…

ParameterTypeDescription
good_count *number
ideal_cycle_time_s *number
planned_time_s *number
run_time_s *number
total_count *number
actual_kwh
baseline_kwh
breakdown_time_s
emission_factor_kg_per_kwh
energy_tolerancenumber
minor_stop_time_s
setup_time_s
startup_reject_count

downtime_events

[READ][risk=low] Detect running→stopped transitions and categorize stoppages. Args: series: Timestamped samples — {timestamp (ISO-8601), state} where state is a string (RUNNING/IDLE/FAULT…), a bool, or a number. category_map: Optional {state_label: category} override (else keyword heuristics map to changeover/material/mechanical/quality/break/unknown). min_duration_s: Ignore stoppages shorter than this (seconds). Returns dict: {samples, event_count, total_downtime_s, by_category:{cat: {count, downtime_s}}, events:[{start,…

ParameterTypeDescription
series *array
category_map
min_duration_snumber

oee_multidim

[READ][risk=low] Aggregate OEE (+ optional energy) across dimensions. Args: records: Labelled records — {<dimension labels>, planned_time_s, run_time_s, ideal_cycle_time_s, total_count, good_count} plus optional actual_kwh / baseline_kwh to enable the energy rollup. dimensions: Dimension keys to group by (default ['machine','part','shift']); use ['shift'] for the classic by-shift energy comparison. emission_factor_kg_per_kwh: Optional carbon factor (kg CO2e/kWh); default is a flagged placeholder — pass the grid's…

ParameterTypeDescription
records *array
dimensions
emission_factor_kg_per_kwh
energy_tolerancenumber

monitor_changes

[READ][risk=low] Capture only the value CHANGES of a point over a bounded window. Polls ``ref`` and returns only the changes (with timestamps), not every sample — the OT deadband-report pattern. Works across OPC-UA / Modbus / S7 / Mitsubishi MC / EtherNet/IP. Hard-capped by duration_s and max_changes (never an infinite loop). Args: ref: Point to watch — OPC-UA node id, Modbus address, S7 address string, MELSEC device, or Logix tag (per the endpoint's protocol). endpoint: Endpoint name from config. duration_s: Wall-clock window in se…

ParameterTypeDescription
ref *string
deadbandnumber
duration_sinteger
endpoint
interval_msinteger
max_changesinteger

compliance_mapping

[READ][risk=low] 《工控系统网络安全防护指南》 ↔ iaiops governance mapping. An honest onboarding/sales self-assessment across the pillars 分区隔离 / 可审计 / 双向认证 / 最小权限 / 数据保护 / 自主可控. Each control names how iaiops addresses it, an honest status (addressed / partial / 待核实), and the remaining gap. Returns dict: {framework, frameworks[], pillars[], control_count, status_summary {addressed, partial, 待核实}, controls:[{pillar, requirement, iaiops, status, gap, crosswalk{dengbao, iec62443}}]}. See comp…

compliance_frameworks

[READ][risk=low] 跨框架对照: 防护指南 ↔ 等保 2.0 ↔ IEC 62443 ↔ GxP ↔ NIS2 ↔ CRA. Omit ``framework`` for one row per governance pillar: the matching 《防护指南》 requirement, 等保 2.0 control class, IEC 62443 FR, GxP clause, the NIS2 / CRA item refs that cite the pillar, and the iaiops status. Pass framework="nis2" (Directive (EU) 2022/2555 Art. 21(2)(a)-(j)) or "cra" (Regulation (EU) 2024/2847 Annex I) for that text item by item, each with an honest coverage: product_evidence (a cited, code-anchored mechanism produces relevant evidence —…

ParameterTypeDescription
framework

compliance_dengbao_levels

[READ][risk=low] 等保 2.0 二级 vs 三级 per-pillar deltas + honest iaiops posture. 等保 2.0 (GB/T 22239) is graded — the same control tightens as the level rises. Per governance pillar this shows the 二级 baseline, what 三级 additionally requires, and how far iaiops moves you toward it (with the honest per-control status/gap). An onboarding/self-assessment aid, NOT a certification. Args: level: Focus on one level — 'l2'/'l3', '二级'/'三级', or '2'/'3'. Omit for both. Returns dict: {framework, levels:[{id,name,note}], selected_level, pillar_…

ParameterTypeDescription
level

compliance_report

[READ][risk=low] Render the 等保 2.0 / IEC 62443 or NIS2 / CRA report (Markdown). Turns the compliance crosswalk into a deliverable document a CISO can read: title-page metadata (site / date / iaiops version), per-pillar 等保 L2/L3 status table, IEC 62443 FR1–6 crosswalk, honest gap list, and a governance-controls appendix (audit hash chain / approval tokens / dry-run+undo / mTLS). With framework='nis2' / 'cra' / 'eu' it renders instead the English NIS2 Art. 21 / CRA Annex I self-assessment (product evidence and gaps, organisational measures separated, cited…

ParameterTypeDescription
framework
level
out_path
sitestring

compliance_evidence_bundle

[READ][risk=low] Export the audit-evidence bundle (zip) for an auditor. Packages the governance evidence trail into one deterministic zip: audit_rows.jsonl (secrets already redacted upstream), chain_verification.json (SHA-256 hash-chain walk result), rules.yaml (if present), doctor_summary.json (non-probing config/secret-store facts), and manifest.json. Path is validated (no '..' traversal; parent created 0700). Args: out_path: Destination zip path (must end in .zip). since: Optional ISO-8601 floor on the audit row timestamp (inclusive). until:…

ParameterTypeDescription
out_path *string
since
until

historian_push

[WRITE][risk=low][→historian] Push collected telemetry to a national TSDB. Writes already-collected points to a domestic historian (信创) — TDengine or IoTDB — instead of binding InfluxDB. Data egress to the operator's OWN database, NOT a control-system write. Non-numeric points are skipped (numeric value column). Args: points: Collected points — {ref|metric, value|present_value, timestamp?, ...} (e.g. the output of interrogate / integrity_poll / read_points / monitor). sink: 'tdengine' or 'iotdb'. host/port/user/password: TSDB co…

ParameterTypeDescription
points *array
sink *string
databasestring
hoststring
passwordstring
portinteger
userstring

export_data

[READ][risk=low] Export collected samples from the LOCAL SQLite sink to a file. Source is ~/.iaiops/data.db — the local queryable store written by historian_push(sink="sqlite") — NOT a live device read. Writes csv (Excel), sqlite (SQL browser / Power BI) or parquet (pandas/Spark; needs pip install 'iaiops[export]'), and returns the file path + row count with a bounded inline preview (first 200 rows max) so the response never floods. Args: fmt: 'csv' | 'sqlite' | 'parquet'. since/until: Optional ISO-8601 time bounds (inclusive). endpoint: On…

ParameterTypeDescription
fmt *string
endpoint
limitinteger
out_path
since
tag
until

baseline_learn

[READ][risk=low] Learn a conservative per-tag normal band from local history. Source is ~/.iaiops/data.db — the local store written by historian_push(sink="sqlite") — NOT a live device read. Learns robust percentiles (p1/p99 + median/MAD, no ML) from the tag's own samples, segmented at the latest change recorded via baseline_record_change (the band reflects only the post-change regime). REFUSES with an explicit insufficient_data verdict (listing exactly what is missing) below 100 usable samples or under 24h of span — it never invents a band from thin data. On…

ParameterTypeDescription
tag *string
endpoint
since

baseline_check

[READ][risk=low] Check recent local samples against the learned baseline. Reads the last window_s seconds from ~/.iaiops/data.db (no device I/O) and judges them against the stored band. Conservative by design: a violation is reported ONLY when values are beyond p1/p99 by more than 3×MAD AND sustained for >=3 consecutive samples — a single spike is never flagged. Every violation cites the baseline window (from/to ts, n samples), the band values, and the offending samples' timestamps/values. No stored baseline → an explicit no_baseline answer (never a guess). Bo…

ParameterTypeDescription
tag *string
endpoint
window_snumber

baseline_record_change

[READ][risk=low] Record an operator change-log entry for a tag (local only). Writes ONLY local metadata (~/.iaiops/baselines.json, owner-only) — never an OT device write, hence risk=low. A recorded change (setpoint moved, valve replaced, probe swapped) marks a regime boundary: the next baseline_learn uses only samples AFTER the latest change, so the band never mixes pre-change and post-change behavior. This operator change log — not a black-box score — is what makes the baseline trustworthy. Args: tag: Tag whose process changed, e.g. 'line1.temp'.…

ParameterTypeDescription
note *string
tag *string

baseline_status

[READ][risk=low] Baseline status for one tag, or a bounded listing of all. Read from the local store only (no history scan, no device I/O) and never guesses: 'no_baseline' (nothing learned, no refused attempt), 'learning' (last learn refused — still accumulating history), 'ok' (band learned, last check clean), 'violation' (last check flagged a sustained excursion). With no tag, lists every tracked tag (bounded to 100 entries). Args: tag: Optional tag name; omit to list all tracked tags. Returns dict: {tag, status, band?, baseline_window?, changes_record…

ParameterTypeDescription
tag

baseline_learn_contextual

[READ][risk=low] Learn one conservative band per declared context, not one per tag. One band per tag is wrong the moment a tag has more than one normal. A dryer running recipe A at 180 °C and recipe B at 240 °C gets a band spanning both, after which neither regime can go wrong — the band is too wide to catch a real excursion and too mixed to mean anything. OT normal ranges move with shift, product/recipe, and start-up versus steady state. **The context is declared, never inferred** (D16). Each sample carries a label under `context_key`; nothing here guesses wh…

ParameterTypeDescription
samples *array
tag *string
context_keystring
min_samplesinteger
min_span_snumber

baseline_check_in_context

[READ][risk=low] Check readings against the band for ONE declared context. A reading whose context was never learned comes back `unknown_context` and stops there. It is **not** compared against the global band or the nearest one, and that refusal is the entire point of the tool: borrowing a band turns "we have never seen this regime" into "this regime is normal" — a silent pass, in the direction nobody reports. The response lists the contexts that do have bands so the gap is actionable. Otherwise the usual conservative rules apply: a violation needs values beyon…

ParameterTypeDescription
context *string
contextual *object
samples *array
margin_madnumber
sustain_ninteger

historian_query

[READ][risk=low] Query a tag's historical samples from a historian. Reads history back OUT of the store the sinks write — the local SQLite store (~/.iaiops/data.db), TDengine, or IoTDB — so the RCA copilot / an agent can see real pre-incident windows instead of only short live samples. Read-only over the operator's OWN historian; no device I/O. Bounded: rows are capped and a truncation flag is set when more history exists. Args: tag: Tag/metric name as stored by historian_push (e.g. 'line1.temp'). since/until: Optional ISO-8601 time bounds (inclusi…

ParameterTypeDescription
tag *string
endpoint
limitinteger
reader
since
until

historian_coverage

[READ][risk=low] Per-tag history coverage — what history do we actually have. Answers the question every RCA starts with: which tags have stored history, how many rows, and over what time span — per tag {rows, first_ts, last_ts} from the same store historian_push writes. Read-only, bounded (tag list is capped with a truncation flag); no device I/O. Args: reader: 'sqlite' | 'tdengine' | 'iotdb'. Omit to use the per-site 'historian:' block in ~/.iaiops/config.yaml, else the local sqlite store. TSDB readers need their extra: pip install ia…

ParameterTypeDescription
limitinteger
reader

stream_publish

[READ][risk=low] Publish already-read normalized points to a message bus (NATS). Egress of data the agent already READ — NOT a control write. Each numeric point becomes a JSON message on ``<subject_prefix>.tag.<metric>``; non-numeric points are skipped (use a historian sink for text/state). Needs the extra: pip install iaiops[nats]. Args: points: Collected point dicts (e.g. from *_read_many): {ref/metric, value, timestamp, ...}. subject_prefix: NATS subject root (default 'iaiops'). servers: Comma-separated NATS server URLs (default nats://localhost:4…

ParameterTypeDescription
points *array
publisherstring
serversstring
subject_prefixstring
tlsboolean
tokenstring

uns_publish

[READ][risk=low] Publish already-read normalized points to an MQTT broker / UNS. Egress of data the agent already READ — NOT a control write. Each numeric point becomes a JSON message on ``<topic_prefix>/<metric>``, with a dotted metric nested into topic levels (``line1.temp`` -> ``plant/line1/temp``) so a Unified Namespace stays browsable. Non-numeric points are skipped (use a historian sink for text/state). The topic is always derived from ``topic_prefix`` — it is never taken verbatim, so this cannot address a command topic. Needs the extra: pip install iaiops[mq…

ParameterTypeDescription
points *array
hoststring
passwordstring
portinteger
qosinteger
retainboolean
topic_prefixstring
use_tlsboolean
usernamestring

stream_publish_event

[READ][risk=low] Publish one computed event (RCA verdict / alarm) to a message bus (NATS). Egress of a finding the brain already COMPUTED — e.g. an RCA verdict or an alarm episode — to ``<subject_prefix>.<subject>`` as JSON. NOT a control write. Needs: pip install iaiops[nats]. Args: subject: Event subject suffix (e.g. 'rca.verdict', 'alarm.flood'). event: The event payload dict (published as JSON). servers/token/tls/subject_prefix/publisher: bus connection (see stream_publish). Returns dict: {publisher, subject, published}. Example: stream_p…

ParameterTypeDescription
event *object
subject *string
publisherstring
serversstring
subject_prefixstring
tlsboolean
tokenstring

rca_narrate

[READ][risk=low] Narrate a cited RCA verdict in plain language via an on-box LLM. Air-gapped: hands the already-computed, already-cited verdict to a LOCAL model (Ollama) that ONLY rephrases it — it never adds a cause, number, or citation (strict prompt; see docs/RCA.md). Read-only; no device I/O. Needs the extra + a running local model: pip install iaiops[ollama]. Args: verdict: An RCA verdict dict (e.g. the output of downtime_root_cause). base_url: Ollama server URL (default http://localhost:11434). model: Local model name (default 'llama3.1').…

ParameterTypeDescription
verdict *object
base_urlstring
modelstring
providerstring

fleet_status

[READ][risk=low] Roll up per-site status reports into one fleet health view. The tier above data_quality_fleet_rollup (per-endpoint within one site): this aggregates across many edge SITES for central management. A site is 'offline' if its last_seen is older than stale_after_s; fleet_status is the worst site status present. Read-only, pure; no device I/O. Args: sites: Per-site reports, each [{site, location?, profile?, status?, score?, issues?, last_seen?}]; status ∈ ok|degraded|critical|offline (else derived from score); score 0..1.…

ParameterTypeDescription
sites *array
now
stale_after_snumber

fleet_incidents

[READ][risk=low] Roll up active RCA incidents across sites → fleet-wide top causes. Aggregates the incidents each site reports into a fleet picture: how many incidents, which sites are affected, and the most common root causes across the whole fleet. Read-only; no device I/O. Args: sites: Per-site reports carrying incidents: [{site, incidents:[{cause|primary_cause, confidence?}]}]. Returns dict: {total_incidents, sites_with_incidents, affected_sites[], top_causes[]}. Example: fleet_incidents(sites=[{"site":"plant-sh","incidents":[{"cause":"network"…

ParameterTypeDescription
sites *array

pdm_forecast

[READ][risk=low] Forecast a value's trend + time until it crosses a warn/alarm limit. The predictive step above baseline_check (which flags a violation that already happened): fits a robust Theil-Sen trend to the recent history and, if it continues, estimates the ETA to the nearest limit in the direction of travel — the early warning that makes maintenance predictive (inverter/turbine degradation, bearing drift, filter clogging). Refuses thin history; read-only, pure over the provided series; no device I/O. Beyond the trend, the result deepens into three explainable…

ParameterTypeDescription
series *array
alarm_high
alarm_low
imminent_within_snumber
include_waveformboolean
warn_high
warn_low

downtime_triage

[READ][risk=low] One-call downtime triage: first-look alarm + RCA cause + precursors. Answers the operator's three simultaneous questions on a stopped line — which alarm to look at first, the likely cause, and whether anything warned us — then cross-checks whether the first-out alarm agrees with the RCA verdict. Composes alarm_cascade + downtime_root_cause + pdm_forecast over ONE incident; every field traces to a sub-report echoed under 'cascade'/'rca'/ 'precursor_forecasts'. Read-first and advisory: it proposes but executes nothing. Thin evidence downgrades ho…

ParameterTypeDescription
window *object
alarms
cascade_window_snumber
cause_weights
dataflow
imminent_within_snumber
include_graphboolean
lead_window_snumber
precursors
state_series
tags

plc_program_outline

[READ][risk=low] Structural outline of an EXPORTED PLC program file. Parses one exported text file (Siemens SCL/ST .scl/.st, AWL/STL .awl, Rockwell Studio 5000 .L5X — .txt is content-sniffed) and returns blocks (FB/FC/OB/DB/routines/AOIs) with VAR sections, IF/CASE branch inventory, timers/counters, and the call graph. Never uploads from a live PLC; reads exactly the named file (≤5 MB). Every element cites source_file + line (rung number for L5X ladder) — quote those citations when explaining. Malformed sections degrade to entries in parse_errors, never a cra…

ParameterTypeDescription
path *string

plc_program_xref

[READ][risk=low] Cross-reference one symbol in an exported PLC program. Finds every read/write/call/declare site of a symbol or absolute address (e.g. Motor_Run, "FB_Conveyor", DB10.DBX0.1, M0.0, Tank[2].Level) in one exported file, quoting the surrounding source line verbatim so the agent cites real code. Access classification is heuristic (op/regex based, not data-flow analysis): SCL ':='→write, '('→call; AWL T/=/S/R→write, L/A/O…→read, CALL→call; L5X OTE/OTL/OTU/RES and MOV-dest→write. For L5X, line is the rung number. Args: path: Expo…

ParameterTypeDescription
path *string
symbol *string

plc_program_section

[READ][risk=low] Source text of ONE named block from an exported program. Returns the exact source of a single block (FB/FC/OB/DB name for SCL/AWL; Program.Routine or routine name for L5X — rungs are rendered as '[rung N] ...'), capped at 200 lines with an explicit truncated flag, so the agent reads exactly the section it is explaining instead of guessing. Unknown block names fail with the list of available blocks. Args: path: Exported program file (.st/.scl/.awl/.l5x/.txt; must exist, ≤5 MB), under $IAIOPS_HOME, the config dir or an IAIOPS_AGE…

ParameterTypeDescription
block *string
path *string

plc_program_visibility

[READ][risk=low] Maintainability / operational-risk profile of a legacy PLC program. The "what am I inheriting?" view over one EXPORTED program (SCL/ST, AWL/STL, Rockwell L5X): folds the structural outline into documentation coverage, the least-commented blocks, blocks nothing references (possible dead code), the complexity hotspots, risky constructs (unconditional JMPs, retentive RTO timers, loops), and a TRANSPARENT additive risk score whose every point cites its reason. Structural only — it anchors an engineer's review of a line somebody else left behind, not…

ParameterTypeDescription
path *string

plc_program_snapshot

[READ][risk=low] Record an exported program's structure as a change baseline. A control program is a controlled document, and the usual way an undocumented change to one gets noticed is that somebody remembers. This gives the comparison a number: the file's SHA-256, plus a per-block structural fingerprint (name/kind/language, declared variables, calls, branch conditions, timers) that deliberately excludes line numbers, comments and block order — so adding a comment at the top of a file does not report the whole program as changed. Stored locally under the iaiops…

ParameterTypeDescription
path *string
labelstring
name
notestring

plc_program_drift

[READ][risk=low] Has this program changed since its approved snapshot, and what moved? Three verdicts, and the wording of each is load-bearing. **identical** means the same SHA-256 and nothing else earns the word. **logic_changed** means the extracted structure differs — reported per block, naming which categories (variables / calls / branches / timers_counters) moved. **changed_outside_ extracted_structure** means the bytes differ while every block fingerprint matched: usually comments or formatting, but these parsers extract structure rather than parse a gramma…

ParameterTypeDescription
path *string
against
name

plc_program_history

[READ][risk=low] Tracked programs, or one program's snapshot history. Local read of the program-baseline store — no file is parsed and no device is touched. Nothing is ever pruned automatically: a change-control history that quietly drops last quarter's baseline is worse than one that grows, and a stored row is block names, hashes and counts rather than source. Removing history is a deliberate act and is CLI-only (`iaiops program forget`) — deleting change-control evidence should not be one tool call away. Args: name: Tracked program name. Omit for the…

ParameterTypeDescription
name

plc_program_xref_config

[READ][risk=low] Join an exported program's addresses with one endpoint's configured points. Answers "which program symbol is that point on the line?" by **exact address match only** — never by name. A configured label that reads like a program symbol, or a ref one character from a tag, is NOT a match (semantics are given by a person, never guessed). Comparable pairs: Siemens AWL / .scl × an ``s7`` endpoint (area, DB, byte, bit and width must all agree) and Rockwell L5X × a Logix ``ethernetip`` endpoint (the tag path is the CIP address). Every other pair return…

ParameterTypeDescription
endpoint *string
path *string
liveboolean

investigation_readiness

[READ][risk=low] How far into an investigation this site could get, and what each gap needs. `readiness` answers "which scenarios can this site run"; this answers the next question down — if something stopped tomorrow, how many of the eight evidence steps could actually be walked, and for each one that could not, what is missing. Contacts nothing: no device, no network, no historian. It is derived from the config and the local store, which is what makes it usable on a site nobody has been authorised to probe yet. Each gap says whether it is *unmet* (you hav…

ParameterTypeDescription
sitestring

investigation_open

[READ][risk=low] Open an investigation over one past window and walk what can be walked. Contacts no device — the window is already past, and its evidence is whatever was collected at the time. Each of the eight steps records its own outcome: `done` (it ran, here is what it found), `refused` (it could not run HERE — no samples, no alarm source; a site fact) or `not_possible` (this product cannot do it at all). The investigation is persisted, so it can be re-read and advanced later.

ParameterTypeDescription
end *string
endpoint *string
start *string
assetstring
sitestring

investigation_show

[READ][risk=low] Re-read a saved investigation — the state it was left in.

ParameterTypeDescription
investigation_id *string

investigation_list

[READ][risk=low] List saved investigations, newest first.

ParameterTypeDescription
site

line_relation_declare

[READ][risk=low] Record that one asset feeds another — the second RCA axis. `[READ]` follows this repo's convention, where the tag is about PLANT state: it touches no device, exactly like `baseline_record_change` and `adopt_alias_map`, which are the same shape. It does write — a declaration about the line, into the site knowledge base. With time alone, an upstream stoppage produces a string of equally-confident downstream false causes, because on a line downstream co-occurrence is guaranteed whatever the cause. That guarantee is exactly why this is a decla…

ParameterTypeDescription
by *string
downstream *string
upstream *string
sitestring

line_relations_list

[READ][risk=low] The declared line order for a site, and what each asset feeds.

ParameterTypeDescription
sitestring

mechanism_library_check

[READ][risk=low] What a mounted fault-mechanism library says about one candidate cause. Three answers, and the difference between the first two is the whole point: * ``nothing_known`` — the library has never heard of this cause. **Not** "no objection": a knowledge base that knows nothing about something has not cleared it. * ``known``, not excluded — mechanisms for it apply here, with what would confirm each. * ``known``, excluded — every mechanism for it is inapplicable to this equipment, so the candidate can be ruled out. That is the strong mov…

ParameterTypeDescription
cause *string
protocolstring
sitestring

mechanism_library_list

[READ][risk=low] The fault mechanisms mounted for a site, and where each came from.

ParameterTypeDescription
sitestring

verify_determinism

[READ][risk=low] Prove this engine's analysis is reproducible without a model. Runs a named suite of analyses (availability, production counts, the Six Big Losses, ISA-18.2 alarm load, control charts, the conservative baseline, the RCA copilot) over a pinned reference dataset, canonically encodes each result and digests it — twice in this process and, with ``subprocesses``, once more in each of two fresh interpreters started at different PYTHONHASHSEED values. That last arm is the one that catches a set or dict iteration order reaching a result; a single run neve…

ParameterTypeDescription
subprocessesboolean

iec104_connection_info

[READ][risk=low] Connect and report IEC-104 link status + discovered stations. Args: endpoint: Endpoint name from config (protocol 'iec104'); omit for default. Returns dict: {endpoint, host, port, connected, configured_common_address, station_count, common_addresses[]}. Example: iec104_connection_info(endpoint="rtu1").

ParameterTypeDescription
endpoint

iec104_interrogate

[READ][risk=low] General interrogation: all monitored points of a station (ASDU CA). Args: common_address: ASDU common address; omit for the configured/first station. endpoint: Endpoint name from config (protocol 'iec104'). Returns dict: {endpoint, common_address, point_count, points:[{io_address, type, value, quality, recorded_at}]}. Example: iec104_interrogate(common_address=1, endpoint="rtu1").

ParameterTypeDescription
common_address
endpoint

iec104_read_point

[READ][risk=low] Read one monitored point by information-object address (IOA). Args: io_address: The point's information-object address (IOA). common_address: ASDU common address; omit for the configured/first station. endpoint: Endpoint name from config (protocol 'iec104'). Returns dict: {endpoint, common_address, found, io_address, type, value, quality, recorded_at}. Example: iec104_read_point(io_address=1001, common_address=1, endpoint="rtu1").

ParameterTypeDescription
io_address *integer
common_address
endpoint

dnp3_integrity_poll

[READ][risk=low] Class 0/1/2/3 integrity poll → the outstation's database. Returns all static points grouped by measurement type (binary_input, analog_input, counter, …). Args: endpoint: Endpoint name from config (protocol 'dnp3'). Returns dict: {endpoint, outstation_address, point_count, by_type{}, points:[{type, group, index, value, quality, timestamp}]}. Example: dnp3_integrity_poll(endpoint="rtu2").

ParameterTypeDescription
endpoint

iec61850_device_directory

[READ][risk=low] List the IED's logical devices (optionally their children). Args: include_children: Also browse each logical device's immediate model children. endpoint: Endpoint name from config (protocol 'iec61850'); omit for default. Returns dict: {endpoint, logical_device_count, logical_devices:[{logical_device, children[]?, child_count?}]}. Example: iec61850_device_directory(include_children=True, endpoint="ied1").

ParameterTypeDescription
endpoint
include_childrenboolean

iec61850_browse

[READ][risk=low] Browse immediate model children under a reference (LD/LN/DO). Args: reference: Model reference, e.g. 'IED1LD0' or 'IED1LD0/LLN0'. endpoint: Endpoint name from config (protocol 'iec61850'). Returns dict: {endpoint, reference, child_count, children[]}. Example: iec61850_browse(reference="IED1LD0/MMXU1", endpoint="ied1").

ParameterTypeDescription
reference *string
endpoint

iec61850_read

[READ][risk=low] Read one data attribute by object-reference + functional constraint. Args: reference: Data-attribute object reference, e.g. 'IED1MMXU1.TotW.mag.f'. fc: Functional constraint — MX (measurands), ST (status), CF (config), … endpoint: Endpoint name from config (protocol 'iec61850'). Returns dict: {endpoint, reference, fc, value, error}. Example: iec61850_read(reference="IED1MMXU1.TotW.mag.f", fc="MX", endpoint="ied1").

ParameterTypeDescription
reference *string
endpoint
fcstring

substation_event_analysis

[READ][risk=low] Analyse a substation Sequence-of-Events for protection selectivity. Pure structural analysis over INJECTED events (no live protocol I/O, no endpoint): given relay pickups/trips, breaker open/close, lockouts and bus undervoltage with ISO-8601 timestamps, decide what tripped and whether protection coordinated — a selective trip (one zone contained), a non-selective backup operation (wider outage), or a breaker failure. Monitor-only, advisory, cite-first (every claim ties to a timestamped event). Args: events: SOE list of {ref, timestamp (I…

ParameterTypeDescription
events *array
backup_margin_snumber
breaker_fail_window_snumber