2.5 KiB
2.5 KiB
detectors
AIMsight anomaly detectors (Python 3, standard library only) and their benchmark (bench/); nothing else. They are improved by Optimizer (improve skill) with the upgrader and validator of the agents repository. Everything is in English: code, identifiers, docs, outputs. Layout and usage: README.md.
Contract (do not break)
- One detector per family, in
scripts/:visibility.py,obstruction.py,target_issue.py,thermal_displacement.py,no_data.py,displacement.py(D-119).categories.pyloads everyscripts/*.pythat hasdetect: never put another script with adetectfunction, or with side effects at import, directly inscripts/; tools go inbench/. detect(measurements)returns episodes with the keysstart,end,kind(the family),label(the variety),text,ignore,sensors. A detector may also declaretemperature,camera,metrics(categories.CONTEXT) orend;categories.eventspasses them by introspection.- Label files are external data and keep their French keys:
debut,fin,categorie,description. - Two repositories use this one through a
detectors -> ~/detectorslink (one copy on the workstation: a commit here is live for both at once); a rename here needs the matching change there:- Diagnostic-app:
categories.events,categories.CATEGORIES(process:images,none,check), the--from/--toCLIs,bench/score.py(the command shown in the page); - Optimizer (
improveskill and its agents):scripts/categories.py --from/--to,bench/(score.py,regression.py,sensors.py); its upgrader changesscripts/*.pyandthresholds.md, one commit per fix.
- Diagnostic-app:
Rules
- A constant added or changed updates
thresholds.mdin the same change; check withgrep -nE "^[A-Z_0-9]+ = " scripts/*.py. - No rule specific to a station, a sensor or a date.
- A change to a detector is checked with the benchmark:
python3 bench/regression.py --labels <labels folder> --data <data folder>(Diagnostic-app and Optimizer:labeling/auto,data, links to the shared~/labelingand~/aimsight-data/data; about 3 min). A refactoring must leave every figure unchanged. - History references in docstrings and
thresholds.md("wf-improve X, mod. 1, S2", "X, batch 01", D-xxx, E-xxx) point to past runs and to decisions recorded in Diagnostic-app/Support-Agent; keep them when editing a rule. - The bench tools take their paths as arguments; the architecture of the repositories:
~/Diagnostic-App/docs/architecture.drawio.