Conversation
…dirty trees Adds two big warning blocks (peer to the existing `git stash` one) and a short Incident Log so the rules are tied to a real, recent failure. Motivated by a 2026-04-28 incident: an agent ran `git checkout dev/cpan-reports/` on an unstaged cpan-tester refresh and silently destroyed ~600 module results. AGENTS.md already warned about `git stash` but said nothing about `checkout <path>` / `restore` / `reset --hard` / `clean`, which are equally destructive on a dirty tree. Changes: - New "MANDATORY PRE-FLIGHT FOR ANY DIRTY TREE" block with the exact snapshot + WIP-branch commands to run first. - New "FORBIDDEN COMMANDS ON A DIRTY TREE" block enumerating the destructive verbs and the safe alternative. - New "Incident Log" table; future incidents append here. - Top-of-file note telling readers the warnings document real losses, not hypothetical ones. Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AGENTS.md already warned about
git stash, but said nothing aboutgit checkout <path>,git restore,git reset --hard, orgit clean— which are equally destructive when run on a dirtyworking tree. This gap caused a real data-loss incident on
2026-04-28, where ~600 module results from
cpan_random_tester.plwere silently destroyed by an agent running
git checkout dev/cpan-reports/.This PR makes the rules harder to ignore:
destructive verb (
checkout <path>,restore,reset --hard,clean -fd,stash) with the safe alternative (mvaside, thengit show HEAD:path).commit that fixes it, so future agents can see the warnings are
tied to real failures rather than abstract caution.
losses.
The two existing rules already in AGENTS.md (the
git stashwarningblock and the "save with
git diff > backup.patch" guidance under"How to Check Regressions") are preserved verbatim.
Test plan
makepasses locally (BUILD SUCCESSFUL, parallel unit tests green)Generated with Devin