9 min readPost 3
Twelve review rounds: how to trust a tool that deletes files
A tool that automatically buries and purges files for AI agents only needs one path or state race to wipe uncommitted work. Here is why we ran 40 adversarial review rounds in a single day across three core stages, the five highest-impact bugs they caught, how we stopped reviews from looping forever, and the 654 compile-time mutations that guard every fix.

On this page
Obituary manages lifespans for temporary files created by AI coding agents: it moves expired items into a restorable local graveyard, intercepts destructive commands like rm -rf before they execute, and exposes safe tools over MCP. Software that moves and deletes user files has an unforgiving failure mode—one wrong path resolution or state-machine race can destroy uncommitted source code.
When our initial prototype passed its first read-only audit, reviewers found 26 real defects in ten minutes. To raise the bar high enough to trust the tool on our own daily machines, we spent 8 November 2026 running 40 consecutive rounds of independent code review across three core subsystems.
| Core subsystem | Scope | Rounds | Window (starting 8 Nov) |
|---|---|---|---|
| Graveyard and auto-registration | Private graveyard, crash recovery, Claude Code & Codex hooks, background runner | 12 | ~01:00–07:00 |
| Delete guard | Pre-execution interception of rm, rmdir, git clean, and Remove-Item | 10 | ~07:55–12:35 |
| MCP server and Skill | Agent-facing protocol, safe tools, and usage instructions | 18 | 8 Nov 13:28 – 9 Nov 09:40 |
Findings do not decay smoothly to zero—and 18 rounds cost 20 hours
Across the 12 rounds on the graveyard and registration subsystem, the defect count followed a jagged curve rather than a neat drop:
- Round 1: 34 findings across two independent reviewers.
- Round 2: 18 findings.
- Round 3: 6 findings, plus 4 more we uncovered while auditing the fixes.
- Rounds 4 through 11: stubbornly hovered at 7 to 9 findings per round, punctuated by a round-7 redesign.
- Round 12: zero CRITICAL or HIGH findings.
Each phase surfaced a different species of bug. Early rounds cleared obvious logic flaws; middle rounds exposed interactions between previous fixes; late rounds probed increasingly synthetic edge cases.
The price was equally concrete: the 18 rounds on the MCP server and Skill alone took roughly 20 hours.

Five steps per round: separate finding from fixing
To avoid grading our own homework, every round followed five rigid steps:
- Parallel read-only review: two or three read-only reviewers examined the same codebase from separate angles—deletion safety and file identity, host integration and installers, and doc accuracy plus regressions. "Shared findings" flagged independently by multiple reviewers jumped straight to the top of the fix list.
- Code verification: reviewers make mistakes and occasionally contradict each other (one warning that the guard misses a command, another warning that the suggested replacement matches too broadly). Only findings verified directly against source code entered the fix list.
- Failing test first: every confirmed bug got a failing regression test before any production code changed.
- Diff and mutation check: verify the diff, run the suite, and confirm that reverting the fix into a compiling broken version turns the test red.
- Fresh eyes: send the patched code to new reviewers with no prior round context, repeating until a full round reported zero CRITICAL or HIGH issues.
Five catches that paid for all 40 rounds
1. Graveyard round 7: get half-finished burials out of the ledger
Early code stored in-progress burial state directly on ledger entries. By round 7, reviewers had traced a chain of recovery bugs to that single design choice—the field participated in main-lock concurrency yet also had to prove crash ownership on restart, so patching one race opened another.
Instead of adding another band-aid, we evicted half-finished burial state from the ledger completely and wrote a standalone manifest beside each grave before moving the target. We then injected crashes at 63 interruption points and verified that restart either finishes the ledger entry, cleans up an empty grave, or freezes safely for obit doctor to warn on.
2. Delete guard round 3 (CRITICAL): reviving an || fallback wipe
Consider rm -r repo || /usr/bin/rm -rf backup. Normally the right-hand command runs only if rm -r repo fails. When the guard suggested replacing the first segment with obit rm, Obituary could legitimately refuse repo (for example, because it is a protected repository) and return a non-zero exit code—
which immediately triggered the unguarded /usr/bin/rm -rf backup behind ||, permanently destroying backup.
The fix tightened replacement eligibility: a rewritten deletion must be the final command segment, preceded only by && or ;. Anything involving ||, pipes, or background operators never receives a drop-in replacement.
3. Delete guard round 5: lexical normalization deleting the wrong file
In missing/../keep.txt, real rm fails because missing does not exist. If the guard lexically collapses the path to keep.txt before building an equivalent obit command, it buries a file the original command would never have touched.
We fixed path handling to verify every parent segment exists before resolving .., and stopped emitting drop-in equivalents for those constructs in Bash altogether. From that round onward, we also locked common shell deletion patterns into a master scenario table executed on every single round.
4. Delete guard round 8: failing open under error
Both HIGH findings in round 8 shared one fatal flaw:
- When writing the audit log failed, an already-decided denial was canceled.
- When wildcard prescanning exceeded its budget or reading the current working directory failed, a command slated for denial was allowed through instead.
The worst failure mode for a safety guard is turning itself off whenever it hits an error.
5. MCP round 1: racing the host over ~/.claude.json
Out of 11 findings in the first MCP review, the top HIGH caught a silent corruption hazard:
We were editing ~/.claude.json directly while Claude Code rewrites that entire file during runtime—concurrent writes could silently swallow each other's changes.
We switched to read-only inspection of ~/.claude.json for ownership checks and delegated all mutations to the official claude mcp add and claude mcp remove commands. The same round also caught four classic medium bugs: reporting a skipped resurrect as success with a warning, executing lock-waiting mutations after client cancellation, advertising obit_bury as restorable while in Recycle Bin mode, and letting a corrupt .mcp.json block uninstalling hooks.
Later rounds pushed deeper into exotic territory: Windows 8.3 short names, NTFS alternate data streams, Unicode case-folding making K collide with the Kelvin sign K, and volume identity attribution. Every single one was logically valid, yet virtually impossible to hit without crafting deliberate inputs.
Knowing when to stop: grade severity by blast radius
Keep adding fresh reviewers and they will always find something else. Without an explicit stopping rule, review loops eat the entire schedule.
Halfway through the MCP rounds, most newly filed HIGHs required extended-length paths, crafted WSL filenames, or obscure Unicode folding—and even if triggered, the worst outcome was burying a file into the restorable graveyard rather than permanently destroying it. We codified severity strictly by consequence:
- HIGH (must fix to zero): any bug that can permanently delete, move, or overwrite the wrong object.
- MEDIUM / LOW: issues requiring contrived extended or WSL-crafted names that never cause permanent data loss.
- Small fixes and test-only changes: one review round is enough.
Code review cannot prove the absence of bugs; it sets a bar whose height has to match the blast radius of a mistake.
Three mechanical checks against wishful thinking
"It's fixed" is the easiest sentence in software engineering to get wrong. Three automated checks keep us honest.
1. Red-then-green against a compiling broken variant
Turning a finding into a regression test outlives the patch: the patch fixes today, the test guards every future refactor. Before changing guard, locate, settle, commit, or recycle logic, we write a failing test, apply the fix, then temporarily revert to a broken implementation that still compiles to prove the test turns red.
2. Compile-time mutation testing: 654 guarded invariants
Using Go's go test -overlay, we maintain two explicit mutation tables. Each entry specifies an exact source file, the exact safety check to break (such as flipping a guard condition to false), and the exact test required to catch it:
| Mutation suite | Mutants |
|---|---|
| Core safety gates and MCP | 516 |
| Delete guard | 138 |
| Total | 654 |
Timing two mutants locally—patching source, compiling, and failing the targeted test—took 3.9 s and 4.8 s. In CI, the full 654-mutant set shards across 8 parallel runners.

3. The delete-guard master scenario table
Common shell deletion invocations stay pinned in a master scenario suite run on every round and every parser refactor, guaranteeing that fixing a subtle edge case never silently breaks plain rm -rf.
Two lasting repo habits
- Name tests after the invariant they guard, never the review round. A filename like
review_r7_test.gotells you when a bug was filed, not what contract breaks if it fails. The back-and-forth stays in commit messages. - Keep public docs focused on current rules and rationale. Early architecture docs accumulated narratives of what round 11 tried and reverted; we stripped those out so documentation explains what holds today and why.
At the end of every major phase, we also run a behavior-preserving structural cleanup—splitting oversized files and isolating end-to-end packages—gated on identical test counts, identical pass results, and every existing mutation test still catching its bug.