Files
aimsight-optimizer/instructions/upgrader-detectors.md
T

5.4 KiB

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.