utils/app_errors/README.md
Krzysztof kuhy Rudnicki f05845e2f7 Read GitHub repo from checkout origin
feedback_inbox and app_errors guessed kuhyx/<folder> for a task's repo,
which filed cleanup-plate under kuhyx/cleanup-plate (real:
Sepci0/cleanup-plate) and showed phantom repos on the board. Both now
read the GitHub owner/name from ~/src/<folder>'s origin remote (https or
ssh forms) and fall back to the guess only when there is no checkout or
its origin is not on GitHub. app-errors 0.1.2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WzxdWZfgt44aEKxvGBJkwP
2026-11-19 18:08:26 +01:00

53 lines
2.2 KiB
Markdown

# app_errors
The PC side of kuhy's app error and slow-wait reporting. Every app reports
errors, and every wait the user sees over 1 s (`perf.slow`). This ingest merges
the reports by signature and writes `~/.local/state/app-errors/<app>.json` in
the todoImplementer `contracts/app-error.schema.json` `report` shape. The board
reads that folder and turns each open error into a self-fixing ticket
(todoImplementer `DOCS-errors.md`).
Generalised from kartka's `tools/errors`. Dart signatures are byte-identical to
kartka's. See `DOCS-app-errors.md` at the repo root for the whole pipeline.
## Where reports come from
| Reporter | Runs on | Writes |
|---|---|---|
| `crdt_sync_flutter` `installErrorReporting` | phone, desktop, web | RTDB `/<app>/errors/<device>/<id>` |
| `gatelock.error_report.install` | PC (Tk) | spool `~/.local/state/app-errors-spool/<app>.jsonl` |
| Godot `addons/app_errors` (`godot_dev_tools/`) | PC | the same spool |
The ingest skips `kartka` in RTDB, because kartka still runs its own ingest.
## Entry (one report, every language)
`at` (ISO UTC), `kind` (`uncaught.flutter`, `uncaught.python`, `uncaught.gdscript`,
`ui.snackbar`, `perf.slow`, ...), `error`, `stack` (list of frames), plus these
optional fields:
- `repo` (`owner/name`; default: the `origin` of `~/src/<app>` when it is on GitHub, else `kuhyx/<app>`)
- `mark` (the substring that marks the app's own frames: `package:todo/`,
`leetcode_guard/`, `res://`)
- `route`
- `operation`, `durationMs`, `waitId` and `still` (slow waits)
- `build` (versionCode, 0 when unknown) and `version`
## Commands
```bash
app-errors ingest # what the timer runs every 5 min
app-errors ingest --keep # leave RTDB entries in place
app-errors ingest --no-rtdb # local spool only
app-errors resolve <app> <signature> # mark it fixed; a newer build reopens it
```
`app_errors/install.sh` installs the venv
(`~/.local/share/app-errors/venv`), the `app-errors` link and
`app-errors-ingest.timer`. `scripts/deploy.sh` runs it.
RTDB access reuses an already seeded crdt-sync session (`--session`, default
`firebase_backup`), so the ingest needs no sign-in of its own.
Tests: `cd app_errors && python -m pytest` (100 % branch coverage).