sageql 0.2.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 (252) hide show
  1. sageql-0.2.1/.env.example +14 -0
  2. sageql-0.2.1/.github/workflows/compatibility.yml +122 -0
  3. sageql-0.2.1/.github/workflows/publish.yml +56 -0
  4. sageql-0.2.1/.gitignore +13 -0
  5. sageql-0.2.1/AGENTS.md +15 -0
  6. sageql-0.2.1/CHANGELOG.md +69 -0
  7. sageql-0.2.1/LICENSE +21 -0
  8. sageql-0.2.1/PKG-INFO +415 -0
  9. sageql-0.2.1/README.md +382 -0
  10. sageql-0.2.1/agent-rules/Agent.md +66 -0
  11. sageql-0.2.1/docs/APPLICATION_INDEPENDENCE.md +148 -0
  12. sageql-0.2.1/docs/ARCHITECTURE.md +233 -0
  13. sageql-0.2.1/docs/CAPABILITIES.md +52 -0
  14. sageql-0.2.1/docs/IMPROVEMENT_RECOMMENDATIONS.md +406 -0
  15. sageql-0.2.1/docs/MODEL_COMPARISON_NANO_MINI.md +175 -0
  16. sageql-0.2.1/docs/RELEASE_PLAN_0.2.md +60 -0
  17. sageql-0.2.1/docs/ROADMAP.md +89 -0
  18. sageql-0.2.1/docs/SDK.md +352 -0
  19. sageql-0.2.1/docs/SDK_AGENTS.md +607 -0
  20. sageql-0.2.1/docs/SDK_CLARIFICATION_CONTINUATION.md +95 -0
  21. sageql-0.2.1/docs/SDK_COMPARISON_CHANGES.md +73 -0
  22. sageql-0.2.1/docs/SDK_ENTITY_DECREASES.md +48 -0
  23. sageql-0.2.1/docs/SDK_ENTITY_LABELS.md +74 -0
  24. sageql-0.2.1/docs/SDK_ENTITY_LOOKUPS.md +87 -0
  25. sageql-0.2.1/docs/SDK_JALALI_MONTHS.md +60 -0
  26. sageql-0.2.1/docs/SDK_MANAGEMENT_REPORT.md +116 -0
  27. sageql-0.2.1/docs/SDK_MANAGER_REPORTS.md +162 -0
  28. sageql-0.2.1/docs/SDK_MATCHING_DAY_COUNTS.md +62 -0
  29. sageql-0.2.1/docs/SDK_PARTICIPANT_MEANS.md +66 -0
  30. sageql-0.2.1/docs/SDK_READ_CONSISTENCY.md +143 -0
  31. sageql-0.2.1/docs/SDK_RELATIONSHIPS.md +86 -0
  32. sageql-0.2.1/docs/SDK_RELEASE.md +173 -0
  33. sageql-0.2.1/docs/SDK_RELIABILITY.md +352 -0
  34. sageql-0.2.1/docs/SDK_SAVED_REPORTS.md +60 -0
  35. sageql-0.2.1/docs/SDK_SQL_SERVER.md +113 -0
  36. sageql-0.2.1/docs/SDK_VALUE_VOCABULARY.md +118 -0
  37. sageql-0.2.1/docs/SQLITE_FIRST_TESTING.md +180 -0
  38. sageql-0.2.1/docs/SQLSERVER_INTEGRATION_TESTING.md +114 -0
  39. sageql-0.2.1/evaluations/README.md +77 -0
  40. sageql-0.2.1/evaluations/__init__.py +1 -0
  41. sageql-0.2.1/evaluations/__main__.py +108 -0
  42. sageql-0.2.1/evaluations/baseline.json +2221 -0
  43. sageql-0.2.1/evaluations/baselines/phase01_cases.json +878 -0
  44. sageql-0.2.1/evaluations/baselines/phase02.json +2221 -0
  45. sageql-0.2.1/evaluations/baselines/phase02_cases.json +1852 -0
  46. sageql-0.2.1/evaluations/cases.json +1852 -0
  47. sageql-0.2.1/evaluations/frozen.py +10 -0
  48. sageql-0.2.1/evaluations/history.py +79 -0
  49. sageql-0.2.1/evaluations/model_comparison.py +134 -0
  50. sageql-0.2.1/evaluations/phase03/cases.v1.json +6025 -0
  51. sageql-0.2.1/evaluations/phase03/cases.v2.json +6320 -0
  52. sageql-0.2.1/evaluations/phase03/freeze.v1.json +15 -0
  53. sageql-0.2.1/evaluations/phase03/freeze.v2.json +17 -0
  54. sageql-0.2.1/evaluations/phase03/records.json +18 -0
  55. sageql-0.2.1/evaluations/phase03_hosts.py +62 -0
  56. sageql-0.2.1/evaluations/phase04/cases.v1.json +4221 -0
  57. sageql-0.2.1/evaluations/phase04/freeze.v1.json +10 -0
  58. sageql-0.2.1/evaluations/phase04.py +17 -0
  59. sageql-0.2.1/evaluations/phase05/cases.v1.json +5233 -0
  60. sageql-0.2.1/evaluations/phase05/cases.v2.json +5383 -0
  61. sageql-0.2.1/evaluations/phase05/freeze.v1.json +17 -0
  62. sageql-0.2.1/evaluations/phase05/freeze.v2.json +19 -0
  63. sageql-0.2.1/evaluations/phase05/hosts.v1.json +36 -0
  64. sageql-0.2.1/evaluations/phase05.py +17 -0
  65. sageql-0.2.1/evaluations/phase05_benchmark.py +55 -0
  66. sageql-0.2.1/evaluations/phase05_hosts.py +61 -0
  67. sageql-0.2.1/evaluations/phase05_reference.py +20 -0
  68. sageql-0.2.1/evaluations/phase06/cases.v1.json +6090 -0
  69. sageql-0.2.1/evaluations/phase06/cases.v2.json +6105 -0
  70. sageql-0.2.1/evaluations/phase06/cases.v3.json +6164 -0
  71. sageql-0.2.1/evaluations/phase06/cases.v4.json +6295 -0
  72. sageql-0.2.1/evaluations/phase06/freeze.v1.json +20 -0
  73. sageql-0.2.1/evaluations/phase06/freeze.v2.json +20 -0
  74. sageql-0.2.1/evaluations/phase06/freeze.v3.json +20 -0
  75. sageql-0.2.1/evaluations/phase06/freeze.v4.json +20 -0
  76. sageql-0.2.1/evaluations/phase06.py +319 -0
  77. sageql-0.2.1/evaluations/phase06_runtime.py +373 -0
  78. sageql-0.2.1/evaluations/phase06_transport.py +190 -0
  79. sageql-0.2.1/evaluations/phase07/cases.v1.json +5269 -0
  80. sageql-0.2.1/evaluations/phase07/cases.v2.json +5511 -0
  81. sageql-0.2.1/evaluations/phase07/freeze.v1.json +21 -0
  82. sageql-0.2.1/evaluations/phase07/freeze.v2.json +33 -0
  83. sageql-0.2.1/evaluations/phase07.py +54 -0
  84. sageql-0.2.1/evaluations/phase08/cases.v1.json +352 -0
  85. sageql-0.2.1/evaluations/phase08/cases.v2.json +352 -0
  86. sageql-0.2.1/evaluations/phase08/contract-check-first.v1.json +2859 -0
  87. sageql-0.2.1/evaluations/phase08/expectations.v1.json +2409 -0
  88. sageql-0.2.1/evaluations/phase08/expectations.v2.json +2401 -0
  89. sageql-0.2.1/evaluations/phase08/freeze.v1.json +26 -0
  90. sageql-0.2.1/evaluations/phase08/freeze.v2.json +30 -0
  91. sageql-0.2.1/evaluations/phase08.py +113 -0
  92. sageql-0.2.1/evaluations/phase09/cases.v1.json +2883 -0
  93. sageql-0.2.1/evaluations/phase09/cases.v2.json +3136 -0
  94. sageql-0.2.1/evaluations/phase09/freeze.v1.json +26 -0
  95. sageql-0.2.1/evaluations/phase09/freeze.v2.json +29 -0
  96. sageql-0.2.1/evaluations/phase09.py +54 -0
  97. sageql-0.2.1/evaluations/phase11/sqlserver-approval.example.json +19 -0
  98. sageql-0.2.1/evaluations/phase14/cases.v1.json +213 -0
  99. sageql-0.2.1/evaluations/phase14/cases.v2.json +213 -0
  100. sageql-0.2.1/evaluations/phase14/expectations.v1.json +1920 -0
  101. sageql-0.2.1/evaluations/phase14/expectations.v2.json +1920 -0
  102. sageql-0.2.1/evaluations/phase14/freeze.v1.json +26 -0
  103. sageql-0.2.1/evaluations/phase14/freeze.v2.json +31 -0
  104. sageql-0.2.1/evaluations/phase14.py +87 -0
  105. sageql-0.2.1/evaluations/phase14_replacements/README.md +32 -0
  106. sageql-0.2.1/evaluations/phase14_replacements/cases.v1.json +112 -0
  107. sageql-0.2.1/evaluations/phase14_replacements/cases.v2.json +140 -0
  108. sageql-0.2.1/evaluations/phase14_replacements/cases.v3.json +140 -0
  109. sageql-0.2.1/evaluations/phase14_replacements/expectations.v1.json +953 -0
  110. sageql-0.2.1/evaluations/phase14_replacements/expectations.v2.json +1361 -0
  111. sageql-0.2.1/evaluations/phase14_replacements/expectations.v3.json +1361 -0
  112. sageql-0.2.1/evaluations/phase14_replacements/freeze.v1.json +35 -0
  113. sageql-0.2.1/evaluations/phase14_replacements/freeze.v2.json +37 -0
  114. sageql-0.2.1/evaluations/phase14_replacements/freeze.v3.json +37 -0
  115. sageql-0.2.1/evaluations/reference.py +99 -0
  116. sageql-0.2.1/evaluations/runner.py +330 -0
  117. sageql-0.2.1/evaluations/scoring.py +128 -0
  118. sageql-0.2.1/evaluations/trajectories.py +577 -0
  119. sageql-0.2.1/examples/multi_domain.py +237 -0
  120. sageql-0.2.1/examples/sdk_demo.py +76 -0
  121. sageql-0.2.1/examples/value_vocabulary.py +58 -0
  122. sageql-0.2.1/examples/web/README.md +215 -0
  123. sageql-0.2.1/examples/web/index.html +385 -0
  124. sageql-0.2.1/examples/web/server.py +565 -0
  125. sageql-0.2.1/main.py +299 -0
  126. sageql-0.2.1/pyproject.toml +48 -0
  127. sageql-0.2.1/schema.example.json +37 -0
  128. sageql-0.2.1/src/sageql/__init__.py +108 -0
  129. sageql-0.2.1/src/sageql/catalog_input.py +138 -0
  130. sageql-0.2.1/src/sageql/chat_cli.py +229 -0
  131. sageql-0.2.1/src/sageql/chat_provider.py +527 -0
  132. sageql-0.2.1/src/sageql/cli.py +43 -0
  133. sageql-0.2.1/src/sageql/context.py +136 -0
  134. sageql-0.2.1/src/sageql/conversation.py +92 -0
  135. sageql-0.2.1/src/sageql/core.py +47 -0
  136. sageql-0.2.1/src/sageql/discovery.py +188 -0
  137. sageql-0.2.1/src/sageql/errors.py +9 -0
  138. sageql-0.2.1/src/sageql/execution.py +139 -0
  139. sageql-0.2.1/src/sageql/localization.py +98 -0
  140. sageql-0.2.1/src/sageql/odbc_catalog.py +172 -0
  141. sageql-0.2.1/src/sageql/openai_provider.py +79 -0
  142. sageql-0.2.1/src/sageql/planning.py +415 -0
  143. sageql-0.2.1/src/sageql/report_validation.py +233 -0
  144. sageql-0.2.1/src/sageql/schema.py +86 -0
  145. sageql-0.2.1/src/sageql/sdk/__init__.py +36 -0
  146. sageql-0.2.1/src/sageql/sdk/adapters.py +709 -0
  147. sageql-0.2.1/src/sageql/sdk/agents.py +1000 -0
  148. sageql-0.2.1/src/sageql/sdk/business.py +158 -0
  149. sageql-0.2.1/src/sageql/sdk/calendars.py +133 -0
  150. sageql-0.2.1/src/sageql/sdk/comparisons.py +185 -0
  151. sageql-0.2.1/src/sageql/sdk/consistency.py +268 -0
  152. sageql-0.2.1/src/sageql/sdk/day_counts.py +88 -0
  153. sageql-0.2.1/src/sageql/sdk/decreases.py +88 -0
  154. sageql-0.2.1/src/sageql/sdk/engine.py +781 -0
  155. sageql-0.2.1/src/sageql/sdk/evidence.py +1098 -0
  156. sageql-0.2.1/src/sageql/sdk/grounding.py +568 -0
  157. sageql-0.2.1/src/sageql/sdk/intent.py +570 -0
  158. sageql-0.2.1/src/sageql/sdk/labels.py +77 -0
  159. sageql-0.2.1/src/sageql/sdk/lookups.py +130 -0
  160. sageql-0.2.1/src/sageql/sdk/models.py +492 -0
  161. sageql-0.2.1/src/sageql/sdk/names.py +10 -0
  162. sageql-0.2.1/src/sageql/sdk/periods.py +115 -0
  163. sageql-0.2.1/src/sageql/sdk/phrases.py +372 -0
  164. sageql-0.2.1/src/sageql/sdk/provider.py +835 -0
  165. sageql-0.2.1/src/sageql/sdk/relationships.py +238 -0
  166. sageql-0.2.1/src/sageql/sdk/saved.py +133 -0
  167. sageql-0.2.1/src/sageql/sdk/semantics.py +751 -0
  168. sageql-0.2.1/src/sageql/sdk/sessions.py +240 -0
  169. sageql-0.2.1/src/sageql/sdk/vocabulary.py +171 -0
  170. sageql-0.2.1/src/sageql/sql_generation.py +220 -0
  171. sageql-0.2.1/src/sageql/tsql.py +301 -0
  172. sageql-0.2.1/src/sageql/understanding.py +74 -0
  173. sageql-0.2.1/src/sageql/validation.py +50 -0
  174. sageql-0.2.1/tests/conftest.py +124 -0
  175. sageql-0.2.1/tests/test_catalog_input.py +78 -0
  176. sageql-0.2.1/tests/test_chat_cli.py +369 -0
  177. sageql-0.2.1/tests/test_chat_provider.py +366 -0
  178. sageql-0.2.1/tests/test_cli.py +30 -0
  179. sageql-0.2.1/tests/test_context.py +110 -0
  180. sageql-0.2.1/tests/test_conversation.py +100 -0
  181. sageql-0.2.1/tests/test_core.py +47 -0
  182. sageql-0.2.1/tests/test_discovery.py +96 -0
  183. sageql-0.2.1/tests/test_evaluations.py +209 -0
  184. sageql-0.2.1/tests/test_main.py +115 -0
  185. sageql-0.2.1/tests/test_model_comparison.py +172 -0
  186. sageql-0.2.1/tests/test_odbc_catalog.py +93 -0
  187. sageql-0.2.1/tests/test_offline_test_policy.py +108 -0
  188. sageql-0.2.1/tests/test_openai_provider.py +36 -0
  189. sageql-0.2.1/tests/test_phase03_evaluations.py +273 -0
  190. sageql-0.2.1/tests/test_phase06_evaluations.py +401 -0
  191. sageql-0.2.1/tests/test_phase07_evaluations.py +214 -0
  192. sageql-0.2.1/tests/test_phase08_evaluations.py +80 -0
  193. sageql-0.2.1/tests/test_phase11_consistency_probe.py +19 -0
  194. sageql-0.2.1/tests/test_phase11_sqlserver_approval.py +46 -0
  195. sageql-0.2.1/tests/test_phase13_exploratory.py +149 -0
  196. sageql-0.2.1/tests/test_phase14_evaluations.py +136 -0
  197. sageql-0.2.1/tests/test_phase14_replacements.py +35 -0
  198. sageql-0.2.1/tests/test_planning.py +218 -0
  199. sageql-0.2.1/tests/test_release_checks.py +112 -0
  200. sageql-0.2.1/tests/test_report_validation_execution.py +203 -0
  201. sageql-0.2.1/tests/test_sdk_adapters.py +587 -0
  202. sageql-0.2.1/tests/test_sdk_agents.py +922 -0
  203. sageql-0.2.1/tests/test_sdk_application_independence.py +363 -0
  204. sageql-0.2.1/tests/test_sdk_calendars.py +104 -0
  205. sageql-0.2.1/tests/test_sdk_clarification_continuation.py +544 -0
  206. sageql-0.2.1/tests/test_sdk_comparison_changes.py +259 -0
  207. sageql-0.2.1/tests/test_sdk_completion_recovery.py +165 -0
  208. sageql-0.2.1/tests/test_sdk_engine.py +572 -0
  209. sageql-0.2.1/tests/test_sdk_entity_decreases.py +288 -0
  210. sageql-0.2.1/tests/test_sdk_filter_order_grounding.py +354 -0
  211. sageql-0.2.1/tests/test_sdk_final_semantic_invariants.py +179 -0
  212. sageql-0.2.1/tests/test_sdk_intent.py +682 -0
  213. sageql-0.2.1/tests/test_sdk_intent_compile.py +112 -0
  214. sageql-0.2.1/tests/test_sdk_intent_normalization.py +55 -0
  215. sageql-0.2.1/tests/test_sdk_intent_sampling.py +85 -0
  216. sageql-0.2.1/tests/test_sdk_interpretation.py +27 -0
  217. sageql-0.2.1/tests/test_sdk_jalali_provider.py +141 -0
  218. sageql-0.2.1/tests/test_sdk_jalali_sessions.py +182 -0
  219. sageql-0.2.1/tests/test_sdk_labels.py +521 -0
  220. sageql-0.2.1/tests/test_sdk_lookups.py +444 -0
  221. sageql-0.2.1/tests/test_sdk_manager_reports.py +455 -0
  222. sageql-0.2.1/tests/test_sdk_matching_day_counts.py +309 -0
  223. sageql-0.2.1/tests/test_sdk_ordering_without_measure.py +60 -0
  224. sageql-0.2.1/tests/test_sdk_participant_means.py +153 -0
  225. sageql-0.2.1/tests/test_sdk_phase14_continuation.py +107 -0
  226. sageql-0.2.1/tests/test_sdk_provider.py +684 -0
  227. sageql-0.2.1/tests/test_sdk_read_consistency.py +457 -0
  228. sageql-0.2.1/tests/test_sdk_relationships.py +440 -0
  229. sageql-0.2.1/tests/test_sdk_reliability.py +436 -0
  230. sageql-0.2.1/tests/test_sdk_rolling_periods.py +36 -0
  231. sageql-0.2.1/tests/test_sdk_saved_reports.py +143 -0
  232. sageql-0.2.1/tests/test_sdk_semantic_continuation.py +377 -0
  233. sageql-0.2.1/tests/test_sdk_semantic_evidence.py +453 -0
  234. sageql-0.2.1/tests/test_sdk_semantics.py +370 -0
  235. sageql-0.2.1/tests/test_sdk_sessions.py +102 -0
  236. sageql-0.2.1/tests/test_sdk_snapshot_sqlserver.py +224 -0
  237. sageql-0.2.1/tests/test_sdk_sqlserver_phase11_integration.py +190 -0
  238. sageql-0.2.1/tests/test_sdk_stage_models.py +118 -0
  239. sageql-0.2.1/tests/test_sdk_tabular_periods.py +87 -0
  240. sageql-0.2.1/tests/test_sdk_targeted_live_regressions.py +117 -0
  241. sageql-0.2.1/tests/test_sdk_v3_live_regressions.py +114 -0
  242. sageql-0.2.1/tests/test_sdk_v5_live_regressions.py +163 -0
  243. sageql-0.2.1/tests/test_sdk_value_vocabulary.py +421 -0
  244. sageql-0.2.1/tests/test_sdk_web.py +371 -0
  245. sageql-0.2.1/tests/test_sdk_year_answer_recovery.py +158 -0
  246. sageql-0.2.1/tests/test_sql_generation.py +144 -0
  247. sageql-0.2.1/tests/test_understanding.py +82 -0
  248. sageql-0.2.1/tests/test_validation.py +36 -0
  249. sageql-0.2.1/tests/web_tabs.cjs +250 -0
  250. sageql-0.2.1/tools/probe_read_consistency.py +167 -0
  251. sageql-0.2.1/tools/release_check.py +225 -0
  252. sageql-0.2.1/tools/sqlserver_synthetic.py +237 -0
@@ -0,0 +1,14 @@
1
+ # Copy this file to .env and fill in values you want to reuse.
2
+ # Leave a field blank to enter it interactively when the chat starts.
3
+ # Authentication is the method name only; do not put a database password here.
4
+ DB_SERVER_HOST=
5
+ DB_NAME=
6
+ DB_AUTHENTICATION=
7
+ DB_ODBC_DRIVER=
8
+ # Path to the structured table/column catalog supplied by the package user.
9
+ SCHEMA_CATALOG_PATH=
10
+
11
+ # Keep your real API key only in the ignored .env file or an environment variable.
12
+ LLM_API_KEY=
13
+ LLM_BASE_URL=https://api.avalai.ir/v1
14
+ LLM_MODEL=gpt-5-nano
@@ -0,0 +1,122 @@
1
+ name: Offline compatibility and package integrity
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches: [main]
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ package:
14
+ runs-on: ubuntu-latest
15
+ timeout-minutes: 15
16
+ steps:
17
+ - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
18
+ with:
19
+ persist-credentials: false
20
+ - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
21
+ with:
22
+ python-version: '3.12'
23
+ cache: pip
24
+ - run: python -m pip --isolated install --index-url https://pypi.org/simple 'build>=1,<2'
25
+ - run: python -m build --outdir dist/packages
26
+ env:
27
+ SOURCE_DATE_EPOCH: '1735689600'
28
+ - run: >-
29
+ python tools/release_check.py archives --source .
30
+ --wheel dist/packages/sageql-*-py3-none-any.whl
31
+ --sdist dist/packages/sageql-*.tar.gz
32
+ --output dist/inventory.json
33
+ - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
34
+ with:
35
+ name: reviewed-packages
36
+ path: |
37
+ dist/packages/*
38
+ dist/inventory.json
39
+
40
+ runtime:
41
+ strategy:
42
+ fail-fast: false
43
+ matrix:
44
+ include:
45
+ - {os: ubuntu-latest, python: '3.10', bounds: lower}
46
+ - {os: windows-latest, python: '3.10', bounds: lower}
47
+ - {os: ubuntu-latest, python: '3.11', bounds: current}
48
+ - {os: windows-latest, python: '3.12', bounds: extras}
49
+ - {os: ubuntu-latest, python: '3.13', bounds: current}
50
+ - {os: windows-latest, python: '3.13', bounds: current}
51
+ - {os: ubuntu-latest, python: '3.14', bounds: current}
52
+ - {os: ubuntu-latest, python: '3.15', bounds: current}
53
+ runs-on: ${{ matrix.os }}
54
+ timeout-minutes: 20
55
+ defaults:
56
+ run:
57
+ shell: bash
58
+ steps:
59
+ - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
60
+ with:
61
+ persist-credentials: false
62
+ - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
63
+ with:
64
+ python-version: ${{ matrix.python }}
65
+ cache: pip
66
+ - name: Create a clean runtime environment
67
+ run: |
68
+ python -m venv dist/runtime
69
+ if [ "$RUNNER_OS" = "Windows" ]; then
70
+ echo "RUNTIME_PYTHON=$PWD/dist/runtime/Scripts/python.exe" >> "$GITHUB_ENV"
71
+ else
72
+ echo "RUNTIME_PYTHON=$PWD/dist/runtime/bin/python" >> "$GITHUB_ENV"
73
+ fi
74
+ - name: Install core with declared lower bounds
75
+ if: matrix.bounds == 'lower'
76
+ run: '"$RUNTIME_PYTHON" -m pip --isolated install --index-url https://pypi.org/simple . sqlglot==26.0.0 python-dotenv==1.2.0'
77
+ - name: Install independently resolved current core
78
+ if: matrix.bounds != 'lower'
79
+ run: '"$RUNTIME_PYTHON" -m pip --isolated install --index-url https://pypi.org/simple .'
80
+ - name: Installed core imports and examples (before testing extras)
81
+ run: '"$RUNTIME_PYTHON" -I tools/release_check.py smoke --source . --core-only --output dist/core-smoke.json'
82
+ - name: Install current optional extras
83
+ if: matrix.bounds == 'extras'
84
+ run: '"$RUNTIME_PYTHON" -m pip --isolated install --index-url https://pypi.org/simple ".[openai,odbc,dev]"'
85
+ - name: Real optional imports and client construction without network
86
+ if: matrix.bounds == 'extras'
87
+ run: '"$RUNTIME_PYTHON" -I tools/release_check.py smoke --source . --extras --output dist/extras-smoke.json'
88
+ - name: Install minimum test tooling
89
+ if: matrix.bounds == 'lower'
90
+ run: '"$RUNTIME_PYTHON" -m pip --isolated install --index-url https://pypi.org/simple pytest==8.0.0'
91
+ - name: Install current test tooling
92
+ if: matrix.bounds == 'current'
93
+ run: '"$RUNTIME_PYTHON" -m pip --isolated install --index-url https://pypi.org/simple "pytest>=8,<10"'
94
+ - name: SQLite-first tests and every offline evaluation
95
+ run: '"$RUNTIME_PYTHON" tools/release_check.py offline --source . --output dist/gates/results.json'
96
+ - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
97
+ if: always()
98
+ with:
99
+ name: evidence-${{ matrix.os }}-${{ matrix.python }}-${{ matrix.bounds }}
100
+ path: |
101
+ dist/gates/
102
+ dist/*smoke.json
103
+ retention-days: 14
104
+
105
+ source-install:
106
+ runs-on: ubuntu-latest
107
+ timeout-minutes: 15
108
+ steps:
109
+ - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
110
+ with:
111
+ persist-credentials: false
112
+ - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
113
+ with:
114
+ python-version: '3.12'
115
+ - run: python -m pip --isolated install --index-url https://pypi.org/simple 'build>=1,<2'
116
+ - run: python -m build --outdir dist/packages
117
+ - run: python -m venv dist/from-sdist
118
+ - run: dist/from-sdist/bin/python -m pip --isolated install --index-url https://pypi.org/simple dist/packages/sageql-*.tar.gz
119
+ - run: dist/from-sdist/bin/python -I tools/release_check.py smoke --source . --core-only --output dist/sdist-smoke.json
120
+ - run: python -m venv dist/editable
121
+ - run: dist/editable/bin/python -m pip --isolated install --index-url https://pypi.org/simple -e .
122
+ - run: dist/editable/bin/python -I tools/release_check.py smoke --source . --core-only --editable --output dist/editable-smoke.json
@@ -0,0 +1,56 @@
1
+ name: Publish to PyPI
2
+
3
+ # Runs when a version tag is pushed. PyPI trusts this workflow through OIDC
4
+ # (trusted publishing), so no API token is stored in the repository.
5
+ on:
6
+ push:
7
+ tags: ['v*']
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ build:
14
+ runs-on: ubuntu-latest
15
+ timeout-minutes: 15
16
+ steps:
17
+ - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
18
+ with:
19
+ persist-credentials: false
20
+ - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
21
+ with:
22
+ python-version: '3.12'
23
+ - name: Tag matches the package version
24
+ run: |
25
+ version=$(sed -n 's/^version = "\(.*\)"/\1/p' pyproject.toml)
26
+ test "v$version" = "$GITHUB_REF_NAME" || { echo "Tag $GITHUB_REF_NAME does not match version $version"; exit 1; }
27
+ - run: python -m pip --isolated install --index-url https://pypi.org/simple 'build>=1,<2' 'twine>=7,<8'
28
+ - run: python -m build --outdir dist/packages
29
+ env:
30
+ SOURCE_DATE_EPOCH: '1735689600'
31
+ - run: >-
32
+ python tools/release_check.py archives --source .
33
+ --wheel dist/packages/sageql-*-py3-none-any.whl
34
+ --sdist dist/packages/sageql-*.tar.gz
35
+ --output dist/inventory.json
36
+ - run: python -m twine check --strict dist/packages/*
37
+ - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
38
+ with:
39
+ name: distributions
40
+ path: dist/packages/*
41
+
42
+ publish:
43
+ needs: build
44
+ runs-on: ubuntu-latest
45
+ timeout-minutes: 10
46
+ environment:
47
+ name: pypi
48
+ url: https://pypi.org/project/sageql/
49
+ permissions:
50
+ id-token: write
51
+ steps:
52
+ - uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6
53
+ with:
54
+ name: distributions
55
+ path: dist
56
+ - uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
@@ -0,0 +1,13 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ .pytest_cache/
4
+ .venv/
5
+ dist/
6
+ *.egg-info/
7
+ .env
8
+ # Private Rahtal host: kept locally, never published.
9
+ sageql_rahtal/
10
+ docs/RAHTAL_MANUAL_TEST.md
11
+ tests/test_rahtal_*.py
12
+ tests/test_tsql_rahtal.py
13
+ .claude/
sageql-0.2.1/AGENTS.md ADDED
@@ -0,0 +1,15 @@
1
+ # SageQL agent entry point
2
+
3
+ Read [agent-rules/Agent.md](agent-rules/Agent.md) before changing anything. It holds
4
+ the product contract, the hard safety rules and the working workflow.
5
+
6
+ Where things are:
7
+
8
+ - Current state and ordered next steps: [docs/ROADMAP.md](docs/ROADMAP.md).
9
+ - Rationale for the plan: [docs/IMPROVEMENT_RECOMMENDATIONS.md](docs/IMPROVEMENT_RECOMMENDATIONS.md).
10
+ - Feature contracts: `docs/SDK*.md` (saved reports: [docs/SDK_SAVED_REPORTS.md](docs/SDK_SAVED_REPORTS.md)) (start with [docs/SDK.md](docs/SDK.md) and
11
+ [docs/SDK_AGENTS.md](docs/SDK_AGENTS.md)).
12
+ - Tests: [docs/SQLITE_FIRST_TESTING.md](docs/SQLITE_FIRST_TESTING.md); evaluations:
13
+ [evaluations/README.md](evaluations/README.md).
14
+
15
+ When reporting work, include a commit message based on the actual changes.
@@ -0,0 +1,69 @@
1
+ # Changelog
2
+
3
+ ## 0.2.1 — 2026-10-30
4
+
5
+ First release published to PyPI (`pip install sageql`). No SDK behavior changes.
6
+
7
+ ### Fixed
8
+ - CI: frozen evaluation inputs are hashed with LF-normalized line endings
9
+ (`evaluations/frozen.py`), so the offline gate passes on any checkout; package
10
+ jobs no longer hard-code the `0.1.0` archive names.
11
+
12
+ ### Changed
13
+ - README rewritten around the design, measured results and an offline
14
+ quickstart; the long feature description moved to `docs/CAPABILITIES.md`.
15
+ - Package metadata: author, keywords, classifiers and project URLs. README links
16
+ are absolute so they work on PyPI.
17
+
18
+ ### Added
19
+ - Tag-triggered PyPI release workflow using trusted publishing (no stored token).
20
+
21
+ ### Removed
22
+ - The private Rahtal host (`sageql_rahtal/`), its dedicated tests and manual test
23
+ guide are no longer published or packaged. Tests that use its catalog skip
24
+ when it is absent.
25
+
26
+ ## 0.2.0 — 2026-10-30
27
+
28
+ Cheaper, faster and more accurate report understanding, plus saved reports.
29
+
30
+ ### Added
31
+ - **Saved reports**: save a finished report and re-run it with zero model calls,
32
+ fresh data and moving dates (`save_report`, `list_saved_reports`,
33
+ `run_saved_report`, `delete_saved_report`; in-memory and SQLite stores).
34
+ See `docs/SDK_SAVED_REPORTS.md`.
35
+ - **Per-stage models and reasoning effort** on `OpenAIReportAgent`
36
+ (`stage_models`, `reasoning_effort`) and per-stage token usage events.
37
+ - **`OpenAIReportAgent.recommended(config)`**: the measured cheap setup
38
+ (mini intent, compiled spec, no reviewer call, low reasoning effort).
39
+ - **`compile_intent`**: a complete intent compiles locally, skipping the planner call.
40
+ - **`review=False`**: accept candidates that pass every local check without a reviewer call.
41
+ - **`intent_samples`**: optional parallel intent extractions with an agreement
42
+ vote; one failed sample no longer fails the turn (live accuracy not yet measured).
43
+ - **Report interpretation**: each report lists the filters, conditions, sort and
44
+ row limit it applied (`provenance["interpretation"]`), shown on the web page.
45
+ - **Rahtal test panel and guide**: 20 example questions with expected outcomes
46
+ and read-only SQL cross-checks (private guide).
47
+ - **Live evaluation levels** (`smoke`, `standard`, `full`) with hard spending caps,
48
+ per-model pricing, and a halt on HTTP 429.
49
+
50
+ ### Changed
51
+ - Rahtal and the reference web host use mini intent, compiled spec, no reviewer
52
+ call and low reasoning effort: 22/27 correct synthetic reports versus 6/27 for
53
+ nano everywhere, ~7 s and usually one model call per turn.
54
+ - SDK defaults are unchanged for backward compatibility; use `recommended()`.
55
+
56
+ ### Fixed
57
+ - Model output that filled controls marked "unspecified" with placeholder
58
+ values is cleaned instead of rejected.
59
+ - A ranking with no chosen measure asks for it instead of sorting by a default metric.
60
+ - Report interpretation never shows identities resolved from name lookups.
61
+
62
+ ### Removed
63
+ - Historical phase reports, procedures and versioned evidence (kept in git history).
64
+
65
+ ### Known limits
66
+ - Released without the manual Rahtal real-data check; live checks cover the
67
+ synthetic legacy cohort (21/21 turns correct).
68
+ - Native SQL Server behavior unverified; local workspace token instead of user login.
69
+ - No share-of-total, absence or per-group top-N operations; saved reports are personal.
sageql-0.2.1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Sina Qasempour
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.