#!/usr/bin/env python3 """Apply the validate.py mock heuristic detection fix.""" import os path = os.path.join(os.path.dirname(__file__), "benchmarks", "validate.py") with open(path, "r") as f: content = f.read() old = ' has_h = "Learned Strategies" in text and "None yet" not in text' new = ' has_h = ("Learned Strategies" in text or "When:" in text) and "None yet" not in text' if old in content: content = content.replace(old, new, 1) with open(path, "w") as f: f.write(content) print("✅ Applied validate.py heuristic detection fix") else: print("⚠️ Pattern not found — may already be patched")