Skip to main content

Module destructive

Module destructive 

Source
Expand description

The register of verbs that destroy, and the one rule they all obey.

§Why a register instead of two guards

cache clear learned Explicit Target Designation on 2026-08-10 and the same plan said config init --force would learn it too. Only the first was built. The gap was not the missing guard — it was that nothing could tell the guard was missing, because the rule lived inside one match arm and could not be asked a question. A second destructive verb shipped without a waiver and every gate agreed with the tree.

So the rule moved here. The runtime reads this list to decide whether to refuse, and tests/policy/etd.rs reads the same list to demand a waiver flag, a target_source in the schema, and a line in both configuration references. A third verb that destroys is either in this list or the class gate fails; it cannot be quietly correct the way config init --force was.

§What counts as designation

Naming the directory in argv designates it. Passing the waiver accepts an ambient one on purpose. Passing neither means the caller never saw the path about to be destroyed, which is the confused-deputy shape: the caller names the verb, the environment names the victim, and nothing compares the two.

Structs§

DestructiveVerb
One verb that destroys, with everything needed to refuse it safely.

Constants§

CACHE_CLEAR
cache clear empties every cached body under the resolved cache root.
CONFIG_INIT_FORCE
config init --force replaces an existing config.toml in place.

Functions§

destructive_verbs
Every verb in this binary that destroys something it did not create.