#!/usr/bin/env bash set -euo pipefail # Benchmark script for ForgeAgent inference error fix validation # Checks if runtime state validation is implemented before HTTP call echo "=== ForgeAgent Inference Error Fix - Validation ===" >&2 LIB_FILE="tauri-app/src-tauri/src/lib.rs" if [[ ! -f "$LIB_FILE" ]]; then echo "ERROR: $LIB_FILE not found" >&2 echo "METRIC validation_score=0" exit 1 fi # Check if validation logic exists in start_forgeagent_session_command # Look for process_running check within the forgeagent function if grep -A 80 "start_forgeagent_session_command" "$LIB_FILE" | \ grep -q "process_running\|!snapshot\.ready\|!inner\.ready"; then echo "✓ Runtime state validation detected" >&2 echo "METRIC validation_score=100" echo "METRIC response_time_ms=500" else echo "✗ No runtime state validation found" >&2 echo "METRIC validation_score=0" echo "METRIC response_time_ms=500" fi echo "Validation complete" >&2