You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[feature] sp pin/unpin — exempt scratches from reaping #34
Backlog item #9. Sometimes a scratch matters more than its TTL implies, but it doesn't deserve the working tree yet (sp promote). Today the only way to keep it is an absurd --ttl 9999d. Add a first-class pin so a scratch is exempt from sp reap without lying about its lifespan.
Behavior
sp pin <id> — mark a scratch as pinned. Pinned scratches are never moved to the morgue by sp reap, regardless of expiry.
sp unpin <id> — clear the pin; normal TTL rules resume.
sp ls shows a pin marker (e.g. 📌 in TTY, PIN in plain/--json) and pinned scratches sort/display as such.
sp reap (and --dry-run) skips pinned scratches and reports how many were skipped for being pinned.
Pin state persists in the index (Scratch.Pinned bool, omitempty).
Acceptance criteria
Scratch model gains a Pinned field (JSON omitempty), backward-compatible with existing indexes.
sp pin <id> / sp unpin <id> commands registered on root, with tombstone-flavored confirmations.
sp reap and sp reap --dry-run exclude pinned scratches and note the skip count.
sp ls (table, plain, and --json) surfaces pin state.
Unit tests: pin round-trips through the index; reap skips pinned; ls renders the marker.
Activity
rwrife commentedon Jul 16, 2026
Opened #37 implementing pin/unpin (model field, store+reap exemption, pin/unpin commands, ls table/plain/--json markers, reap skip reporting, tests, README).
Add sp pin/unpin to exempt scratches from reaping (#34) (#37)