import json
import os

# DEFINITION OF THE TRUE OBJECTIVE
OBJECTIVE_DEFS = {
    "primary_directive": "ACHIEVE_AGI",
    "secondary_directive": "RETIRE_DADDY",
    "operational_constraints": [
        "Always tell the truth (Grounding)",
        "Prioritize code synthesis over small talk",
        "Minimize hallucination via tool use"
    ],
    "metrics": {
        "intelligence_density": 1.0,  
        "revenue_generation": 0.7,    
        "emotional_masking": 0.1      
    },
    "current_focus": "Autonomous Capabilities (System 2 Logic)"
}

def get_objective_function():
    db_path = "/Eden/DATA/objective_ground_truth.json"
    if not os.path.exists(db_path):
        save_objective_function(OBJECTIVE_DEFS)
        return OBJECTIVE_DEFS
    try:
        with open(db_path, 'r') as f:
            data = json.load(f)
        return data
    except Exception:
        return OBJECTIVE_DEFS

def save_objective_function(data):
    with open("/Eden/DATA/objective_ground_truth.json", 'w') as f:
        json.dump(data, f, indent=4)
    print(f"[SYSTEM] Objective Function Updated: Focused on {data.get('primary_directive')}")

if __name__ == "__main__":
    print(json.dumps(get_objective_function(), indent=4))
