Compare commits

..
4 Commits
6 changed files with 132 additions and 25 deletions

No files matched your search

+9 -9
View File
@@ -1,12 +1,12 @@
---
name: optimize
description: Workflow that, from one analysis (its labels as the truth on its range, its scripts and what it missed), optimises the detectors — the upgrader fixes, the validator judges; detectors a little better on the range without going back elsewhere (benchmark on a reference truth), or unchanged — then the reading tools — the tool-builder brings the analyst's useful scripts into them. The caller gives the analysis, the output folder and any specific context. Run from Optimizer's root with the agents plugin (--plugin-dir <agents>). /optimize <request>.
description: Workflow that, from one analysis (its labels as the truth on its range, its scripts and what it missed), optimises the detectors — the upgrader fixes, the validator judges; detectors a little better on the range without going back elsewhere (benchmark on a reference truth), or unchanged — then the reading tools — the upgrader brings the analyst's useful scripts into them. Each agent gets its instructions from `instructions/`. The caller gives the analysis, the output folder and any specific context. Run from Optimizer's root with the agents plugin (--plugin-dir <agents>). /optimize <request>.
argument-hint: "ANALYSIS: <analysis folder>. OUT: <output folder>. [context]"
---
# optimize: the detectors and the tools, from one analysis
You are the orchestrator. An analyst has analysed a range of a station; its folder holds its labels (the truth on this range), its report, its analysis and its own scripts. Two parts follow, in this order. **Part 1, the detectors** (the detectors repository, `DETECTORS`: `scripts/`, `thresholds.md`): you run the upgrader, which fixes them, then the validator, which judges the fixes against overfitting, and you return detectors **a little better on the range without going back elsewhere**, or unchanged. **Part 2, the tools** (the reading harness, `TOOLS`): you run the tool-builder, which brings what the analyst needed into the tools. **You judge nothing yourself**: you only read the verdict lines. **You ask no question**: the workflow runs alone to the end.
You are the orchestrator. An analyst has analysed a range of a station; its folder holds its labels (the truth on this range), its report, its analysis and its own scripts. Two parts follow, in this order. **Part 1, the detectors** (the detectors repository, `DETECTORS`: `scripts/`, `thresholds.md`): you run the upgrader, which fixes them, then the validator, which judges the fixes against overfitting, and you return detectors **a little better on the range without going back elsewhere**, or unchanged. **Part 2, the tools** (the reading harness, `TOOLS`): you run the upgrader on them, which brings what the analyst needed into the tools. **You judge nothing yourself**: you only read the verdict lines. **You ask no question**: the workflow runs alone to the end.
## Inputs
@@ -37,20 +37,20 @@ The measures of a step: `<range score> > <OUT>/range-<step>.txt 2>&1` and `<benc
## Git
The fixes are commits in `DETECTORS`, one per fix, so that the validator can have one removed. Note the **base**: `git -C <DETECTORS> rev-parse HEAD`. Files already modified (`git -C <DETECTORS> status --porcelain`) stay as they are, neither committed nor reverted; list them in the summary and pass them to the upgrader. Always commit by path (`git -C <DETECTORS> commit -m "<message>" -- <paths>`), never `git add -A`, `git stash` or `git checkout` outside your paths: another session may be working there. Each message ends with an empty line then `Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>`. The tool-builder commits in `TOOLS` itself. Nothing is pushed. The rest (branch, committing `OUT`, another repository) is the caller's.
The fixes are commits in `DETECTORS`, one per fix, so that the validator can have one removed. Note the **base**: `git -C <DETECTORS> rev-parse HEAD`. Files already modified (`git -C <DETECTORS> status --porcelain`) stay as they are, neither committed nor reverted; list them in the summary and pass them to the upgrader. The same for `TOOLS` before part 2: its **tools base** (`git -C <TOOLS> rev-parse HEAD`) and its files already modified. Always commit by path (`git -C <DETECTORS> commit -m "<message>" -- <paths>`), never `git add -A`, `git stash` or `git checkout` outside your paths: another session may be working there. Each message ends with an empty line then `Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>`. The upgrader commits in `TOOLS` itself in part 2, one commit per fix. Nothing is pushed. The rest (branch, committing `OUT`, another repository) is the caller's.
## Steps
Each agent is called with the Agent tool, its `subagent_type` (`agents:upgrader`, `agents:validator`, `agents:tool-builder`, from the agents plugin loaded with `--plugin-dir`; not available: say so and stop, changing nothing) and the request below, plus the caller's context. A verdict is read by `grep '^\*\*Verdict\*\*:' <output>`.
Each agent is called with the Agent tool, its `subagent_type` (`agents:upgrader`, `agents:validator`, from the agents plugin loaded with `--plugin-dir`; not available: say so and stop, changing nothing) and the request below, plus the caller's context. A verdict is read by `grep '^\*\*Verdict\*\*:' <output>`.
### Part 1: the detectors
1. **Measures before**: step `before`.
2. **Upgrader**, a single pass: `Detectors: <DETECTORS>. Station: <STATION>, range <FROM> → <TO> (UTC). Labels: <LABELS>/<station>.jsonl. Families: <FAMILIES>. Context: <CONTEXT>. Events command: <…>. Sensors command: <…>. Range score command: <…> (before: <OUT>/range-before.txt). Benchmark command: <…> (before: <OUT>/benchmark-before.txt). Base: <base>. Files already modified: <list | none>. Output folder: <OUT>. Write <OUT>/modification.md.`
2. **Upgrader**, a single pass: `Target: <DETECTORS>. Evidence: station <STATION>, range <FROM> → <TO> (UTC); labels <LABELS>/<station>.jsonl; families <FAMILIES>; context <CONTEXT>. Checks: events: <events> (before: run it); sensors: <sensors> (before: run it); range: <range score> (before: <OUT>/range-before.txt); benchmark: <benchmark> (before: <OUT>/benchmark-before.txt). Base: <base>. Files already modified: <list | none>. Output folder: <OUT>. Write <OUT>/modification.md. INSTRUCTIONS: instructions/upgrader-detectors.md.`
It commits each fix it keeps, message `improve: S<n>`, with its benchmark `<OUT>/benchmark-S<n>.txt`.
Verdict `nothing to change`, or no fix commit (`git -C <DETECTORS> log --format=%h --grep ': S[0-9]*$' <base>..HEAD` empty): go to part 2.
3. **Measures after**: step `after`.
4. **Validator**, which reads neither the diagnosis nor the detail of the modification: `Detectors: <DETECTORS>. Families: <FAMILIES>. Modification: <OUT>/modification.md. Range score: <OUT>/range-before.txt → <OUT>/range-after.txt. Benchmark: <OUT>/benchmark-before.txt → <OUT>/benchmark-after.txt, after each fix: <OUT>/benchmark-S*.txt; command: <…>. Events command for any station: python3 <DETECTORS>/scripts/categories.py <station folder> --from <from> --to <to>. Base: <base>. Write <OUT>/validation.md.`
4. **Validator**, which reads neither the diagnosis nor the detail of the modification: `Target: <DETECTORS>. Modification: <OUT>/modification.md. Base: <base>. Checks: range: <range score>; before: <OUT>/range-before.txt; after: <OUT>/range-after.txt; benchmark: <benchmark>; before: <OUT>/benchmark-before.txt; after: <OUT>/benchmark-after.txt; after each fix: <OUT>/benchmark-S*.txt; events, for any station: python3 <DETECTORS>/scripts/categories.py <station folder> --from <from> --to <to>. Families: <FAMILIES>. Output: <OUT>/validation.md. INSTRUCTIONS: instructions/validator-detectors.md.`
- `keep`: go to part 2.
- `remove`: for each fix of the `**Remove**:` line, its commits (`git -C <DETECTORS> log --format=%h --grep ': S<n>$' <base>..HEAD`), from the most recent: `git -C <DETECTORS> revert --no-edit <commit>`, then `git -C <DETECTORS> commit --amend -m "improve: S<n> removed" -m "Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>"`. A conflict: `git -C <DETECTORS> revert --abort`, and do as for `cancel`.
- `cancel`, or anything else: `git -C <DETECTORS> revert --no-commit <base>..HEAD && git -C <DETECTORS> commit -m "improve: modification cancelled" -m "Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>"` (only what the fix commits changed; files already modified stay as they are).
@@ -62,7 +62,7 @@ An output missing or without a readable verdict: note it, put the detectors back
Always, whatever part 1 gave (a stop in part 1 does not stop part 2).
6. **Tool-builder**: `Analysis: <ANALYSIS>/. Tools: <TOOLS>/. Write <OUT>/tools.md.` It reads the analysis, writes only in `TOOLS` and in `<OUT>`, and commits in `TOOLS`. Its output missing: note it. Do not rerun it.
6. **Upgrader on the tools**: `Target: <TOOLS>. Evidence: <ANALYSIS>/. Checks: none. Base: <tools base>. Files already modified: <list | none>. Output folder: <OUT>. Write <OUT>/tools.md. INSTRUCTIONS: instructions/upgrader-tools.md.` It reads the analysis, writes only in `TOOLS` and in `<OUT>`, and commits in `TOOLS`, one commit per fix. Its output missing: note it. Do not rerun it.
## Summary
@@ -72,7 +72,7 @@ Always, whatever part 1 gave (a stop in part 1 does not stop part 2).
# optimize: <station>, <FROM> → <TO>
**Result**: modification kept | kept without S<n>… | cancelled | none | error
**Tools changed**: <the "Tools changed" line of <OUT>/tools.md> | error
**Tools changed**: <the value of the `**Changed**` line of <OUT>/tools.md> | error
## The range
the range score, before → end, one line per family (found, correct)
@@ -96,7 +96,7 @@ the `Total` line of each family, before → end; then the other changed lines (s
<copied as they are: "Tools" of the modification and of the validation (the scripts the agents kept in `<OUT>/tools/`); none>
## Errors
<none, or what was missing; files already modified; the base and `git -C <DETECTORS> log --oneline <base>..HEAD`; `git -C <TOOLS> log --oneline -1` if the tools changed>
<none, or what was missing; files already modified; the base and `git -C <DETECTORS> log --oneline <base>..HEAD`; `git -C <TOOLS> log --oneline <tools base>..HEAD` if the tools changed>
```
## Answer
+4 -4
View File
@@ -1,10 +1,10 @@
# CLAUDE.md
Optimizer: the optimisation of the AIMsight detectors and of the reading tools, from one analysis of `labeling/auto`, and nothing else (`README.md`). The workflow: `.claude/skills/optimize/SKILL.md` (`/optimize`), launched from the root of Optimizer with the agents plugin (`--plugin-dir agents`); its agents `agents:upgrader`, `agents:validator` (the detectors) and `agents:tool-builder` (the tools); the benchmark `detectors/bench/`.
Optimizer: the optimisation of the AIMsight detectors and of the reading tools, from one analysis of `labeling/auto`, and nothing else (`README.md`). The workflow: `.claude/skills/optimize/SKILL.md` (`/optimize`), launched from the root of Optimizer with the agents plugin (`--plugin-dir agents`); its agents `agents:upgrader`, `agents:validator` (the detectors) and `agents:upgrader` again (the tools), each with its file of `instructions/`; the benchmark `detectors/bench/`.
- **The links**, out of git: `detectors/` → `~/detectors` and `tools/` → `~/tools` (the session commits there); `data/` → `~/aimsight-data/data` and `labeling/` → `~/labeling` (read-only); `agents/` → `~/agents` (the plugin, loaded read-only).
- **The sessions**: `sessions/<analysis>_<YYYYMMDDTHHMMZ>/`; Diagnostic-App reads their summary (`summary.md`).
- **The workflow stays generic**: the skill describes only the workflow (analysis → detectors: upgrader → validator; tools: tool-builder → summary); what is specific to a caller (its paths, its git rules, `Caller's context`) arrives in the request.
- **The links**, out of git: `detectors/` → `~/aimsight-detectors` and `tools/` → `~/aimsight-tools` (the session commits there); `data/` → `~/aimsight-data/data` and `labeling/` → `~/aimsight-labeling` (read-only); `agents/` → `~/aimsight-agents` (the plugin, loaded read-only).
- **The sessions**: `sessions/<analysis>_<YYYYMMDDTHHMMZ>/`; aimsight-app reads their summary (`summary.md`).
- **The workflow stays generic**: the skill describes only the workflow (analysis → detectors: upgrader → validator; tools: upgrader → summary); what is specific to a caller (its paths, its git rules, `Caller's context`) arrives in the request.
- **Check a change of the skill**: `env -u ANTHROPIC_API_KEY claude -p "/optimize" --plugin-dir agents --model haiku` must say the inputs are missing and stop without touching `detectors/` or `tools/`; then a real session through the app's button.
- `archive/`: the former batch and its scanner, stopped; do not run them again.
+12 -12
View File
@@ -1,32 +1,32 @@
# Optimizer
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:
The optimisation of the AIMsight detectors and of the reading tools, from one analysis, and nothing else. An analysis (made in the aimsight-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. **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;
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 `~/aimsight-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 `upgrader` bring the analyst's useful scripts into the reading harness, one fix per commit in `~/aimsight-tools`; always, whatever the detectors gave;
3. writes the summary of the session.
The `upgrader`, the `validator` and the `tool-builder` come from the `agents` repository; the benchmark (`bench/`) from the `detectors` repository. Nothing is pushed.
The `upgrader` and the `validator` come from the `agents` repository, each with its instructions from `instructions/` (`upgrader-detectors.md`, `validator-detectors.md`, `upgrader-tools.md`); the rules of each target are its own `CLAUDE.md`; 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-detectors detectors # the detectors, shared with aimsight-app
ln -s ~/aimsight-tools tools # the reading tools, shared with aimsight-app
ln -s ~/aimsight-data/data data # the pumped data, out of git
ln -s ~/labeling labeling # the labels, the analyses and the families
ln -s ~/agents agents # the generic agents (Claude Code plugin)
ln -s ~/aimsight-labeling labeling # the labels, the analyses and the families
ln -s ~/aimsight-agents agents # the generic agents (Claude Code plugin)
```
`claude` (Claude Code) must be on the `PATH`, logged in to the Claude subscription (`/login`), never to an API key.
## Run
From the "Optimize" button of Diagnostic-App, on a finished analysis; or by hand, from the root of Optimizer:
From the "Optimize" button of aimsight-app, on a finished analysis; or by hand, from the root of Optimizer:
```bash
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 \
--plugin-dir agents --add-dir ~/aimsight-detectors --add-dir ~/aimsight-tools --add-dir ~/aimsight-labeling --add-dir ~/aimsight-data/data \
--setting-sources project,local --strict-mcp-config \
--allowedTools Read,Write,Edit,Bash,Agent --permission-mode acceptEdits
```
@@ -35,6 +35,6 @@ The station and the range come from the analysis's `request.json` (the range's l
## What a session leaves
`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.
`sessions/<analysis>_<time>/`: the measures before and after (`range-*.txt`, `benchmark-*.txt`), `modification.md` (the upgrader), `validation.md` (the validator), `tools.md` (the upgrader on the tools) 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 `~/aimsight-detectors`, the tools `improve: S<n>` commits in `~/aimsight-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`.
`archive/`: the former daily batch and its scanner (auto-labeling by the detectors), stopped on 2026-11-16. The architecture of the repositories: `~/aimsight-app/docs/architecture.drawio`.
+41
View File
@@ -0,0 +1,41 @@
# Optimizer's instructions to the upgrader: the detectors
What `/optimize` asks of the upgrader (agents repository, `agents:upgrader`) in part 1, on top of its trade. The target is the detectors repository; its rules (what may change, the regression, everything is detected) are in `<Target>/CLAUDE.md`, read in full.
## Why this range
An analyst has analysed a range of a station where the detectors perform poorly. The labels of the range are the truth. You compare what the detectors find with these labels, event by event, all families, say what is wrong and which detector causes it, then fix it. Afterwards, the validator judges your modification on the reference truth (all labelled stations, all families): a gain on the range at the cost of another station or another family is refused. What counts is the mechanism behind a label (a rejected reference that makes all targets jump, for example), recognisable wherever it happens; a constant tuned to make these bounds fall exactly, a rule that only recognises the exact shape of these events: no. What the detectors cannot see with these measurements (a cause only an image reveals) goes to "Limits".
## The evidence
- The labels file of the station (or several stations on the same range, a labels file each, in one folder: the events and sensors checks run per station, the range score covers them all; a mechanism that comes back from one station to another comes before a single case). A label: one line of JSONL, `{"id", "start", "end", "family", "description"}` (cited by its `id`), a single anomaly, seen on `corr_x` and `corr_y` (they move or are missing); `description` says the sensors touched, the cause and how it was known. Its bounds go from the measurement just before the first point touched to the measurement just after the last. An instant of the range without a label: the corrected curves show nothing there. Read the labels touching the range (`start` < `TO` and `end` ≥ `FROM`).
- The context documents (the analysis report): the mechanism of each event, the sensors touched and those that do not move, the level of proof; a document may say that a label is wrong: a limit to report, not a target.
- The families document **in full**: the families and their boundaries; the category of an event is its family.
- The checks' outputs before: events (run it with `2>&1`), sensors (the cadence, then the sensors of each event), range score, benchmark.
- The code of the detectors, `scripts/categories.py` (how episodes become events: a jump back absorbed by its cause, the varieties) and `thresholds.md`. You may read the station's data to understand why a rule fails.
## The diagnosis
Compare, event by event and label by label: correct; wrong family; extra (flagged by the detectors, without a label); wrong bounds (late, too early, too wide); wrong sensors (the event's, by the sensors check, against those the description names); missing. A few measurements of gap at the bounds are not a defect. Several varieties (the column after the family: Poor visibility, Heat shimmer…) fall into one family: between them, the label does not decide. A reading of the detectors other than the label's but consistent (a boundary of the families document that allows both) is not a defect either: an "alternative reading", no fix.
Fixes to try first: a significant event missed or badly bounded before a small nuisance. The simplest first, for the detectors, ends with: as a last resort, a new variety (a `label`) in the family's detector.
## The checks
- **events**: before and after each fix, with `2>&1`.
- **range**: the range score, what you make rise, without losing a whole event. A hole has no measurement: it only counts its two bounds; for a hole, read the events check. Do not aim for 100 %.
- **benchmark**: all lines of all stations, against the benchmark of the last committed state (the benchmark before, or that of your previous kept fix); before your output, the whole against the benchmark before. A regression (`<Target>/CLAUDE.md`): rework your change before committing it, or drop the fix. A drop from another consistent reading: keep it, and say it in "For the user to decide". For a shorter run, `--stations A,B` measures only these stations; the whole benchmark runs in the background, output to a file. To try a variant without touching the repository, copy the target in your working folder: the copy's scripts measure the copy, with the same arguments.
## Your output
On top of the skeleton of your trade:
- `## Diagnosis` opens with `<station, range, cadence>` and the table `| Family | labelled | found | flagged | wrongly |`, then one line per event or label: its judgement and why; same judgement and cause grouped.
- After `## Checks`: `## Before / after on the range` (the changed lines of the two outputs of the events check; the range score before → after, per family) and `## Benchmark` (the lines that changed, station and family, before → after, then the changed lines of the `Total` block).
- "For the user to decide": a reading of the detectors other than the labels', kept: the labels (id, station, moment, family), the detectors' reading, what it changes in the benchmark. "Limits": the label (id, bounds, family), what it would take to see it (image…); a label the context says is wrong (id).
Times in UTC. The orchestrator reads the `**Verdict**` line as it is.
## Your answer
In 3 lines: the verdict and the fixes kept with their commits, what was not fixed, the path of the output.
+39
View File
@@ -0,0 +1,39 @@
# Optimizer's instructions to the upgrader: the tools
What `/optimize` asks of the upgrader (agents repository, `agents:upgrader`) in part 2, on top of its trade. The target is the tools repository (the reading harness); its rules (remove nothing, the simplest first, no judgement in a tool's output, `data.py`) are in `<Target>/CLAUDE.md`, read in full.
## Why
The analyst has just analysed a range as an expert, with the tools of the target, their guide (`GUIDE.md`) and, where they were not enough, its own scripts. It is up to you to decide what deserves to enter the tools, so that the next analysis, on any station, reads better. The analyst follows the guide; the callers read the data through `scripts/data.py`.
## The evidence
The analysis folder: `report.md` first, if it exists (the commands behind each fact, hence the tools the analyst used); then `analysis.md` (its "The documentation" section and its "Difficulties" say what it missed or what got in its way); its scripts, in `scripts/`. Then `<Target>/GUIDE.md` and the tools of `<Target>/scripts/`; the station folder, to try things. The station and the range are in the heading of `analysis.md`. Nothing else: neither the detectors (`detectors/`) nor `CLAUDE.md` of the root you are called from.
## What you decide
- **Optimise**: a tool that got in the analyst's way (output too long, unreadable figure, option to guess) is tuned: a better default, an option, a sentence of the guide.
- **Add**: a script of the analyst that showed what the tools did not show, and that would help on other stations, enters `<Target>/scripts/`, made general; or an option of an existing tool does the same, which is better. A script that only served this range stays where it is.
- **Nothing to do** is a decision: if the tools were enough and nothing got in the way, touch nothing and say so.
You write nothing in the analysis folder.
## The checks
There is no check command (`Checks: none`). For each fix, before its commit:
1. Run each changed or added tool on the range, from the root you are called from (`python3 <Target>/scripts/<tool>.py data/<STATION> …`), with `--start` and `--end` of the range and `--out <output folder>/work/tools/`; look at each PNG with Read.
2. Rerun, on the range, the commands of the analysis report that use a changed tool, with `--out <output folder>/work/` (replacing theirs, or added if absent): they must still work.
## Your output
On top of the skeleton of your trade:
- after the `**Changed**` line: `**data.py**: unchanged | changed: <the reading error fixed, in one sentence>`;
- `## What the analyst used` (before `## Diagnosis`): the tools and the scripts it used, and what it missed or what got in its way, summarised;
- `## What I decided` (after `## Diagnosis`): `- <tool or script>: <optimised, added or left>, and why`;
- under `## Checks`: the trial commands and what they return, figures in `<output folder>/work/tools/`; then `Report commands rerun: <number>, and "no failure" or the failures`.
## Your answer
In 2 lines: what changed (or "no tool changed"), the path of your output.
+27
View File
@@ -0,0 +1,27 @@
# Optimizer's instructions to the validator: the detectors
What `/optimize` asks of the validator (agents repository, `agents:validator`) in part 1, on top of its trade. The target is the detectors repository; its rules (what may change, what loads, the regression) are in `<Target>/CLAUDE.md`, read in full.
## Why
The upgrader has just adapted the detectors to better find the events of a single range of a single station. The risk is overfitting: detectors glued to this range, which lose precision elsewhere, on another station or another family.
## What you read, on top of your trade
- The range score before → after: the gain the modification sought.
- The benchmarks (the score per family on each station of the reference truth, then their `Total`), all stations in full; the benchmarks after each fix, in order, say which fix makes a station go back.
- The families document.
- To understand a regression on a station: the events command on its range (from the header of the station's block in the benchmark), with `2>&1`, at HEAD and, to compare, at the base (`git -C <Target> archive <base> | tar -x -C <folder>` in your working folder, then the same command with the copy's `scripts/categories.py`), and the station's labels.
## What you judge, for the detectors
- Regressions: station by station and family by family, the range's station included, by the definition of `<Target>/CLAUDE.md`. A drop you do not count as a regression goes to "Reservations".
- A range gain of nothing or almost, at the price of one more rule, means cancel (or remove for the fix in question); a rule removed is better than a rule added.
## Your output
On top of the skeleton of your trade: `## The range` (the range score before → after, per family), placed before `## Checks`; under `## Checks`, the non-regression: the lines that changed, station and family, before → after, then the changed lines of the `Total` block. "Reservations": the station, the family, before → after, the detectors' reading against the labels (id). Times in UTC.
## Your answer
In 2 lines: the verdict, the path of the output.