Skip to main content

Module install

Module install 

Source
Expand description

Arm / disarm the write guard.

install_guard writes a marker listing the allowed roots and merges a PreToolUse hook into the target harness’s project config. The original hook file is backed up verbatim in a manifest so teardown_guard restores it exactly.

The hook command points at the running binary (std::env::current_exe), so there is no separate hook script to ship and no interpreter to select.

Constants§

GUARD_MANIFEST
Manifest recording what install changed, so teardown can restore it.
GUARD_MARKER
Marker file (under the staged skills dir) that arms the guard.

Functions§

install_guard
Arm the write guard for an eval run. Returns the marker path. The guard is a no-op until this marker exists and is unexpired, so the hook is inert outside an active run. guard_exe is the path the hook invokes (normally std::env::current_exe()); ttl overrides the default 6h lifetime.
teardown_guard
Disarm the guard: restore the original harness hook file (or delete it if we created it) and remove the marker + manifest. Safe to call when no guard is installed. Returns true if a guard was found and torn down.