pretensor 0.1.0a0__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 (293) hide show
  1. pretensor-0.1.0a0/.env.example +0 -0
  2. pretensor-0.1.0a0/.gitattributes +2 -0
  3. pretensor-0.1.0a0/.github/CODEOWNERS +2 -0
  4. pretensor-0.1.0a0/.github/ISSUE_TEMPLATE/bug_report.yml +110 -0
  5. pretensor-0.1.0a0/.github/ISSUE_TEMPLATE/config.yml +8 -0
  6. pretensor-0.1.0a0/.github/ISSUE_TEMPLATE/feature_request.yml +57 -0
  7. pretensor-0.1.0a0/.github/dependabot.yml +49 -0
  8. pretensor-0.1.0a0/.github/pull_request_template.md +15 -0
  9. pretensor-0.1.0a0/.github/workflows/ci.yml +73 -0
  10. pretensor-0.1.0a0/.github/workflows/e2e.yml +47 -0
  11. pretensor-0.1.0a0/.gitignore +63 -0
  12. pretensor-0.1.0a0/.gitlint +19 -0
  13. pretensor-0.1.0a0/.pre-commit-config.yaml +21 -0
  14. pretensor-0.1.0a0/.python-version +1 -0
  15. pretensor-0.1.0a0/CHANGELOG.md +20 -0
  16. pretensor-0.1.0a0/CODE_OF_CONDUCT.md +84 -0
  17. pretensor-0.1.0a0/CONTRIBUTING.md +169 -0
  18. pretensor-0.1.0a0/LICENSE +21 -0
  19. pretensor-0.1.0a0/Makefile +68 -0
  20. pretensor-0.1.0a0/PKG-INFO +175 -0
  21. pretensor-0.1.0a0/README.md +109 -0
  22. pretensor-0.1.0a0/SECURITY.md +63 -0
  23. pretensor-0.1.0a0/docker/quickstart/README.md +27 -0
  24. pretensor-0.1.0a0/docker/quickstart/docker-compose.yml +18 -0
  25. pretensor-0.1.0a0/guides/quickstart.md +324 -0
  26. pretensor-0.1.0a0/pyproject.toml +128 -0
  27. pretensor-0.1.0a0/scripts/audit_deny_list.py +148 -0
  28. pretensor-0.1.0a0/scripts/benchmark_graph_rag_nl2sql.py +335 -0
  29. pretensor-0.1.0a0/scripts/data/pagila_nl2sql_bench.json +52 -0
  30. pretensor-0.1.0a0/scripts/e2e_pagila.py +625 -0
  31. pretensor-0.1.0a0/src/pretensor/__init__.py +50 -0
  32. pretensor-0.1.0a0/src/pretensor/cli/__init__.py +1 -0
  33. pretensor-0.1.0a0/src/pretensor/cli/commands/connections/__init__.py +7 -0
  34. pretensor-0.1.0a0/src/pretensor/cli/commands/connections/add_remove.py +122 -0
  35. pretensor-0.1.0a0/src/pretensor/cli/commands/connections/register.py +12 -0
  36. pretensor-0.1.0a0/src/pretensor/cli/commands/export.py +120 -0
  37. pretensor-0.1.0a0/src/pretensor/cli/commands/index.py +551 -0
  38. pretensor-0.1.0a0/src/pretensor/cli/commands/list.py +65 -0
  39. pretensor-0.1.0a0/src/pretensor/cli/commands/quickstart.py +171 -0
  40. pretensor-0.1.0a0/src/pretensor/cli/commands/reindex.py +581 -0
  41. pretensor-0.1.0a0/src/pretensor/cli/commands/semantic.py +190 -0
  42. pretensor-0.1.0a0/src/pretensor/cli/commands/serve.py +129 -0
  43. pretensor-0.1.0a0/src/pretensor/cli/commands/sync_grants.py +149 -0
  44. pretensor-0.1.0a0/src/pretensor/cli/commands/validate.py +156 -0
  45. pretensor-0.1.0a0/src/pretensor/cli/config_file.py +412 -0
  46. pretensor-0.1.0a0/src/pretensor/cli/constants.py +10 -0
  47. pretensor-0.1.0a0/src/pretensor/cli/dbt_enrichment.py +96 -0
  48. pretensor-0.1.0a0/src/pretensor/cli/main.py +81 -0
  49. pretensor-0.1.0a0/src/pretensor/cli/paths.py +43 -0
  50. pretensor-0.1.0a0/src/pretensor/cli/plugin.py +52 -0
  51. pretensor-0.1.0a0/src/pretensor/config.py +145 -0
  52. pretensor-0.1.0a0/src/pretensor/connectors/SKILL.md +16 -0
  53. pretensor-0.1.0a0/src/pretensor/connectors/__init__.py +29 -0
  54. pretensor-0.1.0a0/src/pretensor/connectors/base.py +165 -0
  55. pretensor-0.1.0a0/src/pretensor/connectors/bigquery.py +463 -0
  56. pretensor-0.1.0a0/src/pretensor/connectors/inspect.py +321 -0
  57. pretensor-0.1.0a0/src/pretensor/connectors/lineage_sqlglot.py +91 -0
  58. pretensor-0.1.0a0/src/pretensor/connectors/models.py +130 -0
  59. pretensor-0.1.0a0/src/pretensor/connectors/pg_array_parse.py +53 -0
  60. pretensor-0.1.0a0/src/pretensor/connectors/postgres.py +921 -0
  61. pretensor-0.1.0a0/src/pretensor/connectors/registry.py +51 -0
  62. pretensor-0.1.0a0/src/pretensor/connectors/snapshot.py +244 -0
  63. pretensor-0.1.0a0/src/pretensor/connectors/snowflake.py +840 -0
  64. pretensor-0.1.0a0/src/pretensor/core/__init__.py +1 -0
  65. pretensor-0.1.0a0/src/pretensor/core/builder.py +268 -0
  66. pretensor-0.1.0a0/src/pretensor/core/dsn_crypto.py +40 -0
  67. pretensor-0.1.0a0/src/pretensor/core/ids.py +68 -0
  68. pretensor-0.1.0a0/src/pretensor/core/portable_export.py +253 -0
  69. pretensor-0.1.0a0/src/pretensor/core/registry.py +204 -0
  70. pretensor-0.1.0a0/src/pretensor/core/schema.py +368 -0
  71. pretensor-0.1.0a0/src/pretensor/core/store.py +1343 -0
  72. pretensor-0.1.0a0/src/pretensor/enrichment/__init__.py +1 -0
  73. pretensor-0.1.0a0/src/pretensor/enrichment/dbt/__init__.py +30 -0
  74. pretensor-0.1.0a0/src/pretensor/enrichment/dbt/lineage.py +100 -0
  75. pretensor-0.1.0a0/src/pretensor/enrichment/dbt/manifest.py +298 -0
  76. pretensor-0.1.0a0/src/pretensor/enrichment/dbt/metadata.py +263 -0
  77. pretensor-0.1.0a0/src/pretensor/enrichment/dbt/pipeline.py +77 -0
  78. pretensor-0.1.0a0/src/pretensor/enrichment/dbt/resolution.py +101 -0
  79. pretensor-0.1.0a0/src/pretensor/enrichment/dbt/signals.py +305 -0
  80. pretensor-0.1.0a0/src/pretensor/entities/__init__.py +27 -0
  81. pretensor-0.1.0a0/src/pretensor/entities/builder.py +63 -0
  82. pretensor-0.1.0a0/src/pretensor/entities/classifier.py +359 -0
  83. pretensor-0.1.0a0/src/pretensor/entities/llm_extract.py +66 -0
  84. pretensor-0.1.0a0/src/pretensor/graph_models/__init__.py +14 -0
  85. pretensor-0.1.0a0/src/pretensor/graph_models/base.py +11 -0
  86. pretensor-0.1.0a0/src/pretensor/graph_models/edge.py +35 -0
  87. pretensor-0.1.0a0/src/pretensor/graph_models/entity.py +21 -0
  88. pretensor-0.1.0a0/src/pretensor/graph_models/node.py +75 -0
  89. pretensor-0.1.0a0/src/pretensor/graph_models/relationship.py +27 -0
  90. pretensor-0.1.0a0/src/pretensor/intelligence/__init__.py +33 -0
  91. pretensor-0.1.0a0/src/pretensor/intelligence/cluster_labeler.py +335 -0
  92. pretensor-0.1.0a0/src/pretensor/intelligence/clustering.py +162 -0
  93. pretensor-0.1.0a0/src/pretensor/intelligence/combining.py +32 -0
  94. pretensor-0.1.0a0/src/pretensor/intelligence/discovery.py +114 -0
  95. pretensor-0.1.0a0/src/pretensor/intelligence/embeddings.py +198 -0
  96. pretensor-0.1.0a0/src/pretensor/intelligence/graph_export.py +139 -0
  97. pretensor-0.1.0a0/src/pretensor/intelligence/heuristic.py +540 -0
  98. pretensor-0.1.0a0/src/pretensor/intelligence/join_paths/__init__.py +130 -0
  99. pretensor-0.1.0a0/src/pretensor/intelligence/join_paths/on_demand.py +516 -0
  100. pretensor-0.1.0a0/src/pretensor/intelligence/join_paths/storage.py +70 -0
  101. pretensor-0.1.0a0/src/pretensor/intelligence/llm_infer.py +78 -0
  102. pretensor-0.1.0a0/src/pretensor/intelligence/llm_runtime.py +60 -0
  103. pretensor-0.1.0a0/src/pretensor/intelligence/metric_templates.py +193 -0
  104. pretensor-0.1.0a0/src/pretensor/intelligence/pipeline.py +254 -0
  105. pretensor-0.1.0a0/src/pretensor/intelligence/schema_classification.py +306 -0
  106. pretensor-0.1.0a0/src/pretensor/intelligence/scoring.py +66 -0
  107. pretensor-0.1.0a0/src/pretensor/intelligence/shadow_alias.py +101 -0
  108. pretensor-0.1.0a0/src/pretensor/intelligence/statistical.py +50 -0
  109. pretensor-0.1.0a0/src/pretensor/intelligence/steps.py +161 -0
  110. pretensor-0.1.0a0/src/pretensor/introspection/__init__.py +6 -0
  111. pretensor-0.1.0a0/src/pretensor/introspection/inspector.py +5 -0
  112. pretensor-0.1.0a0/src/pretensor/introspection/models/__init__.py +0 -0
  113. pretensor-0.1.0a0/src/pretensor/introspection/models/base.py +5 -0
  114. pretensor-0.1.0a0/src/pretensor/introspection/models/config.py +236 -0
  115. pretensor-0.1.0a0/src/pretensor/introspection/models/dsn.py +442 -0
  116. pretensor-0.1.0a0/src/pretensor/introspection/models/plan.py +116 -0
  117. pretensor-0.1.0a0/src/pretensor/introspection/models/schema.py +10 -0
  118. pretensor-0.1.0a0/src/pretensor/introspection/models/semantic.py +121 -0
  119. pretensor-0.1.0a0/src/pretensor/introspection/models/validation.py +116 -0
  120. pretensor-0.1.0a0/src/pretensor/introspection/snapshot.py +46 -0
  121. pretensor-0.1.0a0/src/pretensor/mcp/__init__.py +16 -0
  122. pretensor-0.1.0a0/src/pretensor/mcp/config_json.py +24 -0
  123. pretensor-0.1.0a0/src/pretensor/mcp/payload_types.py +248 -0
  124. pretensor-0.1.0a0/src/pretensor/mcp/resources/__init__.py +19 -0
  125. pretensor-0.1.0a0/src/pretensor/mcp/resources/markdown.py +420 -0
  126. pretensor-0.1.0a0/src/pretensor/mcp/server.py +723 -0
  127. pretensor-0.1.0a0/src/pretensor/mcp/service.py +47 -0
  128. pretensor-0.1.0a0/src/pretensor/mcp/service_context.py +126 -0
  129. pretensor-0.1.0a0/src/pretensor/mcp/service_registry.py +242 -0
  130. pretensor-0.1.0a0/src/pretensor/mcp/tool_registry.py +126 -0
  131. pretensor-0.1.0a0/src/pretensor/mcp/tools/__init__.py +1 -0
  132. pretensor-0.1.0a0/src/pretensor/mcp/tools/compile_metric.py +87 -0
  133. pretensor-0.1.0a0/src/pretensor/mcp/tools/context.py +894 -0
  134. pretensor-0.1.0a0/src/pretensor/mcp/tools/cypher.py +333 -0
  135. pretensor-0.1.0a0/src/pretensor/mcp/tools/detect_changes.py +226 -0
  136. pretensor-0.1.0a0/src/pretensor/mcp/tools/impact.py +165 -0
  137. pretensor-0.1.0a0/src/pretensor/mcp/tools/list.py +110 -0
  138. pretensor-0.1.0a0/src/pretensor/mcp/tools/schema.py +128 -0
  139. pretensor-0.1.0a0/src/pretensor/mcp/tools/search.py +108 -0
  140. pretensor-0.1.0a0/src/pretensor/mcp/tools/traverse.py +753 -0
  141. pretensor-0.1.0a0/src/pretensor/mcp/tools/validate_sql.py +74 -0
  142. pretensor-0.1.0a0/src/pretensor/observability.py +203 -0
  143. pretensor-0.1.0a0/src/pretensor/search/__init__.py +6 -0
  144. pretensor-0.1.0a0/src/pretensor/search/base.py +80 -0
  145. pretensor-0.1.0a0/src/pretensor/search/index.py +435 -0
  146. pretensor-0.1.0a0/src/pretensor/semantic/__init__.py +24 -0
  147. pretensor-0.1.0a0/src/pretensor/semantic/base.py +123 -0
  148. pretensor-0.1.0a0/src/pretensor/semantic/compiler.py +346 -0
  149. pretensor-0.1.0a0/src/pretensor/semantic/yaml_layer.py +182 -0
  150. pretensor-0.1.0a0/src/pretensor/skills/__init__.py +5 -0
  151. pretensor-0.1.0a0/src/pretensor/skills/generator.py +235 -0
  152. pretensor-0.1.0a0/src/pretensor/staleness/__init__.py +15 -0
  153. pretensor-0.1.0a0/src/pretensor/staleness/graph_patcher.py +355 -0
  154. pretensor-0.1.0a0/src/pretensor/staleness/impact_analyzer.py +162 -0
  155. pretensor-0.1.0a0/src/pretensor/staleness/snapshot_store.py +38 -0
  156. pretensor-0.1.0a0/src/pretensor/validation/__init__.py +9 -0
  157. pretensor-0.1.0a0/src/pretensor/validation/query_validator.py +436 -0
  158. pretensor-0.1.0a0/src/pretensor/visibility/__init__.py +23 -0
  159. pretensor-0.1.0a0/src/pretensor/visibility/config.py +126 -0
  160. pretensor-0.1.0a0/src/pretensor/visibility/filter.py +143 -0
  161. pretensor-0.1.0a0/src/pretensor/visibility/kuzu_helpers.py +32 -0
  162. pretensor-0.1.0a0/src/pretensor/visibility/runtime.py +36 -0
  163. pretensor-0.1.0a0/src/pretensor/visibility/sync_grants.py +188 -0
  164. pretensor-0.1.0a0/tests/SKILL.md +90 -0
  165. pretensor-0.1.0a0/tests/__init__.py +1 -0
  166. pretensor-0.1.0a0/tests/cli/test_cli_error_handling.py +372 -0
  167. pretensor-0.1.0a0/tests/cli/test_config_file.py +612 -0
  168. pretensor-0.1.0a0/tests/cli/test_connections_cli.py +217 -0
  169. pretensor-0.1.0a0/tests/cli/test_dbt_enrichment_cli.py +142 -0
  170. pretensor-0.1.0a0/tests/cli/test_export_cli.py +210 -0
  171. pretensor-0.1.0a0/tests/cli/test_index_cli.py +320 -0
  172. pretensor-0.1.0a0/tests/cli/test_list_cli.py +146 -0
  173. pretensor-0.1.0a0/tests/cli/test_main_cli.py +92 -0
  174. pretensor-0.1.0a0/tests/cli/test_paths_cli.py +101 -0
  175. pretensor-0.1.0a0/tests/cli/test_plugin.py +134 -0
  176. pretensor-0.1.0a0/tests/cli/test_quickstart_cli.py +109 -0
  177. pretensor-0.1.0a0/tests/cli/test_reindex_cli.py +417 -0
  178. pretensor-0.1.0a0/tests/cli/test_semantic_cli.py +189 -0
  179. pretensor-0.1.0a0/tests/cli/test_serve_cli.py +181 -0
  180. pretensor-0.1.0a0/tests/cli/test_sync_grants_cli.py +211 -0
  181. pretensor-0.1.0a0/tests/cli/test_validate_cli.py +156 -0
  182. pretensor-0.1.0a0/tests/conftest.py +70 -0
  183. pretensor-0.1.0a0/tests/connectors/test_base_connector.py +74 -0
  184. pretensor-0.1.0a0/tests/connectors/test_bigquery.py +262 -0
  185. pretensor-0.1.0a0/tests/connectors/test_catalog_enrichment.py +189 -0
  186. pretensor-0.1.0a0/tests/connectors/test_dsn_parsing.py +303 -0
  187. pretensor-0.1.0a0/tests/connectors/test_lineage_sqlglot.py +98 -0
  188. pretensor-0.1.0a0/tests/connectors/test_pg_array_parse.py +23 -0
  189. pretensor-0.1.0a0/tests/connectors/test_postgres_table_grants.py +197 -0
  190. pretensor-0.1.0a0/tests/connectors/test_postgres_views.py +145 -0
  191. pretensor-0.1.0a0/tests/connectors/test_registry_snowflake_optional.py +36 -0
  192. pretensor-0.1.0a0/tests/connectors/test_snowflake_connector.py +1057 -0
  193. pretensor-0.1.0a0/tests/connectors/test_snowflake_table_grants.py +187 -0
  194. pretensor-0.1.0a0/tests/contracts/__init__.py +4 -0
  195. pretensor-0.1.0a0/tests/contracts/test_combiner.py +182 -0
  196. pretensor-0.1.0a0/tests/contracts/test_pipeline_step.py +235 -0
  197. pretensor-0.1.0a0/tests/contracts/test_scorer.py +264 -0
  198. pretensor-0.1.0a0/tests/contracts/test_search_index.py +219 -0
  199. pretensor-0.1.0a0/tests/contracts/test_semantic_layer.py +225 -0
  200. pretensor-0.1.0a0/tests/core/test_builder.py +310 -0
  201. pretensor-0.1.0a0/tests/core/test_graph_builder_lineage.py +65 -0
  202. pretensor-0.1.0a0/tests/core/test_lineage_store.py +103 -0
  203. pretensor-0.1.0a0/tests/core/test_models.py +44 -0
  204. pretensor-0.1.0a0/tests/core/test_portable_export.py +75 -0
  205. pretensor-0.1.0a0/tests/core/test_registry.py +52 -0
  206. pretensor-0.1.0a0/tests/core/test_semantic_schema.py +61 -0
  207. pretensor-0.1.0a0/tests/e2e/__init__.py +0 -0
  208. pretensor-0.1.0a0/tests/e2e/conftest.py +346 -0
  209. pretensor-0.1.0a0/tests/e2e/fixtures/__init__.py +0 -0
  210. pretensor-0.1.0a0/tests/e2e/fixtures/sql/adventureworks_ddl.sql +431 -0
  211. pretensor-0.1.0a0/tests/e2e/fixtures/sql/pagila_data.sql +63 -0
  212. pretensor-0.1.0a0/tests/e2e/fixtures/sql/pagila_ddl.sql +92 -0
  213. pretensor-0.1.0a0/tests/e2e/fixtures/sql/tpcds_ddl.sql +571 -0
  214. pretensor-0.1.0a0/tests/e2e/fixtures/sql/tpch_ddl.sql +111 -0
  215. pretensor-0.1.0a0/tests/e2e/test_adventureworks_smoke.py +45 -0
  216. pretensor-0.1.0a0/tests/e2e/test_adventureworks_traverse.py +118 -0
  217. pretensor-0.1.0a0/tests/e2e/test_dbt_warehouse_scale_enrichment.py +288 -0
  218. pretensor-0.1.0a0/tests/e2e/test_index_cycle.py +88 -0
  219. pretensor-0.1.0a0/tests/e2e/test_mcp_tools.py +106 -0
  220. pretensor-0.1.0a0/tests/e2e/test_reindex.py +101 -0
  221. pretensor-0.1.0a0/tests/e2e/test_serve_smoke.py +46 -0
  222. pretensor-0.1.0a0/tests/e2e/test_tpcds_traverse.py +222 -0
  223. pretensor-0.1.0a0/tests/e2e/test_tpch_traverse.py +120 -0
  224. pretensor-0.1.0a0/tests/e2e/test_visibility.py +78 -0
  225. pretensor-0.1.0a0/tests/enrichment/__init__.py +0 -0
  226. pretensor-0.1.0a0/tests/enrichment/fixtures/dbt/manifest_v10.json +19 -0
  227. pretensor-0.1.0a0/tests/enrichment/fixtures/dbt/manifest_v9.json +55 -0
  228. pretensor-0.1.0a0/tests/enrichment/test_dbt_lineage.py +179 -0
  229. pretensor-0.1.0a0/tests/enrichment/test_dbt_manifest.py +106 -0
  230. pretensor-0.1.0a0/tests/enrichment/test_dbt_metadata.py +200 -0
  231. pretensor-0.1.0a0/tests/enrichment/test_dbt_pipeline.py +107 -0
  232. pretensor-0.1.0a0/tests/enrichment/test_dbt_signals.py +361 -0
  233. pretensor-0.1.0a0/tests/entities/test_classifier.py +69 -0
  234. pretensor-0.1.0a0/tests/entities/test_entity_builder.py +76 -0
  235. pretensor-0.1.0a0/tests/entities/test_llm_extract.py +69 -0
  236. pretensor-0.1.0a0/tests/entities/test_pagila_entities.py +67 -0
  237. pretensor-0.1.0a0/tests/fixtures/dbt/synthetic_warehouse/README.md +83 -0
  238. pretensor-0.1.0a0/tests/fixtures/dbt/synthetic_warehouse/__init__.py +16 -0
  239. pretensor-0.1.0a0/tests/fixtures/dbt/synthetic_warehouse/generator.py +405 -0
  240. pretensor-0.1.0a0/tests/fixtures/pairs/analytics_vs_saas.yaml +17 -0
  241. pretensor-0.1.0a0/tests/fixtures/pairs/tpch_vs_pagila.yaml +17 -0
  242. pretensor-0.1.0a0/tests/fixtures/pairs/tpch_vs_tpch_renamed.yaml +27 -0
  243. pretensor-0.1.0a0/tests/fixtures/schemas/adversarial.yaml +372 -0
  244. pretensor-0.1.0a0/tests/fixtures/schemas/analytics_dwh.yaml +574 -0
  245. pretensor-0.1.0a0/tests/fixtures/schemas/pagila.yaml +657 -0
  246. pretensor-0.1.0a0/tests/fixtures/schemas/saas_multitenant.yaml +551 -0
  247. pretensor-0.1.0a0/tests/fixtures/schemas/tpch.yaml +776 -0
  248. pretensor-0.1.0a0/tests/intelligence/test_cluster_labeler.py +461 -0
  249. pretensor-0.1.0a0/tests/intelligence/test_clustering.py +101 -0
  250. pretensor-0.1.0a0/tests/intelligence/test_discovery.py +407 -0
  251. pretensor-0.1.0a0/tests/intelligence/test_embeddings.py +250 -0
  252. pretensor-0.1.0a0/tests/intelligence/test_heuristic.py +769 -0
  253. pretensor-0.1.0a0/tests/intelligence/test_intelligence.py +100 -0
  254. pretensor-0.1.0a0/tests/intelligence/test_join_paths.py +305 -0
  255. pretensor-0.1.0a0/tests/intelligence/test_llm_infer.py +85 -0
  256. pretensor-0.1.0a0/tests/intelligence/test_llm_runtime.py +50 -0
  257. pretensor-0.1.0a0/tests/intelligence/test_metric_templates.py +148 -0
  258. pretensor-0.1.0a0/tests/intelligence/test_pipeline.py +258 -0
  259. pretensor-0.1.0a0/tests/intelligence/test_schema_classification.py +68 -0
  260. pretensor-0.1.0a0/tests/intelligence/test_shadow_alias.py +355 -0
  261. pretensor-0.1.0a0/tests/intelligence/test_statistical.py +78 -0
  262. pretensor-0.1.0a0/tests/mcp/test_compile_metric_tool.py +154 -0
  263. pretensor-0.1.0a0/tests/mcp/test_context_dbt.py +136 -0
  264. pretensor-0.1.0a0/tests/mcp/test_context_lineage.py +119 -0
  265. pretensor-0.1.0a0/tests/mcp/test_context_tool.py +52 -0
  266. pretensor-0.1.0a0/tests/mcp/test_detect_changes_errors.py +138 -0
  267. pretensor-0.1.0a0/tests/mcp/test_error_ergonomics.py +389 -0
  268. pretensor-0.1.0a0/tests/mcp/test_error_handling.py +309 -0
  269. pretensor-0.1.0a0/tests/mcp/test_impact_hop.py +136 -0
  270. pretensor-0.1.0a0/tests/mcp/test_schema_tool.py +117 -0
  271. pretensor-0.1.0a0/tests/mcp/test_service.py +811 -0
  272. pretensor-0.1.0a0/tests/mcp/test_tool_registry.py +198 -0
  273. pretensor-0.1.0a0/tests/mcp/test_traverse_ambiguous.py +173 -0
  274. pretensor-0.1.0a0/tests/mcp/test_traverse_dijkstra.py +520 -0
  275. pretensor-0.1.0a0/tests/mcp/test_traverse_pagila_shape.py +269 -0
  276. pretensor-0.1.0a0/tests/mcp/test_validate_sql_tool.py +125 -0
  277. pretensor-0.1.0a0/tests/mcp/test_visibility_mcp.py +281 -0
  278. pretensor-0.1.0a0/tests/query_helpers.py +26 -0
  279. pretensor-0.1.0a0/tests/search/test_search_index.py +310 -0
  280. pretensor-0.1.0a0/tests/semantic/__init__.py +0 -0
  281. pretensor-0.1.0a0/tests/semantic/test_compiler.py +341 -0
  282. pretensor-0.1.0a0/tests/semantic/test_semantic_layer.py +76 -0
  283. pretensor-0.1.0a0/tests/semantic/test_yaml_layer.py +229 -0
  284. pretensor-0.1.0a0/tests/staleness/test_staleness.py +159 -0
  285. pretensor-0.1.0a0/tests/test_gitlint_config.py +94 -0
  286. pretensor-0.1.0a0/tests/test_observability.py +96 -0
  287. pretensor-0.1.0a0/tests/test_pretensor_config.py +377 -0
  288. pretensor-0.1.0a0/tests/utils/__init__.py +0 -0
  289. pretensor-0.1.0a0/tests/utils/score_tracker.py +99 -0
  290. pretensor-0.1.0a0/tests/validation/test_query_validator.py +147 -0
  291. pretensor-0.1.0a0/tests/visibility/test_sync_grants.py +274 -0
  292. pretensor-0.1.0a0/tests/visibility/test_visibility_config.py +376 -0
  293. pretensor-0.1.0a0/uv.lock +2683 -0
File without changes
@@ -0,0 +1,2 @@
1
+ * text=auto eol=lf
2
+ uv.lock linguist-generated=true
@@ -0,0 +1,2 @@
1
+ # Default owner for all files
2
+ * @tensorcarlos
@@ -0,0 +1,110 @@
1
+ name: Bug report
2
+ description: Report a reproducible problem with Pretensor.
3
+ title: "bug: <short summary>"
4
+ labels:
5
+ - bug
6
+ - triage
7
+ body:
8
+ - type: markdown
9
+ attributes:
10
+ value: |
11
+ Thanks for taking the time to file a bug report. Please fill out the fields below so we can reproduce the issue quickly.
12
+
13
+ **Security vulnerabilities must not be filed as public issues.** See [SECURITY.md](https://github.com/pretensor-ai/pretensor/blob/main/SECURITY.md) and report privately via [GitHub Security Advisories](https://github.com/pretensor-ai/pretensor/security/advisories/new).
14
+
15
+ - type: input
16
+ id: pretensor-version
17
+ attributes:
18
+ label: Pretensor version
19
+ description: Output of `pretensor --version`.
20
+ placeholder: "0.1.0aN"
21
+ validations:
22
+ required: true
23
+
24
+ - type: input
25
+ id: python-version
26
+ attributes:
27
+ label: Python version
28
+ description: Output of `python --version`.
29
+ placeholder: "3.11.x or 3.12.x"
30
+ validations:
31
+ required: true
32
+
33
+ - type: dropdown
34
+ id: os
35
+ attributes:
36
+ label: Operating system
37
+ options:
38
+ - Linux
39
+ - macOS
40
+ - Windows
41
+ - Other
42
+ validations:
43
+ required: true
44
+
45
+ - type: dropdown
46
+ id: backend
47
+ attributes:
48
+ label: Database backend
49
+ description: Which connector were you using when the bug occurred?
50
+ options:
51
+ - PostgreSQL
52
+ - Snowflake
53
+ - BigQuery
54
+ - Not applicable
55
+ - Other
56
+ validations:
57
+ required: true
58
+
59
+ - type: input
60
+ id: extras
61
+ attributes:
62
+ label: Installed extras
63
+ description: Which pip extras did you install? e.g. `[dev]`, `[snowflake]`, `[bigquery]`, `[e2e]`.
64
+ placeholder: "[dev]"
65
+
66
+ - type: textarea
67
+ id: repro
68
+ attributes:
69
+ label: Steps to reproduce
70
+ description: A minimal, self-contained reproduction. Include the exact commands or code.
71
+ placeholder: |
72
+ 1. Install with `pip install -e ".[dev]"`
73
+ 2. Run `pretensor index ...`
74
+ 3. Observe ...
75
+ render: markdown
76
+ validations:
77
+ required: true
78
+
79
+ - type: textarea
80
+ id: expected
81
+ attributes:
82
+ label: Expected behavior
83
+ validations:
84
+ required: true
85
+
86
+ - type: textarea
87
+ id: actual
88
+ attributes:
89
+ label: Actual behavior
90
+ description: Include full tracebacks and error messages.
91
+ render: shell
92
+ validations:
93
+ required: true
94
+
95
+ - type: textarea
96
+ id: logs
97
+ attributes:
98
+ label: Additional logs or context
99
+ description: Any relevant logs, MCP transcripts, or schema snippets. Redact secrets and personally identifiable data.
100
+ render: shell
101
+
102
+ - type: checkboxes
103
+ id: checks
104
+ attributes:
105
+ label: Pre-submission checks
106
+ options:
107
+ - label: I searched existing issues and did not find a duplicate.
108
+ required: true
109
+ - label: I confirmed this is not a security vulnerability (those go through Security Advisories).
110
+ required: true
@@ -0,0 +1,8 @@
1
+ blank_issues_enabled: false
2
+ contact_links:
3
+ - name: Report a security vulnerability
4
+ url: https://github.com/pretensor-ai/pretensor/security/advisories/new
5
+ about: Please report security issues privately through GitHub Security Advisories, not as public issues. See SECURITY.md for details.
6
+ - name: Ask a question or start a discussion
7
+ url: https://github.com/pretensor-ai/pretensor/discussions
8
+ about: Questions, ideas, and general discussion belong in Discussions.
@@ -0,0 +1,57 @@
1
+ name: Feature request
2
+ description: Suggest a new capability or enhancement for Pretensor.
3
+ title: "feat: <short summary>"
4
+ labels:
5
+ - enhancement
6
+ - triage
7
+ body:
8
+ - type: markdown
9
+ attributes:
10
+ value: |
11
+ Thanks for proposing an improvement. Please describe the problem you're trying to solve before the solution — that lets us evaluate alternatives we may not have considered.
12
+
13
+ - type: textarea
14
+ id: problem
15
+ attributes:
16
+ label: Problem
17
+ description: What are you trying to accomplish, and what's blocking you today? Include concrete use cases where helpful.
18
+ validations:
19
+ required: true
20
+
21
+ - type: textarea
22
+ id: proposal
23
+ attributes:
24
+ label: Proposed solution
25
+ description: Describe the change you have in mind. Include expected CLI, MCP, or API behavior if relevant.
26
+ validations:
27
+ required: true
28
+
29
+ - type: textarea
30
+ id: alternatives
31
+ attributes:
32
+ label: Alternatives considered
33
+ description: Other approaches you evaluated and why you discarded them. Leave blank if none.
34
+
35
+ - type: dropdown
36
+ id: scope
37
+ attributes:
38
+ label: Scope
39
+ description: Which subsystem does this primarily affect?
40
+ options:
41
+ - CLI
42
+ - MCP server
43
+ - Connectors (Postgres / Snowflake / BigQuery)
44
+ - Graph / intelligence
45
+ - Docs
46
+ - Build / release
47
+ - Not sure
48
+ validations:
49
+ required: true
50
+
51
+ - type: checkboxes
52
+ id: checks
53
+ attributes:
54
+ label: Pre-submission checks
55
+ options:
56
+ - label: I searched existing issues and did not find a duplicate.
57
+ required: true
@@ -0,0 +1,49 @@
1
+ version: 2
2
+
3
+ updates:
4
+ - package-ecosystem: pip
5
+ directory: /
6
+ schedule:
7
+ interval: weekly
8
+ day: monday
9
+ time: "06:00"
10
+ timezone: Etc/UTC
11
+ open-pull-requests-limit: 5
12
+ commit-message:
13
+ prefix: chore
14
+ prefix-development: chore
15
+ include: scope
16
+ labels:
17
+ - dependencies
18
+ - python
19
+ groups:
20
+ dev-dependencies:
21
+ dependency-type: development
22
+ update-types:
23
+ - minor
24
+ - patch
25
+ runtime-dependencies:
26
+ dependency-type: production
27
+ update-types:
28
+ - minor
29
+ - patch
30
+
31
+ - package-ecosystem: github-actions
32
+ directory: /
33
+ schedule:
34
+ interval: weekly
35
+ day: monday
36
+ time: "06:00"
37
+ timezone: Etc/UTC
38
+ open-pull-requests-limit: 5
39
+ commit-message:
40
+ prefix: ci
41
+ include: scope
42
+ labels:
43
+ - dependencies
44
+ - github-actions
45
+ groups:
46
+ actions-minor-and-patch:
47
+ update-types:
48
+ - minor
49
+ - patch
@@ -0,0 +1,15 @@
1
+ ## Summary
2
+
3
+ <!-- What changed and why (1-3 sentences). -->
4
+
5
+ ## Checklist
6
+
7
+ - [ ] Tests pass (`python -m pytest tests/`)
8
+ - [ ] Linting passes (`ruff check src/ tests/`)
9
+ - [ ] Type checking passes (`pyright src/`)
10
+ - [ ] `CHANGELOG.md` updated under `[Unreleased]` (or noted as not user-facing)
11
+ - [ ] All commits signed off per the [Developer Certificate of Origin](https://developercertificate.org/) (`git commit -s`)
12
+
13
+ ## Notes
14
+
15
+ <!-- Optional: risks, follow-ups, screenshots. -->
@@ -0,0 +1,73 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main, master, 'publish/**']
6
+ paths-ignore:
7
+ - 'docs/**'
8
+ - '**.md'
9
+ - '.github/ISSUE_TEMPLATE/**'
10
+ pull_request:
11
+ paths-ignore:
12
+ - 'docs/**'
13
+ - '**.md'
14
+ - '.github/ISSUE_TEMPLATE/**'
15
+
16
+ concurrency:
17
+ group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
18
+ cancel-in-progress: true
19
+
20
+ permissions:
21
+ contents: read
22
+
23
+ jobs:
24
+ lint:
25
+ name: Lint (ruff)
26
+ runs-on: ubuntu-latest
27
+ steps:
28
+ - uses: actions/checkout@v4
29
+ - uses: astral-sh/setup-uv@v4
30
+ with:
31
+ enable-cache: true
32
+ cache-dependency-glob: "uv.lock"
33
+ python-version: "3.12"
34
+ - name: Install dependencies
35
+ run: uv sync --extra dev
36
+ - name: Ruff check
37
+ run: uv run ruff check src tests
38
+
39
+ typecheck:
40
+ name: Typecheck (pyright)
41
+ runs-on: ubuntu-latest
42
+ steps:
43
+ - uses: actions/checkout@v4
44
+ - uses: astral-sh/setup-uv@v4
45
+ with:
46
+ enable-cache: true
47
+ cache-dependency-glob: "uv.lock"
48
+ python-version: "3.11"
49
+ - name: Install dependencies
50
+ run: uv sync --extra dev
51
+ - name: Pyright
52
+ run: uv run pyright
53
+
54
+ test:
55
+ name: Test (pytest, py${{ matrix.python-version }})
56
+ runs-on: ubuntu-latest
57
+ strategy:
58
+ fail-fast: false
59
+ matrix:
60
+ python-version: ["3.11", "3.12"]
61
+ steps:
62
+ - uses: actions/checkout@v4
63
+ - uses: astral-sh/setup-uv@v4
64
+ with:
65
+ enable-cache: true
66
+ cache-dependency-glob: "uv.lock"
67
+ python-version: ${{ matrix.python-version }}
68
+ - name: Install dependencies
69
+ run: uv sync --extra dev
70
+ - name: Pytest
71
+ env:
72
+ PYTHONPATH: src
73
+ run: uv run pytest tests/
@@ -0,0 +1,47 @@
1
+ name: E2E Tests
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ verbose:
7
+ description: "Enable verbose output (--tb=long -s)"
8
+ type: boolean
9
+ default: false
10
+
11
+ jobs:
12
+ e2e:
13
+ runs-on: ubuntu-latest
14
+ # Docker Engine is pre-installed on ubuntu-latest — no extra setup needed
15
+
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - uses: actions/setup-python@v6
20
+ with:
21
+ python-version: "3.11"
22
+
23
+ - name: Install uv
24
+ run: |
25
+ curl -LsSf https://astral.sh/uv/install.sh | sh
26
+ echo "$HOME/.local/bin" >> "$GITHUB_PATH"
27
+
28
+ - name: Install dependencies (make test-e2e uses uv sync --extra dev --extra e2e)
29
+ run: uv sync --extra dev --extra e2e
30
+
31
+ - name: Run E2E suite (PRETENSOR_E2E=1 uv run pytest tests/e2e/ ...)
32
+ env:
33
+ PRETENSOR_E2E: "1"
34
+ run: |
35
+ if [ "${{ inputs.verbose }}" = "true" ]; then
36
+ uv run pytest tests/e2e/ -v --tb=long -s
37
+ else
38
+ uv run pytest tests/e2e/ -v --tb=short
39
+ fi
40
+
41
+ - name: Upload logs on failure
42
+ if: failure()
43
+ uses: actions/upload-artifact@v4
44
+ with:
45
+ name: e2e-logs
46
+ path: /tmp/pytest-*
47
+ retention-days: 3
@@ -0,0 +1,63 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ *.egg-info/
7
+ *.egg
8
+ dist/
9
+ build/
10
+ .eggs/
11
+
12
+ # Virtual environments
13
+ .venv/
14
+ venv/
15
+ env/
16
+
17
+ # Environment variables
18
+ .env
19
+ .env.*
20
+ !.env.example
21
+
22
+ # IDE
23
+ .vscode/
24
+ .idea/
25
+ *.swp
26
+ *.swo
27
+ *~
28
+
29
+ # OS
30
+ .DS_Store
31
+ Thumbs.db
32
+
33
+ # Testing
34
+ .pytest_cache/
35
+ .coverage
36
+ htmlcov/
37
+ .mypy_cache/
38
+
39
+ # Node
40
+ node_modules/
41
+ .next/
42
+
43
+ # Evidence.dev build artifacts
44
+ .evidence/
45
+ build/
46
+
47
+ # Logs
48
+ *.log
49
+
50
+ # uv / pip
51
+ .uv/
52
+ pip-log.txt
53
+
54
+ # pretensor runtime state (generated by `pretensor index`)
55
+ .pretensor/
56
+
57
+ # Secrets
58
+ *.pem
59
+ *.key
60
+ *.p12
61
+ *.pfx
62
+ credentials.json
63
+ service-account*.json
@@ -0,0 +1,19 @@
1
+ # R5 commit title shape (Conventional Commits + optional `PROJ-123: ` ticket prefix).
2
+ # The task names `contrib=CC1`; in gitlint 0.19.x, CC1 is signed-off-by on the body,
3
+ # not Conventional Commits. CC1 is listed per spec then ignored so title-only commits can pass.
4
+ # B6 (body required) is ignored so `feat: add thing` with no body passes.
5
+ [general]
6
+ contrib=CC1
7
+ ignore=CC1,B6
8
+ ignore-merge-commits=true
9
+ ignore-fixup-commits=true
10
+ ignore-squash-commits=true
11
+
12
+ [title-max-length]
13
+ line-length=72
14
+
15
+ [title-match-regex]
16
+ regex=^([A-Z]+-\d+:\s)?(feat|fix|chore|docs|test|refactor|ci|build|perf|revert|style)(\([a-z0-9-]+\))?:\s[a-z].+[^.]$
17
+
18
+ [body-max-line-length]
19
+ line-length=100
@@ -0,0 +1,21 @@
1
+ # Public repo pre-commit config — ruff + pyright only.
2
+
3
+ default_language_version:
4
+ python: python3
5
+
6
+ repos:
7
+ - repo: https://github.com/astral-sh/ruff-pre-commit
8
+ rev: v0.15.9
9
+ hooks:
10
+ - id: ruff-check
11
+ args: ["--fix"]
12
+ - id: ruff-format
13
+
14
+ - repo: local
15
+ hooks:
16
+ - id: pyright
17
+ name: pyright
18
+ language: system
19
+ entry: python
20
+ pass_filenames: false
21
+ args: [-m, pyright, --project, .]
@@ -0,0 +1 @@
1
+ 3.11
@@ -0,0 +1,20 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog 1.1.0](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [PEP 440](https://peps.python.org/pep-0440/) versioning.
7
+
8
+ Pretensor is in **pre-release development** and is not yet published to PyPI.
9
+ Until the first packaged release, this changelog tracks notable changes landing on `main`.
10
+
11
+ ## [Unreleased]
12
+
13
+ ### Added
14
+ - Placeholder for changes landing on `main` between releases.
15
+
16
+ <!--
17
+ When cutting a release, copy the contents of [Unreleased] into a new
18
+ `## [X.Y.Z] - YYYY-MM-DD` section above, then reset [Unreleased] to empty
19
+ subsections (Added / Changed / Deprecated / Removed / Fixed / Security).
20
+ -->
@@ -0,0 +1,84 @@
1
+
2
+ # Contributor Covenant Code of Conduct
3
+
4
+ ## Our Pledge
5
+
6
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
7
+
8
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
9
+
10
+ ## Our Standards
11
+
12
+ Examples of behavior that contributes to a positive environment for our community include:
13
+
14
+ * Demonstrating empathy and kindness toward other people
15
+ * Being respectful of differing opinions, viewpoints, and experiences
16
+ * Giving and gracefully accepting constructive feedback
17
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
18
+ * Focusing on what is best not just for us as individuals, but for the overall community
19
+
20
+ Examples of unacceptable behavior include:
21
+
22
+ * The use of sexualized language or imagery, and sexual attention or advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email address, without their explicit permission
26
+ * Other conduct which could reasonably be considered inappropriate in a professional setting
27
+
28
+ ## Enforcement Responsibilities
29
+
30
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
31
+
32
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
33
+
34
+ ## Scope
35
+
36
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
37
+
38
+ ## Enforcement
39
+
40
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [INSERT CONTACT METHOD]. All complaints will be reviewed and investigated promptly and fairly.
41
+
42
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
43
+
44
+ ## Enforcement Guidelines
45
+
46
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
47
+
48
+ ### 1. Correction
49
+
50
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
51
+
52
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
53
+
54
+ ### 2. Warning
55
+
56
+ **Community Impact**: A violation through a single incident or series of actions.
57
+
58
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
59
+
60
+ ### 3. Temporary Ban
61
+
62
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
63
+
64
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
65
+
66
+ ### 4. Permanent Ban
67
+
68
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
69
+
70
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
71
+
72
+ ## Attribution
73
+
74
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
75
+
76
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
77
+
78
+ For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations].
79
+
80
+ [homepage]: https://www.contributor-covenant.org
81
+ [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
82
+ [Mozilla CoC]: https://github.com/mozilla/diversity
83
+ [FAQ]: https://www.contributor-covenant.org/faq
84
+ [translations]: https://www.contributor-covenant.org/translations