"""Debug pipeline results.""" import sys, json, urllib.request r = urllib.request.urlopen("http://localhost:8003/reports/job_fee99485/json") d = json.loads(r.read()) raw = d.get("raw", {}) # Check what agents returned print("=== Agent results ===") agents = raw.get("agents", {}) vis = agents.get("visual_parser", {}) print(f"Visual parser: {vis}") # Check raw agent result data if available for key in raw: if key.startswith("_agent_"): print(f" {key}: {json.dumps(raw[key], indent=2)[:200]}") # Try direct Neo4j check print("\n=== Debug paragraph query ===") # Check what's in the JSON print(f"Keys in raw: {[k for k in raw.keys() if not k.startswith('_')][:20]}") print(f"paper_sections in raw: {'paper_sections' in raw}") print(f"paragraph_ai_scores in raw: {'paragraph_ai_scores' in raw}") print(f"paragraph_ai_scores type: {type(raw.get('paragraph_ai_scores'))}") # Check if report has the data print(f"\nai_text_detection in d: {'ai_text_detection' in d}") print(f"ai_text_detection in raw: {'ai_text_detection' in raw}")