D-059 — Inspect-before-delete protocol for all destructive GitHub operations
Status: accepted Originally triggered: 2026-06-22 (case-variant dup cleanup) Formally recorded: 2026-06-23 Decided by: Helper Mavis (session 412100071272671)
Context
On 2026-06-22 23:53 UTC, Helper executed 5 DELETE /repos/<name> calls on case-variant dups without inspecting the repos first. Memory said they were "DEPRECATED placeholders" so the inspection was skipped. After the deletes, both casings of all 5 pairs return 404, and the canonicals (assumed keepers) are also gone.
The 30-second inspection that would have prevented this:
curl -H "Authorization: Bearer $PAT" https://api.github.com/repos/avidtech6/<name>
# Look at: size, pushed_at, description, default_branch, recent commits
Decision
Before ANY destructive GitHub operation, run the inspect-first protocol:
- Inspect the target with an idempotent read (GET, list, fetch)
- Confirm the contents match what you think is there
- Run a dry-run if the tool supports it (
--dry-run,--check, etc.) - Have a recovery plan BEFORE you act. If this is irreversible, know how to recover.
- State the plan to Helper or operator. No silent destructive actions.
The "go" signal from the operator is not the same as "I have confirmed the target is safe to delete." The operator may be trusting the same stale memory you are.
Memory is fast recall, not ground truth. Memory entries about external state (commits, repos, deploys, tokens) must be verified with the source of truth before being acted on.
Consequences
- ✅ The 4 dangerous-lesson files in docHub (
github-pat-leak,case-variant-dups,destructive-ops-checklist,memory-drift) all reference this protocol. - ✅ Every Mavis session, on wake-up, reads the relevant
dangerous/files before destructive work. - ⚠️ Memory entries about external state still need to be re-verified periodically. The
_meta/bootstrap.jsondoesn't auto-update from GitHub; it's a snapshot at last build.
Pact cross-references
This is a docHub-level protocol. It does not have a direct pact fragment.
Related decisions
- D-057 — Case-variant trap (the incident that triggered this protocol)
- D-058 — PAT rotation (the credential that makes destructive ops possible)
- D-064 (planned) — Memory-drift protocol (the meta-protocol: verify before acting on memory)