๐Ÿ— KeyzHub
19Keys ยท community archive
2360 bytes raw
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/usr/bin/env bash
# Verification gate for the funnel-psychology master.
# This is the anti-theater proof: it runs verify_funnel_psychology.py against a
# known-EXCELLENT sample (must PASS) and a deliberately-broken sample (must FAIL).
# If the gate ever passes the bad sample or fails the good one, this script exits
# nonzero โ€” that means the linter is decorative, not real, and must be fixed before
# any deliverable in this discipline can be trusted.
set -euo pipefail

ROOT="$(cd "$(dirname "$0")" && pwd)"
cd "$ROOT"

echo "== funnel-psychology harness :: anti-theater gate =="

# --- toolchain check --------------------------------------------------------
if ! command -v python3 >/dev/null 2>&1; then
  echo "FAIL: python3 not found on PATH" >&2
  exit 1
fi

LINTER="$ROOT/verify_funnel_psychology.py"
if [ ! -f "$LINTER" ]; then
  echo "FAIL: linter not found at $LINTER" >&2
  exit 1
fi

GATE_RC=0

# --- good sample MUST pass ---------------------------------------------------
echo "-- samples/good/* must PASS --"
shopt -s nullglob
GOOD_FILES=("$ROOT"/samples/good/*)
shopt -u nullglob
if [ ${#GOOD_FILES[@]} -eq 0 ]; then
  echo "FAIL: no files in samples/good/ โ€” nothing to prove the gate against" >&2
  exit 1
fi
for f in "${GOOD_FILES[@]}"; do
  echo "   checking: $f"
  if python3 "$LINTER" "$f" --type funnel-blueprint; then
    echo "   OK: $f passed (expected PASS)"
  else
    echo "   GATE FAILURE: good sample '$f' did NOT pass โ€” linter is too strict or the sample regressed" >&2
    GATE_RC=1
  fi
done

# --- bad sample MUST fail ----------------------------------------------------
echo "-- samples/bad/* must FAIL --"
shopt -s nullglob
BAD_FILES=("$ROOT"/samples/bad/*)
shopt -u nullglob
if [ ${#BAD_FILES[@]} -eq 0 ]; then
  echo "FAIL: no files in samples/bad/ โ€” nothing to prove the gate catches defects" >&2
  exit 1
fi
for f in "${BAD_FILES[@]}"; do
  echo "   checking: $f"
  if python3 "$LINTER" "$f" --type funnel-blueprint; then
    echo "   GATE FAILURE: bad sample '$f' PASSED โ€” linter is not catching known defects" >&2
    GATE_RC=1
  else
    echo "   OK: $f correctly failed (expected FAIL)"
  fi
done

if [ "$GATE_RC" -ne 0 ]; then
  echo "FAIL: anti-theater gate did not hold โ€” see failures above" >&2
  exit 1
fi

echo "PASS: linter correctly passes the good sample and fails the bad sample."
exit 0