Skip to content

Commit 61f81c6

Browse files
committed
rename project from citelens to sourcery
1 parent ffdb809 commit 61f81c6

20 files changed

Lines changed: 96 additions & 96 deletions

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,10 @@ jobs:
170170
version: v3.16.3
171171

172172
- name: helm lint
173-
run: helm lint helm/citelens
173+
run: helm lint helm/sourcery
174174

175175
- name: helm template (dry render)
176-
run: helm template citelens helm/citelens --debug | head -200
176+
run: helm template sourcery helm/sourcery --debug | head -200
177177

178178
pyright:
179179
name: pyright (typecheck)

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ roughly tracks [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
3333

3434
### Fixed
3535
- Frontend fast-refresh warning by splitting `useDefaultPaletteActions` into its own file.
36-
- README pointed at the wrong GitHub repo slug (`Final-Project-ScholarRAG``citelens`).
36+
- README pointed at the wrong GitHub repo slug (`Final-Project-ScholarRAG``sourcery`).
3737

3838
## [0.1.0] — initial commit history
3939

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,23 +38,23 @@ test-coverage:
3838
# on port 5433 (so it doesn't fight whatever's already on 5432). Idempotent —
3939
# safe to re-run; the container is recreated each time.
4040
test-isolation:
41-
@echo "→ tearing down any previous citelens-iso-db"
42-
@docker rm -f citelens-iso-db 2>/dev/null || true
41+
@echo "→ tearing down any previous sourcery-iso-db"
42+
@docker rm -f sourcery-iso-db 2>/dev/null || true
4343
@echo "→ booting pgvector on :5433"
44-
@docker run -d --name citelens-iso-db \
44+
@docker run -d --name sourcery-iso-db \
4545
-e POSTGRES_USER=scholarrag -e POSTGRES_PASSWORD=scholarrag \
4646
-e POSTGRES_DB=scholarrag -p 5433:5432 \
4747
pgvector/pgvector:pg16 >/dev/null
4848
@sleep 6
49-
@docker exec -i citelens-iso-db psql -U scholarrag -d scholarrag < db/init.sql >/dev/null
49+
@docker exec -i sourcery-iso-db psql -U scholarrag -d scholarrag < db/init.sql >/dev/null
5050
@echo "→ running isolation tests"
5151
@DATABASE_URL=postgresql://scholarrag:scholarrag@127.0.0.1:5433/scholarrag \
5252
PGHOST=127.0.0.1 PGPORT=5433 PGUSER=scholarrag PGPASSWORD=scholarrag PGDATABASE=scholarrag \
5353
EMBEDDING_PROVIDER=stub OPENAI_API_KEY=test \
5454
$(PYTEST) backend/tests/test_workspace_isolation.py -v --tb=short ; \
5555
EXITCODE=$$? ; \
5656
echo "→ tearing down" ; \
57-
docker rm -f citelens-iso-db >/dev/null 2>&1 || true ; \
57+
docker rm -f sourcery-iso-db >/dev/null 2>&1 || true ; \
5858
exit $$EXITCODE
5959

6060
# ── Lint ──────────────────────────────────────────────────────────────────────

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# citelens
1+
# sourcery
22

3-
<img src="frontend/favicon.svg" width="56" alt="citelens" align="left" hspace="12" />
3+
<img src="frontend/favicon.svg" width="56" alt="sourcery" align="left" hspace="12" />
44

55
A scholarly RAG app I built because I kept getting plausible-but-uncited answers from off-the-shelf chatbots. It does hybrid retrieval over your uploaded PDFs and six live scholarly APIs, then scores every generated claim for whether it's actually supported by the cited evidence.
66

77
<br clear="left"/>
88

9-
[![CI](https://img.shields.io/github/actions/workflow/status/sushildalavi/citelens/ci.yml?branch=main&label=CI&logo=github)](https://github.com/sushildalavi/citelens/actions/workflows/ci.yml) [![Tests](https://img.shields.io/badge/tests-198%20%E2%80%A2%2092%25%20unit-15803d?logo=pytest&logoColor=white)](https://github.com/sushildalavi/citelens/actions) [![Coverage](https://img.shields.io/badge/coverage-50%25-15803d)](.github/workflows/ci.yml) [![Python](https://img.shields.io/badge/python-3.11-1d4ed8?logo=python&logoColor=white)](https://www.python.org/) [![FastAPI](https://img.shields.io/badge/FastAPI-0.135+-15803d?logo=fastapi&logoColor=white)](https://fastapi.tiangolo.com/) [![React](https://img.shields.io/badge/React-18-1d4ed8?logo=react&logoColor=white)](https://react.dev/) [![pgvector](https://img.shields.io/badge/Postgres%2016-pgvector-336791?logo=postgresql&logoColor=white)](https://github.com/pgvector/pgvector) [![License](https://img.shields.io/badge/License-MIT-15803d)](LICENSE)
9+
[![CI](https://img.shields.io/github/actions/workflow/status/sushildalavi/sourcery/ci.yml?branch=main&label=CI&logo=github)](https://github.com/sushildalavi/sourcery/actions/workflows/ci.yml) [![Tests](https://img.shields.io/badge/tests-198%20%E2%80%A2%2092%25%20unit-15803d?logo=pytest&logoColor=white)](https://github.com/sushildalavi/sourcery/actions) [![Coverage](https://img.shields.io/badge/coverage-50%25-15803d)](.github/workflows/ci.yml) [![Python](https://img.shields.io/badge/python-3.11-1d4ed8?logo=python&logoColor=white)](https://www.python.org/) [![FastAPI](https://img.shields.io/badge/FastAPI-0.135+-15803d?logo=fastapi&logoColor=white)](https://fastapi.tiangolo.com/) [![React](https://img.shields.io/badge/React-18-1d4ed8?logo=react&logoColor=white)](https://react.dev/) [![pgvector](https://img.shields.io/badge/Postgres%2016-pgvector-336791?logo=postgresql&logoColor=white)](https://github.com/pgvector/pgvector) [![License](https://img.shields.io/badge/License-MIT-15803d)](LICENSE)
1010

1111
[Quick start](#quick-start) · [Architecture](#architecture) · [Benchmarks](#benchmark-results) · [API examples](docs/examples/curl.md) · [Helm chart](helm/README.md) · [Security](SECURITY.md)
1212

@@ -499,8 +499,8 @@ dominates the tail; embed/retrieve/rerank stay sub-450 ms even at p99.
499499
### 1. Clone and configure
500500

501501
```bash
502-
git clone https://github.com/sushildalavi/citelens.git
503-
cd citelens
502+
git clone https://github.com/sushildalavi/sourcery.git
503+
cd sourcery
504504
cp .env.example .env
505505
# fill in OPENAI_API_KEY, DATABASE_URL, OLLAMA_BASE_URL
506506
```
@@ -546,7 +546,7 @@ make test
546546
## Project Structure
547547

548548
```
549-
citelens/
549+
sourcery/
550550
├── backend/
551551
│ ├── app.py # FastAPI app — CORS, routers, startup
552552
│ ├── pdf_ingest.py # PDF extraction, chunking, pgvector upsert
@@ -780,7 +780,7 @@ Shipped:
780780
- [x] **Multi-tenant isolation**`WorkspaceMiddleware` reads `X-Workspace-Id`, sanitises it, pins it on `request.state`. Every INSERT/SELECT/UPDATE/DELETE on `documents`, `chunks`, `chat_sessions`, `user_memory`, `digests`, and `confidence_calibration` filters by `workspace_id`. `db/init.sql` is canonical (fresh deploys are wired); existing deploys upgrade via `_ensure_workspace_columns()` on FastAPI lifespan startup. Cross-tenant isolation is covered by 7 integration tests in `test_workspace_isolation.py` (run via `make test-isolation`).
781781
- [x] **Batched embedding upserts** — verified the existing path: cache lookup → batched OpenAI / parallel Ollama → bulk `execute_values` insert into both `chunks` and `chunk_embeddings`. A 50-chunk PDF is one OpenAI call + one cache insert + one upsert per table.
782782
- [x] **Prometheus exposition**`GET /metrics/prom` returns text/plain in standard Prometheus format. Helm chart includes an optional `ServiceMonitor` if you run Prometheus Operator.
783-
- [x] **Helm chart**`helm/citelens/` with backend + frontend Deployments, Postgres StatefulSet, optional Ingress + ServiceMonitor. Wired to the k8s-style `/health/live` + `/health/ready` probes.
783+
- [x] **Helm chart**`helm/sourcery/` with backend + frontend Deployments, Postgres StatefulSet, optional Ingress + ServiceMonitor. Wired to the k8s-style `/health/live` + `/health/ready` probes.
784784
- [x] **Per-tenant calibration**`_load_latest_calibration_weights(workspace_id=...)` looks up tenant-specific MSA weights in the calibration table and falls back gracefully (tenant→global→default).
785785

786786
Still open:

backend/.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ PG_POOL_MAX=10
1414
# --- OpenAI (generation + LLM judge) ---
1515
OPENAI_API_KEY=sk-...
1616
# If using AWS Secrets Manager instead of plain env:
17-
# OPENAI_API_KEY_SECRET_ID=prod/citelens/openai
17+
# OPENAI_API_KEY_SECRET_ID=prod/sourcery/openai
1818

1919
# --- Embeddings ---
2020
# Provider: ollama (default, local) or openai

backend/app.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -370,17 +370,17 @@ def _emit(name: str, value, help_text: str, mtype: str = "gauge") -> None:
370370
lines.append(f"# TYPE {name} {mtype}")
371371
lines.append(f"{name} {num}")
372372

373-
_emit("citelens_documents_total", payload.get("documents"), "Documents in `ready` status.")
374-
_emit("citelens_chunks_total", payload.get("chunks"), "Total chunks across all documents.")
375-
_emit("citelens_eval_runs_total", payload.get("eval_runs"), "Recorded evaluation runs.")
373+
_emit("sourcery_documents_total", payload.get("documents"), "Documents in `ready` status.")
374+
_emit("sourcery_chunks_total", payload.get("chunks"), "Total chunks across all documents.")
375+
_emit("sourcery_eval_runs_total", payload.get("eval_runs"), "Recorded evaluation runs.")
376376
retrieval = payload.get("retrieval") or {}
377-
_emit("citelens_retrieval_recall_at_5", retrieval.get("recall_at_5"), "Recall@5 from latest eval run.")
378-
_emit("citelens_retrieval_ndcg_at_10", retrieval.get("ndcg_at_10"), "nDCG@10 from latest eval run.")
379-
_emit("citelens_retrieval_mrr", retrieval.get("mrr"), "Mean reciprocal rank from latest eval run.")
377+
_emit("sourcery_retrieval_recall_at_5", retrieval.get("recall_at_5"), "Recall@5 from latest eval run.")
378+
_emit("sourcery_retrieval_ndcg_at_10", retrieval.get("ndcg_at_10"), "nDCG@10 from latest eval run.")
379+
_emit("sourcery_retrieval_mrr", retrieval.get("mrr"), "Mean reciprocal rank from latest eval run.")
380380
latency = payload.get("latency_ms") or {}
381-
_emit("citelens_assistant_latency_ms_p50", latency.get("p50"), "Assistant answer latency p50 (ms).")
382-
_emit("citelens_assistant_latency_ms_p95", latency.get("p95"), "Assistant answer latency p95 (ms).")
383-
_emit("citelens_assistant_latency_ms_p99", latency.get("p99"), "Assistant answer latency p99 (ms).")
381+
_emit("sourcery_assistant_latency_ms_p50", latency.get("p50"), "Assistant answer latency p50 (ms).")
382+
_emit("sourcery_assistant_latency_ms_p95", latency.get("p95"), "Assistant answer latency p95 (ms).")
383+
_emit("sourcery_assistant_latency_ms_p99", latency.get("p99"), "Assistant answer latency p99 (ms).")
384384

385385
body = "\n".join(lines) + "\n" if lines else ""
386386
return Response(content=body, media_type="text/plain; version=0.0.4; charset=utf-8")

backend/tests/test_metrics_prometheus.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ def _fake_metrics():
2828
body = resp.text
2929

3030
# Spot-check the wire format.
31-
assert "# HELP citelens_documents_total" in body
32-
assert "# TYPE citelens_documents_total gauge" in body
33-
assert "citelens_documents_total 42.0" in body
34-
assert "citelens_chunks_total 1337.0" in body
35-
assert "citelens_retrieval_recall_at_5 0.99" in body
36-
assert "citelens_assistant_latency_ms_p99 1600.0" in body
31+
assert "# HELP sourcery_documents_total" in body
32+
assert "# TYPE sourcery_documents_total gauge" in body
33+
assert "sourcery_documents_total 42.0" in body
34+
assert "sourcery_chunks_total 1337.0" in body
35+
assert "sourcery_retrieval_recall_at_5 0.99" in body
36+
assert "sourcery_assistant_latency_ms_p99 1600.0" in body
3737

3838

3939
def test_metrics_prom_skips_missing_values(monkeypatch):
@@ -49,5 +49,5 @@ def test_metrics_prom_skips_missing_values(monkeypatch):
4949
client = TestClient(app_module.app)
5050
body = client.get("/metrics/prom").text
5151

52-
assert "citelens_documents_total" not in body
53-
assert "citelens_chunks_total 5.0" in body
52+
assert "sourcery_documents_total" not in body
53+
assert "sourcery_chunks_total 5.0" in body

backend/tests/test_workspace_isolation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
When DATABASE_URL isn't set they skip with a clear message rather than
1212
failing. To run by hand:
1313
14-
docker run -d --name citelens-iso-db \\
14+
docker run -d --name sourcery-iso-db \\
1515
-e POSTGRES_USER=scholarrag -e POSTGRES_PASSWORD=scholarrag \\
1616
-e POSTGRES_DB=scholarrag -p 5433:5432 pgvector/pgvector:pg16
1717
sleep 5
18-
docker exec -i citelens-iso-db psql -U scholarrag -d scholarrag < db/init.sql
18+
docker exec -i sourcery-iso-db psql -U scholarrag -d scholarrag < db/init.sql
1919
DATABASE_URL=postgresql://scholarrag:scholarrag@127.0.0.1:5433/scholarrag \\
2020
EMBEDDING_PROVIDER=stub OPENAI_API_KEY=test \\
2121
pytest backend/tests/test_workspace_isolation.py -v

docs/architecture.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Architecture — citelens
1+
# Architecture — sourcery
22

33
This document describes the **why** behind the major design decisions. The
44
**what** lives in the [README architecture diagrams](../README.md#architecture).

frontend/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
<head>
44
<meta charset="UTF-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6-
<meta name="description" content="Citelens — calibrated RAG over your PDFs and 6 live scholarly APIs, with per-claim faithfulness scoring." />
6+
<meta name="description" content="Sourcery — calibrated RAG over your PDFs and 6 live scholarly APIs, with per-claim faithfulness scoring." />
77
<meta name="theme-color" content="#0f172a" />
88
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
9-
<title>Citelens — Calibrated Scholarly RAG</title>
9+
<title>Sourcery — Calibrated Scholarly RAG</title>
1010
<link rel="preconnect" href="https://fonts.googleapis.com" />
1111
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1212
<link

0 commit comments

Comments
 (0)