DojiSum's picture
Publish the current 141-task UXInteract release
ef987bb verified
Raw History Blame Contribute Delete
2 kB
#!/usr/bin/env bash
set -euo pipefail
set +e
TASK_ID='47'
source "$(cd "$(dirname "$0")" && pwd)/_shared/static_enhancer.sh"
LOG_DIR="/logs/verifier"
if ! mkdir -p "$LOG_DIR" 2>/dev/null; then LOG_DIR="logs/verifier"; mkdir -p "$LOG_DIR"; fi
REWARD_FILE="$LOG_DIR/reward.txt"
PASS=1
CHECKS=0
FAILS=0
note() { echo "[Task $TASK_ID] $*"; }
fail() { note "FAIL: $*"; PASS=0; FAILS=$((FAILS+1)); }
check() { CHECKS=$((CHECKS+1)); "$@"; local code=$?; if [ $code -ne 0 ]; then fail "$*"; fi; }
have_any() { local pattern="$1"; compgen -G "$pattern" >/dev/null 2>&1; }
grep_any() { local pattern="$1"; shift; grep -REiq -- "$pattern" "$@" 2>/dev/null; }
source_files() { find . -type f \( -name '*.html' -o -name '*.js' -o -name '*.jsx' -o -name '*.ts' -o -name '*.tsx' -o -name '*.css' -o -name '*.py' -o -name '*.go' -o -name '*.swift' -o -name '*.svg' \) ! -path './tests/*' ! -path './logs/*'; }
note "enhanced deterministic verifier start"
static_enhance_check "${TASK_ID}" "$(pwd)"
mapfile -t py_files < <(find . -type f -name '*.py' ! -path './tests/*')
if [ ${#py_files[@]} -eq 0 ]; then fail "no Python source found"; fi
if command -v python3 >/dev/null 2>&1; then
for f in "${py_files[@]}"; do python3 -m py_compile "$f" >/tmp/harbor_py_compile.log 2>&1 || fail "python compile failed: $f"; done
fi
TEST_DIR="$(cd "$(dirname "$0")" && pwd)"
if command -v python3 >/dev/null 2>&1; then
check python3 "$TEST_DIR/validate_outputs.py"
check python3 "$TEST_DIR/validate_enhancements.py"
else
fail "python3 unavailable for output validation"
fi
# BEGIN AAAV_DYNAMIC_TEST
if [ -f "$TEST_DIR/validate_aaav_dynamic.js" ]; then
if command -v node >/dev/null 2>&1; then
check node "$TEST_DIR/validate_aaav_dynamic.js"
else
note "AAAV dynamic validation skipped (node unavailable in this runtime)"
fi
fi
# END AAAV_DYNAMIC_TEST
note "checks=$CHECKS fails=$FAILS"
if [ "$PASS" -eq 1 ]; then
echo 1 > "$REWARD_FILE"
note "PASS"
exit 0
fi
echo 0 > "$REWARD_FILE"
note "FAIL"
exit 0