tekmeria 0.1.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 (200) hide show
  1. tekmeria-0.1.0/.github/workflows/ci.yml +55 -0
  2. tekmeria-0.1.0/.github/workflows/live.yml +23 -0
  3. tekmeria-0.1.0/.github/workflows/mutants.yml +20 -0
  4. tekmeria-0.1.0/.github/workflows/pages.yml +53 -0
  5. tekmeria-0.1.0/.github/workflows/release.yml +48 -0
  6. tekmeria-0.1.0/.gitignore +30 -0
  7. tekmeria-0.1.0/.python-version +1 -0
  8. tekmeria-0.1.0/CHANGELOG.md +15 -0
  9. tekmeria-0.1.0/CITATION.cff +26 -0
  10. tekmeria-0.1.0/LICENSE +202 -0
  11. tekmeria-0.1.0/NOTICE +36 -0
  12. tekmeria-0.1.0/PKG-INFO +627 -0
  13. tekmeria-0.1.0/README.md +599 -0
  14. tekmeria-0.1.0/docs/ACCEPTANCE.md +61 -0
  15. tekmeria-0.1.0/docs/CONTRACT.md +162 -0
  16. tekmeria-0.1.0/docs/DESIGN.md +59 -0
  17. tekmeria-0.1.0/docs/assets/audit-view.png +0 -0
  18. tekmeria-0.1.0/docs/assets/banner.html +85 -0
  19. tekmeria-0.1.0/docs/assets/banner.png +0 -0
  20. tekmeria-0.1.0/docs/assets/host-audit-view.png +0 -0
  21. tekmeria-0.1.0/docs/live-run.md +223 -0
  22. tekmeria-0.1.0/docs/specs/2026-10-06-tekmeria-server-design.md +910 -0
  23. tekmeria-0.1.0/pyproject.toml +96 -0
  24. tekmeria-0.1.0/schemas/audit_report.schema.json +477 -0
  25. tekmeria-0.1.0/src/tekmeria/__init__.py +6 -0
  26. tekmeria-0.1.0/src/tekmeria/__main__.py +176 -0
  27. tekmeria-0.1.0/src/tekmeria/contract/__init__.py +3 -0
  28. tekmeria-0.1.0/src/tekmeria/contract/audit.py +233 -0
  29. tekmeria-0.1.0/src/tekmeria/contract/audit_models.py +102 -0
  30. tekmeria-0.1.0/src/tekmeria/contract/citations.py +154 -0
  31. tekmeria-0.1.0/src/tekmeria/contract/descriptions.py +77 -0
  32. tekmeria-0.1.0/src/tekmeria/contract/handles.py +106 -0
  33. tekmeria-0.1.0/src/tekmeria/contract/models.py +146 -0
  34. tekmeria-0.1.0/src/tekmeria/contract/normalize.py +87 -0
  35. tekmeria-0.1.0/src/tekmeria/contract/schemas.py +35 -0
  36. tekmeria-0.1.0/src/tekmeria/contract/tool_models.py +115 -0
  37. tekmeria-0.1.0/src/tekmeria/demo/__init__.py +1 -0
  38. tekmeria-0.1.0/src/tekmeria/demo/fixtures/105009cadd3ae0bb23cd7cf6.json +6 -0
  39. tekmeria-0.1.0/src/tekmeria/demo/fixtures/115086eb605e64849817412c.json +6 -0
  40. tekmeria-0.1.0/src/tekmeria/demo/fixtures/13377f375937b71652a0064e.json +6 -0
  41. tekmeria-0.1.0/src/tekmeria/demo/fixtures/1378bad02d89db51b2cb4ce2.json +6 -0
  42. tekmeria-0.1.0/src/tekmeria/demo/fixtures/22817cca1b368964b876b4ff.json +6 -0
  43. tekmeria-0.1.0/src/tekmeria/demo/fixtures/336580ec7e03381cd2a0b8b5.json +6 -0
  44. tekmeria-0.1.0/src/tekmeria/demo/fixtures/34589af539d8218634455307.json +6 -0
  45. tekmeria-0.1.0/src/tekmeria/demo/fixtures/419be4134f00f12f6d53f3f2.json +6 -0
  46. tekmeria-0.1.0/src/tekmeria/demo/fixtures/4d8d6fc62be595312319d8a7.json +6 -0
  47. tekmeria-0.1.0/src/tekmeria/demo/fixtures/4e076caa5ebe58bb7d6c16e2.json +6 -0
  48. tekmeria-0.1.0/src/tekmeria/demo/fixtures/55f570efc79c7a535cfad57b.json +6 -0
  49. tekmeria-0.1.0/src/tekmeria/demo/fixtures/5a4b3864183ebac79f1faa6c.json +6 -0
  50. tekmeria-0.1.0/src/tekmeria/demo/fixtures/6463fa8e6f0d572d89731161.json +6 -0
  51. tekmeria-0.1.0/src/tekmeria/demo/fixtures/6d6e7c78e75446598ec21737.json +6 -0
  52. tekmeria-0.1.0/src/tekmeria/demo/fixtures/72120ed69cf75f3d0bdec508.json +6 -0
  53. tekmeria-0.1.0/src/tekmeria/demo/fixtures/77a834003ffbbb3658ea25c5.json +6 -0
  54. tekmeria-0.1.0/src/tekmeria/demo/fixtures/7aced45e86128b3407067083.json +6 -0
  55. tekmeria-0.1.0/src/tekmeria/demo/fixtures/7cc9069f58a05fca00873331.json +6 -0
  56. tekmeria-0.1.0/src/tekmeria/demo/fixtures/7e4ff295719ce4699d57a206.json +6 -0
  57. tekmeria-0.1.0/src/tekmeria/demo/fixtures/7fa6805864ddc1a8b1785988.json +6 -0
  58. tekmeria-0.1.0/src/tekmeria/demo/fixtures/8f474296131c87f30244147a.json +6 -0
  59. tekmeria-0.1.0/src/tekmeria/demo/fixtures/90f9d62ee857cc4c25d9cc47.json +6 -0
  60. tekmeria-0.1.0/src/tekmeria/demo/fixtures/96fd8aff617486166738899d.json +6 -0
  61. tekmeria-0.1.0/src/tekmeria/demo/fixtures/9c7af92deaa0427c75d97c90.json +6 -0
  62. tekmeria-0.1.0/src/tekmeria/demo/fixtures/a4544e60e3f3b51dfcf9590e.json +6 -0
  63. tekmeria-0.1.0/src/tekmeria/demo/fixtures/a8d59c533701d5cf5f166df9.json +6 -0
  64. tekmeria-0.1.0/src/tekmeria/demo/fixtures/aef517032f9d59f0043c6b58.json +6 -0
  65. tekmeria-0.1.0/src/tekmeria/demo/fixtures/b403356f4d9dff58b0962201.json +6 -0
  66. tekmeria-0.1.0/src/tekmeria/demo/fixtures/b7ae8d8c6de95f6926f68b04.json +6 -0
  67. tekmeria-0.1.0/src/tekmeria/demo/fixtures/c04bf146d4a15b143b73b862.json +6 -0
  68. tekmeria-0.1.0/src/tekmeria/demo/fixtures/c223f519147822fd610c7b47.json +6 -0
  69. tekmeria-0.1.0/src/tekmeria/demo/fixtures/c992c70e7a0ebd0760ac8ef9.json +6 -0
  70. tekmeria-0.1.0/src/tekmeria/demo/fixtures/cfe69e6b6c1752c1a20b492a.json +6 -0
  71. tekmeria-0.1.0/src/tekmeria/demo/fixtures/d7f8b3e3a01d043eee3d27b4.json +6 -0
  72. tekmeria-0.1.0/src/tekmeria/demo/fixtures/e43dd8955a69ea60153715d2.json +6 -0
  73. tekmeria-0.1.0/src/tekmeria/demo/fixtures/e7e7ef52a46f993947dd7e99.json +6 -0
  74. tekmeria-0.1.0/src/tekmeria/demo/fixtures/eddc432b3b4d825f58ebfc1f.json +6 -0
  75. tekmeria-0.1.0/src/tekmeria/demo/fixtures/f550ba0247ee378be215b5f1.json +6 -0
  76. tekmeria-0.1.0/src/tekmeria/demo/fixtures/scenario.json +8 -0
  77. tekmeria-0.1.0/src/tekmeria/demo/scenario.py +274 -0
  78. tekmeria-0.1.0/src/tekmeria/evaluation/__init__.py +1 -0
  79. tekmeria-0.1.0/src/tekmeria/evaluation/answers.py +105 -0
  80. tekmeria-0.1.0/src/tekmeria/evaluation/cases.py +683 -0
  81. tekmeria-0.1.0/src/tekmeria/evaluation/faults.py +266 -0
  82. tekmeria-0.1.0/src/tekmeria/evaluation/mutants.py +299 -0
  83. tekmeria-0.1.0/src/tekmeria/evaluation/oracle.py +107 -0
  84. tekmeria-0.1.0/src/tekmeria/evaluation/run.py +321 -0
  85. tekmeria-0.1.0/src/tekmeria/evaluation/snapshot.py +83 -0
  86. tekmeria-0.1.0/src/tekmeria/infra/__init__.py +1 -0
  87. tekmeria-0.1.0/src/tekmeria/infra/cache.py +136 -0
  88. tekmeria-0.1.0/src/tekmeria/infra/fixtures.py +160 -0
  89. tekmeria-0.1.0/src/tekmeria/infra/http.py +166 -0
  90. tekmeria-0.1.0/src/tekmeria/infra/keys.py +71 -0
  91. tekmeria-0.1.0/src/tekmeria/infra/logging.py +40 -0
  92. tekmeria-0.1.0/src/tekmeria/infra/ratelimit.py +35 -0
  93. tekmeria-0.1.0/src/tekmeria/infra/settings.py +21 -0
  94. tekmeria-0.1.0/src/tekmeria/server/__init__.py +1 -0
  95. tekmeria-0.1.0/src/tekmeria/server/app.py +505 -0
  96. tekmeria-0.1.0/src/tekmeria/server/cursor.py +54 -0
  97. tekmeria-0.1.0/src/tekmeria/server/render.py +142 -0
  98. tekmeria-0.1.0/src/tekmeria/server/runtime.py +71 -0
  99. tekmeria-0.1.0/src/tekmeria/sources/__init__.py +1 -0
  100. tekmeria-0.1.0/src/tekmeria/sources/base.py +25 -0
  101. tekmeria-0.1.0/src/tekmeria/sources/clinicaltrials.py +223 -0
  102. tekmeria-0.1.0/src/tekmeria/sources/clinicaltrials_parse.py +291 -0
  103. tekmeria-0.1.0/src/tekmeria/sources/crossref.py +73 -0
  104. tekmeria-0.1.0/src/tekmeria/sources/errors.py +7 -0
  105. tekmeria-0.1.0/src/tekmeria/sources/europepmc.py +198 -0
  106. tekmeria-0.1.0/src/tekmeria/sources/europepmc_parse.py +204 -0
  107. tekmeria-0.1.0/src/tekmeria/sources/merge.py +55 -0
  108. tekmeria-0.1.0/src/tekmeria/sources/openfda.py +131 -0
  109. tekmeria-0.1.0/src/tekmeria/sources/openfda_parse.py +192 -0
  110. tekmeria-0.1.0/src/tekmeria/sources/pubmed.py +155 -0
  111. tekmeria-0.1.0/src/tekmeria/sources/pubmed_parse.py +202 -0
  112. tekmeria-0.1.0/src/tekmeria/sources/pubtator.py +133 -0
  113. tekmeria-0.1.0/src/tekmeria/sources/service.py +763 -0
  114. tekmeria-0.1.0/src/tekmeria/ui/__init__.py +24 -0
  115. tekmeria-0.1.0/src/tekmeria/ui/audit-view.html +110 -0
  116. tekmeria-0.1.0/tests/__init__.py +0 -0
  117. tekmeria-0.1.0/tests/conftest.py +34 -0
  118. tekmeria-0.1.0/tests/contract/__init__.py +0 -0
  119. tekmeria-0.1.0/tests/contract/test_audit.py +287 -0
  120. tekmeria-0.1.0/tests/contract/test_citations.py +215 -0
  121. tekmeria-0.1.0/tests/contract/test_contract_doc.py +100 -0
  122. tekmeria-0.1.0/tests/contract/test_descriptions.py +32 -0
  123. tekmeria-0.1.0/tests/contract/test_handles.py +94 -0
  124. tekmeria-0.1.0/tests/contract/test_models.py +101 -0
  125. tekmeria-0.1.0/tests/contract/test_normalize.py +118 -0
  126. tekmeria-0.1.0/tests/contract/test_schemas.py +27 -0
  127. tekmeria-0.1.0/tests/demo/__init__.py +0 -0
  128. tekmeria-0.1.0/tests/demo/test_demo.py +62 -0
  129. tekmeria-0.1.0/tests/demo/test_demo_cli.py +52 -0
  130. tekmeria-0.1.0/tests/demo/test_fixture_licences.py +90 -0
  131. tekmeria-0.1.0/tests/demo/test_scenario_recording.py +59 -0
  132. tekmeria-0.1.0/tests/evaluation/__init__.py +0 -0
  133. tekmeria-0.1.0/tests/evaluation/conftest.py +14 -0
  134. tekmeria-0.1.0/tests/evaluation/test_answers.py +102 -0
  135. tekmeria-0.1.0/tests/evaluation/test_cases.py +193 -0
  136. tekmeria-0.1.0/tests/evaluation/test_cli.py +54 -0
  137. tekmeria-0.1.0/tests/evaluation/test_faults.py +88 -0
  138. tekmeria-0.1.0/tests/evaluation/test_mutants.py +144 -0
  139. tekmeria-0.1.0/tests/evaluation/test_oracle.py +140 -0
  140. tekmeria-0.1.0/tests/evaluation/test_run.py +226 -0
  141. tekmeria-0.1.0/tests/evaluation/test_snapshot.py +58 -0
  142. tekmeria-0.1.0/tests/infra/__init__.py +0 -0
  143. tekmeria-0.1.0/tests/infra/test_http_and_fixtures.py +258 -0
  144. tekmeria-0.1.0/tests/infra/test_keys.py +107 -0
  145. tekmeria-0.1.0/tests/infra/test_logging.py +51 -0
  146. tekmeria-0.1.0/tests/infra/test_ratelimit_and_cache.py +89 -0
  147. tekmeria-0.1.0/tests/live/__init__.py +0 -0
  148. tekmeria-0.1.0/tests/live/test_live_pubmed.py +34 -0
  149. tekmeria-0.1.0/tests/live/test_live_registries.py +37 -0
  150. tekmeria-0.1.0/tests/server/__init__.py +0 -0
  151. tekmeria-0.1.0/tests/server/test_audit_view.py +91 -0
  152. tekmeria-0.1.0/tests/server/test_cursor_and_render.py +202 -0
  153. tekmeria-0.1.0/tests/server/test_server.py +159 -0
  154. tekmeria-0.1.0/tests/server/test_server_literature.py +191 -0
  155. tekmeria-0.1.0/tests/server/test_server_offline.py +202 -0
  156. tekmeria-0.1.0/tests/server/test_server_registries.py +118 -0
  157. tekmeria-0.1.0/tests/sources/__init__.py +0 -0
  158. tekmeria-0.1.0/tests/sources/test_clinicaltrials.py +146 -0
  159. tekmeria-0.1.0/tests/sources/test_clinicaltrials_parse.py +241 -0
  160. tekmeria-0.1.0/tests/sources/test_crossref.py +90 -0
  161. tekmeria-0.1.0/tests/sources/test_europepmc.py +127 -0
  162. tekmeria-0.1.0/tests/sources/test_europepmc_parse.py +121 -0
  163. tekmeria-0.1.0/tests/sources/test_merge.py +31 -0
  164. tekmeria-0.1.0/tests/sources/test_openfda.py +138 -0
  165. tekmeria-0.1.0/tests/sources/test_openfda_parse.py +120 -0
  166. tekmeria-0.1.0/tests/sources/test_pubmed_parse.py +100 -0
  167. tekmeria-0.1.0/tests/sources/test_pubmed_query.py +97 -0
  168. tekmeria-0.1.0/tests/sources/test_pubmed_recorded.py +39 -0
  169. tekmeria-0.1.0/tests/sources/test_pubtator.py +106 -0
  170. tekmeria-0.1.0/tests/sources/test_search_state.py +12 -0
  171. tekmeria-0.1.0/tests/sources/test_service_registries.py +213 -0
  172. tekmeria-0.1.0/tests/sources/test_service_resilience.py +255 -0
  173. tekmeria-0.1.0/tests/test_acceptance_doc.py +43 -0
  174. tekmeria-0.1.0/tests/test_instructions.py +15 -0
  175. tekmeria-0.1.0/tests/test_package.py +88 -0
  176. tekmeria-0.1.0/tests/test_readme.py +229 -0
  177. tekmeria-0.1.0/tests/test_release.py +53 -0
  178. tekmeria-0.1.0/tests/test_workflows.py +105 -0
  179. tekmeria-0.1.0/uv.lock +996 -0
  180. tekmeria-0.1.0/web/.gitignore +2 -0
  181. tekmeria-0.1.0/web/audit-view.html +14 -0
  182. tekmeria-0.1.0/web/package-lock.json +2841 -0
  183. tekmeria-0.1.0/web/package.json +36 -0
  184. tekmeria-0.1.0/web/scripts/gen-types.mjs +17 -0
  185. tekmeria-0.1.0/web/src/AuditView.test.tsx +192 -0
  186. tekmeria-0.1.0/web/src/AuditView.tsx +92 -0
  187. tekmeria-0.1.0/web/src/CitationChip.tsx +149 -0
  188. tekmeria-0.1.0/web/src/Root.test.tsx +46 -0
  189. tekmeria-0.1.0/web/src/Root.tsx +71 -0
  190. tekmeria-0.1.0/web/src/main.tsx +6 -0
  191. tekmeria-0.1.0/web/src/report.test.ts +81 -0
  192. tekmeria-0.1.0/web/src/report.ts +162 -0
  193. tekmeria-0.1.0/web/src/source.test.ts +136 -0
  194. tekmeria-0.1.0/web/src/source.ts +113 -0
  195. tekmeria-0.1.0/web/src/styles.css +256 -0
  196. tekmeria-0.1.0/web/src/test/fixtures/demo-report.json +172 -0
  197. tekmeria-0.1.0/web/src/test/fixtures/edge-report.json +99 -0
  198. tekmeria-0.1.0/web/src/test/setup.ts +5 -0
  199. tekmeria-0.1.0/web/tsconfig.json +19 -0
  200. tekmeria-0.1.0/web/vite.config.ts +18 -0
@@ -0,0 +1,55 @@
1
+ name: ci
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ python:
13
+ runs-on: ubuntu-latest
14
+ timeout-minutes: 20
15
+ steps:
16
+ - uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
17
+ - uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
18
+ with:
19
+ enable-cache: true
20
+ - run: uv python install 3.12
21
+ - run: uv sync --locked
22
+ - run: uv run ruff check
23
+ - run: uv run ruff format --check
24
+ - run: uv run pyright
25
+ - run: uv run pytest
26
+ - name: Offline demo must catch every planted case
27
+ run: uv run tekmeria demo
28
+ - name: The audit must give every planted case its verdict
29
+ run: uv run tekmeria evaluate
30
+ - name: The evaluation must catch every injected fault it can
31
+ run: uv run python -m tekmeria.evaluation.faults --per-category 10
32
+ - name: The wheel ships the audit view
33
+ run: |
34
+ uv build --wheel --out-dir dist
35
+ uv run python -c "import glob, sys, zipfile; names = zipfile.ZipFile(glob.glob('dist/*.whl')[0]).namelist(); sys.exit(0 if 'tekmeria/ui/audit-view.html' in names else 'the wheel has no tekmeria/ui/audit-view.html')"
36
+
37
+ web:
38
+ runs-on: ubuntu-latest
39
+ timeout-minutes: 20
40
+ defaults:
41
+ run:
42
+ working-directory: web
43
+ steps:
44
+ - uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
45
+ - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
46
+ with:
47
+ node-version: 24
48
+ cache: npm
49
+ cache-dependency-path: web/package-lock.json
50
+ - run: npm ci
51
+ - run: npm run typecheck
52
+ - run: npm test
53
+ - run: npm run build
54
+ - name: The committed audit view must match the build
55
+ run: git diff --exit-code -- ../src/tekmeria/ui/audit-view.html
@@ -0,0 +1,23 @@
1
+ name: live-smoke
2
+
3
+ # Calls real upstream APIs to catch drift. Never part of the default test run.
4
+ on:
5
+ schedule:
6
+ - cron: "0 6 * * 1" # Mondays 06:00 UTC
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ live:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
17
+ - uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
18
+ - run: uv python install 3.12
19
+ - run: uv sync --locked
20
+ - run: uv run pytest -m live
21
+ env:
22
+ NCBI_EMAIL: ${{ secrets.NCBI_EMAIL }}
23
+ NCBI_API_KEY: ${{ secrets.NCBI_API_KEY }}
@@ -0,0 +1,20 @@
1
+ name: mutants
2
+
3
+ # How much of the audit the evaluation exercises: one mutant at a time, run on request.
4
+ on:
5
+ workflow_dispatch:
6
+
7
+ permissions:
8
+ contents: read
9
+
10
+ jobs:
11
+ mutants:
12
+ runs-on: ubuntu-latest
13
+ timeout-minutes: 30
14
+ steps:
15
+ - uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
16
+ - uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
17
+ - run: uv python install 3.12
18
+ - run: uv sync --locked
19
+ - name: Mutation score of the evaluation
20
+ run: uv run python -m tekmeria.evaluation.mutants >> "$GITHUB_STEP_SUMMARY"
@@ -0,0 +1,53 @@
1
+ name: pages
2
+
3
+ # Publishes the audit view with the offline demo's report (spec 10).
4
+ # Runs after CI passes on a push to main and deploys the commit CI tested; it can also be
5
+ # started by hand. Pages must be set to "GitHub Actions" in the repository settings, which
6
+ # needs a public repository (or a paid plan).
7
+ on:
8
+ workflow_run:
9
+ workflows: [ci]
10
+ types: [completed]
11
+ branches: [main]
12
+ workflow_dispatch:
13
+
14
+ permissions:
15
+ contents: read
16
+ pages: write
17
+ id-token: write
18
+
19
+ concurrency:
20
+ group: pages
21
+ cancel-in-progress: false # a newer run waits; a deployment is never cut short
22
+
23
+ jobs:
24
+ build:
25
+ if: >-
26
+ github.event_name == 'workflow_dispatch' ||
27
+ (github.event.workflow_run.conclusion == 'success' &&
28
+ github.event.workflow_run.event == 'push')
29
+ runs-on: ubuntu-latest
30
+ steps:
31
+ - uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
32
+ with:
33
+ ref: ${{ github.event.workflow_run.head_sha || github.sha }}
34
+ - uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
35
+ with:
36
+ enable-cache: true
37
+ - run: uv python install 3.12
38
+ - run: uv sync --locked
39
+ - run: uv run tekmeria demo --json-out site/demo-report.json --html-out site/index.html
40
+ - uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0
41
+ - uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
42
+ with:
43
+ path: site
44
+
45
+ deploy:
46
+ needs: build
47
+ runs-on: ubuntu-latest
48
+ environment:
49
+ name: github-pages
50
+ url: ${{ steps.deployment.outputs.page_url }}
51
+ steps:
52
+ - id: deployment
53
+ uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5.0.1
@@ -0,0 +1,48 @@
1
+ name: release
2
+
3
+ # A published GitHub release goes to PyPI by trusted publishing: PyPI trusts this workflow's
4
+ # identity token, so no PyPI password or API token is stored anywhere. The upload waits in
5
+ # the pypi environment for the maintainer's approval.
6
+
7
+ on:
8
+ release:
9
+ types: [published]
10
+
11
+ permissions:
12
+ contents: read
13
+
14
+ jobs:
15
+ build:
16
+ runs-on: ubuntu-latest
17
+ timeout-minutes: 20
18
+ steps:
19
+ - uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
20
+ - uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
21
+ - run: uv python install 3.12
22
+ - run: uv sync --locked
23
+ - name: The release tag must name the package version
24
+ run: test "$GITHUB_REF_NAME" = "v$(uv version --short)"
25
+ - name: The demo page the README links to must be live
26
+ run: curl --fail --silent --show-error --location --output /dev/null https://pedromarkovicz.github.io/tekmeria/
27
+ - run: uv run pytest
28
+ - run: uv build --out-dir dist
29
+ - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
30
+ with:
31
+ name: dist
32
+ path: dist/
33
+
34
+ publish:
35
+ needs: build
36
+ runs-on: ubuntu-latest
37
+ timeout-minutes: 20
38
+ environment:
39
+ name: pypi
40
+ url: https://pypi.org/project/tekmeria/
41
+ permissions:
42
+ id-token: write
43
+ steps:
44
+ - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
45
+ with:
46
+ name: dist
47
+ path: dist/
48
+ - uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
@@ -0,0 +1,30 @@
1
+ # Old project, kept locally for reference only
2
+ healthcare_mcp_codespaces/
3
+
4
+ # Python
5
+ __pycache__/
6
+ *.py[cod]
7
+ .venv/
8
+ .pytest_cache/
9
+ .hypothesis/
10
+ .ruff_cache/
11
+ .mypy_cache/
12
+ .coverage
13
+ htmlcov/
14
+ dist/
15
+ build/
16
+ *.egg-info/
17
+
18
+ # Node
19
+ node_modules/
20
+ web/dist/
21
+
22
+ # GitHub Pages build (pages workflow)
23
+ site/
24
+
25
+ # Local config and secrets
26
+ .env
27
+ *.key
28
+
29
+ # Working notes, kept locally
30
+ docs/plans/
@@ -0,0 +1 @@
1
+ 3.12
@@ -0,0 +1,15 @@
1
+ # Changelog
2
+
3
+ ## 0.1.0
4
+
5
+ The first release.
6
+
7
+ - **Tools.** Seven MCP tools: `search_literature` (PubMed and Europe PMC), `search_trials` (ClinicalTrials.gov), `search_drug_labels` (openFDA), `fetch_passages`, `resolve_handles`, `audit_answer` and `describe_contract`.
8
+ - **Handles.** Every passage carries a handle, `scheme:id[@version]/path~check`, whose check code is the first 25 bits of HMAC-SHA256 over the locator, under a key created once per installation.
9
+ - **Audit.** Each citation gets one verdict (`malformed`, `forged`, `unavailable`, `withdrawn`, `quote_mismatch` or `ok`) and flags (`retracted`, `preprint`, `version_changed`); each sentence a status; the answer metrics and an overall verdict. An answer passes only when every sentence is cited and every citation is valid.
10
+ - **Audit view.** Hosts that support MCP Apps render the report in an interactive view.
11
+ - **Offline demo.** `tekmeria demo` and `tekmeria --demo` run on recorded responses, with a public demo key.
12
+ - **Evaluation.** `tekmeria evaluate` plants citations in 34 categories: 1,600 audits and 257 whole answers, all correct. A fault harness and a mutation harness measure what the evaluation would miss.
13
+ - **Contract.** The citation contract, version 0.1.0, is in [docs/CONTRACT.md](docs/CONTRACT.md).
14
+
15
+ Known limits are listed in the README.
@@ -0,0 +1,26 @@
1
+ cff-version: 1.2.0
2
+ message: "If you use this software, please cite it using the metadata below."
3
+ type: software
4
+ title: tekmeria
5
+ abstract: >-
6
+ An MCP server for biomedical evidence from PubMed, Europe PMC, ClinicalTrials.gov and
7
+ openFDA. Every passage it returns carries a handle whose check code is a truncated keyed
8
+ MAC over the passage's locator, so the installation that issued it can tell a genuine
9
+ citation from a fabricated one, and a deterministic audit checks each citation of an
10
+ answer: malformed, forged, unavailable, withdrawn, misquoted or valid, with flags for
11
+ retracted, preprint and outdated sources.
12
+ authors:
13
+ - family-names: Markovicz
14
+ given-names: Pedro
15
+ orcid: "https://orcid.org/0009-0006-6878-793X"
16
+ version: 0.1.0
17
+ license: Apache-2.0
18
+ repository-code: "https://github.com/PedroMarkovicz/tekmeria"
19
+ url: "https://pedromarkovicz.github.io/tekmeria/"
20
+ keywords:
21
+ - mcp
22
+ - citations
23
+ - biomedical
24
+ - pubmed
25
+ - llm
26
+ - provenance
tekmeria-0.1.0/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
tekmeria-0.1.0/NOTICE ADDED
@@ -0,0 +1,36 @@
1
+ tekmeria
2
+ Copyright 2026 Pedro Markovicz
3
+
4
+ Licensed under the Apache License, Version 2.0 (see LICENSE).
5
+
6
+ Third-party data
7
+ ----------------
8
+
9
+ The recorded API responses in src/tekmeria/demo/fixtures/ are kept so that the demo
10
+ and the tests run offline. They are not covered by the Apache License; each keeps the
11
+ terms of its source:
12
+
13
+ - ClinicalTrials.gov (National Library of Medicine) and openFDA drug labels (Food
14
+ and Drug Administration): United States government data.
15
+ - Crossref metadata: bibliographic facts, which Crossref makes available without
16
+ restriction.
17
+ - PubMed and PubTator (National Library of Medicine): bibliographic records, and
18
+ abstracts only of the records the demo, the tests and the evaluation fetch and of
19
+ search results that Europe PMC lists as CC BY or CC0; the recorder removes every
20
+ other PubMed abstract. Abstracts remain under the copyright of their publishers or
21
+ authors.
22
+ - Europe PMC search results: an abstract is kept only when Europe PMC lists the
23
+ article under CC BY or CC0, or when the result is the lookup of a record the demo
24
+ or the evaluation fetches. The recorder removes every other abstract.
25
+ - Full text: Jiao B, Sato R, Mak J, et al. Financial risk protection from vaccines
26
+ in 52 Gavi-eligible low- and middle-income countries: a modeling study. PLoS
27
+ Medicine. 2025. doi:10.1371/journal.pmed.1004764. Licensed under CC BY 4.0
28
+ (https://creativecommons.org/licenses/by/4.0/), recorded unmodified from Europe
29
+ PMC (PMC12585062).
30
+ - Preprint: Garba A, Usman S, Hussaini A. Mapping immune targets in peste des petits
31
+ ruminants virus hemagglutinin: an integrated computational framework for vaccine
32
+ candidate prioritization. Research Square. 2026. doi:10.21203/rs.3.rs-10665898/v1.
33
+ Licensed under CC BY 4.0.
34
+
35
+ A rights holder who wants a recorded item removed can open an issue in the
36
+ repository.