Commit History
-
update claude.md files
Rifqi Hafizuddin2adb6e1
-
update PROGRESS.md: cleanup PR items, trigger items, dead modules, renames
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>89a5ba6
-
[KM-556][KM-562] fix tabular catalog pipeline: trigger wiring, parquet upload, lazy Azure init, backfill script
- Wire on_db_registered in /database-clients/{id}/ingest endpoint so DB registration now builds the catalog (was silently skipped before). - CSV/XLSX no longer ingested into vector store (embedding wasted); parquet upload preserved via _upload_parquet() so TabularExecutor can still read blobs at query time. - on_document_uploaded implemented (was raise NotImplementedError); opens its own AsyncSessionLocal session, calls document_pipeline.process(). - Lazy-init Azure/PGVector clients in retrieval/document.py via @functools.cache getters; RetrievalRouter holds DocumentRetriever lazily. FastAPI no longer crashes at startup if embedding env vars are missing. - _normalize_chunks in chat_handler.py now handles RetrievalResult objects (previously silently dropped, causing empty context for unstructured path). - Cache invalidation: retrieval_router.invalidate_cache(user_id) called after document process and delete; Redis failure is logged, not raised. - Add scripts/build_initia…59b14af -
[KM-560][KM-561] drop catalog LLM enrichment + rename store to data_catalog + add /data-catalog index endpoint
Rifqi Hafizuddin +1: Claude Opus 4.7- Remove CatalogEnricher entirely (cost cut). Planner reads stats + sample rows + column names directly. Deletes src/catalog/enricher.py, config/prompts/catalog_enricher.md, and the StructuredPipeline enrich step. render_source moves to src/catalog/render.py. - Rename jsonb table catalogs -> data_catalog. Class name unchanged; table created fresh on next init_db (no rows in prod yet, no migration needed). - Add GET /api/v1/data-catalog/{user_id} returning list[CatalogIndexEntry] (source_id, source_type, name, location_ref, table_count, updated_at). Wired in main.py. Lightweight summary intended for the catalog refresher. - Update ARCHITECTURE.md / REPO_CONTEXT.md / PROGRESS.md: LLM call sites now three (was four), ingestion flow is introspect -> validate -> upsert. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>2d6eca0
-
[KM-556] delete Phase 1 remnants: query/executors/, query_executor.py, orchestration.py
b272cc7 -
[KM-556] rewire chat stream endpoint to Phase 2 IntentRouter + AnswerAgent + QueryService
5670888 -
update progress.md
12f8dea -
fix planner prompt template parsing
0c263cf -
Merge DB bundle (PR2b/4/5/6/7) into pr/1 + reconcile PROGRESS.md
efc301b -
[NOTICKET] IntentRouter + planner + dispatcher + QueryService + AnswerAgent + ChatHandler
Rifqi Hafizuddin +1: Claude Opus 4.7Bundles every Both-PR work item that doesn't require teammate's tabular modules. Phase 1 endpoints and chatbot.py are intentionally NOT touched -- cleanup PR will rewire /chat/stream and rename answer_agent.py -> chatbot.py. - IntentRouter: classify chat / unstructured / structured; history-aware rewritten_query via Pydantic structured output. Prompt with full ruleset + few-shot in config/prompts/intent_router.md. - Planner prompt: build_planner_prompt(question, catalog, previous_error) reuses catalog.enricher.render_source so DB and tabular sources render identically across enricher and planner. System prompt has hard constraints + DB and tabular few-shot in config/prompts/query_planner.md. - QueryPlannerService: Azure OpenAI structured output -> QueryIR. Injectable chain. Supports retry via previous_error arg. - ExecutorDispatcher: pick(ir) routes by source.source_type. Lazy executor imports keep module import-safe. Caches per source_type. Tests inject factories. - Q…f65aee0
-
eat(query): PandasCompiler + TabularExecutor (PR3-TAB)
c749544 -
TabularIntrospector + on_tabular_uploaded trigger + 31 tests
ca42520 -
[NOTICKET] SqlCompiler (Postgres) + DbExecutor
Rifqi Hafizuddin +1: Claude Opus 4.7- SqlCompiler: deterministic IR -> (sql, params dict) for Postgres dialect (Supabase reuses). Double-quoted identifiers from catalog, named parameters for values. Supports all 12 whitelisted filter ops, 6 aggs (count/count_distinct/sum/avg/min/max), count(*), alias-aware order_by. CompiledSql.params changed from list to dict[str, Any]. - DbExecutor: layered safety -- source_type check + dbclient:// parse + client owner match + sqlglot SELECT/no-DML guard + Postgres session default_transaction_read_only + statement_timeout=30s + asyncio.wait_for backstop + 10k row cap. Runs sync engine via db_pipeline_service.engine_scope inside asyncio.to_thread. Never raises -- populates QueryResult.error. - pandas.py compiler stub: fixed pre-existing UP035 (Callable import). - pyproject.toml: added S608 to tests/** ruff ignore (test assertions on literal SQL strings are a false positive). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>212dad3 -
[NOTICKET] catalog enricher + structured pipeline + on_db_registered
Rifqi Hafizuddin +1: Claude Opus 4.7- CatalogEnricher: Azure OpenAI GPT-4o with structured output (EnrichmentResponse keyed by stable IDs), render_source helper reusable by the planner prompt, apply_descriptions merger, injectable structured_chain for tests - catalog_enricher.md system prompt with style rules + few-shot - StructuredPipeline: introspect -> enrich -> merge -> validate -> upsert; source-type-agnostic (caller supplies introspector); default_structured_pipeline() factory lazy-imports prod deps - on_db_registered trigger wired; tabular/document/rebuild stubs preserved with implementation notes for the teammate - Table.foreign_keys + ForeignKey model; DB introspector now extracts FKs from extractor data (was discarded) - REPO_CONTEXT.md catalog schema diagram reflects FK addition - PROGRESS.md persistent checklist for the team Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>77ea82d