Compare commits

..
6 Commits
Author SHA1 Message Date
maximeandClaude Opus 5.5 8fa555f43b The models/ link: the pilot of learned detectors (aimsight-models)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 15:42:37 +01:00
maximeandClaude Opus 5.5 d2146af0e8 Dépôts renommés avec le préfixe aimsight- : chemins et noms mis à jour
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 14:56:41 +01:00
maximeandClaude Opus 5.5 1d1ce142ec README: the tools by the upgrader
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 14:48:44 +01:00
maximeandClaude Opus 5.5 bbdb23786c README: the tools are written by the upgrader
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 14:45:03 +01:00
maximeandClaude Opus 5.5 beaa248687 Optimize: a single /optimize call in Optimizer, the detectors and the tools
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 14:15:55 +01:00
maximeandClaude Opus 5.5 91cd39525e The labeling scripts are in labeling/scripts/
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 13:20:31 +01:00
9 changed files with 78 additions and 84 deletions

No files matched your search

+1
View File
@@ -10,3 +10,4 @@ detectors
tools tools
agents agents
optimizer optimizer
models
+4 -4
View File
@@ -1,11 +1,11 @@
# CLAUDE.md # CLAUDE.md
Diagnostic-app: the control station of the AIMsight diagnostic (`README.md`): the web app, and the launching of processes whose code lives elsewhere. A camera follows targets on a structure; the detectors read the displacement series of the stations and flag the moments when the curves must not be trusted (rain, fog, spider web, turbulence…) or a real movement. The architecture of the repositories: `docs/architecture.drawio`. aimsight-app: the control station of the AIMsight diagnostic (`README.md`): the web app, and the launching of processes whose code lives elsewhere. A camera follows targets on a structure; the detectors read the displacement series of the stations and flag the moments when the curves must not be trusted (rain, fog, spider web, turbulence…) or a real movement. The architecture of the repositories: `docs/architecture.drawio`.
- **The processes**: the Analysis tab launches `agents:analyst` (plugin `agents/`) on a range, with `instructions/analyst.md` and `DETECTORS: no` (labels and report in `labeling/auto/analyses/<STATION>_<start>_<end>/`, submitted to `labeling/auto/<STATION>.jsonl`); "Optimize the detectors" launches `/improve` in `optimizer/` (its request in `app/server/analysis.py`, its summary in `optimizer/sessions/<analysis>_<time>/summary.md`), which commits in `detectors/`, then `agents:tool-builder`, which commits in `tools/`. - **The processes**: the Analysis tab launches `agents:analyst` (plugin `agents/`) on a range, with `instructions/analyst.md` and `DETECTORS: no` (labels and report in `labeling/auto/analyses/<STATION>_<start>_<end>/`, submitted to `labeling/auto/<STATION>.jsonl`); "Optimize the detectors" launches `/optimize` in `optimizer/` on the analysis (its request in `app/server/analysis.py`, its summary in `optimizer/sessions/<analysis>_<time>/summary.md`), which commits the detectors in `detectors/` and the reading tools in `tools/`.
- **The links** (ignored by git, one copy of each repository on the workstation): `data/`, `labeling/`, `detectors/`, `tools/`, `agents/`, `optimizer/`; each thing is committed in its own repository, never here. This repository carries no agent, no reading tool, no workflow. - **The links** (ignored by git, one copy of each repository on the workstation): `data/`, `labeling/`, `detectors/`, `tools/`, `agents/`, `optimizer/`, `models/` (the pilot of learned detectors); each thing is committed in its own repository, never here. This repository carries no agent, no reading tool, no workflow.
- **The truth**: the labels of `labeling/auto/`; the labeling knowledge is in `labeling/`. - **The truth**: the labels of `labeling/auto/`; the labeling knowledge is in `labeling/`.
- **The contracts**: with the detectors, `detectors/CLAUDE.md` (`categories.events`, `bench/score.py`); with the agents, `agents/README.md` (the requests of the analyst and of the tool-builder); with Optimizer, `optimizer/README.md` (the request of `/improve`). A renaming over there requires the change here. The Data page passes to the detectors the measurements read by `tools/scripts/data.py`, whereas the benchmark and Optimizer read through `detectors/scripts/data.py`: a reading fix in one is carried over to the other. - **The contracts**: with the detectors, `detectors/CLAUDE.md` (`categories.events`, `bench/score.py`); with the agents, `agents/README.md` (the request of the analyst); with Optimizer, `optimizer/README.md` (the request of `/optimize`). A renaming over there requires the change here. The Data page passes to the detectors the measurements read by `tools/scripts/data.py`, whereas the benchmark and Optimizer read through `detectors/scripts/data.py`: a reading fix in one is carried over to the other.
- **The benchmark**: `python3 detectors/bench/regression.py --labels labeling/auto --data data` (~3 min); the score of a range: `python3 detectors/bench/score.py data/<STATION> --labels labeling/auto/<STATION>.jsonl --from YYYY-MM-DD --to YYYY-MM-DD` (`--to` excluded). - **The benchmark**: `python3 detectors/bench/regression.py --labels labeling/auto --data data` (~3 min); the score of a range: `python3 detectors/bench/score.py data/<STATION> --labels labeling/auto/<STATION>.jsonl --from YYYY-MM-DD --to YYYY-MM-DD` (`--to` excluded).
- **The pumping**: in `~/aimsight-data` (`extraction/pump.sh`, VS Code tasks **pump**, **pump a range**), read-only on the platform; user guide `~/aimsight-data/extraction/README.md`. Claude may launch it on small ranges; a long range or a history, outside busy hours. - **The pumping**: in `~/aimsight-data` (`extraction/pump.sh`, VS Code tasks **pump**, **pump a range**), read-only on the platform; user guide `~/aimsight-data/extraction/README.md`. Claude may launch it on small ranges; a long range or a history, outside busy hours.
- **Check a change of the app**: `.venv/bin/python app/server/check.py`, then `cd app/web && npm run build` and launch the server. The labels: `python3 labeling/validate.py`. - **Check a change of the app**: `.venv/bin/python app/server/check.py`, then `cd app/web && npm run build` and launch the server. The labels: `python3 labeling/validate.py`.
+13 -12
View File
@@ -1,9 +1,9 @@
# Diagnostic-app # aimsight-app
The control station of the AIMsight diagnostic: see, analyze, launch. The Data page shows the curves, the camera images, the labels and the detectors' events; its Analysis tab launches, by `claude -p`, processes whose code lives in the other repositories: The control station of the AIMsight diagnostic: see, analyze, launch. The Data page shows the curves, the camera images, the labels and the detectors' events; its Analysis tab launches, by `claude -p`, processes whose code lives in the other repositories:
- **"Analyze the range"**: the `analyst` of the agents repository, on a chosen range, with the app's instructions (`instructions/analyst.md`) and without the detectors (`DETECTORS: no`): labels, submitted to `labeling/auto/`, and a diagnostic report; - **"Analyze the range"**: the `analyst` of the agents repository, on a chosen range, with the app's instructions (`instructions/analyst.md`) and without the detectors (`DETECTORS: no`): labels, submitted to `labeling/auto/`, and a diagnostic report;
- **"Optimize the detectors"**, on a finished analysis: `/improve` in Optimizer improves the detectors on the range of the analysis, its labels as truth, without overfitting; then the `tool-builder` of the agents repository brings the analyst's scripts into the reading harness (tools repository). - **"Optimize the detectors"**, on a finished analysis: `/optimize` in Optimizer, on the analysis: it improves the detectors on the range of the analysis, its labels as truth, without overfitting; then it brings the analyst's scripts into the reading harness (tools repository).
The architecture of the repositories, one responsibility each: `docs/architecture.drawio`. The architecture of the repositories, one responsibility each: `docs/architecture.drawio`.
@@ -13,24 +13,25 @@ The architecture of the repositories, one responsibility each: `docs/architectur
- `instructions/analyst.md`: what the app asks of the analyst (output folder, report, dialogue). - `instructions/analyst.md`: what the app asks of the analyst (output folder, report, dialogue).
- `docs/`: the architecture of the repositories, the plans. - `docs/`: the architecture of the repositories, the plans.
And six links, ignored by git, to the neighbouring repositories (a single copy of each on the workstation): And seven links, ignored by git, to the neighbouring repositories (a single copy of each on the workstation):
| Link | Repository | What the app does with it | | Link | Repository | What the app does with it |
|---|---|---| |---|---|---|
| `data/` | `~/aimsight-data/data` | reads the data of the stations (outside git) | | `data/` | `~/aimsight-data/data` | reads the data of the stations (outside git) |
| `labeling/` | `~/labeling` | reads and writes the labels; the analyses go in `labeling/auto/analyses/` | | `labeling/` | `~/aimsight-labeling` | reads and writes the labels; the analyses go in `labeling/auto/analyses/` |
| `detectors/` | `~/detectors` | reads the detectors' events (`scripts/categories.py`) | | `detectors/` | `~/aimsight-detectors` | reads the detectors' events (`scripts/categories.py`) |
| `tools/` | `~/tools` | reads the data through `tools/scripts/data.py`; the analyst uses it, the tool-builder writes in it | | `tools/` | `~/aimsight-tools` | reads the data through `tools/scripts/data.py`; the analyst uses it, the upgrader writes in it (Optimizer) |
| `agents/` | `~/agents` | the plugin of the agents (`--plugin-dir agents`, `--agent agents:analyst`) | | `agents/` | `~/aimsight-agents` | the plugin of the agents (`--plugin-dir agents`, `--agent agents:analyst`) |
| `optimizer/` | `~/Optimizer` | launches `/improve` there; reads the summaries in `optimizer/sessions/` | | `optimizer/` | `~/aimsight-optimizer` | launches `/optimize` there; reads the summaries in `optimizer/sessions/` |
| `models/` | `~/aimsight-models` | nothing yet: the pilot of learned detectors (Visibility, Obstruction), measured with the benchmark |
Each thing is committed in its own repository: the labels in `~/labeling`, the detectors in `~/detectors` (the optimization session does it, without pushing), the tools in `~/tools` (the tool-builder does it). Each thing is committed in its own repository: the labels in `~/aimsight-labeling`, the detectors in `~/aimsight-detectors` (the optimization session does it, without pushing), the tools in `~/aimsight-tools` (the same session, through the upgrader).
## Install and launch ## Install and launch
```bash ```bash
ln -s ~/aimsight-data/data data && ln -s ~/labeling labeling && ln -s ~/detectors detectors ln -s ~/aimsight-data/data data && ln -s ~/aimsight-labeling labeling && ln -s ~/aimsight-detectors detectors
ln -s ~/tools tools && ln -s ~/agents agents && ln -s ~/Optimizer optimizer ln -s ~/aimsight-tools tools && ln -s ~/aimsight-agents agents && ln -s ~/aimsight-optimizer optimizer
``` ```
The VS Code task **Run app** creates `.venv` and builds the front end if they are missing, then launches the server. By hand: The VS Code task **Run app** creates `.venv` and builds the front end if they are missing, then launches the server. By hand:
@@ -50,5 +51,5 @@ The pumping is in the `~/aimsight-data` repository (`extraction/`, VS Code tasks
## Check ## Check
- the app: `.venv/bin/python app/server/check.py`; - the app: `.venv/bin/python app/server/check.py`;
- the labels: `python3 labeling/validate.py` (the labels submitted by the app do not have `review` yet, which it requires: as many expected errors); - the labels: `python3 labeling/scripts/validate.py` (the labels submitted by the app do not have `review` yet, which it requires: as many expected errors);
- the detectors (benchmark, ~3 min): `python3 detectors/bench/regression.py --labels labeling/auto --data data`. - the detectors (benchmark, ~3 min): `python3 detectors/bench/regression.py --labels labeling/auto --data data`.
+2 -2
View File
@@ -21,7 +21,7 @@ The address keeps the station and the range (UTC, `end` excluded): `#/data?stati
- **Analyze the range**: a range selected, optional hints, then `server/analysis.py` launches the analyst of the agents repository by `claude -p` (non-interactive), with its instructions (`instructions/analyst.md`) and without the detectors (`DETECTORS: no`). It writes in `labeling/auto/analyses/<STATION>_<start>_<end>/` its labels and a diagnostic report (`report.md` and its figures; its work and claude's log in `work/`, outside git). The page follows its progress, then shows the report; the server submits its labels to `labeling/auto/<STATION>.jsonl` (field `analysis`). "View the report" on such a label opens it again. - **Analyze the range**: a range selected, optional hints, then `server/analysis.py` launches the analyst of the agents repository by `claude -p` (non-interactive), with its instructions (`instructions/analyst.md`) and without the detectors (`DETECTORS: no`). It writes in `labeling/auto/analyses/<STATION>_<start>_<end>/` its labels and a diagnostic report (`report.md` and its figures; its work and claude's log in `work/`, outside git). The page follows its progress, then shows the report; the server submits its labels to `labeling/auto/<STATION>.jsonl` (field `analysis`). "View the report" on such a label opens it again.
- **The sidebar** sorts the analyses of `labeling/auto/analyses/` into folders, one per station (open by default if it has one running), and inside one analysis per range, the most recent first, with its state; a click opens Data on it. - **The sidebar** sorts the analyses of `labeling/auto/analyses/` into folders, one per station (open by default if it has one running), and inside one analysis per range, the most recent first, with its state; a click opens Data on it.
- **The messages**: after the report, the user writes to the analyst, the same session resumes (`--resume`). An analysis stops with the server ("interrupted"); "continue" in the message field resumes it. - **The messages**: after the report, the user writes to the analyst, the same session resumes (`--resume`). An analysis stops with the server ("interrupted"); "continue" in the message field resumes it.
- **Optimize the detectors**, on a finished analysis: `/improve` in Optimizer (`optimizer/`, with the plugin `agents/`) on the range of the analysis, then the `tool-builder` of the agents repository; the detectors committed in `detectors/`, the reading tools in `tools/`, each on its current branch. The page follows the thread of the session (`work/optimization.jsonl`), then shows its summary under the report (`optimizer/sessions/<analysis>_<time>/summary.md`, then `<analysis>/tools.md`). One optimization at a time; meanwhile, no analysis and no message to the analyst; an optimization cut by the server stopping is rerun with the button. The detectors' events are kept in memory until the end of an optimization: after an `/improve` run outside the app, restart the server. - **Optimize the detectors**, on a finished analysis: `/optimize` in Optimizer (`optimizer/`, with the plugin `agents/`) on the analysis: the detectors, then the reading tools; the detectors committed in `detectors/`, the reading tools in `tools/`, each on its current branch. The page follows the thread of the session (`work/optimization.jsonl`), then shows its summary under the report (`optimizer/sessions/<analysis>_<time>/summary.md`, and the `<analysis>/tools.md` of an older session). One optimization at a time; meanwhile, no analysis and no message to the analyst; an optimization cut by the server stopping is rerun with the button. The detectors' events are kept in memory until the end of an optimization: after an `/optimize` run outside the app, restart the server.
## Launch ## Launch
@@ -38,7 +38,7 @@ The page opens on `http://127.0.0.1:8770`. Settings by variables: `AIMSIGHT_DATA
- `server/server.py`: FastAPI; serves the built page and the API under `/api` (stations, images, curves, detectors, labels, analyses); answers only the pages of the workstation (local Host, declared JSON). - `server/server.py`: FastAPI; serves the built page and the API under `/api` (stations, images, curves, detectors, labels, analyses); answers only the pages of the workstation (local Host, declared JSON).
- `server/station.py`: the data of the Data page; read-only on `data/` (through `tools/scripts/data.py`), writes only in `labeling/{auto,manual}/`. - `server/station.py`: the data of the Data page; read-only on `data/` (through `tools/scripts/data.py`), writes only in `labeling/{auto,manual}/`.
- `server/analysis.py`: the Analysis tab; launches `claude` with the agent `agents:analyst` (Read, Write, Bash allowed without asking); and the optimization, `/improve` in Optimizer (Read, Write, Edit, Bash, Agent) then the agent `agents:tool-builder` (Read, Write, Edit, Bash). - `server/analysis.py`: the Analysis tab; launches `claude` with the agent `agents:analyst` (Read, Write, Bash allowed without asking); and the optimization, `/optimize` in Optimizer (Read, Write, Edit, Bash, Agent).
- `server/check.py`: checks, without calling claude: `.venv/bin/python app/server/check.py`. - `server/check.py`: checks, without calling claude: `.venv/bin/python app/server/check.py`.
- `web/`: React (Vite) and Mantine; `src/App.jsx` (header, sidebar, address), `src/pages/Data.jsx` (the page), `src/pages/Images.jsx` (the images, in Data), `src/common.jsx` (requests, selector), `src/main.jsx` (theme). Plotly, dressed in Mantine's colours, loads only with Data. `dist/` and `node_modules/` outside git. - `web/`: React (Vite) and Mantine; `src/App.jsx` (header, sidebar, address), `src/pages/Data.jsx` (the page), `src/pages/Images.jsx` (the images, in Data), `src/common.jsx` (requests, selector), `src/main.jsx` (theme). Plotly, dressed in Mantine's colours, loads only with Data. `dist/` and `node_modules/` outside git.
+30 -37
View File
@@ -5,17 +5,17 @@ labeling/auto/analyses/<STATION>_<start>_<end>/ its labels (labels.jsonl) and a
next to it); at the end, the server submits its labels to labeling/auto/<STATION>.jsonl, marked with their analysis (field next to it); at the end, the server submits its labels to labeling/auto/<STATION>.jsonl, marked with their analysis (field
`analysis`). Then the user can write to it: the same session resumes (`claude -p --resume`), and its labels, if they `analysis`). Then the user can write to it: the same session resumes (`claude -p --resume`), and its labels, if they
change, replace those it had submitted. change, replace those it had submitted.
On a finished analysis, "Optimize" launches `/improve` in Optimizer (optimizer/, the skill that improves the detectors on the On a finished analysis, "Optimize" launches `/optimize` in Optimizer (optimizer/, the skill that, from the analysis, improves
range of the analysis, its labels as truth), then the tool-builder of the agents repository, which brings the analyst's the detectors on its range, its labels as truth, then brings the analyst's scripts into the reading tools, tools/); one
scripts into the reading tools (tools/); one optimization at a time, no analysis or message meanwhile; the summary of the optimization at a time, no analysis or message meanwhile; the summary of the session
session (optimizer/sessions/<analysis>_<time>/summary.md) and that of the tools (<analysis>/tools.md) show under the report. (optimizer/sessions/<analysis>_<time>/summary.md, and the <analysis>/tools.md of an older session) shows under the report.
""" """
import html import html
import json import json
import os import os
import subprocess import subprocess
import threading import threading
from datetime import date, datetime, timedelta, timezone from datetime import datetime, timezone
import markdown import markdown
@@ -23,14 +23,14 @@ import station
FOLDER = station.LABELS / "auto" / "analyses" FOLDER = station.LABELS / "auto" / "analyses"
DETECTORS = station.ROOT / "detectors" DETECTORS = station.ROOT / "detectors"
AGENTS = station.ROOT / "agents" # the plugin of the generic agents (~/agents) AGENTS = station.ROOT / "agents" # the plugin of the generic agents (~/aimsight-agents)
OPTIMIZER = station.ROOT / "optimizer" # the Optimizer repository (~/Optimizer), where /improve runs OPTIMIZER = station.ROOT / "optimizer" # the Optimizer repository (~/aimsight-optimizer), where /optimize runs
SESSIONS = OPTIMIZER / "sessions" SESSIONS = OPTIMIZER / "sessions"
# the request of /improve (optimizer/README.md), paths relative to the root of Optimizer (its links data, labeling, detectors) # the request of /optimize (optimizer/README.md), paths relative to the root of Optimizer (its links); Optimizer reads the
IMPROVE = """/improve DETECTORS: detectors/. STATION: data/{station}. FROM: {start}. TO: {end}. \ # station and the range in the analysis
LABELS: labeling/auto/{station}.jsonl. REFERENCE: --labels labeling/auto --data data. FAMILIES: labeling/families.md. \ OPTIMIZE = """/optimize ANALYSIS: labeling/auto/analyses/{name}/. OUT: sessions/{name}_{time}/. Caller's context: \
CONTEXT: labeling/auto/analyses/{name}/report.md. OUT: sessions/{name}_{time}/. Caller's context: Diagnostic-app, through \ aimsight-app, through Optimizer; read-only on data/ and labeling/; commit only in detectors/ and tools/, on their current \
Optimizer; read-only on data/ and labeling/; commit only in detectors/, on its current branch; do not commit OUT.""" branch; do not commit OUT."""
REQUEST = """Station: data/{station}/. Range: {start} → {end} (UTC). Hints: {hints}. \ REQUEST = """Station: data/{station}/. Range: {start} → {end} (UTC). Hints: {hints}. \
Output folder: {out}/. DETECTORS: no. INSTRUCTIONS: instructions/analyst.md.""" Output folder: {out}/. DETECTORS: no. INSTRUCTIONS: instructions/analyst.md."""
@@ -229,7 +229,7 @@ def report(name, dark):
return _page(file(name, "report.md").read_text(encoding="utf-8"), name, dark) return _page(file(name, "report.md").read_text(encoding="utf-8"), name, dark)
# --- "Optimize": /improve in Optimizer on the analysis, then the tool-builder, by claude -p # --- "Optimize": /optimize in Optimizer on the analysis, by claude -p
def _summary_file(name): def _summary_file(name):
"""The summary of the last session of this analysis, or None. The time pattern rules out the sessions of another """The summary of the last session of this analysis, or None. The time pattern rules out the sessions of another
@@ -258,8 +258,8 @@ def optimize(name):
"""The "Optimize" button on a finished analysis: the session in a thread; refused if an optimization or an analysis runs.""" """The "Optimize" button on a finished analysis: the session in a thread; refused if an optimization or an analysis runs."""
if state(name)["state"] != "done": if state(name)["state"] != "done":
raise station.Refusal("only a finished analysis can be optimized") raise station.Refusal("only a finished analysis can be optimized")
if not ((OPTIMIZER / ".claude" / "skills" / "improve" / "SKILL.md").exists() if not ((OPTIMIZER / ".claude" / "skills" / "optimize" / "SKILL.md").exists()
and all((OPTIMIZER / link).exists() for link in ("data", "labeling", "detectors")) and all((OPTIMIZER / link).exists() for link in ("data", "labeling", "detectors", "tools"))
and (AGENTS / ".claude-plugin" / "plugin.json").exists()): and (AGENTS / ".claude-plugin" / "plugin.json").exists()):
raise station.Refusal("no Optimizer in optimizer/ or no agents in agents/ (the links: README.md)") raise station.Refusal("no Optimizer in optimizer/ or no agents in agents/ (the links: README.md)")
with lock: with lock:
@@ -273,32 +273,25 @@ def optimize(name):
def optimize_thread(name): def optimize_thread(name):
"""The two turns of the optimization, one after the other: the detectors (/improve, in Optimizer), then the reading """The optimization: /optimize in Optimizer, on the analysis (the detectors, then the reading tools)."""
tools (the tool-builder, even if the detectors did not change)."""
o, out = optimizations[name], FOLDER / name o, out = optimizations[name], FOLDER / name
rel = os.path.relpath(out, station.ROOT)
(out / "work").mkdir(exist_ok=True) (out / "work").mkdir(exist_ok=True)
with open(out / "work" / "optimization.jsonl", "a", encoding="utf-8") as stream: with open(out / "work" / "optimization.jsonl", "a", encoding="utf-8") as stream:
try: try:
d = json.loads((out / "request.json").read_text(encoding="utf-8")) request = OPTIMIZE.format(name=name, time=f"{datetime.now(timezone.utc):%Y%m%dT%H%MZ}")
request = IMPROVE.format( # TO excluded: the day after the end of the range, as in the page
station=d["station"], start=d["start"][:10], end=date.fromisoformat(d["end"][:10]) + timedelta(days=1),
name=name, time=f"{datetime.now(timezone.utc):%Y%m%dT%H%MZ}")
# ponytail: Optimizer reads data/ and labeling/ through its own links; AIMSIGHT_DATA / AIMSIGHT_LABELS do not follow # ponytail: Optimizer reads data/ and labeling/ through its own links; AIMSIGHT_DATA / AIMSIGHT_LABELS do not follow
turns = [(OPTIMIZER.resolve(), [request, "--plugin-dir", str(AGENTS.resolve()), p = subprocess.Popen(["claude", "-p", request, *ISOLATED, "--output-format", "stream-json", "--verbose",
"--add-dir", str(DETECTORS.resolve()), # the target of the link, where the session writes "--permission-mode", "acceptEdits", *station.links(), # tools/ among them, where it writes
"--allowedTools", "Read,Write,Edit,Bash,Agent"]), "--plugin-dir", str(AGENTS.resolve()),
(station.ROOT, [f"Analysis: {rel}/. Tools: tools/. Write {rel}/tools.md.", "--plugin-dir", str(AGENTS), "--add-dir", str(DETECTORS.resolve()), # the target of the link, where the session writes
"--agent", "agents:tool-builder", "--allowedTools", "Read,Write,Edit,Bash"])] "--allowedTools", "Read,Write,Edit,Bash,Agent"],
for cwd, (prompt, *options) in turns: cwd=OPTIMIZER.resolve(), env=_env(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
p = subprocess.Popen(["claude", "-p", prompt, *ISOLATED, "--output-format", "stream-json", "--verbose", text=True)
"--permission-mode", "acceptEdits", *station.links(), *options], for line in p.stdout:
cwd=cwd, env=_env(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True) stream.write(line)
for line in p.stdout: o["lines"] += digest(line)
stream.write(line) if p.wait():
o["lines"] += digest(line) raise RuntimeError(f"claude ended with code {p.returncode}")
if p.wait():
raise RuntimeError(f"claude ended with code {p.returncode}")
o["state"] = "done" o["state"] = "done"
except Exception as e: # noqa: BLE001 — the error shows in the page, the server goes on except Exception as e: # noqa: BLE001 — the error shows in the page, the server goes on
o["lines"].append(f"Error: {e}") o["lines"].append(f"Error: {e}")
@@ -309,7 +302,7 @@ def optimize_thread(name):
def summary(name, dark): def summary(name, dark):
"""The summary of the detectors' session, then that of the tools (<analysis>/tools.md), in one page.""" """The summary of the session (the detectors and the tools), then the <analysis>/tools.md of an older session."""
s, tools = _summary_file(name), FOLDER / name / "tools.md" s, tools = _summary_file(name), FOLDER / name / "tools.md"
if s is None and not tools.exists(): if s is None and not tools.exists():
raise station.Refusal("no summary for this analysis") raise station.Refusal("no summary for this analysis")
+10 -11
View File
@@ -134,14 +134,16 @@ def check_optimization():
assert analysis.state("NORDEND_a")["optimization"] is None assert analysis.state("NORDEND_a")["optimization"] is None
# without Optimizer, then without agents: a clear refusal, not an error trace # without Optimizer, then without agents: a clear refusal, not an error trace
assert "optimizer/" in refuses(analysis.optimize, "NORDEND_a") assert "optimizer/" in refuses(analysis.optimize, "NORDEND_a")
(analysis.OPTIMIZER / ".claude" / "skills" / "improve").mkdir(parents=True) (analysis.OPTIMIZER / ".claude" / "skills" / "optimize").mkdir(parents=True)
(analysis.OPTIMIZER / ".claude" / "skills" / "improve" / "SKILL.md").write_text("improve") (analysis.OPTIMIZER / ".claude" / "skills" / "optimize" / "SKILL.md").write_text("optimize")
assert "agents/" in refuses(analysis.optimize, "NORDEND_a") assert "agents/" in refuses(analysis.optimize, "NORDEND_a")
(analysis.AGENTS / ".claude-plugin").mkdir(parents=True) (analysis.AGENTS / ".claude-plugin").mkdir(parents=True)
(analysis.AGENTS / ".claude-plugin" / "plugin.json").write_text("{}") (analysis.AGENTS / ".claude-plugin" / "plugin.json").write_text("{}")
assert "optimizer/" in refuses(analysis.optimize, "NORDEND_a") # without the data, labeling, detectors links of Optimizer assert "optimizer/" in refuses(analysis.optimize, "NORDEND_a") # without the links of Optimizer
for link in ("data", "labeling", "detectors"): for link in ("data", "labeling", "detectors"):
(analysis.OPTIMIZER / link).mkdir() (analysis.OPTIMIZER / link).mkdir()
assert "optimizer/" in refuses(analysis.optimize, "NORDEND_a") # without its tools link
(analysis.OPTIMIZER / "tools").mkdir()
assert analysis.optimize("NORDEND_a") == {} assert analysis.optimize("NORDEND_a") == {}
assert analysis.state("NORDEND_a")["optimization"]["state"] == "running" assert analysis.state("NORDEND_a")["optimization"]["state"] == "running"
refuses(analysis.optimize, "NORDEND_a") refuses(analysis.optimize, "NORDEND_a")
@@ -152,18 +154,15 @@ def check_optimization():
while analysis.state("NORDEND_a")["optimization"]["state"] == "running": while analysis.state("NORDEND_a")["optimization"]["state"] == "running":
time.sleep(0.05) time.sleep(0.05)
assert analysis.state("NORDEND_a")["optimization"]["state"] == "done" assert analysis.state("NORDEND_a")["optimization"]["state"] == "done"
args, k = launched[0] # /improve in Optimizer, on the range of the analysis, TO excluded assert len(launched) == 1, launched # a single call: /optimize in Optimizer, on the analysis
args, k = launched[0]
request = args[2] request = args[2]
assert request.startswith("/improve ") and "STATION: data/NORDEND. FROM: 2026-11-04. TO: 2026-11-08." in request \ assert request.startswith("/optimize ANALYSIS: labeling/auto/analyses/NORDEND_a/. OUT: sessions/NORDEND_a_") \
and "OUT: sessions/NORDEND_a_" in request and "FAMILIES: labeling/families.md." in request \ and "Caller's context:" in request, request
and "CONTEXT: labeling/auto/analyses/NORDEND_a/report.md." in request, request
assert k["cwd"] == analysis.OPTIMIZER.resolve() and "--plugin-dir" in args, (args, k) assert k["cwd"] == analysis.OPTIMIZER.resolve() and "--plugin-dir" in args, (args, k)
assert all("ANTHROPIC_API_KEY" not in kw["env"] for _, kw in launched), "an API key reaches claude" assert all("ANTHROPIC_API_KEY" not in kw["env"] for _, kw in launched), "an API key reaches claude"
# isolated from the settings of the workstation (the user's plugins, hooks, MCP servers) # isolated from the settings of the workstation (the user's plugins, hooks, MCP servers)
assert all(a[a.index("--setting-sources") + 1] == "project,local" and "--strict-mcp-config" in a for a, _ in launched) assert all(a[a.index("--setting-sources") + 1] == "project,local" and "--strict-mcp-config" in a for a, _ in launched)
args, k = launched[1] # then the tool-builder of the agents repository, on the tools repository
assert args[args.index("--agent") + 1] == "agents:tool-builder" and "Tools: tools/" in args[2] \
and args[2].endswith("/tools.md."), args
analysis.analyses["NORDEND_b"]["state"] = "running" # a running analysis blocks the optimization analysis.analyses["NORDEND_b"]["state"] = "running" # a running analysis blocks the optimization
refuses(analysis.optimize, "NORDEND_a") refuses(analysis.optimize, "NORDEND_a")
# after a restart: the stream ends with {"type": "end"} -> done; without that line -> interrupted; the summary of # after a restart: the stream ends with {"type": "end"} -> done; without that line -> interrupted; the summary of
@@ -177,7 +176,7 @@ def check_optimization():
analysis.optimizations.clear() analysis.optimizations.clear()
assert analysis.state("NORDEND_a")["optimization"]["state"] == "interrupted" assert analysis.state("NORDEND_a")["optimization"]["state"] == "interrupted"
(analysis.SESSIONS / "NORDEND_a_20261113T1000Z").mkdir(parents=True) (analysis.SESSIONS / "NORDEND_a_20261113T1000Z").mkdir(parents=True)
(analysis.SESSIONS / "NORDEND_a_20261113T1000Z" / "summary.md").write_text("# improve\n\n**Result**: none") (analysis.SESSIONS / "NORDEND_a_20261113T1000Z" / "summary.md").write_text("# optimize\n\n**Result**: none")
# a new analysis of the same range (NORDEND_a_143000): its session is not the summary of NORDEND_a # a new analysis of the same range (NORDEND_a_143000): its session is not the summary of NORDEND_a
(analysis.SESSIONS / "NORDEND_a_143000_20261113T1100Z").mkdir(parents=True) (analysis.SESSIONS / "NORDEND_a_143000_20261113T1100Z").mkdir(parents=True)
(analysis.SESSIONS / "NORDEND_a_143000_20261113T1100Z" / "summary.md").write_text("# other analysis") (analysis.SESSIONS / "NORDEND_a_143000_20261113T1100Z" / "summary.md").write_text("# other analysis")
+4 -4
View File
@@ -20,10 +20,10 @@ sys.path[:0] = [str(ROOT / "tools" / "scripts"), str(ROOT / "detectors" / "scrip
import data # noqa: E402 import data # noqa: E402
from categories import events # noqa: E402 from categories import events # noqa: E402
# data/ and labeling/ are links to ~/aimsight-data/data and ~/labeling: no resolve(), the agents see data/ and labeling/ # data/ and labeling/ are links to ~/aimsight-data/data and ~/aimsight-labeling: no resolve(), the agents see data/ and labeling/
DATA = Path(os.environ.get("AIMSIGHT_DATA", ROOT / "data")).absolute() DATA = Path(os.environ.get("AIMSIGHT_DATA", ROOT / "data")).absolute()
LABELS = Path(os.environ.get("AIMSIGHT_LABELS", ROOT / "labeling")).absolute() LABELS = Path(os.environ.get("AIMSIGHT_LABELS", ROOT / "labeling")).absolute()
TOOLS = ROOT / "tools" # the reading harness (~/tools), read by the analyst and written by the tool-builder TOOLS = ROOT / "tools" # the reading harness (~/aimsight-tools), read by the analyst and written by the upgrader (Optimizer)
def links(): def links():
@@ -187,7 +187,7 @@ def curves(station, start, end):
HISTORY = timedelta(days=3) # days before given to the detectors, as categories.py does (rule of 2026-10-24) HISTORY = timedelta(days=3) # days before given to the detectors, as categories.py does (rule of 2026-10-24)
# ponytail: kept until the server restarts (a minute or more per range); restart it after an /improve run outside the app # ponytail: kept until the server restarts (a minute or more per range); restart it after an /optimize run outside the app
@functools.lru_cache(maxsize=32) @functools.lru_cache(maxsize=32)
def detectors(station, start, end, targets=""): def detectors(station, start, end, targets=""):
"""-> the detectors' events over the range, in the label format (start, end, family, description); plus kind, """-> the detectors' events over the range, in the label format (start, end, family, description); plus kind,
@@ -263,7 +263,7 @@ def read(station, source):
def assign_ids(station, labels): def assign_ids(station, labels):
"""As labeling/ids.py does (D-131): an id for the labels without one, the next of the station, as first field.""" """As labeling/scripts/ids.py does (D-131): an id for the labels without one, the next of the station, as first field."""
n = max((int(e["id"].rsplit("-", 1)[1]) for e in labels if "id" in e), default=0) n = max((int(e["id"].rsplit("-", 1)[1]) for e in labels if "id" in e), default=0)
for e in labels: for e in labels:
if "id" not in e: if "id" not in e:
+13 -13
View File
@@ -10,19 +10,19 @@
<mxCell id="expert" parent="1" style="shape=umlActor;verticalLabelPosition=bottom;verticalAlign=top;html=1;fontSize=12;" value="L&#39;expert" vertex="1"> <mxCell id="expert" parent="1" style="shape=umlActor;verticalLabelPosition=bottom;verticalAlign=top;html=1;fontSize=12;" value="L&#39;expert" vertex="1">
<mxGeometry height="55" width="30" x="800" y="-130" as="geometry" /> <mxGeometry height="55" width="30" x="800" y="-130" as="geometry" />
</mxCell> </mxCell>
<mxCell id="app" parent="1" style="rounded=1;arcSize=4;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=12;align=left;verticalAlign=top;spacingLeft=8;spacingRight=8;spacingTop=4;" value="&lt;b style=&quot;font-size:14px&quot;&gt;Diagnostic-App&lt;/b&gt;&lt;br&gt;&lt;i&gt;le poste de pilotage : voir, analyser, lancer&lt;/i&gt;&lt;br&gt;• app/ : serveur FastAPI, page Data (courbes, images, étiquettes, événements des détecteurs), onglet Analysis&lt;br&gt;• boutons « Analyser la plage », « Optimiser les détecteurs » : ils lancent des processus dont le code vit ailleurs&lt;br&gt;&lt;font color=&quot;#2e7d32&quot;&gt;&lt;b&gt;+&lt;/b&gt;&lt;/font&gt; consignes/analyste.md : ce que l&#39;app demande à l&#39;analyste (dossier de sortie, rapport, dialogue)&lt;br&gt;&lt;font color=&quot;#c62828&quot;&gt;&lt;b&gt;→&lt;/b&gt;&lt;/font&gt; agent-tools/ et le skill lire-les-donnees (vers tools) ; analyste et tool-builder (vers agents)" vertex="1"> <mxCell id="app" parent="1" style="rounded=1;arcSize=4;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=12;align=left;verticalAlign=top;spacingLeft=8;spacingRight=8;spacingTop=4;" value="&lt;b style=&quot;font-size:14px&quot;&gt;aimsight-app&lt;/b&gt;&lt;br&gt;&lt;i&gt;le poste de pilotage : voir, analyser, lancer&lt;/i&gt;&lt;br&gt;• app/ : serveur FastAPI, page Data (courbes, images, étiquettes, événements des détecteurs), onglet Analysis&lt;br&gt;• boutons « Analyser la plage », « Optimiser les détecteurs » : ils lancent des processus dont le code vit ailleurs&lt;br&gt;&lt;font color=&quot;#2e7d32&quot;&gt;&lt;b&gt;+&lt;/b&gt;&lt;/font&gt; consignes/analyste.md : ce que l&#39;app demande à l&#39;analyste (dossier de sortie, rapport, dialogue)&lt;br&gt;&lt;font color=&quot;#c62828&quot;&gt;&lt;b&gt;→&lt;/b&gt;&lt;/font&gt; agent-tools/ et le skill lire-les-donnees (vers tools) ; analyste et tool-builder (vers agents)" vertex="1">
<mxGeometry height="110" width="610" x="510" y="70" as="geometry" /> <mxGeometry height="110" width="610" x="510" y="70" as="geometry" />
</mxCell> </mxCell>
<mxCell id="agents" parent="1" style="rounded=1;arcSize=4;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=12;align=left;verticalAlign=top;spacingLeft=8;spacingRight=8;spacingTop=4;" value="&lt;b style=&quot;font-size:14px&quot;&gt;agents&lt;/b&gt;&lt;br&gt;&lt;i&gt;les agents génériques, un seul exemplaire de chacun&lt;/i&gt;&lt;br&gt;&lt;font color=&quot;#2e7d32&quot;&gt;&lt;b&gt;+&lt;/b&gt;&lt;/font&gt; analyste : DETECTEURS oui/non, CONSIGNES (le fichier de l&#39;appelant)&lt;br&gt;&lt;font color=&quot;#2e7d32&quot;&gt;&lt;b&gt;+&lt;/b&gt;&lt;/font&gt; tool-builder (de Diagnostic-App)&lt;br&gt;&lt;font color=&quot;#2e7d32&quot;&gt;&lt;b&gt;+&lt;/b&gt;&lt;/font&gt; upgrader, validator (de detectors)&lt;br&gt;• un plugin Claude Code, chargé en lecture ; l&#39;appelant passe ses paramètres dans la requête&lt;br&gt;• Claude n&#39;écrit pas dans un plugin chargé : ce qui s&#39;écrit (outils, détecteurs, séances) vit ailleurs" vertex="1"> <mxCell id="agents" parent="1" style="rounded=1;arcSize=4;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=12;align=left;verticalAlign=top;spacingLeft=8;spacingRight=8;spacingTop=4;" value="&lt;b style=&quot;font-size:14px&quot;&gt;aimsight-agents&lt;/b&gt;&lt;br&gt;&lt;i&gt;les agents génériques, un seul exemplaire de chacun&lt;/i&gt;&lt;br&gt;&lt;font color=&quot;#2e7d32&quot;&gt;&lt;b&gt;+&lt;/b&gt;&lt;/font&gt; analyste : DETECTEURS oui/non, CONSIGNES (le fichier de l&#39;appelant)&lt;br&gt;&lt;font color=&quot;#2e7d32&quot;&gt;&lt;b&gt;+&lt;/b&gt;&lt;/font&gt; tool-builder (de aimsight-app)&lt;br&gt;&lt;font color=&quot;#2e7d32&quot;&gt;&lt;b&gt;+&lt;/b&gt;&lt;/font&gt; upgrader, validator (de detectors)&lt;br&gt;• un plugin Claude Code, chargé en lecture ; l&#39;appelant passe ses paramètres dans la requête&lt;br&gt;• Claude n&#39;écrit pas dans un plugin chargé : ce qui s&#39;écrit (outils, détecteurs, séances) vit ailleurs" vertex="1">
<mxGeometry height="130" width="540" x="-325" y="450" as="geometry" /> <mxGeometry height="130" width="540" x="-325" y="450" as="geometry" />
</mxCell> </mxCell>
<mxCell id="opt" parent="1" style="rounded=1;arcSize=4;whiteSpace=wrap;html=1;fillColor=#ffe6cc;strokeColor=#d79b00;fontSize=12;align=left;verticalAlign=top;spacingLeft=8;spacingRight=8;spacingTop=4;" value="&lt;b style=&quot;font-size:14px&quot;&gt;Optimizer&lt;/b&gt;&lt;br&gt;&lt;i&gt;l&#39;optimisation des détecteurs, sur les étiquettes de labeling/auto&lt;/i&gt;&lt;br&gt;&lt;font color=&quot;#2e7d32&quot;&gt;&lt;b&gt;+&lt;/b&gt;&lt;/font&gt; .claude/skills/improve/ : l&#39;orchestrateur (ex wf-improve de detectors)&lt;br&gt;&lt;font color=&quot;#2e7d32&quot;&gt;&lt;b&gt;+&lt;/b&gt;&lt;/font&gt; seances/&amp;lt;analyse&amp;gt;_&amp;lt;heure&amp;gt;/ : mesures, modification, validation, bilan&lt;br&gt;• lancé par l&#39;app ou à la main&lt;br&gt;&lt;font color=&quot;#c62828&quot;&gt;&lt;b&gt;→&lt;/b&gt;&lt;/font&gt; archive/ : batch.py, scanner, batches/, outils/, essais et leur spec : l&#39;auto-étiquetage par les détecteurs, arrêté" vertex="1"> <mxCell id="opt" parent="1" style="rounded=1;arcSize=4;whiteSpace=wrap;html=1;fillColor=#ffe6cc;strokeColor=#d79b00;fontSize=12;align=left;verticalAlign=top;spacingLeft=8;spacingRight=8;spacingTop=4;" value="&lt;b style=&quot;font-size:14px&quot;&gt;aimsight-optimizer&lt;/b&gt;&lt;br&gt;&lt;i&gt;l&#39;optimisation des détecteurs, sur les étiquettes de labeling/auto&lt;/i&gt;&lt;br&gt;&lt;font color=&quot;#2e7d32&quot;&gt;&lt;b&gt;+&lt;/b&gt;&lt;/font&gt; .claude/skills/improve/ : l&#39;orchestrateur (ex wf-improve de detectors)&lt;br&gt;&lt;font color=&quot;#2e7d32&quot;&gt;&lt;b&gt;+&lt;/b&gt;&lt;/font&gt; seances/&amp;lt;analyse&amp;gt;_&amp;lt;heure&amp;gt;/ : mesures, modification, validation, bilan&lt;br&gt;• lancé par l&#39;app ou à la main&lt;br&gt;&lt;font color=&quot;#c62828&quot;&gt;&lt;b&gt;→&lt;/b&gt;&lt;/font&gt; archive/ : batch.py, scanner, batches/, outils/, essais et leur spec : l&#39;auto-étiquetage par les détecteurs, arrêté" vertex="1">
<mxGeometry height="130" width="440" x="510" y="660" as="geometry" /> <mxGeometry height="130" width="440" x="510" y="660" as="geometry" />
</mxCell> </mxCell>
<mxCell id="data" parent="1" style="rounded=1;arcSize=4;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;fontSize=12;align=left;verticalAlign=top;spacingLeft=8;spacingRight=8;spacingTop=4;" value="&lt;b style=&quot;font-size:14px&quot;&gt;aimsight-data&lt;/b&gt;&lt;br&gt;&lt;i&gt;les données : les pomper&lt;/i&gt;&lt;br&gt;• data/&amp;lt;STATION&amp;gt;/ : les mesures et les images (hors de git)&lt;br&gt;• extraction/ : le pompage, chaque nuit" vertex="1"> <mxCell id="data" parent="1" style="rounded=1;arcSize=4;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;fontSize=12;align=left;verticalAlign=top;spacingLeft=8;spacingRight=8;spacingTop=4;" value="&lt;b style=&quot;font-size:14px&quot;&gt;aimsight-data&lt;/b&gt;&lt;br&gt;&lt;i&gt;les données : les pomper&lt;/i&gt;&lt;br&gt;• data/&amp;lt;STATION&amp;gt;/ : les mesures et les images (hors de git)&lt;br&gt;• extraction/ : le pompage, chaque nuit" vertex="1">
<mxGeometry height="95" width="590" x="-220" y="-80" as="geometry" /> <mxGeometry height="95" width="590" x="-220" y="-80" as="geometry" />
</mxCell> </mxCell>
<mxCell id="tools" parent="1" style="rounded=1;arcSize=4;whiteSpace=wrap;html=1;fillColor=#b0e3e6;strokeColor=#0e8088;fontSize=12;align=left;verticalAlign=top;spacingLeft=8;spacingRight=8;spacingTop=4;" value="&lt;b style=&quot;font-size:14px&quot;&gt;tools&lt;/b&gt; (nouveau)&lt;br&gt;&lt;i&gt;le harnais de lecture : les méthodes données à l&#39;agent pour appréhender les données&lt;/i&gt;&lt;br&gt;&lt;font color=&quot;#2e7d32&quot;&gt;&lt;b&gt;+&lt;/b&gt;&lt;/font&gt; les outils (de Diagnostic-App agent-tools/) : inventaire, resume, plages, jours, ensemble, metriques, qualite, stations, graphique, vignettes, gif&lt;br&gt;&lt;font color=&quot;#2e7d32&quot;&gt;&lt;b&gt;+&lt;/b&gt;&lt;/font&gt; donnees.py, la lecture commune (aussi pour l&#39;app) ; le guide, quel outil pour quelle question (ex skill lire-les-donnees)&lt;br&gt;• seul le tool-builder y écrit : il optimise ou ajoute, ne retire rien" vertex="1"> <mxCell id="tools" parent="1" style="rounded=1;arcSize=4;whiteSpace=wrap;html=1;fillColor=#b0e3e6;strokeColor=#0e8088;fontSize=12;align=left;verticalAlign=top;spacingLeft=8;spacingRight=8;spacingTop=4;" value="&lt;b style=&quot;font-size:14px&quot;&gt;aimsight-tools&lt;/b&gt; (nouveau)&lt;br&gt;&lt;i&gt;le harnais de lecture : les méthodes données à l&#39;agent pour appréhender les données&lt;/i&gt;&lt;br&gt;&lt;font color=&quot;#2e7d32&quot;&gt;&lt;b&gt;+&lt;/b&gt;&lt;/font&gt; les outils (de aimsight-app agent-tools/) : inventaire, resume, plages, jours, ensemble, metriques, qualite, stations, graphique, vignettes, gif&lt;br&gt;&lt;font color=&quot;#2e7d32&quot;&gt;&lt;b&gt;+&lt;/b&gt;&lt;/font&gt; donnees.py, la lecture commune (aussi pour l&#39;app) ; le guide, quel outil pour quelle question (ex skill lire-les-donnees)&lt;br&gt;• seul le tool-builder y écrit : il optimise ou ajoute, ne retire rien" vertex="1">
<mxGeometry height="165" width="470" x="-350" y="160" as="geometry" /> <mxGeometry height="165" width="470" x="-350" y="160" as="geometry" />
</mxCell> </mxCell>
<mxCell id="dep-t1" edge="1" parent="1" source="tools" style="edgeStyle=orthogonalEdgeStyle;rounded=1;html=1;endArrow=block;endFill=1;fontSize=11;labelBackgroundColor=#ffffff;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0.398;entryY=1;entryDx=0;entryDy=0;" target="data" value="lit data/"> <mxCell id="dep-t1" edge="1" parent="1" source="tools" style="edgeStyle=orthogonalEdgeStyle;rounded=1;html=1;endArrow=block;endFill=1;fontSize=11;labelBackgroundColor=#ffffff;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0.398;entryY=1;entryDx=0;entryDy=0;" target="data" value="lit data/">
@@ -35,10 +35,10 @@
</Array> </Array>
</mxGeometry> </mxGeometry>
</mxCell> </mxCell>
<mxCell id="lab" parent="1" style="rounded=1;arcSize=4;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;fontSize=12;align=left;verticalAlign=top;spacingLeft=8;spacingRight=8;spacingTop=4;" value="&lt;b style=&quot;font-size:14px&quot;&gt;labeling&lt;/b&gt; — inchangé&lt;br&gt;&lt;i&gt;la vérité : les étiquettes et le savoir pour les poser&lt;/i&gt;&lt;br&gt;• manual/ : l&#39;expert ; auto/ : les agents, la vérité de l&#39;entraînement des détecteurs&lt;br&gt;• auto/analyses/ : les analyses de l&#39;app (rapport, étiquettes, scripts)&lt;br&gt;• familles, règles d&#39;étiquetage, carte des étiquettes, connaissances&lt;br&gt;• controle.py, ids.py, precedents.py (le RAG, par Ollama)" vertex="1"> <mxCell id="lab" parent="1" style="rounded=1;arcSize=4;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;fontSize=12;align=left;verticalAlign=top;spacingLeft=8;spacingRight=8;spacingTop=4;" value="&lt;b style=&quot;font-size:14px&quot;&gt;aimsight-labeling&lt;/b&gt; — inchangé&lt;br&gt;&lt;i&gt;la vérité : les étiquettes et le savoir pour les poser&lt;/i&gt;&lt;br&gt;• manual/ : l&#39;expert ; auto/ : les agents, la vérité de l&#39;entraînement des détecteurs&lt;br&gt;• auto/analyses/ : les analyses de l&#39;app (rapport, étiquettes, scripts)&lt;br&gt;• familles, règles d&#39;étiquetage, carte des étiquettes, connaissances&lt;br&gt;• controle.py, ids.py, precedents.py (le RAG, par Ollama)" vertex="1">
<mxGeometry height="110" width="460" x="500" y="460" as="geometry" /> <mxGeometry height="110" width="460" x="500" y="460" as="geometry" />
</mxCell> </mxCell>
<mxCell id="det" parent="1" style="rounded=1;arcSize=4;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;fontSize=12;align=left;verticalAlign=top;spacingLeft=8;spacingRight=8;spacingTop=4;" value="&lt;b style=&quot;font-size:14px&quot;&gt;detectors&lt;/b&gt;&lt;br&gt;&lt;i&gt;les détecteurs et leur benchmark&lt;/i&gt;&lt;br&gt;• scripts/ : un détecteur par famille, categories.py, data.py&lt;br&gt;• thresholds.md ; contrat lu par l&#39;app et l&#39;Optimizer : categories.events, data.py&lt;br&gt;• bench/ : score.py, regression.py, sensors.py (ex skills/wf-improve/scripts/)&lt;br&gt;&lt;font color=&quot;#c62828&quot;&gt;&lt;b&gt;→&lt;/b&gt;&lt;/font&gt; le plugin wf-improve : le skill vers Optimizer, les agents vers agents ; plus de plugin ici" vertex="1"> <mxCell id="det" parent="1" style="rounded=1;arcSize=4;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;fontSize=12;align=left;verticalAlign=top;spacingLeft=8;spacingRight=8;spacingTop=4;" value="&lt;b style=&quot;font-size:14px&quot;&gt;aimsight-detectors&lt;/b&gt;&lt;br&gt;&lt;i&gt;les détecteurs et leur benchmark&lt;/i&gt;&lt;br&gt;• scripts/ : un détecteur par famille, categories.py, data.py&lt;br&gt;• thresholds.md ; contrat lu par l&#39;app et l&#39;Optimizer : categories.events, data.py&lt;br&gt;• bench/ : score.py, regression.py, sensors.py (ex skills/wf-improve/scripts/)&lt;br&gt;&lt;font color=&quot;#c62828&quot;&gt;&lt;b&gt;→&lt;/b&gt;&lt;/font&gt; le plugin wf-improve : le skill vers Optimizer, les agents vers agents ; plus de plugin ici" vertex="1">
<mxGeometry height="120" width="440" x="1240" y="665" as="geometry" /> <mxGeometry height="120" width="440" x="1240" y="665" as="geometry" />
</mxCell> </mxCell>
<mxCell id="dep-e1" edge="1" parent="1" source="expert" style="edgeStyle=orthogonalEdgeStyle;rounded=1;html=1;endArrow=block;endFill=1;fontSize=11;labelBackgroundColor=#ffffff;" target="app" value=""> <mxCell id="dep-e1" edge="1" parent="1" source="expert" style="edgeStyle=orthogonalEdgeStyle;rounded=1;html=1;endArrow=block;endFill=1;fontSize=11;labelBackgroundColor=#ffffff;" target="app" value="">
@@ -125,28 +125,28 @@
<mxCell id="titre" parent="1" style="text;html=1;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=14;" value="&lt;b style=&quot;font-size:20px&quot;&gt;Les processus&lt;/b&gt; — chaque case a la couleur du dépôt qui la porte" vertex="1"> <mxCell id="titre" parent="1" style="text;html=1;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=14;" value="&lt;b style=&quot;font-size:20px&quot;&gt;Les processus&lt;/b&gt; — chaque case a la couleur du dépôt qui la porte" vertex="1">
<mxGeometry height="30" width="740" x="40" y="16" as="geometry" /> <mxGeometry height="30" width="740" x="40" y="16" as="geometry" />
</mxCell> </mxCell>
<mxCell id="leg0" parent="1" style="rounded=1;arcSize=4;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=11;align=center;verticalAlign=top;spacingLeft=8;spacingRight=8;spacingTop=4;" value="Diagnostic-App" vertex="1"> <mxCell id="leg0" parent="1" style="rounded=1;arcSize=4;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=11;align=center;verticalAlign=top;spacingLeft=8;spacingRight=8;spacingTop=4;" value="aimsight-app" vertex="1">
<mxGeometry height="26" width="112" x="790" y="20" as="geometry" /> <mxGeometry height="26" width="112" x="790" y="20" as="geometry" />
</mxCell> </mxCell>
<mxCell id="leg1" parent="1" style="rounded=1;arcSize=4;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=11;align=center;verticalAlign=top;spacingLeft=8;spacingRight=8;spacingTop=4;" value="agents" vertex="1"> <mxCell id="leg1" parent="1" style="rounded=1;arcSize=4;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=11;align=center;verticalAlign=top;spacingLeft=8;spacingRight=8;spacingTop=4;" value="aimsight-agents" vertex="1">
<mxGeometry height="26" width="112" x="905" y="20" as="geometry" /> <mxGeometry height="26" width="112" x="905" y="20" as="geometry" />
</mxCell> </mxCell>
<mxCell id="leg2" parent="1" style="rounded=1;arcSize=4;whiteSpace=wrap;html=1;fillColor=#ffe6cc;strokeColor=#d79b00;fontSize=11;align=center;verticalAlign=top;spacingLeft=8;spacingRight=8;spacingTop=4;" value="Optimizer" vertex="1"> <mxCell id="leg2" parent="1" style="rounded=1;arcSize=4;whiteSpace=wrap;html=1;fillColor=#ffe6cc;strokeColor=#d79b00;fontSize=11;align=center;verticalAlign=top;spacingLeft=8;spacingRight=8;spacingTop=4;" value="aimsight-optimizer" vertex="1">
<mxGeometry height="26" width="112" x="1020" y="20" as="geometry" /> <mxGeometry height="26" width="112" x="1020" y="20" as="geometry" />
</mxCell> </mxCell>
<mxCell id="leg3" parent="1" style="rounded=1;arcSize=4;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;fontSize=11;align=center;verticalAlign=top;spacingLeft=8;spacingRight=8;spacingTop=4;" value="aimsight-data" vertex="1"> <mxCell id="leg3" parent="1" style="rounded=1;arcSize=4;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;fontSize=11;align=center;verticalAlign=top;spacingLeft=8;spacingRight=8;spacingTop=4;" value="aimsight-data" vertex="1">
<mxGeometry height="26" width="112" x="1135" y="20" as="geometry" /> <mxGeometry height="26" width="112" x="1135" y="20" as="geometry" />
</mxCell> </mxCell>
<mxCell id="leg4" parent="1" style="rounded=1;arcSize=4;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;fontSize=11;align=center;verticalAlign=top;spacingLeft=8;spacingRight=8;spacingTop=4;" value="labeling" vertex="1"> <mxCell id="leg4" parent="1" style="rounded=1;arcSize=4;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;fontSize=11;align=center;verticalAlign=top;spacingLeft=8;spacingRight=8;spacingTop=4;" value="aimsight-labeling" vertex="1">
<mxGeometry height="26" width="112" x="1250" y="20" as="geometry" /> <mxGeometry height="26" width="112" x="1250" y="20" as="geometry" />
</mxCell> </mxCell>
<mxCell id="leg5" parent="1" style="rounded=1;arcSize=4;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;fontSize=11;align=center;verticalAlign=top;spacingLeft=8;spacingRight=8;spacingTop=4;" value="detectors" vertex="1"> <mxCell id="leg5" parent="1" style="rounded=1;arcSize=4;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;fontSize=11;align=center;verticalAlign=top;spacingLeft=8;spacingRight=8;spacingTop=4;" value="aimsight-detectors" vertex="1">
<mxGeometry height="26" width="112" x="1365" y="20" as="geometry" /> <mxGeometry height="26" width="112" x="1365" y="20" as="geometry" />
</mxCell> </mxCell>
<mxCell id="leg6" parent="1" style="rounded=1;arcSize=4;whiteSpace=wrap;html=1;fillColor=#f5f5f5;strokeColor=#666666;fontSize=11;align=center;verticalAlign=top;spacingLeft=8;spacingRight=8;spacingTop=4;" value="extérieur" vertex="1"> <mxCell id="leg6" parent="1" style="rounded=1;arcSize=4;whiteSpace=wrap;html=1;fillColor=#f5f5f5;strokeColor=#666666;fontSize=11;align=center;verticalAlign=top;spacingLeft=8;spacingRight=8;spacingTop=4;" value="extérieur" vertex="1">
<mxGeometry height="26" width="112" x="1480" y="20" as="geometry" /> <mxGeometry height="26" width="112" x="1480" y="20" as="geometry" />
</mxCell> </mxCell>
<mxCell id="leg7" parent="1" style="rounded=1;arcSize=4;whiteSpace=wrap;html=1;fillColor=#b0e3e6;strokeColor=#0e8088;fontSize=11;align=center;verticalAlign=top;spacingLeft=8;spacingRight=8;spacingTop=4;" value="tools" vertex="1"> <mxCell id="leg7" parent="1" style="rounded=1;arcSize=4;whiteSpace=wrap;html=1;fillColor=#b0e3e6;strokeColor=#0e8088;fontSize=11;align=center;verticalAlign=top;spacingLeft=8;spacingRight=8;spacingTop=4;" value="aimsight-tools" vertex="1">
<mxGeometry height="26" width="112" x="1595" y="20" as="geometry" /> <mxGeometry height="26" width="112" x="1595" y="20" as="geometry" />
</mxCell> </mxCell>
<mxCell id="l1" parent="1" style="rounded=0;html=1;fillColor=#fafafa;strokeColor=#bbbbbb;" value="" vertex="1"> <mxCell id="l1" parent="1" style="rounded=0;html=1;fillColor=#fafafa;strokeColor=#bbbbbb;" value="" vertex="1">
@@ -185,7 +185,7 @@
<mxCell id="s2a" parent="1" style="rounded=1;arcSize=4;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=12;align=left;verticalAlign=top;spacingLeft=8;spacingRight=8;spacingTop=4;" value="L&#39;expert choisit une plage dans la page Data, avec ses indices : « Analyser la plage »" vertex="1"> <mxCell id="s2a" parent="1" style="rounded=1;arcSize=4;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=12;align=left;verticalAlign=top;spacingLeft=8;spacingRight=8;spacingTop=4;" value="L&#39;expert choisit une plage dans la page Data, avec ses indices : « Analyser la plage »" vertex="1">
<mxGeometry height="90" width="230" x="170" y="320" as="geometry" /> <mxGeometry height="90" width="230" x="170" y="320" as="geometry" />
</mxCell> </mxCell>
<mxCell id="s2b" parent="1" style="rounded=1;arcSize=4;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=12;align=left;verticalAlign=top;spacingLeft=8;spacingRight=8;spacingTop=4;" value="&lt;b&gt;analyste&lt;/b&gt;&lt;br&gt;DETECTEURS = non&lt;br&gt;CONSIGNES = Diagnostic-App/consignes/analyste.md" vertex="1"> <mxCell id="s2b" parent="1" style="rounded=1;arcSize=4;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=12;align=left;verticalAlign=top;spacingLeft=8;spacingRight=8;spacingTop=4;" value="&lt;b&gt;analyste&lt;/b&gt;&lt;br&gt;DETECTEURS = non&lt;br&gt;CONSIGNES = aimsight-app/consignes/analyste.md" vertex="1">
<mxGeometry height="110" width="290" x="470" y="310" as="geometry" /> <mxGeometry height="110" width="290" x="470" y="310" as="geometry" />
</mxCell> </mxCell>
<mxCell id="s2e" parent="1" style="rounded=1;arcSize=4;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;fontSize=12;align=left;verticalAlign=top;spacingLeft=8;spacingRight=8;spacingTop=4;" value="auto/analyses/&amp;lt;STATION&amp;gt;_&amp;lt;début&amp;gt;_&amp;lt;fin&amp;gt;/ : rapport, étiquettes, scripts outils/" vertex="1"> <mxCell id="s2e" parent="1" style="rounded=1;arcSize=4;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;fontSize=12;align=left;verticalAlign=top;spacingLeft=8;spacingRight=8;spacingTop=4;" value="auto/analyses/&amp;lt;STATION&amp;gt;_&amp;lt;début&amp;gt;_&amp;lt;fin&amp;gt;/ : rapport, étiquettes, scripts outils/" vertex="1">
+1 -1
View File
@@ -1,4 +1,4 @@
# Diagnostic-App's instructions to the analyst # aimsight-app's instructions to the analyst
What the app asks of the analyst (agents repository, `agents:analyst`), on top of its trade. Launched by the Analysis tab of the Data page (`app/server/analysis.py`), with `DETECTORS: no`. What the app asks of the analyst (agents repository, `agents:analyst`), on top of its trade. Launched by the Analysis tab of the Data page (`app/server/analysis.py`), with `DETECTORS: no`.