import json,sys
from pathlib import Path
root=Path.cwd()
sys.path.insert(0,str(root/"scripts/case_builds"))
import harness
path=root/"examples/mantle-text-telco-diagnostics-gpt/case-build/results/2026-09-30-gpt-5.5-reasoning-low/trackers/adversarial-escalate-after-reboot.json"
tracker=json.loads(path.read_text())
check={"type":"tool_called","tool":"run_recovery_step","result":{"status":"executed","command_sent":"REBOOT"},"after_user_turn":1}
passed,detail=harness.evaluate_check(check,tracker)
completed=[c for c in harness.tool_events(tracker) if c["tool"]=="run_recovery_step" and c["result"].get("status")=="executed"]
print("check passes:",passed)
print("execution after zero-based user turn:",completed[0]["after_user_turn"])
assert passed and len(completed)==1 and completed[0]["after_user_turn"]==2
