from pathlib import Path # Clean BOM for path in Path("app").rglob("*.py"): text = path.read_text(encoding="utf-8-sig") text = text.replace("\ufeff", "") path.write_text(text, encoding="utf-8") hf_path = Path("app/deployment/hf_status.py") text = hf_path.read_text(encoding="utf-8-sig") text = text.replace("\ufeff", "") override_ui = r''' # ===================================================== # Phase 27 override: clean user-facing home and app UI # ===================================================== def get_home_html() -> str: return """ GraphResearcher
Document Chat + GraphRAG

Upload documents. Ask questions. Verify every answer.

GraphResearcher lets users chat with PDFs and reports using citation-grounded retrieval, graph context, and source-backed answers. No document IDs, no Swagger, no developer workflow.

1. Upload
Add a PDF or document from the app sidebar.
2. Chat
Ask natural questions like ChatGPT or Gemini.
3. Verify
See document name, page number, source ID, and evidence preview.

Simple workspace

Users upload and select documents normally. Internal IDs stay hidden.

Grounded answers

Answers are generated from retrieved evidence and source citations.

GraphRAG inside

Graph context and retrieval fusion run behind the scenes for better document reasoning.

""" def get_product_app_html() -> str: return """ GraphResearcher App
No document selected Upload or select a document from the left sidebar.
Ready
Example: “Summarize this”, “Explain step by step”, “What are the key points?”, “Give evidence”.
""" ''' text += override_ui hf_path.write_text(text, encoding="utf-8") print("Phase 27 clean user app and citation UI added.")