`StackManager.check`/`install`/`delete` quoted remote paths with
`shlex.quote`, which single-quotes the string. Bash treats single-
quoted `~` as a literal tilde character — so the commands probed
`'~/.cache/scripthut/stacks/foo/.ready'` instead of
`$HOME/.cache/scripthut/stacks/foo/.ready`. In the local-mode path
both ops were broken the same way, so they agreed with each other
(install created a literal `~` directory in CWD; check found it
there). v0.9.0's synthesized server-side install correctly substituted
`~` → `$HOME` and wrote at the real `$HOME/...` location — but
`check` still looked at the literal tilde path, found nothing, and
reported MISSING. That misled the documented "always `stack check`
before submit" guidance, since a freshly-installed stack would show
up as not installed.
New `StackManager._shell_quote_path` rewrites a leading `~` to
`$HOME` and wraps in *double* quotes, so the shell actually expands
`$HOME` while keeping the rest as a single token. Applied to all
three sites that touched stack paths (check, install, delete).
`compute_stack_hash` and the hash_path docstring were updated to
note the convention shift.
Tests:
- New `TestTildeExpansion` in `tests/test_stacks.py` pins the
emitted shell commands: check / install / delete must contain
`$HOME/.cache/...` (double-quoted, expansion-safe) and never a
single-quoted `'~/.cache/...'`. A separate test confirms an
absolute cache_dir (e.g. `/scratch/me/stacks`) passes through
without picking up a spurious `$HOME` prefix.
Bug 2 from the v0.9.0 field report is fixed.
Known-still-open (bug 1 from the same report): "install reports a
job's status from accounting — same completed/ran ambiguity as
before". The v0.6.5 sacct ExitCode cross-check applies for Slurm
backends; if the install runs on a non-Slurm backend (PBS, Batch)
the State-vs-ExitCode disagreement isn't caught. Worth a separate
pass per-backend; not in this hotfix.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>