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
@@ -18,20 +18,24 @@ An analyst has analysed a range of a station where the detectors perform poorly.
|
||||
|
||||
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.
|
||||
Fixes to try first: a significant event missed or badly bounded before a small nuisance. The simplest first: widen or remove a rule before adding one; a new constant or more than 20 code lines must earn at least 1 point on a family `Total` (`<Target>/CLAUDE.md`, "Simple first"); as a last resort, a new variety (a `label`) in the family's detector.
|
||||
|
||||
## The pruning
|
||||
|
||||
After your fixes, and even when you fixed nothing: each rule of the detectors you touched (or, without a fix, of the detector the diagnosis blames most) is tried without it, on a copy in your working folder, one rule per copy, the benchmarks in the background, then `compare` against the benchmark of the last committed state. A removal with no regression is kept: a fix of its own (`S<n>`, its benchmark, its line of `thresholds.md` removed). A removal with a regression is not committed: say the rule and the regression.
|
||||
|
||||
## 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.
|
||||
- **benchmark**: all lines of all stations, through `compare` (its `REGRESSION` lines and the complexity), 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).
|
||||
- After `## Checks`: `## Pruning` (one line per rule tried: removed, its commit, or kept, the regression its removal makes); `## 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 output of `compare` against the benchmark before, as it is).
|
||||
- "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.
|
||||
|
||||
@@ -15,12 +15,13 @@ The upgrader has just adapted the detectors to better find the events of a singl
|
||||
|
||||
## 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".
|
||||
- Regressions: `compare` before → after, and before → after each fix in order (it says which fix makes a station go back); its `REGRESSION` lines are those of `<Target>/CLAUDE.md`, the range's station included. A `REGRESSION` line you do not count as one (an exception of `<Target>/CLAUDE.md`, "Not a regression") goes to "Reservations", with the labels (id).
|
||||
- Complexity: the last line of `compare`. A fix that adds a constant or more than 20 code lines without 1 point on a family `Total` means remove; a fix that removes code without a regression (the pruning) is kept, even without a gain.
|
||||
- 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.
|
||||
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 output of `compare` before → after, as it is. "Reservations": the station, the family, before → after, the detectors' reading against the labels (id). Times in UTC.
|
||||
|
||||
## Your answer
|
||||
|
||||
|
||||
Reference in new issue
Block a user