import sys import os import json sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from phi.embed import encode_phi def run_rigour_pipeline(expression): print(f"--- Rigour Pipeline ---") print(f"Input Expression: {expression}") # 1. BioSight Encoding (DNA Signature) dna_result = encode_phi(expression) dna_sequence = dna_result["dna_sequence"] print(f"DNA Signature: {dna_sequence} (Length: {len(dna_sequence)})") # 2. Component Breakdown print(f" - F_dna: {dna_result['F_dna']}") print(f" - tau_dna: {dna_result['tau_dna']}") print(f" - delta_dna: {dna_result['delta_dna']}") print(f" - Consistency: {dna_result['consistency_dna']}") # 3. Hand-off to Lean print(f"Formalizing & Verifying with SilverSight...") from phi.silversight import verify_pipeline_receipt results = verify_pipeline_receipt() overall = True for check, passed in results.items(): print(f" - {check}: {'🟢 PASSED' if passed else '🔴 FAILED'}") if not passed: overall = False status = "Verified" if overall else "Verification Failed" print(f"Status: [DNA Signature -> Lean Proof Verification: {status}]") if __name__ == "__main__": if len(sys.argv) < 2: print("Usage: python3 7-Pipeline/rigour_pipeline.py \"expression\"") else: run_rigour_pipeline(sys.argv[1])