diff --git a/docs/handoff/brief-doctor-handoff.md b/docs/handoff/brief-doctor-handoff.md new file mode 100644 index 0000000..0154f5f --- /dev/null +++ b/docs/handoff/brief-doctor-handoff.md @@ -0,0 +1,58 @@ +# dotfiles: make `dot doctor` check the handoff pipeline + +Repository: /home/deck/.dotfiles (bash, no build step) + +`dot doctor` currently checks flatpaks, wallpapers, a few services and netbird. The free-model +handoff pipeline — a systemd user service, a weekly timer and a model pool — has no checks at +all, so a dead daemon or an expired lane is invisible until someone tries to delegate work. + +Add a "handoff" group to `dot doctor`. + +## What to add + +In `bin/dot`, `cmd_doctor()` (around line 688), following the existing `chk` helper's +conventions — the same `chk "name" "test command" "how to fix"` calls that produce the +`ok` / `!!` lines: + +1. `handoff daemon` — `systemctl --user is-active handoff.service`; fix hint `systemctl --user start handoff`. +2. `handoff probe timer` — the timer is scheduled: `systemctl --user list-timers handoff-probe.timer --no-pager` + must mention `handoff-probe.timer`; fix hint `systemctl --user start handoff-probe.timer`. +3. `handoff pool policy` — every lane in `~/.config/free-agent/pool.json` carries + `usage: "developer-api"`. Use one `python3 -` heredoc that exits non-zero when a lane + is missing the field or carries another value, and prints the offending ids on stderr. + Fix hint `edit config/free-agent/pool.json`. +4. `handoff pool alive` — `free-agent --list` exits 0 (it fails on an unreadable pool); + fix hint `free-agent --list`. + +Put them together under a comment that says what the group is for, and keep the existing +output style exactly: the `chk` helper already prints `ok`/`!!` and the hint. + +## Tests + +Extend `tests/handoff.sh` (it already isolates `XDG_DATA_HOME` / `XDG_STATE_HOME` and runs +in seconds) with one check that the four new names appear in `dot doctor` output: + +```sh +./bin/dot doctor 2>/dev/null | grep -q 'handoff pool policy' || fail "doctor has no handoff checks" +``` + +Keep every existing check in that file passing. + +## Acceptance — run this yourself and paste the output in the report + +```sh +cd /home/deck/.dotfiles \ + && bash -n bin/dot \ + && bash tests/handoff.sh \ + && ./bin/dot doctor 2>/dev/null | grep -E 'handoff|probe' +``` + +The last command must print four lines about the handoff group (they will be `ok` on this +machine). Paste them. + +## Do not touch + +- `bin/free-agent`, `bin/handoff`, `bin/freebuff-agent`, `config/free-agent/` — the pipeline + itself is not part of this task; +- `home/`, `scripts/`, `.github/`, `docs/`; +- do not commit and do not create branches. Leave the tree dirty for review.