Skip to content

land #665: feat(hosthooks): recheck a delete's blast radius before execution (#649) - #680

Merged
fu351 merged 2 commits into
mainfrom
land/pr665
Sep 8, 2026
Merged

land #665: feat(hosthooks): recheck a delete's blast radius before execution (#649)#680
fu351 merged 2 commits into
mainfrom
land/pr665

Conversation

@fu351

@fu351 fu351 commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Lands #665 (feat(hosthooks): recheck a delete's blast radius before execution) by @harshitagrawal2O via a landing branch: their commits cherry-picked onto current main with authorship preserved, because main requires up-to-date branches and refuses merge commits.

Mechanical changes on this branch: none.

Closes #649

harshitagrawal2O and others added 2 commits September 8, 2026 15:53
Before a risky delete runs, Doberman counts what it would touch, shows that to
the human, and recounts right before execution, blocking if the count moved
(ADR 0094's TOCTOU guard, reason code effect_set_diverged). That guard lived
only in proxy/executor.py, so none of the four supported hosts had it, even
though a host hook is how most agents actually reach a tool. `grep -rln
effect_set_diverged src/doberman/` now lists hosthooks/hookio.py.

The host-hook path computed no preview at all, so there was nothing a recheck
could compare against and the challenge rendered no blast radius. This adds
both halves in hookio.resolve_auth_result, the one place every adapter turns an
approval into an execution:

* before the challenge, compute the bounded effect set and attach it to the
  decision the prompters render, so the human approves a blast radius they can
  actually see;
* after they answer, recompute the same operands and deny if the digest moved.

Drift in either direction denies, and so does a known count degrading to
unknown. A dynamic delete is `unknown` at both ends and cannot re-deny on
dynamism alone. A recheck that raises denies too: a guard that cannot verify
must not report success.

Cost is unchanged for everything else. Both helpers early-out before any
filesystem work for a non-delete action, and both imports are lazy, so the
PASS/BLOCK hot path this module's docstring protects still pays nothing.

Mutation-checked: forcing `diverged = False` turns six of the new tests red.

OpenClaw is deliberately not covered and LIMITATIONS.md now says so: it defers
an AUTH to its own /approve flow, which resolves outside this process, so there
is no moment inside the hook where a recheck could run.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
(cherry picked from commit da48b49)
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
(cherry picked from commit 82989e8)
@fu351
fu351 merged commit f2c39ec into main Sep 8, 2026
12 checks passed
@fu351
fu351 deleted the land/pr665 branch September 8, 2026 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hosthooks: the delete recheck before execution only runs on the MCP proxy path

2 participants