Skip to content

MES Watch (mes-watch@1)

MES Watch screens one collection's own MES and production data, read through the data shapes its context model maps (section 7.6), with plain statistics, and sends only what they flag to the writer. It reads the last days (default 90) of every mapped shape on each run; a shape that is not mapped skips its checks, a shape that fails to read is named in each finding's evidence and text, and a run fails only when no shape can be read. Every flagged pattern is filed even if the writer leaves it out (the finding then carries the check's own text). A finding's id holds its slice (stop reason and shift, check name, measurement name) and no date, so the next run lands on the same row, and a pattern a run no longer sees is resolved.

{ "template": "mes-watch@1", "enabled": true, "collections": ["cell"],
  "triggers": [ { "type": "cron", "expr": "0 6 * * *" } ],
  "params": { "days": 90, "shiftStarts": ["06:00", "14:00", "22:00"], "maxFindings": 12,
              "thresholds": { "stopRatio": 1.8, "stopZ": 4.0 } } }
Check (family) What it flags Default thresholds (params.thresholds)
Stop rate by slice (mes-stop-rate) an unplanned stop reason more frequent per running hour in one shift, one product (from counts) or one hour of the day (weekday or weekend) than in the rest of the asset's running time; log rate-ratio z with 0.5 continuity; evidence gives the peers' ratio the reason ≥ 15 stops in all (stopReasonMinStops), the slice ≥ 15 stops (stopSliceMinStops) and ≥ 8 run hours (stopSliceMinRunHours), ratio ≥ 1.8 (stopRatio), z ≥ 4.0 (stopZ)
Planned-stop duration by shift (mes-planned-duration) a planned stop (same reason) that lasts longer on one shift than on the others; log-duration mean z each side ≥ 10 stops (plannedMinStops), z ≥ 4.0 (plannedZ), median ratio ≥ 1.4 (plannedMedianRatio)
Performance stretch (mes-performance) days in a row where ideal minutes (units ÷ counts.idealRate, units per minute) over running minutes sit below the asset's median days under 240 run minutes skipped (perfMinRunMinutes), ≥ 10 days (perfMinDays), ≥ 4 days in a row (perfMinStretchDays) below the median by 0.07 (perfDrop)
Waste after planned stops (mes-waste-after-stop) waste rate in the count buckets touching the 20 minutes after a planned stop ends, against the rest, compared with the other assets 20 minutes (wasteAfterMinutes), ≥ 3 assets (wasteMinAssets), ≥ 100 units in the after windows (wasteMinAfterUnits), the asset's ratio ≥ 1.5 × the peers' median ratio (wastePeerRatio)
Check failures by week (mes-check-failures) a check (asset + name) failing more in one of the last weeks than in the checks before them last 3 weeks (checkWeeks); baseline = checks more than 13 days before the end (checkBaselineGapDays), ≥ 100 (checkBaselineMin); the week ≥ 5 fails (checkMinFails), ≥ 5% failing (checkMinRate), z ≥ 4.0 (checkZ)
Measurement drift (mes-drift) a measurement whose daily mean left its normal range in the last days; onset walks back to the last day within 2 sd ≥ 40 days (driftMinDays); the last 21 days (driftRecentDays) tested against the daily means before them; ≥ 3 days (driftMinDaysOut) beyond 4 sd (driftSd); onset 2 sd (driftOnsetSd)

Days, hours, shifts and weekends are plant time; shifts come from shiftStarts (default 06:00, 14:00, 22:00). A period is running when its state is one of the collection's costs.runningStates (default Running); any other period is a stop, planned when its planned column is true (else when its category is "Planned"). Raw stop-rate flags are consolidated: an hour inside a flagged shift on the same asset and reason is folded into the shift; adjacent flagged hours become one window; the same reason, day type and overlapping window on two or more assets is one plant-level finding (its subject is the collection) naming every asset. Findings rank by impact in minute-equivalents (excess stops × their mean length, excess planned minutes, lost output minutes, excess rejects × minutes per unit; 5 minutes per excess failed check and 60 per drifted day, until these are costed) and a run keeps the maxFindings largest (default 12, 1–50). Ninety days of 5-minute counts is about 26,000 rows per asset: raise read.shapeRowCap (section 6.2) above the collection's rows, or a read keeps only the newest rows and every finding says it was partial.

Readings against stop hours (mes-stop-link). For each asset and unplanned reason (not "Unknown Stop") with at least linkMinStopHours (40) stop hours — plant clock hours holding at least linkStopMinutes (5) of that reason's stops — MES Watch compares the hourly mean of every measurement on the asset and on every related asset (the from of a feeds relation to it, either side of sharesUtility) between those hours and the asset's other hours (at least linkOtherRunMinutes, 45, running and no such stop). It reports a reading at |z| ≥ linkZ (6) and |effect| ≥ linkEffectSd (0.25 sd of the other hours), at least linkMinHours (30) a side, with both means. A measurement whose mean differs by more than linkRateLikeSd (0.5) sd between the measured asset's hours running at least 45 minutes and under 30 (line speed, flow) moves with running itself and is dropped first. A link on an asset and reason with a stop-rate finding is attached to that finding's evidence (links); otherwise it is its own finding. A reading that moves with stops points at a shared cause; it does not prove one.

Saved rules. A Real issue verdict on an MES Watch finding saves its check as a rule. While the latest verdict on that pattern is a confirm — followed back through the pattern's reappearances; a later Not an issue, Wrong or Known withdraws it — the next run files the pattern from MES Watch's own text, stored as confirmed, with "Filed from a saved rule" in its why, and does not send it or its evidence to the writer. A run whose every finding is covered calls no model and costs nothing. The rule is the confirmed finding itself: nothing is added to the context model, and removing a rule is a verdict.

Effect sizes and guards. Every finding's evidence carries effectSize, effectKind and effectText (a rate ratio; a median duration ratio; performance points below the median; the ratio over the peers' median; fail-rate points above the baseline; the shift in normal day-to-day variation), and a pattern with no effect size is not filed. Findings of equal impact rank by effect size, never by z: on low-noise data z grows without bound while the effect stays small. Floors on spread keep near-constant data honest: the daily-mean sd used for drift is at least driftMinSdPct (0.2) percent of the baseline mean, each side's log-duration sd at least plannedMinLogSd (0.05), the baseline fail rate in the z at least checkMinBaselineRate (0.005), and the rest waste rate in the ratio at least wasteMinRestRate (0.002). Every stop-rate finding reports tests (the run's slice tests) and qValue, its Benjamini–Hochberg false-discovery rate over them. Watch tier ("watchTier": true, off by default): a slice under the main thresholds with at least watchMinStops (5) stops, z ≥ watchZ (2.5), the main ratio and run hours, on an asset and reason with no main finding, is filed as mes-stop-watch ("Watch: …") only when its q is at most watchFdr (0.05, at most 0.5). Without that control a watch tier is mostly chance (on one plant's data: 1 of 7 real on 14 days, 0 of 15 on 90), so it has no switch to run without it.