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_exeis the path the hook invokes (normallystd::env::current_exe());ttloverrides 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.