Files
aimsight-app/README.md
T
maximeandClaude Opus 5.5 eaa124f9f5 Weather: the MeteoSwiss measurements at a place over a past range
weather/meteoswiss.py <place> <start> <end>: the hourly values of the
nearest SwissMetNet station (precipitation, temperature, humidity, wind,
pressure, sunshine, radiation, snow), from the MeteoSwiss Open Data, as CSV.
The place is a Swiss name (swisstopo search) or lat,lon; times in UTC.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 17:54:28 +01:00

67 lines
4.2 KiB
Markdown

# 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:
- **"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: `/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 repository
- `app/`: the web app (FastAPI server, React and Mantine page); its doc in `app/README.md`.
- `instructions/analyst.md`: what the app asks of the analyst (output folder, report, dialogue).
- `docs/`: the architecture of the repositories, the plans.
- `weather/`: the weather measured by MeteoSwiss at a place over a past range (`weather/meteoswiss.py <place> <start> <end>`); its doc in `weather/README.md`.
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 |
|---|---|---|
| `data/` | `~/aimsight-data/data` | reads the data of the stations (outside git) |
| `labeling/` | `~/aimsight-labeling` | reads and writes the labels; the analyses go in `labeling/auto/analyses/` |
| `detectors/` | `~/aimsight-detectors` | reads the detectors' events (`scripts/categories.py`) |
| `tools/` | `~/aimsight-tools` | reads the data through `tools/scripts/data.py`; the analyst uses it, the upgrader writes in it (Optimizer) |
| `agents/` | `~/aimsight-agents` | the plugin of the agents (`--plugin-dir agents`, `--agent agents:analyst`) |
| `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 `~/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
```bash
ln -s ~/aimsight-data/data data && ln -s ~/aimsight-labeling labeling && ln -s ~/aimsight-detectors detectors
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:
```bash
python3 -m venv .venv && .venv/bin/pip install -r app/requirements.txt
cd app/web && npm install && npm run build && cd ../..
.venv/bin/python app/server/server.py
```
The page opens on `http://127.0.0.1:8770`. `claude` (Claude Code, logged in to the subscription) must be on the `PATH` for the Analysis tab.
### Run as a service
Without VS Code, the app runs as a systemd user service of WSL (`app/aimsight-app.service`, with `systemd=true` in `/etc/wsl.conf`), started with WSL; the page stays on `http://127.0.0.1:8770`. Once:
```bash
systemctl --user enable --now ~/aimsight-app/app/aimsight-app.service
```
After a change of the code, a restart rebuilds the page and relaunches the server: `systemctl --user restart aimsight-app`. The log: `journalctl --user -u aimsight-app -f`. Stop it before launching the VS Code task **Run app** (same port).
## Pump the data
The pumping is in the `~/aimsight-data` repository (`extraction/`, VS Code tasks **pump** and **pump a range**); user guide `~/aimsight-data/extraction/README.md`.
## Check
- the app: `.venv/bin/python app/server/check.py`;
- 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, ~1 min): `python3 detectors/bench/regression.py --labels labeling/auto --data data`.