Description
scripts/conformance/rubyspec/run.sh caches the ruby/spec checkout in a
directory the operating system empties:
# SPECDIR ruby/spec checkout (default: cloned to CACHE at SPEC_SHA)
# CACHE clone cache dir (default: /tmp/rubyspec-corpus)On macOS /tmp is /private/tmp, which is purged; on most Linux distributions
/tmp is cleaned on boot or by a timer. So the corpus the baseline was measured
against is not a durable artefact, and the first run after a reboot silently
re-clones 4594 files from GitHub.
Why it is worth a line of code rather than a note
The cost is not the clone, it is what a missing corpus looks like when something
else is also wrong. run.sh exits 2 with clone failed (offline?) — cannot run ratchet, which is clear. But a corpus that is present and incomplete — a
clone interrupted, or a cache from a different SPEC_SHA — reads as a sweep
with fewer files, and cmd/ratchet reports those as MISSING FROM THE SWEEP,
which is indistinguishable from the regression that verdict exists to catch.
A cache that cannot be deleted under you is one fewer way to get that.
This bit this morning: measuring one spec file for #856 found no corpus at
/tmp/rubyspec-corpus at all, so the measurement had to start by re-cloning.
Suggested shape
Default CACHE to an OS-appropriate durable cache directory rather than /tmp
— ${XDG_CACHE_HOME:-$HOME/.cache}/rubyspec-corpus on Linux,
$HOME/Library/Caches/rubyspec-corpus on macOS — keeping CACHE overridable
exactly as it is now, and verify the checked-out commit matches SPEC_SHA
before reusing a cache rather than assuming a directory that exists is the
right one.
CI is unaffected either way: a fresh runner has no cache and clones regardless.
This is about the machine a person measures on twice.
🤖 Generated with Claude Code
Activity