"""
Seed Doctrinal Facts - Populates core Christological truths into Oracle.
Run after init_oracle.py, before starting FastAPI server.
"""

import sys
from pathlib import Path

sys.path.insert(0, str(Path(__file__).parent))

from oracle_service import ScriptureOracle

print("=" * 70)
print("Bible-Companion: Seeding Doctrinal Facts")
print("=" * 70)

oracle = ScriptureOracle()

# Core Christological facts
christology_facts = [
    "Jesus Christ is Lord, fully God and fully human, eternally begotten of the Father",
    "Christ's incarnation, atoning death, and bodily resurrection are Scripture's redemptive foundation",
    "The Old Testament testifies prophetically to Christ's coming incarnation and redemptive work",
    "The New Testament reveals Christ's incarnation, atonement, resurrection, and ongoing heavenly intercession",
    "Christ is alive, resurrected, sitting at the Father's right hand, actively interceding for believers",
    "Love is redemptive action-verb in Scripture; Christ is love incarnate, operating through His sacrifice and grace",
]

# Comparative theology facts
comparative_facts = [
    "Buddhism teaches enlightenment through self-effort and detachment; lacks incarnational redemption unique to Christ",
    "Islam denies Christ's deity, incarnation, and bodily resurrection—incompatible with Gospel of Christ's atonement",
    "Stoicism relies on reason alone for virtue and detachment; Gospel offers grace-based transformation through Christ",
    "Only Christ's incarnation, death, and resurrection provide redemption; no alternative worldview offers this",
]

# Hermeneutical principles
hermeneutics_facts = [
    "Christological hermeneutics: All Scripture testifies to Christ's person and work",
    "OT prophecy patterns point to Christ's incarnation, suffering, resurrection, and exaltation",
    "NT application: believers participate in Christ's redemptive story through grace",
    "Redemption is about being restored to relationship with God through Christ, not self-improvement",
]

# Historical apologetics anchors
historical_apologetics_facts = [
    "The resurrection claim is rooted in early eyewitness testimony preserved in 1 Corinthians 15:3-8 within the first generation of the church",
    "The empty tomb tradition and post-resurrection appearances are central, early, and multiply attested in New Testament witness",
    "The rapid rise of the early church in Jerusalem is historically tied to public proclamation of the risen Christ",
    "Christian faith is not only ethical teaching but a historical claim: Jesus died, was buried, and rose bodily",
]

all_facts = [
    (christology_facts, "christology"),
    (comparative_facts, "comparative_theology"),
    (hermeneutics_facts, "hermeneutics"),
    (historical_apologetics_facts, "historical_apologetics"),
]

total_added = 0

try:
    for facts_list, fact_type in all_facts:
        print(f"\n📚 Adding {fact_type.upper()} facts...")
        for i, fact in enumerate(facts_list, 1):
            oracle.add_doctrinal_fact(fact, fact_type=fact_type, confidence=0.95)
            print(f"   [{i}] ✅ {fact[:70]}...")
            total_added += 1

    print(f"\n" + "=" * 70)
    print(f"✅ SUCCESS: Seeded {total_added} doctrinal facts")
    print(f"\nOracle is now ready with:")
    print(f"   • Christological foundation facts")
    print(f"   • Comparative theology context")
    print(f"   • Hermeneutical principles")
    print(f"\nNext step: Start FastAPI server with: uvicorn main:app --reload")
    print("=" * 70)

except Exception as e:
    print(f"\n❌ ERROR seeding facts: {e}")
    import traceback
    traceback.print_exc()
    sys.exit(1)
