Find pstack's watcher in ~/.pi/pstack #29

Manually merged
bryan merged 2 commits from ticket-43-have-the-forgejo-watcher-find-pstack-in into main 2026-11-17 18:22:08 +00:00
Owner

Why

When run by hand, watch-pr-forgejo should find pstack where it is installed. scripts/reconcile-pi-pstack.sh puts pstack in ~/.pi/pstack, but the watcher looked only under $PI_CODING_AGENT_DIR or ~/.pi/agent. With no variables set it stopped with "pstack's watch-pr is not at …" and exit 64.

Closes bryan/dotfiles-workspace#43

What changed

  • dot-agents/pstack-forgejo/watch-pr-dir.ts (new) decides the order in one function. It tries PSTACK_WATCH_PR_DIR (the watch-pr directory itself), then the pstack package under $PI_CODING_AGENT_DIR, then under ~/.pi/pstack, then under ~/.pi/agent. The first that holds cli.ts wins. Unset or empty variables are skipped, and so is a set variable whose directory has no cli.ts.
  • watch-pr-forgejo uses that function. When pstack is in none of those places, it exits 64 and lists each path it tried, in order.
  • tests/test-pstack-watch-pr-dir.ts covers each case with real temporary directories, plus one end-to-end run of the watcher under bun, which is skipped when bun is missing.
  • The AGENTS.md row for the watcher and forge-operations.md now say where it looks.

Verification

  • bash tests/run-all.sh: 35 test files, all passed.
  • I ran a one-off journey through .agents/skills/verify (dotfiles-verify run <file>), sandboxed, with a throwaway HOME and no network:
    • With pstack copied only into ~/.pi/pstack, --help exits 0 and prints the watcher's usage.
    • With pstack nowhere, it exits 64 and lists the paths in order, both with and without the two variables set.
    • Precedence was checked with stub packages: ~/.pi/agent < ~/.pi/pstack < PI_CODING_AGENT_DIR < PSTACK_WATCH_PR_DIR.
    • The same journey against the old watcher fails at "--help exits 0" (exit 64).
## Why When run by hand, `watch-pr-forgejo` should find pstack where it is installed. `scripts/reconcile-pi-pstack.sh` puts pstack in `~/.pi/pstack`, but the watcher looked only under `$PI_CODING_AGENT_DIR` or `~/.pi/agent`. With no variables set it stopped with "pstack's watch-pr is not at …" and exit 64. Closes https://git.snowboardtechie.com/bryan/dotfiles-workspace/issues/43 ## What changed - `dot-agents/pstack-forgejo/watch-pr-dir.ts` (new) decides the order in one function. It tries `PSTACK_WATCH_PR_DIR` (the watch-pr directory itself), then the pstack package under `$PI_CODING_AGENT_DIR`, then under `~/.pi/pstack`, then under `~/.pi/agent`. The first that holds `cli.ts` wins. Unset or empty variables are skipped, and so is a set variable whose directory has no `cli.ts`. - `watch-pr-forgejo` uses that function. When pstack is in none of those places, it exits 64 and lists each path it tried, in order. - `tests/test-pstack-watch-pr-dir.ts` covers each case with real temporary directories, plus one end-to-end run of the watcher under bun, which is skipped when bun is missing. - The `AGENTS.md` row for the watcher and `forge-operations.md` now say where it looks. ## Verification - `bash tests/run-all.sh`: 35 test files, all passed. - I ran a one-off journey through `.agents/skills/verify` (`dotfiles-verify run <file>`), sandboxed, with a throwaway HOME and no network: - With pstack copied only into `~/.pi/pstack`, `--help` exits 0 and prints the watcher's usage. - With pstack nowhere, it exits 64 and lists the paths in order, both with and without the two variables set. - Precedence was checked with stub packages: `~/.pi/agent` < `~/.pi/pstack` < `PI_CODING_AGENT_DIR` < `PSTACK_WATCH_PR_DIR`. - The same journey against the old watcher fails at "--help exits 0" (exit 64).
watch-pr-forgejo looked only under the Pi agent directory, but
reconcile-pi-pstack.sh installs pstack in ~/.pi/pstack, so run by hand
it exited 64. It now tries PSTACK_WATCH_PR_DIR, $PI_CODING_AGENT_DIR,
~/.pi/pstack and ~/.pi/agent in that order, decided in watch-pr-dir.ts,
and lists every path tried when none holds cli.ts.
bryan manually merged commit 246faf9ba6 into main 2026-11-17 18:22:08 +00:00
Sign in to join this conversation.
No reviewers
No labels
ready-for-agent
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bryan/dotfiles!29
No description provided.