geomend 0.0.1__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 (325) hide show
  1. geomend-0.0.1/.github/workflows/ci.yml +34 -0
  2. geomend-0.0.1/.github/workflows/docs.yml +30 -0
  3. geomend-0.0.1/.github/workflows/release.yml +68 -0
  4. geomend-0.0.1/.gitignore +14 -0
  5. geomend-0.0.1/AGENTS.md +23 -0
  6. geomend-0.0.1/ARCHITECTURE.md +182 -0
  7. geomend-0.0.1/CITATION.cff +12 -0
  8. geomend-0.0.1/CONTRIBUTING.md +133 -0
  9. geomend-0.0.1/LICENSE +21 -0
  10. geomend-0.0.1/PKG-INFO +226 -0
  11. geomend-0.0.1/README.md +148 -0
  12. geomend-0.0.1/codemeta.json +13 -0
  13. geomend-0.0.1/configs/README.md +11 -0
  14. geomend-0.0.1/configs/combiner.example.yaml +16 -0
  15. geomend-0.0.1/configs/dream-manifest.example.yaml +19 -0
  16. geomend-0.0.1/configs/dream.yaml +102 -0
  17. geomend-0.0.1/configs/gdc-development-policy-qwen35-v1.yaml +13 -0
  18. geomend-0.0.1/configs/gdc-sm.yaml +71 -0
  19. geomend-0.0.1/configs/policy.example.yaml +11 -0
  20. geomend-0.0.1/coverage.xml +25832 -0
  21. geomend-0.0.1/docs/accession-quickstart.md +32 -0
  22. geomend-0.0.1/docs/cli-contract.md +75 -0
  23. geomend-0.0.1/docs/cli-reference.md +1712 -0
  24. geomend-0.0.1/docs/cohort-acceptance.md +736 -0
  25. geomend-0.0.1/docs/cohort-convenience-review-2026-09-28.md +423 -0
  26. geomend-0.0.1/docs/cohort.md +664 -0
  27. geomend-0.0.1/docs/curation-contracts.md +167 -0
  28. geomend-0.0.1/docs/dual-perspective-audit-2026-09-26.json +147 -0
  29. geomend-0.0.1/docs/dual-perspective-audit-2026-09-26.md +111 -0
  30. geomend-0.0.1/docs/gui-review-plan.md +155 -0
  31. geomend-0.0.1/docs/human-review.md +14 -0
  32. geomend-0.0.1/docs/index.md +41 -0
  33. geomend-0.0.1/docs/local-table-quickstart.md +39 -0
  34. geomend-0.0.1/docs/long-running-convenience-results.md +170 -0
  35. geomend-0.0.1/docs/long-running-convenience-task.md +318 -0
  36. geomend-0.0.1/docs/manifest-reference.md +41 -0
  37. geomend-0.0.1/docs/metadata-representation-vocabulary.md +189 -0
  38. geomend-0.0.1/docs/native-review-export.md +88 -0
  39. geomend-0.0.1/docs/ontology-provenance.md +53 -0
  40. geomend-0.0.1/docs/reconciliation-outcomes.md +28 -0
  41. geomend-0.0.1/docs/releases.md +29 -0
  42. geomend-0.0.1/docs/reviewer-client-contract.md +420 -0
  43. geomend-0.0.1/docs/reviewer-protocol.md +226 -0
  44. geomend-0.0.1/docs/reviewer-tooling-issues.json +41 -0
  45. geomend-0.0.1/docs/reviewer-tooling-iteration.md +189 -0
  46. geomend-0.0.1/docs/reviewer-usability-pilot.md +201 -0
  47. geomend-0.0.1/docs/robots.txt +4 -0
  48. geomend-0.0.1/docs/schemas/capabilities.json +217 -0
  49. geomend-0.0.1/docs/schemas/capabilities.schema.json +76 -0
  50. geomend-0.0.1/docs/schemas/cohort-client.ts +284 -0
  51. geomend-0.0.1/docs/schemas/cohort-contracts.json +13025 -0
  52. geomend-0.0.1/docs/schemas/cohort-review-client.ts +478 -0
  53. geomend-0.0.1/docs/schemas/cohort-review.openapi.json +16113 -0
  54. geomend-0.0.1/docs/schemas/cohort.openapi.json +8817 -0
  55. geomend-0.0.1/docs/schemas/reconcile.schema.json +359 -0
  56. geomend-0.0.1/docs/schemas/review-derivation-policy.schema.json +113 -0
  57. geomend-0.0.1/docs/soft-quickstart.md +29 -0
  58. geomend-0.0.1/docs/troubleshooting.md +22 -0
  59. geomend-0.0.1/docs/validation.md +27 -0
  60. geomend-0.0.1/docs/workspace-review.md +122 -0
  61. geomend-0.0.1/examples/cohort/GSE900001_family.soft +17 -0
  62. geomend-0.0.1/examples/cohort/GSE900002_family.soft +12 -0
  63. geomend-0.0.1/examples/cohort/README.md +50 -0
  64. geomend-0.0.1/llms-full.txt +49 -0
  65. geomend-0.0.1/llms.txt +19 -0
  66. geomend-0.0.1/mkdocs.yml +41 -0
  67. geomend-0.0.1/pyproject.toml +178 -0
  68. geomend-0.0.1/research-notes/BAYESIAN_MAPPING.md +242 -0
  69. geomend-0.0.1/research-notes/LITERATURE_REVIEW.md +547 -0
  70. geomend-0.0.1/research-notes/PROMPT_ENGINEERING.md +144 -0
  71. geomend-0.0.1/scripts/generate_cohort_contracts.py +42 -0
  72. geomend-0.0.1/scripts/generate_discovery_artifacts.py +43 -0
  73. geomend-0.0.1/src/geomend/__init__.py +48 -0
  74. geomend-0.0.1/src/geomend/__main__.py +4 -0
  75. geomend-0.0.1/src/geomend/bayesian.py +1083 -0
  76. geomend-0.0.1/src/geomend/calibration.py +49 -0
  77. geomend-0.0.1/src/geomend/campaign.py +1449 -0
  78. geomend-0.0.1/src/geomend/campaign_audit.py +572 -0
  79. geomend-0.0.1/src/geomend/campaign_inference.py +2328 -0
  80. geomend-0.0.1/src/geomend/cli.py +1149 -0
  81. geomend-0.0.1/src/geomend/cohort.py +2840 -0
  82. geomend-0.0.1/src/geomend/cohort_annotations.py +194 -0
  83. geomend-0.0.1/src/geomend/cohort_api.py +772 -0
  84. geomend-0.0.1/src/geomend/cohort_cli.py +665 -0
  85. geomend-0.0.1/src/geomend/cohort_coarsening.py +155 -0
  86. geomend-0.0.1/src/geomend/cohort_code.py +277 -0
  87. geomend-0.0.1/src/geomend/cohort_codegen.py +175 -0
  88. geomend-0.0.1/src/geomend/cohort_comparables.py +68 -0
  89. geomend-0.0.1/src/geomend/cohort_concepts.py +1059 -0
  90. geomend-0.0.1/src/geomend/cohort_context.py +88 -0
  91. geomend-0.0.1/src/geomend/cohort_facets.py +97 -0
  92. geomend-0.0.1/src/geomend/cohort_inference.py +356 -0
  93. geomend-0.0.1/src/geomend/cohort_integrity.py +57 -0
  94. geomend-0.0.1/src/geomend/cohort_legacy.py +315 -0
  95. geomend-0.0.1/src/geomend/cohort_models.py +791 -0
  96. geomend-0.0.1/src/geomend/cohort_ordering.py +34 -0
  97. geomend-0.0.1/src/geomend/cohort_prepared.py +193 -0
  98. geomend-0.0.1/src/geomend/cohort_profile.py +452 -0
  99. geomend-0.0.1/src/geomend/cohort_providers.py +158 -0
  100. geomend-0.0.1/src/geomend/cohort_r_code.py +572 -0
  101. geomend-0.0.1/src/geomend/cohort_review.py +722 -0
  102. geomend-0.0.1/src/geomend/cohort_review_mapping.py +72 -0
  103. geomend-0.0.1/src/geomend/cohort_selection.py +435 -0
  104. geomend-0.0.1/src/geomend/cohort_transform.py +353 -0
  105. geomend-0.0.1/src/geomend/cohort_value_groups.py +85 -0
  106. geomend-0.0.1/src/geomend/combiner.py +816 -0
  107. geomend-0.0.1/src/geomend/curation.py +235 -0
  108. geomend-0.0.1/src/geomend/dense_retrieval.py +232 -0
  109. geomend-0.0.1/src/geomend/dev_cli.py +1260 -0
  110. geomend-0.0.1/src/geomend/discovery.py +206 -0
  111. geomend-0.0.1/src/geomend/dream.py +223 -0
  112. geomend-0.0.1/src/geomend/evaluation.py +1224 -0
  113. geomend-0.0.1/src/geomend/gdc.py +774 -0
  114. geomend-0.0.1/src/geomend/gdc_sm.py +396 -0
  115. geomend-0.0.1/src/geomend/geo.py +160 -0
  116. geomend-0.0.1/src/geomend/geo_adapters.py +423 -0
  117. geomend-0.0.1/src/geomend/geo_alignment.py +580 -0
  118. geomend-0.0.1/src/geomend/geo_alignment_campaign.py +181 -0
  119. geomend-0.0.1/src/geomend/geo_alignment_inference.py +625 -0
  120. geomend-0.0.1/src/geomend/geo_alignment_state.py +856 -0
  121. geomend-0.0.1/src/geomend/geo_bayesian.py +276 -0
  122. geomend-0.0.1/src/geomend/geo_campaign.py +449 -0
  123. geomend-0.0.1/src/geomend/geo_consumer.py +255 -0
  124. geomend-0.0.1/src/geomend/geo_evaluation.py +375 -0
  125. geomend-0.0.1/src/geomend/geo_evidence.py +604 -0
  126. geomend-0.0.1/src/geomend/geo_harm_analysis.py +172 -0
  127. geomend-0.0.1/src/geomend/geo_inference.py +401 -0
  128. geomend-0.0.1/src/geomend/geo_llm_ranking.py +2038 -0
  129. geomend-0.0.1/src/geomend/geo_llm_ranking_campaign.py +226 -0
  130. geomend-0.0.1/src/geomend/geo_mapping.py +2413 -0
  131. geomend-0.0.1/src/geomend/geo_policy.py +751 -0
  132. geomend-0.0.1/src/geomend/geo_profile.py +922 -0
  133. geomend-0.0.1/src/geomend/geo_prompt_rendering.py +103 -0
  134. geomend-0.0.1/src/geomend/geo_reasoning.py +317 -0
  135. geomend-0.0.1/src/geomend/geo_registry.py +108 -0
  136. geomend-0.0.1/src/geomend/geo_release.py +160 -0
  137. geomend-0.0.1/src/geomend/geo_workflow.py +104 -0
  138. geomend-0.0.1/src/geomend/gold.py +49 -0
  139. geomend-0.0.1/src/geomend/inference.py +190 -0
  140. geomend-0.0.1/src/geomend/interval_representation.py +144 -0
  141. geomend-0.0.1/src/geomend/model_base.py +14 -0
  142. geomend-0.0.1/src/geomend/model_qualification.py +876 -0
  143. geomend-0.0.1/src/geomend/models.py +1094 -0
  144. geomend-0.0.1/src/geomend/monitor.py +410 -0
  145. geomend-0.0.1/src/geomend/neighborhood.py +580 -0
  146. geomend-0.0.1/src/geomend/ollama_client.py +576 -0
  147. geomend-0.0.1/src/geomend/ontology.py +557 -0
  148. geomend-0.0.1/src/geomend/ontology_fetch.py +325 -0
  149. geomend-0.0.1/src/geomend/pipeline.py +2932 -0
  150. geomend-0.0.1/src/geomend/policy.py +1087 -0
  151. geomend-0.0.1/src/geomend/profile.py +595 -0
  152. geomend-0.0.1/src/geomend/profile_rows.py +85 -0
  153. geomend-0.0.1/src/geomend/profile_store.py +54 -0
  154. geomend-0.0.1/src/geomend/prompts.py +1869 -0
  155. geomend-0.0.1/src/geomend/ranking.py +575 -0
  156. geomend-0.0.1/src/geomend/reconcile.py +852 -0
  157. geomend-0.0.1/src/geomend/release.py +464 -0
  158. geomend-0.0.1/src/geomend/retrieval.py +862 -0
  159. geomend-0.0.1/src/geomend/review.py +50 -0
  160. geomend-0.0.1/src/geomend/review_archive.py +49 -0
  161. geomend-0.0.1/src/geomend/reviewer.py +154 -0
  162. geomend-0.0.1/src/geomend/reviewer_cli.py +97 -0
  163. geomend-0.0.1/src/geomend/reviewer_comparison.py +310 -0
  164. geomend-0.0.1/src/geomend/reviewer_evidence.py +94 -0
  165. geomend-0.0.1/src/geomend/reviewer_loop.py +37 -0
  166. geomend-0.0.1/src/geomend/reviewer_service.py +267 -0
  167. geomend-0.0.1/src/geomend/reviewer_telemetry.py +93 -0
  168. geomend-0.0.1/src/geomend/semantic_rules.py +209 -0
  169. geomend-0.0.1/src/geomend/storage.py +392 -0
  170. geomend-0.0.1/src/geomend/study_ids.py +37 -0
  171. geomend-0.0.1/src/geomend/table_pass.py +424 -0
  172. geomend-0.0.1/src/geomend/text.py +134 -0
  173. geomend-0.0.1/src/geomend/transformations.py +230 -0
  174. geomend-0.0.1/src/geomend/workspace.py +288 -0
  175. geomend-0.0.1/src/geomend/workspace_api.py +44 -0
  176. geomend-0.0.1/src/geomend/workspace_api_app.py +218 -0
  177. geomend-0.0.1/src/geomend/workspace_api_contract_common.py +26 -0
  178. geomend-0.0.1/src/geomend/workspace_api_coordinator.py +483 -0
  179. geomend-0.0.1/src/geomend/workspace_api_curation.py +68 -0
  180. geomend-0.0.1/src/geomend/workspace_api_derivation.py +88 -0
  181. geomend-0.0.1/src/geomend/workspace_api_events.py +53 -0
  182. geomend-0.0.1/src/geomend/workspace_api_evidence_contracts.py +180 -0
  183. geomend-0.0.1/src/geomend/workspace_api_meta.py +131 -0
  184. geomend-0.0.1/src/geomend/workspace_api_packet_contracts.py +322 -0
  185. geomend-0.0.1/src/geomend/workspace_api_review_model.py +752 -0
  186. geomend-0.0.1/src/geomend/workspace_api_reviewer.py +589 -0
  187. geomend-0.0.1/src/geomend/workspace_api_reviewer_contracts.py +736 -0
  188. geomend-0.0.1/src/geomend/workspace_api_reviewer_operations.py +70 -0
  189. geomend-0.0.1/src/geomend/workspace_api_support.py +225 -0
  190. geomend-0.0.1/src/geomend/workspace_audit.py +117 -0
  191. geomend-0.0.1/src/geomend/workspace_audit_import.py +266 -0
  192. geomend-0.0.1/src/geomend/workspace_builder.py +1711 -0
  193. geomend-0.0.1/src/geomend/workspace_cards.py +1368 -0
  194. geomend-0.0.1/src/geomend/workspace_comparison.py +227 -0
  195. geomend-0.0.1/src/geomend/workspace_curation.py +279 -0
  196. geomend-0.0.1/src/geomend/workspace_db.py +60 -0
  197. geomend-0.0.1/src/geomend/workspace_derivation.py +789 -0
  198. geomend-0.0.1/src/geomend/workspace_evidence.py +75 -0
  199. geomend-0.0.1/src/geomend/workspace_export.py +168 -0
  200. geomend-0.0.1/src/geomend/workspace_fork.py +34 -0
  201. geomend-0.0.1/src/geomend/workspace_frontier.py +78 -0
  202. geomend-0.0.1/src/geomend/workspace_identities.py +106 -0
  203. geomend-0.0.1/src/geomend/workspace_inheritance.py +185 -0
  204. geomend-0.0.1/src/geomend/workspace_ledger.py +558 -0
  205. geomend-0.0.1/src/geomend/workspace_lifecycle.py +729 -0
  206. geomend-0.0.1/src/geomend/workspace_mapping_proposals.py +109 -0
  207. geomend-0.0.1/src/geomend/workspace_materialization.py +823 -0
  208. geomend-0.0.1/src/geomend/workspace_models.py +466 -0
  209. geomend-0.0.1/src/geomend/workspace_packets.py +1117 -0
  210. geomend-0.0.1/src/geomend/workspace_paths.py +76 -0
  211. geomend-0.0.1/src/geomend/workspace_portability.py +84 -0
  212. geomend-0.0.1/src/geomend/workspace_review.py +260 -0
  213. geomend-0.0.1/src/geomend/workspace_review_service.py +311 -0
  214. geomend-0.0.1/src/geomend/workspace_schema.py +68 -0
  215. geomend-0.0.1/src/geomend/workspace_state.py +94 -0
  216. geomend-0.0.1/src/geomend/workspace_support.py +20 -0
  217. geomend-0.0.1/src/geomend/workspace_views.py +703 -0
  218. geomend-0.0.1/tests/test_bayesian.py +371 -0
  219. geomend-0.0.1/tests/test_bayesian_contracts.py +113 -0
  220. geomend-0.0.1/tests/test_bayesian_evaluation.py +196 -0
  221. geomend-0.0.1/tests/test_bayesian_pipeline.py +133 -0
  222. geomend-0.0.1/tests/test_biology_v2.py +42 -0
  223. geomend-0.0.1/tests/test_calibration_review.py +27 -0
  224. geomend-0.0.1/tests/test_campaign.py +630 -0
  225. geomend-0.0.1/tests/test_campaign_audit.py +277 -0
  226. geomend-0.0.1/tests/test_campaign_inference.py +937 -0
  227. geomend-0.0.1/tests/test_campaign_table_pass.py +338 -0
  228. geomend-0.0.1/tests/test_cli_human_ux.py +296 -0
  229. geomend-0.0.1/tests/test_cohort.py +443 -0
  230. geomend-0.0.1/tests/test_cohort_api.py +166 -0
  231. geomend-0.0.1/tests/test_cohort_attached_concept_evidence.py +234 -0
  232. geomend-0.0.1/tests/test_cohort_attribute_result_role.py +31 -0
  233. geomend-0.0.1/tests/test_cohort_coarsening.py +154 -0
  234. geomend-0.0.1/tests/test_cohort_code.py +420 -0
  235. geomend-0.0.1/tests/test_cohort_comparables.py +183 -0
  236. geomend-0.0.1/tests/test_cohort_concept_snapshot.py +39 -0
  237. geomend-0.0.1/tests/test_cohort_concept_status.py +37 -0
  238. geomend-0.0.1/tests/test_cohort_concepts.py +762 -0
  239. geomend-0.0.1/tests/test_cohort_context.py +148 -0
  240. geomend-0.0.1/tests/test_cohort_context_retrieval.py +63 -0
  241. geomend-0.0.1/tests/test_cohort_convenience.py +255 -0
  242. geomend-0.0.1/tests/test_cohort_convenience_roles.py +116 -0
  243. geomend-0.0.1/tests/test_cohort_definition_retrieval.py +47 -0
  244. geomend-0.0.1/tests/test_cohort_encoding.py +147 -0
  245. geomend-0.0.1/tests/test_cohort_geo_declared_units.py +62 -0
  246. geomend-0.0.1/tests/test_cohort_inference.py +366 -0
  247. geomend-0.0.1/tests/test_cohort_interchange.py +49 -0
  248. geomend-0.0.1/tests/test_cohort_label_equivalence.py +53 -0
  249. geomend-0.0.1/tests/test_cohort_legacy_v4.py +60 -0
  250. geomend-0.0.1/tests/test_cohort_ordering.py +20 -0
  251. geomend-0.0.1/tests/test_cohort_query_provenance.py +40 -0
  252. geomend-0.0.1/tests/test_cohort_recovery.py +339 -0
  253. geomend-0.0.1/tests/test_cohort_refinement.py +488 -0
  254. geomend-0.0.1/tests/test_cohort_release_status.py +30 -0
  255. geomend-0.0.1/tests/test_cohort_review_mapping.py +65 -0
  256. geomend-0.0.1/tests/test_cohort_transform_cache.py +44 -0
  257. geomend-0.0.1/tests/test_cohort_transport_conformance.py +360 -0
  258. geomend-0.0.1/tests/test_cohort_value_groups.py +136 -0
  259. geomend-0.0.1/tests/test_combiner.py +114 -0
  260. geomend-0.0.1/tests/test_combiner_cli.py +64 -0
  261. geomend-0.0.1/tests/test_combiner_contracts.py +260 -0
  262. geomend-0.0.1/tests/test_combiner_runtime.py +130 -0
  263. geomend-0.0.1/tests/test_curation.py +375 -0
  264. geomend-0.0.1/tests/test_direct_merge_gate.py +37 -0
  265. geomend-0.0.1/tests/test_discovery.py +87 -0
  266. geomend-0.0.1/tests/test_distribution_surface.py +39 -0
  267. geomend-0.0.1/tests/test_dream.py +71 -0
  268. geomend-0.0.1/tests/test_dual_review_contract.py +202 -0
  269. geomend-0.0.1/tests/test_end_to_end.py +102 -0
  270. geomend-0.0.1/tests/test_excerpt_selection.py +65 -0
  271. geomend-0.0.1/tests/test_gdc.py +131 -0
  272. geomend-0.0.1/tests/test_gdc_sm.py +70 -0
  273. geomend-0.0.1/tests/test_geo.py +73 -0
  274. geomend-0.0.1/tests/test_geo_adapters.py +126 -0
  275. geomend-0.0.1/tests/test_geo_alignment.py +51 -0
  276. geomend-0.0.1/tests/test_geo_alignment_campaign.py +57 -0
  277. geomend-0.0.1/tests/test_geo_alignment_inference.py +148 -0
  278. geomend-0.0.1/tests/test_geo_alignment_state.py +161 -0
  279. geomend-0.0.1/tests/test_geo_binary_prompt_cache.py +67 -0
  280. geomend-0.0.1/tests/test_geo_column_reconciliation.py +219 -0
  281. geomend-0.0.1/tests/test_geo_consumer.py +123 -0
  282. geomend-0.0.1/tests/test_geo_mapping.py +495 -0
  283. geomend-0.0.1/tests/test_geo_profile.py +299 -0
  284. geomend-0.0.1/tests/test_geo_upgrade.py +1021 -0
  285. geomend-0.0.1/tests/test_geo_workflow.py +101 -0
  286. geomend-0.0.1/tests/test_graph_retrieval_evaluation.py +167 -0
  287. geomend-0.0.1/tests/test_inference_engineering.py +405 -0
  288. geomend-0.0.1/tests/test_interval_representation.py +214 -0
  289. geomend-0.0.1/tests/test_model_qualification.py +501 -0
  290. geomend-0.0.1/tests/test_monitor.py +228 -0
  291. geomend-0.0.1/tests/test_native_synthesis.py +228 -0
  292. geomend-0.0.1/tests/test_ollama_client.py +139 -0
  293. geomend-0.0.1/tests/test_ollama_live.py +56 -0
  294. geomend-0.0.1/tests/test_ollama_runtime_guard.py +74 -0
  295. geomend-0.0.1/tests/test_ontology_fetch.py +123 -0
  296. geomend-0.0.1/tests/test_ontology_prompt.py +739 -0
  297. geomend-0.0.1/tests/test_overflow_rescue.py +231 -0
  298. geomend-0.0.1/tests/test_package_architecture.py +60 -0
  299. geomend-0.0.1/tests/test_pairwise.py +825 -0
  300. geomend-0.0.1/tests/test_policy.py +126 -0
  301. geomend-0.0.1/tests/test_prompt_v64.py +231 -0
  302. geomend-0.0.1/tests/test_prompt_v65.py +199 -0
  303. geomend-0.0.1/tests/test_ranking.py +93 -0
  304. geomend-0.0.1/tests/test_reconcile.py +503 -0
  305. geomend-0.0.1/tests/test_record_pagination.py +322 -0
  306. geomend-0.0.1/tests/test_release.py +273 -0
  307. geomend-0.0.1/tests/test_rescue.py +94 -0
  308. geomend-0.0.1/tests/test_retrieval.py +377 -0
  309. geomend-0.0.1/tests/test_review_assignments.py +147 -0
  310. geomend-0.0.1/tests/test_reviewed_export_semantics.py +160 -0
  311. geomend-0.0.1/tests/test_reviewer_candidate_actionability.py +244 -0
  312. geomend-0.0.1/tests/test_reviewer_comparison.py +447 -0
  313. geomend-0.0.1/tests/test_reviewer_complete_judgment_cli.py +90 -0
  314. geomend-0.0.1/tests/test_reviewer_sdk_contract.py +1923 -0
  315. geomend-0.0.1/tests/test_routing_plan.py +194 -0
  316. geomend-0.0.1/tests/test_semantic_rules.py +14 -0
  317. geomend-0.0.1/tests/test_table_pass.py +345 -0
  318. geomend-0.0.1/tests/test_text_profile.py +328 -0
  319. geomend-0.0.1/tests/test_transformations.py +170 -0
  320. geomend-0.0.1/tests/test_workspace.py +1306 -0
  321. geomend-0.0.1/tests/test_workspace_api.py +607 -0
  322. geomend-0.0.1/tests/test_workspace_api_review_model.py +730 -0
  323. geomend-0.0.1/tests/test_workspace_architecture.py +116 -0
  324. geomend-0.0.1/tests/test_workspace_quality_gates.py +150 -0
  325. geomend-0.0.1/uv.lock +4255 -0
@@ -0,0 +1,34 @@
1
+ name: CI
2
+ on:
3
+ push:
4
+ pull_request:
5
+ jobs:
6
+ test:
7
+ strategy:
8
+ matrix:
9
+ os: [ubuntu-latest, macos-latest]
10
+ runs-on: ${{ matrix.os }}
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ - uses: astral-sh/setup-uv@v6
14
+ with:
15
+ python-version: '3.13'
16
+ - run: uv sync --frozen --group dev --extra cohort --extra reconcile --extra ontology --extra server
17
+ - run: uv run ruff check
18
+ - run: uv run mypy
19
+ - run: uv run pytest --cov=geomend --cov-branch --cov-report=term-missing --cov-report=xml
20
+ - run: uv run geomend capabilities --json
21
+ - run: uv run python scripts/generate_discovery_artifacts.py
22
+ - run: git diff --exit-code -- docs/schemas
23
+ - run: uv build
24
+ - run: uv tool run --from dist/*.whl geomend version --json
25
+ - run: uv run --python 3.13 --isolated --no-project --with dist/*.whl python -c "from geomend.workspace_materialization import materialize; assert callable(materialize)"
26
+ docs:
27
+ runs-on: ubuntu-latest
28
+ steps:
29
+ - uses: actions/checkout@v4
30
+ - uses: astral-sh/setup-uv@v6
31
+ with:
32
+ python-version: '3.13'
33
+ - run: uv sync --frozen --group docs
34
+ - run: uv run mkdocs build --strict
@@ -0,0 +1,30 @@
1
+ name: Documentation
2
+ on:
3
+ push:
4
+ branches: [main]
5
+ permissions:
6
+ contents: read
7
+ pages: write
8
+ id-token: write
9
+ concurrency:
10
+ group: pages
11
+ cancel-in-progress: true
12
+ jobs:
13
+ deploy:
14
+ environment:
15
+ name: github-pages
16
+ url: ${{ steps.deployment.outputs.page_url }}
17
+ runs-on: ubuntu-latest
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+ - uses: astral-sh/setup-uv@v6
21
+ with:
22
+ python-version: '3.13'
23
+ - run: uv sync --frozen --group docs
24
+ - run: uv run mkdocs build --strict
25
+ - uses: actions/configure-pages@v5
26
+ - uses: actions/upload-pages-artifact@v3
27
+ with:
28
+ path: site
29
+ - id: deployment
30
+ uses: actions/deploy-pages@v4
@@ -0,0 +1,68 @@
1
+ name: Release
2
+ on:
3
+ push:
4
+ tags: ['v*']
5
+ permissions:
6
+ contents: read
7
+ jobs:
8
+ build:
9
+ runs-on: ubuntu-latest
10
+ permissions:
11
+ contents: read
12
+ id-token: write
13
+ attestations: write
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+ - uses: astral-sh/setup-uv@v6
17
+ with:
18
+ python-version: '3.13'
19
+ - run: test "$GITHUB_REF_NAME" = "v$(uv version --short)"
20
+ - run: uv sync --frozen --group dev --extra cohort --extra reconcile --extra ontology --extra server
21
+ - run: uv run ruff check
22
+ - run: uv run mypy
23
+ - run: uv run pytest --cov=geomend --cov-branch --cov-report=term-missing --cov-report=xml
24
+ - run: uv run python scripts/generate_discovery_artifacts.py
25
+ - run: uv build --no-sources
26
+ - run: uv run --python 3.13 --isolated --no-project --with "./dist/geomend-$(uv version --short)-py3-none-any.whl" python -c "from geomend.workspace_materialization import materialize; assert callable(materialize)"
27
+ - run: cp docs/schemas/*.json dist/
28
+ - run: cd dist && sha256sum * > SHA256SUMS
29
+ - uses: actions/attest-build-provenance@v2
30
+ if: ${{ !github.event.repository.private }}
31
+ with:
32
+ subject-path: 'dist/*'
33
+ - uses: actions/upload-artifact@v4
34
+ with:
35
+ name: release-dist
36
+ path: dist/
37
+ if-no-files-found: error
38
+
39
+ publish:
40
+ needs: build
41
+ runs-on: ubuntu-latest
42
+ environment:
43
+ name: pypi
44
+ url: https://pypi.org/p/geomend
45
+ permissions:
46
+ id-token: write
47
+ steps:
48
+ - uses: astral-sh/setup-uv@v6
49
+ - uses: actions/download-artifact@v4
50
+ with:
51
+ name: release-dist
52
+ path: dist/
53
+ - run: uv publish dist/*.whl dist/*.tar.gz
54
+
55
+ github-release:
56
+ needs: build
57
+ runs-on: ubuntu-latest
58
+ permissions:
59
+ contents: write
60
+ steps:
61
+ - uses: actions/download-artifact@v4
62
+ with:
63
+ name: release-dist
64
+ path: dist/
65
+ - uses: softprops/action-gh-release@v2
66
+ with:
67
+ generate_release_notes: true
68
+ files: dist/*
@@ -0,0 +1,14 @@
1
+ .geomend/
2
+ geomend-output/
3
+ .venv/
4
+ .pytest_cache/
5
+ __pycache__/
6
+ .coverage
7
+ site/
8
+ dist/
9
+ build/
10
+ *.egg-info/
11
+ *.sqlite
12
+ *.joblib
13
+ *.npz
14
+ .DS_Store
@@ -0,0 +1,23 @@
1
+ # GEOmend repository discovery
2
+
3
+ Use the same public workflow and decision semantics provided to every reviewer.
4
+ The canonical instructions are in [`docs/reviewer-protocol.md`](docs/reviewer-protocol.md).
5
+
6
+ Begin with:
7
+
8
+ ```bash
9
+ command -v geomend
10
+ # Installed release:
11
+ geomend capabilities --json
12
+ # Source-checkout fallback (run from the GEOmend repository root only):
13
+ cd /path/to/geomend
14
+ uv run --no-dev geomend capabilities --json
15
+ ```
16
+
17
+ Outside the repository, install the release wheel or invoke the checkout's absolute
18
+ `.venv/bin/geomend` executable. Do not assume `uv run` can discover GEOmend from a
19
+ review-packet directory. Use the same working invocation for later commands.
20
+
21
+ Never edit workspace SQLite files, review responses, or source metadata directly.
22
+ Use `geomend reconcile plan` before creating a workspace and use the review CLI
23
+ or authenticated API for every decision.
@@ -0,0 +1,182 @@
1
+ # GEOmend architecture
2
+
3
+ This document gives a new contributor the shortest complete mental model of the
4
+ system. Statistical rationale and historical design research live in
5
+ [`research-notes/BAYESIAN_MAPPING.md`](research-notes/BAYESIAN_MAPPING.md), while
6
+ the public validation boundary is documented in
7
+ [`docs/validation.md`](docs/validation.md).
8
+
9
+ The stable product boundary is intentionally smaller than the research engine.
10
+ Users enter through `geomend reconcile`, review through the flat workspace, and
11
+ export only reviewed mappings. Experimental retrieval, ranking, calibration,
12
+ and benchmark commands are isolated under `geomend dev`.
13
+
14
+ ## The decision pipeline
15
+
16
+ ```text
17
+ pinned ontology/registry + dataset manifest
18
+ |
19
+ v
20
+ immutable column profiles
21
+ |
22
+ v
23
+ fielded lexical candidate union
24
+ |
25
+ v
26
+ deterministic evidence + reverse specificity
27
+ |
28
+ +---------+----------+
29
+ | |
30
+ v v
31
+ lexical shadow all eligible GEO fields -> local LLM
32
+ | |
33
+ +---------+----------+
34
+ v
35
+ grouped fitted combiner
36
+ |
37
+ v
38
+ preference -> adequacy -> overflow/rescue
39
+ |
40
+ v
41
+ flat pending-review workspace
42
+ ```
43
+
44
+ The LLM does not generate a target ID or a final confidence score. It compares
45
+ already retrieved candidates using first-token probabilities. The grouped
46
+ combiner measures whether that semantic residual helps after deterministic
47
+ evidence is already known.
48
+
49
+ ## Two mapping domains
50
+
51
+ ### Registry/CDE mapping
52
+
53
+ The selectable answer is a registry record such as a caDSR CDE. Ontology nodes
54
+ and NCIt concepts provide semantic anchors and graph context; they are not
55
+ automatically interchangeable with selectable CDEs. DREAM, the synthetic GDC
56
+ regression corpus, and GDC-SM use this path.
57
+
58
+ ### Direct ontology-term mapping
59
+
60
+ GEO profiles can be mapped against a pinned local ontology whose eligible graph
61
+ nodes are projected into selectable targets. This path has a separate response
62
+ contract because a GEO field-to-term suggestion is not a caDSR CDE assignment.
63
+
64
+ ## Stages and ownership
65
+
66
+ ### 1. Ingestion
67
+
68
+ `ontology.py` parses graph nodes, typed edges, synonyms, definitions,
69
+ deprecations, replacements, and selectable targets into SQLite. Adapters in
70
+ `dream.py`, `gdc_sm.py`, and `geo_mapping.py` translate source-specific formats.
71
+ Sparse retrieval matrices are stored separately and tied to the ontology hash.
72
+
73
+ ### 2. Profiling
74
+
75
+ `profile.py` preserves raw names and values while producing normalized retrieval
76
+ views, datatypes, missingness classes, categorical distributions, numeric shape,
77
+ units, and table context. `neighborhood.py` creates compact aggregate
78
+ relationships and semantic neighbors. GEO metadata are public; aggregation is
79
+ used to control prompt noise and size, not to imply confidentiality. Physical
80
+ adjacency is weak fallback evidence, not the definition of relevance.
81
+
82
+ ### 3. Retrieval
83
+
84
+ `retrieval.py` runs independent header, semantic-facet, acronym, value-domain,
85
+ and low-weight table-context channels. It preserves the top candidates from each
86
+ channel, fuses the remainder deterministically, records the uncapped union, and
87
+ caps the selectable prompt pool. Retrieval recall is evaluated independently of
88
+ ranking.
89
+
90
+ ### 4. Deterministic and reverse evidence
91
+
92
+ `bayesian.py` and `ranking.py` compute header, value, datatype, unit/range,
93
+ semantic-slot, and contradiction evidence. Each candidate also asks the reverse
94
+ question: if this candidate were correct, is the focal field its best realization
95
+ in the table, or does a semantically comparable column fit better?
96
+
97
+ ### 5. LLM evidence
98
+
99
+ `prompts.py` builds the versioned generic ontology-mapping prompt contract;
100
+ `geo_inference.py` builds the GEO-specific contract. Both use symmetric,
101
+ equal-budget candidate evidence, permit repeated legitimate mappings, hide
102
+ target IDs, and ask whether observations are better explained by Candidate A or
103
+ Candidate B. GEO inference routes every pairwise-eligible field when enabled;
104
+ verified source bindings remain protected and every result retains its lexical
105
+ shadow. `ollama_client.py` calls only a loopback native Ollama endpoint and
106
+ extracts token log probabilities.
107
+
108
+ Reciprocal scoring produces one semantic evidence term and an inconsistency
109
+ measure. Missing valid-token mass, unstable reruns, excessive inconsistency, or
110
+ an unavailable model makes the comparison unscorable.
111
+
112
+ ### 6. Grouped combiner
113
+
114
+ `combiner.py` fits two otherwise identical no-intercept L2 logistic models on
115
+ whole-study folds: deterministic/reverse evidence only, and the same vector plus
116
+ the reciprocal LLM logit. Fold-local imputation, scaling, model selection, and
117
+ out-of-fold calibration prevent information leakage. The augmented model is
118
+ usable only when the LLM coefficient is stable and improves held-out fit and
119
+ ranking.
120
+
121
+ ### 7. Runtime decisions
122
+
123
+ Candidate preference is aggregated over pairwise comparisons. Adequacy compares
124
+ the tentative winner with an explicit `NOMATCH`. Shortlist sufficiency decides
125
+ whether to examine deterministic overflow and then one-hop graph rescue. These
126
+ heads are not derived from a candidate softmax because one candidate always wins
127
+ a closed-set softmax.
128
+
129
+ Any unsafe condition restores the original lexical result. A conservative
130
+ table-level second pass may update ambiguous columns once using high-confidence
131
+ anchors; it cannot propagate indefinitely.
132
+
133
+ An exact source/candidate name is never schema authority. Only a verified,
134
+ pinned source-to-standard binding can protect a mapping from residual reranking.
135
+ Literal disagreement between linked records is recorded for review and becomes
136
+ a negative semantic feature only when normalization establishes incompatible
137
+ propositions.
138
+
139
+ ### 8. Artifacts and review
140
+
141
+ `storage.py` writes versioned JSONL and model manifests atomically. The public
142
+ review boundary is the flat workspace in `workspace.py`: candidate rankings are
143
+ stored once, opinion sets and reviews are append-only, and snapshots select a
144
+ coherent perspective without copying evidence. `workspace_api.py` provides the
145
+ authenticated loopback API. A run records profiles, candidates, relations,
146
+ probabilities, pairwise features, combiner decisions, suggestions, value
147
+ mappings, and lexical shadows.
148
+
149
+ Multi-target gold and review assignments are supported. Automatic semantic
150
+ relations such as `co_required` remain disabled until relation-labelled evidence
151
+ is sufficiently powered.
152
+
153
+ ## Releases and benchmarks
154
+
155
+ `release.py` seals immutable engine bundles and maintains an atomic active
156
+ pointer. A run pins the active release when it is created. `campaign.py` evaluates
157
+ frozen contenders and may activate a hybrid only after every promotion gate
158
+ passes; rollback changes the pointer, never historical artifacts.
159
+
160
+ Benchmark roles are deliberately different:
161
+
162
+ - GDC-SM: primary public development and comparison benchmark;
163
+ - independent GEO cohorts: real-data development and prediction-blind
164
+ promotion evidence maintained outside this product repository;
165
+ - synthetic GDC schema: regression and controlled-ablation asset only;
166
+ - DREAM: independent challenge evaluation when authorized files are available.
167
+
168
+ Public or previously inspected gold cannot become locked promotion evidence.
169
+
170
+ ## Deliberately unsupported in this release
171
+
172
+ - remote inference;
173
+ - automatic application of mappings to source tables;
174
+ - recursive graph traversal;
175
+ - raw-row prompt context;
176
+ - a production-default embedding or cross-encoder retriever (local dense
177
+ retrieval remains an explicitly enabled development channel);
178
+ - global joint table optimization;
179
+ - automatic `co_required` emission.
180
+
181
+ Additions in these areas require a separate evidence and privacy review rather
182
+ than being slipped into an existing configuration.
@@ -0,0 +1,12 @@
1
+ cff-version: 1.2.0
2
+ message: "If you use GEOmend, cite this software release."
3
+ title: "GEOmend"
4
+ type: software
5
+ version: 0.2.0
6
+ date-released: 2026-09-25
7
+ authors:
8
+ - family-names: Raab
9
+ given-names: Preston
10
+ repository-code: "https://github.com/prestonraab/geomend"
11
+ url: "https://prestonraab.github.io/geomend/"
12
+ license: MIT
@@ -0,0 +1,133 @@
1
+ # Contributing to GEOmend
2
+
3
+ This guide assumes you have not worked on GEOmend before. The system is designed
4
+ for scientific auditability, so a behavior change is incomplete until its
5
+ evidence contract, test, and documentation agree.
6
+
7
+ ## Development setup
8
+
9
+ From the `geomend/` directory:
10
+
11
+ ```bash
12
+ uv sync --group dev --extra reconcile --extra ontology --extra server
13
+ uv run ruff check
14
+ uv run mypy
15
+ uv run pytest
16
+ uv run geomend --help
17
+ ```
18
+
19
+ Python 3.13 is required. The ordinary test suite uses mocked model responses and
20
+ does not require network access or Ollama. Run local-model smoke tests only when
21
+ you intentionally have a compatible Ollama server and model.
22
+
23
+ ## Non-negotiable invariants
24
+
25
+ - Every mapping is a suggestion marked `pending_review`.
26
+ - Model inference is local and loopback-only. Papers and metadata must never be
27
+ sent to a remote inference endpoint.
28
+ - The lexical decision is retained as a shadow result for every hybrid decision.
29
+ - Missing, malformed, inconsistent, or digest-mismatched model evidence falls
30
+ back to lexical behavior.
31
+ - LLM token probabilities are evidence, not self-reported confidence and not a
32
+ calibrated posterior by themselves.
33
+ - Candidate preference, adequacy versus `NOMATCH`, and shortlist sufficiency are
34
+ separate statistical questions.
35
+ - Raw aligned row tuples never enter prompts. Public GEO values may be retained
36
+ in evidence artifacts and summarized in prompt cards when relevant;
37
+ aggregation is for signal quality and token efficiency, not confidentiality.
38
+ - Registry IDs are hidden from model-visible prompts.
39
+ - Explicit qualifier and unit contradictions are hard vetoes.
40
+ - Evaluation splits are by complete study/table. Do not leak schema-local names,
41
+ target aliases, review labels, or public gold across folds.
42
+ - Serialized artifacts are immutable and hash-linked. Extend Pydantic contracts
43
+ with safe defaults so older JSONL remains readable.
44
+
45
+ ## Where a change belongs
46
+
47
+ | Change | Primary locations |
48
+ |---|---|
49
+ | Data contracts | `src/geomend/models.py` and contract tests |
50
+ | Dataset profiling | `profile.py`, `neighborhood.py`, and profile tests |
51
+ | Ontology/registry ingestion | `ontology.py`, `dream.py`, `gdc_sm.py`, or `geo_mapping.py` |
52
+ | Retrieval channel or fusion | `retrieval.py`, configuration, retrieval tests |
53
+ | Prompt/context engineering | `prompts.py`, prompt snapshots and symmetry tests |
54
+ | Ollama protocol | `ollama_client.py`, `model_qualification.py`, mocked contract tests |
55
+ | Fitted residual evidence | `combiner.py`, CLI configuration, grouped-fold tests |
56
+ | Runtime decision/fallback | `pipeline.py`, `ranking.py`, end-to-end tests |
57
+ | Review and adjudication | `review.py`, review round-trip tests |
58
+ | Promotion/release behavior | `campaign.py`, `release.py`, monitor and gate tests |
59
+ | Workspace contracts and persistence | `workspace_models.py`, `workspace_db.py`, `workspace_schema.py` |
60
+ | Workspace review services | focused `workspace_*.py` modules; keep `workspace.py` as a compatibility facade |
61
+
62
+ ## Workspace maintainability gates
63
+
64
+ Workspace changes must pass three independent checks before the behavior tests:
65
+
66
+ ```bash
67
+ uv run ruff check
68
+ uv run mypy
69
+ uv run pytest tests/test_workspace_architecture.py tests/test_workspace_quality_gates.py
70
+ ```
71
+
72
+ Ruff and strict mypy cover every `workspace*.py` module listed by the glob in
73
+ `pyproject.toml`. The architecture tests cover every extracted workspace
74
+ service. They reject HTTP dependencies in the domain, persistence modules that
75
+ reach upward into services, dependency cycles, and functions over 150 lines or
76
+ complexity 50. Add new workspace modules under the same prefix so they enter
77
+ these gates automatically.
78
+
79
+ ## Changing prompts safely
80
+
81
+ 1. Bump the prompt-template version.
82
+ 2. Keep candidate-independent bytes invariant across reciprocal orders.
83
+ 3. Give candidates equal budgets and hide real target IDs.
84
+ 4. Keep data quoted as untrusted evidence, never as instructions.
85
+ 5. Add or update snapshot, ID-hiding, and reciprocal-symmetry tests.
86
+ 6. Treat prior model qualification and calibration as incompatible unless the
87
+ versioned contract proves otherwise.
88
+ 7. Document experimental rationale in
89
+ `research-notes/PROMPT_ENGINEERING.md` and any stable behavior change in the
90
+ public documentation.
91
+
92
+ ## Changing retrieval safely
93
+
94
+ Retrieval determines candidate membership and must remain distinguishable from
95
+ LLM reranking gains. Store the full union as well as the capped pool, use stable
96
+ target-ID tie breaking, and report recall before ranking accuracy. Never add a
97
+ held-out source property's name as a target alias.
98
+
99
+ When comparing an LLM contender with the baseline, freeze candidate membership,
100
+ order, registry release, and retrieval configuration. Otherwise the experiment
101
+ cannot attribute gains to model evidence.
102
+
103
+ ## Working with data and models
104
+
105
+ The local `data/` directory is ignored. Put downloaded GDC-SM, DREAM, and GEO
106
+ source material there. Do not redistribute controlled DREAM files,
107
+ publisher supplements, model weights, or human review packets unless their terms
108
+ explicitly permit it.
109
+
110
+ Run workspaces (`.geomend*`), `artifacts/`, `*.sqlite`, `*.joblib`, and `*.npz`
111
+ are ignored. Checked-in configuration must use relative paths and must pin source
112
+ versions and hashes where the workflow supports them.
113
+
114
+ ## Before handing off a change
115
+
116
+ Run the narrow tests while developing, then the full suite:
117
+
118
+ ```bash
119
+ uv run pytest tests/test_relevant_module.py
120
+ uv run ruff check
121
+ uv run mypy
122
+ uv run pytest
123
+ git diff --check
124
+ ```
125
+
126
+ In the handoff, report:
127
+
128
+ - the behavior and contract that changed;
129
+ - the tests and benchmark slices that ran;
130
+ - whether Ollama, network access, or non-public data was required;
131
+ - whether the public v0.2 contracts changed and whether regeneration is
132
+ required (pre-v0.2 workspaces are rejected rather than migrated);
133
+ - whether the change is production-default, canary-only, or experimental.
geomend-0.0.1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Preston Raab
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.