Repository navigation
v0.3.4 — spectator install self-heals a stub-dir VSS checkout
What was broken
The install bash payload's idempotency check only handled two states of `$workdir/video-search-and-summarization/`:
- exists with `.git/` → fetch + pull
- doesn't exist → `git clone`
Anything else fell through to a plain `git clone`, which crashes with:
```
fatal: destination path 'video-search-and-summarization' already
exists and is not an empty directory.
```
A user upgrading across today's three default-`$workdir` renames hit exactly that — a leftover empty stub dir from an interrupted earlier install, with the error message offering no actionable next step.
What changed
The script now distinguishes three states:
- exists with
.git/→ fetch + pull (unchanged). - exists, empty → `rmdir` and clone fresh. Safe because POSIX `rmdir` refuses non-empty directories — the `[ -z "$(ls -A ...)" ]` guard is belt-and-suspenders for clarity.
- exists, non-empty, no
.git/→ hard error with the contents enumerated and the canonical rm-rf hint baked into the message:
```
==== ERROR: ~/.spectator/video-search-and-summarization/ exists
but is not a git checkout. ====
contents (first few entries):
<ls -A output>
If it's leftover from a failed install or an interrupted
migration, remove it and re-run deploy:
ssh <gpu-machine> 'rm -rf ~/.spectator/video-search-and-summarization'
./spectator deploy --target <gpu-machine>
If you put real data there, move it elsewhere first.
```
Tests
1 new test renders the install bash payload and pins all three branches (`if` / `elif` / `else`, the rmdir, the error message, the exact $workdir/$vss_checkout path in the rm-rf hint). `bash -n` parse-check on the rendered heredoc also passes. Suite is now 45/45 (was 44).
Migration
None required. v0.3.4 just makes `./spectator deploy --target ...` more forgiving when the target's filesystem has stub state from prior failed installs.