datacharter 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (194) hide show
  1. datacharter-0.1.0/.github/workflows/banned-terms.yml +26 -0
  2. datacharter-0.1.0/.github/workflows/release.yml +51 -0
  3. datacharter-0.1.0/.github/workflows/test.yml +91 -0
  4. datacharter-0.1.0/.gitignore +35 -0
  5. datacharter-0.1.0/.impeccable/hook.cache.json +1 -0
  6. datacharter-0.1.0/CHANGELOG.md +80 -0
  7. datacharter-0.1.0/CLAUDE.md +103 -0
  8. datacharter-0.1.0/LICENSE +202 -0
  9. datacharter-0.1.0/PKG-INFO +115 -0
  10. datacharter-0.1.0/README.md +72 -0
  11. datacharter-0.1.0/TRADEMARKS.md +56 -0
  12. datacharter-0.1.0/brand/README.md +9 -0
  13. datacharter-0.1.0/brand/hero.png +0 -0
  14. datacharter-0.1.0/brand/mark.svg +13 -0
  15. datacharter-0.1.0/brand/screenshot-m4-agent.png +0 -0
  16. datacharter-0.1.0/brand/screenshot-m5-complete.png +0 -0
  17. datacharter-0.1.0/brand/screenshot-m5-core.png +0 -0
  18. datacharter-0.1.0/brand/screenshot-m5-features.png +0 -0
  19. datacharter-0.1.0/compose.yaml +35 -0
  20. datacharter-0.1.0/docs/DESIGN.md +259 -0
  21. datacharter-0.1.0/docs/PLAN.md +126 -0
  22. datacharter-0.1.0/docs/PROGRESS.md +283 -0
  23. datacharter-0.1.0/docs/SECURITY_AUDIT.md +526 -0
  24. datacharter-0.1.0/docs/TUTORIAL_MODE.md +104 -0
  25. datacharter-0.1.0/docs/_config.yml +17 -0
  26. datacharter-0.1.0/docs/about.md +67 -0
  27. datacharter-0.1.0/docs/agent.md +78 -0
  28. datacharter-0.1.0/docs/assets/hero.png +0 -0
  29. datacharter-0.1.0/docs/assets/screenshot.png +0 -0
  30. datacharter-0.1.0/docs/charter-yaml.md +218 -0
  31. datacharter-0.1.0/docs/faq.md +92 -0
  32. datacharter-0.1.0/docs/index.html +332 -0
  33. datacharter-0.1.0/docs/quickstart.md +136 -0
  34. datacharter-0.1.0/docs/security.md +74 -0
  35. datacharter-0.1.0/docs/sources.md +101 -0
  36. datacharter-0.1.0/docs/workspace.md +39 -0
  37. datacharter-0.1.0/pyproject.toml +79 -0
  38. datacharter-0.1.0/scripts/build_ui.sh +11 -0
  39. datacharter-0.1.0/src/datacharter/__init__.py +3 -0
  40. datacharter-0.1.0/src/datacharter/agent/__init__.py +5 -0
  41. datacharter-0.1.0/src/datacharter/agent/llm.py +119 -0
  42. datacharter-0.1.0/src/datacharter/agent/loop.py +103 -0
  43. datacharter-0.1.0/src/datacharter/agent/tools.py +146 -0
  44. datacharter-0.1.0/src/datacharter/cli.py +249 -0
  45. datacharter-0.1.0/src/datacharter/contracts/__init__.py +5 -0
  46. datacharter-0.1.0/src/datacharter/contracts/loader.py +147 -0
  47. datacharter-0.1.0/src/datacharter/contracts/resolve.py +74 -0
  48. datacharter-0.1.0/src/datacharter/engine/__init__.py +1 -0
  49. datacharter-0.1.0/src/datacharter/engine/aggregate.py +218 -0
  50. datacharter-0.1.0/src/datacharter/engine/guard.py +142 -0
  51. datacharter-0.1.0/src/datacharter/engine/pushdown.py +261 -0
  52. datacharter-0.1.0/src/datacharter/engine/scrub.py +19 -0
  53. datacharter-0.1.0/src/datacharter/engine/session.py +413 -0
  54. datacharter-0.1.0/src/datacharter/engine/snowflake.py +153 -0
  55. datacharter-0.1.0/src/datacharter/engine/sources.py +140 -0
  56. datacharter-0.1.0/src/datacharter/models.py +72 -0
  57. datacharter-0.1.0/src/datacharter/server/__init__.py +5 -0
  58. datacharter-0.1.0/src/datacharter/server/app.py +355 -0
  59. datacharter-0.1.0/src/datacharter/server/static/assets/abap-DLDM7-KI.js +1 -0
  60. datacharter-0.1.0/src/datacharter/server/static/assets/apex-DNDY2TF8.js +1 -0
  61. datacharter-0.1.0/src/datacharter/server/static/assets/azcli-Y6nb8tq_.js +1 -0
  62. datacharter-0.1.0/src/datacharter/server/static/assets/bat-BwHxbl9M.js +1 -0
  63. datacharter-0.1.0/src/datacharter/server/static/assets/bicep-CFznDFnq.js +2 -0
  64. datacharter-0.1.0/src/datacharter/server/static/assets/cameligo-Bf6VGUru.js +1 -0
  65. datacharter-0.1.0/src/datacharter/server/static/assets/clojure-Dnu-v4kV.js +1 -0
  66. datacharter-0.1.0/src/datacharter/server/static/assets/codicon-Brq4_Ui5.ttf +0 -0
  67. datacharter-0.1.0/src/datacharter/server/static/assets/coffee-Bd8akH9Z.js +1 -0
  68. datacharter-0.1.0/src/datacharter/server/static/assets/cpp-BbWJElDN.js +1 -0
  69. datacharter-0.1.0/src/datacharter/server/static/assets/csharp-Co3qMtFm.js +1 -0
  70. datacharter-0.1.0/src/datacharter/server/static/assets/csp-D-4FJmMZ.js +1 -0
  71. datacharter-0.1.0/src/datacharter/server/static/assets/css-DdJfP1eB.js +3 -0
  72. datacharter-0.1.0/src/datacharter/server/static/assets/css.worker-CqwWTjeG.js +97 -0
  73. datacharter-0.1.0/src/datacharter/server/static/assets/cssMode-BuAVOLr4.js +1 -0
  74. datacharter-0.1.0/src/datacharter/server/static/assets/cypher-cTPe9QuQ.js +1 -0
  75. datacharter-0.1.0/src/datacharter/server/static/assets/dart-BOtBlQCF.js +1 -0
  76. datacharter-0.1.0/src/datacharter/server/static/assets/dockerfile-BG73LgW2.js +1 -0
  77. datacharter-0.1.0/src/datacharter/server/static/assets/ecl-BEgZUVRK.js +1 -0
  78. datacharter-0.1.0/src/datacharter/server/static/assets/editor.worker-DCKwvLbM.js +30 -0
  79. datacharter-0.1.0/src/datacharter/server/static/assets/elixir-BkW5O-1t.js +1 -0
  80. datacharter-0.1.0/src/datacharter/server/static/assets/flow9-BeJ5waoc.js +1 -0
  81. datacharter-0.1.0/src/datacharter/server/static/assets/freemarker2-DM0thzwF.js +3 -0
  82. datacharter-0.1.0/src/datacharter/server/static/assets/fsharp-PahG7c26.js +1 -0
  83. datacharter-0.1.0/src/datacharter/server/static/assets/go-acbASCJo.js +1 -0
  84. datacharter-0.1.0/src/datacharter/server/static/assets/graphql-BxJiqAUM.js +1 -0
  85. datacharter-0.1.0/src/datacharter/server/static/assets/handlebars-BkMf3Qj4.js +1 -0
  86. datacharter-0.1.0/src/datacharter/server/static/assets/hcl-DtV1sZF8.js +1 -0
  87. datacharter-0.1.0/src/datacharter/server/static/assets/html-KeNy2AFd.js +1 -0
  88. datacharter-0.1.0/src/datacharter/server/static/assets/html.worker-DhJ4VZMp.js +474 -0
  89. datacharter-0.1.0/src/datacharter/server/static/assets/htmlMode-CN5rSB9p.js +1 -0
  90. datacharter-0.1.0/src/datacharter/server/static/assets/index-BqWIVR2x.css +1 -0
  91. datacharter-0.1.0/src/datacharter/server/static/assets/index-CCTlsFBM.js +295 -0
  92. datacharter-0.1.0/src/datacharter/server/static/assets/ini-Kd9XrMLS.js +1 -0
  93. datacharter-0.1.0/src/datacharter/server/static/assets/java-CXBNlu9o.js +1 -0
  94. datacharter-0.1.0/src/datacharter/server/static/assets/javascript-CZu1iw4q.js +1 -0
  95. datacharter-0.1.0/src/datacharter/server/static/assets/json.worker-BF9eV5mS.js +62 -0
  96. datacharter-0.1.0/src/datacharter/server/static/assets/jsonMode-BtMXpE2Q.js +7 -0
  97. datacharter-0.1.0/src/datacharter/server/static/assets/julia-cl7-CwDS.js +1 -0
  98. datacharter-0.1.0/src/datacharter/server/static/assets/kotlin-s7OhZKlX.js +1 -0
  99. datacharter-0.1.0/src/datacharter/server/static/assets/less-9HpZscsL.js +2 -0
  100. datacharter-0.1.0/src/datacharter/server/static/assets/lexon-OrD6JF1K.js +1 -0
  101. datacharter-0.1.0/src/datacharter/server/static/assets/liquid-mhqehfbE.js +1 -0
  102. datacharter-0.1.0/src/datacharter/server/static/assets/lspLanguageFeatures-D1NXFkgg.js +4 -0
  103. datacharter-0.1.0/src/datacharter/server/static/assets/lua-Cyyb5UIc.js +1 -0
  104. datacharter-0.1.0/src/datacharter/server/static/assets/m3-B8OfTtLu.js +1 -0
  105. datacharter-0.1.0/src/datacharter/server/static/assets/markdown-BFxVWTOG.js +1 -0
  106. datacharter-0.1.0/src/datacharter/server/static/assets/mdx-69yOd9f1.js +1 -0
  107. datacharter-0.1.0/src/datacharter/server/static/assets/mips-CiqrrVzr.js +1 -0
  108. datacharter-0.1.0/src/datacharter/server/static/assets/monaco-CB2SckMT.css +1 -0
  109. datacharter-0.1.0/src/datacharter/server/static/assets/monaco-DNze5gXB.js +930 -0
  110. datacharter-0.1.0/src/datacharter/server/static/assets/msdax-DmeGPVcC.js +1 -0
  111. datacharter-0.1.0/src/datacharter/server/static/assets/mysql-C_tMU-Nz.js +1 -0
  112. datacharter-0.1.0/src/datacharter/server/static/assets/objective-c-BDtDVThU.js +1 -0
  113. datacharter-0.1.0/src/datacharter/server/static/assets/pascal-vHIfCaH5.js +1 -0
  114. datacharter-0.1.0/src/datacharter/server/static/assets/pascaligo-DtZ0uQbO.js +1 -0
  115. datacharter-0.1.0/src/datacharter/server/static/assets/perl-Ub6l9XKa.js +1 -0
  116. datacharter-0.1.0/src/datacharter/server/static/assets/pgsql-BlNEE0v7.js +1 -0
  117. datacharter-0.1.0/src/datacharter/server/static/assets/php-BBUBE1dy.js +1 -0
  118. datacharter-0.1.0/src/datacharter/server/static/assets/pla-DSh2-awV.js +1 -0
  119. datacharter-0.1.0/src/datacharter/server/static/assets/postiats-CocnycG-.js +1 -0
  120. datacharter-0.1.0/src/datacharter/server/static/assets/powerquery-tScXyioY.js +1 -0
  121. datacharter-0.1.0/src/datacharter/server/static/assets/powershell-COWaemsV.js +1 -0
  122. datacharter-0.1.0/src/datacharter/server/static/assets/protobuf-Brw8urJB.js +2 -0
  123. datacharter-0.1.0/src/datacharter/server/static/assets/pug-8SOpv6rk.js +1 -0
  124. datacharter-0.1.0/src/datacharter/server/static/assets/python-C5qpjWC4.js +1 -0
  125. datacharter-0.1.0/src/datacharter/server/static/assets/qsharp-Bw9ernYp.js +1 -0
  126. datacharter-0.1.0/src/datacharter/server/static/assets/r-j7ic8hl3.js +1 -0
  127. datacharter-0.1.0/src/datacharter/server/static/assets/razor-fg0l3XC9.js +1 -0
  128. datacharter-0.1.0/src/datacharter/server/static/assets/redis-Bu5POkcn.js +1 -0
  129. datacharter-0.1.0/src/datacharter/server/static/assets/redshift-Bs9aos_-.js +1 -0
  130. datacharter-0.1.0/src/datacharter/server/static/assets/restructuredtext-CqXO7rUv.js +1 -0
  131. datacharter-0.1.0/src/datacharter/server/static/assets/ruby-zBfavPgS.js +1 -0
  132. datacharter-0.1.0/src/datacharter/server/static/assets/rust-BzKRNQWT.js +1 -0
  133. datacharter-0.1.0/src/datacharter/server/static/assets/sb-BBc9UKZt.js +1 -0
  134. datacharter-0.1.0/src/datacharter/server/static/assets/scala-D9hQfWCl.js +1 -0
  135. datacharter-0.1.0/src/datacharter/server/static/assets/scheme-BPhDTwHR.js +1 -0
  136. datacharter-0.1.0/src/datacharter/server/static/assets/scss-CBJaRo0y.js +3 -0
  137. datacharter-0.1.0/src/datacharter/server/static/assets/shell-DiJ1NA_G.js +1 -0
  138. datacharter-0.1.0/src/datacharter/server/static/assets/solidity-Db0IVjzk.js +1 -0
  139. datacharter-0.1.0/src/datacharter/server/static/assets/sophia-CnS9iZB_.js +1 -0
  140. datacharter-0.1.0/src/datacharter/server/static/assets/sparql-CJmd_6j2.js +1 -0
  141. datacharter-0.1.0/src/datacharter/server/static/assets/sql-ClhHkBeG.js +1 -0
  142. datacharter-0.1.0/src/datacharter/server/static/assets/st-CHwy0fLd.js +1 -0
  143. datacharter-0.1.0/src/datacharter/server/static/assets/swift-Bqt4WxQ4.js +3 -0
  144. datacharter-0.1.0/src/datacharter/server/static/assets/systemverilog-Bs9z6M-B.js +1 -0
  145. datacharter-0.1.0/src/datacharter/server/static/assets/tcl-Dm6ycUr_.js +1 -0
  146. datacharter-0.1.0/src/datacharter/server/static/assets/ts.worker-DTZAwq0V.js +67735 -0
  147. datacharter-0.1.0/src/datacharter/server/static/assets/tsMode-CaXNdXrQ.js +11 -0
  148. datacharter-0.1.0/src/datacharter/server/static/assets/twig-Csy3S7wG.js +1 -0
  149. datacharter-0.1.0/src/datacharter/server/static/assets/typescript-CCbVPqil.js +1 -0
  150. datacharter-0.1.0/src/datacharter/server/static/assets/typespec-Btyra-wh.js +1 -0
  151. datacharter-0.1.0/src/datacharter/server/static/assets/vb-Db0cS2oM.js +1 -0
  152. datacharter-0.1.0/src/datacharter/server/static/assets/wgsl-BTesnYfV.js +298 -0
  153. datacharter-0.1.0/src/datacharter/server/static/assets/workers-CwEVRSMl.js +1 -0
  154. datacharter-0.1.0/src/datacharter/server/static/assets/xml-CIpcyvha.js +1 -0
  155. datacharter-0.1.0/src/datacharter/server/static/assets/yaml-CiikAWeE.js +1 -0
  156. datacharter-0.1.0/src/datacharter/server/static/index.html +15 -0
  157. datacharter-0.1.0/tests/agent/test_agent.py +111 -0
  158. datacharter-0.1.0/tests/agent/test_llm_wire.py +70 -0
  159. datacharter-0.1.0/tests/contracts/test_loader.py +168 -0
  160. datacharter-0.1.0/tests/engine/test_aggregate.py +262 -0
  161. datacharter-0.1.0/tests/engine/test_federation.py +272 -0
  162. datacharter-0.1.0/tests/engine/test_guard.py +130 -0
  163. datacharter-0.1.0/tests/engine/test_pushdown.py +133 -0
  164. datacharter-0.1.0/tests/engine/test_scrub.py +20 -0
  165. datacharter-0.1.0/tests/engine/test_session.py +120 -0
  166. datacharter-0.1.0/tests/engine/test_sources.py +67 -0
  167. datacharter-0.1.0/tests/integration/seed/mysql.sql +10 -0
  168. datacharter-0.1.0/tests/integration/seed/postgres.sql +9 -0
  169. datacharter-0.1.0/tests/integration/test_live_sources.py +159 -0
  170. datacharter-0.1.0/tests/server/test_api.py +216 -0
  171. datacharter-0.1.0/tests/test_cli_init.py +62 -0
  172. datacharter-0.1.0/tests/test_packaging_e2e.py +43 -0
  173. datacharter-0.1.0/tests/test_scaffold.py +5 -0
  174. datacharter-0.1.0/tests/test_secrets_cli.py +59 -0
  175. datacharter-0.1.0/ui/.impeccable/hook.cache.json +1 -0
  176. datacharter-0.1.0/ui/index.html +12 -0
  177. datacharter-0.1.0/ui/package-lock.json +2941 -0
  178. datacharter-0.1.0/ui/package.json +30 -0
  179. datacharter-0.1.0/ui/src/App.tsx +293 -0
  180. datacharter-0.1.0/ui/src/api.ts +55 -0
  181. datacharter-0.1.0/ui/src/components/ChartPanel.tsx +81 -0
  182. datacharter-0.1.0/ui/src/components/ChatPanel.tsx +165 -0
  183. datacharter-0.1.0/ui/src/components/QueryFiles.tsx +60 -0
  184. datacharter-0.1.0/ui/src/components/ResultsGrid.tsx +130 -0
  185. datacharter-0.1.0/ui/src/components/SourceTree.tsx +97 -0
  186. datacharter-0.1.0/ui/src/components/Tutorial.tsx +151 -0
  187. datacharter-0.1.0/ui/src/lib/chartSpec.ts +91 -0
  188. datacharter-0.1.0/ui/src/lib/columns.ts +26 -0
  189. datacharter-0.1.0/ui/src/main.tsx +11 -0
  190. datacharter-0.1.0/ui/src/monaco.ts +76 -0
  191. datacharter-0.1.0/ui/src/styles.css +617 -0
  192. datacharter-0.1.0/ui/src/vite-env.d.ts +1 -0
  193. datacharter-0.1.0/ui/tsconfig.json +16 -0
  194. datacharter-0.1.0/ui/vite.config.ts +19 -0
@@ -0,0 +1,26 @@
1
+ name: banned-terms
2
+
3
+ # Release-hygiene gate: certain terms must never appear in this codebase,
4
+ # in any file, on any branch. The patterns below use single-character
5
+ # classes (e.g. "[p]attern") so this workflow file never contains the
6
+ # literal terms it bans — meaning the check can ship in the public repo
7
+ # without flagging itself.
8
+
9
+ on:
10
+ push:
11
+ pull_request:
12
+
13
+ jobs:
14
+ scan:
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+ - name: Scan for banned terms
19
+ run: |
20
+ set -e
21
+ PATTERN='[p]anasonic|[k]anpai|[a]idp|[g]aai|[p]rdca|[y]ohana|[p]well'
22
+ if grep -riE "$PATTERN" --exclude-dir=.git .; then
23
+ echo "::error::Banned term found — see matches above."
24
+ exit 1
25
+ fi
26
+ echo "Clean."
@@ -0,0 +1,51 @@
1
+ # Publishes to PyPI via Trusted Publishing (OIDC) — no stored token.
2
+ #
3
+ # One-time PyPI setup (Project → Publishing → Add a pending publisher):
4
+ # PyPI Project name: datacharter
5
+ # Owner: datacharter
6
+ # Repository name: datacharter
7
+ # Workflow filename: release.yml
8
+ # Environment name: pypi
9
+ # Then create a GitHub Release (tag like v0.1.0) to trigger this workflow.
10
+ name: release
11
+
12
+ on:
13
+ release:
14
+ types: [published]
15
+
16
+ jobs:
17
+ build:
18
+ runs-on: ubuntu-latest
19
+ steps:
20
+ - uses: actions/checkout@v4
21
+ - uses: actions/setup-node@v4
22
+ with:
23
+ node-version: 22
24
+ cache: npm
25
+ cache-dependency-path: ui/package-lock.json
26
+ - uses: astral-sh/setup-uv@v4
27
+ - name: Build UI into the package
28
+ run: ./scripts/build_ui.sh
29
+ - name: Build sdist + wheel
30
+ run: uv build
31
+ - name: Validate metadata and README rendering
32
+ run: uvx twine check dist/*
33
+ - uses: actions/upload-artifact@v4
34
+ with:
35
+ name: dist
36
+ path: dist/
37
+
38
+ publish:
39
+ needs: build
40
+ runs-on: ubuntu-latest
41
+ environment:
42
+ name: pypi
43
+ url: https://pypi.org/project/datacharter/
44
+ permissions:
45
+ id-token: write # OIDC token for PyPI Trusted Publishing
46
+ steps:
47
+ - uses: actions/download-artifact@v4
48
+ with:
49
+ name: dist
50
+ path: dist/
51
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,91 @@
1
+ name: test
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+
7
+ jobs:
8
+ test:
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - uses: actions/checkout@v4
12
+ - uses: astral-sh/setup-uv@v4
13
+ - name: Install
14
+ run: uv venv && uv pip install -e ".[dev]"
15
+ - name: Lint
16
+ run: .venv/bin/ruff check .
17
+ - name: Unit tests
18
+ run: .venv/bin/pytest -q
19
+
20
+ integration:
21
+ runs-on: ubuntu-latest
22
+ services:
23
+ postgres:
24
+ image: postgres:16-alpine
25
+ env:
26
+ POSTGRES_USER: charter
27
+ POSTGRES_PASSWORD: charter_test_pw
28
+ POSTGRES_DB: demo
29
+ ports:
30
+ - 55432:5432
31
+ options: >-
32
+ --health-cmd "pg_isready -U charter -d demo"
33
+ --health-interval 2s --health-timeout 2s --health-retries 30
34
+ mysql:
35
+ image: mysql:8.4
36
+ env:
37
+ MYSQL_ROOT_PASSWORD: root_test_pw
38
+ MYSQL_USER: charter
39
+ MYSQL_PASSWORD: charter_test_pw
40
+ MYSQL_DATABASE: demo
41
+ ports:
42
+ - 53306:3306
43
+ options: >-
44
+ --health-cmd "mysqladmin ping -h 127.0.0.1 -pcharter_test_pw -ucharter"
45
+ --health-interval 2s --health-timeout 2s --health-retries 60
46
+ steps:
47
+ - uses: actions/checkout@v4
48
+ - uses: astral-sh/setup-uv@v4
49
+ - name: Install
50
+ run: uv venv && uv pip install -e ".[dev]"
51
+ - name: Seed databases
52
+ run: |
53
+ sudo apt-get install -y -q postgresql-client mysql-client >/dev/null
54
+ PGPASSWORD=charter_test_pw psql -h 127.0.0.1 -p 55432 -U charter -d demo \
55
+ -f tests/integration/seed/postgres.sql
56
+ mysql -h 127.0.0.1 -P 53306 -ucharter -pcharter_test_pw demo \
57
+ < tests/integration/seed/mysql.sql
58
+ - name: Integration tests
59
+ run: .venv/bin/pytest -m integration -q
60
+
61
+ ui:
62
+ runs-on: ubuntu-latest
63
+ steps:
64
+ - uses: actions/checkout@v4
65
+ - uses: actions/setup-node@v4
66
+ with:
67
+ node-version: 22
68
+ cache: npm
69
+ cache-dependency-path: ui/package-lock.json
70
+ - name: Install
71
+ run: cd ui && npm ci
72
+ - name: Typecheck + build
73
+ run: cd ui && npm run build
74
+
75
+ package:
76
+ runs-on: ubuntu-latest
77
+ steps:
78
+ - uses: actions/checkout@v4
79
+ - uses: actions/setup-node@v4
80
+ with:
81
+ node-version: 22
82
+ cache: npm
83
+ cache-dependency-path: ui/package-lock.json
84
+ - uses: astral-sh/setup-uv@v4
85
+ - name: Build UI into package
86
+ run: ./scripts/build_ui.sh
87
+ - name: Install + e2e
88
+ run: |
89
+ uv venv
90
+ uv pip install -e ".[dev]"
91
+ .venv/bin/pytest -m e2e -q
@@ -0,0 +1,35 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ .venv/
5
+ venv/
6
+ dist/
7
+ build/
8
+ *.egg-info/
9
+ .pytest_cache/
10
+ .ruff_cache/
11
+ .coverage
12
+
13
+ # Node
14
+ node_modules/
15
+ *.local
16
+
17
+ # Env / secrets
18
+ .env
19
+ .env.*
20
+ !.env.example
21
+
22
+ # DuckDB local artifacts
23
+ *.duckdb
24
+ *.duckdb.wal
25
+
26
+ # OS / editor
27
+ .DS_Store
28
+ .idea/
29
+ .vscode/
30
+
31
+ # UI build output (built in CI / at release)
32
+ ui/dist/
33
+ ui/*.tsbuildinfo
34
+ src/datacharter/server/static/
35
+ .claude/
@@ -0,0 +1 @@
1
+ {"version":1,"sessions":{"4526dd9e-e6b7-4c46-91fd-b88f1a601f85":{"updatedAt":1784780655809,"files":{"/Users/rishi.mashelkar/Desktop/git-repo/datacharter/ui/vite.config.ts":{"editCount":1,"findings":[]},"/Users/rishi.mashelkar/Desktop/git-repo/datacharter/ui/index.html":{"editCount":1,"findings":[]},"/Users/rishi.mashelkar/Desktop/git-repo/datacharter/ui/src/api.ts":{"editCount":2,"findings":[]},"/Users/rishi.mashelkar/Desktop/git-repo/datacharter/ui/src/main.tsx":{"editCount":1,"findings":[]},"/Users/rishi.mashelkar/Desktop/git-repo/datacharter/ui/src/styles.css":{"editCount":3,"findings":[]},"/Users/rishi.mashelkar/Desktop/git-repo/datacharter/ui/src/components/SourceTree.tsx":{"editCount":1,"findings":[]},"/Users/rishi.mashelkar/Desktop/git-repo/datacharter/ui/src/components/ResultsGrid.tsx":{"editCount":2,"findings":[]},"/Users/rishi.mashelkar/Desktop/git-repo/datacharter/ui/src/App.tsx":{"editCount":1,"findings":[]},"/Users/rishi.mashelkar/Desktop/git-repo/datacharter/ui/src/components/ChatPanel.tsx":{"editCount":1,"findings":[]}}}}}
@@ -0,0 +1,80 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ Format: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
5
+
6
+ ## [Unreleased]
7
+
8
+ ## [0.1.0] - 2026-07-23
9
+
10
+ First public release.
11
+
12
+ ### Packaging
13
+
14
+ - Self-contained wheel: the web UI is bundled into the package, so
15
+ `pip install datacharter` (or `uvx datacharter`) runs the full app with
16
+ no Node toolchain and no repo checkout.
17
+
18
+ ### Added
19
+
20
+ - Federation parity (D10): BigQuery and SQL Server via DuckDB community
21
+ extensions; Snowflake via connector-extract fallback; uniform
22
+ `source__table` compatibility views across every source; per-source
23
+ filter/projection pushdown with EXPLAIN-verified tests.
24
+ - Connector pushdown planner (D11): deterministic, AST-driven filter +
25
+ projection pushdown into the Snowflake extract — no agent required. Connector
26
+ tables now materialize lazily with each query's pushdown applied and cached.
27
+ - Large-dataset handling (D12): connector extracts now report truncation via
28
+ `QueryResult.warnings` (UI banner + agent), a per-source `max_rows:` cap in
29
+ charter.yaml, and aggregation pushdown that runs single-table GROUP BY queries
30
+ on the remote instead of extracting raw rows.
31
+ - Aggregation pushdown now also covers export and snapshots (D12): a pushable
32
+ single-table aggregation is computed on the remote and its small result staged
33
+ locally for `COPY`/snapshot, instead of raw-extracting (and capping) the table.
34
+ Pushed `ORDER BY` emits explicit `NULLS FIRST`/`NULLS LAST` so the remote row
35
+ order matches the local result deterministically.
36
+ - Virtualized results grid: only visible rows render to the DOM, so the grid
37
+ scrolls a full 10k-row result smoothly (default visible cap raised 1k → 10k).
38
+ - `datacharter secrets set|list|rm` — manage `${NAME}` secrets in the OS keyring.
39
+
40
+ ### Security
41
+
42
+ - Read-only guard rewritten on DuckDB's parser: counts and types statements and
43
+ blocks filesystem/remote functions. Closes verified bypasses — dollar-quote
44
+ statement stacking, `EXPLAIN ANALYZE COPY` file writes, CTE-prefixed DML, and
45
+ arbitrary file reads via `read_csv`/`glob`/`postgres_scan`.
46
+ - HTTP surface hardened: Host-header allowlist (anti-DNS-rebinding) plus Origin
47
+ and Sec-Fetch-Site checks reject cross-site browser requests.
48
+ - Local state DB is now encrypted (key from the OS keyring or
49
+ `DATACHARTER_STATE_KEY`); connector literals escape backslash as well as quote;
50
+ sync DB access is serialized; uploads are size-bounded and export temp files
51
+ are cleaned up.
52
+
53
+ - Natural-language agent: `/api/agent/ask` SSE endpoint and chat panel.
54
+ 4-tool loop (list_sources/list_tables/describe_table/query) over any
55
+ OpenAI-compatible endpoint via a dependency-free httpx client; charter
56
+ PII columns masked in tool results; `serve --local` targets Ollama
57
+ (qwen3:8b default). Agent can emit inline Vega-Lite charts.
58
+
59
+ - Local server: `datacharter serve` (localhost-only by default, port 8321)
60
+ with JSON API (`/api/health|sources|tables|query|profile`), SSE query
61
+ streaming with heartbeats, scrubbed error envelope, and ephemeral demo
62
+ workspace when run without a charter.
63
+
64
+ - charter.yaml loader: `${NAME}` secret resolution (env → .env → OS
65
+ keyring), hard error on credential literals with fix-it guidance,
66
+ workspace portability lint (absolute/backslash paths), contextual
67
+ error messages.
68
+ - Iceberg and Delta source types.
69
+ - `datacharter init`: workspace scaffolding (charter.yaml, queries/,
70
+ .env.example, .gitignore) with optional generated demo dataset.
71
+ - Query engine core: DuckDB session bound to a workspace; postgres/mysql
72
+ (temporary-secret + read-only attach), sqlite, csv/parquet/json sources
73
+ (s3 paths supported); cross-source joins via native catalogs.
74
+ - Read-only SQL guard: statement allowlist with `local.*` DDL as the only
75
+ write path; single-statement enforcement; comment-smuggling protection.
76
+ - Encrypted local persistence catalog (`local`) for snapshots.
77
+ - Spill hygiene: contained temp dir, always-on temp-file encryption,
78
+ wipe on start/close, optional no-spill mode.
79
+ - Credential scrubbing on all engine error paths.
80
+ - Async query API with interrupt-based timeouts.
@@ -0,0 +1,103 @@
1
+ # DataCharter — Claude Code Project Context
2
+
3
+ Contract-governed local data exploration. Tagline: "Charter your data."
4
+ This file is the cross-machine source of truth for project context — keep it
5
+ updated so any Claude session on any machine picks up where the last left off.
6
+
7
+ ## Current state
8
+
9
+ See `docs/PROGRESS.md` (running journal — update it at the end of every
10
+ working session, then push).
11
+
12
+ ## Locked decisions
13
+
14
+ - **License:** Apache-2.0. **Repo:** private until V1; at V1 publish via fresh
15
+ `git init` + single curated commit into a NEW public repo (never flip this
16
+ repo public — dev history must not ship).
17
+ - **Clean-room build.** All code written fresh for this repo. Never copy code
18
+ from any prior codebase.
19
+ - **Hygiene gate:** `.github/workflows/banned-terms.yml` scans every push.
20
+ Never introduce a term its pattern matches — including in docs, comments,
21
+ and commit messages. Do not write those terms into this file either.
22
+ - **Commit identity:** use the per-repo git identity already configured
23
+ (personal noreply address). Never commit with any employer-associated
24
+ account. Verify with `git config user.email` before first commit of a session.
25
+ - **Name:** DataCharter (one word, capital D+C). Config file: `charter.yaml`.
26
+ Brand: `brand/` (hero.png = social/landing; mark.svg = favicon/avatar/README).
27
+
28
+ ## Architecture (planned)
29
+
30
+ - **Engine:** Python + DuckDB federation. DB sources via native `ATTACH`
31
+ (postgres, mysql, sqlite, bigquery, mssql — community extensions where
32
+ needed), file sources via views (s3/gcs/azure/excel/csv/parquet/json),
33
+ Snowflake via connector fallback, Iceberg + Delta via core extensions.
34
+ Cross-source joins, `CREATE SECRET` credential injection, query timeouts
35
+ via interrupt, credential-scrubbed error messages.
36
+ - **Sources:** `charter.yaml` — ODCS/datacontract-style YAML. Source type,
37
+ connection, `${ENV_VAR}` credential interpolation (.env), tables, PII field
38
+ lists (drive masking).
39
+ - **Serving:** FastAPI, SSE/NDJSON streaming.
40
+ - **Agent:** 4-tool loop (list_sources, list_tables, describe_table,
41
+ query). BYO `OPENAI_BASE_URL` default; `--local` mode
42
+ provisions Ollama + Qwen3 8B; phase-2: route SQL-writing to
43
+ Arctic-Text2SQL-R1-7B. Constrained JSON tool calls; schema pruning;
44
+ execution-feedback retry.
45
+ - **UI:** Vite + React. Source tree, Monaco SQL editor, results grid
46
+ (tanstack), Vega-Lite spec-driven charts (agent emits specs; heuristic
47
+ auto-detect fallback), profiling panel (missing/percentiles/skew/outliers/
48
+ correlation), CSV/parquet/xlsx export, local file drag-drop.
49
+ - **Packaging:** `pip install datacharter` / `uvx datacharter`.
50
+
51
+ ## MVP scope (~3–3.5 wk) then post-launch
52
+
53
+ MVP = engine + charter.yaml + FastAPI + agent + UI + Tier-1 features
54
+ (Iceberg/Delta, file drop, exports, EXPLAIN ANALYZE visualizer).
55
+ Post-launch #1: **MCP server mode** (`datacharter mcp` — the 5 agent tools as
56
+ MCP tools) + schema drift badges; then contract quality checks.
57
+
58
+ ## Conventions (binding)
59
+
60
+ **Authorship & commits**
61
+ - Commits, code comments, and docs must NOT mention Claude, AI assistance, or
62
+ any tooling attribution. No `Co-Authored-By` trailers, no session links.
63
+ - Conventional Commits (`feat:`/`fix:`/`docs:`/`chore:`/`test:`/`refactor:`).
64
+ Subject ≤72 chars, imperative mood. Body only when the WHY isn't obvious.
65
+ - Every commit must build and pass tests (bisectable history). Small, focused
66
+ commits over omnibus ones.
67
+
68
+ **Code style**
69
+ - Comments: max 2 lines, and only where the code can't say it — constraints,
70
+ invariants, non-obvious WHY. Never narrate WHAT the next line does.
71
+ - Reusable components first: before writing new code, check for an existing
72
+ helper/component to extend. Extract shared logic once used twice (engine
73
+ utils, UI atoms, test fixtures alike).
74
+ - Boring, explicit names. No cleverness. English-only identifiers.
75
+ - Type hints on all function signatures. Docstrings (one-liner minimum) on
76
+ public API only — not private helpers.
77
+ - Errors: actionable messages that say what to fix; never echo credentials
78
+ (scrub before raising — engine-wide invariant).
79
+
80
+ **Dependencies & security**
81
+ - Every new dependency needs a one-line justification in the PR/commit body.
82
+ Prefer stdlib/DuckDB-native. Lower-bound pins only (`>=`), no upper pins
83
+ without reason.
84
+ - No secrets, tokens, or real hostnames in code, tests, or fixtures — ever.
85
+ `.env` locally, `.env.example` committed with placeholder values.
86
+
87
+ **Testing**
88
+ - Every feature lands with tests. Unit tests fast by default; integration
89
+ tests (docker) behind a marker so `pytest -q` stays quick.
90
+ - Test names describe behavior (`test_join_across_postgres_and_parquet`),
91
+ not implementation.
92
+
93
+ **Public-API discipline (for OSS consumers)**
94
+ - `__all__` in public modules; anything else is private by convention (`_`).
95
+ - Keep a `CHANGELOG.md` (Keep-a-Changelog format) from M1 onward.
96
+ - Post-V1: semver; breaking changes only on majors.
97
+
98
+ **Session ritual**
99
+ - End each session: update `docs/PROGRESS.md` (done / in-flight / next),
100
+ check off `docs/PLAN.md` boxes, push.
101
+
102
+ **V1 publish note:** `CLAUDE.md`, `docs/PROGRESS.md`, and `docs/PLAN.md` are
103
+ dev-internal — review at release gate: publish cleaned versions or exclude.
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.