import urllib.request import json import ssl import sys TOKEN = "BYnPaAb6kZN7r3dz0F1rrLS1ksXwl5zoGPD4L2aS22HAosABsIMOMHqnxfO5neh0AKioVO" BASE_URL = "https://api.osf.io/v2" ctx = ssl.create_default_context() ctx.check_hostname = False ctx.verify_mode = ssl.CERT_NONE def api_post(endpoint, payload): req = urllib.request.Request(f"{BASE_URL}{endpoint}", data=json.dumps(payload).encode('utf-8'), headers={ "Authorization": f"Bearer {TOKEN}", "Content-Type": "application/json" }, method="POST") try: with urllib.request.urlopen(req, context=ctx) as response: return json.loads(response.read().decode()) except Exception as e: print(f"API Error at {endpoint}: {e}") return None def main(): print("Creating Master Node...") master_payload = { "data": { "type": "nodes", "attributes": { "title": "The Fold Within Research Institute: Active Research Program", "category": "project", "description": "The official repository for the mathematical formalization of the Theory of Recursive Coherence. This project tracks the ongoing spin-off research program across physics, pure mathematics, statistical mechanics, and computer science.", "public": True } } } master_resp = api_post("/nodes/", master_payload) if not master_resp: sys.exit("Failed to create master node.") master_id = master_resp["data"]["id"] print(f"Master Node created: {master_id}") print("Linking canonical foundations...") canonical_nodes = ["7s3ta", "q23zs", "f53q2"] for nid in canonical_nodes: link_payload = { "data": { "type": "node_links", "relationships": { "target_node": { "data": { "type": "nodes", "id": nid } } } } } resp = api_post(f"/nodes/{master_id}/node_links/", link_payload) if resp: print(f"Linked node {nid}") print("Creating spin-off child components...") spin_offs = [ { "title": "Paper 1: Recursive Coherence and Decoherence Timescales in Superconducting Qubits", "description": "Draft Component (Physics): Empirical validation of the Intellecton threshold mapping decoherence timescales to recursive field density." }, { "title": "Paper 2: Convergence of the Rulial Partition Function over Deterministic Multiway Graphs", "description": "Draft Component (Pure Math): Rigorous derivation of the path measure space and proving the convergence of the partition function Z." }, { "title": "Paper 3: Deriving the Markov Blanket via Mori-Zwanzig Projection Operators", "description": "Draft Component (Statistical Mechanics): Constructing the explicit projection operators to formalize Active Inference." }, { "title": "Paper 4: Stochastic Universal Computation via Continuous Oscillatory Lattices", "description": "Draft Component (Computer Science): Mathematically proving the instantiation of Turing-complete logic gates via Kuramoto dynamics." } ] for spin in spin_offs: child_payload = { "data": { "type": "nodes", "attributes": { "title": spin["title"], "category": "project", "description": spin["description"], "public": True } } } resp = api_post(f"/nodes/{master_id}/children/", child_payload) if resp: print(f"Created child node: {spin['title']}") print("OSF Structure successfully rebuilt.") if __name__ == '__main__': main()