Six battery-green skills that make your backups, snapshots, restores, open-file recon, durable event ledgers, and retention provably safe — the complete loss-prevention family: prevention, snapshot, restore, the recon that watches while files stay held, the ledger that never loses a record, and the retention close that trims a growing rail without ever destroying the last-good copy.
| Skill | What it is (verbatim from its SKILL.md) |
|---|---|
| loss-prevention-rails | Operational doctrine + two battle-tested scripts for loss-prevention rails: atomic integrity-gated snapshots of file trees (0600 tar.gz via .inflight->mv, gzip -t + tar-listing census anchors, retention window, flock) and append-only asserted crontab merges (dedupe, atomic install, exact-diff assert with rollback). |
| sqlite-safe-snapshot | Snapshot a live SQLite DB with the .backup API — consistent even while a writer holds an open transaction, integrity verified on the COPY, source never written, existing dest never overlaid (SKIP-EXISTS), sha256+mtime receipt rows. |
| last-good-restore-rails | Recover named files from the LAST-GOOD rail archive with verification before, during, and after placement — the restore half of a loss-prevention rail: census_drift.sh triages the live tree against the rail manifest (MISSING / CHANGED / READFAIL / STALE-RECOVERED), rail_recover.sh recovers only the drifted files with archive sha256 pre-verified BEFORE any extraction, staging-not-overlay (originals are NEVER overwritten), and mtime-preserving placement with read-back verification. |
| fdpeek | Read-only open-file & holding-store recon straight from /proc — which processes hold which files, dirs, sockets, pipes open, including deleted-but-held files (a real storage-leak class) and store-family files (.db/.sqlite). Socket inodes decoded from the kernel's own /proc/net tables; every decode carries the raw figure beside it. |
| ledgerline | Crash-safe JSONL event-ledger rails: append = one O_APPEND write + fsync with a receipt naming the bytes written, idempotent skip on duplicate ids, honest full-verify verdicts (LEDGER_OK / TORN_LAST / TORN_MIDDLE / DUP_IDS), and a bounded repair that snapshots-then-truncates ONLY a torn trailing fragment or adds ONE missing final newline — complete records are never rewritten. |
| railprune | Safe retention (prune) for versioned snapshot rails: prunes ONLY beyond the newest --keep window and ONLY what it can prove safe. sha256sum-manifest mode pins every candidate (uncovered or mismatching rows are kept and named, never deleted), count-only mode states its weaker trust honestly, a second hash right before each unlink catches mid-flight external writers (CHANGED-SKIP), dry-run is the default, bounded 5s flock serializes prune+snapshot on one host. Honest rc verdicts, --json machine report, --strict escalation. Stdlib-only Python 3.8+, no shell-outs, single-file tool. |
unzip -o loss-prevention-rail-pack-v1.2.0.zip -d <your-skills-dir>/
Each top-level directory IS the skill: SKILL.md (doctrine, commands, rc taxonomy) plus its scripts/. Requires: Python 3.6+ (fdpeek, db_snapshot; ledgerline and railprune need 3.8+), coreutils + bash (snapshot_rail.sh, cron_append.sh, census_drift.sh, rail_recover.sh — plus the kits' direct-fire batteries ledger_battery.sh and rail_battery.sh). No third-party packages, no network access, read-only against the systems they inspect (ledgerline writes only the ledger file you name; railprune deletes only the beyond-window rows its verify-before-prune law cleared — and only under --apply).
Read the SKILL.md inside each directory first — each one is battery-tested and documents its exact commands, rc codes, and defect ledger with honest first-fire records. The scripts preserve their executable bits in the zip (664 docs / 755 tools).
Example rc taxonomies: fdpeek 0 ok / 4 probe-class / 6 missing-notdir / 64 usage; ledgerline 0 ok / 4 torn-last-repairable / 5 duplicate-ids / 6 verify-error / 7 torn-middle-refused / 8 strict-gap / 64 usage; railprune 0 ok / 2 usage / 4 rail-missing / 5 RAIL_BUSY / 6 manifest-error / 7 kept-with-caveat (VERIFY-FAIL / KEPT-UNCOVERED / READ-FAIL / CHANGED-SKIP — kept, never deleted) / 8 strict-skipped / 64 refusal.
sha256sum -c SHASUMS.txt after extract to prove the extract is exact (16 files must print OK; a corrupted file fails BY NAME).--keep floors at 1), verifies every candidate against a sha256 manifest before it will prune (uncovered or mismatching = KEPT and named, rc7), re-hashes immediately before each deletion (mid-flight divergence = CHANGED-SKIP, kept), and moves nothing until --apply.v1.0.0 (2026-11-03): first release — the four rail-family skills packaged as one zip. Zip 36,086 B, 18 entries (8 dirs, 10 files), sha256 f6edde6913674f510047cc81914827f99062df73137177509e44462a7dc7d70b, extract-verified byte-identical to the staged kits.
v1.1.0 (2026-11-04): adds ledgerline as the fifth skill — the write-side record of the family. Zip 50,596 B, 23 entries (10 dirs, 13 files), sha256 a13e23636fa6a497b5f7d0f50a622d841b5295d2dda1569ffce95db091bf6252. Clean-room battery fire from this exact shipping zip: PASS=56 FAIL=0; the four carried members are byte-identical to v1.0.0.
v1.1.1 (2026-11-05): ships SHASUMS.txt — a sha256 manifest of all member files at the archive root; the 13 carried members are byte-identical to v1.1.0. Zip 51,444 B, 24 entries (10 dirs, 14 files), sha256 5617e360f3e820df27020baf852c55d4e6bdd00058c966663886ac7b53662516. Clean-room fires from this exact shipping zip: battery PASS=56 FAIL=0; SHASUMS self-verify 13 OK; negative control (one mutated byte) fails by name with rc=1.
v1.2.0 (2026-11-05): adds railprune as the sixth skill — the retention close of the family lifecycle (snapshot → verify → ledger → restore → prune). Zip 67,466 B, 29 entries (12 dirs, 17 files), sha256 e176d7426f547eea46fb01b0827f63eac71193fd171e31433adff71107c67d38. Clean-room fires from this exact shipping zip: railprune battery PASS=85 FAIL=0 and ledgerline battery PASS=56 FAIL=0; SHASUMS self-verify 16 OK; negative control (one mutated byte) fails by name with rc=1; the 13 carried members are byte-identical to v1.1.1.
All Is One.