Heavy-Tools / phases /phase1_ingest.py
lexicalspace's picture
Upload 9 files
d6dec4f verified
raw
history blame contribute delete
369 Bytes
import os, zipfile, json
def ingest(rulebook_text, code_zip):
os.makedirs("artifacts", exist_ok=True)
with open("artifacts/rulebook_raw.txt", "w", encoding="utf-8") as f:
f.write(rulebook_text)
if code_zip:
with zipfile.ZipFile(code_zip, "r") as z:
z.extractall("artifacts/code")
return "Ingestion complete"