Commit History
-
updates
ritvikv03e74233b
-
fix(tests): repair broken pipeline tests and delete stale q2/ suite
ritvikv03 +1: Claude Sonnet 4.6Replace Gemini/ChromaDB mocks with HuggingFace InferenceClient mocks, fix tmp_db fixture to skip Astra DB tests when ASTRA_DB_TOKEN unset, use 200+ char test inputs to satisfy pipeline min-length guard. Delete tests/q2/ (crashes pytest on collection; q2_solution gone), remove Django from requirements.txt, fix Llama model string in agents.py docstring, replace stale Gemini comments in sources.py and scheduler.py. All 28 tests pass, 6 Astra DB integration tests skip without token. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>4bed3b3 -
feat: production-grade Knowledge Graph refactor
ritvikv03 +1: Claude Sonnet 4.6- graph.json reset to empty; stale orphaned nodes purged - graph_engine: add rebuild_graph_from_db() — reconstructs graph from live Astra DB on demand, called automatically post-Scout cycle - graph_engine: add infer_hidden_relationships() — BFS traversal to surface non-obvious cross-PESTEL cascade paths (e.g. ENV→ECO), stored as INFERRED_CASCADE triples with hop_path metadata - scheduler: wire rebuild_graph_from_db() after every successful cycle - app.py: Knowledge Graph tab — Rebuild Graph + Run Inference buttons, inferred-cascades panel in sidebar, accurate empty state messaging Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>77879e2
-
feat: Flask-Caching singletons, rewrite CI workflow for Astra DB / HuggingFace stack
ritvikv03 +1: Claude Sonnet 4.6- Replace all _get_db().get_all() and _db_stats() call sites with _get_all_signals_cached() / _db_stats_cached() / _load_graph_elements_cached() (Flask-Caching SimpleCache, 30 s TTL) — eliminates one Astra DB round-trip per tab render and per sidebar tick - Remove stale _db_stats() definition (replaced by cached variant below app init) - Rewrite .github/workflows/sentinel.yml: Python 3.11, ASTRA_DB_TOKEN + HF_TOKEN secrets, two-job pipeline (scout-ingest → analyst-brief), brief uploaded as 30-day artifact; removes dead references to sentinel.py / GEMINI_API_KEY / q2_solution SQLite paths - Delete run_daily_intelligence.sh and .mcp.json (pruned legacy files) - Pin data/graph.json schema_version 2 (triples ontology) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>8954441 -
feat: background callbacks, dcc.Loading, signals-store, prune legacy
ritvikv03 +1: Claude Sonnet 4.6Pruning - Delete _archive_legacy/ (20 dead files, zero imports remained) - Delete load_env.sh (python-dotenv handles secrets; shell shim redundant) - Delete .streamlit/ (Streamlit config with no Streamlit code) Background callbacks (DiskCache) - Add diskcache>=5.6.0 + multiprocess>=0.70.16 to requirements.txt - Wire DiskcacheLongCallbackManager into dash.Dash(); cache stored at data/.dash_cache/ (gitignored) - Convert generate_intelligence_brief to @app.long_callback with button-disabled running state and "Generating…" status message - Convert send_message (chat) to @app.long_callback with flattened chip inputs (no *args); input + send button disabled while LLM runs → both callbacks now fire in a subprocess; UI stays responsive dcc.Loading spinners - page-canvas (tab content) — circle, #00e5ff - sidebar-body (live metrics) — dot, #7d8fa8 - chat-messages — dot, #00e5ff - reports-body — circle, #00e5ff - lens-results was already wrapped dcc.Store - Add signals-store (storage_t…87fb121
-
refactor: replace Gemini with HuggingFace/LangGraph stack
ritvikv03 +1: Claude Sonnet 4.6- Swap core/pipeline.py to HuggingFaceEndpoint (Mistral-7B-Instruct-v0.3) with module-level singleton, [INST] format, and severity_score removed - Swap core/summary_engine.py to HuggingFace, fix dead q2_solution db path - Add semantic deduplication (cosine threshold 0.08) before LLM scoring - Create core/graph_engine.py: 4-node LangGraph RAG knowledge-graph workflow with aborted sentinel, correct short-circuit logic, and edge deduplication - Hook run_graph_update() into scheduler after each successful signal insert - Add Export Report button + dcc.Download HTML export in app.py - Rename tabs: Field Intelligence, Disruption Horizon, Signal Feed, Strategic Advisor - Update sidebar brand to AGRO-MARKET INTELLIGENCE, remove Gemini branding - Reset data/graph.json to empty template (no synthetic data) - Add langchain/langgraph/huggingface_hub deps with upper-bound caps Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>c9dcf7a
-
Allow graph data on Streamlit Cloud
ritvikv034814b86