Repository navigation
v0.4.7 — \`--workdir ~/...\` footgun + audio status symlink follow
Closes Bug A and Bug E from the 2026-05-09 final bug report (workspace/Outbox/spectator-bug-report-final-2026-05-09.md). Other bugs from that report were already addressed: B in v0.3.6, C in v0.4.2, D mitigated in v0.4.1.
Bug A — `--workdir ~/...` unquoted gets local-tilde-expanded
Symptom on a Mac terminal driving a Linux remote:
$ ./spectator audio install --target spark --workdir ~/.co-sa/spectator
install failed
mkdir: cannot create directory '/Users': Permission denied
The local Bash expanded ~/.co-sa/spectator to /Users/misha/.co-sa/spectator before Spectator's typer parser saw the argument. Spectator stored that absolute Mac path in cfg.workdir, shipped it to the Linux remote, which failed because /Users/... doesn't exist there.
Fix: when --target is set AND cfg.workdir starts with the local user's home directory, rewrite the prefix back to $HOME so the REMOTE shell expands it. New helper config.normalize_workdir_for_remote(workdir, target). Plumbed into every verb that takes both --target and --workdir (preflight, install, uninstall, deploy, rsync, up, down, status, logs, audio install / transcribe / status / fetch, system cache-cleaner-start). The CLI emits a one-line heads-up when the rewrite kicks in, with a hint to single-quote the tilde next time:
heads-up: --workdir /Users/misha/.spectator looks like your LOCAL home
($HOME on this machine), but --target spark is set. Rewriting to
$HOME/.spectator so the remote shell expands it to the remote's $HOME.
Quote your tilde (--workdir '~/...' with single quotes) to avoid this
round-trip.
ui-server start is NOT rewritten — its --target is for job-routing, the workdir is local to the UI server, so cross-platform translation would be wrong there.
Bug E — `audio status` doesn't follow audio-out/ symlink
spectator audio status used bare find (no -L), so when $workdir/audio-out/ is a directory symlink, completed transcripts in subdirs of the symlink target weren't listed. One-character fix: find -L.
Tests
69/69 (was 67, +2). One pins the rewrite behavior for tilde-expanded local-home prefixes plus the no-rewrite cases (unrelated absolute paths, local-only invocations, already-tilde-quoted invocations). One renders audio.status's bash and asserts find -L is present.
Migration
None — both fixes are defensive additions. v0.3.6+ users have been single-quoting --workdir '~/...' as a workaround; that still works (the rewrite is a no-op when no rewrite is needed). v0.4.7 just makes Spectator forgiving when the user forgets to quote.