Private
Public Access
0
0
Files
manual_slop/tests
ed 6399dcc4ed refactor(rag_engine,ai_client): rag_engine.search returns List[RAGChunk] directly
Phase 5: rag_engine.search() return type (FR4 row 7)
Before: def search(...) -> List[Dict[str, Any]] at src/rag_engine.py:367
After:  def search(...) -> List["RAGChunk"]
Delta:  -1 wrong type annotation (List[Dict] -> List[RAGChunk])

RAGChunk dataclass extended with `id: str = ""` field to preserve the
chroma wire-format identifier. The search() function now constructs
RAGChunk instances directly from chromadb query results, normalizing
the wire format (metadata.path -> RAGChunk.path; distance -> 1.0 - score)
at the boundary.

Consumer updates:
- src/ai_client.py:3259-3266: chunk["metadata"]["path"] -> chunk.path;
  chunk["document"] -> chunk.document (direct attribute access)
- src/app_controller.py:3506: docstring updated from Result[List[Dict]]
  to Result[List[RAGChunk]] (no code change; pass-through)

Test updates:
- tests/test_rag_engine.py:61: results[0]["id"] -> results[0].id
  (now uses dataclass attribute access)

Verification:
- audit_weak_types --strict: OK (107 <= 112 baseline)
- py_check_syntax: OK on rag_engine.py, ai_client.py, test_rag_engine.py
- 21 RAG tests pass (test_rag_engine, test_rag_chunk,
  test_rag_engine_ready_status_bug, test_rag_integration,
  test_context_composition_decoupled, test_tiered_aggregation)
2026-06-26 04:54:02 -04:00
..
2026-03-05 17:13:59 -05:00
2026-05-10 15:14:54 -04:00
2026-05-20 07:51:58 -04:00
2026-03-05 16:37:30 -05:00
2026-03-05 17:13:59 -05:00
2026-03-05 16:37:30 -05:00
2026-03-07 20:32:59 -05:00
2026-03-05 15:10:53 -05:00
2026-03-12 19:08:51 -04:00
ok
2026-03-07 21:40:40 -05:00