Skip to content

damage-control: no-delete ladder covers producer-fed deletes, mv/overwrite, emptying (#1127 #1128) - #1135

Merged
dotdevdotdev merged 5 commits into
mainfrom
nodelete-1127-1128
Oct 18, 2026
Merged

dotdevdotdev merged 5 commits into
mainfrom
nodelete-1127-1128

Conversation

@dotdevdotdev

Copy link
Copy Markdown
Owner

Producer-fed deletes (xargs/parallel/loops/substitution/find -exec) are judged like direct operands; mv of a guarded path out of place = delete, mv/cp/install/rsync/ln -f onto a guarded file = overwrite; truncate/dd of=/: > onto a guarded path blocks (plain > stays allowed). Logic only in _core.py (hooks regenerated; no rule-YAML change). Exact behavior, stated costs and declared residuals: docs/wiki/internals/damage-control.md ("What the no-delete ladder judges").

Tests: tests/unit/test_damage_control_producer_fed.py — differential vs direct-operand decision (consumers x producers x targets x homes x default/kill-switch/unattended) + must-allow controls; five mutations each turn it red. Full unit suite: 5829 passed.

Closes #1127
Closes #1128

Built by dotdev.dev

…write, and emptying (#1127) (#1128)

- #1128: a delete fed by xargs/parallel/loop/substitution/find -exec is judged
  against the guarded sets using the producer's words; a search root that may
  reach a guarded path asks (unverifiable, not demoted by bypass).
- #1127 (owner ruling): mv of a guarded path out of place is a delete; mv/cp/
  install/rsync/ln -f onto a guarded file is an overwrite. Unrelated moves into
  a guarded dir stay allowed.
- Emptying == deleting: truncate, dd of=, `: >` onto a guarded path block.

Built by dotdev.dev
…1128)

- A whole guarded directory (or an ancestor) moved is a delete: mv ~/.claude x, mv * .
- Runtime state inside directory entries (cohorts, inbox, sessions) is out of the
  mv/overwrite/emptying ladder; renaming a guarded FILE in its own dir asks.
- Emptying: known-empty redirects (cat /dev/null, true, printf '', : >|, tee </dev/null)
  and truncate/dd as fed consumers.
- Producers: git ls-files & co, parallel 'rm {}' ::: x, -execdir/-ok/-okdir equal -exec.
- Narrowed: a producer with no protected argument in an unguarded cwd stays allowed
  (ls build | xargs rm, find . -mtime +7 | xargs rm); variable roots and a cwd inside
  a guarded dir ask.

Built by dotdev.dev
… document the two accepted tradeoffs (#1135)

Built by dotdev.dev
@dotdevdotdev
dotdevdotdev marked this pull request as ready for review October 18, 2026 23:19
@dotdevdotdev
dotdevdotdev merged commit f66b347 into main Oct 18, 2026
5 checks passed
@dotdevdotdev
dotdevdotdev deleted the nodelete-1127-1128 branch October 18, 2026 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant