Why
Current conditional break: chains/rag_search.py:87 queries managers.manager_id and returns an empty catalog on schema error. chains/rag_search.py:197 repeats the assumption for explicit manager filters. The repo bootstrap at scripts/seed_managers.py:48 uses id. Matched fixtures yield a manager-1 match for the full Elliott name on manager_id schema and no match on id schema, silently dropping structured manager context.
Scope
RAG catalog, manager matching, and structured manager context on both supported SQLite schemas and Postgres.
Non-Goals
Do not change LLM prompts, model selection, or semantic ranking. Scaffold-only completion does NOT count: resolving catalog names but leaving explicit structured filters broken is a failure of this issue.
Tasks
Acceptance Criteria
Implementation Notes
Verified at 4523cf5. Reproduction imports llm before chains to match application startup and isolate the schema issue from the separate standalone circular-import limitation. No LLM/provider calls used.
Why
Current conditional break:
chains/rag_search.py:87queries managers.manager_id and returns an empty catalog on schema error.chains/rag_search.py:197repeats the assumption for explicit manager filters. The repo bootstrap atscripts/seed_managers.py:48uses id. Matched fixtures yield a manager-1 match for the full Elliott name on manager_id schema and no match on id schema, silently dropping structured manager context.Scope
RAG catalog, manager matching, and structured manager context on both supported SQLite schemas and Postgres.
Non-Goals
Do not change LLM prompts, model selection, or semantic ranking. Scaffold-only completion does NOT count: resolving catalog names but leaving explicit structured filters broken is a failure of this issue.
Tasks
_manager_cataloginchains/rag_search.pyusing the existing helper inadapters/base.py._structured_searchinchains/rag_search.py.tests/test_rag_search_chain.pyfor name extraction, explicit manager context, and unrelated managers.Acceptance Criteria
chains/rag_search.py; the new id-schema extraction test intests/test_rag_search_chain.pymust fail; revert and rerun.Implementation Notes
Verified at 4523cf5. Reproduction imports llm before chains to match application startup and isolate the schema issue from the separate standalone circular-import limitation. No LLM/provider calls used.