Metadata-Version: 2.5
Name: elementary-runtime
Version: 0.1.0rc1
Summary: Customer-side runtime that executes Elementary Cloud SQL against a warehouse.
Project-URL: Homepage, https://www.elementary-data.com
Project-URL: Repository, https://github.com/elementary-data/elementary-runtime
Author-email: Elementary Data <team@elementary-data.com>
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: <3.15,>=3.10
Requires-Dist: expandvars<2,>=1.1.2
Requires-Dist: pydantic<3,>=2.11
Requires-Dist: pyyaml<7,>=6
Description-Content-Type: text/markdown

# Elementary Runtime

> Early development. This package is a skeleton and is not usable yet.

Elementary Runtime is a small service that customers run in their own
environment. It uses local warehouse credentials to execute SQL prepared by
Elementary Cloud, so Cloud never holds credentials that can read customer
business tables.

Warehouse drivers will be optional extras. Installing the base package for
task models will not pull in every warehouse driver or the full runtime.

A license has not been chosen yet.

## Security-critical code

Local safety controls live under
[`src/elementary_runtime/execution/`](src/elementary_runtime/execution/).
That tree is the audited surface: SQL validation, query execution with limits
applied while rows are fetched and encoded, and redaction of SQL, row values,
credentials, and unrestricted warehouse errors from logs and telemetry.

## Repository layout

```text
src/elementary_runtime/
  protocol/      Task and result wire formats
  config/        Versioned YAML configuration and local limits
  common/        Shared helpers used by protocol and config
  warehouses/    Warehouse clients (drivers behind extras)
  execution/     Audited local safety controls
    sql/         SQL validation
    worker/      Worker pool, query execution, limit enforcement
    redaction/   Error, log, and telemetry scrubbing
  coordinator/   Register, poll, heartbeat, submit, retries, shutdown
```

## Configuration

```yaml
version: 1
cloud:
  token_file: /run/secrets/elementary_runtime_token
connections:
  - warehouse_connection_id: connection-id
    type: snowflake
    account: ab12345.eu-central-1
    user: elementary_runtime
    password_file: /run/secrets/snowflake_password
```

## Development

Requires [uv](https://docs.astral.sh/uv/) and Python 3.10–3.14. Local
development uses Python 3.12.

After a clone or a new Git worktree, install the environment and hooks:

```bash
./script/setup.sh
```

Then:

```bash
uv run pytest
uv run mypy src tests
uvx prek run --all-files
```

The package version lives in `pyproject.toml`. Bump it with
`uv version --bump patch` (or `minor` / `major`). At runtime,
`elementary_runtime.__version__` is read from the installed distribution
metadata.
