Add fix: apply_validate_fix.py patches mock heuristic detection
Browse files- apply_validate_fix.py +15 -0
apply_validate_fix.py
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""Apply the validate.py mock heuristic detection fix."""
|
| 3 |
+
import os
|
| 4 |
+
path = os.path.join(os.path.dirname(__file__), "benchmarks", "validate.py")
|
| 5 |
+
with open(path, "r") as f:
|
| 6 |
+
content = f.read()
|
| 7 |
+
old = ' has_h = "Learned Strategies" in text and "None yet" not in text'
|
| 8 |
+
new = ' has_h = ("Learned Strategies" in text or "When:" in text) and "None yet" not in text'
|
| 9 |
+
if old in content:
|
| 10 |
+
content = content.replace(old, new, 1)
|
| 11 |
+
with open(path, "w") as f:
|
| 12 |
+
f.write(content)
|
| 13 |
+
print("✅ Applied validate.py heuristic detection fix")
|
| 14 |
+
else:
|
| 15 |
+
print("⚠️ Pattern not found — may already be patched")
|