sci-rag-kit 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (360) hide show
  1. sci_rag_kit-0.3.0/.devcontainer/compose.yml +18 -0
  2. sci_rag_kit-0.3.0/.devcontainer/devcontainer-lock.json +9 -0
  3. sci_rag_kit-0.3.0/.devcontainer/devcontainer.json +19 -0
  4. sci_rag_kit-0.3.0/.env.example +90 -0
  5. sci_rag_kit-0.3.0/.github/ISSUE_TEMPLATE/bug_report.yml +30 -0
  6. sci_rag_kit-0.3.0/.github/ISSUE_TEMPLATE/config.yml +1 -0
  7. sci_rag_kit-0.3.0/.github/ISSUE_TEMPLATE/domain_help.yml +24 -0
  8. sci_rag_kit-0.3.0/.github/ISSUE_TEMPLATE/feature_request.yml +23 -0
  9. sci_rag_kit-0.3.0/.github/dependabot.yml +19 -0
  10. sci_rag_kit-0.3.0/.github/pull_request_template.md +14 -0
  11. sci_rag_kit-0.3.0/.github/workflows/ci.yml +121 -0
  12. sci_rag_kit-0.3.0/.github/workflows/docker-free-postgres.yml +126 -0
  13. sci_rag_kit-0.3.0/.github/workflows/docs-deploy.yml +57 -0
  14. sci_rag_kit-0.3.0/.github/workflows/generated-projects.yml +234 -0
  15. sci_rag_kit-0.3.0/.github/workflows/release.yml +127 -0
  16. sci_rag_kit-0.3.0/.gitignore +51 -0
  17. sci_rag_kit-0.3.0/.pre-commit-config.yaml +19 -0
  18. sci_rag_kit-0.3.0/.python-version +1 -0
  19. sci_rag_kit-0.3.0/ADOPTERS.md +20 -0
  20. sci_rag_kit-0.3.0/AGENTS.md +391 -0
  21. sci_rag_kit-0.3.0/CHANGELOG.md +269 -0
  22. sci_rag_kit-0.3.0/CODE_OF_CONDUCT.md +11 -0
  23. sci_rag_kit-0.3.0/CONTRIBUTING.md +64 -0
  24. sci_rag_kit-0.3.0/Dockerfile +31 -0
  25. sci_rag_kit-0.3.0/LICENSE +28 -0
  26. sci_rag_kit-0.3.0/Makefile +123 -0
  27. sci_rag_kit-0.3.0/PKG-INFO +247 -0
  28. sci_rag_kit-0.3.0/README.md +200 -0
  29. sci_rag_kit-0.3.0/SECURITY.md +28 -0
  30. sci_rag_kit-0.3.0/alembic.ini +45 -0
  31. sci_rag_kit-0.3.0/data/demo/fixture/almond-prunings-logistics.md +47 -0
  32. sci_rag_kit-0.3.0/data/demo/fixture/anaerobic-digestion-primer.md +50 -0
  33. sci_rag_kit-0.3.0/data/demo/fixture/central-valley-residue-policy.md +50 -0
  34. sci_rag_kit-0.3.0/data/demo/fixture/colusa-rice-straw-2023.md +48 -0
  35. sci_rag_kit-0.3.0/data/demo/fixture/gasification-walnut-shells.md +47 -0
  36. sci_rag_kit-0.3.0/data/demo/manifest.jsonl +7 -0
  37. sci_rag_kit-0.3.0/data/interim/.gitkeep +0 -0
  38. sci_rag_kit-0.3.0/data/processed/.gitkeep +0 -0
  39. sci_rag_kit-0.3.0/data/raw/.gitkeep +0 -0
  40. sci_rag_kit-0.3.0/data/snapshots/benchmark-20260827-163251.json +43 -0
  41. sci_rag_kit-0.3.0/data/snapshots/benchmark-20260828-045130.json +43 -0
  42. sci_rag_kit-0.3.0/docker-compose.yml +27 -0
  43. sci_rag_kit-0.3.0/docs/GOVERNANCE.md +56 -0
  44. sci_rag_kit-0.3.0/docs/ROADMAP.md +162 -0
  45. sci_rag_kit-0.3.0/docs/VERSIONING.md +119 -0
  46. sci_rag_kit-0.3.0/docs/adopters.md +1 -0
  47. sci_rag_kit-0.3.0/docs/adr/0001-graph-in-postgres.md +38 -0
  48. sci_rag_kit-0.3.0/docs/adr/0002-embeddings-1536-hnsw.md +42 -0
  49. sci_rag_kit-0.3.0/docs/adr/0003-docling-with-pypdf-fallback.md +34 -0
  50. sci_rag_kit-0.3.0/docs/adr/0004-template-repo-not-cookiecutter.md +39 -0
  51. sci_rag_kit-0.3.0/docs/adr/0005-citation-edges-as-a-document-table.md +62 -0
  52. sci_rag_kit-0.3.0/docs/adr/0006-multi-provider-llms.md +79 -0
  53. sci_rag_kit-0.3.0/docs/adr/0007-interactive-project-generator.md +102 -0
  54. sci_rag_kit-0.3.0/docs/adr/0008-supported-postgresql-versions.md +104 -0
  55. sci_rag_kit-0.3.0/docs/api.md +225 -0
  56. sci_rag_kit-0.3.0/docs/architecture.md +203 -0
  57. sci_rag_kit-0.3.0/docs/assets/branding/README.md +31 -0
  58. sci_rag_kit-0.3.0/docs/assets/branding/full-logo/sci-rag-kit-full-color-black.png +0 -0
  59. sci_rag_kit-0.3.0/docs/assets/branding/full-logo/sci-rag-kit-full-color-transparent.png +0 -0
  60. sci_rag_kit-0.3.0/docs/assets/branding/full-logo/sci-rag-kit-full-color-white.png +0 -0
  61. sci_rag_kit-0.3.0/docs/assets/branding/icon/sci-rag-kit-icon-color-black-1024.png +0 -0
  62. sci_rag_kit-0.3.0/docs/assets/branding/icon/sci-rag-kit-icon-color-transparent-1024.png +0 -0
  63. sci_rag_kit-0.3.0/docs/assets/branding/icon/sci-rag-kit-icon-color-white-1024.png +0 -0
  64. sci_rag_kit-0.3.0/docs/assets/branding/icon-sizes/favicon.ico +0 -0
  65. sci_rag_kit-0.3.0/docs/assets/branding/icon-sizes/sci-rag-kit-icon-transparent-128.png +0 -0
  66. sci_rag_kit-0.3.0/docs/assets/branding/icon-sizes/sci-rag-kit-icon-transparent-180.png +0 -0
  67. sci_rag_kit-0.3.0/docs/assets/branding/icon-sizes/sci-rag-kit-icon-transparent-192.png +0 -0
  68. sci_rag_kit-0.3.0/docs/assets/branding/icon-sizes/sci-rag-kit-icon-transparent-256.png +0 -0
  69. sci_rag_kit-0.3.0/docs/assets/branding/icon-sizes/sci-rag-kit-icon-transparent-32.png +0 -0
  70. sci_rag_kit-0.3.0/docs/assets/branding/icon-sizes/sci-rag-kit-icon-transparent-512.png +0 -0
  71. sci_rag_kit-0.3.0/docs/assets/branding/icon-sizes/sci-rag-kit-icon-transparent-64.png +0 -0
  72. sci_rag_kit-0.3.0/docs/assets/branding/monochrome/sci-rag-kit-full-black-transparent.png +0 -0
  73. sci_rag_kit-0.3.0/docs/assets/branding/monochrome/sci-rag-kit-full-white-on-black.png +0 -0
  74. sci_rag_kit-0.3.0/docs/assets/branding/monochrome/sci-rag-kit-full-white-transparent.png +0 -0
  75. sci_rag_kit-0.3.0/docs/assets/branding/monochrome/sci-rag-kit-icon-black-transparent-1024.png +0 -0
  76. sci_rag_kit-0.3.0/docs/assets/branding/monochrome/sci-rag-kit-icon-white-on-black-1024.png +0 -0
  77. sci_rag_kit-0.3.0/docs/assets/branding/monochrome/sci-rag-kit-icon-white-transparent-1024.png +0 -0
  78. sci_rag_kit-0.3.0/docs/assets/branding/sci-rag-kit-logo-system-overview.png +0 -0
  79. sci_rag_kit-0.3.0/docs/assets/branding/source/sci-rag-kit-selected-master-white.png +0 -0
  80. sci_rag_kit-0.3.0/docs/assets/casts/sci-rag-new.cast +108 -0
  81. sci_rag_kit-0.3.0/docs/assets/diagrams/pipeline.svg +146 -0
  82. sci_rag_kit-0.3.0/docs/assets/logo.png +0 -0
  83. sci_rag_kit-0.3.0/docs/assets/vendor/asciinema-player/LICENSE +201 -0
  84. sci_rag_kit-0.3.0/docs/assets/vendor/asciinema-player/README.md +19 -0
  85. sci_rag_kit-0.3.0/docs/assets/vendor/asciinema-player/asciinema-player.css +2389 -0
  86. sci_rag_kit-0.3.0/docs/assets/vendor/asciinema-player/asciinema-player.min.js +1 -0
  87. sci_rag_kit-0.3.0/docs/benchmarks.md +133 -0
  88. sci_rag_kit-0.3.0/docs/bring-your-own-domain.md +238 -0
  89. sci_rag_kit-0.3.0/docs/campaigns.md +181 -0
  90. sci_rag_kit-0.3.0/docs/changelog.md +1 -0
  91. sci_rag_kit-0.3.0/docs/choosing-sci-rag-kit.md +95 -0
  92. sci_rag_kit-0.3.0/docs/citation.md +39 -0
  93. sci_rag_kit-0.3.0/docs/cli.md +545 -0
  94. sci_rag_kit-0.3.0/docs/configuration.md +106 -0
  95. sci_rag_kit-0.3.0/docs/contributing.md +1 -0
  96. sci_rag_kit-0.3.0/docs/deploy-gcp.md +129 -0
  97. sci_rag_kit-0.3.0/docs/evaluation.md +246 -0
  98. sci_rag_kit-0.3.0/docs/evidence-and-rights.md +106 -0
  99. sci_rag_kit-0.3.0/docs/examples/demo-eval/answers.md +29 -0
  100. sci_rag_kit-0.3.0/docs/examples/demo-eval/retrieval-ablation.md +27 -0
  101. sci_rag_kit-0.3.0/docs/extend.md +155 -0
  102. sci_rag_kit-0.3.0/docs/get-started.md +29 -0
  103. sci_rag_kit-0.3.0/docs/glossary.md +113 -0
  104. sci_rag_kit-0.3.0/docs/guides.md +24 -0
  105. sci_rag_kit-0.3.0/docs/index.md +293 -0
  106. sci_rag_kit-0.3.0/docs/javascripts/cast.js +52 -0
  107. sci_rag_kit-0.3.0/docs/learn.md +22 -0
  108. sci_rag_kit-0.3.0/docs/methodology.md +354 -0
  109. sci_rag_kit-0.3.0/docs/operations.md +156 -0
  110. sci_rag_kit-0.3.0/docs/overrides/home.html +34 -0
  111. sci_rag_kit-0.3.0/docs/overrides/partials/header.html +75 -0
  112. sci_rag_kit-0.3.0/docs/overrides/partials/path.html +33 -0
  113. sci_rag_kit-0.3.0/docs/overrides/partials/source.html +14 -0
  114. sci_rag_kit-0.3.0/docs/planning/sci-rag-new-project-factory.md +397 -0
  115. sci_rag_kit-0.3.0/docs/planning/v02-roadmap-plan.md +116 -0
  116. sci_rag_kit-0.3.0/docs/planning/wave2-execution-plan.md +132 -0
  117. sci_rag_kit-0.3.0/docs/planning/wave2-handoff.md +447 -0
  118. sci_rag_kit-0.3.0/docs/project.md +30 -0
  119. sci_rag_kit-0.3.0/docs/quickstart.md +229 -0
  120. sci_rag_kit-0.3.0/docs/reference.md +22 -0
  121. sci_rag_kit-0.3.0/docs/stylesheets/code.css +82 -0
  122. sci_rag_kit-0.3.0/docs/stylesheets/components.css +436 -0
  123. sci_rag_kit-0.3.0/docs/stylesheets/diagrams.css +60 -0
  124. sci_rag_kit-0.3.0/docs/stylesheets/home.css +215 -0
  125. sci_rag_kit-0.3.0/docs/stylesheets/tokens.css +366 -0
  126. sci_rag_kit-0.3.0/docs/stylesheets/typography.css +121 -0
  127. sci_rag_kit-0.3.0/docs/tour.md +97 -0
  128. sci_rag_kit-0.3.0/docs/troubleshooting.md +122 -0
  129. sci_rag_kit-0.3.0/domain/README.md +26 -0
  130. sci_rag_kit-0.3.0/domain/domain.yaml +133 -0
  131. sci_rag_kit-0.3.0/domain/eval_calibration_labels.jsonl +19 -0
  132. sci_rag_kit-0.3.0/domain/eval_seed_questions.jsonl +18 -0
  133. sci_rag_kit-0.3.0/domain/prompts/answer.md +15 -0
  134. sci_rag_kit-0.3.0/domain/prompts/community_summary.md +11 -0
  135. sci_rag_kit-0.3.0/domain/prompts/entity_extraction.md +33 -0
  136. sci_rag_kit-0.3.0/domain/prompts/hyde.md +7 -0
  137. sci_rag_kit-0.3.0/domain/prompts/judge_correctness.md +23 -0
  138. sci_rag_kit-0.3.0/domain/prompts/judge_grounding.md +20 -0
  139. sci_rag_kit-0.3.0/domain/prompts/ontology_draft.md +39 -0
  140. sci_rag_kit-0.3.0/domain/prompts/query_entities.md +13 -0
  141. sci_rag_kit-0.3.0/domain/prompts/rerank.md +13 -0
  142. sci_rag_kit-0.3.0/domain/prompts/screening.md +18 -0
  143. sci_rag_kit-0.3.0/domain/prompts/snippet_compression.md +18 -0
  144. sci_rag_kit-0.3.0/examples/bring_your_own_domain.ipynb +329 -0
  145. sci_rag_kit-0.3.0/examples/library_quickstart.py +62 -0
  146. sci_rag_kit-0.3.0/infra/terraform/.terraform.lock.hcl +43 -0
  147. sci_rag_kit-0.3.0/infra/terraform/main.tf +283 -0
  148. sci_rag_kit-0.3.0/infra/terraform/outputs.tf +23 -0
  149. sci_rag_kit-0.3.0/infra/terraform/variables.tf +45 -0
  150. sci_rag_kit-0.3.0/migrations/env.py +58 -0
  151. sci_rag_kit-0.3.0/migrations/script.py.mako +25 -0
  152. sci_rag_kit-0.3.0/migrations/versions/0001_initial.py +35 -0
  153. sci_rag_kit-0.3.0/migrations/versions/0002_community_embedding_version.py +35 -0
  154. sci_rag_kit-0.3.0/migrations/versions/0003_document_journal.py +41 -0
  155. sci_rag_kit-0.3.0/migrations/versions/0004_retracted_index.py +35 -0
  156. sci_rag_kit-0.3.0/migrations/versions/0005_entity_resolution.py +60 -0
  157. sci_rag_kit-0.3.0/migrations/versions/0006_document_citations.py +47 -0
  158. sci_rag_kit-0.3.0/mkdocs.yml +170 -0
  159. sci_rag_kit-0.3.0/pyproject.toml +144 -0
  160. sci_rag_kit-0.3.0/scripts/init_domain.py +109 -0
  161. sci_rag_kit-0.3.0/scripts/local_postgres.py +273 -0
  162. sci_rag_kit-0.3.0/scripts/render_benchmarks.py +305 -0
  163. sci_rag_kit-0.3.0/scripts/render_cast.py +226 -0
  164. sci_rag_kit-0.3.0/scripts/render_cli_docs.py +216 -0
  165. sci_rag_kit-0.3.0/scripts/render_config_docs.py +280 -0
  166. sci_rag_kit-0.3.0/src/sci_rag/__init__.py +78 -0
  167. sci_rag_kit-0.3.0/src/sci_rag/answer/__init__.py +3 -0
  168. sci_rag_kit-0.3.0/src/sci_rag/answer/compress.py +132 -0
  169. sci_rag_kit-0.3.0/src/sci_rag/answer/generator.py +341 -0
  170. sci_rag_kit-0.3.0/src/sci_rag/campaigns/__init__.py +50 -0
  171. sci_rag_kit-0.3.0/src/sci_rag/campaigns/build.py +209 -0
  172. sci_rag_kit-0.3.0/src/sci_rag/campaigns/discovery.py +330 -0
  173. sci_rag_kit-0.3.0/src/sci_rag/campaigns/download.py +177 -0
  174. sci_rag_kit-0.3.0/src/sci_rag/campaigns/http.py +125 -0
  175. sci_rag_kit-0.3.0/src/sci_rag/campaigns/licensing_map.py +41 -0
  176. sci_rag_kit-0.3.0/src/sci_rag/campaigns/manifest.py +50 -0
  177. sci_rag_kit-0.3.0/src/sci_rag/campaigns/prisma.py +85 -0
  178. sci_rag_kit-0.3.0/src/sci_rag/campaigns/resolve.py +93 -0
  179. sci_rag_kit-0.3.0/src/sci_rag/campaigns/screen.py +474 -0
  180. sci_rag_kit-0.3.0/src/sci_rag/campaigns/state.py +126 -0
  181. sci_rag_kit-0.3.0/src/sci_rag/citations.py +152 -0
  182. sci_rag_kit-0.3.0/src/sci_rag/cli/__init__.py +3 -0
  183. sci_rag_kit-0.3.0/src/sci_rag/cli/doctor.py +611 -0
  184. sci_rag_kit-0.3.0/src/sci_rag/cli/init.py +133 -0
  185. sci_rag_kit-0.3.0/src/sci_rag/cli/main.py +1714 -0
  186. sci_rag_kit-0.3.0/src/sci_rag/cli/new.py +126 -0
  187. sci_rag_kit-0.3.0/src/sci_rag/config.py +176 -0
  188. sci_rag_kit-0.3.0/src/sci_rag/corpus.py +282 -0
  189. sci_rag_kit-0.3.0/src/sci_rag/db/__init__.py +28 -0
  190. sci_rag_kit-0.3.0/src/sci_rag/db/engine.py +63 -0
  191. sci_rag_kit-0.3.0/src/sci_rag/db/models.py +282 -0
  192. sci_rag_kit-0.3.0/src/sci_rag/domain.py +212 -0
  193. sci_rag_kit-0.3.0/src/sci_rag/embed/__init__.py +30 -0
  194. sci_rag_kit-0.3.0/src/sci_rag/embed/cache.py +53 -0
  195. sci_rag_kit-0.3.0/src/sci_rag/embed/google.py +106 -0
  196. sci_rag_kit-0.3.0/src/sci_rag/embed/local_hash.py +53 -0
  197. sci_rag_kit-0.3.0/src/sci_rag/embed/planner.py +174 -0
  198. sci_rag_kit-0.3.0/src/sci_rag/embed/provider.py +70 -0
  199. sci_rag_kit-0.3.0/src/sci_rag/enrich.py +176 -0
  200. sci_rag_kit-0.3.0/src/sci_rag/evals/__init__.py +40 -0
  201. sci_rag_kit-0.3.0/src/sci_rag/evals/answer_eval.py +135 -0
  202. sci_rag_kit-0.3.0/src/sci_rag/evals/calibration.py +241 -0
  203. sci_rag_kit-0.3.0/src/sci_rag/evals/diff.py +255 -0
  204. sci_rag_kit-0.3.0/src/sci_rag/evals/judge.py +105 -0
  205. sci_rag_kit-0.3.0/src/sci_rag/evals/report.py +291 -0
  206. sci_rag_kit-0.3.0/src/sci_rag/evals/retrieval_eval.py +243 -0
  207. sci_rag_kit-0.3.0/src/sci_rag/evals/seeds.py +57 -0
  208. sci_rag_kit-0.3.0/src/sci_rag/evals/stats.py +142 -0
  209. sci_rag_kit-0.3.0/src/sci_rag/graph/__init__.py +25 -0
  210. sci_rag_kit-0.3.0/src/sci_rag/graph/communities.py +190 -0
  211. sci_rag_kit-0.3.0/src/sci_rag/graph/extractor.py +445 -0
  212. sci_rag_kit-0.3.0/src/sci_rag/graph/resolve.py +413 -0
  213. sci_rag_kit-0.3.0/src/sci_rag/ingest/__init__.py +26 -0
  214. sci_rag_kit-0.3.0/src/sci_rag/ingest/chunker.py +287 -0
  215. sci_rag_kit-0.3.0/src/sci_rag/ingest/ingester.py +192 -0
  216. sci_rag_kit-0.3.0/src/sci_rag/ingest/manifest.py +75 -0
  217. sci_rag_kit-0.3.0/src/sci_rag/ingest/parsers.py +153 -0
  218. sci_rag_kit-0.3.0/src/sci_rag/ingest/tokens.py +40 -0
  219. sci_rag_kit-0.3.0/src/sci_rag/licensing.py +65 -0
  220. sci_rag_kit-0.3.0/src/sci_rag/llm/__init__.py +68 -0
  221. sci_rag_kit-0.3.0/src/sci_rag/llm/anthropic.py +193 -0
  222. sci_rag_kit-0.3.0/src/sci_rag/llm/client.py +193 -0
  223. sci_rag_kit-0.3.0/src/sci_rag/llm/google.py +107 -0
  224. sci_rag_kit-0.3.0/src/sci_rag/llm/openai_compat.py +208 -0
  225. sci_rag_kit-0.3.0/src/sci_rag/llm/spec.py +64 -0
  226. sci_rag_kit-0.3.0/src/sci_rag/py.typed +0 -0
  227. sci_rag_kit-0.3.0/src/sci_rag/retrieve/__init__.py +19 -0
  228. sci_rag_kit-0.3.0/src/sci_rag/retrieve/fusion.py +39 -0
  229. sci_rag_kit-0.3.0/src/sci_rag/retrieve/rerank.py +188 -0
  230. sci_rag_kit-0.3.0/src/sci_rag/retrieve/retriever.py +411 -0
  231. sci_rag_kit-0.3.0/src/sci_rag/retrieve/router.py +195 -0
  232. sci_rag_kit-0.3.0/src/sci_rag/retrieve/stages/__init__.py +15 -0
  233. sci_rag_kit-0.3.0/src/sci_rag/retrieve/stages/community.py +43 -0
  234. sci_rag_kit-0.3.0/src/sci_rag/retrieve/stages/graph.py +226 -0
  235. sci_rag_kit-0.3.0/src/sci_rag/retrieve/stages/hyde.py +59 -0
  236. sci_rag_kit-0.3.0/src/sci_rag/retrieve/stages/keyword.py +34 -0
  237. sci_rag_kit-0.3.0/src/sci_rag/retrieve/stages/vector.py +31 -0
  238. sci_rag_kit-0.3.0/src/sci_rag/retrieve/types.py +167 -0
  239. sci_rag_kit-0.3.0/src/sci_rag/scaffold/__init__.py +16 -0
  240. sci_rag_kit-0.3.0/src/sci_rag/scaffold/answers.py +163 -0
  241. sci_rag_kit-0.3.0/src/sci_rag/scaffold/apply.py +850 -0
  242. sci_rag_kit-0.3.0/src/sci_rag/scaffold/fetch.py +161 -0
  243. sci_rag_kit-0.3.0/src/sci_rag/scaffold/licenses.py +110 -0
  244. sci_rag_kit-0.3.0/src/sci_rag/scaffold/manifests.py +246 -0
  245. sci_rag_kit-0.3.0/src/sci_rag/scaffold/naming.py +13 -0
  246. sci_rag_kit-0.3.0/src/sci_rag/scaffold/ontology.py +103 -0
  247. sci_rag_kit-0.3.0/src/sci_rag/scaffold/questions.py +173 -0
  248. sci_rag_kit-0.3.0/src/sci_rag/scaffold/runners.py +345 -0
  249. sci_rag_kit-0.3.0/src/sci_rag/scaffold/wizard.py +217 -0
  250. sci_rag_kit-0.3.0/src/sci_rag/server/__init__.py +5 -0
  251. sci_rag_kit-0.3.0/src/sci_rag/server/app.py +139 -0
  252. sci_rag_kit-0.3.0/src/sci_rag/server/auth.py +192 -0
  253. sci_rag_kit-0.3.0/src/sci_rag/server/errors.py +90 -0
  254. sci_rag_kit-0.3.0/src/sci_rag/server/mcp_server.py +385 -0
  255. sci_rag_kit-0.3.0/src/sci_rag/server/routers/__init__.py +6 -0
  256. sci_rag_kit-0.3.0/src/sci_rag/server/routers/answer.py +132 -0
  257. sci_rag_kit-0.3.0/src/sci_rag/server/routers/documents.py +86 -0
  258. sci_rag_kit-0.3.0/src/sci_rag/server/routers/meta.py +45 -0
  259. sci_rag_kit-0.3.0/src/sci_rag/server/routers/query.py +88 -0
  260. sci_rag_kit-0.3.0/src/sci_rag/server/schemas.py +240 -0
  261. sci_rag_kit-0.3.0/src/sci_rag/server/service.py +349 -0
  262. sci_rag_kit-0.3.0/src/sci_rag/snapshot.py +111 -0
  263. sci_rag_kit-0.3.0/tests/cloud/test_campaign_build_live.py +47 -0
  264. sci_rag_kit-0.3.0/tests/cloud/test_campaign_discovery_live.py +34 -0
  265. sci_rag_kit-0.3.0/tests/cloud/test_llm_providers_live.py +82 -0
  266. sci_rag_kit-0.3.0/tests/conftest.py +82 -0
  267. sci_rag_kit-0.3.0/tests/docs/test_snippet_geometry.py +202 -0
  268. sci_rag_kit-0.3.0/tests/fixtures/campaigns/crossref_current.json +10 -0
  269. sci_rag_kit-0.3.0/tests/fixtures/campaigns/crossref_malformed.json +11 -0
  270. sci_rag_kit-0.3.0/tests/fixtures/campaigns/crossref_retracted.json +17 -0
  271. sci_rag_kit-0.3.0/tests/fixtures/campaigns/crossref_retracted_updated_by.json +19 -0
  272. sci_rag_kit-0.3.0/tests/fixtures/campaigns/crossref_work.json +17 -0
  273. sci_rag_kit-0.3.0/tests/fixtures/campaigns/openalex_page1.json +34 -0
  274. sci_rag_kit-0.3.0/tests/fixtures/campaigns/openalex_page2.json +20 -0
  275. sci_rag_kit-0.3.0/tests/fixtures/campaigns/unpaywall_cc_by.json +16 -0
  276. sci_rag_kit-0.3.0/tests/fixtures/campaigns/unpaywall_closed.json +9 -0
  277. sci_rag_kit-0.3.0/tests/fixtures/campaigns/unpaywall_green_no_license.json +16 -0
  278. sci_rag_kit-0.3.0/tests/integration/test_answer_compression.py +120 -0
  279. sci_rag_kit-0.3.0/tests/integration/test_campaign_build.py +97 -0
  280. sci_rag_kit-0.3.0/tests/integration/test_campaign_screen.py +81 -0
  281. sci_rag_kit-0.3.0/tests/integration/test_citation_edges.py +199 -0
  282. sci_rag_kit-0.3.0/tests/integration/test_confidence_traversal.py +142 -0
  283. sci_rag_kit-0.3.0/tests/integration/test_corpus_delete.py +238 -0
  284. sci_rag_kit-0.3.0/tests/integration/test_doctor.py +192 -0
  285. sci_rag_kit-0.3.0/tests/integration/test_enrich_integration.py +148 -0
  286. sci_rag_kit-0.3.0/tests/integration/test_entity_resolution_db.py +670 -0
  287. sci_rag_kit-0.3.0/tests/integration/test_eval_smoke.py +130 -0
  288. sci_rag_kit-0.3.0/tests/integration/test_graph.py +439 -0
  289. sci_rag_kit-0.3.0/tests/integration/test_metadata_filters.py +241 -0
  290. sci_rag_kit-0.3.0/tests/integration/test_pipeline.py +253 -0
  291. sci_rag_kit-0.3.0/tests/integration/test_reindex.py +159 -0
  292. sci_rag_kit-0.3.0/tests/integration/test_rerank_integration.py +127 -0
  293. sci_rag_kit-0.3.0/tests/integration/test_retraction_filter.py +75 -0
  294. sci_rag_kit-0.3.0/tests/integration/test_router_integration.py +69 -0
  295. sci_rag_kit-0.3.0/tests/integration/test_snapshot.py +89 -0
  296. sci_rag_kit-0.3.0/tests/server/conftest.py +140 -0
  297. sci_rag_kit-0.3.0/tests/server/test_answer_api.py +147 -0
  298. sci_rag_kit-0.3.0/tests/server/test_api_contracts.py +191 -0
  299. sci_rag_kit-0.3.0/tests/server/test_mcp_server.py +186 -0
  300. sci_rag_kit-0.3.0/tests/unit/test_anthropic_provider.py +217 -0
  301. sci_rag_kit-0.3.0/tests/unit/test_calibration.py +210 -0
  302. sci_rag_kit-0.3.0/tests/unit/test_campaign_build_unit.py +179 -0
  303. sci_rag_kit-0.3.0/tests/unit/test_campaign_cli.py +152 -0
  304. sci_rag_kit-0.3.0/tests/unit/test_campaign_discovery.py +152 -0
  305. sci_rag_kit-0.3.0/tests/unit/test_campaign_download.py +151 -0
  306. sci_rag_kit-0.3.0/tests/unit/test_campaign_http.py +116 -0
  307. sci_rag_kit-0.3.0/tests/unit/test_campaign_licensing.py +37 -0
  308. sci_rag_kit-0.3.0/tests/unit/test_campaign_manifest.py +66 -0
  309. sci_rag_kit-0.3.0/tests/unit/test_campaign_resolve.py +73 -0
  310. sci_rag_kit-0.3.0/tests/unit/test_campaign_state.py +71 -0
  311. sci_rag_kit-0.3.0/tests/unit/test_chunker.py +129 -0
  312. sci_rag_kit-0.3.0/tests/unit/test_citations.py +35 -0
  313. sci_rag_kit-0.3.0/tests/unit/test_cli_help.py +111 -0
  314. sci_rag_kit-0.3.0/tests/unit/test_cli_init.py +147 -0
  315. sci_rag_kit-0.3.0/tests/unit/test_cli_new.py +178 -0
  316. sci_rag_kit-0.3.0/tests/unit/test_compression.py +129 -0
  317. sci_rag_kit-0.3.0/tests/unit/test_doc_renderers.py +44 -0
  318. sci_rag_kit-0.3.0/tests/unit/test_docs_code_snippets.py +101 -0
  319. sci_rag_kit-0.3.0/tests/unit/test_docs_deploy_workflow.py +30 -0
  320. sci_rag_kit-0.3.0/tests/unit/test_docs_page_head.py +180 -0
  321. sci_rag_kit-0.3.0/tests/unit/test_docs_site_copy.py +91 -0
  322. sci_rag_kit-0.3.0/tests/unit/test_docs_transcript.py +95 -0
  323. sci_rag_kit-0.3.0/tests/unit/test_doctor_offline.py +189 -0
  324. sci_rag_kit-0.3.0/tests/unit/test_dotenv_environ.py +78 -0
  325. sci_rag_kit-0.3.0/tests/unit/test_embed_local.py +65 -0
  326. sci_rag_kit-0.3.0/tests/unit/test_enrich.py +58 -0
  327. sci_rag_kit-0.3.0/tests/unit/test_entity_resolution.py +118 -0
  328. sci_rag_kit-0.3.0/tests/unit/test_eval_diff.py +188 -0
  329. sci_rag_kit-0.3.0/tests/unit/test_eval_stats.py +108 -0
  330. sci_rag_kit-0.3.0/tests/unit/test_evals_pure.py +100 -0
  331. sci_rag_kit-0.3.0/tests/unit/test_generated_projects_workflow.py +81 -0
  332. sci_rag_kit-0.3.0/tests/unit/test_google_providers.py +158 -0
  333. sci_rag_kit-0.3.0/tests/unit/test_graph_pure.py +205 -0
  334. sci_rag_kit-0.3.0/tests/unit/test_graph_walk_sql.py +96 -0
  335. sci_rag_kit-0.3.0/tests/unit/test_init_domain_script.py +57 -0
  336. sci_rag_kit-0.3.0/tests/unit/test_licensing_and_manifest.py +63 -0
  337. sci_rag_kit-0.3.0/tests/unit/test_llm_factory.py +120 -0
  338. sci_rag_kit-0.3.0/tests/unit/test_local_postgres_script.py +137 -0
  339. sci_rag_kit-0.3.0/tests/unit/test_model_spec.py +81 -0
  340. sci_rag_kit-0.3.0/tests/unit/test_openai_compat_provider.py +226 -0
  341. sci_rag_kit-0.3.0/tests/unit/test_public_api.py +49 -0
  342. sci_rag_kit-0.3.0/tests/unit/test_render_benchmarks.py +204 -0
  343. sci_rag_kit-0.3.0/tests/unit/test_report_writers.py +102 -0
  344. sci_rag_kit-0.3.0/tests/unit/test_rerank.py +165 -0
  345. sci_rag_kit-0.3.0/tests/unit/test_retrieval_scope.py +92 -0
  346. sci_rag_kit-0.3.0/tests/unit/test_router.py +124 -0
  347. sci_rag_kit-0.3.0/tests/unit/test_scaffold_answers.py +99 -0
  348. sci_rag_kit-0.3.0/tests/unit/test_scaffold_apply.py +421 -0
  349. sci_rag_kit-0.3.0/tests/unit/test_scaffold_docker_free_postgres.py +164 -0
  350. sci_rag_kit-0.3.0/tests/unit/test_scaffold_fetch.py +164 -0
  351. sci_rag_kit-0.3.0/tests/unit/test_scaffold_manifests.py +166 -0
  352. sci_rag_kit-0.3.0/tests/unit/test_scaffold_ontology.py +78 -0
  353. sci_rag_kit-0.3.0/tests/unit/test_scaffold_ontology_flow.py +90 -0
  354. sci_rag_kit-0.3.0/tests/unit/test_scaffold_questions.py +103 -0
  355. sci_rag_kit-0.3.0/tests/unit/test_scaffold_runner_coherence.py +168 -0
  356. sci_rag_kit-0.3.0/tests/unit/test_scaffold_runner_profiles.py +113 -0
  357. sci_rag_kit-0.3.0/tests/unit/test_scaffold_runners.py +50 -0
  358. sci_rag_kit-0.3.0/tests/unit/test_scaffold_wizard.py +139 -0
  359. sci_rag_kit-0.3.0/tests/unit/test_screening.py +282 -0
  360. sci_rag_kit-0.3.0/uv.lock +5004 -0
@@ -0,0 +1,18 @@
1
+ # Devcontainer overlay: adds an app container next to the db service from
2
+ # the root docker-compose.yml. Inside this network the database is reached
3
+ # as host "db" on 5432 (no published-port indirection).
4
+ #
5
+ # Note on the volume path: with multiple compose files, relative paths
6
+ # resolve against the FIRST file's directory (the repo root), so the
7
+ # workspace mount is "." here, not "..".
8
+ services:
9
+ app:
10
+ image: mcr.microsoft.com/devcontainers/python:3.12
11
+ volumes:
12
+ - .:/workspaces/sci-rag-kit:cached
13
+ command: sleep infinity
14
+ environment:
15
+ SCI_RAG_DATABASE_URL: postgresql+asyncpg://sci_rag:sci_rag@db:5432/sci_rag
16
+ depends_on:
17
+ db:
18
+ condition: service_healthy
@@ -0,0 +1,9 @@
1
+ {
2
+ "features": {
3
+ "ghcr.io/va-h/devcontainers-features/uv:1": {
4
+ "version": "1.1.4",
5
+ "resolved": "ghcr.io/va-h/devcontainers-features/uv@sha256:a15737142539d150ef4d358e2d6a7424a0a2f3dc43b29a3aa1b50162a8b11bc1",
6
+ "integrity": "sha256:a15737142539d150ef4d358e2d6a7424a0a2f3dc43b29a3aa1b50162a8b11bc1"
7
+ }
8
+ }
9
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "sci-rag-kit",
3
+ "dockerComposeFile": ["../docker-compose.yml", "compose.yml"],
4
+ "service": "app",
5
+ "workspaceFolder": "/workspaces/sci-rag-kit",
6
+ "features": {
7
+ "ghcr.io/va-h/devcontainers-features/uv:1": {}
8
+ },
9
+ "postCreateCommand": "uv sync && uv run sci-rag db upgrade",
10
+ "forwardPorts": [8000],
11
+ "customizations": {
12
+ "vscode": {
13
+ "extensions": ["ms-python.python", "charliermarsh.ruff"],
14
+ "settings": {
15
+ "python.defaultInterpreterPath": "${containerWorkspaceFolder}/.venv/bin/python"
16
+ }
17
+ }
18
+ }
19
+ }
@@ -0,0 +1,90 @@
1
+ # ---------------------------------------------------------------------------
2
+ # sci-rag-kit configuration
3
+ #
4
+ # Copy this file to `.env`, then fill in the handful of values you need.
5
+ # Everything has a sensible default for the local quickstart; you only need
6
+ # Google credentials when you want real embeddings, graph extraction, and
7
+ # generated answers (see docs/quickstart.md).
8
+ # ---------------------------------------------------------------------------
9
+
10
+ # --- Database ---------------------------------------------------------------
11
+ # The default matches docker-compose.yml (`docker compose up -d`).
12
+ SCI_RAG_DATABASE_URL=postgresql+asyncpg://sci_rag:sci_rag@localhost:5433/sci_rag
13
+
14
+ # --- Models: pick ONE of the two options below ------------------------------
15
+ # Option A (easiest): a free Google AI Studio API key, https://aistudio.google.com/apikey
16
+ # SCI_RAG_GOOGLE_API_KEY=
17
+
18
+ # Option B (labs/teams on Google Cloud): Vertex AI with application-default
19
+ # credentials. Run `gcloud auth application-default login` first.
20
+ # SCI_RAG_GCP_PROJECT=your-project-id
21
+ # SCI_RAG_GCP_LOCATION=us-central1
22
+
23
+ # --- Embeddings -------------------------------------------------------------
24
+ # "google" needs one of the credential options above. "local-hash" is a
25
+ # deterministic, no-network embedder meant for tests and pipeline dry runs;
26
+ # its rankings are lexical, not semantic.
27
+ SCI_RAG_EMBEDDING_PROVIDER=google
28
+ SCI_RAG_EMBEDDING_MODEL=gemini-embedding-001
29
+ # 1536 keeps vectors inside pgvector's HNSW index limit (2000 dims).
30
+ # Changing this after ingestion requires a migration plus re-embedding.
31
+ SCI_RAG_EMBEDDING_DIM=1536
32
+
33
+ # --- Generation (answers, graph extraction, HyDE, summaries) ----------------
34
+ # Every model setting below is a spec: either a bare model id, which belongs to
35
+ # SCI_RAG_LLM_PROVIDER, or "provider:model" to override the provider inline.
36
+ # Providers: google | anthropic | openai-compatible
37
+ SCI_RAG_LLM_PROVIDER=google
38
+ SCI_RAG_LLM_MODEL=gemini-2.5-flash
39
+
40
+ # Optional lower-cost model for high-volume graph extraction, HyDE, and
41
+ # reranking. Unset inherits SCI_RAG_LLM_MODEL.
42
+ # SCI_RAG_EXTRACTION_MODEL=
43
+
44
+ # Optional model for the evaluation judge. Unset inherits SCI_RAG_LLM_MODEL.
45
+ # Pointing this at a different provider than SCI_RAG_LLM_MODEL avoids grading
46
+ # a model's answers with its own family, which flatters the score.
47
+ # SCI_RAG_JUDGE_MODEL=
48
+
49
+ # Worked examples (each needs the matching extra installed):
50
+ # uv sync --extra anthropic
51
+ # SCI_RAG_GCP_LOCATION=global
52
+ # SCI_RAG_LLM_MODEL=anthropic:claude-haiku-4-5
53
+ # Claude as a Vertex partner model. Uses SCI_RAG_GCP_PROJECT and
54
+ # application-default credentials; no separate key needed.
55
+ #
56
+ # uv sync --extra openai
57
+ # SCI_RAG_GCP_LOCATION=global
58
+ # SCI_RAG_LLM_MODEL=openai-compatible:xai/grok-4.1-fast-non-reasoning
59
+ # Grok through Vertex Model Garden's OpenAI-compatible endpoint, which is
60
+ # how every non-Google partner model (Grok, Llama, Mistral, DeepSeek) is
61
+ # served. Also uses SCI_RAG_GCP_PROJECT.
62
+ #
63
+ # NOTE: partner models are not served from every region. The us-central1
64
+ # default serves Gemini but not Claude or Grok; both work from "global", and
65
+ # Grok is only offered there. Run `sci-rag doctor --probe` after changing
66
+ # providers -- it probes each one and names the fix.
67
+
68
+ # --- Credentials for the non-Google generation providers --------------------
69
+ # Only needed to call these providers directly instead of through Vertex AI.
70
+ # SCI_RAG_ANTHROPIC_API_KEY=
71
+ # SCI_RAG_OPENAI_API_KEY=
72
+ # Point the OpenAI-compatible provider somewhere other than Vertex: OpenAI
73
+ # itself (unset the base URL, set the key) or a self-hosted vLLM/Ollama server.
74
+ # SCI_RAG_OPENAI_BASE_URL=
75
+
76
+ # --- Retrieval stage timeouts (seconds) -------------------------------------
77
+ # SCI_RAG_INTERACTIVE_STAGE_TIMEOUT_S=8.0
78
+ # SCI_RAG_DEEP_STAGE_TIMEOUT_S=30.0
79
+
80
+ # --- Repository-relative paths ---------------------------------------------
81
+ # SCI_RAG_DOMAIN_DIR=domain
82
+ # SCI_RAG_DATA_DIR=data
83
+
84
+ # --- Server (only needed for `sci-rag serve`) -------------------------------
85
+ # JSON map of API key -> settings. Leave unset for open local development
86
+ # (the server will warn loudly). Example:
87
+ # SCI_RAG_API_KEYS={"dev-key-123": {"scopes": ["retrieval:query", "retrieval:answer"]}}
88
+ # SCI_RAG_SERVER_HOST=127.0.0.1
89
+ # SCI_RAG_SERVER_PORT=8000
90
+ # SCI_RAG_CORS_ORIGINS=*
@@ -0,0 +1,30 @@
1
+ name: Bug report
2
+ description: Something broke or behaved wrongly
3
+ labels: [bug]
4
+ body:
5
+ - type: textarea
6
+ id: what
7
+ attributes:
8
+ label: What happened
9
+ description: What you did, what you expected, what you got instead.
10
+ placeholder: Ran `sci-rag ingest data/raw` and ...
11
+ validations:
12
+ required: true
13
+ - type: textarea
14
+ id: doctor
15
+ attributes:
16
+ label: sci-rag doctor output
17
+ description: Paste the output of `uv run sci-rag doctor` (redact anything sensitive).
18
+ render: text
19
+ validations:
20
+ required: true
21
+ - type: input
22
+ id: version
23
+ attributes:
24
+ label: Version / commit
25
+ placeholder: v0.1.0a0, or a commit SHA
26
+ - type: textarea
27
+ id: logs
28
+ attributes:
29
+ label: Relevant logs or traceback
30
+ render: text
@@ -0,0 +1 @@
1
+ blank_issues_enabled: true
@@ -0,0 +1,24 @@
1
+ name: Domain specialization help
2
+ description: Questions about adapting the kit to your field (ontology, prompts, evals)
3
+ labels: [domain-help]
4
+ body:
5
+ - type: textarea
6
+ id: domain
7
+ attributes:
8
+ label: Your domain and corpus
9
+ description: What field, roughly how many documents, and what kinds (papers, reports, protocols).
10
+ validations:
11
+ required: true
12
+ - type: textarea
13
+ id: question
14
+ attributes:
15
+ label: What you are trying to figure out
16
+ description: Ontology design, seed questions, disappointing retrieval, prompt wording, and so on.
17
+ validations:
18
+ required: true
19
+ - type: textarea
20
+ id: evidence
21
+ attributes:
22
+ label: What you have tried and measured
23
+ description: Eval numbers help enormously (`sci-rag eval retrieval --ablation` output, or the report.md).
24
+ render: text
@@ -0,0 +1,23 @@
1
+ name: Feature request
2
+ description: Propose an improvement to the kit
3
+ labels: [enhancement]
4
+ body:
5
+ - type: textarea
6
+ id: problem
7
+ attributes:
8
+ label: The problem it solves
9
+ description: What is hard or impossible today, concretely.
10
+ validations:
11
+ required: true
12
+ - type: textarea
13
+ id: proposal
14
+ attributes:
15
+ label: Proposed change
16
+ description: What you would change, and where it fits (see docs/architecture.md extension points).
17
+ validations:
18
+ required: true
19
+ - type: textarea
20
+ id: evidence
21
+ attributes:
22
+ label: Evidence it helps
23
+ description: For retrieval/eval changes, before/after ablation numbers are the currency here.
@@ -0,0 +1,19 @@
1
+ # Weekly dependency update PRs. CI (including the coverage floor and the
2
+ # smoke eval) is the gate that keeps them honest.
3
+ version: 2
4
+ updates:
5
+ - package-ecosystem: "uv"
6
+ directory: "/"
7
+ schedule:
8
+ interval: "weekly"
9
+ groups:
10
+ python-dependencies:
11
+ patterns: ["*"]
12
+ - package-ecosystem: "github-actions"
13
+ directory: "/"
14
+ schedule:
15
+ interval: "weekly"
16
+ - package-ecosystem: "docker"
17
+ directory: "/"
18
+ schedule:
19
+ interval: "weekly"
@@ -0,0 +1,14 @@
1
+ ## What this changes
2
+
3
+ <!-- One or two sentences. Link the issue if there is one. -->
4
+
5
+ ## Checklist
6
+
7
+ - [ ] `make check` is green (ruff, mypy, tests)
8
+ - [ ] Tests cover the change (offline by default)
9
+ - [ ] Docs updated if user-visible behavior changed
10
+ - [ ] For retrieval or eval changes: before/after `sci-rag eval retrieval --ablation` tables included below
11
+
12
+ ## Eval evidence (if applicable)
13
+
14
+ <!-- Paste the ablation tables, or delete this section. -->
@@ -0,0 +1,121 @@
1
+ name: ci
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ concurrency:
9
+ group: ci-${{ github.workflow }}-${{ github.ref }}
10
+ cancel-in-progress: true
11
+
12
+ jobs:
13
+ checks:
14
+ runs-on: ubuntu-latest
15
+ timeout-minutes: 20
16
+ strategy:
17
+ fail-fast: false
18
+ matrix:
19
+ python-version: ["3.11", "3.12"]
20
+ services:
21
+ postgres:
22
+ image: pgvector/pgvector:pg16
23
+ env:
24
+ POSTGRES_DB: sci_rag_test
25
+ POSTGRES_USER: sci_rag
26
+ POSTGRES_PASSWORD: sci_rag
27
+ ports:
28
+ - 5433:5432
29
+ options: >-
30
+ --health-cmd "pg_isready -U sci_rag -d sci_rag_test"
31
+ --health-interval 2s
32
+ --health-timeout 5s
33
+ --health-retries 15
34
+ env:
35
+ SCI_RAG_TEST_DATABASE_URL: postgresql+asyncpg://sci_rag:sci_rag@localhost:5433/sci_rag_test
36
+ steps:
37
+ - uses: actions/checkout@v7
38
+ - uses: astral-sh/setup-uv@v7
39
+ with:
40
+ python-version: ${{ matrix.python-version }}
41
+ enable-cache: true
42
+ - name: Install dependencies
43
+ # The provider extras are light and carry the LLM adapters' tests, so
44
+ # CI installs them rather than skipping that coverage.
45
+ run: uv sync --extra anthropic --extra openai
46
+ - name: Lint
47
+ run: |
48
+ uv run ruff check src tests examples scripts
49
+ uv run ruff format --check src tests examples scripts
50
+ - name: Type check
51
+ run: uv run mypy
52
+ - name: Tests (unit + integration + smoke eval, with coverage floor)
53
+ run: uv run pytest -q --cov=sci_rag --cov-report=term --cov-fail-under=78
54
+
55
+ docker:
56
+ runs-on: ubuntu-latest
57
+ timeout-minutes: 20
58
+ steps:
59
+ - uses: actions/checkout@v7
60
+ - name: Build the server image
61
+ run: docker build -t sci-rag-kit:ci .
62
+ - name: Image smoke (CLI runs inside the container)
63
+ run: docker run --rm sci-rag-kit:ci sci-rag --help
64
+
65
+ terraform:
66
+ runs-on: ubuntu-latest
67
+ timeout-minutes: 10
68
+ defaults:
69
+ run:
70
+ working-directory: infra/terraform
71
+ steps:
72
+ - uses: actions/checkout@v7
73
+ - uses: hashicorp/setup-terraform@v4
74
+ - name: Format check
75
+ run: terraform fmt -check -diff
76
+ - name: Validate
77
+ run: |
78
+ terraform init -backend=false -input=false
79
+ terraform validate
80
+
81
+ docs-links:
82
+ runs-on: ubuntu-latest
83
+ timeout-minutes: 10
84
+ steps:
85
+ - uses: actions/checkout@v7
86
+ - name: Check internal documentation links
87
+ uses: lycheeverse/lychee-action@v2
88
+ with:
89
+ # Offline: internal file links only, so external-site flake can
90
+ # never break the build.
91
+ args: --offline --no-progress "**/*.md"
92
+ fail: true
93
+
94
+ docs:
95
+ runs-on: ubuntu-latest
96
+ timeout-minutes: 10
97
+ steps:
98
+ - uses: actions/checkout@v7
99
+ - uses: astral-sh/setup-uv@v7
100
+ with:
101
+ python-version: "3.12"
102
+ enable-cache: true
103
+ - name: Install project and documentation dependencies
104
+ # docs-test carries Playwright for the rendered-geometry guard below.
105
+ run: uv sync --group docs --group docs-test
106
+ - name: Check and build documentation exactly as contributors do
107
+ run: make docs
108
+ - name: Install the browser the geometry guard measures with
109
+ run: uv run playwright install --with-deps chromium
110
+ - name: Measure the built site's code snippets
111
+ # Reads site/ from the build above. Geometry is what the Markdown-level
112
+ # guard in tests/unit cannot see.
113
+ run: uv run pytest tests/docs -q
114
+ - name: Upload documentation preview
115
+ if: github.event_name == 'pull_request'
116
+ uses: actions/upload-artifact@v7
117
+ with:
118
+ name: docs-preview
119
+ path: site/
120
+ if-no-files-found: error
121
+ retention-days: 7
@@ -0,0 +1,126 @@
1
+ # Does the Docker-free database actually work?
2
+ #
3
+ # `docs/quickstart.md` tells pixi and conda users they can run PostgreSQL and
4
+ # pgvector from conda-forge instead of a container. An untested instruction is
5
+ # worse than no instruction, so this runs the real integration and server
6
+ # suites against a server installed that way, on the two platforms the
7
+ # quickstart names.
8
+ #
9
+ # It is deliberately separate from `ci.yml`. That workflow proves the
10
+ # supported floor, PostgreSQL 16 from the pgvector container image, on every
11
+ # pull request. This one proves the other end of the range in ADR 0008:
12
+ # whatever conda-forge resolves inside it, which is PostgreSQL 18 today.
13
+ #
14
+ # macOS runners are expensive, so a pull request gets linux-64 only unless it
15
+ # changes something that decides what the Docker-free path looks like. Nightly
16
+ # runs and release tags get both.
17
+ name: docker-free-postgres
18
+
19
+ on:
20
+ pull_request:
21
+ schedule:
22
+ - cron: "30 6 * * *"
23
+ push:
24
+ tags: ["v*"]
25
+ workflow_dispatch:
26
+
27
+ concurrency:
28
+ group: docker-free-${{ github.workflow }}-${{ github.ref }}
29
+ cancel-in-progress: true
30
+
31
+ jobs:
32
+ select:
33
+ runs-on: ubuntu-latest
34
+ outputs:
35
+ platforms: ${{ steps.pick.outputs.platforms }}
36
+ steps:
37
+ - uses: actions/checkout@v7
38
+ with:
39
+ fetch-depth: 0
40
+ - id: pick
41
+ env:
42
+ BASE: ${{ github.event.pull_request.base.ref }}
43
+ run: |
44
+ BOTH='[{"os":"ubuntu-latest","platform":"linux-64"},{"os":"macos-latest","platform":"osx-arm64"}]'
45
+ LINUX='[{"os":"ubuntu-latest","platform":"linux-64"}]'
46
+ if [ "${{ github.event_name }}" != "pull_request" ]; then
47
+ echo "platforms=$BOTH" >> "$GITHUB_OUTPUT"; exit 0
48
+ fi
49
+ CHANGED=$(git diff --name-only "origin/$BASE...HEAD")
50
+ echo "$CHANGED"
51
+ if echo "$CHANGED" | grep -qE '^(scripts/local_postgres|src/sci_rag/db/|migrations/|src/sci_rag/scaffold/runners|[.]github/workflows/docker-free-postgres)'; then
52
+ echo "the diff changes what this path looks like; running both platforms"
53
+ echo "platforms=$BOTH" >> "$GITHUB_OUTPUT"
54
+ else
55
+ echo "platforms=$LINUX" >> "$GITHUB_OUTPUT"
56
+ fi
57
+
58
+ integration:
59
+ needs: select
60
+ runs-on: ${{ matrix.os }}
61
+ timeout-minutes: 30
62
+ strategy:
63
+ fail-fast: false
64
+ matrix:
65
+ include: ${{ fromJSON(needs.select.outputs.platforms) }}
66
+ env:
67
+ SCI_RAG_LOCAL_PG_PORT: "5433"
68
+ SCI_RAG_LOCAL_PG_DB: sci_rag_test
69
+ SCI_RAG_TEST_DATABASE_URL: postgresql+asyncpg://sci_rag:sci_rag@127.0.0.1:5433/sci_rag_test
70
+ steps:
71
+ - uses: actions/checkout@v7
72
+
73
+ # The project itself installs with uv, exactly as in ci.yml. Only the
74
+ # database comes from conda-forge, which is the whole subject here.
75
+ - uses: astral-sh/setup-uv@v7
76
+ with:
77
+ python-version: "3.12"
78
+ enable-cache: true
79
+ - run: uv sync
80
+
81
+ # micromamba rather than a full conda: this needs two packages, and the
82
+ # action caches them, so the leg stays close to a uv one in cost.
83
+ - uses: mamba-org/setup-micromamba@v2
84
+ with:
85
+ environment-name: pgserver
86
+ condarc: |
87
+ channels:
88
+ - conda-forge
89
+ # No quotes: the action execs micromamba directly rather than
90
+ # through a shell, so a quote here becomes part of the version spec
91
+ # and libmamba rejects `19"`.
92
+ create-args: >-
93
+ postgresql>=16,<19
94
+ pgvector
95
+ cache-environment: true
96
+ init-shell: bash
97
+
98
+ - name: The server and the extension came from conda-forge
99
+ shell: bash -el {0}
100
+ run: |
101
+ which initdb pg_ctl psql
102
+ postgres --version
103
+
104
+ - name: Start the database with no container runtime
105
+ shell: bash -el {0}
106
+ run: |
107
+ uv run python scripts/local_postgres.py start
108
+ uv run python scripts/local_postgres.py status
109
+
110
+ - name: The integration and server suites pass against it
111
+ shell: bash -el {0}
112
+ run: |
113
+ # A skipped integration suite is indistinguishable from a passing
114
+ # one in the check mark, and proving these tests really ran is this
115
+ # job's only purpose, so treat the skip path as a failure.
116
+ set -o pipefail
117
+ uv run pytest tests/integration tests/server -q -rs 2>&1 | tee run.log
118
+ if grep -q "Postgres unavailable" run.log; then
119
+ echo "::error::the suite skipped instead of running against the conda-forge server"
120
+ exit 1
121
+ fi
122
+
123
+ - name: Stop it again
124
+ if: always()
125
+ shell: bash -el {0}
126
+ run: uv run python scripts/local_postgres.py stop
@@ -0,0 +1,57 @@
1
+ name: docs-deploy
2
+
3
+ on:
4
+ workflow_run:
5
+ workflows: [ci]
6
+ types: [completed]
7
+
8
+ concurrency:
9
+ group: pages
10
+ cancel-in-progress: false
11
+
12
+ permissions:
13
+ contents: read
14
+
15
+ jobs:
16
+ build:
17
+ if: >-
18
+ github.event.workflow_run.event == 'push' &&
19
+ github.event.workflow_run.head_repository.full_name == github.repository &&
20
+ github.event.workflow_run.head_branch == 'main' &&
21
+ github.event.workflow_run.head_sha == github.sha &&
22
+ github.event.workflow_run.conclusion == 'success'
23
+ runs-on: ubuntu-latest
24
+ timeout-minutes: 10
25
+ steps:
26
+ - uses: actions/checkout@v7
27
+ with:
28
+ ref: ${{ github.event.workflow_run.head_sha }}
29
+ - uses: astral-sh/setup-uv@v7
30
+ with:
31
+ python-version: "3.12"
32
+ enable-cache: true
33
+ - name: Install project and documentation dependencies
34
+ run: uv sync --group docs
35
+ - name: Check and build documentation exactly as contributors do
36
+ run: make docs
37
+ - name: Upload GitHub Pages artifact
38
+ uses: actions/upload-pages-artifact@v5
39
+ with:
40
+ path: site/
41
+
42
+ deploy:
43
+ needs: build
44
+ runs-on: ubuntu-latest
45
+ timeout-minutes: 10
46
+ permissions:
47
+ pages: write
48
+ id-token: write
49
+ environment:
50
+ name: github-pages
51
+ url: ${{ steps.deployment.outputs.page_url }}
52
+ steps:
53
+ - name: Configure GitHub Pages
54
+ uses: actions/configure-pages@v6
55
+ - name: Deploy to GitHub Pages
56
+ id: deployment
57
+ uses: actions/deploy-pages@v5