Skip to content

Commit b03ec30

Browse files
hyperpolymathclaude
andcommitted
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

File tree

bots/rhodibot/src/fleet.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,14 @@ fn suggestion_for(check_name: &str) -> Option<String> {
100100
}
101101

102102
/// Whether a failed check can be auto-fixed by robot-repo-automaton
103+
/// Whether a failed check can be auto-fixed by robot-repo-automaton.
104+
///
105+
/// Only files with proper templates in robot-repo-automaton/templates/ are
106+
/// fixable. Files without templates (CONTRIBUTING.md, CODE_OF_CONDUCT.md)
107+
/// would produce empty boilerplate and are excluded.
103108
fn is_fixable(check_name: &str) -> bool {
104109
matches!(check_name,
105-
"SECURITY.md" | "CODE_OF_CONDUCT.md" | "CONTRIBUTING.md" |
110+
"SECURITY.md" |
106111
".editorconfig" | ".gitattributes" | ".gitignore" |
107112
".claude/CLAUDE.md" | ".machine_readable/bot_directives"
108113
)

0 commit comments

Comments
 (0)