From e487d34b40359571c7f158a25acbce1c9e4695b2 Mon Sep 17 00:00:00 2001 From: Ed_ Date: Tue, 16 Jun 2026 19:51:16 -0400 Subject: [PATCH] feat(tier2): add post-checkout detection hook (logs to tier2_checkout_log.txt) --- conductor/tier2/githooks/post-checkout | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 conductor/tier2/githooks/post-checkout diff --git a/conductor/tier2/githooks/post-checkout b/conductor/tier2/githooks/post-checkout new file mode 100644 index 00000000..8bd615fe --- /dev/null +++ b/conductor/tier2/githooks/post-checkout @@ -0,0 +1,13 @@ +#!/bin/sh +# Tier 2 autonomous mode: detect (not prevent) any `git checkout` of tracked files. +# Layer 1 (OpenCode permission) is the primary defense; this is a logging backup. + +LOG_DIR="${LOCALAPPDATA:-$HOME/.local/share}/manual_slop/tier2" +LOG_FILE="$LOG_DIR/tier2_checkout_log.txt" +mkdir -p "$LOG_DIR" 2>/dev/null || true + +COMMIT=$(git rev-parse HEAD 2>/dev/null || echo "unknown") +TIMESTAMP=$(date -u +"%Y-%m-%dT%H:%M:%SZ" 2>/dev/null || date -u) +echo "[$TIMESTAMP] checkout detected: $COMMIT, files: $*" >> "$LOG_FILE" 2>/dev/null || true + +exit 0