Files
aimsight-detectors/CLAUDE.md
T
maximeandClaude Opus 5.5 388619685a Review fixes; README and CLAUDE.md finalised
- cancel reverts only the run's commits (base..HEAD), never the caller's edits
- validator diffs base..HEAD, not the working tree
- fix commits carry their Co-Authored-By line; no redundant end benchmark
- score.py: clear error on a missing labels file; docstring says end is not passed
- usage lines; README and CLAUDE.md for the generic workflow

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 12:45:14 +01:00

22 lines
2.3 KiB
Markdown

# detectors
AIMsight anomaly detectors (Python 3, standard library only) and the Claude Code plugin that improves them (`/detectors:wf-improve`). 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.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.
## The workflow stays generic
`skills/wf-improve/SKILL.md` and `agents/` describe only the workflow (range + labels → upgrader → validator → summary). Everything specific to a caller (its paths, its files, its git rules, where the summary goes) is given in the request at launch, never written here. The tools take their paths as arguments.
## Rules
- 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.
- 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.