phase29ab(p5): freeze pattern7 split-scan near-miss with fixture+smoke

This commit is contained in:
2025-12-28 14:32:19 +09:00
parent 7a790a27cb
commit bea2a8d9bb
6 changed files with 249 additions and 14 deletions

View File

@ -0,0 +1,40 @@
#!/bin/bash
# Phase 29ab P5: Pattern7 first-fail minimal (contract violation)
# Tests: split scan with else step != i + 1 must fail-fast
source "$(dirname "$0")/../../../lib/test_runner.sh"
export SMOKES_USE_PYVM=0
require_env || exit 2
INPUT="$NYASH_ROOT/apps/tests/phase29ab_pattern7_firstfail_min.hako"
RUN_TIMEOUT_SECS=${RUN_TIMEOUT_SECS:-10}
set +e
OUTPUT=$(timeout "$RUN_TIMEOUT_SECS" env NYASH_DISABLE_PLUGINS=1 HAKO_JOINIR_STRICT=1 "$NYASH_BIN" "$INPUT" 2>&1)
EXIT_CODE=$?
set -e
if [ "$EXIT_CODE" -eq 124 ]; then
test_fail "phase29ab_pattern7_firstfail_min_vm: hakorune timed out (>${RUN_TIMEOUT_SECS}s)"
exit 1
fi
if [ "$EXIT_CODE" -eq 0 ]; then
echo "[FAIL] Expected JoinIR contract freeze error, got exit 0"
echo "[INFO] Output:"
echo "$OUTPUT" | tail -n 40 || true
test_fail "phase29ab_pattern7_firstfail_min_vm: Unexpected success"
exit 1
fi
if echo "$OUTPUT" | grep -q "\[joinir/phase29ab/pattern7/contract\]"; then
test_pass "phase29ab_pattern7_firstfail_min_vm: joinir contract freeze detected"
exit 0
else
echo "[FAIL] Expected joinir contract freeze tag in output"
echo "[INFO] Exit code: $EXIT_CODE"
echo "[INFO] Output:"
echo "$OUTPUT" | tail -n 60 || true
test_fail "phase29ab_pattern7_firstfail_min_vm: Missing joinir contract freeze tag"
exit 1
fi