Commit b03ec30
fix(safety): add protected file guard to prevent bots deleting state files
Rhodibot deleted Burble's TODO.md and pushed empty CONTRIBUTING.md
boilerplate because (1) is_fixable() included files with no templates,
(2) fixer.rs happily created empty files, and (3) confidence.rs had
no concept of protected files.
Three fixes:
- confidence.rs: is_protected_file() blocks deletion/modification of
TODO, README, CHANGELOG, .scm, .a2ml, and files in .machine_readable/,
src/abi/, docs/, spec/, verification/ — always forces Low confidence
- fleet.rs: removed CONTRIBUTING.md and CODE_OF_CONDUCT.md from
is_fixable() (no templates exist, produces empty boilerplate)
- fixer.rs: refuses to create files when template produces empty content
17 new tests covering all protected file scenarios.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 42194b6 commit b03ec30
4 files changed
Lines changed: 326 additions & 151 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
103 | 108 | | |
104 | 109 | | |
105 | | - | |
| 110 | + | |
106 | 111 | | |
107 | 112 | | |
108 | 113 | | |
| |||
0 commit comments