From 58b630f2d55c4a711c2cbca816f6182922a8f1ee Mon Sep 17 00:00:00 2001 From: maxime Date: Wed, 18 Nov 2026 10:51:31 +0100 Subject: [PATCH] . --- .claude/settings.json | 1 + .claude/skills/cases/SKILL.md | 58 +++ CLAUDE.md | 10 +- README.md | 15 +- auto/ALASKA.jsonl | 10 + auto/BREITHORN.jsonl | 38 +- auto/CLARIDEN.jsonl | 54 +-- auto/SNCF01.jsonl | 98 ++--- ...08-10-11_20261112T0900Z_20261113T0100Z.png | Bin 0 -> 154355 bytes .../analysis.md | 121 ++++++ .../labels.jsonl | 10 + .../references_vs_targets.png | Bin 0 -> 619797 bytes .../report.md | 52 +++ .../request.json | 6 + .../scripts/common_dist.py | 31 ++ .../scripts/devtable.py | 40 ++ .../scripts/slowfig.py | 28 ++ .../scripts/touched.py | 28 ++ .../scripts/weather.py | 13 + .../target04_temperature.png | Bin 0 -> 300262 bytes .../labels.jsonl | 6 +- .../analysis.md | 30 +- .../labels.jsonl | 4 +- .../report.md | 12 +- .../scripts/parallax.py | 28 ++ .../scripts/parallax_fit.py | 44 ++ .../scripts/write_labels.py | 17 + .../labels.jsonl | 4 +- .../labels.jsonl | 8 +- .../labels.jsonl | 6 +- .../report.md | 4 + .../analysis.md | 43 +- .../labels.jsonl | 2 +- .../report.md | 20 +- .../scripts/disp_size.py | 41 ++ .../scripts/month_plot.py | 30 ++ .../scripts/short_native.py | 25 ++ .../labels.jsonl | 15 +- .../report.md | 4 + .../labels.jsonl | 27 +- .../report.md | 4 + .../labels.jsonl | 28 +- .../labels.jsonl | 16 +- .../labels.jsonl | 26 +- auto/cases/animal-close-to-lens.json | 23 + auto/cases/atmospheric-turbulence.json | 19 + .../base-changes-without-reference-lost.json | 23 + ...a-drifts-housing-cools-no-daily-cycle.json | 23 + .../camera-jolt-back-at-next-measurement.json | 22 + auto/cases/camera-moves-thermal-effect.json | 28 ++ auto/cases/camera-step-not-erased.json | 24 ++ auto/cases/camera-tilts-little-by-little.json | 19 + .../cases/compensation-on-two-references.json | 21 + auto/cases/faint-spot-lost-without-light.json | 27 ++ ...ff-common-jumps-at-reference-switches.json | 18 + auto/cases/ff-corrections-stuck-at-zero.json | 13 + ...f-error-return-not-end-of-obstruction.json | 18 + auto/cases/ff-insects-not-a-train.json | 18 + auto/cases/ff-no-signal-no-obstruction.json | 18 + auto/cases/ff-references-calm-in-rain.json | 18 + .../cases/ff-rise-over-days-not-movement.json | 18 + auto/cases/ff-step-is-not-amplitude.json | 18 + .../ff-target-sliding-with-error-rising.json | 18 + ...ff-thumbnail-spot-follows-measurement.json | 18 + ...f-tunnel-temperature-drop-not-thermal.json | 18 + auto/cases/ff-web-is-not-the-spider.json | 18 + .../cases/gap-common-to-several-stations.json | 19 + .../lesson-everything-moves-together.json | 19 + auto/cases/lesson-low-contrast-target.json | 18 + ...esson-references-masked-by-vegetation.json | 18 + auto/cases/lesson-snow.json | 18 + auto/cases/lesson-two-prisms-too-close.json | 20 + auto/cases/lesson-vegetation-grows.json | 18 + auto/cases/mains-cut-station-on-battery.json | 19 + auto/cases/obstacle-covers-part-of-spot.json | 29 ++ auto/cases/part-of-scene-dark-at-night.json | 19 + ...pass-by-hides-targets-one-measurement.json | 31 ++ auto/cases/plant-shaken-by-wind.json | 21 + auto/cases/rain.json | 23 + auto/cases/real-movement-of-structure.json | 35 ++ .../cases/reference-dropped-base-changes.json | 27 ++ auto/cases/reference-loses-brightness.json | 20 + .../reference-shifted-alone-then-back.json | 24 ++ .../rise-over-days-as-temperature-drops.json | 23 + auto/cases/sensor-configuration-changed.json | 19 + auto/cases/single-point-back-at-once.json | 20 + auto/cases/soiled-glass.json | 23 + auto/cases/spider-web-in-front-of-lens.json | 27 ++ auto/cases/station-goes-silent-long.json | 19 + .../station-runs-measurement-missing.json | 19 + .../station-shuts-down-lack-of-energy.json | 23 + .../cases/step-during-measurement-outage.json | 19 + .../structure-expands-and-contracts.json | 19 + auto/cases/sun-in-field-or-behind-spot.json | 24 ++ .../target-at-threshold-whole-batch.json | 23 + .../target-degrades-sometimes-recovers.json | 17 + .../cases/target-jumps-and-stays-shifted.json | 27 ++ .../target-latches-onto-another-light.json | 27 ++ .../target-rejected-at-all-measurements.json | 19 + .../target-rejected-every-night-or-day.json | 23 + .../targets-move-slowly-alone-and-return.json | 20 + .../two-references-lost-camera-blind.json | 23 + auto/cases/vehicle-or-machine-stays.json | 19 + auto/cases/visibility-drops-whole-scene.json | 24 ++ docs/superpowers/plans/2026-11-18-cases.md | 372 ++++++++++++++++ .../specs/2026-11-18-cases-design.md | 134 ++++++ families.md | 60 +-- labeling-rules.md | 2 +- reading-rules.md | 22 +- scripts/cases.py | 396 ++++++++++++++++++ scripts/validate.py | 147 ++++++- stations.md | 2 +- 112 files changed, 3172 insertions(+), 295 deletions(-) create mode 100644 .claude/skills/cases/SKILL.md create mode 100644 auto/ALASKA.jsonl create mode 100644 auto/analyses/ALASKA_2026-11-04T2358_2026-11-16T1217/ALASKA_corr_y_mm-error_value_01-02-04-06-08-10-11_20261112T0900Z_20261113T0100Z.png create mode 100644 auto/analyses/ALASKA_2026-11-04T2358_2026-11-16T1217/analysis.md create mode 100644 auto/analyses/ALASKA_2026-11-04T2358_2026-11-16T1217/labels.jsonl create mode 100644 auto/analyses/ALASKA_2026-11-04T2358_2026-11-16T1217/references_vs_targets.png create mode 100644 auto/analyses/ALASKA_2026-11-04T2358_2026-11-16T1217/report.md create mode 100644 auto/analyses/ALASKA_2026-11-04T2358_2026-11-16T1217/request.json create mode 100644 auto/analyses/ALASKA_2026-11-04T2358_2026-11-16T1217/scripts/common_dist.py create mode 100644 auto/analyses/ALASKA_2026-11-04T2358_2026-11-16T1217/scripts/devtable.py create mode 100644 auto/analyses/ALASKA_2026-11-04T2358_2026-11-16T1217/scripts/slowfig.py create mode 100644 auto/analyses/ALASKA_2026-11-04T2358_2026-11-16T1217/scripts/touched.py create mode 100644 auto/analyses/ALASKA_2026-11-04T2358_2026-11-16T1217/scripts/weather.py create mode 100644 auto/analyses/ALASKA_2026-11-04T2358_2026-11-16T1217/target04_temperature.png create mode 100644 auto/analyses/BREITHORN_2026-10-03T0000_2026-11-01T0000/scripts/parallax.py create mode 100644 auto/analyses/BREITHORN_2026-10-03T0000_2026-11-01T0000/scripts/parallax_fit.py create mode 100644 auto/analyses/BREITHORN_2026-10-03T0000_2026-11-01T0000/scripts/write_labels.py create mode 100644 auto/analyses/CLARIDEN_2026-10-01T0000_2026-11-01T0000/scripts/disp_size.py create mode 100644 auto/analyses/CLARIDEN_2026-10-01T0000_2026-11-01T0000/scripts/month_plot.py create mode 100644 auto/analyses/CLARIDEN_2026-10-01T0000_2026-11-01T0000/scripts/short_native.py create mode 100644 auto/cases/animal-close-to-lens.json create mode 100644 auto/cases/atmospheric-turbulence.json create mode 100644 auto/cases/base-changes-without-reference-lost.json create mode 100644 auto/cases/camera-drifts-housing-cools-no-daily-cycle.json create mode 100644 auto/cases/camera-jolt-back-at-next-measurement.json create mode 100644 auto/cases/camera-moves-thermal-effect.json create mode 100644 auto/cases/camera-step-not-erased.json create mode 100644 auto/cases/camera-tilts-little-by-little.json create mode 100644 auto/cases/compensation-on-two-references.json create mode 100644 auto/cases/faint-spot-lost-without-light.json create mode 100644 auto/cases/ff-common-jumps-at-reference-switches.json create mode 100644 auto/cases/ff-corrections-stuck-at-zero.json create mode 100644 auto/cases/ff-error-return-not-end-of-obstruction.json create mode 100644 auto/cases/ff-insects-not-a-train.json create mode 100644 auto/cases/ff-no-signal-no-obstruction.json create mode 100644 auto/cases/ff-references-calm-in-rain.json create mode 100644 auto/cases/ff-rise-over-days-not-movement.json create mode 100644 auto/cases/ff-step-is-not-amplitude.json create mode 100644 auto/cases/ff-target-sliding-with-error-rising.json create mode 100644 auto/cases/ff-thumbnail-spot-follows-measurement.json create mode 100644 auto/cases/ff-tunnel-temperature-drop-not-thermal.json create mode 100644 auto/cases/ff-web-is-not-the-spider.json create mode 100644 auto/cases/gap-common-to-several-stations.json create mode 100644 auto/cases/lesson-everything-moves-together.json create mode 100644 auto/cases/lesson-low-contrast-target.json create mode 100644 auto/cases/lesson-references-masked-by-vegetation.json create mode 100644 auto/cases/lesson-snow.json create mode 100644 auto/cases/lesson-two-prisms-too-close.json create mode 100644 auto/cases/lesson-vegetation-grows.json create mode 100644 auto/cases/mains-cut-station-on-battery.json create mode 100644 auto/cases/obstacle-covers-part-of-spot.json create mode 100644 auto/cases/part-of-scene-dark-at-night.json create mode 100644 auto/cases/pass-by-hides-targets-one-measurement.json create mode 100644 auto/cases/plant-shaken-by-wind.json create mode 100644 auto/cases/rain.json create mode 100644 auto/cases/real-movement-of-structure.json create mode 100644 auto/cases/reference-dropped-base-changes.json create mode 100644 auto/cases/reference-loses-brightness.json create mode 100644 auto/cases/reference-shifted-alone-then-back.json create mode 100644 auto/cases/rise-over-days-as-temperature-drops.json create mode 100644 auto/cases/sensor-configuration-changed.json create mode 100644 auto/cases/single-point-back-at-once.json create mode 100644 auto/cases/soiled-glass.json create mode 100644 auto/cases/spider-web-in-front-of-lens.json create mode 100644 auto/cases/station-goes-silent-long.json create mode 100644 auto/cases/station-runs-measurement-missing.json create mode 100644 auto/cases/station-shuts-down-lack-of-energy.json create mode 100644 auto/cases/step-during-measurement-outage.json create mode 100644 auto/cases/structure-expands-and-contracts.json create mode 100644 auto/cases/sun-in-field-or-behind-spot.json create mode 100644 auto/cases/target-at-threshold-whole-batch.json create mode 100644 auto/cases/target-degrades-sometimes-recovers.json create mode 100644 auto/cases/target-jumps-and-stays-shifted.json create mode 100644 auto/cases/target-latches-onto-another-light.json create mode 100644 auto/cases/target-rejected-at-all-measurements.json create mode 100644 auto/cases/target-rejected-every-night-or-day.json create mode 100644 auto/cases/targets-move-slowly-alone-and-return.json create mode 100644 auto/cases/two-references-lost-camera-blind.json create mode 100644 auto/cases/vehicle-or-machine-stays.json create mode 100644 auto/cases/visibility-drops-whole-scene.json create mode 100644 docs/superpowers/plans/2026-11-18-cases.md create mode 100644 docs/superpowers/specs/2026-11-18-cases-design.md create mode 100644 scripts/cases.py diff --git a/.claude/settings.json b/.claude/settings.json index 41e239e..22696c1 100644 --- a/.claude/settings.json +++ b/.claude/settings.json @@ -4,6 +4,7 @@ "allow": [ "Bash(python3 scripts/validate.py:*)", "Bash(python3 scripts/ids.py:*)", + "Bash(python3 scripts/cases.py:*)", "Bash(python3 scripts/precedents.py:*)", "Bash(docker start ollama-bge-m3)" ], diff --git a/.claude/skills/cases/SKILL.md b/.claude/skills/cases/SKILL.md new file mode 100644 index 0000000..8a79683 --- /dev/null +++ b/.claude/skills/cases/SKILL.md @@ -0,0 +1,58 @@ +--- +name: cases +description: Builds or refreshes the cases of auto/cases/ (the phenomena, false friends and lessons, one JSON file each) from the labels of auto/ and, on the first run, from the phenomena, false friends and lessons of families.md and reading-rules.md. Use when the user asks to build, refresh or update the cases (/cases). +--- + +# The cases + +A case generalizes labels: the signature of a phenomenon, how to confirm it, how to tell it from its neighbours, what the client is told. The agents read the cases through `python3 scripts/cases.py` (search, `--list`); the labels themselves are no longer searched. The design, binding: `docs/superpowers/specs/2026-11-18-cases-design.md` (sections "A case" and "The skill"). + +## Rules + +- Never read nor write `manual/` (the user's alone). Touch only `auto/cases/`, and, at the seed, the three markdown sections below; aimsight-app writes in `auto/` at the same time. +- Never write `review`, never commit. Remove `review` from a case only when you change its `kind`, `family`, `name`, `signature`, `checks`, a `tell_apart` or `client`; adding a source or a neighbour link keeps it. +- A case is general: English, words without numeric values, no station or target name in its text (where it was seen is in `sources`). A case `id` is a short English slug, equal to its file name, and never changes. +- Never delete a case that has a non-label source (`user`, `expert`, `client report`): hand-written knowledge leaves only by the user's hand. +- A new case needs labels from at least two stations (the station of a label is its id before the last `-`), or a non-label source. + +## Read first + +The design (sections above), `families.md` and `reading-rules.md` in full, and `python3 scripts/cases.py --list`. + +## Seed: when `--list` prints no case + +1. One case per bullet of: + - `families.md`, section "The phenomena": `kind` `phenomenon`; `family` the key of its `###` heading, `null` under "Family of the cause"; + - `reading-rules.md` §6 "False friends": `kind` `false friend`; `family` `null` unless the bullet is about one family; + - `reading-rules.md` §8 "Lessons from cases outside the labels": `kind` `lesson`. +2. Fields: `sources` = `user` plus its bracketed sources (`[NORDEND-169]` → `NORDEND-169`, `[expert]` → `expert`, `[client report]` → `client report`), dropping a label id that `auto/` no longer has; `name` the bullet's bold name; `signature` the bullet's text, reworded only to say what is seen (move a station name of the text to `sources` if it is a label, otherwise make it general); `neighbours` the entries the bullet says how to tell apart, linked both ways with the same `tell_apart`; `checks` only when the bullet names a tool or a column; `client` only when the bullet says what the client is told and it differs from the family's line; no `review`. Write each to `auto/cases/.json`, indented by two spaces. +3. Replace the body of each of the three sections (keep its heading) by one paragraph: + - phenomena: "They are the cases: `auto/cases/` (`kind` phenomenon), listed by `python3 scripts/cases.py --list`, searched by `python3 scripts/cases.py ""`. A phenomenon not among them is labelled too, without forcing a cause." + - false friends: "They are the cases: `auto/cases/` (`kind` false friend), listed by `python3 scripts/cases.py --list`, searched by `python3 scripts/cases.py ""`." + - lessons: the same with `kind` lesson. +4. `python3 scripts/validate.py` until it says 0 errors for the cases; `python3 scripts/cases.py --index`. +5. Report the cases written (`--list`) and every bullet that did not become its own case (merged, and into which), then **stop**: the pass over the labels is the next `/cases`, once the user has read the seed. + +## Refresh: when cases exist + +1. `python3 scripts/cases.py --pending .index/cases-work` clears the files of an earlier refresh there, writes one `.jsonl` per family with labels to read, and prints the counts and the label ids deleted since the last record. +2. **One subagent per family file**, all in one message (Agent tool, `general-purpose`), each with this prompt, its `` filled in: + + > You attach AIMsight displacement labels to cases. Work in `/home/maxime/aimsight-labeling`. Never read `manual/`. Read in full `families.md` and `reading-rules.md`; run `python3 scripts/cases.py --list` (every case); read the case files `auto/cases/*.json` of family `` and those whose `family` is `null`, and any other case the list makes relevant. Then read every label of `.index/cases-work/.jsonl`. + > For each label, say which cases it illustrates: existing ids, ids of cases you propose, or none. A label may illustrate several cases (rain that also makes the references switch; a false friend it shows). + > Propose a new case only for a pattern no case covers, general (English, words without numbers, no station or target name), with the labels that show it; give it `id` (short English slug), `kind` (`phenomenon`, `false friend`, `lesson`), `name`, `family` (a key of `families.md` or null), `signature` (what is seen: what moves, what does not), `checks` (the reading tools or images that confirm it), `neighbours` (existing or proposed case ids, each with `tell_apart`), and `client` only if it differs from the family's line. + > Propose a change to an existing case (a sharper signature, a check, a neighbour, a client line) only with the labels that justify it. + > A pattern you see at one station only goes to `single_station`, not to a new case. + > Write only this JSON to `.index/cases-work/.answer.json`: + > `{"assignments": {"