"""Phase 13 sites 3+4 + SS 6: index_file batched migration. index_file has 3 sites: - Site 3 (BC at L247): try: mtime = os.path.getmtime(full_path); except Exception: return - Site 4 (BC at L261): try: with open(full_path, ...) as f: content = f.read(); except Exception: return - Site 6 (SS at L255): try: res = self.collection.get(...); ...; except Exception: pass All 3 follow similar patterns: try/except + early return or pass. """ import sys sys.path.insert(0, ".") def test_phase13_sites346_index_file_no_broad_except(): """index_file must not have bare 'except Exception'.""" import inspect import src.rag_engine src_text = inspect.getsource(src.rag_engine.RAGEngine.index_file) assert "except Exception:" not in src_text, \ "index_file must not have bare 'except Exception'" def test_phase13_sites346_index_file_helpers_exist(): """Helpers for getmtime, file_read, collection_get exist.""" import src.rag_engine # Check via dir() of the class members = [m for m in dir(src.rag_engine.RAGEngine) if 'result' in m.lower()] # We expect 3 new _result helpers added to index_file assert len(members) >= 3, f"Expected at least 3 _result helpers, got {members}"