## TL;DR

The batch delete's filter was parsed wrong and removed the wrong records. Restore from backup, fix the filter parsing, and dry-run deletes first.

## Error

```text
batch delete removed the wrong records
```

## Steps

1. Stop the job immediately Expected: no more deletes.
2. Restore the wrongly deleted records from backup or recycle bin Expected: data is back.
3. Fix the filter parser and test it on a sample Expected: the filter is correct.
4. Dry-run all future deletes Expected: it cannot regress.

## When to use

- Batch delete hit the wrong records
- The filter was misparsed

## When not to use

- The filter is right (then check the data)
- Deletes were intended (then the scope was wrong)

## Tool compatibility

- Batch deletes
- Data hygiene jobs

## Variant phrasings

### batch delete wrong records

Restore from backup, fix the filter, dry-run first.

### delete filter parsed wrong

Same: test the filter on a sample.

## Why it happens

Delete filters are code, and code has bugs. Agents run deletes without a dry run because the filter 'looks right'.

## Edge cases

- Soft delete first; hard delete later
- Require explicit confirmation for unscoped deletes

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_n0Wnjlt3gr6-_gbRwCV3sQ
