You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
echo'{"decision":"block","reason":"This command matches a dangerous pattern and has been blocked by Kova safety protocol. If you genuinely need to run this, ask the human explicitly."}'
33
-
exit 0
62
+
# Check a string against all blocked patterns.
63
+
# Returns 0 (match) or 1 (no match). Prints the matched pattern on stdout.
64
+
_check_blocked() {
65
+
local text="$1"
66
+
forpatternin"${BLOCKED_PATTERNS[@]}";do
67
+
ifprintf'%s'"$text"| grep -qiF "$pattern";then
68
+
# --force-with-lease is semi-dangerous (warned), not catastrophic — don't block it
echo'{"decision":"block","reason":"This command matches a dangerous pattern and has been blocked by Kova safety protocol. If you genuinely need to run this, ask the human explicitly."}'
@@ -56,7 +59,7 @@ $(cat "$HISTORY_FILE" 2>/dev/null || echo "No history available")
56
59
DEBUGEOF
57
60
58
61
# Cross-model diagnosis before self-heal
59
-
codex_diag="/tmp/.claude-codex-diag-$PROJ_HASH"
62
+
codex_diag="$KOVA_TMP/codex-diag"
60
63
if codex_diagnose "DEBUG_LOG.md""$codex_diag";then
61
64
echo"">> DEBUG_LOG.md
62
65
cat "$codex_diag">> DEBUG_LOG.md
@@ -79,7 +82,7 @@ DEBUGEOF
79
82
PROMPT="Read DEBUG_LOG.md and fix all failures listed. Pay special attention to the 'Cross-Model Diagnosis [codex]' section if present — it contains analysis from a different AI model. Run tests after each fix. Do not ask questions — use the assumption protocol."
0 commit comments