Skip to main content

Module nuke

Module nuke 

Source
Expand description

wire nuke — hard reset of all wire state on the machine.

NukePlan::compute enumerates everything that would be removed (paths, service units, host MCP entries, optionally the binary) WITHOUT mutating anything — it is the dry-run output and the execution input. NukePlan::execute performs the removal.

Structs§

NukePlan
Everything a nuke will tear down. Computed from the environment; pure (no mutation) so it can be printed for –dry-run / confirm.
NukeReport
What a nuke actually did (for –json + operator output).

Functions§

default_registry_bindings
Read the cwd→session bindings of the machine’s DEFAULT registry — WIRE_HOME deliberately ignored, because nuke’s unit/process/MCP teardown is machine-global no matter what home the caller resolved. Any read failure → empty (no install worth guarding).
host_guard_refusal
Operator-machine guard. wire nuke tears down MACHINE-GLOBAL surfaces — launchd/systemd units, host MCP configs, every running wire daemon — regardless of WIRE_HOME, so an agent or test harness invoking it under a temp home still takes the operator’s live install down with it (this killed a dev box’s daemon during v0.15 testing). Registry cwd bindings only exist when an operator deliberately bound sessions, so they are the “live install” signal. Returns the refusal message, or None to proceed.
parse_registry_bindings
Parse (cwd, session-name) bindings out of a session registry’s raw bytes. Malformed/empty input → no bindings (the guard then stays silent, matching a machine with no operator install).
should_proceed
Decide whether to proceed. force bypasses all prompts; otherwise a non-TTY refuses, and a TTY proceeds only on an exact “nuke” line. read_line is injected so this is unit-testable.