Optimize: /optimize, the detectors and the tools from one analysis (ex /improve)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
maximeandClaude Opus 5.5 committed 2026-11-16 14:13:38 +01:00
1 parent 63bebbc415
commit 68768dfd39
7 files changed
+299 -107

No files matched your search

+12 -14
View File
@@ -1,20 +1,20 @@
# Optimizer
The optimisation of the AIMsight detectors, on the labels of `labeling/auto`, and nothing else. On the range of an in-depth analysis (made in the Diagnostic-App app), its labels as the truth, the `improve` skill:
The optimisation of the AIMsight detectors and of the reading tools, from one analysis, and nothing else. An analysis (made in the Diagnostic-App app by the analyst) leaves in its folder the two things needed: its labels, the truth on its range, and its own scripts with what it missed. On that analysis, the `optimize` skill:
1. measures the detectors' score on the range, and the benchmark on every label of `labeling/auto`;
2. has the detectors fixed by the `upgrader`, one fix per commit in `~/detectors`;
3. has them judged by the `validator`, which keeps, has some removed, or cancels: no station goes back, no overfitting;
4. writes the summary of the session.
1. **the detectors**: measures their score on the range, and the benchmark on every label of `labeling/auto`; has them fixed by the `upgrader`, one fix per commit in `~/detectors`; has them judged by the `validator`, which keeps, has some removed, or cancels: no station goes back, no overfitting;
2. **the tools**: has the `tool-builder` bring the analyst's useful scripts into the reading harness, commits in `~/tools`; always, whatever the detectors gave;
3. writes the summary of the session.
The `upgrader` and the `validator` come from the `agents` repository; the benchmark (`bench/`) from the `detectors` repository. Nothing is pushed.
The `upgrader`, the `validator` and the `tool-builder` come from the `agents` repository; the benchmark (`bench/`) from the `detectors` repository. Nothing is pushed.
## Install
```bash
ln -s ~/detectors detectors # the detectors, shared with Diagnostic-App
ln -s ~/tools tools # the reading tools, shared with Diagnostic-App
ln -s ~/aimsight-data/data data # the pumped data, out of git
ln -s ~/labeling labeling # the labels: the truth and the families
ln -s ~/labeling labeling # the labels, the analyses and the families
ln -s ~/agents agents # the generic agents (Claude Code plugin)
```
@@ -22,21 +22,19 @@ ln -s ~/agents agents # the generic agents (Claude Code p
## Run
From the "Optimize the detectors" button of Diagnostic-App, on a finished analysis; or by hand, from the root of Optimizer:
From the "Optimize" button of Diagnostic-App, on a finished analysis; or by hand, from the root of Optimizer:
```bash
env -u ANTHROPIC_API_KEY claude -p "/improve DETECTORS: detectors/. STATION: data/NORDEND. FROM: 2026-11-04. TO: 2026-11-08. \
LABELS: labeling/auto/NORDEND.jsonl. REFERENCE: --labels labeling/auto --data data. FAMILIES: labeling/families.md. \
CONTEXT: labeling/auto/analyses/<analysis>/report.md. OUT: sessions/<analysis>_<YYYYMMDDTHHMMZ>/." \
--plugin-dir agents --add-dir ~/detectors --add-dir ~/labeling --add-dir ~/aimsight-data/data \
env -u ANTHROPIC_API_KEY claude -p "/optimize ANALYSIS: labeling/auto/analyses/<analysis>/. OUT: sessions/<analysis>_<YYYYMMDDTHHMMZ>/." \
--plugin-dir agents --add-dir ~/detectors --add-dir ~/tools --add-dir ~/labeling --add-dir ~/aimsight-data/data \
--setting-sources project,local --strict-mcp-config \
--allowedTools Read,Write,Edit,Bash,Agent --permission-mode acceptEdits
```
`TO` is excluded. Several stations on the same range: `DATA: data. STATIONS: A,B. LABELS: <folder of <STATION>.jsonl>` instead of `STATION` and a labels file.
The station and the range come from the analysis's `request.json` (the range's last day included); the labels from `labeling/auto/<STATION>.jsonl`; the context from its `report.md`. `DETECTORS`, `TOOLS`, `DATA`, `LABELS`, `FAMILIES` can be overridden in the request.
## What a session leaves
`sessions/<analysis>_<time>/`: the measures before and after (`range-*.txt`, `benchmark-*.txt`), `modification.md` (the upgrader), `validation.md` (the validator), `summary.md` (the summary, shown by the app under the analysis report), `tools/` (the scripts the agents wrote). The fixes: `improve: S<n>` commits in `~/detectors`, on its current branch.
`sessions/<analysis>_<time>/`: the measures before and after (`range-*.txt`, `benchmark-*.txt`), `modification.md` (the upgrader), `validation.md` (the validator), `tools.md` (the tool-builder) and its trials (`work/`), `summary.md` (the summary, shown by the app under the analysis report), `tools/` (the scripts the upgrader and validator wrote). The fixes: `improve: S<n>` commits in `~/detectors`, the tools a `Tools: <analysis>` commit in `~/tools`, each on its current branch.
`archive/`: the former daily batch and its scanner (auto-labeling by the detectors), stopped on 2026-11-16. The architecture of the repositories: `~/Diagnostic-App/docs/architecture.drawio`.