optimize: the benchmark is in ~/aimsight-models/rules/bench (BENCH, measuring $DETECTORS); the detectors in detectors/, thresholds.md in models/rules

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
maximeandClaude Opus 5.5 committed 2026-11-25 14:28:23 +01:00
1 parent 0cfbd1b7bc
commit 698fededa3
3 files changed
+9 -9

No files matched your search

+7 -7
View File
@@ -14,7 +14,7 @@ Given by the caller, in the request; any other context or rule it gives (files t
- `ANALYSIS` (required): the analysis folder: `request.json` (`station`, `start`, `end`, UTC), `labels.jsonl`, `report.md`, `analysis.md`, `scripts/`.
- `OUT` (required): the output folder of this run (`sessions/<analysis>_<YYYYMMDDTHHMMZ>/` in Optimizer).
- Defaults, relative to Optimizer's root (its links), which the request may override: `DETECTORS: detectors/`, `TOOLS: tools/`, `DATA: data`, `LABELS: labeling/auto` (the folder of the `<STATION>.jsonl` label files, JSONL: `id`, `start`, `end`, `family`, `description`), `FAMILIES: labeling/families.md` (the families and their boundaries, one detector per family).
- Defaults, relative to Optimizer's root (its links), which the request may override: `DETECTORS: detectors/`, `BENCH: ~/aimsight-models/rules/bench` (the benchmark of the detectors, outside them: it measures `$DETECTORS`), `TOOLS: tools/`, `DATA: data`, `LABELS: labeling/auto` (the folder of the `<STATION>.jsonl` label files, JSONL: `id`, `start`, `end`, `family`, `description`), `FAMILIES: labeling/families.md` (the families and their boundaries, one detector per family).
Derived from `<ANALYSIS>/request.json`:
@@ -28,11 +28,11 @@ Derived from `<ANALYSIS>/request.json`:
## Commands
- events: `python3 <DETECTORS>/scripts/categories.py <STATION> --from <FROM> --to <TO>`
- sensors: `python3 <DETECTORS>/bench/sensors.py <STATION> --from <FROM> --to <TO>`
- range score (the goal): `python3 <DETECTORS>/bench/score.py <STATION> --labels <LABELS>/<station>.jsonl --from <FROM> --to <TO>`; it exits with an error if no label touches the range: note it in the summary, touch nothing in the detectors and go to part 2.
- benchmark (the non-regression, about 1 min): `python3 <DETECTORS>/bench/regression.py <REFERENCE>`
- compare (the regressions and the complexity of two benchmarks): `python3 <DETECTORS>/bench/compare.py <before.txt> <after.txt>`
- events: `python3 <DETECTORS>/detectors/categories.py <STATION> --from <FROM> --to <TO>`
- sensors: `DETECTORS=<DETECTORS> python3 <BENCH>/sensors.py <STATION> --from <FROM> --to <TO>`
- range score (the goal): `DETECTORS=<DETECTORS> python3 <BENCH>/score.py <STATION> --labels <LABELS>/<station>.jsonl --from <FROM> --to <TO>`; it exits with an error if no label touches the range: note it in the summary, touch nothing in the detectors and go to part 2.
- benchmark (the non-regression, about 1 min): `DETECTORS=<DETECTORS> python3 <BENCH>/regression.py <REFERENCE>`
- compare (the regressions and the complexity of two benchmarks): `python3 <BENCH>/compare.py <before.txt> <after.txt>`
The measures of a step: `<range score> > <OUT>/range-<step>.txt 2>&1` and `<benchmark> > <OUT>/benchmark-<step>.txt 2>&1`.
@@ -51,7 +51,7 @@ Each agent is called with the Agent tool, its `subagent_type` (`agents:upgrader`
It commits each fix it keeps, message `improve: S<n>`, with its benchmark `<OUT>/benchmark-S<n>.txt`; each rule its pruning removes is a fix of its own.
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: `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; compare: <compare>; 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.`
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; compare: <compare>; events, for any station: python3 <DETECTORS>/detectors/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).