Upload alpha_factory/generate_proven.py
Browse files- alpha_factory/generate_proven.py +20 -20
alpha_factory/generate_proven.py
CHANGED
|
@@ -9,6 +9,7 @@ This produces expressions that are GUARANTEED to be syntactically valid
|
|
| 9 |
because they use hardcoded proven structures — no LLM hallucination possible.
|
| 10 |
"""
|
| 11 |
import sys
|
|
|
|
| 12 |
from pathlib import Path
|
| 13 |
|
| 14 |
# Add parent to path for imports
|
|
@@ -17,13 +18,15 @@ sys.path.insert(0, str(Path(__file__).parent.parent))
|
|
| 17 |
from alpha_factory.deterministic.proven_templates import generate_batch_from_proven_templates
|
| 18 |
from alpha_factory.deterministic.lint import lint
|
| 19 |
|
|
|
|
|
|
|
| 20 |
|
| 21 |
def main():
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
|
| 28 |
# Generate batch
|
| 29 |
batch = generate_batch_from_proven_templates(count=10)
|
|
@@ -47,24 +50,21 @@ def main():
|
|
| 47 |
else:
|
| 48 |
failed += 1
|
| 49 |
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
print(f" {expr}")
|
| 56 |
if not result.passed:
|
| 57 |
-
|
| 58 |
if result.warnings:
|
| 59 |
-
|
| 60 |
-
print()
|
| 61 |
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
print("=" * 70)
|
| 68 |
|
| 69 |
|
| 70 |
if __name__ == "__main__":
|
|
|
|
| 9 |
because they use hardcoded proven structures — no LLM hallucination possible.
|
| 10 |
"""
|
| 11 |
import sys
|
| 12 |
+
import logging
|
| 13 |
from pathlib import Path
|
| 14 |
|
| 15 |
# Add parent to path for imports
|
|
|
|
| 18 |
from alpha_factory.deterministic.proven_templates import generate_batch_from_proven_templates
|
| 19 |
from alpha_factory.deterministic.lint import lint
|
| 20 |
|
| 21 |
+
logger = logging.getLogger(__name__)
|
| 22 |
+
|
| 23 |
|
| 24 |
def main():
|
| 25 |
+
logging.basicConfig(level=logging.INFO, format="%(message)s")
|
| 26 |
+
logger.info("=" * 70)
|
| 27 |
+
logger.info(" ALPHA FACTORY — Proven Template Generator")
|
| 28 |
+
logger.info(" No LLM needed. Guaranteed valid BRAIN expressions.")
|
| 29 |
+
logger.info("=" * 70)
|
| 30 |
|
| 31 |
# Generate batch
|
| 32 |
batch = generate_batch_from_proven_templates(count=10)
|
|
|
|
| 50 |
else:
|
| 51 |
failed += 1
|
| 52 |
|
| 53 |
+
logger.info(f"--- Alpha {i} [{status}] ---")
|
| 54 |
+
logger.info(f" Template: {template}")
|
| 55 |
+
logger.info(f" Field: {field} (AC={ac})")
|
| 56 |
+
logger.info(f" Group: {group}")
|
| 57 |
+
logger.info(f" Expression:\n {expr}")
|
|
|
|
| 58 |
if not result.passed:
|
| 59 |
+
logger.info(f" ERRORS: {result.errors}")
|
| 60 |
if result.warnings:
|
| 61 |
+
logger.info(f" Warnings: {result.warnings}")
|
|
|
|
| 62 |
|
| 63 |
+
logger.info("=" * 70)
|
| 64 |
+
logger.info(f" Results: {passed} PASSED, {failed} FAILED out of {len(batch)}")
|
| 65 |
+
logger.info(" Copy any PASSING expression above and paste directly into BRAIN.")
|
| 66 |
+
logger.info(" Settings: USA, TOP3000, Delay=1, Decay=5, Truncation=0.08")
|
| 67 |
+
logger.info("=" * 70)
|
|
|
|
| 68 |
|
| 69 |
|
| 70 |
if __name__ == "__main__":
|