diff --git a/skills/rpa-run-tab/SKILL.md b/skills/rpa-run-tab/SKILL.md index 0d15297..5220f0b 100644 --- a/skills/rpa-run-tab/SKILL.md +++ b/skills/rpa-run-tab/SKILL.md @@ -18,7 +18,7 @@ Everything needed is in `templates/`. Never read the original Tebra projects. | `templates/fake_bot.py` | Prints the protocol for the endings complete, partial, stuck and crash. Used only by the self-check. | | `templates/palette.py` | Theme: `sky`, `teal` or a brand hex. Use `--write` to put it into the page. It checks contrast. | -The rules come from the repo's ADRs. Keep to them: +The rules come from the ADRs in `docs/adr/`. Keep to them: - One checkpoint list drives the steps, the boxes and the progress %. - The bot talks only through tagged lines in a log file. - A stuck checkpoint kills the run, and the run fails. diff --git a/skills/rpa-run-tab/docs/adr/0001-one-checkpoint-list-drives-run-tab.md b/skills/rpa-run-tab/docs/adr/0001-one-checkpoint-list-drives-run-tab.md new file mode 100644 index 0000000..32db026 --- /dev/null +++ b/skills/rpa-run-tab/docs/adr/0001-one-checkpoint-list-drives-run-tab.md @@ -0,0 +1,11 @@ +# One checkpoint list drives the whole Run tab + +Tebra Auto Post keeps two overlapping lists: +- 8 **steps**, which move forward when known phrases appear in the log (`STEP_MARKERS`). +- 7 **checkpoints**, which move forward on `[CPSTATE]` lines and have time limits. + +The Run tab skill keeps one checkpoint list. The bot's `[CPSTATE] active|done N` lines move the step list, the checkpoint boxes and the progress % together. The screen still looks like Tebra. + +**Why:** there is one list to ask the user for, so the skill fits in 5 minutes. And a typo in a log phrase can no longer stall the progress bar without anyone noticing. + +**Cost:** the progress bar moves in whole checkpoints, not Tebra's finer per-phrase percentages. diff --git a/skills/rpa-run-tab/docs/adr/0002-bot-talks-through-tagged-log-file.md b/skills/rpa-run-tab/docs/adr/0002-bot-talks-through-tagged-log-file.md new file mode 100644 index 0000000..22a62e7 --- /dev/null +++ b/skills/rpa-run-tab/docs/adr/0002-bot-talks-through-tagged-log-file.md @@ -0,0 +1,11 @@ +# The bot talks to the Run tab through tagged lines in a log file + +The bot runs as a **separate process** with no Qt. The Run tab starts it with `--log ` and reads that file every 0.2 s. It does not read stdout. The bot prints: + +- `[CPSTATE] active N` / `[CPSTATE] done N`: checkpoint progress (see ADR-0001). +- `[UI] text`, `[UI:ok]`, `[UI:warn]`, `[UI:error]`: lines the operator sees. Error lines and tracebacks always show, even without a tag. Every raw line stays in the run log file. +- `__RUN_SUMMARY__{json}` as its last line. The outcome comes from this line, not from the exit code. If the line is missing, the run counts as failed, so a crash never shows green. + +**Why:** this comes from Tebra Auto Post. UI automation inside a Qt worker thread was unreliable (bug-094). A windowed PyInstaller child's stdout pipe is block-buffered, so log lines arrived in late bursts; reading the log file fixed that. Tagging lines saves each project from writing a table of phrase→friendly-text rules. + +**Conflict:** `rpa-dashboard-no-ai/templates/bot_runner.py` reads `stdout=PIPE`, which is the approach Tebra dropped. Fix it there, or point it at the Run tab skill's runner. diff --git a/skills/rpa-run-tab/docs/adr/0003-stuck-kills-no-restart-no-stop.md b/skills/rpa-run-tab/docs/adr/0003-stuck-kills-no-restart-no-stop.md new file mode 100644 index 0000000..8cdbd41 --- /dev/null +++ b/skills/rpa-run-tab/docs/adr/0003-stuck-kills-no-restart-no-stop.md @@ -0,0 +1,7 @@ +# A stuck run is killed and fails; no auto-restart, no Stop button + +When a checkpoint passes its time limit, the Run tab kills the bot's whole process tree and ends the run as failed: "Stuck at , run again". It does not restart. There is no Stop or Pause button. A run also ends early when the operator closes the window, which asks first and then kills the process tree. + +**Why:** Tebra Auto Post restarts a stuck bot up to 3 times. That is only safe because its SQL batch table lets a restarted bot skip work it already did. The Run tab skill has no DB (decision Q2), so a restart could do work twice, for example post a payment twice. Tebra removed Stop on purpose ("a run always goes to completion"), and the Run tab keeps the same look. + +**Reopen if:** a project's bot is rerun-safe (it skips items already done). Then auto-restart ×3 can come back as an option.