optimize: compare.py for the regressions and the complexity; the upgrader prunes the rules it touched
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2a96d54844
commit
bfa0224711
3 files changed
+15
-9
No files matched your search
@@ -32,6 +32,7 @@ Derived from `<ANALYSIS>/request.json`:
|
||||
- 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>`
|
||||
|
||||
The measures of a step: `<range score> > <OUT>/range-<step>.txt 2>&1` and `<benchmark> > <OUT>/benchmark-<step>.txt 2>&1`.
|
||||
|
||||
@@ -46,11 +47,11 @@ Each agent is called with the Agent tool, its `subagent_type` (`agents:upgrader`
|
||||
### Part 1: the detectors
|
||||
|
||||
1. **Measures before**: step `before`.
|
||||
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`.
|
||||
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); compare: <compare>. 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`; 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; 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>/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).
|
||||
@@ -78,7 +79,7 @@ Always, whatever part 1 gave (a stop in part 1 does not stop part 2).
|
||||
the range score, before → end, one line per family (found, correct)
|
||||
|
||||
## Elsewhere
|
||||
the `Total` line of each family, before → end; then the other changed lines (station, family), before → end
|
||||
the output of `<compare> <OUT>/benchmark-before.txt <OUT>/benchmark-<end>.txt`: the `Total` lines first, then the other changed lines, then its last line (regressions, complexity before → end)
|
||||
|
||||
## What changed
|
||||
<per fix kept, one sentence from "What changed" of the modification>; the upgrader's verdict, the validator's
|
||||
|
||||
Reference in new issue
Block a user