Optimizer, second user of the contract (categories, scripts/data.py); labels and data from the labeling and aimsight-data repositories

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
maximeandClaude Opus 5.5 committed 2026-11-13 17:01:14 +01:00
1 parent 388619685a
commit 21a35d90aa
3 files changed
+6 -4

No files matched your search

+4 -2
View File
@@ -7,7 +7,9 @@ AIMsight anomaly detectors (Python 3, standard library only) and the Claude Code
- One detector per family, in `scripts/`: `visibility.py`, `obstruction.py`, `target_issue.py`, `thermal_displacement.py`, `no_data.py`, `displacement.py` (D-119). `categories.py` loads every `scripts/*.py` that has `detect`: never put another script with a `detect` function, or with side effects at import, directly in `scripts/`; tools go in `skills/wf-improve/scripts/`.
- `detect(measurements)` returns episodes with the keys `start`, `end`, `kind` (the family), `label` (the variety), `text`, `ignore`, `sensors`. A detector may also declare `temperature`, `camera`, `metrics` (`categories.CONTEXT`) or `end`; `categories.events` passes them by introspection.
- Label files are external data and keep their French keys: `debut`, `fin`, `categorie`, `description`.
- Diagnostic-app uses this repository as its `detectors/` submodule: `categories.events`, `categories.CATEGORIES` (`process`: `images`, `none`, `check`), the `--from/--to` CLIs, `/detectors:wf-improve`. A rename here needs the matching change there.
- Two repositories use this one as their `detectors/` submodule; a rename here needs the matching change there:
- Diagnostic-app: `categories.events`, `categories.CATEGORIES` (`process`: `images`, `none`, `check`), the `--from/--to` CLIs, `/detectors:wf-improve`;
- Optimizer (`batch.py`): `categories.events`, `categories.CATEGORIES`, and from `scripts/data.py` `load`, `load_temperature`, `is_reference`, `rejected`, `parse_time`, `iso`.
## The workflow stays generic
@@ -17,5 +19,5 @@ AIMsight anomaly detectors (Python 3, standard library only) and the Claude Code
- A constant added or changed updates `thresholds.md` in the same change; check with `grep -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 skills/wf-improve/scripts/regression.py --labels <labels folder> --data <data folder>` (Diagnostic-app: `labeling/auto`, `data`; about 3 min). A refactoring must leave every figure unchanged.
- A change to a detector is checked with the benchmark: `python3 skills/wf-improve/scripts/regression.py --labels <labels folder> --data <data folder>` (Diagnostic-app and Optimizer: `labeling/auto`, `data`, links to the shared `~/labeling` and `~/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.
+1 -1
View File
@@ -54,4 +54,4 @@ python3 skills/wf-improve/scripts/score.py <station folder> --labels <labels.jso
python3 skills/wf-improve/scripts/regression.py --labels <folder of <STATION>.jsonl> --data <folder of <STATION>/>
```
Copied from Support-Agent on 2026-11-13 (commit 48a3092); the detectors now evolve here. Used by Diagnostic-app, where it is the `detectors/` submodule.
Copied from Support-Agent on 2026-11-13 (commit 48a3092); the detectors now evolve here. Used by Diagnostic-app and Optimizer, where it is the `detectors/` submodule; their labels come from the `labeling` repository, their data from `aimsight-data`.
+1 -1
View File
@@ -1,6 +1,6 @@
"""Reading a station folder (standard library only). Every time is UTC.
Column formats: labeling/connaissances/colonnes-des-deplacements.md in Diagnostic-app.
Column formats: connaissances/colonnes-des-deplacements.md in the labeling repository.
"""
import csv
import glob