monoscope/scripts/dangling-work.sh
Anthony Alaribe 7a13fc0887 chore(scripts): share the lost-work sweep instead of keeping it on one laptop
Written after `git add -A` + `reset --hard` destroyed another session's
uncommitted work on 2026-09-02 and every ref-based check came back clean —
`git log --all`, branch diffs and prod-vs-master HTML can only see work that
reached a ref, and a dangling commit has not.

- `dangling-work.sh` lists commits no ref can reach, and (PRESERVE=1)
  snapshot-tags every dirty worktree via `git stash create`, which builds the
  commit object WITHOUT touching the index or working tree — safe against a
  checkout another session is editing. Its first run tagged 11 dirty checkouts,
  several 8+ days stale, none of them recoverable if anyone had reset them.
- `dangling-triage.sh` answers "is this orphan actually lost?" by the identifiers
  a commit introduced rather than its lines. Line comparison is useless here:
  fourmolu and the deep-clean sweeps reword everything, so landed work scores
  100% missing. Identifiers survive refactors and scored 14 of 18 correctly.

Out of scripts/local/ (gitignored) because neither reads a secret or touches a
database — they are pure git, and the whole point is that someone else can run
them. The repo list is now derived from this checkout and its siblings rather
than hardcoded to one machine's home directory.
2026-09-03 09:52:39 +02:00

161 lines
8.1 KiB
Executable file