elementary-runtime 0.1.0rc1__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 (69) hide show
  1. elementary_runtime-0.1.0rc1/.cursor/worktrees.json +3 -0
  2. elementary_runtime-0.1.0rc1/.github/workflows/dependency-review.yml +31 -0
  3. elementary_runtime-0.1.0rc1/.github/workflows/lint.yml +53 -0
  4. elementary_runtime-0.1.0rc1/.github/workflows/release.yml +27 -0
  5. elementary_runtime-0.1.0rc1/.github/workflows/test.yml +40 -0
  6. elementary_runtime-0.1.0rc1/.gitignore +221 -0
  7. elementary_runtime-0.1.0rc1/.pre-commit-config.yaml +42 -0
  8. elementary_runtime-0.1.0rc1/.python-version +1 -0
  9. elementary_runtime-0.1.0rc1/PKG-INFO +95 -0
  10. elementary_runtime-0.1.0rc1/README.md +74 -0
  11. elementary_runtime-0.1.0rc1/pyproject.toml +72 -0
  12. elementary_runtime-0.1.0rc1/script/setup.sh +15 -0
  13. elementary_runtime-0.1.0rc1/src/elementary_runtime/__init__.py +5 -0
  14. elementary_runtime-0.1.0rc1/src/elementary_runtime/common/__init__.py +0 -0
  15. elementary_runtime-0.1.0rc1/src/elementary_runtime/common/validators.py +27 -0
  16. elementary_runtime-0.1.0rc1/src/elementary_runtime/config/__init__.py +40 -0
  17. elementary_runtime-0.1.0rc1/src/elementary_runtime/config/base.py +19 -0
  18. elementary_runtime-0.1.0rc1/src/elementary_runtime/config/connections.py +55 -0
  19. elementary_runtime-0.1.0rc1/src/elementary_runtime/config/env.py +66 -0
  20. elementary_runtime-0.1.0rc1/src/elementary_runtime/config/errors.py +20 -0
  21. elementary_runtime-0.1.0rc1/src/elementary_runtime/config/runtime.py +60 -0
  22. elementary_runtime-0.1.0rc1/src/elementary_runtime/config/secrets.py +77 -0
  23. elementary_runtime-0.1.0rc1/src/elementary_runtime/config/sections.py +98 -0
  24. elementary_runtime-0.1.0rc1/src/elementary_runtime/coordinator/__init__.py +0 -0
  25. elementary_runtime-0.1.0rc1/src/elementary_runtime/execution/__init__.py +0 -0
  26. elementary_runtime-0.1.0rc1/src/elementary_runtime/execution/redaction/__init__.py +0 -0
  27. elementary_runtime-0.1.0rc1/src/elementary_runtime/execution/sql/__init__.py +0 -0
  28. elementary_runtime-0.1.0rc1/src/elementary_runtime/execution/worker/__init__.py +0 -0
  29. elementary_runtime-0.1.0rc1/src/elementary_runtime/protocol/__init__.py +162 -0
  30. elementary_runtime-0.1.0rc1/src/elementary_runtime/protocol/base.py +82 -0
  31. elementary_runtime-0.1.0rc1/src/elementary_runtime/protocol/enums.py +89 -0
  32. elementary_runtime-0.1.0rc1/src/elementary_runtime/protocol/errors.py +28 -0
  33. elementary_runtime-0.1.0rc1/src/elementary_runtime/protocol/http.py +15 -0
  34. elementary_runtime-0.1.0rc1/src/elementary_runtime/protocol/instances.py +51 -0
  35. elementary_runtime-0.1.0rc1/src/elementary_runtime/protocol/limits.py +18 -0
  36. elementary_runtime-0.1.0rc1/src/elementary_runtime/protocol/tasks/__init__.py +80 -0
  37. elementary_runtime-0.1.0rc1/src/elementary_runtime/protocol/tasks/custom_sql_test.py +35 -0
  38. elementary_runtime-0.1.0rc1/src/elementary_runtime/protocol/tasks/envelope.py +20 -0
  39. elementary_runtime-0.1.0rc1/src/elementary_runtime/protocol/tasks/heartbeat.py +34 -0
  40. elementary_runtime-0.1.0rc1/src/elementary_runtime/protocol/tasks/poll.py +20 -0
  41. elementary_runtime-0.1.0rc1/src/elementary_runtime/protocol/tasks/registry.py +35 -0
  42. elementary_runtime-0.1.0rc1/src/elementary_runtime/protocol/tasks/results.py +30 -0
  43. elementary_runtime-0.1.0rc1/src/elementary_runtime/protocol/tasks/run_sql.py +29 -0
  44. elementary_runtime-0.1.0rc1/src/elementary_runtime/protocol/tasks/sql_query.py +102 -0
  45. elementary_runtime-0.1.0rc1/src/elementary_runtime/protocol/telemetry.py +99 -0
  46. elementary_runtime-0.1.0rc1/src/elementary_runtime/py.typed +0 -0
  47. elementary_runtime-0.1.0rc1/src/elementary_runtime/warehouses/__init__.py +0 -0
  48. elementary_runtime-0.1.0rc1/tests/common/__init__.py +0 -0
  49. elementary_runtime-0.1.0rc1/tests/common/test_validators.py +32 -0
  50. elementary_runtime-0.1.0rc1/tests/config/__init__.py +0 -0
  51. elementary_runtime-0.1.0rc1/tests/config/factory.py +55 -0
  52. elementary_runtime-0.1.0rc1/tests/config/test_env.py +77 -0
  53. elementary_runtime-0.1.0rc1/tests/config/test_runtime.py +245 -0
  54. elementary_runtime-0.1.0rc1/tests/config/test_secrets.py +96 -0
  55. elementary_runtime-0.1.0rc1/tests/protocol/__init__.py +0 -0
  56. elementary_runtime-0.1.0rc1/tests/protocol/contract_v1.json +1296 -0
  57. elementary_runtime-0.1.0rc1/tests/protocol/factory.py +116 -0
  58. elementary_runtime-0.1.0rc1/tests/protocol/test_contract_snapshot.py +48 -0
  59. elementary_runtime-0.1.0rc1/tests/protocol/test_custom_sql_test.py +15 -0
  60. elementary_runtime-0.1.0rc1/tests/protocol/test_errors.py +55 -0
  61. elementary_runtime-0.1.0rc1/tests/protocol/test_heartbeat.py +60 -0
  62. elementary_runtime-0.1.0rc1/tests/protocol/test_http.py +48 -0
  63. elementary_runtime-0.1.0rc1/tests/protocol/test_instances.py +90 -0
  64. elementary_runtime-0.1.0rc1/tests/protocol/test_poll.py +86 -0
  65. elementary_runtime-0.1.0rc1/tests/protocol/test_results.py +155 -0
  66. elementary_runtime-0.1.0rc1/tests/protocol/test_run_sql.py +14 -0
  67. elementary_runtime-0.1.0rc1/tests/protocol/test_telemetry.py +147 -0
  68. elementary_runtime-0.1.0rc1/tests/test_package.py +6 -0
  69. elementary_runtime-0.1.0rc1/uv.lock +804 -0
@@ -0,0 +1,3 @@
1
+ {
2
+ "setup-worktree-unix": "./script/setup.sh"
3
+ }
@@ -0,0 +1,31 @@
1
+ name: Dependency Review
2
+
3
+ on:
4
+ pull_request:
5
+ workflow_dispatch:
6
+ inputs:
7
+ base-ref:
8
+ description: Base git ref for comparison (e.g. a tag or commit SHA)
9
+ required: true
10
+ head-ref:
11
+ description: Head git ref for comparison (defaults to HEAD)
12
+ required: false
13
+ default: HEAD
14
+
15
+ permissions: {}
16
+
17
+ jobs:
18
+ dependency-review:
19
+ runs-on: ubuntu-latest
20
+ permissions:
21
+ contents: read
22
+ steps:
23
+ - name: Checkout repository
24
+ uses: actions/checkout@v4
25
+ with:
26
+ persist-credentials: false
27
+ - name: Dependency Review
28
+ uses: actions/dependency-review-action@v4
29
+ with:
30
+ base-ref: ${{ inputs.base-ref || '' }}
31
+ head-ref: ${{ inputs.head-ref || '' }}
@@ -0,0 +1,53 @@
1
+ name: Lint
2
+
3
+ on:
4
+ pull_request:
5
+ workflow_dispatch:
6
+
7
+ permissions: {}
8
+
9
+ concurrency:
10
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
11
+ cancel-in-progress: true
12
+
13
+ jobs:
14
+ hooks:
15
+ runs-on: ubuntu-latest
16
+ permissions:
17
+ contents: read
18
+ steps:
19
+ - name: Checkout
20
+ uses: actions/checkout@v6
21
+ with:
22
+ persist-credentials: false
23
+
24
+ - name: Install uv
25
+ uses: astral-sh/setup-uv@v6
26
+ with:
27
+ enable-cache: true
28
+
29
+ - name: Run hooks
30
+ env:
31
+ SKIP: mypy
32
+ run: uvx prek run --all-files --show-diff-on-failure
33
+
34
+ typecheck:
35
+ runs-on: ubuntu-latest
36
+ permissions:
37
+ contents: read
38
+ steps:
39
+ - name: Checkout
40
+ uses: actions/checkout@v6
41
+ with:
42
+ persist-credentials: false
43
+
44
+ - name: Install uv
45
+ uses: astral-sh/setup-uv@v6
46
+ with:
47
+ enable-cache: true
48
+
49
+ - name: Install dependencies
50
+ run: uv sync --frozen --group dev
51
+
52
+ - name: Run mypy
53
+ run: uv run --frozen mypy src tests
@@ -0,0 +1,27 @@
1
+ name: Release package
2
+
3
+ on:
4
+ workflow_dispatch:
5
+
6
+ permissions: {}
7
+
8
+ jobs:
9
+ publish-to-pypi:
10
+ runs-on: ubuntu-latest
11
+ permissions:
12
+ id-token: write
13
+ contents: read
14
+ steps:
15
+ - name: Checkout
16
+ uses: actions/checkout@v6
17
+ with:
18
+ persist-credentials: false
19
+
20
+ - name: Install uv
21
+ uses: astral-sh/setup-uv@v6
22
+
23
+ - name: Build
24
+ run: uv build --out-dir dist
25
+
26
+ - name: Publish
27
+ run: uv publish dist/*
@@ -0,0 +1,40 @@
1
+ name: Test
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches:
7
+ - main
8
+ workflow_dispatch:
9
+
10
+ permissions: {}
11
+
12
+ concurrency:
13
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
14
+ cancel-in-progress: true
15
+
16
+ jobs:
17
+ test:
18
+ runs-on: ubuntu-latest
19
+ permissions:
20
+ contents: read
21
+ strategy:
22
+ fail-fast: false
23
+ matrix:
24
+ python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
25
+ steps:
26
+ - name: Checkout
27
+ uses: actions/checkout@v6
28
+ with:
29
+ persist-credentials: false
30
+
31
+ - name: Install uv
32
+ uses: astral-sh/setup-uv@v6
33
+ with:
34
+ enable-cache: true
35
+
36
+ - name: Install dependencies
37
+ run: uv sync --frozen --python ${{ matrix.python-version }} --group dev
38
+
39
+ - name: Run tests
40
+ run: uv run --frozen pytest --cov
@@ -0,0 +1,221 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py.cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ # Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ # uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ # poetry.lock
109
+ # poetry.toml
110
+
111
+ # pdm
112
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
113
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
114
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
115
+ # pdm.lock
116
+ # pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # pixi
121
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
122
+ # pixi.lock
123
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
124
+ # in the .venv directory. It is recommended not to include this directory in version control.
125
+ .pixi
126
+
127
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
128
+ __pypackages__/
129
+
130
+ # Celery stuff
131
+ celerybeat-schedule
132
+ celerybeat.pid
133
+
134
+ # Redis
135
+ *.rdb
136
+ *.aof
137
+ *.pid
138
+
139
+ # RabbitMQ
140
+ mnesia/
141
+ rabbitmq/
142
+ rabbitmq-data/
143
+
144
+ # ActiveMQ
145
+ activemq-data/
146
+
147
+ # SageMath parsed files
148
+ *.sage.py
149
+
150
+ # Environments
151
+ .env
152
+ .envrc
153
+ .venv
154
+ env/
155
+ venv/
156
+ ENV/
157
+ env.bak/
158
+ venv.bak/
159
+
160
+ # Spyder project settings
161
+ .spyderproject
162
+ .spyproject
163
+
164
+ # Rope project settings
165
+ .ropeproject
166
+
167
+ # mkdocs documentation
168
+ /site
169
+
170
+ # mypy
171
+ .mypy_cache/
172
+ .dmypy.json
173
+ dmypy.json
174
+
175
+ # Pyre type checker
176
+ .pyre/
177
+
178
+ # pytype static type analyzer
179
+ .pytype/
180
+
181
+ # Cython debug symbols
182
+ cython_debug/
183
+
184
+ # PyCharm
185
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
186
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
187
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
188
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
189
+ # .idea/
190
+
191
+ # Abstra
192
+ # Abstra is an AI-powered process automation framework.
193
+ # Ignore directories containing user credentials, local state, and settings.
194
+ # Learn more at https://abstra.io/docs
195
+ .abstra/
196
+
197
+ # Visual Studio Code
198
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
199
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
200
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
201
+ # you could uncomment the following to ignore the entire vscode folder
202
+ # .vscode/
203
+ # Temporary file for partial code execution
204
+ tempCodeRunnerFile.py
205
+
206
+ # Ruff stuff:
207
+ .ruff_cache/
208
+
209
+ # PyPI configuration file
210
+ .pypirc
211
+
212
+ # Marimo
213
+ marimo/_static/
214
+ marimo/_lsp/
215
+ __marimo__/
216
+
217
+ # Streamlit
218
+ .streamlit/secrets.toml
219
+
220
+ # macOS
221
+ .DS_Store
@@ -0,0 +1,42 @@
1
+ repos:
2
+ - repo: https://github.com/pre-commit/pre-commit-hooks
3
+ rev: v6.0.0
4
+ hooks:
5
+ - id: end-of-file-fixer
6
+ - id: trailing-whitespace
7
+ - id: check-yaml
8
+ - id: check-toml
9
+ - id: check-merge-conflict
10
+ - id: check-added-large-files
11
+
12
+ - repo: https://github.com/astral-sh/ruff-pre-commit
13
+ rev: v0.16.6
14
+ hooks:
15
+ - id: ruff-check
16
+ args: [--fix]
17
+ - id: ruff-format
18
+
19
+ - repo: https://github.com/astral-sh/uv-pre-commit
20
+ rev: 0.12.11
21
+ hooks:
22
+ - id: uv-lock
23
+
24
+ - repo: https://github.com/crate-ci/typos
25
+ rev: v1.50.1
26
+ hooks:
27
+ - id: typos
28
+
29
+ - repo: local
30
+ hooks:
31
+ - id: no_commit
32
+ name: Check for NO_COMMIT marker
33
+ entry: bash -c "git diff --cached -U0 -- . ':(exclude).pre-commit-config.yaml' | (! grep NO_COMMIT)"
34
+ language: system
35
+ require_serial: true
36
+ pass_filenames: false
37
+ - id: mypy
38
+ name: mypy
39
+ entry: uv run --frozen mypy src tests
40
+ language: system
41
+ pass_filenames: false
42
+ always_run: true
@@ -0,0 +1 @@
1
+ 3.12
@@ -0,0 +1,95 @@
1
+ Metadata-Version: 2.5
2
+ Name: elementary-runtime
3
+ Version: 0.1.0rc1
4
+ Summary: Customer-side runtime that executes Elementary Cloud SQL against a warehouse.
5
+ Project-URL: Homepage, https://www.elementary-data.com
6
+ Project-URL: Repository, https://github.com/elementary-data/elementary-runtime
7
+ Author-email: Elementary Data <team@elementary-data.com>
8
+ Classifier: Development Status :: 2 - Pre-Alpha
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Classifier: Programming Language :: Python :: 3.14
16
+ Requires-Python: <3.15,>=3.10
17
+ Requires-Dist: expandvars<2,>=1.1.2
18
+ Requires-Dist: pydantic<3,>=2.11
19
+ Requires-Dist: pyyaml<7,>=6
20
+ Description-Content-Type: text/markdown
21
+
22
+ # Elementary Runtime
23
+
24
+ > Early development. This package is a skeleton and is not usable yet.
25
+
26
+ Elementary Runtime is a small service that customers run in their own
27
+ environment. It uses local warehouse credentials to execute SQL prepared by
28
+ Elementary Cloud, so Cloud never holds credentials that can read customer
29
+ business tables.
30
+
31
+ Warehouse drivers will be optional extras. Installing the base package for
32
+ task models will not pull in every warehouse driver or the full runtime.
33
+
34
+ A license has not been chosen yet.
35
+
36
+ ## Security-critical code
37
+
38
+ Local safety controls live under
39
+ [`src/elementary_runtime/execution/`](src/elementary_runtime/execution/).
40
+ That tree is the audited surface: SQL validation, query execution with limits
41
+ applied while rows are fetched and encoded, and redaction of SQL, row values,
42
+ credentials, and unrestricted warehouse errors from logs and telemetry.
43
+
44
+ ## Repository layout
45
+
46
+ ```text
47
+ src/elementary_runtime/
48
+ protocol/ Task and result wire formats
49
+ config/ Versioned YAML configuration and local limits
50
+ common/ Shared helpers used by protocol and config
51
+ warehouses/ Warehouse clients (drivers behind extras)
52
+ execution/ Audited local safety controls
53
+ sql/ SQL validation
54
+ worker/ Worker pool, query execution, limit enforcement
55
+ redaction/ Error, log, and telemetry scrubbing
56
+ coordinator/ Register, poll, heartbeat, submit, retries, shutdown
57
+ ```
58
+
59
+ ## Configuration
60
+
61
+ ```yaml
62
+ version: 1
63
+ cloud:
64
+ token_file: /run/secrets/elementary_runtime_token
65
+ connections:
66
+ - warehouse_connection_id: connection-id
67
+ type: snowflake
68
+ account: ab12345.eu-central-1
69
+ user: elementary_runtime
70
+ password_file: /run/secrets/snowflake_password
71
+ ```
72
+
73
+ ## Development
74
+
75
+ Requires [uv](https://docs.astral.sh/uv/) and Python 3.10–3.14. Local
76
+ development uses Python 3.12.
77
+
78
+ After a clone or a new Git worktree, install the environment and hooks:
79
+
80
+ ```bash
81
+ ./script/setup.sh
82
+ ```
83
+
84
+ Then:
85
+
86
+ ```bash
87
+ uv run pytest
88
+ uv run mypy src tests
89
+ uvx prek run --all-files
90
+ ```
91
+
92
+ The package version lives in `pyproject.toml`. Bump it with
93
+ `uv version --bump patch` (or `minor` / `major`). At runtime,
94
+ `elementary_runtime.__version__` is read from the installed distribution
95
+ metadata.
@@ -0,0 +1,74 @@
1
+ # Elementary Runtime
2
+
3
+ > Early development. This package is a skeleton and is not usable yet.
4
+
5
+ Elementary Runtime is a small service that customers run in their own
6
+ environment. It uses local warehouse credentials to execute SQL prepared by
7
+ Elementary Cloud, so Cloud never holds credentials that can read customer
8
+ business tables.
9
+
10
+ Warehouse drivers will be optional extras. Installing the base package for
11
+ task models will not pull in every warehouse driver or the full runtime.
12
+
13
+ A license has not been chosen yet.
14
+
15
+ ## Security-critical code
16
+
17
+ Local safety controls live under
18
+ [`src/elementary_runtime/execution/`](src/elementary_runtime/execution/).
19
+ That tree is the audited surface: SQL validation, query execution with limits
20
+ applied while rows are fetched and encoded, and redaction of SQL, row values,
21
+ credentials, and unrestricted warehouse errors from logs and telemetry.
22
+
23
+ ## Repository layout
24
+
25
+ ```text
26
+ src/elementary_runtime/
27
+ protocol/ Task and result wire formats
28
+ config/ Versioned YAML configuration and local limits
29
+ common/ Shared helpers used by protocol and config
30
+ warehouses/ Warehouse clients (drivers behind extras)
31
+ execution/ Audited local safety controls
32
+ sql/ SQL validation
33
+ worker/ Worker pool, query execution, limit enforcement
34
+ redaction/ Error, log, and telemetry scrubbing
35
+ coordinator/ Register, poll, heartbeat, submit, retries, shutdown
36
+ ```
37
+
38
+ ## Configuration
39
+
40
+ ```yaml
41
+ version: 1
42
+ cloud:
43
+ token_file: /run/secrets/elementary_runtime_token
44
+ connections:
45
+ - warehouse_connection_id: connection-id
46
+ type: snowflake
47
+ account: ab12345.eu-central-1
48
+ user: elementary_runtime
49
+ password_file: /run/secrets/snowflake_password
50
+ ```
51
+
52
+ ## Development
53
+
54
+ Requires [uv](https://docs.astral.sh/uv/) and Python 3.10–3.14. Local
55
+ development uses Python 3.12.
56
+
57
+ After a clone or a new Git worktree, install the environment and hooks:
58
+
59
+ ```bash
60
+ ./script/setup.sh
61
+ ```
62
+
63
+ Then:
64
+
65
+ ```bash
66
+ uv run pytest
67
+ uv run mypy src tests
68
+ uvx prek run --all-files
69
+ ```
70
+
71
+ The package version lives in `pyproject.toml`. Bump it with
72
+ `uv version --bump patch` (or `minor` / `major`). At runtime,
73
+ `elementary_runtime.__version__` is read from the installed distribution
74
+ metadata.
@@ -0,0 +1,72 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "elementary-runtime"
7
+ version = "0.1.0rc1"
8
+ description = "Customer-side runtime that executes Elementary Cloud SQL against a warehouse."
9
+ readme = "README.md"
10
+ authors = [
11
+ { name = "Elementary Data", email = "team@elementary-data.com" },
12
+ ]
13
+ requires-python = ">=3.10,<3.15"
14
+ classifiers = [
15
+ "Development Status :: 2 - Pre-Alpha",
16
+ "Intended Audience :: Developers",
17
+ "Programming Language :: Python :: 3",
18
+ "Programming Language :: Python :: 3.10",
19
+ "Programming Language :: Python :: 3.11",
20
+ "Programming Language :: Python :: 3.12",
21
+ "Programming Language :: Python :: 3.13",
22
+ "Programming Language :: Python :: 3.14",
23
+ ]
24
+ dependencies = [
25
+ "pydantic>=2.11,<3",
26
+ "pyyaml>=6,<7",
27
+ "expandvars>=1.1.2,<2",
28
+ ]
29
+
30
+ [project.urls]
31
+ Homepage = "https://www.elementary-data.com"
32
+ Repository = "https://github.com/elementary-data/elementary-runtime"
33
+
34
+ [dependency-groups]
35
+ dev = [
36
+ "pytest>=9.1.1",
37
+ "pytest-cov>=7.1.0",
38
+ "mypy>=1.18.2",
39
+ "ruff>=0.16.6",
40
+ "prek>=0.5.2",
41
+ "types-PyYAML>=6.0.12,<7",
42
+ ]
43
+
44
+ [tool.ruff]
45
+ target-version = "py310"
46
+ src = ["src"]
47
+
48
+ [tool.ruff.lint]
49
+ select = ["E", "F", "I", "UP", "B", "SIM", "RUF"]
50
+
51
+ [tool.mypy]
52
+ strict = true
53
+ python_version = "3.10"
54
+ files = ["src", "tests"]
55
+ plugins = ["pydantic.mypy"]
56
+
57
+ [[tool.mypy.overrides]]
58
+ module = "expandvars"
59
+ ignore_missing_imports = true
60
+
61
+ [tool.pytest.ini_options]
62
+ testpaths = ["tests"]
63
+ addopts = "-ra --strict-markers --strict-config --import-mode=importlib"
64
+ xfail_strict = true
65
+
66
+ [tool.coverage.run]
67
+ source = ["src"]
68
+ branch = true
69
+
70
+ [tool.coverage.report]
71
+ show_missing = true
72
+ skip_covered = true
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ cd "$(cd "$(dirname "$0")/.." && pwd)"
5
+
6
+ if ! command -v uv >/dev/null 2>&1; then
7
+ echo "uv not found; installing from https://astral.sh/uv/"
8
+ curl -LsSf https://astral.sh/uv/install.sh | sh
9
+ export PATH="${HOME}/.local/bin:${PATH}"
10
+ fi
11
+
12
+ uv sync --frozen --group dev
13
+ uvx prek install
14
+
15
+ echo "Setup complete."
@@ -0,0 +1,5 @@
1
+ from importlib.metadata import version
2
+
3
+ __version__ = version("elementary-runtime")
4
+
5
+ __all__ = ["__version__"]