param(
  [string]$JsonPath = ".\GatherTradingData.json"
)

$ErrorActionPreference = "Stop"

powershell -ExecutionPolicy Bypass -File .\tools\run_engine_harness_gate.ps1 -JsonPath $JsonPath
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }

python .\tools\build_request_result_summary.py `
  --gate .\Temp\engine_harness_gate_result.json `
  --out .\Temp\request_result.txt
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }

Write-Output "YOLO_FULL_CYCLE_OK"
exit 0
