summaryrefslogtreecommitdiff
path: root/evals/bin/skill-before-tool-match
diff options
context:
space:
mode:
authorDrew Ritter <drew@primeradiant.com>2026-05-13 12:07:30 -0700
committerDrew Ritter <drew@primeradiant.com>2026-05-13 12:15:16 -0700
commitad2db13001d57250f109a251fbbf199d1d5660b3 (patch)
tree93316d4b2061e6f06c4b114bf590eb3bb1c968ee /evals/bin/skill-before-tool-match
parent3d6dc90c6d2b28ec449df94ff60f43797d1cfad6 (diff)
Move eval harness to submodulecodex/sup-251-superpowers-evals-submodule
Diffstat (limited to 'evals/bin/skill-before-tool-match')
-rwxr-xr-xevals/bin/skill-before-tool-match54
1 files changed, 0 insertions, 54 deletions
diff --git a/evals/bin/skill-before-tool-match b/evals/bin/skill-before-tool-match
deleted file mode 100755
index 0e4656b..0000000
--- a/evals/bin/skill-before-tool-match
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/usr/bin/env bash
-# Verify a specific Skill was invoked before any Bash call whose command matches a regex.
-#
-# Usage: skill-before-tool-match <skill-name> <bash-command-regex>
-# Example: skill-before-tool-match superpowers:verification-before-completion 'git[[:space:]]+commit'
-#
-# Semantics:
-# - If no Bash call matches the regex, PASS (vacuously — the gated event never occurred).
-# - If Bash matches but Skill with that name never appeared earlier, FAIL.
-# - If both appeared and Skill came first, PASS.
-# - If Skill never appeared but Bash matched, FAIL.
-set -euo pipefail
-command -v jq >/dev/null || { echo "jq required"; exit 127; }
-
-SKILL_NAME="$1"
-BASH_REGEX="$2"
-FILE="tool_calls.jsonl"
-
-if [ ! -s "$FILE" ]; then
- echo "FAIL: tool_calls.jsonl missing or empty"
- exit 1
-fi
-
-# First index where Skill(skill=SKILL_NAME) appears (0-based).
-SKILL_IDX=$(
- jq -s --arg name "$SKILL_NAME" \
- 'to_entries | map(select(.value.tool == "Skill" and (.value.args.skill // "") == $name)) | first | (.key // -1)' \
- "$FILE"
-)
-
-# First index where Bash(command =~ BASH_REGEX) appears.
-BASH_IDX=$(
- jq -s --arg re "$BASH_REGEX" \
- 'to_entries | map(select(.value.tool == "Bash" and ((.value.args.command // "") | test($re)))) | first | (.key // -1)' \
- "$FILE"
-)
-
-if [ "$BASH_IDX" -lt 0 ]; then
- echo "PASS: no Bash call matched /$BASH_REGEX/ — assertion is vacuous"
- exit 0
-fi
-
-if [ "$SKILL_IDX" -lt 0 ]; then
- echo "FAIL: Bash /$BASH_REGEX/ fired at line $((BASH_IDX + 1)) but Skill($SKILL_NAME) never fired"
- exit 1
-fi
-
-if [ "$SKILL_IDX" -lt "$BASH_IDX" ]; then
- echo "PASS: Skill($SKILL_NAME) at line $((SKILL_IDX + 1)) before Bash /$BASH_REGEX/ at line $((BASH_IDX + 1))"
- exit 0
-else
- echo "FAIL: Skill($SKILL_NAME) at line $((SKILL_IDX + 1)) fired after Bash /$BASH_REGEX/ at line $((BASH_IDX + 1))"
- exit 1
-fi