diff --git a/.agents/plugins/marketplace.json b/.agents/plugins/marketplace.json index 8520b595d..f484264ba 100644 --- a/.agents/plugins/marketplace.json +++ b/.agents/plugins/marketplace.json @@ -5,10 +5,10 @@ }, "plugins": [ { - "name": "sidemantic", + "name": "sqlctx", "source": { "source": "local", - "path": "./plugins/sidemantic" + "path": "./plugins/sqlctx" }, "policy": { "installation": "AVAILABLE", diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index f8d462124..e95b3713e 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -6,9 +6,9 @@ }, "plugins": [ { - "name": "sidemantic", - "source": "./plugins/sidemantic", - "description": "Build, validate, and query Sidemantic semantic models, and generate analytics webapps from them. Ships the modeler and webapp-builder skills." + "name": "sqlctx", + "source": "./plugins/sqlctx", + "description": "Build, validate, and query sqlctx semantic models, and generate analytics webapps from them. Ships the modeler and webapp-builder skills." } ] } diff --git a/.dockerignore b/.dockerignore index 411debd9b..8419cda65 100644 --- a/.dockerignore +++ b/.dockerignore @@ -9,8 +9,8 @@ __pycache__ *.pyc # Rust/DuckDB extension builds (not needed for Python image) -sidemantic-rs/ -sidemantic-duckdb/ +sqlctx-rs/ +sqlctx-duckdb/ # Docs and examples not needed at runtime docs/ diff --git a/.github/actions/setup-rust-cache/action.yml b/.github/actions/setup-rust-cache/action.yml index 800e24a8b..2a136d24f 100644 --- a/.github/actions/setup-rust-cache/action.yml +++ b/.github/actions/setup-rust-cache/action.yml @@ -46,7 +46,7 @@ runs: with: version: ${{ (runner.os != 'macOS' || runner.arch != 'X64') && '1.11.0' || '' }} github-cache-mode: objects - cache-generation: sidemantic-v1-${{ inputs.suffix }} + cache-generation: sqlctx-v1-${{ inputs.suffix }} - name: Remove imported Rust cache archive env: diff --git a/.github/actions/setup-uv/action.yml b/.github/actions/setup-uv/action.yml index b80fb107f..b91f428f2 100644 --- a/.github/actions/setup-uv/action.yml +++ b/.github/actions/setup-uv/action.yml @@ -24,17 +24,17 @@ runs: cache-dependency-glob: | uv.lock pyproject.toml - sidemantic-rs/pyproject.toml + sqlctx-rs/pyproject.toml crates/dax-pyo3/pyproject.toml crates/dax-pyo3/README.md .cargo/config.toml rust-toolchain* Cargo.lock Cargo.toml - sidemantic-rs/Cargo.toml - sidemantic-rs/build.rs - sidemantic-rs/src/** - sidemantic-rs/schemas/** + sqlctx-rs/Cargo.toml + sqlctx-rs/build.rs + sqlctx-rs/src/** + sqlctx-rs/schemas/** crates/*/Cargo.toml crates/*/src/** crates/dax-pyo3/python/**/*.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e66c81047..f8c231b27 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-24.04 env: UV_PYTHON: ${{ matrix.python-version }} - SIDEMANTIC_ENGINE: ${{ matrix.engine }} + SQLCTX_ENGINE: ${{ matrix.engine }} strategy: fail-fast: false matrix: @@ -57,12 +57,12 @@ jobs: uv run python - <<'PY' import sys - from sidemantic import Dimension, Metric, Model + from sqlctx import Dimension, Metric, Model assert Model.__name__ == "Model" assert Dimension.__name__ == "Dimension" assert Metric.__name__ == "Metric" - assert "sidemantic_dax" not in sys.modules + assert "sqlctx_dax" not in sys.modules PY - name: Install Rust, DAX, and MCP Apps test dependencies @@ -74,7 +74,7 @@ jobs: - name: Check version consistency run: | PYPROJECT_VERSION=$(grep '^version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/') - INIT_VERSION=$(grep '^__version__ = ' sidemantic/__init__.py | sed 's/__version__ = "\(.*\)"/\1/') + INIT_VERSION=$(grep '^__version__ = ' sqlctx/__init__.py | sed 's/__version__ = "\(.*\)"/\1/') if [ "$PYPROJECT_VERSION" != "$INIT_VERSION" ]; then echo "Version mismatch: pyproject.toml=$PYPROJECT_VERSION, __init__.py=$INIT_VERSION" exit 1 @@ -82,10 +82,10 @@ jobs: echo "Version check passed: $PYPROJECT_VERSION" - name: Run ruff check - run: uv run ruff check . --exclude docs/_extensions --exclude sidemantic-duckdb/extension-ci-tools --exclude sidemantic-duckdb/scripts --exclude sidemantic-duckdb/duckdb --exclude sidemantic/adapters/malloy_grammar --exclude sidemantic/adapters/holistics_grammar + run: uv run ruff check . --exclude docs/_extensions --exclude sqlctx-duckdb/extension-ci-tools --exclude sqlctx-duckdb/scripts --exclude sqlctx-duckdb/duckdb --exclude sqlctx/adapters/malloy_grammar --exclude sqlctx/adapters/holistics_grammar - name: Run ruff format check - run: uv run ruff format --check . --exclude docs/_extensions --exclude sidemantic-duckdb/extension-ci-tools --exclude sidemantic-duckdb/scripts --exclude sidemantic-duckdb/duckdb --exclude sidemantic/adapters/malloy_grammar --exclude sidemantic/adapters/holistics_grammar + run: uv run ruff format --check . --exclude docs/_extensions --exclude sqlctx-duckdb/extension-ci-tools --exclude sqlctx-duckdb/scripts --exclude sqlctx-duckdb/duckdb --exclude sqlctx/adapters/malloy_grammar --exclude sqlctx/adapters/holistics_grammar - name: Check public API types run: | @@ -95,7 +95,7 @@ jobs: - name: Check typed package marker run: | uv build --wheel - unzip -l dist/*.whl | grep -q 'sidemantic/py.typed' + unzip -l dist/*.whl | grep -q 'sqlctx/py.typed' - name: Run Python reference suite if: matrix.engine == 'python' @@ -114,15 +114,15 @@ jobs: - name: Run installed-wheel DAX smoke run: | - uv build sidemantic-rs --out-dir /tmp/sidemantic-dax-dist - uv build crates/dax-pyo3 --out-dir /tmp/sidemantic-dax-dist - uv build --out-dir /tmp/sidemantic-dist - SIDEMANTIC_WHEEL=$(realpath "$(find /tmp/sidemantic-dist -name 'sidemantic-[0-9]*.whl' -print -quit)") + uv build sqlctx-rs --out-dir /tmp/sqlctx-dax-dist + uv build crates/dax-pyo3 --out-dir /tmp/sqlctx-dax-dist + uv build --out-dir /tmp/sqlctx-dist + SQLCTX_WHEEL=$(realpath "$(find /tmp/sqlctx-dist -name 'sqlctx-[0-9]*.whl' -print -quit)") cd /tmp - uv run --no-project --find-links /tmp/sidemantic-dax-dist --with "${SIDEMANTIC_WHEEL}[dax]" -- python - <<'PY' - import sidemantic_dax + uv run --no-project --find-links /tmp/sqlctx-dax-dist --with "${SQLCTX_WHEEL}[dax]" -- python - <<'PY' + import sqlctx_dax - sidemantic_dax.parse_expression("1") + sqlctx_dax.parse_expression("1") PY - name: Save completed build caches @@ -242,12 +242,12 @@ jobs: run: uv python install 3.12 - name: Build Python distribution - run: uv build --wheel --out-dir /tmp/sidemantic-dist + run: uv build --wheel --out-dir /tmp/sqlctx-dist - name: Smoke base CLI install run: | set -euo pipefail - SIDEMANTIC_WHEEL=$(realpath "$(find /tmp/sidemantic-dist -name 'sidemantic-[0-9]*.whl' -print -quit)") + SQLCTX_WHEEL=$(realpath "$(find /tmp/sqlctx-dist -name 'sqlctx-[0-9]*.whl' -print -quit)") tmpdir="$(mktemp -d)" mkdir -p "$tmpdir/models" cat > "$tmpdir/models/models.yml" <<'YAML' @@ -264,23 +264,23 @@ jobs: YAML cd "$tmpdir" - uv run --no-project --with "$SIDEMANTIC_WHEEL" python -c "import importlib.metadata as m; print('typer', m.version('typer'), 'click', m.version('click'))" - uv run --no-project --with "$SIDEMANTIC_WHEEL" sidemantic --version - uv run --no-project --with "$SIDEMANTIC_WHEEL" sidemantic validate "$tmpdir/models" - uv run --no-project --with "$SIDEMANTIC_WHEEL" sidemantic query "SELECT order_count, status FROM orders" --models "$tmpdir/models" --dry-run + uv run --no-project --with "$SQLCTX_WHEEL" python -c "import importlib.metadata as m; print('typer', m.version('typer'), 'click', m.version('click'))" + uv run --no-project --with "$SQLCTX_WHEEL" sqlctx --version + uv run --no-project --with "$SQLCTX_WHEEL" sqlctx validate "$tmpdir/models" + uv run --no-project --with "$SQLCTX_WHEEL" sqlctx query "SELECT order_count, status FROM orders" --models "$tmpdir/models" --dry-run # Subcommand help must exit 0 without an error or traceback. - uv run --no-project --with "$SIDEMANTIC_WHEEL" sidemantic validate --help >"$tmpdir/help.out" 2>"$tmpdir/help.err" + uv run --no-project --with "$SQLCTX_WHEEL" sqlctx validate --help >"$tmpdir/help.out" 2>"$tmpdir/help.err" grep -q "Usage:" "$tmpdir/help.out" if grep -q -e "Traceback" -e "Error" "$tmpdir/help.err"; then - echo "sidemantic validate --help reported an error" + echo "sqlctx validate --help reported an error" cat "$tmpdir/help.err" >&2 exit 1 fi # Handled errors must exit 1 with a concise message and no traceback. set +e - uv run --no-project --with "$SIDEMANTIC_WHEEL" sidemantic query "SELECT orders.missing FROM orders" --models "$tmpdir/models" --dry-run >"$tmpdir/error.out" 2>"$tmpdir/error.err" + uv run --no-project --with "$SQLCTX_WHEEL" sqlctx query "SELECT orders.missing FROM orders" --models "$tmpdir/models" --dry-run >"$tmpdir/error.out" 2>"$tmpdir/error.err" error_status=$? set -e if [ "$error_status" -ne 1 ] || ! grep -q "^Error: " "$tmpdir/error.err" || grep -q "Traceback" "$tmpdir/error.err"; then @@ -289,12 +289,12 @@ jobs: exit 1 fi - uv run --no-project --with "$SIDEMANTIC_WHEEL" python - <<'PYTHON' + uv run --no-project --with "$SQLCTX_WHEEL" python - <<'PYTHON' from importlib.util import find_spec - from sidemantic import SemanticLayer, Model, Metric - from sidemantic.semantic_handoff import RustBackendUnavailableError + from sqlctx import SemanticLayer, Model, Metric + from sqlctx.semantic_handoff import RustBackendUnavailableError - assert find_spec("sidemantic_rs") is None + assert find_spec("sqlctx_rs") is None with SemanticLayer() as layer: layer.add_model(Model(name="orders", sql="select 1 as id", metrics=[Metric(name="count", agg="count")])) assert layer.sql("select orders.count from orders").fetchall() == [(1,)] @@ -302,26 +302,26 @@ jobs: try: SemanticLayer(engine="rust") except RustBackendUnavailableError as error: - assert "sidemantic[rust]" in str(error) + assert "sqlctx[rust]" in str(error) else: raise AssertionError("Rust must require the extra") PYTHON set +e - timeout 10s uv run --no-project --with "$SIDEMANTIC_WHEEL" sidemantic serve "$tmpdir/models" >"$tmpdir/serve.out" 2>"$tmpdir/serve.err" + timeout 10s uv run --no-project --with "$SQLCTX_WHEEL" sqlctx serve "$tmpdir/models" >"$tmpdir/serve.out" 2>"$tmpdir/serve.err" serve_status=$? set -e if [ "$serve_status" -eq 0 ]; then - echo "base install unexpectedly ran sidemantic serve without the serve extra" + echo "base install unexpectedly ran sqlctx serve without the serve extra" exit 1 fi if [ "$serve_status" -eq 124 ]; then - echo "base install unexpectedly started sidemantic serve without the serve extra" + echo "base install unexpectedly started sqlctx serve without the serve extra" cat "$tmpdir/serve.out" cat "$tmpdir/serve.err" >&2 exit 1 fi - grep -q "sidemantic\\[api\\]" "$tmpdir/serve.err" + grep -q "sqlctx\\[api\\]" "$tmpdir/serve.err" if grep -q "Traceback" "$tmpdir/serve.err"; then echo "missing serve extra must be reported without a traceback" cat "$tmpdir/serve.err" >&2 @@ -329,15 +329,15 @@ jobs: fi - name: Build runtime distribution - run: uv build sidemantic-rs --out-dir /tmp/sidemantic-runtime-dist + run: uv build sqlctx-rs --out-dir /tmp/sqlctx-runtime-dist - name: Smoke Rust extra install run: | - SIDEMANTIC_WHEEL=$(realpath "$(find /tmp/sidemantic-dist -name 'sidemantic-[0-9]*.whl' -print -quit)") + SQLCTX_WHEEL=$(realpath "$(find /tmp/sqlctx-dist -name 'sqlctx-[0-9]*.whl' -print -quit)") cd /tmp - uv run --no-project --find-links /tmp/sidemantic-runtime-dist --with "${SIDEMANTIC_WHEEL}[rust]" python - <<'PYTHON' - import sidemantic_rs - from sidemantic import SemanticLayer, Model, Metric + uv run --no-project --find-links /tmp/sqlctx-runtime-dist --with "${SQLCTX_WHEEL}[rust]" python - <<'PYTHON' + import sqlctx_rs + from sqlctx import SemanticLayer, Model, Metric for engine in (None, "rust"): with SemanticLayer(engine=engine) as layer: @@ -414,10 +414,10 @@ jobs: PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }} run: | uv run python scripts/generate_schema.py - if ! git diff --exit-code sidemantic-schema.json; then + if ! git diff --exit-code sqlctx-schema.json; then git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" - git add sidemantic-schema.json + git add sqlctx-schema.json git commit -m "Auto-update JSON schema" git push --force-with-lease="refs/heads/$PR_BRANCH:$PR_HEAD_SHA" origin "HEAD:refs/heads/$PR_BRANCH" fi @@ -464,11 +464,11 @@ jobs: run: | curl -L https://github.com/duckdb/duckdb/releases/download/v1.5.5/libduckdb-linux-amd64.zip -o /tmp/libduckdb.zip unzip -q /tmp/libduckdb.zip -d /tmp/libduckdb - echo "SIDEMANTIC_TEST_ADBC_DUCKDB_DRIVER=/tmp/libduckdb/libduckdb.so" >> "$GITHUB_ENV" + echo "SQLCTX_TEST_ADBC_DUCKDB_DRIVER=/tmp/libduckdb/libduckdb.so" >> "$GITHUB_ENV" - name: Run Rust native fixtures id: native_fixtures - working-directory: sidemantic-rs + working-directory: sqlctx-rs run: | cargo test --test native_fixtures cargo test --features adbc-exec --test native_fixtures native_fixtures_execute_expected_results_with_duckdb_adbc @@ -476,7 +476,7 @@ jobs: - name: Capture native fixture stack overflow if: ${{ failure() && steps.native_fixtures.outcome == 'failure' }} timeout-minutes: 5 - working-directory: sidemantic-rs + working-directory: sqlctx-rs run: | set -euo pipefail if ! command -v gdb >/dev/null; then @@ -541,7 +541,7 @@ jobs: with: filters: | rust: - - 'sidemantic-rs/**' + - 'sqlctx-rs/**' - 'Cargo.toml' - 'Cargo.lock' - '.cargo/**' @@ -552,42 +552,42 @@ jobs: # not just the crate. Keep its contract and fixture inputs gated. - 'pyproject.toml' - 'uv.lock' - - 'sidemantic/__init__.py' - - 'sidemantic/rust_bridge.py' - - 'sidemantic/rust_parity.py' - - 'sidemantic/semantic_handoff.py' - - 'sidemantic/core/**' - - 'sidemantic/sql/**' - - 'sidemantic/db/__init__.py' - - 'sidemantic/db/base.py' - - 'sidemantic/db/duckdb.py' - - 'sidemantic/db/postgres.py' - - 'sidemantic/db/unavailable.py' - - 'sidemantic/validation.py' - - 'sidemantic/validation_runner.py' - - 'sidemantic/cli.py' - - 'sidemantic/cli_contract.py' - - 'sidemantic/cli_polish.py' - - 'sidemantic/config.py' - - 'sidemantic/loaders.py' - - 'sidemantic/project.py' - - 'sidemantic/paths.py' - - 'sidemantic/formats.py' - - 'sidemantic/fidelity.py' - - 'sidemantic/yaml_compat.py' + - 'sqlctx/__init__.py' + - 'sqlctx/rust_bridge.py' + - 'sqlctx/rust_parity.py' + - 'sqlctx/semantic_handoff.py' + - 'sqlctx/core/**' + - 'sqlctx/sql/**' + - 'sqlctx/db/__init__.py' + - 'sqlctx/db/base.py' + - 'sqlctx/db/duckdb.py' + - 'sqlctx/db/postgres.py' + - 'sqlctx/db/unavailable.py' + - 'sqlctx/validation.py' + - 'sqlctx/validation_runner.py' + - 'sqlctx/cli.py' + - 'sqlctx/cli_contract.py' + - 'sqlctx/cli_polish.py' + - 'sqlctx/config.py' + - 'sqlctx/loaders.py' + - 'sqlctx/project.py' + - 'sqlctx/paths.py' + - 'sqlctx/formats.py' + - 'sqlctx/fidelity.py' + - 'sqlctx/yaml_compat.py' # Imported native/Cube/Ossie fixtures are acceptance inputs too. - - 'sidemantic/adapters/__init__.py' - - 'sidemantic/adapters/base.py' - - 'sidemantic/adapters/sidemantic.py' - - 'sidemantic/adapters/cube.py' - - 'sidemantic/adapters/ossie.py' - - 'sidemantic/interchange/ossie/**' + - 'sqlctx/adapters/__init__.py' + - 'sqlctx/adapters/base.py' + - 'sqlctx/adapters/sqlctx.py' + - 'sqlctx/adapters/cube.py' + - 'sqlctx/adapters/ossie.py' + - 'sqlctx/interchange/ossie/**' - 'tests/conftest.py' - 'tests/semantic_conformance/**/*.py' - 'tests/semantic_conformance/fixtures/**' duckdb: - - 'sidemantic-duckdb/**' - - 'sidemantic-rs/**' + - 'sqlctx-duckdb/**' + - 'sqlctx-rs/**' # The extension links the workspace crate; host tests and their # shared SemanticInput fixture live under the two trees above. - 'Cargo.toml' @@ -609,15 +609,15 @@ jobs: - 'webapp/**' - 'scripts/build_webapp.py' - 'scripts/build_ui_distribution.py' - - 'sidemantic/ui/static/**' - - 'sidemantic-rs/ui/**' - - 'plugins/sidemantic/skills/webapp-builder/assets/ui-dist/**' - - 'examples/sidemantic_wasm_demo/src/components/sidemantic/**' + - 'sqlctx/ui/static/**' + - 'sqlctx-rs/ui/**' + - 'plugins/sqlctx/skills/webapp-builder/assets/ui-dist/**' + - 'examples/sqlctx_wasm_demo/src/components/sqlctx/**' widget: - 'js/**' - 'scripts/build_widget.py' - - 'sidemantic/widget/static/**' - - 'plugins/sidemantic/skills/webapp-builder/assets/ui-dist/**' + - 'sqlctx/widget/static/**' + - 'plugins/sqlctx/skills/webapp-builder/assets/ui-dist/**' dax-rust: name: Rust (DAX crates) @@ -653,7 +653,7 @@ jobs: rust-key: ${{ steps.rust-cache.outputs.key }} rust: - name: Rust (sidemantic-rs) + name: Rust (sqlctx-rs) needs: check-rust-changes if: needs.check-rust-changes.outputs.rust_changed == 'true' runs-on: ubuntu-latest @@ -667,19 +667,19 @@ jobs: postgres: image: postgres:16 env: - POSTGRES_USER: sidemantic - POSTGRES_PASSWORD: sidemantic - POSTGRES_DB: sidemantic + POSTGRES_USER: sqlctx + POSTGRES_PASSWORD: sqlctx + POSTGRES_DB: sqlctx ports: - 5432:5432 options: >- - --health-cmd "pg_isready -U sidemantic" + --health-cmd "pg_isready -U sqlctx" --health-interval 10s --health-timeout 5s --health-retries 5 defaults: run: - working-directory: sidemantic-rs + working-directory: sqlctx-rs steps: - uses: actions/checkout@v4 @@ -724,28 +724,28 @@ jobs: cargo check --no-default-features --all-targets cargo check --features python --lib cargo check --features python-adbc --lib - cargo check --features mcp-server --bin sidemantic-mcp --test mcp_protocol - cargo check --features mcp-adbc --bin sidemantic-mcp - cargo check --features runtime-server --bin sidemantic-server --test http_server - cargo check --features runtime-server-adbc --bin sidemantic-server - cargo check --features runtime-lsp --bin sidemantic-lsp --test lsp_protocol_smoke - cargo check --features workbench-tui --bin sidemantic --bin sidemantic-workbench - cargo check --features workbench-adbc --bin sidemantic --bin sidemantic-workbench + cargo check --features mcp-server --bin sqlctx-mcp --test mcp_protocol + cargo check --features mcp-adbc --bin sqlctx-mcp + cargo check --features runtime-server --bin sqlctx-server --test http_server + cargo check --features runtime-server-adbc --bin sqlctx-server + cargo check --features runtime-lsp --bin sqlctx-lsp --test lsp_protocol_smoke + cargo check --features workbench-tui --bin sqlctx --bin sqlctx-workbench + cargo check --features workbench-adbc --bin sqlctx --bin sqlctx-workbench - name: Install DuckDB ADBC driver run: | curl -L https://github.com/duckdb/duckdb/releases/download/v1.5.5/libduckdb-linux-amd64.zip -o /tmp/libduckdb.zip unzip -q /tmp/libduckdb.zip -d /tmp/libduckdb - echo "SIDEMANTIC_TEST_ADBC_DUCKDB_DRIVER=/tmp/libduckdb/libduckdb.so" >> "$GITHUB_ENV" + echo "SQLCTX_TEST_ADBC_DUCKDB_DRIVER=/tmp/libduckdb/libduckdb.so" >> "$GITHUB_ENV" - name: Install SQLite ADBC driver run: | uv run --no-project --with adbc-driver-sqlite python - <<'PY' >> "$GITHUB_ENV" import adbc_driver_sqlite - print(f"SIDEMANTIC_TEST_ADBC_SQLITE_DRIVER={adbc_driver_sqlite._driver_path()}") - print("SIDEMANTIC_TEST_ADBC_SQLITE_URI=:memory:") - print("SIDEMANTIC_TEST_ADBC_REQUIRE=duckdb,sqlite") + print(f"SQLCTX_TEST_ADBC_SQLITE_DRIVER={adbc_driver_sqlite._driver_path()}") + print("SQLCTX_TEST_ADBC_SQLITE_URI=:memory:") + print("SQLCTX_TEST_ADBC_REQUIRE=duckdb,sqlite") PY - name: Run standalone protocol and UI tests @@ -757,16 +757,16 @@ jobs: cargo test --features workbench-adbc --test cli_smoke workbench cargo test --features workbench-tui --test workbench_pty_smoke cargo test --features workbench-adbc --test workbench_pty_smoke - cargo test --features workbench-adbc --bin sidemantic + cargo test --features workbench-adbc --bin sqlctx cargo test --features adbc-exec --test adbc_driver_matrix cargo test --features mcp-adbc,runtime-server-adbc --test adbc_duckdb_e2e - name: Smoke C ABI header and static library run: | cargo build --release --lib - SIDEMANTIC_STATICLIB="$(cargo metadata --no-deps --format-version 1 | python3 -c 'import json, sys; print(json.load(sys.stdin)["target_directory"])')/release/libsidemantic.a" - cc -std=c11 -Wall -Wextra -I include tests/c_abi_smoke.c "$SIDEMANTIC_STATICLIB" -lpthread -ldl -lm -lrt -o /tmp/sidemantic_c_abi_smoke - /tmp/sidemantic_c_abi_smoke + SQLCTX_STATICLIB="$(cargo metadata --no-deps --format-version 1 | python3 -c 'import json, sys; print(json.load(sys.stdin)["target_directory"])')/release/libsqlctx.a" + cc -std=c11 -Wall -Wextra -I include tests/c_abi_smoke.c "$SQLCTX_STATICLIB" -lpthread -ldl -lm -lrt -o /tmp/sqlctx_c_abi_smoke + /tmp/sqlctx_c_abi_smoke - name: Build WASM host module run: cargo build --no-default-features --features wasm --target wasm32-unknown-unknown --lib @@ -781,8 +781,8 @@ jobs: - name: Execute SemanticInput through the public WASM module run: | - wasm-bindgen ../target/wasm32-unknown-unknown/debug/sidemantic.wasm --target nodejs --out-dir ../target/semantic-host - SIDEMANTIC_WASM_MODULE="$PWD/../target/semantic-host/sidemantic.js" uv run --no-project tests/test_wasm_semantic_host.py + wasm-bindgen ../target/wasm32-unknown-unknown/debug/sqlctx.wasm --target nodejs --out-dir ../target/semantic-host + SQLCTX_WASM_MODULE="$PWD/../target/semantic-host/sqlctx.js" uv run --no-project tests/test_wasm_semantic_host.py - name: Check Python extension build run: uvx maturin build --out dist @@ -801,15 +801,15 @@ jobs: - name: Run semantic compiler conformance with the built extension working-directory: . env: - SIDEMANTIC_TEST_POSTGRES_DSN: postgresql://sidemantic:sidemantic@localhost:5432/sidemantic + SQLCTX_TEST_POSTGRES_DSN: postgresql://sqlctx:sqlctx@localhost:5432/sqlctx run: | - uv run --extra dev --with "psycopg[binary]" --with ./sidemantic-rs/dist-python/*.whl python - <<'PY' + uv run --extra dev --with "psycopg[binary]" --with ./sqlctx-rs/dist-python/*.whl python - <<'PY' import pytest - import sidemantic_rs + import sqlctx_rs - assert callable(sidemantic_rs.compile_with_semantic_input) - assert callable(sidemantic_rs.validate_with_semantic_input) - assert callable(sidemantic_rs.rewrite_with_semantic_input) + assert callable(sqlctx_rs.compile_with_semantic_input) + assert callable(sqlctx_rs.validate_with_semantic_input) + assert callable(sqlctx_rs.rewrite_with_semantic_input) raise SystemExit(pytest.main(["--no-cov", "-q", "tests/semantic_conformance"])) PY @@ -838,7 +838,7 @@ jobs: env: GEN: ninja DUCKDB_VERSION: ${{ matrix.duckdb }} - SIDEMANTIC_NATIVE_PEG: ${{ matrix.duckdb == 'v2.0-cyanoptera' && '1' || '' }} + SQLCTX_NATIVE_PEG: ${{ matrix.duckdb == 'v2.0-cyanoptera' && '1' || '' }} steps: - uses: actions/checkout@v4 @@ -853,18 +853,18 @@ jobs: suffix: ${{ github.workflow }}-${{ github.job }}-${{ strategy.job-index || 0 }} - name: Fetch DuckDB dependencies - working-directory: sidemantic-duckdb + working-directory: sqlctx-duckdb run: make deps - name: Install build dependencies run: sudo apt-get update && sudo apt-get install -y ninja-build - name: Build DuckDB extension - working-directory: sidemantic-duckdb + working-directory: sqlctx-duckdb run: make - name: Run extension tests - working-directory: sidemantic-duckdb + working-directory: sqlctx-duckdb run: make test - name: Install uv for SQL host acceptance @@ -876,11 +876,11 @@ jobs: - name: Execute SemanticInput in the loaded DuckDB extension env: - SIDEMANTIC_DUCKDB_BINARY: sidemantic-duckdb/build/release/duckdb - SIDEMANTIC_DUCKDB_EXTENSION: sidemantic-duckdb/build/release/extension/sidemantic/sidemantic.duckdb_extension + SQLCTX_DUCKDB_BINARY: sqlctx-duckdb/build/release/duckdb + SQLCTX_DUCKDB_EXTENSION: sqlctx-duckdb/build/release/extension/sqlctx/sqlctx.duckdb_extension run: | - uv run sidemantic-duckdb/test/test_semantic_input_host.py - uv run sidemantic-duckdb/test/test_catalog_host.py + uv run sqlctx-duckdb/test/test_semantic_input_host.py + uv run sqlctx-duckdb/test/test_catalog_host.py - name: Save completed build caches if: ${{ !cancelled() }} diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 816b3e239..30e3c86d3 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -14,7 +14,7 @@ concurrency: cancel-in-progress: false env: - IMAGE: sidequery/sidemantic + IMAGE: sidequery/sqlctx jobs: source: diff --git a/.github/workflows/duckdb-extension-release.yml b/.github/workflows/duckdb-extension-release.yml index 593fd8c06..70f4a4f53 100644 --- a/.github/workflows/duckdb-extension-release.yml +++ b/.github/workflows/duckdb-extension-release.yml @@ -15,7 +15,7 @@ on: type: boolean push: tags: - - "sidemantic-duckdb-v*" + - "sqlctx-duckdb-v*" pull_request: paths: @@ -93,31 +93,31 @@ jobs: echo "version=$VERSION" >> "$GITHUB_OUTPUT" - name: Fetch DuckDB dependencies - working-directory: sidemantic-duckdb + working-directory: sqlctx-duckdb env: DUCKDB_VERSION: ${{ steps.duckdb.outputs.version }} run: make deps DUCKDB_VERSION="$DUCKDB_VERSION" - name: Build extension - working-directory: sidemantic-duckdb + working-directory: sqlctx-duckdb env: DUCKDB_PLATFORM: ${{ matrix.platform }} run: make - name: Run extension tests - working-directory: sidemantic-duckdb + working-directory: sqlctx-duckdb run: make test - name: Package extension artifact - working-directory: sidemantic-duckdb + working-directory: sqlctx-duckdb env: DUCKDB_VERSION: ${{ steps.duckdb.outputs.version }} PLATFORM: ${{ matrix.platform }} run: | mkdir -p dist DUCKDB_VERSION="${DUCKDB_VERSION#v}" - ASSET="sidemantic-duckdb-${DUCKDB_VERSION}-${PLATFORM}.duckdb_extension" - cp build/release/extension/sidemantic/sidemantic.duckdb_extension "dist/$ASSET" + ASSET="sqlctx-duckdb-${DUCKDB_VERSION}-${PLATFORM}.duckdb_extension" + cp build/release/extension/sqlctx/sqlctx.duckdb_extension "dist/$ASSET" cd dist if command -v sha256sum >/dev/null; then sha256sum "$ASSET" > "$ASSET.sha256" @@ -128,8 +128,8 @@ jobs: - name: Upload extension artifact uses: actions/upload-artifact@v4 with: - name: sidemantic-duckdb-extension-${{ matrix.platform }} - path: sidemantic-duckdb/dist/* + name: sqlctx-duckdb-extension-${{ matrix.platform }} + path: sqlctx-duckdb/dist/* if-no-files-found: error - name: Save completed build caches @@ -152,7 +152,7 @@ jobs: - name: Download extension artifact uses: actions/download-artifact@v4 with: - pattern: sidemantic-duckdb-extension-* + pattern: sqlctx-duckdb-extension-* path: dist merge-multiple: true @@ -165,11 +165,11 @@ jobs: if [ "$REF_TYPE" = "tag" ]; then TAG="$REF_NAME" else - VERSION=$(grep '^version = ' sidemantic-rs/Cargo.toml | sed 's/version = "\(.*\)"/\1/') - TAG="sidemantic-duckdb-v${VERSION}" + VERSION=$(grep '^version = ' sqlctx-rs/Cargo.toml | sed 's/version = "\(.*\)"/\1/') + TAG="sqlctx-duckdb-v${VERSION}" fi - if [[ ! "$TAG" =~ ^sidemantic-duckdb-v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + if [[ ! "$TAG" =~ ^sqlctx-duckdb-v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then echo "Invalid extension release tag" >&2 exit 1 fi @@ -192,7 +192,7 @@ jobs: fi cd dist for PLATFORM in linux_amd64 linux_arm64 osx_amd64 osx_arm64; do - ASSET="sidemantic-duckdb-1.5.6-${PLATFORM}.duckdb_extension" + ASSET="sqlctx-duckdb-1.5.6-${PLATFORM}.duckdb_extension" test -s "$ASSET" sha256sum --check "$ASSET.sha256" done diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index b11cca390..e5e7bacd9 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -21,7 +21,7 @@ jobs: env: POSTGRES_USER: test POSTGRES_PASSWORD: test - POSTGRES_DB: sidemantic_test + POSTGRES_DB: sqlctx_test ports: - 5432:5432 options: >- @@ -58,10 +58,10 @@ jobs: - name: Run PostgreSQL integration tests env: POSTGRES_TEST: "1" - POSTGRES_URL: "postgres://test:test@localhost:5432/sidemantic_test" + POSTGRES_URL: "postgres://test:test@localhost:5432/sqlctx_test" POSTGRES_HOST: "localhost" POSTGRES_PORT: "5432" - POSTGRES_DB: "sidemantic_test" + POSTGRES_DB: "sqlctx_test" POSTGRES_USER: "test" POSTGRES_PASSWORD: "test" run: | @@ -73,7 +73,7 @@ jobs: POSTGRES_TEST: "1" POSTGRES_HOST: "localhost" POSTGRES_PORT: "5432" - POSTGRES_DB: "sidemantic_test" + POSTGRES_DB: "sqlctx_test" POSTGRES_USER: "test" POSTGRES_PASSWORD: "test" run: | @@ -83,7 +83,7 @@ jobs: # The suite parametrizes Python, public Rust (no fallback), and native Rust import/compile. - name: Run Ossie on real PostgreSQL and DuckDB env: - POSTGRES_URL: "postgres://test:test@localhost:5432/sidemantic_test" + POSTGRES_URL: "postgres://test:test@localhost:5432/sqlctx_test" run: | OSSIE_INTEGRATION_BACKEND=duckdb uv run pytest -m integration tests/db/test_ossie_integration.py -v OSSIE_INTEGRATION_BACKEND=postgres uv run pytest -m integration tests/db/test_ossie_integration.py -v @@ -315,7 +315,7 @@ jobs: env: POSTGRES_USER: test POSTGRES_PASSWORD: test - POSTGRES_DB: sidemantic_test + POSTGRES_DB: sqlctx_test ports: - 5432:5432 options: >- @@ -394,7 +394,7 @@ jobs: env: ADBC_TEST: "1" ADBC_DB: ${{ matrix.db }} - POSTGRES_URL: "postgres://test:test@localhost:5432/sidemantic_test" + POSTGRES_URL: "postgres://test:test@localhost:5432/sqlctx_test" BIGQUERY_EMULATOR_HOST: "localhost:9050" BIGQUERY_PROJECT: "test-project" BIGQUERY_DATASET: "test_dataset" @@ -408,22 +408,22 @@ jobs: - name: Export SQLite ADBC driver for Rust if: matrix.db == 'sqlite' run: | - echo "SIDEMANTIC_TEST_ADBC_SQLITE_DRIVER=sqlite" >> "$GITHUB_ENV" - echo "SIDEMANTIC_TEST_ADBC_SQLITE_URI=:memory:" >> "$GITHUB_ENV" - echo "SIDEMANTIC_TEST_ADBC_REQUIRE=sqlite" >> "$GITHUB_ENV" + echo "SQLCTX_TEST_ADBC_SQLITE_DRIVER=sqlite" >> "$GITHUB_ENV" + echo "SQLCTX_TEST_ADBC_SQLITE_URI=:memory:" >> "$GITHUB_ENV" + echo "SQLCTX_TEST_ADBC_REQUIRE=sqlite" >> "$GITHUB_ENV" - name: Export DuckDB ADBC driver for Rust if: matrix.db == 'duckdb' run: | - echo "SIDEMANTIC_TEST_ADBC_DUCKDB_DRIVER=duckdb" >> "$GITHUB_ENV" - echo "SIDEMANTIC_TEST_ADBC_REQUIRE=duckdb" >> "$GITHUB_ENV" + echo "SQLCTX_TEST_ADBC_DUCKDB_DRIVER=duckdb" >> "$GITHUB_ENV" + echo "SQLCTX_TEST_ADBC_REQUIRE=duckdb" >> "$GITHUB_ENV" - name: Export Postgres ADBC driver for Rust if: matrix.db == 'postgres' run: | - echo "SIDEMANTIC_TEST_ADBC_POSTGRES_DRIVER=postgresql" >> "$GITHUB_ENV" - echo "SIDEMANTIC_TEST_ADBC_POSTGRES_URI=postgresql://test:test@localhost:5432/sidemantic_test" >> "$GITHUB_ENV" - echo "SIDEMANTIC_TEST_ADBC_REQUIRE=postgres" >> "$GITHUB_ENV" + echo "SQLCTX_TEST_ADBC_POSTGRES_DRIVER=postgresql" >> "$GITHUB_ENV" + echo "SQLCTX_TEST_ADBC_POSTGRES_URI=postgresql://test:test@localhost:5432/sqlctx_test" >> "$GITHUB_ENV" + echo "SQLCTX_TEST_ADBC_REQUIRE=postgres" >> "$GITHUB_ENV" - name: Export BigQuery ADBC driver for Rust if: matrix.db == 'bigquery' @@ -439,9 +439,9 @@ jobs: CREDENTIALS_FILE="$(mktemp)" printf '%s' "$BIGQUERY_ADBC_CREDENTIALS_JSON" > "$CREDENTIALS_FILE" echo "::add-mask::$BIGQUERY_ADBC_CREDENTIALS_JSON" - echo "SIDEMANTIC_TEST_ADBC_BIGQUERY_DRIVER=bigquery" >> "$GITHUB_ENV" - echo "SIDEMANTIC_TEST_ADBC_BIGQUERY_DBOPTS=adbc.bigquery.sql.project_id=$BIGQUERY_ADBC_PROJECT,adbc.bigquery.sql.dataset_id=$BIGQUERY_ADBC_DATASET,adbc.bigquery.sql.auth_type=adbc.bigquery.sql.auth_type.json_credential_file,adbc.bigquery.sql.auth_credentials=$CREDENTIALS_FILE" >> "$GITHUB_ENV" - echo "SIDEMANTIC_TEST_ADBC_REQUIRE=bigquery" >> "$GITHUB_ENV" + echo "SQLCTX_TEST_ADBC_BIGQUERY_DRIVER=bigquery" >> "$GITHUB_ENV" + echo "SQLCTX_TEST_ADBC_BIGQUERY_DBOPTS=adbc.bigquery.sql.project_id=$BIGQUERY_ADBC_PROJECT,adbc.bigquery.sql.dataset_id=$BIGQUERY_ADBC_DATASET,adbc.bigquery.sql.auth_type=adbc.bigquery.sql.auth_type.json_credential_file,adbc.bigquery.sql.auth_credentials=$CREDENTIALS_FILE" >> "$GITHUB_ENV" + echo "SQLCTX_TEST_ADBC_REQUIRE=bigquery" >> "$GITHUB_ENV" - name: Export Snowflake ADBC driver for Rust if: matrix.db == 'snowflake' @@ -453,33 +453,33 @@ jobs: exit 0 fi echo "::add-mask::$SNOWFLAKE_ADBC_URI" - echo "SIDEMANTIC_TEST_ADBC_SNOWFLAKE_DRIVER=snowflake" >> "$GITHUB_ENV" - echo "SIDEMANTIC_TEST_ADBC_SNOWFLAKE_URI=$SNOWFLAKE_ADBC_URI" >> "$GITHUB_ENV" - echo "SIDEMANTIC_TEST_ADBC_REQUIRE=snowflake" >> "$GITHUB_ENV" + echo "SQLCTX_TEST_ADBC_SNOWFLAKE_DRIVER=snowflake" >> "$GITHUB_ENV" + echo "SQLCTX_TEST_ADBC_SNOWFLAKE_URI=$SNOWFLAKE_ADBC_URI" >> "$GITHUB_ENV" + echo "SQLCTX_TEST_ADBC_REQUIRE=snowflake" >> "$GITHUB_ENV" - name: Export ClickHouse ADBC driver for Rust if: matrix.db == 'clickhouse' run: | - echo "SIDEMANTIC_TEST_ADBC_CLICKHOUSE_DRIVER=clickhouse" >> "$GITHUB_ENV" - echo "SIDEMANTIC_TEST_ADBC_CLICKHOUSE_URI=http://localhost:8123/" >> "$GITHUB_ENV" - echo "SIDEMANTIC_TEST_ADBC_REQUIRE=clickhouse" >> "$GITHUB_ENV" + echo "SQLCTX_TEST_ADBC_CLICKHOUSE_DRIVER=clickhouse" >> "$GITHUB_ENV" + echo "SQLCTX_TEST_ADBC_CLICKHOUSE_URI=http://localhost:8123/" >> "$GITHUB_ENV" + echo "SQLCTX_TEST_ADBC_REQUIRE=clickhouse" >> "$GITHUB_ENV" - name: Run Rust ADBC semantic smoke env: - SIDEMANTIC_ADBC_TESTS: "1" - SIDEMANTIC_ADBC_DB: ${{ matrix.db }} - SIDEMANTIC_ADBC_REQUIRED: ${{ contains(fromJSON('["sqlite","duckdb","postgres","clickhouse"]'), matrix.db) }} - POSTGRES_URL: "postgres://test:test@localhost:5432/sidemantic_test" + SQLCTX_ADBC_TESTS: "1" + SQLCTX_ADBC_DB: ${{ matrix.db }} + SQLCTX_ADBC_REQUIRED: ${{ contains(fromJSON('["sqlite","duckdb","postgres","clickhouse"]'), matrix.db) }} + POSTGRES_URL: "postgres://test:test@localhost:5432/sqlctx_test" BIGQUERY_EMULATOR_HOST: "localhost:9050" BIGQUERY_PROJECT: "test-project" BIGQUERY_DATASET: "test_dataset" CLICKHOUSE_URL: "adbc://clickhouse?uri=http://localhost:8123/" SNOWFLAKE_TEST: "1" RUST_MIN_STACK: 16777216 - run: cargo test --manifest-path sidemantic-rs/Cargo.toml --features adbc-exec --test adbc_engines -- --nocapture + run: cargo test --manifest-path sqlctx-rs/Cargo.toml --features adbc-exec --test adbc_engines -- --nocapture - name: Run Rust ADBC probe - run: cargo test --manifest-path sidemantic-rs/Cargo.toml --features adbc-exec --test adbc_driver_matrix + run: cargo test --manifest-path sqlctx-rs/Cargo.toml --features adbc-exec --test adbc_driver_matrix - name: Save completed build caches if: ${{ !cancelled() }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 22bc9c774..77c8c43ad 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -57,12 +57,12 @@ jobs: uv run python - <<'PY' import sys - from sidemantic import Dimension, Metric, Model + from sqlctx import Dimension, Metric, Model assert Model.__name__ == "Model" assert Dimension.__name__ == "Dimension" assert Metric.__name__ == "Metric" - assert "sidemantic_dax" not in sys.modules + assert "sqlctx_dax" not in sys.modules PY - name: Install Rust and DAX dependencies @@ -128,7 +128,7 @@ jobs: version_files = ( Path("pyproject.toml"), Path("crates/dax-pyo3/pyproject.toml"), - Path("sidemantic-rs/pyproject.toml"), + Path("sqlctx-rs/pyproject.toml"), Path("crates/dax-pyo3/Cargo.toml"), ) for path in version_files: @@ -141,7 +141,7 @@ jobs: + "\n" ) - init_path = Path("sidemantic/__init__.py") + init_path = Path("sqlctx/__init__.py") init_lines = init_path.read_text().splitlines() init_path.write_text( "\n".join( @@ -155,8 +155,8 @@ jobs: pyproject_lines = pyproject_path.read_text().splitlines() pyproject_path.write_text( "\n".join( - f' "sidemantic-dax>={version}",' if line.strip().startswith('"sidemantic-dax>=') - else f' "sidemantic-rs=={version}; sys_platform != \'emscripten\'",' if line.strip().startswith('"sidemantic-rs==') + f' "sqlctx-dax>={version}",' if line.strip().startswith('"sqlctx-dax>=') + else f' "sqlctx-rs=={version}; sys_platform != \'emscripten\'",' if line.strip().startswith('"sqlctx-rs==') else line for line in pyproject_lines ) @@ -177,8 +177,8 @@ jobs: - name: Validate release tree run: | - uv run ruff check . --exclude docs/_extensions --exclude sidemantic-duckdb/extension-ci-tools --exclude sidemantic-duckdb/scripts --exclude sidemantic-duckdb/duckdb --exclude sidemantic/adapters/malloy_grammar --exclude sidemantic/adapters/holistics_grammar - uv run ruff format --check . --exclude docs/_extensions --exclude sidemantic-duckdb/extension-ci-tools --exclude sidemantic-duckdb/scripts --exclude sidemantic-duckdb/duckdb --exclude sidemantic/adapters/malloy_grammar --exclude sidemantic/adapters/holistics_grammar + uv run ruff check . --exclude docs/_extensions --exclude sqlctx-duckdb/extension-ci-tools --exclude sqlctx-duckdb/scripts --exclude sqlctx-duckdb/duckdb --exclude sqlctx/adapters/malloy_grammar --exclude sqlctx/adapters/holistics_grammar + uv run ruff format --check . --exclude docs/_extensions --exclude sqlctx-duckdb/extension-ci-tools --exclude sqlctx-duckdb/scripts --exclude sqlctx-duckdb/duckdb --exclude sqlctx/adapters/malloy_grammar --exclude sqlctx/adapters/holistics_grammar uv run mypy uv run mypy --config-file tests/typing/mypy.ini tests/typing/package_consumer.py uv run pytest -v --cov-fail-under=76 @@ -188,20 +188,20 @@ jobs: - name: Build packages run: | - uv build sidemantic-rs --sdist --out-dir dist + uv build sqlctx-rs --sdist --out-dir dist uv build crates/dax-pyo3 --sdist --out-dir dist uv build --out-dir dist - unzip -l "$(find dist -name 'sidemantic-[0-9]*.whl' -print -quit)" | grep -q 'sidemantic/py.typed' + unzip -l "$(find dist -name 'sqlctx-[0-9]*.whl' -print -quit)" | grep -q 'sqlctx/py.typed' - name: Run installed-wheel DAX smoke run: | DIST_DIR=$(realpath dist) - SIDEMANTIC_WHEEL=$(realpath "$(find dist -name 'sidemantic-[0-9]*.whl' -print -quit)") + SQLCTX_WHEEL=$(realpath "$(find dist -name 'sqlctx-[0-9]*.whl' -print -quit)") cd /tmp - uv run --no-project --find-links "${DIST_DIR}" --with "${SIDEMANTIC_WHEEL}[dax]" -- python - <<'PY' - import sidemantic_dax + uv run --no-project --find-links "${DIST_DIR}" --with "${SQLCTX_WHEEL}[dax]" -- python - <<'PY' + import sqlctx_dax - sidemantic_dax.parse_expression("1") + sqlctx_dax.parse_expression("1") PY - name: Commit version bump and create tag @@ -209,13 +209,13 @@ jobs: run: | git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" - git add pyproject.toml sidemantic/__init__.py sidemantic/man/sidemantic.1 sidemantic-rs/pyproject.toml crates/dax-pyo3/pyproject.toml crates/dax-pyo3/Cargo.toml Cargo.lock uv.lock + git add pyproject.toml sqlctx/__init__.py sqlctx/man/sqlctx.1 sqlctx-rs/pyproject.toml crates/dax-pyo3/pyproject.toml crates/dax-pyo3/Cargo.toml Cargo.lock uv.lock git commit -m "Bump version to ${{ steps.version.outputs.new_version }}" git tag -a "v${{ steps.version.outputs.new_version }}" -m "Release v${{ steps.version.outputs.new_version }}" git push origin main git push origin "v${{ steps.version.outputs.new_version }}" - - name: Upload sdist and sidemantic wheel + - name: Upload sdist and sqlctx wheel uses: actions/upload-artifact@v4 with: name: dist-base @@ -223,7 +223,7 @@ jobs: if-no-files-found: error build-dax-wheels: - name: Build sidemantic-dax wheel (${{ matrix.target }}) + name: Build sqlctx-dax wheel (${{ matrix.target }}) needs: publish runs-on: ${{ matrix.os }} strategy: @@ -267,7 +267,7 @@ jobs: if-no-files-found: error build-runtime-wheels: - name: Build sidemantic-rs wheel (${{ matrix.target }}) + name: Build sqlctx-rs wheel (${{ matrix.target }}) needs: publish runs-on: ${{ matrix.os }} strategy: @@ -299,7 +299,7 @@ jobs: uses: PyO3/maturin-action@v1 with: command: build - args: --release --manifest-path sidemantic-rs/Cargo.toml --out sidemantic-rs/dist + args: --release --manifest-path sqlctx-rs/Cargo.toml --out sqlctx-rs/dist manylinux: auto target: ${{ matrix.target }} @@ -310,13 +310,13 @@ jobs: - name: Smoke runtime wheel shell: bash - run: uv run --no-project --with sidemantic-rs/dist/*.whl sidemantic-rs/tests/python_wheel_python_smoke.py + run: uv run --no-project --with sqlctx-rs/dist/*.whl sqlctx-rs/tests/python_wheel_python_smoke.py - name: Upload abi3 wheel uses: actions/upload-artifact@v4 with: name: dist-runtime-${{ matrix.os }}-${{ matrix.target }} - path: sidemantic-rs/dist/*.whl + path: sqlctx-rs/dist/*.whl if-no-files-found: error release: @@ -347,9 +347,9 @@ jobs: env: UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }} run: | - uv publish dist/sidemantic_rs-* --token "$UV_PUBLISH_TOKEN" - uv publish dist/sidemantic_dax-* --token "$UV_PUBLISH_TOKEN" - uv publish dist/sidemantic-[0-9]* --token "$UV_PUBLISH_TOKEN" + uv publish dist/sqlctx_rs-* --token "$UV_PUBLISH_TOKEN" + uv publish dist/sqlctx_dax-* --token "$UV_PUBLISH_TOKEN" + uv publish dist/sqlctx-[0-9]* --token "$UV_PUBLISH_TOKEN" - name: Create GitHub Release env: diff --git a/.github/workflows/pyodide-test.yml b/.github/workflows/pyodide-test.yml index 725753a5e..17c0acd2f 100644 --- a/.github/workflows/pyodide-test.yml +++ b/.github/workflows/pyodide-test.yml @@ -23,7 +23,7 @@ jobs: enable-cache: true suffix: ${{ github.workflow }}-${{ github.job }}-${{ strategy.job-index || 0 }} - - name: Build sidemantic wheel + - name: Build sqlctx wheel run: uv build - name: Inspect wheel metadata @@ -42,7 +42,7 @@ jobs: print(metadata) requires = metadata.get_all("Requires-Dist", []) extras = set(metadata.get_all("Provides-Extra", [])) - heavy_optional = ("textual", "pyarrow", "mcp", "riffq", "altair", "vl-convert-python", "sidemantic-dax") + heavy_optional = ("textual", "pyarrow", "mcp", "riffq", "altair", "vl-convert-python", "sqlctx-dax") for requirement in requires: name = re.split(r"[<>=!~;\[ ]", requirement.strip(), maxsplit=1)[0] if name in heavy_optional: @@ -54,7 +54,7 @@ jobs: - name: Install Pyodide and dependencies run: npm install pyodide glob - - name: Test sidemantic in Pyodide + - name: Test sqlctx in Pyodide run: | cat > test_pyodide.mjs << 'EOF' import { loadPyodide } from 'pyodide'; @@ -80,20 +80,20 @@ jobs: const wheelName = wheelPath.split('/').pop(); pyodide.FS.writeFile(`/tmp/${wheelName}`, wheelData); - console.log('Installing sidemantic with the documented Pyodide no-deps path...'); + console.log('Installing sqlctx with the documented Pyodide no-deps path...'); await pyodide.runPythonAsync(` import micropip # Install missing pure-Python deps await micropip.install(['sqlglot', 'lkml', 'inflect'], deps=False) - # Install sidemantic from local wheel without deps + # Install sqlctx from local wheel without deps await micropip.install('emfs:/tmp/` + wheelName + `', deps=False) `); console.log('Testing basic imports...'); await pyodide.runPythonAsync(` - from sidemantic import Model, Dimension, Metric, Relationship, SemanticLayer - from sidemantic.core.semantic_graph import SemanticGraph - from sidemantic.loaders import load_from_directory + from sqlctx import Model, Dimension, Metric, Relationship, SemanticLayer + from sqlctx.core.semantic_graph import SemanticGraph + from sqlctx.loaders import load_from_directory print('✓ Core imports successful') # Test creating a model (doesn't need duckdb) diff --git a/.github/workflows/release-rust-binaries.yml b/.github/workflows/release-rust-binaries.yml index a59a18786..422b6cf28 100644 --- a/.github/workflows/release-rust-binaries.yml +++ b/.github/workflows/release-rust-binaries.yml @@ -10,7 +10,7 @@ on: workflow_dispatch: inputs: tag: - description: Git tag for the GitHub Release to attach binaries to, for example sidemantic-rs-v0.1.0. + description: Git tag for the GitHub Release to attach binaries to, for example sqlctx-rs-v0.1.0. required: true type: string @@ -19,7 +19,7 @@ permissions: env: CARGO_TERM_COLOR: always - CARGO_TARGET_DIR: sidemantic-rs/target + CARGO_TARGET_DIR: sqlctx-rs/target RUST_FEATURES: mcp-server,runtime-server,runtime-lsp,workbench-tui jobs: @@ -77,7 +77,7 @@ jobs: shell: bash run: | set -euo pipefail - VERSION=$(grep '^version = ' sidemantic-rs/Cargo.toml | sed 's/version = "\(.*\)"/\1/') + VERSION=$(grep '^version = ' sqlctx-rs/Cargo.toml | sed 's/version = "\(.*\)"/\1/') echo "version=$VERSION" >> "$GITHUB_OUTPUT" - name: Verify release tag matches crate version @@ -87,7 +87,7 @@ jobs: RUST_VERSION: ${{ steps.rust_version.outputs.version }} run: | set -euo pipefail - expected_tag="sidemantic-rs-v${RUST_VERSION}" + expected_tag="sqlctx-rs-v${RUST_VERSION}" if [ "$RELEASE_TAG" != "$expected_tag" ]; then echo "Release tag '$RELEASE_TAG' does not match Rust crate version tag '$expected_tag'" >&2 exit 1 @@ -103,29 +103,29 @@ jobs: TARGET: ${{ matrix.target }} run: | cargo build \ - --manifest-path sidemantic-rs/Cargo.toml \ + --manifest-path sqlctx-rs/Cargo.toml \ --release \ --locked \ --target "$TARGET" \ --features "$RUST_FEATURES" \ - --bin sidemantic \ - --bin sidemantic-mcp \ - --bin sidemantic-server \ - --bin sidemantic-lsp \ - --bin sidemantic-workbench + --bin sqlctx \ + --bin sqlctx-mcp \ + --bin sqlctx-server \ + --bin sqlctx-lsp \ + --bin sqlctx-workbench - name: Smoke CLI if: runner.os != 'Windows' env: TARGET: ${{ matrix.target }} - run: sidemantic-rs/target/"$TARGET"/release/sidemantic --help + run: sqlctx-rs/target/"$TARGET"/release/sqlctx --help - name: Smoke CLI if: runner.os == 'Windows' env: TARGET: ${{ matrix.target }} shell: pwsh - run: sidemantic-rs/target/$env:TARGET/release/sidemantic.exe --help + run: sqlctx-rs/target/$env:TARGET/release/sqlctx.exe --help - name: Package archive if: runner.os != 'Windows' @@ -136,17 +136,17 @@ jobs: run: | set -euo pipefail version="$RUST_VERSION" - asset_name="sidemantic-rs-${version}-${ASSET_SUFFIX}" + asset_name="sqlctx-rs-${version}-${ASSET_SUFFIX}" archive_path="dist/${asset_name}.tar.gz" checksum_path="${archive_path}.sha256" - target_dir="sidemantic-rs/target/${TARGET}/release" + target_dir="sqlctx-rs/target/${TARGET}/release" mkdir -p "dist/${asset_name}" - install -m 755 "${target_dir}/sidemantic" "dist/${asset_name}/sidemantic" - install -m 755 "${target_dir}/sidemantic-mcp" "dist/${asset_name}/sidemantic-mcp" - install -m 755 "${target_dir}/sidemantic-server" "dist/${asset_name}/sidemantic-server" - install -m 755 "${target_dir}/sidemantic-lsp" "dist/${asset_name}/sidemantic-lsp" - install -m 755 "${target_dir}/sidemantic-workbench" "dist/${asset_name}/sidemantic-workbench" + install -m 755 "${target_dir}/sqlctx" "dist/${asset_name}/sqlctx" + install -m 755 "${target_dir}/sqlctx-mcp" "dist/${asset_name}/sqlctx-mcp" + install -m 755 "${target_dir}/sqlctx-server" "dist/${asset_name}/sqlctx-server" + install -m 755 "${target_dir}/sqlctx-lsp" "dist/${asset_name}/sqlctx-lsp" + install -m 755 "${target_dir}/sqlctx-workbench" "dist/${asset_name}/sqlctx-workbench" cp LICENSE "dist/${asset_name}/LICENSE" tar -C dist -czf "$archive_path" "$asset_name" @@ -168,17 +168,17 @@ jobs: shell: pwsh run: | $version = $env:RUST_VERSION - $assetName = "sidemantic-rs-$version-$env:ASSET_SUFFIX" + $assetName = "sqlctx-rs-$version-$env:ASSET_SUFFIX" $archivePath = "dist/$assetName.zip" $checksumPath = "$archivePath.sha256" - $targetDir = "sidemantic-rs/target/$env:TARGET/release" + $targetDir = "sqlctx-rs/target/$env:TARGET/release" New-Item -ItemType Directory -Force -Path "dist/$assetName" - Copy-Item "$targetDir/sidemantic.exe" "dist/$assetName/sidemantic.exe" - Copy-Item "$targetDir/sidemantic-mcp.exe" "dist/$assetName/sidemantic-mcp.exe" - Copy-Item "$targetDir/sidemantic-server.exe" "dist/$assetName/sidemantic-server.exe" - Copy-Item "$targetDir/sidemantic-lsp.exe" "dist/$assetName/sidemantic-lsp.exe" - Copy-Item "$targetDir/sidemantic-workbench.exe" "dist/$assetName/sidemantic-workbench.exe" + Copy-Item "$targetDir/sqlctx.exe" "dist/$assetName/sqlctx.exe" + Copy-Item "$targetDir/sqlctx-mcp.exe" "dist/$assetName/sqlctx-mcp.exe" + Copy-Item "$targetDir/sqlctx-server.exe" "dist/$assetName/sqlctx-server.exe" + Copy-Item "$targetDir/sqlctx-lsp.exe" "dist/$assetName/sqlctx-lsp.exe" + Copy-Item "$targetDir/sqlctx-workbench.exe" "dist/$assetName/sqlctx-workbench.exe" Copy-Item LICENSE "dist/$assetName/LICENSE" Compress-Archive -Path "dist/$assetName" -DestinationPath $archivePath -Force diff --git a/.github/workflows/rust-runtime-release.yml b/.github/workflows/rust-runtime-release.yml index 227204e92..b1d7e59ce 100644 --- a/.github/workflows/rust-runtime-release.yml +++ b/.github/workflows/rust-runtime-release.yml @@ -15,14 +15,14 @@ on: type: boolean push: tags: - - "sidemantic-rs-v*" + - "sqlctx-rs-v*" - "rust-runtime-v*" pull_request: paths: - ".github/actions/**" - ".github/workflows/rust-runtime-release.yml" - - "sidemantic-rs/tests/packaged_cli_smoke.py" + - "sqlctx-rs/tests/packaged_cli_smoke.py" permissions: contents: read @@ -36,7 +36,7 @@ jobs: runs-on: ubuntu-latest defaults: run: - working-directory: sidemantic-rs + working-directory: sqlctx-rs steps: - uses: actions/checkout@v4 @@ -96,7 +96,7 @@ jobs: defaults: run: - working-directory: sidemantic-rs + working-directory: sqlctx-rs steps: - uses: actions/checkout@v4 @@ -112,7 +112,7 @@ jobs: suffix: ${{ github.workflow }}-${{ github.job }}-${{ strategy.job-index || 0 }} - name: Build CLI - run: cargo build --release --locked --bin sidemantic + run: cargo build --release --locked --bin sqlctx - name: Package CLI artifact shell: bash @@ -120,10 +120,10 @@ jobs: mkdir -p dist if [ "$RUNNER_OS" = "Windows" ]; then - cp ../target/release/sidemantic.exe "dist/sidemantic-${{ matrix.artifact }}.exe" + cp ../target/release/sqlctx.exe "dist/sqlctx-${{ matrix.artifact }}.exe" else - cp ../target/release/sidemantic "dist/sidemantic-${{ matrix.artifact }}" - tar -czf "dist/sidemantic-${{ matrix.artifact }}.tar.gz" -C dist "sidemantic-${{ matrix.artifact }}" + cp ../target/release/sqlctx "dist/sqlctx-${{ matrix.artifact }}" + tar -czf "dist/sqlctx-${{ matrix.artifact }}.tar.gz" -C dist "sqlctx-${{ matrix.artifact }}" fi - name: Install uv @@ -137,19 +137,19 @@ jobs: shell: bash run: | if [ "$RUNNER_OS" = "Windows" ]; then - uv run --no-project tests/packaged_cli_smoke.py dist/sidemantic-${{ matrix.artifact }}.exe + uv run --no-project tests/packaged_cli_smoke.py dist/sqlctx-${{ matrix.artifact }}.exe else mkdir -p dist/smoke - tar -xzf dist/sidemantic-${{ matrix.artifact }}.tar.gz -C dist/smoke - uv run --no-project tests/packaged_cli_smoke.py dist/smoke/sidemantic-${{ matrix.artifact }} + tar -xzf dist/sqlctx-${{ matrix.artifact }}.tar.gz -C dist/smoke + uv run --no-project tests/packaged_cli_smoke.py dist/smoke/sqlctx-${{ matrix.artifact }} rm -r dist/smoke fi - name: Upload CLI artifact uses: actions/upload-artifact@v4 with: - name: sidemantic-cli-${{ matrix.artifact }} - path: sidemantic-rs/dist/* + name: sqlctx-cli-${{ matrix.artifact }} + path: sqlctx-rs/dist/* if-no-files-found: error - name: Save completed build caches @@ -184,8 +184,8 @@ jobs: if [ "${{ github.ref_type }}" = "tag" ]; then TAG="${{ github.ref_name }}" else - VERSION=$(grep '^version = ' sidemantic-rs/Cargo.toml | sed 's/version = "\(.*\)"/\1/') - TAG="sidemantic-rs-v${VERSION}" + VERSION=$(grep '^version = ' sqlctx-rs/Cargo.toml | sed 's/version = "\(.*\)"/\1/') + TAG="sqlctx-rs-v${VERSION}" fi echo "tag=$TAG" >> "$GITHUB_OUTPUT" diff --git a/.github/workflows/sidemantic-rs-wheels.yml b/.github/workflows/sqlctx-rs-wheels.yml similarity index 87% rename from .github/workflows/sidemantic-rs-wheels.yml rename to .github/workflows/sqlctx-rs-wheels.yml index 4b2886e53..abd80b501 100644 --- a/.github/workflows/sidemantic-rs-wheels.yml +++ b/.github/workflows/sqlctx-rs-wheels.yml @@ -1,4 +1,4 @@ -name: sidemantic-rs Python Wheels +name: sqlctx-rs Python Wheels on: workflow_dispatch: @@ -15,14 +15,14 @@ on: type: boolean push: tags: - - "sidemantic-rs-v*" + - "sqlctx-rs-v*" pull_request: paths: - ".github/actions/**" - - ".github/workflows/sidemantic-rs-wheels.yml" - - "sidemantic-rs/pyproject.toml" - - "sidemantic-rs/tests/python_wheel_smoke.py" + - ".github/workflows/sqlctx-rs-wheels.yml" + - "sqlctx-rs/pyproject.toml" + - "sqlctx-rs/tests/python_wheel_smoke.py" permissions: contents: read @@ -71,7 +71,7 @@ jobs: uses: PyO3/maturin-action@v1 with: command: build - args: --release --manifest-path sidemantic-rs/Cargo.toml --out sidemantic-rs/dist + args: --release --manifest-path sqlctx-rs/Cargo.toml --out sqlctx-rs/dist manylinux: auto docker-options: ${{ github.event_name == 'pull_request' && '--env MBX_CACHE_DIR --env MBX_CACHE_EXPORT_GROUP --env MBX_TARGET_VIEWS=0 --env MBX_CACHE_LINKS --env MBX_GC_AUTO' || '' }} before-script-linux: | @@ -98,14 +98,14 @@ jobs: - name: Smoke built wheel on its target host shell: bash run: | - uv run --no-project --with sidemantic-rs/dist/*.whl sidemantic-rs/tests/python_wheel_smoke.py - uv run --no-project --with sidemantic-rs/dist/*.whl sidemantic-rs/tests/python_wheel_python_smoke.py + uv run --no-project --with sqlctx-rs/dist/*.whl sqlctx-rs/tests/python_wheel_smoke.py + uv run --no-project --with sqlctx-rs/dist/*.whl sqlctx-rs/tests/python_wheel_python_smoke.py - name: Upload wheel uses: actions/upload-artifact@v4 with: - name: sidemantic-rs-wheel-${{ matrix.os }}-${{ matrix.target }} - path: sidemantic-rs/dist/*.whl + name: sqlctx-rs-wheel-${{ matrix.os }}-${{ matrix.target }} + path: sqlctx-rs/dist/*.whl if-no-files-found: error - name: Save completed build caches @@ -120,7 +120,7 @@ jobs: runs-on: ubuntu-latest defaults: run: - working-directory: sidemantic-rs + working-directory: sqlctx-rs steps: - uses: actions/checkout@v4 @@ -141,8 +141,8 @@ jobs: - name: Upload sdist uses: actions/upload-artifact@v4 with: - name: sidemantic-rs-sdist - path: sidemantic-rs/dist/*.tar.gz + name: sqlctx-rs-sdist + path: sqlctx-rs/dist/*.tar.gz if-no-files-found: error - name: Save completed build caches @@ -195,8 +195,8 @@ jobs: if [ "${{ github.ref_type }}" = "tag" ]; then TAG="${{ github.ref_name }}" else - VERSION=$(grep '^version = ' sidemantic-rs/pyproject.toml | sed 's/version = "\(.*\)"/\1/') - TAG="sidemantic-rs-v${VERSION}" + VERSION=$(grep '^version = ' sqlctx-rs/pyproject.toml | sed 's/version = "\(.*\)"/\1/') + TAG="sqlctx-rs-v${VERSION}" fi echo "tag=$TAG" >> "$GITHUB_OUTPUT" diff --git a/.github/workflows/wasm-package-release.yml b/.github/workflows/wasm-package-release.yml index 43b5628f5..e3716d300 100644 --- a/.github/workflows/wasm-package-release.yml +++ b/.github/workflows/wasm-package-release.yml @@ -4,18 +4,18 @@ on: workflow_dispatch: inputs: publish_npm: - description: "Publish sidemantic-wasm to npm when NPM_TOKEN is available" + description: "Publish sqlctx-wasm to npm when NPM_TOKEN is available" required: false default: false type: boolean push: tags: - - "sidemantic-wasm-v*" + - "sqlctx-wasm-v*" pull_request: paths: - ".github/actions/**" - - "sidemantic-wasm/**" - - "sidemantic-rs/**" + - "sqlctx-wasm/**" + - "sqlctx-rs/**" - "Cargo.toml" - "Cargo.lock" - ".github/workflows/wasm-package-release.yml" @@ -32,7 +32,7 @@ jobs: runs-on: ubuntu-latest defaults: run: - working-directory: sidemantic-wasm + working-directory: sqlctx-wasm steps: - uses: actions/checkout@v4 @@ -69,10 +69,10 @@ jobs: - name: Check bundle output run: | - test -f wasm/sidemantic_bg.wasm - test -f wasm/sidemantic.js + test -f wasm/sqlctx_bg.wasm + test -f wasm/sqlctx.js ls -la wasm/ - echo "raw wasm bytes: $(stat -c%s wasm/sidemantic_bg.wasm)" + echo "raw wasm bytes: $(stat -c%s wasm/sqlctx_bg.wasm)" - name: Smoke test the bundle run: | @@ -83,25 +83,25 @@ jobs: - name: Pack and smoke test shipped package run: | - bun pm pack --ignore-scripts --filename sidemantic-wasm.tgz - bun run scripts/smoke_package.mjs sidemantic-wasm.tgz + bun pm pack --ignore-scripts --filename sqlctx-wasm.tgz + bun run scripts/smoke_package.mjs sqlctx-wasm.tgz - name: Upload tested package uses: actions/upload-artifact@v4 with: - name: sidemantic-wasm-package - path: sidemantic-wasm/sidemantic-wasm.tgz + name: sqlctx-wasm-package + path: sqlctx-wasm/sqlctx-wasm.tgz if-no-files-found: error - name: Set up npm registry - if: ${{ (github.event_name == 'workflow_dispatch' && inputs.publish_npm == true) || startsWith(github.ref, 'refs/tags/sidemantic-wasm-v') }} + if: ${{ (github.event_name == 'workflow_dispatch' && inputs.publish_npm == true) || startsWith(github.ref, 'refs/tags/sqlctx-wasm-v') }} uses: actions/setup-node@v4 with: node-version: "20" registry-url: "https://registry.npmjs.org" - name: Publish to npm - if: ${{ (github.event_name == 'workflow_dispatch' && inputs.publish_npm == true) || startsWith(github.ref, 'refs/tags/sidemantic-wasm-v') }} + if: ${{ (github.event_name == 'workflow_dispatch' && inputs.publish_npm == true) || startsWith(github.ref, 'refs/tags/sqlctx-wasm-v') }} env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} run: | @@ -110,7 +110,7 @@ jobs: exit 0 fi # Publish the exact tarball exercised by the isolated consumer above. - npm publish sidemantic-wasm.tgz --access public --ignore-scripts + npm publish sqlctx-wasm.tgz --access public --ignore-scripts - name: Save completed build caches if: ${{ !cancelled() && github.event_name == 'pull_request' }} diff --git a/.github/workflows/yardstick-upstream.yml b/.github/workflows/yardstick-upstream.yml index f86bccbdb..b35b66717 100644 --- a/.github/workflows/yardstick-upstream.yml +++ b/.github/workflows/yardstick-upstream.yml @@ -14,9 +14,9 @@ on: - ".github/actions/**" - ".github/workflows/yardstick-upstream.yml" - "docs/compatibility/yardstick.md" - - "sidemantic/adapters/yardstick.py" - - "sidemantic/sql/aggregation_detection.py" - - "sidemantic/sql/query_rewriter.py" + - "sqlctx/adapters/yardstick.py" + - "sqlctx/sql/aggregation_detection.py" + - "sqlctx/sql/query_rewriter.py" - "tests/queries/test_yardstick_measures_replay.py" - "tests/queries/test_yardstick_query_rewriter.py" @@ -33,7 +33,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 15 env: - SIDEMANTIC_YARDSTICK_UPSTREAM_TESTS: "1" + SQLCTX_YARDSTICK_UPSTREAM_TESTS: "1" YARDSTICK_UPSTREAM_REF: ${{ github.event.inputs.yardstick_ref || 'main' }} steps: diff --git a/.gitignore b/.gitignore index 0b5bdc25b..bb957d381 100644 --- a/.gitignore +++ b/.gitignore @@ -35,12 +35,12 @@ examples/juv.tmp*.py # Package installers *.pkg .claude/settings.local.json -crates/dax-pyo3/python/sidemantic_dax/_native*.so +crates/dax-pyo3/python/sqlctx_dax/_native*.so # Docker volumes docker-compose.override.yml Dockerfile.test -sidemantic_definitions.sql +sqlctx_definitions.sql # Node.js (for bun tests) node_modules/ @@ -49,7 +49,8 @@ package.json !js/package.json !js/bun.lock !webapp/package.json -!sidemantic/apps/web/package.json +!sqlctx/apps/web/package.json +!vscode-sqlctx/package.json # Rust workspace build artifacts (dax local wheel builds) /target/ diff --git a/AGENTS.md b/AGENTS.md index 7ccc08aa1..7abc0f225 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,16 +1,16 @@ -# Sidemantic +# sqlctx Universal SQL-first semantic layer in Python. Imports from Cube/LookML/dbt/Hex/Rill/Malloy, queries against DuckDB/Postgres/BigQuery/Snowflake/etc. ## Usage Preference (Important) -- Sidemantic usage is overwhelmingly CLI-first in practice (roughly 95% CLI usage). -- Default to `sidemantic` CLI workflows (`validate`, `info`, `query`, `migrate`, etc.). +- sqlctx usage is overwhelmingly CLI-first in practice (roughly 95% CLI usage). +- Default to `sqlctx` CLI workflows (`validate`, `info`, `query`, `migrate`, etc.). - Treat Python API examples as secondary, advanced automation paths, not the default onboarding path. ## Codebase Structure -**Main Python package:** `sidemantic/` +**Main Python package:** `sqlctx/` - `core/` - SemanticLayer, Model, Dimension, Metric, SemanticGraph - `adapters/` - Format parsers (Cube, LookML, MetricFlow, Hex, Rill, Malloy, etc.) - `db/` - Database adapters @@ -18,8 +18,8 @@ Universal SQL-first semantic layer in Python. Imports from Cube/LookML/dbt/Hex/R - `widget/`, `server/`, `workbench/`, `mcp_server.py` - Optional features with lazy imports **Rust runtime and DuckDB extension (experimental):** -- `sidemantic-rs/` - Rust native runtime, also built as the `sidemantic-rs` Python extension. Python opts in through `sidemantic/rust_bridge.py`, the optional `rust` extra, and `--engine rust|auto`; Python stays the default engine (see `docs/rust-engine-mode.md`). -- `sidemantic-duckdb/` - DuckDB extension wrapping sidemantic-rs +- `sqlctx-rs/` - Rust native runtime, also built as the `sqlctx-rs` Python extension. Python opts in through `sqlctx/rust_bridge.py`, the optional `rust` extra, and `--engine rust|auto`; Python stays the default engine (see `docs/rust-engine-mode.md`). +- `sqlctx-duckdb/` - DuckDB extension wrapping sqlctx-rs CI runs the Rust and DuckDB jobs when their dirs change, and the Rust jobs also when the Python code they exercise changes (bridge, core, SQL, CLI; see the paths filter in `.github/workflows/ci.yml`). @@ -27,7 +27,7 @@ CI runs the Rust and DuckDB jobs when their dirs change, and the Rust jobs also Update BOTH when releasing: - `pyproject.toml`: `version = "X.Y.Z"` -- `sidemantic/__init__.py`: `__version__ = "X.Y.Z"` +- `sqlctx/__init__.py`: `__version__ = "X.Y.Z"` ## Validation Before Commits @@ -47,16 +47,16 @@ uv sync --extra dev uv run python - <<'PY' import sys -from sidemantic import Dimension, Metric, Model +from sqlctx import Dimension, Metric, Model assert Model.__name__ == "Model" assert Dimension.__name__ == "Dimension" assert Metric.__name__ == "Metric" -assert "sidemantic_dax" not in sys.modules +assert "sqlctx_dax" not in sys.modules PY uv sync --extra dev --extra dax -uv run ruff check . --exclude docs/_extensions --exclude sidemantic-duckdb/extension-ci-tools --exclude sidemantic-duckdb/scripts --exclude sidemantic-duckdb/duckdb --exclude sidemantic/adapters/malloy_grammar --exclude sidemantic/adapters/holistics_grammar -uv run ruff format --check . --exclude docs/_extensions --exclude sidemantic-duckdb/extension-ci-tools --exclude sidemantic-duckdb/scripts --exclude sidemantic-duckdb/duckdb --exclude sidemantic/adapters/malloy_grammar --exclude sidemantic/adapters/holistics_grammar +uv run ruff check . --exclude docs/_extensions --exclude sqlctx-duckdb/extension-ci-tools --exclude sqlctx-duckdb/scripts --exclude sqlctx-duckdb/duckdb --exclude sqlctx/adapters/malloy_grammar --exclude sqlctx/adapters/holistics_grammar +uv run ruff format --check . --exclude docs/_extensions --exclude sqlctx-duckdb/extension-ci-tools --exclude sqlctx-duckdb/scripts --exclude sqlctx-duckdb/duckdb --exclude sqlctx/adapters/malloy_grammar --exclude sqlctx/adapters/holistics_grammar uv run python -m playwright install --with-deps chromium uv run pytest -v ``` @@ -64,8 +64,8 @@ uv run pytest -v If any fail, fix them: ```bash # Fix ruff issues -uv run ruff check --fix . --exclude docs/_extensions --exclude sidemantic-duckdb/extension-ci-tools --exclude sidemantic-duckdb/scripts --exclude sidemantic-duckdb/duckdb --exclude sidemantic/adapters/malloy_grammar --exclude sidemantic/adapters/holistics_grammar -uv run ruff format . --exclude docs/_extensions --exclude sidemantic-duckdb/extension-ci-tools --exclude sidemantic-duckdb/scripts --exclude sidemantic-duckdb/duckdb --exclude sidemantic/adapters/malloy_grammar --exclude sidemantic/adapters/holistics_grammar +uv run ruff check --fix . --exclude docs/_extensions --exclude sqlctx-duckdb/extension-ci-tools --exclude sqlctx-duckdb/scripts --exclude sqlctx-duckdb/duckdb --exclude sqlctx/adapters/malloy_grammar --exclude sqlctx/adapters/holistics_grammar +uv run ruff format . --exclude docs/_extensions --exclude sqlctx-duckdb/extension-ci-tools --exclude sqlctx-duckdb/scripts --exclude sqlctx-duckdb/duckdb --exclude sqlctx/adapters/malloy_grammar --exclude sqlctx/adapters/holistics_grammar ``` **PRs:** Do not include test commands in PR bodies unless explicitly requested. @@ -83,23 +83,23 @@ uv run ruff format . --exclude docs/_extensions --exclude sidemantic-duckdb/exte - DO NOT add dev tools to main dependencies unless explicitly requested - Optional features use `[project.optional-dependencies]`: - `workbench` - textual, plotext, textual-plotext (for TUI, NOT Pyodide compatible) - - `serve` - riffq, pyarrow (for the PostgreSQL wire server, `sidemantic server postgres`; NOT Pyodide compatible) - - `api` / `mcp` - fastapi, uvicorn, pyarrow / mcp[cli] (for `sidemantic serve`, `server api`, `server mcp`) + - `serve` - riffq, pyarrow (for the PostgreSQL wire server, `sqlctx server postgres`; NOT Pyodide compatible) + - `api` / `mcp` - fastapi, uvicorn, pyarrow / mcp[cli] (for `sqlctx serve`, `server api`, `server mcp`) - `dev` - pytest, ruff, pandas, numpy (for development) **CRITICAL: Pyodide Compatibility Rules** - **Core dependencies** (in main `dependencies` list) MUST work in Pyodide/WASM - **Optional dependencies** can use packages incompatible with Pyodide (textual, riffq, pyarrow, mcp) - **ALL imports** of optional deps MUST be lazy (inside functions, NOT at module level) -- **Test**: `from sidemantic import Model, Dimension, Metric` must work without any optional deps +- **Test**: `from sqlctx import Model, Dimension, Metric` must work without any optional deps ## Pyodide Compatibility **Import Structure:** -- `sidemantic/__init__.py` - Only imports core classes (Model, Dimension, etc.) -- `sidemantic/cli.py` - Imports typer (core dep) at top, workbench/server imports inside command functions -- `sidemantic/workbench/__init__.py` - Lazy imports textual inside `run_workbench()` function -- `sidemantic/server/` - Not imported by `sidemantic/__init__.py`; `server.py`/`connection.py` (riffq) load only for `sidemantic server postgres`, and the dependency-free `common.py` is shared with the API, MCP, and chart modules +- `sqlctx/__init__.py` - Only imports core classes (Model, Dimension, etc.) +- `sqlctx/cli.py` - Imports typer (core dep) at top, workbench/server imports inside command functions +- `sqlctx/workbench/__init__.py` - Lazy imports textual inside `run_workbench()` function +- `sqlctx/server/` - Not imported by `sqlctx/__init__.py`; `server.py`/`connection.py` (riffq) load only for `sqlctx server postgres`, and the dependency-free `common.py` is shared with the API, MCP, and chart modules **Pyodide install path** (`docs/pyodide.md`, `.github/workflows/pyodide-test.yml`): - Pyodide's bundled `pydantic`, `pyyaml`, and `jinja2` are loaded first; `sqlglot`, `lkml`, and `inflect` are installed with `deps=False` diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9375ca3b0..9df6254e0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Contributing -Sidemantic is primarily developed by Sidequery Corporation. We're not actively seeking external contributions at this time. +sqlctx is primarily developed by Sidequery Corporation. We're not actively seeking external contributions at this time. If you find bugs, please open an issue with reproduction steps. diff --git a/Cargo.lock b/Cargo.lock index 6fd83180e..51c1376ea 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2416,42 +2416,6 @@ version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" -[[package]] -name = "sidemantic" -version = "0.1.0" -dependencies = [ - "adbc_core", - "adbc_driver_manager", - "arrow-array", - "arrow-ipc", - "arrow-schema", - "axum", - "chrono", - "crossterm", - "lazy_static", - "mime_guess", - "minijinja", - "nom", - "once_cell", - "polyglot-sql", - "pyo3", - "ratatui", - "regex", - "rmcp", - "rust-embed", - "serde", - "serde_json", - "serde_yaml", - "thiserror 2.0.21", - "tokio", - "tokio-stream", - "tower-lsp", - "url", - "wasm-bindgen", - "wasm-bindgen-test", - "windows-sys", -] - [[package]] name = "signal-hook" version = "0.3.18" @@ -2511,6 +2475,42 @@ dependencies = [ "windows-sys", ] +[[package]] +name = "sqlctx" +version = "0.1.0" +dependencies = [ + "adbc_core", + "adbc_driver_manager", + "arrow-array", + "arrow-ipc", + "arrow-schema", + "axum", + "chrono", + "crossterm", + "lazy_static", + "mime_guess", + "minijinja", + "nom", + "once_cell", + "polyglot-sql", + "pyo3", + "ratatui", + "regex", + "rmcp", + "rust-embed", + "serde", + "serde_json", + "serde_yaml", + "thiserror 2.0.21", + "tokio", + "tokio-stream", + "tower-lsp", + "url", + "wasm-bindgen", + "wasm-bindgen-test", + "windows-sys", +] + [[package]] name = "stable_deref_trait" version = "1.2.1" diff --git a/Cargo.toml b/Cargo.toml index a89be2d5a..e7a115c22 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [workspace] members = [ - "sidemantic-rs", + "sqlctx-rs", "crates/dax-parser", "crates/dax-pyo3", ] diff --git a/Dockerfile b/Dockerfile index cf47d73d4..6ea155958 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,12 +24,16 @@ WORKDIR /app # [tool.uv.sources], whose local Rust packages are not in the build context. # Dependencies install before the source is copied so code changes reuse the # slow riffq build layer. +# List database extras directly so uv does not fetch sqlctx from PyPI to +# resolve the all-databases extra. COPY pyproject.toml ./ RUN uv pip install --system --no-cache --no-sources -r pyproject.toml \ - --extra serve --extra mcp --extra api --extra all-databases + --extra serve --extra mcp --extra api \ + --extra postgres --extra bigquery --extra snowflake --extra clickhouse \ + --extra databricks --extra spark --extra adbc COPY README.md LICENSE ./ -COPY sidemantic/ sidemantic/ +COPY sqlctx/ sqlctx/ COPY examples/multi_format_demo/ examples/multi_format_demo/ COPY scripts/build_demo_duckdb.py scripts/ @@ -45,7 +49,7 @@ COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv # Copy installed packages from builder COPY --from=builder /usr/local/lib/python3.12/site-packages /usr/local/lib/python3.12/site-packages -COPY --from=builder /usr/local/bin/sidemantic /usr/local/bin/sidemantic +COPY --from=builder /usr/local/bin/sqlctx /usr/local/bin/sqlctx WORKDIR /app @@ -60,4 +64,4 @@ EXPOSE 5433 EXPOSE 4400 ENTRYPOINT ["/docker-entrypoint.sh"] -# Mode is controlled by SIDEMANTIC_MODE env var (serve, mcp, api, both) +# Mode is controlled by SQLCTX_MODE env var (serve, mcp, api, both) diff --git a/README.md b/README.md index 95a5b336e..3a5a4a3ba 100644 --- a/README.md +++ b/README.md @@ -1,39 +1,41 @@ -# Sidemantic +# sqlctx -Sidemantic is an open-source semantic runtime. Define governed metrics once—or import the semantic models you already have—and query them consistently from SQL, the CLI, Python, HTTP, PostgreSQL clients, notebooks, BI tools, and AI agents. +sqlctx is an open-source semantic runtime. Define governed metrics once—or import the semantic models you already have—and query them consistently from SQL, the CLI, Python, HTTP, PostgreSQL clients, notebooks, BI tools, and AI agents. - **Bring existing models:** Power BI TMDL/DAX, Cube, dbt MetricFlow, LookML, Hex, Rill, Superset, Omni, BSL, GoodData LDM, Snowflake Cortex, Malloy, Apache Ossie, AtScale SML, and ThoughtSpot TML - **Or author natively:** concise YAML, semantic SQL DDL, or Python - **Run on your warehouse:** DuckDB, MotherDuck, PostgreSQL, BigQuery, Snowflake, ClickHouse, Databricks, Spark SQL, and ADBC sources - **Consume metrics anywhere:** semantic SQL, CLI, Python, HTTP/Arrow, PostgreSQL wire protocol, MCP, notebooks, TypeScript/WASM, and embedded analytics -[Documentation](https://sidemantic.com) | [GitHub](https://github.com/sidequery/sidemantic) | [Docker Hub](https://hub.docker.com/r/sidequery/sidemantic) | [Discord](https://discord.com/invite/7MZ4UgSVvF) | [Demo](https://sidemantic.com/demo) (50+ MB data download, runs in your browser with Pyodide + DuckDB) +[Documentation](docs/cli.md) | [GitHub](https://github.com/sidequery/sqlctx) | [Docker](#docker) | [Discord](https://discord.com/invite/7MZ4UgSVvF) | [Demo](https://sidemantic.com/demo) (50+ MB data download, runs in your browser with Pyodide + DuckDB) ![Jupyter Widget Preview](preview.png) -Sidemantic ships Claude Code and Codex plugin metadata for two skills (`modeler` and `webapp-builder`). See [Agent Plugin](#agent-plugin) below to install. +sqlctx ships Claude Code and Codex plugin metadata for two skills (`modeler` and `webapp-builder`). See [Agent Plugin](#agent-plugin) below to install. Contributors working on browser surfaces should read the [UI architecture and canonical ownership map](docs/ui-architecture.md). ## 60-second quickstart +Install from GitHub while PyPI serves the earlier sqlctx tool. + See it working before writing anything — one command creates a complete demo project (models, sample DuckDB data, golden tests) and runs a first query: ```bash -uvx sidemantic demo +uvx --from git+https://github.com/sidequery/sqlctx sqlctx demo ``` -Start from your own data — Sidemantic introspects it and generates models with +Start from your own data — sqlctx introspects it and generates models with inferred dimensions, metrics, and relationships: ```bash -uvx sidemantic init analytics --from 'data/*.csv' # also Parquet, JSON, DuckDB +uvx --from git+https://github.com/sidequery/sqlctx sqlctx init analytics --from 'data/*.csv' # also Parquet, JSON, DuckDB cd analytics -uvx sidemantic query "SELECT orders.record_count FROM orders" -uvx sidemantic test # golden-query assertions -uvx sidemantic validate --live # models vs. actual database schema -uvx --from "sidemantic[api,mcp]" sidemantic serve # web UI + HTTP API + MCP on one port +uvx --from git+https://github.com/sidequery/sqlctx sqlctx query "SELECT orders.record_count FROM orders" +uvx --from git+https://github.com/sidequery/sqlctx sqlctx test # golden-query assertions +uvx --from git+https://github.com/sidequery/sqlctx sqlctx validate --live # models vs. actual database schema +uvx --from "sqlctx[api,mcp] @ git+https://github.com/sidequery/sqlctx" sqlctx serve # web UI + HTTP API + MCP on one port ``` Or write a model by hand. Create `models/orders.yml`: @@ -63,7 +65,7 @@ models: Query it directly—no database setup or package installation required: ```bash -uvx sidemantic query \ +uvx --from git+https://github.com/sidequery/sqlctx sqlctx query \ "SELECT orders.status, orders.revenue, orders.order_count FROM orders ORDER BY orders.status" \ @@ -80,41 +82,43 @@ From here, inspect generated warehouse SQL or open an interactive explorer: ```bash # Compile without executing -uvx sidemantic query \ +uvx --from git+https://github.com/sidequery/sqlctx sqlctx query \ "SELECT orders.status, orders.revenue FROM orders" \ --models ./models --dry-run # Explore in the terminal -uvx --from "sidemantic[workbench]" sidemantic workbench ./models +uvx --from "sqlctx[workbench] @ git+https://github.com/sidequery/sqlctx" sqlctx workbench ./models ``` ## Choose your path -- **Import existing semantic models:** point Sidemantic at a Cube, MetricFlow, LookML, Power BI, Malloy, Rill, or other supported project. Start with the [adapter guide](https://sidemantic.com/sidemantic/adapters). -- **Model tables or SQL:** continue with [models](https://sidemantic.com/sidemantic/models), [dimensions](https://sidemantic.com/sidemantic/dimensions), [metrics](https://sidemantic.com/sidemantic/metrics), and [relationships](https://sidemantic.com/sidemantic/relationships). -- **Query governed metrics:** use the [CLI](https://sidemantic.com/sidemantic/cli), [semantic SQL](https://sidemantic.com/sidemantic/query), or [Python API](https://sidemantic.com/sidemantic/python-api). +- **Import existing semantic models:** point sqlctx at a Cube, MetricFlow, LookML, Power BI, Malloy, Rill, or other supported project. Start with the [adapter guide](https://sidequery.dev/sidemantic/adapters). +- **Model tables or SQL:** continue with [models](https://sidequery.dev/sidemantic/models), [dimensions](https://sidequery.dev/sidemantic/dimensions), [metrics](https://sidequery.dev/sidemantic/metrics), and [relationships](https://sidequery.dev/sidemantic/relationships). +- **Query governed metrics:** use the [CLI](https://github.com/sidequery/sqlctx/blob/main/docs/cli.md), [semantic SQL](https://sidequery.dev/sidemantic/query), or [Python API](https://sidequery.dev/sidemantic/python-api). - **Explore data:** launch the terminal workbench, notebook widget, or browser UI. - **Serve other tools:** expose models over the HTTP API, PostgreSQL wire protocol, or MCP server. -Install Sidemantic in a project with `uv add sidemantic`. Optional features are packaged as extras: +Install sqlctx in a project with `uv add git+https://github.com/sidequery/sqlctx`. Optional features are packaged as extras: -- **Interfaces:** `api` (HTTP API and `sidemantic serve`), `mcp` (MCP server), `apps` (MCP apps with charts), `serve` (PostgreSQL wire protocol server), `workbench` (terminal UI), `widget` (Jupyter widget), `charts` (Altair charts for MCP chart tools), and `lsp` (language server) +- **Interfaces:** `api` (HTTP API and `sqlctx serve`), `mcp` (MCP server), `apps` (MCP apps with charts), `serve` (PostgreSQL wire protocol server), `workbench` (terminal UI), `widget` (Jupyter widget), `charts` (Altair charts for MCP chart tools), and `lsp` (language server) - **Model formats:** `lookml`, `metricflow`, `malloy`, `dax` (Power BI TMDL/DAX), and `ossie` (Apache Ossie schema validation) - **Databases:** `postgres`, `bigquery`, `snowflake`, `clickhouse`, `databricks`, `spark`, and `adbc`, or `all-databases` for all of them - **Engine:** `rust` (Rust engine) and `fast` (compiled SQLGlot) - **Bundle:** `full` (every interface, format, and engine extra except `serve`, `fast`, and the databases) -Python is the default engine. To use the optional Rust engine, install `uv tool install "sidemantic[rust]"` (CLI) or `uv add "sidemantic[rust]"` (project), then select `--engine rust`. See [Rust engine mode](docs/rust-engine-mode.md). +Python is the default engine. To build the optional Rust engine from source and select it with `--engine rust`, follow [Rust engine mode](docs/rust-engine-mode.md). ## DAX And TMDL DAX/TMDL support lives behind the `dax` extra because it includes a native Rust parser: ```bash -uv add "sidemantic[dax]" +git clone https://github.com/sidequery/sqlctx.git +cd sqlctx +uv sync --extra dax ``` -Native Sidemantic YAML can preserve DAX expression source text next to the SQL definition Sidemantic queries, for Power BI interoperability: +Native sqlctx YAML can preserve DAX expression source text next to the SQL definition sqlctx queries, for Power BI interoperability: ```yaml models: @@ -138,7 +142,7 @@ models: Power BI TMDL projects can be loaded from a project root or `definition/` folder. Embedded DAX measures, calculated columns, calculated tables, relationships, and TMDL passthrough metadata are parsed and preserved in model metadata: ```python -from sidemantic import SemanticLayer, load_from_directory +from sqlctx import SemanticLayer, load_from_directory layer = SemanticLayer(connection="duckdb://warehouse.duckdb") load_from_directory(layer, "powerbi_project/") @@ -148,7 +152,7 @@ print(layer.describe_models(["Sales"])) TMDL can also round-trip back to disk: ```python -from sidemantic.adapters.tmdl import TMDLAdapter +from sqlctx.adapters.tmdl import TMDLAdapter TMDLAdapter().export(layer.graph, "exported_tmdl/") ``` @@ -157,46 +161,46 @@ TMDLAdapter().export(layer.graph, "exported_tmdl/") ```bash # Scaffold a project (optionally generating models from your data) -sidemantic init -sidemantic init --from data/orders.csv --from data/customers.parquet +sqlctx init +sqlctx init --from data/orders.csv --from data/customers.parquet # Self-contained demo project with sample data -sidemantic demo +sqlctx demo # Query as a human-readable table (also supports csv, json, and jsonl) -sidemantic query "SELECT revenue FROM orders" --db data.duckdb --format table +sqlctx query "SELECT revenue FROM orders" --db data.duckdb --format table # Query raw files directly (CSV, Parquet, JSON become tables named by file stem) -sidemantic query "SELECT orders.revenue FROM orders" --db data/orders.csv +sqlctx query "SELECT orders.revenue FROM orders" --db data/orders.csv # Golden-query tests: pin expected metric values so definitions cannot drift -sidemantic test +sqlctx test # Serve teammates and tools on one port: web UI, HTTP API, and MCP -uvx --from "sidemantic[api,mcp]" sidemantic serve models/ --db data.duckdb +uvx --from "sqlctx[api,mcp] @ git+https://github.com/sidequery/sqlctx" sqlctx serve models/ --db data.duckdb # Interactive workbench (TUI with SQL editor + charts) -uvx --from "sidemantic[workbench]" sidemantic workbench models/ --db data.duckdb +uvx --from "sqlctx[workbench] @ git+https://github.com/sidequery/sqlctx" sqlctx workbench models/ --db data.duckdb # PostgreSQL server (connect Tableau, DBeaver, etc.) -uvx --from "sidemantic[serve]" sidemantic server postgres models/ --port 5433 +uvx --from "sqlctx[serve] @ git+https://github.com/sidequery/sqlctx" sqlctx server postgres models/ --port 5433 # HTTP API server (JSON or Arrow) -uvx --from "sidemantic[api]" sidemantic server api models/ --port 4400 --auth-token-file .secrets/api-token +uvx --from "sqlctx[api] @ git+https://github.com/sidequery/sqlctx" sqlctx server api models/ --port 4400 --auth-token-file .secrets/api-token # Validate definitions (--live also checks tables/columns against the database) -sidemantic validate models/ -sidemantic validate models/ --live --db data.duckdb +sqlctx validate models/ +sqlctx validate models/ --live --db data.duckdb # Model info -sidemantic info models/ +sqlctx info models/ # Pre-aggregation recommendations from a log of compiled queries # (or --connection for Snowflake, BigQuery, Databricks, or ClickHouse query history) -sidemantic preagg recommend --queries queries.sql +sqlctx preagg recommend --queries queries.sql # Migrate SQL queries to semantic layer -sidemantic migrate generate legacy/ --output output/ +sqlctx migrate generate legacy/ --output output/ ``` See [the CLI contract](docs/cli.md) for output formats, `--plain`, quiet/verbose @@ -207,67 +211,67 @@ stdin/stdout, exit codes, debugging, and secure credential input. **Workbench** (TUI with SQL editor + charts): ```bash -uvx --from "sidemantic[workbench]" sidemantic workbench --demo +uvx --from "sqlctx[workbench] @ git+https://github.com/sidequery/sqlctx" sqlctx workbench --demo ``` **PostgreSQL server** (connect Tableau, DBeaver, etc.): ```bash -uvx --from "sidemantic[serve]" sidemantic server postgres --demo --port 5433 +uvx --from "sqlctx[serve] @ git+https://github.com/sidequery/sqlctx" sqlctx server postgres --demo --port 5433 ``` **HTTP API server** (JSON or Arrow): ```bash -uvx --from "sidemantic[api]" sidemantic server api --demo --port 4400 +uvx --from "sqlctx[api] @ git+https://github.com/sidequery/sqlctx" sqlctx server api --demo --port 4400 ``` **Colab notebooks:** -[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/sidequery/sidemantic/blob/main/examples/notebooks/sidemantic_sql_duckdb_demo.ipynb) SQL + DuckDB +[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/sidequery/sqlctx/blob/main/examples/notebooks/sqlctx_sql_duckdb_demo.ipynb) SQL + DuckDB -[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/sidequery/sidemantic/blob/main/examples/notebooks/lookml_multi_entity_duckdb_demo.ipynb) LookML multi-entity +[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/sidequery/sqlctx/blob/main/examples/notebooks/lookml_multi_entity_duckdb_demo.ipynb) LookML multi-entity **SQL syntax:** ```bash -uv run https://raw.githubusercontent.com/sidequery/sidemantic/main/examples/sql/sql_syntax_example.py +uv run https://raw.githubusercontent.com/sidequery/sqlctx/main/examples/sql/sql_syntax_example.py ``` **Comprehensive demo:** ```bash -uv run https://raw.githubusercontent.com/sidequery/sidemantic/main/examples/advanced/comprehensive_demo.py +uv run https://raw.githubusercontent.com/sidequery/sqlctx/main/examples/advanced/comprehensive_demo.py ``` **Symmetric aggregates:** ```bash -uv run https://raw.githubusercontent.com/sidequery/sidemantic/main/examples/features/symmetric_aggregates_example.py +uv run https://raw.githubusercontent.com/sidequery/sqlctx/main/examples/features/symmetric_aggregates_example.py ``` **Superset with DuckDB:** ```bash -git clone https://github.com/sidequery/sidemantic.git && cd sidemantic +git clone https://github.com/sidequery/sqlctx.git && cd sqlctx uv run examples/superset_demo/run_demo.py ``` **Cube Playground:** ```bash -git clone https://github.com/sidequery/sidemantic.git && cd sidemantic +git clone https://github.com/sidequery/sqlctx.git && cd sqlctx uv run examples/cube_demo/run_demo.py ``` **Rill Developer:** ```bash -git clone https://github.com/sidequery/sidemantic.git && cd sidemantic +git clone https://github.com/sidequery/sqlctx.git && cd sqlctx uv run examples/rill_demo/run_demo.py ``` **Apache Ossie (complex adtech semantic model):** ```bash -git clone https://github.com/sidequery/sidemantic.git && cd sidemantic +git clone https://github.com/sidequery/sqlctx.git && cd sqlctx uv run examples/osi_demo/run_demo.py ``` **Apache Ossie widget notebook (percent-cell Python notebook):** ```bash -git clone https://github.com/sidequery/sidemantic.git && cd sidemantic +git clone https://github.com/sidequery/sqlctx.git && cd sqlctx uv run examples/osi_demo/osi_widget_notebook.py ``` @@ -289,14 +293,14 @@ See `examples/` for more. ## Multi-Format Support -Auto-detects: Sidemantic (SQL/YAML), Power BI TMDL, Cube, MetricFlow (dbt), LookML, Hex, Rill, Superset, Omni, BSL, GoodData LDM, Apache Ossie, AtScale SML, ThoughtSpot TML, Graphene GSQL +Auto-detects: sqlctx (SQL/YAML), Power BI TMDL, Cube, MetricFlow (dbt), LookML, Hex, Rill, Superset, Omni, BSL, GoodData LDM, Apache Ossie, AtScale SML, ThoughtSpot TML, Graphene GSQL ```bash -sidemantic query "SELECT revenue FROM orders" --models ./my_models +sqlctx query "SELECT revenue FROM orders" --models ./my_models ``` ```python -from sidemantic import SemanticLayer, load_from_directory +from sqlctx import SemanticLayer, load_from_directory layer = SemanticLayer(connection="duckdb://data.duckdb") # duckdb:///abs/path.duckdb for absolute paths load_from_directory(layer, "my_models/") # Auto-detects formats @@ -307,12 +311,12 @@ Apache Ossie is registered as format `ossie`; `osi`, `apache-ossie`, and selecting an Ossie scope or execution dialect: ```bash -sidemantic convert commerce.ossie.yaml \ - --from ossie --to sidemantic --output models.yml \ +sqlctx convert commerce.ossie.yaml \ + --from ossie --to sqlctx --output models.yml \ --ossie-scope commerce --ossie-target-dialect bigquery -sidemantic convert models/orders.yml \ - --from sidemantic --to ossie --output commerce.ossie.yaml \ +sqlctx convert models/orders.yml \ + --from sqlctx --to ossie --output commerce.ossie.yaml \ --ossie-scope commerce --ossie-expression-dialect BIGQUERY ``` @@ -325,25 +329,29 @@ pinned schema profiles, validation policies, scope rules, and round-trip limits. |----------|:------:|--------------| | DuckDB | ✅ | built-in | | MotherDuck | ✅ | built-in | -| PostgreSQL | ✅ | `uv add "sidemantic[postgres]"` | -| BigQuery | ✅ | `uv add "sidemantic[bigquery]"` | -| Snowflake | ✅ | `uv add "sidemantic[snowflake]"` | -| ClickHouse | ✅ | `uv add "sidemantic[clickhouse]"` | -| Databricks | ✅ | `uv add "sidemantic[databricks]"` | -| Spark SQL | ✅ | `uv add "sidemantic[spark]"` | +| PostgreSQL | ✅ | `uv add "sqlctx[postgres] @ git+https://github.com/sidequery/sqlctx"` | +| BigQuery | ✅ | `uv add "sqlctx[bigquery] @ git+https://github.com/sidequery/sqlctx"` | +| Snowflake | ✅ | `uv add "sqlctx[snowflake] @ git+https://github.com/sidequery/sqlctx"` | +| ClickHouse | ✅ | `uv add "sqlctx[clickhouse] @ git+https://github.com/sidequery/sqlctx"` | +| Databricks | ✅ | `uv add "sqlctx[databricks] @ git+https://github.com/sidequery/sqlctx"` | +| Spark SQL | ✅ | `uv add "sqlctx[spark] @ git+https://github.com/sidequery/sqlctx"` | ## Docker -The published image is [`sidequery/sidemantic`](https://hub.docker.com/r/sidequery/sidemantic) on Docker Hub. Mount your models directory as a volume at `/app/models`: +Build the image from the repository root. Mount your models directory as a volume at `/app/models`: + +```bash +docker build -t sidequery/sqlctx . +``` ```bash -docker run -p 5433:5433 -v ./models:/app/models sidequery/sidemantic +docker run -p 5433:5433 -v ./models:/app/models sidequery/sqlctx ``` Demo mode (built-in sample data, no volume needed): ```bash -docker run -p 5433:5433 sidequery/sidemantic --demo +docker run -p 5433:5433 sidequery/sqlctx --demo ``` See [`examples/docker/`](examples/docker/) for MCP mode, env vars, building from source, and integration test services. @@ -352,16 +360,16 @@ For Cloudflare Worker + Container deployment, see [`examples/cloudflare_containe ## HTTP API -These examples use the project created by `uvx sidemantic demo`. Create a +These examples use the project created by `uvx --from git+https://github.com/sidequery/sqlctx sqlctx demo`. Create a bearer token file, then start the API server: ```bash -cd sidemantic-demo +cd sqlctx-demo mkdir -p .secrets && openssl rand -hex 32 > .secrets/api-token -uvx --from "sidemantic[api]" sidemantic server api models/ --db data/demo.duckdb --port 4400 --auth-token-file .secrets/api-token +uvx --from "sqlctx[api] @ git+https://github.com/sidequery/sqlctx" sqlctx server api models/ --db data/demo.duckdb --port 4400 --auth-token-file .secrets/api-token ``` -In another terminal in `sidemantic-demo`, compile a structured semantic query: +In another terminal in `sqlctx-demo`, compile a structured semantic query: ```bash curl -s http://localhost:4400/compile \ @@ -401,7 +409,7 @@ curl -s http://localhost:4400/sql \ ## Agent Plugin -Sidemantic ships a [plugin bundle](plugins/sidemantic/) with Claude Code and Codex metadata for two skills: +sqlctx ships a [plugin bundle](plugins/sqlctx/) with Claude Code and Codex metadata for two skills: - **`modeler`** — build, validate, and query semantic models - **`webapp-builder`** — generate analytics webapps from your models @@ -409,31 +417,31 @@ Sidemantic ships a [plugin bundle](plugins/sidemantic/) with Claude Code and Cod **Install in Claude Code:** ```bash -claude plugin marketplace add sidequery/sidemantic && claude plugin install sidemantic@sidequery +claude plugin marketplace add sidequery/sqlctx && claude plugin install sqlctx@sidequery ``` **Install in Codex:** ```bash -codex plugin marketplace add sidequery/sidemantic && codex plugin add sidemantic@sidequery +codex plugin marketplace add sidequery/sqlctx && codex plugin add sqlctx@sidequery ``` **Use a local clone while developing:** ```bash -claude --plugin-dir ./plugins/sidemantic -codex plugin marketplace add . && codex plugin add sidemantic@sidequery +claude --plugin-dir ./plugins/sqlctx +codex plugin marketplace add . && codex plugin add sqlctx@sidequery ``` -The Claude Code plugin manifest lives at `plugins/sidemantic/.claude-plugin/plugin.json`, and its marketplace lives at `.claude-plugin/marketplace.json`. +The Claude Code plugin manifest lives at `plugins/sqlctx/.claude-plugin/plugin.json`, and its marketplace lives at `.claude-plugin/marketplace.json`. -The Codex plugin manifest lives at `plugins/sidemantic/.codex-plugin/plugin.json`, and its repo-local marketplace lives at `.agents/plugins/marketplace.json`. +The Codex plugin manifest lives at `plugins/sqlctx/.codex-plugin/plugin.json`, and its repo-local marketplace lives at `.agents/plugins/marketplace.json`. -The skills also work with other `SKILL.md`-compatible agents by pointing them at `plugins/sidemantic/skills/`. +The skills also work with other `SKILL.md`-compatible agents by pointing them at `plugins/sqlctx/skills/`. -## How mature is Sidemantic? +## How mature is sqlctx? -Sidemantic is an ambitious but young semantic layer project. You could encounter rough patches, especially with the more exotic features like converting between semantic model formats or serving semantic layers via the included Postgres protocol server. +sqlctx is an ambitious but young semantic layer project. You could encounter rough patches, especially with the more exotic features like converting between semantic model formats or serving semantic layers via the included Postgres protocol server. ## Testing @@ -441,4 +449,4 @@ Sidemantic is an ambitious but young semantic layer project. You could encounter uv run pytest -v ``` -This prints line coverage for `sidemantic` with missing lines in the terminal. +This prints line coverage for `sqlctx` with missing lines in the terminal. diff --git a/crates/dax-parser/Cargo.toml b/crates/dax-parser/Cargo.toml index beec363da..1c13ce481 100644 --- a/crates/dax-parser/Cargo.toml +++ b/crates/dax-parser/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" description = "DAX lexer+parser" license = "AGPL-3.0-only" -repository = "https://github.com/sidequery/sidemantic" +repository = "https://github.com/sidequery/sqlctx" [dependencies] serde = { version = "1.0", features = ["derive"] } diff --git a/crates/dax-pyo3/Cargo.toml b/crates/dax-pyo3/Cargo.toml index 651279d8b..b0e430d73 100644 --- a/crates/dax-pyo3/Cargo.toml +++ b/crates/dax-pyo3/Cargo.toml @@ -4,11 +4,11 @@ version = "0.13.2" edition = "2021" description = "Python bindings for dax-parser" license = "AGPL-3.0-only" -repository = "https://github.com/sidequery/sidemantic" +repository = "https://github.com/sidequery/sqlctx" publish = false [lib] -name = "sidemantic_dax" +name = "sqlctx_dax" crate-type = ["cdylib"] [dependencies] diff --git a/crates/dax-pyo3/README.md b/crates/dax-pyo3/README.md index c72214ed5..2b89c1917 100644 --- a/crates/dax-pyo3/README.md +++ b/crates/dax-pyo3/README.md @@ -1,4 +1,4 @@ -# sidemantic-dax +# sqlctx-dax Python bindings for the `dax-parser` crate. @@ -20,7 +20,7 @@ export PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 ## Usage ```python -import sidemantic_dax as dax +import sqlctx_dax as dax expr = dax.parse_expression("SUM('Sales'[Amount])") query = dax.parse_query("evaluate 'Sales'") diff --git a/crates/dax-pyo3/pyproject.toml b/crates/dax-pyo3/pyproject.toml index 671a619c6..d7ddb0c67 100644 --- a/crates/dax-pyo3/pyproject.toml +++ b/crates/dax-pyo3/pyproject.toml @@ -3,7 +3,7 @@ requires = ["maturin>=1.7"] build-backend = "maturin" [project] -name = "sidemantic-dax" +name = "sqlctx-dax" version = "0.13.2" description = "Python bindings for dax-parser" readme = "README.md" @@ -11,7 +11,7 @@ requires-python = ">=3.11" license = {text = "AGPL-3.0-only"} [tool.maturin] -module-name = "sidemantic_dax._native" +module-name = "sqlctx_dax._native" python-source = "python" features = ["pyo3/extension-module", "pyo3/abi3-py311"] exclude = ["dist/*", "target/*"] diff --git a/crates/dax-pyo3/python/sidemantic_dax/__init__.py b/crates/dax-pyo3/python/sqlctx_dax/__init__.py similarity index 98% rename from crates/dax-pyo3/python/sidemantic_dax/__init__.py rename to crates/dax-pyo3/python/sqlctx_dax/__init__.py index 79e861ab0..c0d23e63d 100644 --- a/crates/dax-pyo3/python/sidemantic_dax/__init__.py +++ b/crates/dax-pyo3/python/sqlctx_dax/__init__.py @@ -139,7 +139,7 @@ def _native_module(): try: from . import _native except Exception as exc: # pragma: no cover - exercised via import in runtime - raise RuntimeError("sidemantic_dax native module is not available") from exc + raise RuntimeError("sqlctx_dax native module is not available") from exc return _native diff --git a/crates/dax-pyo3/python/sidemantic_dax/ast.py b/crates/dax-pyo3/python/sqlctx_dax/ast.py similarity index 99% rename from crates/dax-pyo3/python/sidemantic_dax/ast.py rename to crates/dax-pyo3/python/sqlctx_dax/ast.py index 366490550..5849935f6 100644 --- a/crates/dax-pyo3/python/sidemantic_dax/ast.py +++ b/crates/dax-pyo3/python/sqlctx_dax/ast.py @@ -913,7 +913,7 @@ def _native_module(): try: from . import _native except Exception as exc: # pragma: no cover - exercised via import in runtime - raise RuntimeError("sidemantic_dax native module is not available") from exc + raise RuntimeError("sqlctx_dax native module is not available") from exc return _native diff --git a/crates/dax-pyo3/python/sidemantic_dax/py.typed b/crates/dax-pyo3/python/sqlctx_dax/py.typed similarity index 100% rename from crates/dax-pyo3/python/sidemantic_dax/py.typed rename to crates/dax-pyo3/python/sqlctx_dax/py.typed diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index b342a6d32..bde08be1e 100644 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -1,8 +1,8 @@ #!/bin/sh set -e -# SIDEMANTIC_MODE: "serve" (default), "mcp", "api", or "both" -MODE="${SIDEMANTIC_MODE:-serve}" +# SQLCTX_MODE: "serve" (default), "mcp", "api", or "both" +MODE="${SQLCTX_MODE:-serve}" ENTRYPOINT_ARGS_FILE=$(mktemp) trap 'rm -f "$ENTRYPOINT_ARGS_FILE"' EXIT @@ -16,24 +16,24 @@ write_secret_file() { } run_serve() { - set -- sidemantic server postgres --host 0.0.0.0 - if [ -n "$SIDEMANTIC_CONNECTION" ]; then - set -- "$@" --connection "$SIDEMANTIC_CONNECTION" + set -- sqlctx server postgres --host 0.0.0.0 + if [ -n "$SQLCTX_CONNECTION" ]; then + set -- "$@" --connection "$SQLCTX_CONNECTION" fi - if [ -n "$SIDEMANTIC_DB" ]; then - set -- "$@" --db "$SIDEMANTIC_DB" + if [ -n "$SQLCTX_DB" ]; then + set -- "$@" --db "$SQLCTX_DB" fi - if [ -n "$SIDEMANTIC_USERNAME" ]; then - set -- "$@" --username "$SIDEMANTIC_USERNAME" + if [ -n "$SQLCTX_USERNAME" ]; then + set -- "$@" --username "$SQLCTX_USERNAME" fi - if [ -n "$SIDEMANTIC_PASSWORD" ]; then - write_secret_file "$SIDEMANTIC_PASSWORD" + if [ -n "$SQLCTX_PASSWORD" ]; then + write_secret_file "$SQLCTX_PASSWORD" set -- "$@" --password-file "$SECRET_FILE" fi - if [ -n "$SIDEMANTIC_PORT" ]; then - set -- "$@" --port "$SIDEMANTIC_PORT" + if [ -n "$SQLCTX_PORT" ]; then + set -- "$@" --port "$SQLCTX_PORT" fi - if [ -n "$SIDEMANTIC_DEMO" ]; then + if [ -n "$SQLCTX_DEMO" ]; then set -- "$@" --demo fi while IFS= read -r arg; do @@ -43,14 +43,14 @@ run_serve() { } run_mcp() { - set -- sidemantic server mcp - if [ -n "$SIDEMANTIC_CONNECTION" ]; then - set -- "$@" --connection "$SIDEMANTIC_CONNECTION" + set -- sqlctx server mcp + if [ -n "$SQLCTX_CONNECTION" ]; then + set -- "$@" --connection "$SQLCTX_CONNECTION" fi - if [ -n "$SIDEMANTIC_DB" ]; then - set -- "$@" --db "$SIDEMANTIC_DB" + if [ -n "$SQLCTX_DB" ]; then + set -- "$@" --db "$SQLCTX_DB" fi - if [ -n "$SIDEMANTIC_DEMO" ]; then + if [ -n "$SQLCTX_DEMO" ]; then set -- "$@" --demo fi while IFS= read -r arg; do @@ -60,32 +60,32 @@ run_mcp() { } run_api() { - set -- sidemantic server api --host 0.0.0.0 - if [ -n "$SIDEMANTIC_CONNECTION" ]; then - set -- "$@" --connection "$SIDEMANTIC_CONNECTION" + set -- sqlctx server api --host 0.0.0.0 + if [ -n "$SQLCTX_CONNECTION" ]; then + set -- "$@" --connection "$SQLCTX_CONNECTION" fi - if [ -n "$SIDEMANTIC_DB" ]; then - set -- "$@" --db "$SIDEMANTIC_DB" + if [ -n "$SQLCTX_DB" ]; then + set -- "$@" --db "$SQLCTX_DB" fi - if [ -n "$SIDEMANTIC_API_TOKEN" ]; then - write_secret_file "$SIDEMANTIC_API_TOKEN" + if [ -n "$SQLCTX_API_TOKEN" ]; then + write_secret_file "$SQLCTX_API_TOKEN" set -- "$@" --auth-token-file "$SECRET_FILE" fi - if [ -n "$SIDEMANTIC_API_PORT" ]; then - set -- "$@" --port "$SIDEMANTIC_API_PORT" + if [ -n "$SQLCTX_API_PORT" ]; then + set -- "$@" --port "$SQLCTX_API_PORT" fi - if [ -n "$SIDEMANTIC_MAX_REQUEST_BODY_BYTES" ]; then - set -- "$@" --max-request-body-bytes "$SIDEMANTIC_MAX_REQUEST_BODY_BYTES" + if [ -n "$SQLCTX_MAX_REQUEST_BODY_BYTES" ]; then + set -- "$@" --max-request-body-bytes "$SQLCTX_MAX_REQUEST_BODY_BYTES" fi - if [ -n "$SIDEMANTIC_CORS_ORIGINS" ]; then + if [ -n "$SQLCTX_CORS_ORIGINS" ]; then OLD_IFS=$IFS IFS=',' - for ORIGIN in $SIDEMANTIC_CORS_ORIGINS; do + for ORIGIN in $SQLCTX_CORS_ORIGINS; do set -- "$@" --cors-origin "$ORIGIN" done IFS=$OLD_IFS fi - if [ -n "$SIDEMANTIC_DEMO" ]; then + if [ -n "$SQLCTX_DEMO" ]; then set -- "$@" --demo fi while IFS= read -r arg; do @@ -95,38 +95,38 @@ run_api() { } run_both() { - set -- sidemantic server postgres --host 0.0.0.0 - if [ -n "$SIDEMANTIC_CONNECTION" ]; then - set -- "$@" --connection "$SIDEMANTIC_CONNECTION" + set -- sqlctx server postgres --host 0.0.0.0 + if [ -n "$SQLCTX_CONNECTION" ]; then + set -- "$@" --connection "$SQLCTX_CONNECTION" fi - if [ -n "$SIDEMANTIC_DB" ]; then - set -- "$@" --db "$SIDEMANTIC_DB" + if [ -n "$SQLCTX_DB" ]; then + set -- "$@" --db "$SQLCTX_DB" fi - if [ -n "$SIDEMANTIC_USERNAME" ]; then - set -- "$@" --username "$SIDEMANTIC_USERNAME" + if [ -n "$SQLCTX_USERNAME" ]; then + set -- "$@" --username "$SQLCTX_USERNAME" fi - if [ -n "$SIDEMANTIC_PASSWORD" ]; then - write_secret_file "$SIDEMANTIC_PASSWORD" + if [ -n "$SQLCTX_PASSWORD" ]; then + write_secret_file "$SQLCTX_PASSWORD" set -- "$@" --password-file "$SECRET_FILE" fi - if [ -n "$SIDEMANTIC_PORT" ]; then - set -- "$@" --port "$SIDEMANTIC_PORT" + if [ -n "$SQLCTX_PORT" ]; then + set -- "$@" --port "$SQLCTX_PORT" fi - if [ -n "$SIDEMANTIC_DEMO" ]; then + if [ -n "$SQLCTX_DEMO" ]; then set -- "$@" --demo fi "$@" & SERVE_PID=$! trap 'kill "$SERVE_PID" 2>/dev/null; rm -f "$ENTRYPOINT_ARGS_FILE"' EXIT - set -- sidemantic server mcp - if [ -n "$SIDEMANTIC_CONNECTION" ]; then - set -- "$@" --connection "$SIDEMANTIC_CONNECTION" + set -- sqlctx server mcp + if [ -n "$SQLCTX_CONNECTION" ]; then + set -- "$@" --connection "$SQLCTX_CONNECTION" fi - if [ -n "$SIDEMANTIC_DB" ]; then - set -- "$@" --db "$SIDEMANTIC_DB" + if [ -n "$SQLCTX_DB" ]; then + set -- "$@" --db "$SQLCTX_DB" fi - if [ -n "$SIDEMANTIC_DEMO" ]; then + if [ -n "$SQLCTX_DEMO" ]; then set -- "$@" --demo fi while IFS= read -r arg; do @@ -149,7 +149,7 @@ case "$MODE" in run_both ;; *) - echo "Unknown SIDEMANTIC_MODE: $MODE (use serve, mcp, api, or both)" >&2 + echo "Unknown SQLCTX_MODE: $MODE (use serve, mcp, api, or both)" >&2 exit 1 ;; esac diff --git a/docs/adapter-fidelity-yaml.md b/docs/adapter-fidelity-yaml.md index d6b532f9a..0b47b6268 100644 --- a/docs/adapter-fidelity-yaml.md +++ b/docs/adapter-fidelity-yaml.md @@ -48,6 +48,6 @@ explicit SQL source before importing. Omni relationship predicates and declared join types are executable native semantics. The `reversible` property must be Boolean and is retained for native roundtrips. Topic configuration is retained for native export, but topic field -curation does not restrict Sidemantic queries; fidelity reporting identifies +curation does not restrict sqlctx queries; fidelity reporting identifies that distinction. Retaining vendor configuration is not a guarantee that every vendor feature is executable outside that vendor. diff --git a/docs/cli-deprecations.md b/docs/cli-deprecations.md index 56814df95..82edd1f98 100644 --- a/docs/cli-deprecations.md +++ b/docs/cli-deprecations.md @@ -1,6 +1,6 @@ # CLI deprecation policy -Sidemantic keeps scripts working while the CLI evolves. A legacy command or +sqlctx keeps scripts working while the CLI evolves. A legacy command or flag remains functional for at least two minor releases after its deprecation is announced. Its warning names the supported replacement and the first release in which removal may occur. @@ -21,31 +21,31 @@ release. | Legacy surface | Replacement | Deprecated | Earliest removal | | --- | --- | --- | --- | -| `sidemantic gen` | `sidemantic generate` | 0.10.0 | 0.12.0 | -| `sidemantic migrator` | `sidemantic migrate generate` or `migrate check` | 0.10.0 | 0.12.0 | -| `sidemantic export-native` | `sidemantic convert --to sidemantic` | 0.10.0 | 0.12.0 | -| `sidemantic explain-sql` | `sidemantic explain` | 0.10.0 | 0.12.0 | -| `sidemantic api-serve` | `sidemantic server api` | 0.10.0 | 0.12.0 | -| `sidemantic mcp-serve` | `sidemantic server mcp` | 0.10.0 | 0.12.0 | -| `sidemantic tree` | `sidemantic workbench` | 0.10.0 | 0.12.0 | +| `sqlctx gen` | `sqlctx generate` | 0.10.0 | 0.12.0 | +| `sqlctx migrator` | `sqlctx migrate generate` or `migrate check` | 0.10.0 | 0.12.0 | +| `sqlctx export-native` | `sqlctx convert --to sqlctx` | 0.10.0 | 0.12.0 | +| `sqlctx explain-sql` | `sqlctx explain` | 0.10.0 | 0.12.0 | +| `sqlctx api-serve` | `sqlctx server api` | 0.10.0 | 0.12.0 | +| `sqlctx mcp-serve` | `sqlctx server mcp` | 0.10.0 | 0.12.0 | +| `sqlctx tree` | `sqlctx workbench` | 0.10.0 | 0.12.0 | | `server postgres --password` | `server postgres --password-file` | 0.10.2 | 1.0.0 | | `server api --auth-token` | `server api --auth-token-file` | 0.10.2 | 1.0.0 | | `dashboard serve --output-dir` | Remove the ignored flag | 0.10.0 | 0.12.0 | | `dashboard serve --warm-interaction-preaggregations` | Remove the ignored flag | 0.10.0 | 0.12.0 | -`sidemantic serve` was briefly (0.10.0-0.10.2) a hidden deprecated alias for -`sidemantic server postgres`. As of 0.11.0 it is the unified serving command +`sqlctx serve` was briefly (0.10.0-0.10.2) a hidden deprecated alias for +`sqlctx server postgres`. As of 0.11.0 it is the unified serving command (web UI + HTTP API + MCP on one port); scripts that relied on the alias must -use `sidemantic server postgres` explicitly. +use `sqlctx server postgres` explicitly. -The registry in `sidemantic/cli_polish.py` is the executable source of truth. +The registry in `sqlctx/cli_polish.py` is the executable source of truth. Tests require every entry to specify its replacement, introduction release, and target removal release. Update this table, the registry, release notes, and the bundled plugin skills together whenever a lifecycle changes. ## Recovery behavior -Sidemantic may suggest a close command name, corrected option spelling, or a +sqlctx may suggest a close command name, corrected option spelling, or a safe next action. It never silently executes a suggested command and never adds `--force` or another mutating option on the user's behalf. Review a suggestion -with `sidemantic help ` before running it. +with `sqlctx help ` before running it. diff --git a/docs/cli.md b/docs/cli.md index 88e8867dc..f53cac1cf 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -1,30 +1,30 @@ # CLI contract -Sidemantic is CLI-first. The command line follows one contract across command +sqlctx is CLI-first. The command line follows one contract across command families so it can be used interactively and safely composed in scripts. -Online documentation: . Support and bug -reports: . +Online documentation: . Support and bug +reports: . ## Help Full help is available through every conventional entry point: ```bash -sidemantic -h -sidemantic --help -sidemantic help -sidemantic help migrate generate -sidemantic migrate generate -h +sqlctx -h +sqlctx --help +sqlctx help +sqlctx help migrate generate +sqlctx migrate generate -h ``` -`sidemantic help` accepts a nested command path and is equivalent to the +`sqlctx help` accepts a nested command path and is equivalent to the corresponding `--help` invocation. ## Output and exit codes Primary results and machine data go to stdout. Errors, warnings, deprecations, and status messages go to stderr. This keeps pipelines such as -`sidemantic info --json | jq .models` valid. +`sqlctx info --json | jq .models` valid. The stable process exit codes are: @@ -38,15 +38,15 @@ Expected errors are concise. Put the global `--debug` option before the command to let unexpected exceptions propagate with a traceback: ```bash -sidemantic --debug info ./models +sqlctx --debug info ./models ``` Long project, config, output, and diagnostic options can be placed before or after a subcommand. For example, these are equivalent: ```bash -sidemantic --project ./analytics info --format json -sidemantic info --project ./analytics --format json +sqlctx --project ./analytics info --format json +sqlctx info --project ./analytics --format json ``` Use the long `--quiet` spelling after `preagg recommend` and `preagg apply`, @@ -57,19 +57,19 @@ because those commands retain the existing `-q` shorthand for `--queries`. Structured inspection and reporting commands accept `--json`, including: ```bash -sidemantic info --json -sidemantic init --json -sidemantic demo --json -sidemantic test --json -sidemantic validate --json -sidemantic validate --live --json -sidemantic dashboard validate dashboard.yml --json -sidemantic migrate check queries/ --json -sidemantic migrate generate queries/ --output generated/ --json -sidemantic preagg recommend --queries query-log.sql --json -sidemantic preagg apply --queries query-log.sql --dry-run --json -sidemantic preagg refresh --json -sidemantic explain "SELECT orders.revenue FROM orders" +sqlctx info --json +sqlctx init --json +sqlctx demo --json +sqlctx test --json +sqlctx validate --json +sqlctx validate --live --json +sqlctx dashboard validate dashboard.yml --json +sqlctx migrate check queries/ --json +sqlctx migrate generate queries/ --output generated/ --json +sqlctx preagg recommend --queries query-log.sql --json +sqlctx preagg apply --queries query-log.sql --dry-run --json +sqlctx preagg refresh --json +sqlctx explain "SELECT orders.revenue FROM orders" ``` JSON is the only content written to stdout in these modes. Diagnostics remain @@ -80,9 +80,9 @@ on stderr. Named consumption queries and result calculations use structured selectors: ```bash -sidemantic query --explore revenue_overview --models ./models --db data.duckdb -sidemantic query --saved-query paid_revenue --models ./models --db data.duckdb -sidemantic query --metric orders.revenue --dimension orders.region \ +sqlctx query --explore revenue_overview --models ./models --db data.duckdb +sqlctx query --saved-query paid_revenue --models ./models --db data.duckdb +sqlctx query --metric orders.revenue --dimension orders.region \ --filter "orders.status = 'paid'" --order-by "orders.revenue DESC" \ --limit 10 --table-calculation revenue_share --models ./models --db data.duckdb ``` @@ -106,10 +106,10 @@ queries retain their existing syntax and execution path. Structured inspection, reporting, and query commands share one format option: ```bash -sidemantic query "SELECT status, order_count FROM orders" --format table -sidemantic query "SELECT status, order_count FROM orders" --format csv -sidemantic info --format json -sidemantic preagg recommend --queries queries.sql --format jsonl +sqlctx query "SELECT status, order_count FROM orders" --format table +sqlctx query "SELECT status, order_count FROM orders" --format csv +sqlctx info --format json +sqlctx preagg recommend --queries queries.sql --format jsonl ``` `--format` accepts `table`, `csv`, `json`, or `jsonl`. CSV emits a header, @@ -125,28 +125,32 @@ the requested result or errors. `--verbose`/`-v` enables detailed diagnostics; `--version` remains the unambiguous version option. Color is enabled only for an interactive stream. `--no-color`, a non-empty -`NO_COLOR`, `SIDEMANTIC_NO_COLOR`, or `TERM=dumb` disables it. A non-empty +`NO_COLOR`, `SQLCTX_NO_COLOR`, or `TERM=dumb` disables it. A non-empty `FORCE_COLOR` overrides automatic terminal detection, but not explicit disable controls. Progress is animated only on an interactive stderr stream and is disabled for redirects, machine formats, plain/quiet mode, and CI. ## Environment and precedence -Public Sidemantic environment variables use the `SIDEMANTIC_` prefix: +Update scripts to call `sqlctx` and use the `SQLCTX_` environment variables. +New projects use `sqlctx.yaml`. Discovery also reads project configuration +files saved under the previous name. + +Public sqlctx environment variables use the `SQLCTX_` prefix: | Variable | Meaning | | --- | --- | -| `SIDEMANTIC_PROJECT` | Project root used for discovery | -| `SIDEMANTIC_CONFIG` | Explicit YAML or JSON config path | -| `SIDEMANTIC_FORMAT` | Default `table`, `csv`, `json`, or `jsonl` output | -| `SIDEMANTIC_PLAIN` | Enable plain output when truthy | -| `SIDEMANTIC_QUIET` | Suppress non-essential diagnostics when truthy | -| `SIDEMANTIC_VERBOSE` | Enable verbose diagnostics when truthy | -| `SIDEMANTIC_DEBUG` | Enable debug tracebacks when truthy | -| `SIDEMANTIC_NO_COLOR` | Disable Sidemantic color when truthy | -| `SIDEMANTIC_PAGER` | Pager command for long interactive reports | -| `SIDEMANTIC_PG_PASSWORD_FILE` | PostgreSQL password credential file | -| `SIDEMANTIC_API_AUTH_TOKEN_FILE` | HTTP API bearer-token credential file | +| `SQLCTX_PROJECT` | Project root used for discovery | +| `SQLCTX_CONFIG` | Explicit YAML or JSON config path | +| `SQLCTX_FORMAT` | Default `table`, `csv`, `json`, or `jsonl` output | +| `SQLCTX_PLAIN` | Enable plain output when truthy | +| `SQLCTX_QUIET` | Suppress non-essential diagnostics when truthy | +| `SQLCTX_VERBOSE` | Enable verbose diagnostics when truthy | +| `SQLCTX_DEBUG` | Enable debug tracebacks when truthy | +| `SQLCTX_NO_COLOR` | Disable sqlctx color when truthy | +| `SQLCTX_PAGER` | Pager command for long interactive reports | +| `SQLCTX_PG_PASSWORD_FILE` | PostgreSQL password credential file | +| `SQLCTX_API_AUTH_TOKEN_FILE` | HTTP API bearer-token credential file | Ordinary settings use flag, environment variable, project config, then built-in default precedence. Project config may define the same presentation @@ -163,20 +167,20 @@ put secret values directly in environment variables. Use `-` where a command accepts streamable SQL or a single generated file: ```bash -printf 'SELECT orders.revenue FROM orders\n' | sidemantic rewrite - -printf 'SELECT orders.revenue FROM orders\n' | sidemantic query - --output - -printf 'SELECT * FROM orders;\n' | sidemantic migrate check - --json -sidemantic generate client --output - -sidemantic convert models.yml --to sidemantic --output - -cat model.yml | sidemantic convert - --from sidemantic --to sidemantic --output - -cat model.sql | sidemantic convert - --from sidemantic --source-extension .sql --to sidemantic --output - +printf 'SELECT orders.revenue FROM orders\n' | sqlctx rewrite - +printf 'SELECT orders.revenue FROM orders\n' | sqlctx query - --output - +printf 'SELECT * FROM orders;\n' | sqlctx migrate check - --json +sqlctx generate client --output - +sqlctx convert models.yml --to sqlctx --output - +cat model.yml | sqlctx convert - --from sqlctx --to sqlctx --output - +cat model.sql | sqlctx convert - --from sqlctx --source-extension .sql --to sqlctx --output - ``` `rewrite`, `query`, and `explain` read SQL from stdin when their SQL argument is `-`. Migration and pre-aggregation query sources do the same. Query and single-file code generation write to stdout when output is `-`. For formats with multiple file syntaxes, stdin conversion infers JSON and native -Sidemantic SQL when possible; use `--source-extension` to select explicitly. +sqlctx SQL when possible; use `--source-extension` to select explicitly. Some exporters produce directories or multiple files, so they cannot stream to stdout. `migrate generate --output -`, directory-only conversion inputs, and @@ -189,11 +193,11 @@ Never put a PostgreSQL server password or API bearer token directly in a command argument. Read it from a credential file: ```bash -sidemantic server postgres \ +sqlctx server postgres \ --username analytics \ --password-file .secrets/pg-password -sidemantic server api \ +sqlctx server api \ --auth-token-file .secrets/api-token ``` @@ -201,8 +205,8 @@ Both credential options accept `-` to read from stdin, which is useful with a secret manager: ```bash -secret-tool lookup service sidemantic-api | - sidemantic server api --auth-token-file - +secret-tool lookup service sqlctx-api | + sqlctx server api --auth-token-file - ``` Project configuration can point to the same files. Relative paths are resolved @@ -230,10 +234,10 @@ release cycle. New command invocations should use credential files or stdin. ## Terminal documentation and completion -Use `sidemantic help [COMMAND]...` for nested offline help, or install the -generated `sidemantic(1)` manual page from the wheel. Long human-readable +Use `sqlctx help [COMMAND]...` for nested offline help, or install the +generated `sqlctx(1)` manual page from the wheel. Long human-readable reports support TTY-aware paging with `--pager`, `--no-pager`, and -`SIDEMANTIC_PAGER`. Shell completion includes commands, semantic formats, +`SQLCTX_PAGER`. Shell completion includes commands, semantic formats, project model names, dashboard specs, and relevant paths. See [terminal help, paging, and completion](terminal.md) for the complete diff --git a/docs/compatibility/conversion.md b/docs/compatibility/conversion.md index c53bdfb21..223557c4a 100644 --- a/docs/compatibility/conversion.md +++ b/docs/compatibility/conversion.md @@ -1,6 +1,6 @@ # Conversion fidelity and Ossie interoperability -`sidemantic convert` reports import and export fidelity separately. Exact features +`sqlctx convert` reports import and export fidelity separately. Exact features are listed when adapters report them; partial mappings require review; unsupported or rejected mappings block publication. A report with no recorded losses is not proof of vendor compilation or SQL equivalence. Shared conversion APIs stage exports, @@ -23,8 +23,8 @@ not carry. Two outcomes are possible when a target cannot represent a construct: | Target | Filtered measure | Row count / distinct count | Primary key | Joins | Graph-level metrics | |---|---|---|---|---|---| -| `sidemantic`, `metricflow`, `snowflake` | Carried | Carried | Carried | Carried | Carried | -| `ossie` | Carried | Carried | Carried | Carried | Carried (review: needs the Sidemantic runtime extension) | +| `sqlctx`, `metricflow`, `snowflake` | Carried | Carried | Carried | Carried | Carried | +| `ossie` | Carried | Carried | Carried | Carried | Carried (review: needs the sqlctx runtime extension) | | `bsl` | Carried (`where=`) | Carried | Carried | Carried | Blocked | | `cube`, `lookml`, `malloy` | Carried | Carried | Carried | Carried | Blocked | | `hex`, `omni`, `holistics` | Carried | Carried | Carried (hidden key dimension) | Carried | Blocked | @@ -52,13 +52,13 @@ which this adapter does not write. `tests/adapters/test_export_roundtrip.py` enforces this table: it exports one model to every registered target, re-imports it, and compares metric values grouped by categorical dimensions on DuckDB against the native model. It checks -import through Sidemantic's own adapters, not compilation by the vendor, and it +import through sqlctx's own adapters, not compilation by the vendor, and it does not compare time-dimension names or grains. ## Exporting for official Ossie converters ```sh -sidemantic convert models.yml --from sidemantic --to ossie \ +sqlctx convert models.yml --from sqlctx --to ossie \ --ossie-scope commerce --ossie-expression-dialect ANSI_SQL \ --ossie-official-compatible --output commerce.ossie.yaml ``` @@ -68,7 +68,7 @@ metrics into model scope with qualified field references, and validates the conservative flat `0.2.0.dev0` shape. It rejects duplicate metric names and aggregates without a field binding, including `COUNT(*)` inside larger expressions. It also rejects runtime-only semantics such as invariant filters and directed joins -that require Sidemantic's extension. This addresses the observed dataset-metric +that require sqlctx's extension. This addresses the observed dataset-metric loss in the official converter snapshot `011ea9f9a1e2c941f351e18e071622339ccae881`; individual vendors still have narrower capabilities. @@ -77,7 +77,7 @@ default an untyped numeric field to a string. Set the actual logical datatype before relying on downstream type preservation; compatibility mode does not guess numeric precision. -Ordinary Ossie exports can preserve unsupported native behavior in a Sidemantic +Ordinary Ossie exports can preserve unsupported native behavior in a sqlctx runtime extension. The CLI marks this as partial export fidelity. Other consumers see only an empty sentinel dataset. Use `--ossie-portable-only` to require core output without changing metric placement, or `--ossie-official-compatible` for @@ -89,7 +89,7 @@ Graph conversion can lose vendor extensions and AI annotations. It now reports those losses. To retain the complete valid document, use: ```sh -sidemantic convert source.ossie.yaml --from ossie --to ossie \ +sqlctx convert source.ossie.yaml --from ossie --to ossie \ --ossie-preserve-document --output preserved.ossie.yaml ``` @@ -102,7 +102,7 @@ For physical source names with warehouse-specific quoting, supply both source an execution dialects: ```sh -sidemantic convert source.ossie.yaml --from ossie --to sidemantic \ +sqlctx convert source.ossie.yaml --from ossie --to sqlctx \ --ossie-source-dialect bigquery --ossie-target-dialect bigquery \ --output models.yml ``` @@ -110,15 +110,15 @@ sidemantic convert source.ossie.yaml --from ossie --to sidemantic \ ## Optional reference-converter bridges Lightdash and Sigma are explicitly selected formats backed by separately installed -`ossie-lightdash` and `ossie-sigma` executables. Sidemantic does not download or +`ossie-lightdash` and `ossie-sigma` executables. sqlctx does not download or install them automatically. Lightdash accepts native model YAML, not arbitrary dbt schema metadata. Sigma accepts native JSON. The bridge validates its supported subset and rejects unsupported semantics before publishing output. ```sh -sidemantic convert models.yml --from sidemantic --to lightdash \ +sqlctx convert models.yml --from sqlctx --to lightdash \ --ossie-expression-dialect ANSI_SQL --output lightdash-project -sidemantic convert models.yml --from sidemantic --to sigma \ +sqlctx convert models.yml --from sqlctx --to sigma \ --ossie-expression-dialect ANSI_SQL --output sigma.json ``` diff --git a/docs/compatibility/cube.md b/docs/compatibility/cube.md index 11bcc45a6..f3d2d9753 100644 --- a/docs/compatibility/cube.md +++ b/docs/compatibility/cube.md @@ -1,8 +1,8 @@ # Cube Compatibility -Sidemantic's Cube adapter parses YAML schema files (`.yml` / `.yaml`) and maps Cube concepts to Sidemantic's semantic model (Model, Dimension, Metric, Segment, Relationship, PreAggregation). It also supports exporting back to Cube YAML for roundtrip workflows. +sqlctx's Cube adapter parses YAML schema files (`.yml` / `.yaml`) and maps Cube concepts to sqlctx's semantic model (Model, Dimension, Metric, Segment, Relationship, PreAggregation). It also supports exporting back to Cube YAML for roundtrip workflows. -Features are marked **supported**, **partial support**, or **unsupported**. Partial support entries include notes explaining the limitation. Properties that parse without error but have no Sidemantic equivalent (UI hints, caching config, access control) are grouped together per section rather than listed individually. +Features are marked **supported**, **partial support**, or **unsupported**. Partial support entries include notes explaining the limitation. Properties that parse without error but have no sqlctx equivalent (UI hints, caching config, access control) are grouped together per section rather than listed individually. ## Export fidelity @@ -186,7 +186,7 @@ Not mapped: join `type` (not the same as `relationship`; Cube does not use this ## Pre-Aggregations -Pre-aggregations are fully mapped to Sidemantic's `PreAggregation` model, including refresh configuration, partitioning, and indexes. +Pre-aggregations are fully mapped to sqlctx's `PreAggregation` model, including refresh configuration, partitioning, and indexes. | Feature | Status | |---------|--------| @@ -239,7 +239,7 @@ View models are marked with `meta={"cube_type": "view"}` and are excluded from C ### View Groups (top-level `view_groups`) -The top-level `view_groups:` block (a UI grouping of views) is parsed and the raw definitions are preserved in `SemanticGraph.metadata["cube_view_groups"]`. Sidemantic has no first-class equivalent, so the definitions are kept verbatim for consumers that organize views. +The top-level `view_groups:` block (a UI grouping of views) is parsed and the raw definitions are preserved in `SemanticGraph.metadata["cube_view_groups"]`. sqlctx has no first-class equivalent, so the definitions are kept verbatim for consumers that organize views. --- @@ -258,7 +258,7 @@ Supported. `hierarchies:` blocks on cubes are parsed and used to set `Dimension. ## Access Control (`access_policy` / `accessPolicy`) -Partially supported and **enforced**. Cube `access_policy` `row_level.filters` are imported into an enforced `Model.security` (`SecurityPolicy`) that Sidemantic applies per query when `user_attributes` are supplied; the raw `access_policy` is also preserved in `Model.meta`. Constructs with no mechanical equivalent are dropped with a warning. See [Security](../security.md). +Partially supported and **enforced**. Cube `access_policy` `row_level.filters` are imported into an enforced `Model.security` (`SecurityPolicy`) that sqlctx applies per query when `user_attributes` are supplied; the raw `access_policy` is also preserved in `Model.meta`. Constructs with no mechanical equivalent are dropped with a warning. See [Security](../security.md). | Construct | Status | |-----------|--------| @@ -302,9 +302,9 @@ Partial support. Cube supports custom calendar cubes (`calendar: true`) with cus ## SQL Syntax Normalization -The adapter normalizes three Cube SQL reference patterns to Sidemantic's `{model}` placeholder: +The adapter normalizes three Cube SQL reference patterns to sqlctx's `{model}` placeholder: -| Cube Pattern | Sidemantic Output | +| Cube Pattern | sqlctx Output | |-------------|-------------------| | `${CUBE}` | `{model}` | | `{CUBE}` (no dollar sign) | `{model}` | @@ -313,13 +313,13 @@ The adapter normalizes three Cube SQL reference patterns to Sidemantic's `{model This normalization applies to dimension SQL, measure SQL, filter SQL, and segment SQL. -Measure-to-measure references (`${measure_name}`) in derived measures are converted to `cube_name.measure_name` format for Sidemantic's dependency resolution. +Measure-to-measure references (`${measure_name}`) in derived measures are converted to `cube_name.measure_name` format for sqlctx's dependency resolution. --- ## Cube Export (Roundtrip) -Sidemantic can export its semantic model back to Cube YAML format. +sqlctx can export its semantic model back to Cube YAML format. | Feature | Status | |---------|--------| diff --git a/docs/compatibility/graphene.md b/docs/compatibility/graphene.md index 065abc6b7..16129e187 100644 --- a/docs/compatibility/graphene.md +++ b/docs/compatibility/graphene.md @@ -1,15 +1,15 @@ # Graphene GSQL Compatibility -Sidemantic can import Graphene `.gsql` semantic model files through `load_from_directory()` and CLI commands that use the normal model loader. +sqlctx can import Graphene `.gsql` semantic model files through `load_from_directory()` and CLI commands that use the normal model loader. -The importer is a Sidemantic-owned compatibility parser for Graphene's documented model declarations. It does not bundle Graphene, call the Graphene runtime, or vendor Graphene's parser/grammar/analyzer. +The importer is a sqlctx-owned compatibility parser for Graphene's documented model declarations. It does not bundle Graphene, call the Graphene runtime, or vendor Graphene's parser/grammar/analyzer. ## Supported - `table name (...)` physical table definitions - `table name as (...)` derived table definitions, with the view query preserved as model SQL - `extend name (...)` blocks -- Base columns as Sidemantic dimensions +- Base columns as sqlctx dimensions - Computed scalar expressions as dimensions - Aggregate expressions and measure-composed expressions as metrics - `join one` as `many_to_one` diff --git a/docs/compatibility/index.md b/docs/compatibility/index.md index 59bee0c40..9e7641707 100644 --- a/docs/compatibility/index.md +++ b/docs/compatibility/index.md @@ -1,6 +1,6 @@ # Import Adapter Compatibility Summary - + This is the complete registry-level summary for Python import adapters. `Registered` means the CLI can route the format to its adapter; it does not imply complete source-platform feature parity. @@ -22,15 +22,15 @@ Detailed compatibility documents describe field-level limitations where they exi | `omni` | — | `file_or_directory` | `.yml`, `.yaml` | Registered | Yes | 5 | [Detailed guide](omni.md) | | `ossie` | `apache-ossie`, `osi`, `open-semantic-interchange` | `file_or_directory` | `.yml`, `.yaml`, `.json` | Registered | Yes | 5 | [Detailed guide](ossie.md) | | `rill` | — | `file_or_directory` | `.yml`, `.yaml` | Registered | Yes | 8 | Registry summary only | -| `sidemantic` | `native` | `file` | `.yml`, `.yaml`, `.sql` | Registered | Yes | 2 | Registry summary only | | `sigma` | — | `file` | `.json` | Registered | Yes | 0 | [Detailed guide](sigma.md) | | `snowflake` | `cortex`, `snowflake-cortex` | `file_or_directory` | `.yml`, `.yaml` | Registered | Yes | 9 | [Detailed guide](snowflake.md) | +| `sqlctx` | `native` | `file` | `.yml`, `.yaml`, `.sql` | Registered | Yes | 2 | Registry summary only | | `superset` | — | `file_or_directory` | `.yml`, `.yaml` | Registered | Yes | 5 | Registry summary only | | `tableau` | — | `file_or_directory` | `.tds`, `.twb`, `.tdsx`, `.twbx` | Registered | No | 4 | Registry summary only | | `thoughtspot` | `thought-spot`, `tml` | `file_or_directory` | `.tml`, `.yml`, `.yaml` | Registered | Yes | 4 | Registry summary only | | `tmdl` | `powerbi`, `power-bi` | `file_or_directory` | `.tmdl` | Registered | Yes | 5 | Registry summary only | | `yardstick` | `yardstick-sql` | `file_or_directory` | `.sql` | Registered | No | 1 | [Detailed guide](yardstick.md) | -The native `sidemantic` adapter is included because it participates in the same conversion registry. +The native `sqlctx` adapter is included because it participates in the same conversion registry. Adapters without a detailed guide are intentionally labeled summary-only; their test count is an inventory signal, not a claim that every upstream feature is supported. diff --git a/docs/compatibility/lightdash.md b/docs/compatibility/lightdash.md index 51ddfe879..1c0a57bc9 100644 --- a/docs/compatibility/lightdash.md +++ b/docs/compatibility/lightdash.md @@ -1,7 +1,7 @@ # Lightdash compatibility `--from lightdash` and `--to lightdash` use the separately installed official -`ossie-lightdash` executable. Sidemantic never installs it, downloads dependencies, +`ossie-lightdash` executable. sqlctx never installs it, downloads dependencies, or calls Lightdash automatically. Install it in a separate environment and expose its executable on `PATH`; the converter requires Python 3.11+. See the [upstream installation instructions](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/lightdash/README.md#installation). @@ -9,15 +9,15 @@ its executable on `PATH`; the converter requires Python 3.11+. See the The bridge was tested against `apache/ossie-converters` commit `011ea9f9a1e2c941f351e18e071622339ccae881`, with its `apache/ossie` submodule at `01a5488d840deda309aac68cc0b312c195369b8d`. Installing another revision does not -extend Sidemantic's supported subset automatically. +extend sqlctx's supported subset automatically. ## CLI ```sh -sidemantic convert lightdash/models --from lightdash --to sidemantic \ +sqlctx convert lightdash/models --from lightdash --to sqlctx \ --ossie-expression-dialect ANSI_SQL --output models.yml -sidemantic convert models.yml --from sidemantic --to lightdash \ +sqlctx convert models.yml --from sqlctx --to lightdash \ --ossie-expression-dialect ANSI_SQL --ossie-scope commerce \ --output lightdash-project ``` @@ -27,7 +27,7 @@ Select the format explicitly. Both directions require relabel arbitrary warehouse SQL safely. Import lowers through Ossie to DuckDB by default; `--ossie-target-dialect` selects another supported execution dialect. `--ossie-scope` optionally names the export's intermediate semantic model -(default `sidemantic`). The bridge applies official-compatible, portable Ossie +(default `sqlctx`). The bridge applies official-compatible, portable Ossie export internally; do not pass `--ossie-official-compatible`, which is reserved for `--to ossie`. @@ -69,7 +69,7 @@ SQL such as `${TABLE}.raw_amount * 2` instead. The bridge stages conversion through validated Ossie, rejects empty outputs, and checks model, field, metric, and relationship counts. It also compares join endpoints and ordered field pairs. A model rename that changes those identities -can therefore be refused. Export rejects semantics requiring Sidemantic's runtime +can therefore be refused. Export rejects semantics requiring sqlctx's runtime extension, including invariant filters, instead of sending an empty sentinel to Lightdash. @@ -79,7 +79,7 @@ explicitly reported `SOURCE_UNQUALIFIED`, `METRIC_REFERENCE_INLINED`, and presentation metadata is not retained by the executable graph; this is not a lossless project archive. -Offline tests exercised native and Sidemantic-origin exports, reimports, +Offline tests exercised native and sqlctx-origin exports, reimports, DuckDB aggregation results, and a two-column join. Those checks do not guarantee all Lightdash features or live deployment compatibility. See [conversion fidelity and Ossie interoperability](conversion.md) for separate diff --git a/docs/compatibility/lookml.md b/docs/compatibility/lookml.md index 8f588a07e..e4529d3fa 100644 --- a/docs/compatibility/lookml.md +++ b/docs/compatibility/lookml.md @@ -1,8 +1,8 @@ # LookML Compatibility -Sidemantic's LookML adapter parses `.lkml` files via the `lkml` Python library and maps LookML concepts to Sidemantic's semantic model (Model, Dimension, Metric, Segment, Relationship). It also supports exporting back to LookML for roundtrip workflows. +sqlctx's LookML adapter parses `.lkml` files via the `lkml` Python library and maps LookML concepts to sqlctx's semantic model (Model, Dimension, Metric, Segment, Relationship). It also supports exporting back to LookML for roundtrip workflows. -Features are marked **supported**, **partial support**, or **unsupported**. Partial support entries include notes explaining the limitation. Properties that parse without error but have no Sidemantic equivalent (display hints, UI metadata, caching config) are grouped together per section rather than listed individually. +Features are marked **supported**, **partial support**, or **unsupported**. Partial support entries include notes explaining the limitation. Properties that parse without error but have no sqlctx equivalent (display hints, UI metadata, caching config) are grouped together per section rather than listed individually. --- @@ -75,7 +75,7 @@ Naming convention: `{group_name}_{timeframe}`. Timeframe granularity mapping: -| LookML | Sidemantic | +| LookML | sqlctx | |--------|------------| | `time` | `hour` | | `date` | `day` | @@ -242,7 +242,7 @@ Unsupported. `aggregate_table:` blocks in explores parse without error but no se ## LookML Export (Roundtrip) -Sidemantic can export its semantic model back to LookML. +sqlctx can export its semantic model back to LookML. | Feature | Status | |---------|--------| diff --git a/docs/compatibility/malloy.md b/docs/compatibility/malloy.md index a2ecf35a4..bb0c9f3da 100644 --- a/docs/compatibility/malloy.md +++ b/docs/compatibility/malloy.md @@ -1,6 +1,6 @@ # Malloy compatibility -Sidemantic imports `.malloy` files with the bundled ANTLR grammar and maps the supported subset into native `Model`, `Dimension`, `Metric`, `Relationship`, `Explore`, and `SavedQuery` objects. It can also export semantic models back to Malloy. +sqlctx imports `.malloy` files with the bundled ANTLR grammar and maps the supported subset into native `Model`, `Dimension`, `Metric`, `Relationship`, `Explore`, and `SavedQuery` objects. It can also export semantic models back to Malloy. The statuses below describe the Python adapter and query engine: @@ -38,7 +38,7 @@ Lenient import records blocked or unsupported features and omits unsafe partial | `accept:` | **Supported.** The allowlist is enforced during physical schema introspection, before excluded columns can become public dimensions. | | `except:` | **Supported.** Exclusions compose with inherited controls. When both `accept` and `except` are present, the effective allowlist is narrowed. | | Primary-key exposure | **Supported.** `SchemaExposure.include_primary_key` keeps an explicitly declared physical key available even when schema controls are active. No key is inferred when absent. | -| `private` / `internal` dimensions, measures, and renames | **Supported with native visibility.** Fields are non-public; metric visibility and Malloy access metadata are retained and exported. Internal and private both enforce a non-public runtime boundary, although Sidemantic cannot reproduce every Malloy-internal visibility nuance. | +| `private` / `internal` dimensions, measures, and renames | **Supported with native visibility.** Fields are non-public; metric visibility and Malloy access metadata are retained and exported. Internal and private both enforce a non-public runtime boundary, although sqlctx cannot reproduce every Malloy-internal visibility nuance. | | Private renamed physical columns | **Supported.** Both the public alias and underlying physical name are excluded from intrinsic public exposure. | | Inherited exposure controls | **Supported.** Child `accept`, `except`, and private fields narrow or compose with the parent; flattened export/reparse preserves the effective boundary. | | `include { ... }` blocks | **Unsupported/rejected.** Include projection and access modifiers are not applied. The limitation is reported in lenient mode and rejected in strict mode rather than silently broadening or narrowing inherited fields. | @@ -74,7 +74,7 @@ Dialect-sensitive expressions use the source connection's resolved SQL dialect. | Filtered measures and chained filter refinements | **Supported.** Filters are lowered separately, kept in source order, and conjoined. | | Dialect-sensitive aggregate arguments and filters | **Supported with a resolved dialect.** The aggregate root remains a native metric while casts, date truncation, and regex predicates render for the target dialect. | | Rejected aggregate descendant | **Rejected atomically.** No partial metric or unsafe raw fallback is produced. | -| Measure references inside derived SQL | **Partial.** Native derived metric references are supported by the Sidemantic compiler, but Malloy symmetric/ungroup locality semantics are not inferred. | +| Measure references inside derived SQL | **Partial.** Native derived metric references are supported by the sqlctx compiler, but Malloy symmetric/ungroup locality semantics are not inferred. | | `all`, `exclude`, `source.count()` locality/symmetric semantics | **Unsupported.** These require Malloy query semantics not represented by a native metric. | ## Joins and relationship roles @@ -162,4 +162,4 @@ The following remain **unsupported** in adapter integration: ## Differential coverage -The opt-in harness under `tests/malloy_differential/` compares the official Malloy DuckDB runtime with the Python Sidemantic path for manifest entries marked `compatible`. Executable fixtures cover core measures, empty results, a typed arithmetic dimension, conjunctive source filters, exact joins with additional predicates, ordered composite joins with fanout-safe aggregation, and intrinsic physical fields on a source without a declared primary key. Unsupported families remain declarative in the manifest and are reported without claiming runtime equivalence. +The opt-in harness under `tests/malloy_differential/` compares the official Malloy DuckDB runtime with the Python sqlctx path for manifest entries marked `compatible`. Executable fixtures cover core measures, empty results, a typed arithmetic dimension, conjunctive source filters, exact joins with additional predicates, ordered composite joins with fanout-safe aggregation, and intrinsic physical fields on a source without a declared primary key. Unsupported families remain declarative in the manifest and are reported without claiming runtime equivalence. diff --git a/docs/compatibility/metricflow.md b/docs/compatibility/metricflow.md index cab4b8a0b..2745f9692 100644 --- a/docs/compatibility/metricflow.md +++ b/docs/compatibility/metricflow.md @@ -17,6 +17,6 @@ The MetricFlow adapter reads dbt **source YAML**: legacy `semantic_models` and ` | Semi-additive measures | Window choice and groupings are mapped natively | Native non-additive parameters retained | | Natural entities / SCD joins | Source entity retained; SCD behavior is unsupported | Source entity retained with an unsupported diagnostic | -The adapter stores source-only definitions separately from executable graph fields. Preserving a property for a source roundtrip does not mean it is used by Sidemantic's query engine. Fidelity reports distinguish retained but unsupported execution from native mappings. +The adapter stores source-only definitions separately from executable graph fields. Preserving a property for a source roundtrip does not mean it is used by sqlctx's query engine. Fidelity reports distinguish retained but unsupported execution from native mappings. Export is not a complete dbt project generator. It reports unsupported SQL-only models, relationship kinds without a foreign-entity mapping, and metrics that cannot become legacy measures. Warehouse qualification is lost when a table is lowered to `ref('model_name')`, and is reported as an approximation. Percentile aggregation remains unsupported. Exported source should be validated in the destination dbt project, including its model refs, time spine and project configuration. diff --git a/docs/compatibility/osi.md b/docs/compatibility/osi.md index 6d86f911e..ce62d9f6c 100644 --- a/docs/compatibility/osi.md +++ b/docs/compatibility/osi.md @@ -1,7 +1,7 @@ # OSI compatibility alias The canonical name is now [Apache Ossie](ossie.md), and the canonical -Sidemantic format name is `ossie`. +sqlctx format name is `ossie`. Existing commands may continue to use `osi`. The aliases `apache-ossie` and `open-semantic-interchange` are also accepted. New documentation, automation, diff --git a/docs/compatibility/ossie.md b/docs/compatibility/ossie.md index 4d1af75e1..44a0663a9 100644 --- a/docs/compatibility/ossie.md +++ b/docs/compatibility/ossie.md @@ -1,26 +1,26 @@ # Apache Ossie compatibility -Sidemantic's Python integration handles [Apache Ossie](https://github.com/apache/ossie) +sqlctx's Python integration handles [Apache Ossie](https://github.com/apache/ossie) logical semantic-model, ontology, and standalone mapping source documents. Executable import and graph synthesis apply only to logical documents. The canonical format name is `ossie`; `osi`, `apache-ossie`, and `open-semantic-interchange` remain accepted aliases. The historical Python import spelling -`sidemantic.adapters.osi.OSIAdapter` now routes to this canonical contract. +`sqlctx.adapters.osi.OSIAdapter` now routes to this canonical contract. The pre-profile implementation is isolated as `LegacyOSIAdapter` for explicit migration work; format discovery, CLI aliases, and ordinary direct imports do not bypass validation or scoped lowering. -Install the optional validator dependencies with `uv add 'sidemantic[ossie]'`, -or use `uv sync --extra ossie` in a Sidemantic checkout. Validation is offline: -Sidemantic loads only the vendored, checksum-verified schemas listed below and +Install the optional validator dependencies with `uv add 'sqlctx[ossie] @ git+https://github.com/sidequery/sqlctx'`, +or use `uv sync --extra ossie` in a sqlctx checkout. Validation is offline: +sqlctx loads only the vendored, checksum-verified schemas listed below and does not retrieve schema resources from the network. ## Pinned profiles Schema version, consumer profile, and YAML-versus-JSON serialization are -independent choices. Sidemantic supports these explicit contracts: +independent choices. sqlctx supports these explicit contracts: | Consumer profile | Declared version | Document family | Validation schema | Pinned upstream commit | |---|---|---|---|---| @@ -46,7 +46,7 @@ The vendored ontology runtime schema has two recorded deterministic rewrites: a unique local `$id` and local references to the pinned logical schema. The untouched upstream ontology schema is retained alongside it. Exact paths, source URLs, transformations, and SHA-256 values are in -[`sidemantic/interchange/ossie/schemas/manifest.json`](../../sidemantic/interchange/ossie/schemas/manifest.json). +[`sqlctx/interchange/ossie/schemas/manifest.json`](../../sqlctx/interchange/ossie/schemas/manifest.json). The September 12 snapshot retains the `semantic_model` array envelope, root `dialects` and `vendors`, and its original expression labels. The October 1 @@ -65,7 +65,7 @@ The mutable development version alone does not identify a schema revision. New logical markers (`expression.sql`, dataset metrics, or an additional dialect name) select the November snapshot. An ambiguous flat document keeps its October interpretation. Use `OssieParseOptions(schema_revision=...)` or -`sidemantic convert --ossie-input-schema-revision 172a3e566f2fc9c0a733ebbb470e97c33d2bd8b1` +`sqlctx convert --ossie-input-schema-revision 172a3e566f2fc9c0a733ebbb470e97c33d2bd8b1` to validate such a source explicitly against the newer contract. The separate `--ossie-schema-revision` option selects the synthesized output revision. `LATEST_OSSIE_SCHEMA_COMMIT` identifies the November pin; the existing @@ -75,7 +75,7 @@ to validate such a source explicitly against the newer contract. The separate The conformance suite also runs the official Apache Ossie validator from a pinned local fixture, using only the vendored upstream schemas and validator -code. It verifies that canonical Sidemantic exports pass for core `0.1.1` +code. It verifies that canonical sqlctx exports pass for core `0.1.1` (JSON), both pinned core `0.2.0.dev0` shapes, and current ontology. Deliberately invalid documents are rejected. The gates are implemented by [`tests/interchange/ossie/test_upstream_validator_gate.py`](../../tests/interchange/ossie/test_upstream_validator_gate.py) @@ -101,7 +101,7 @@ when requested, the original bytes. Unknown fields that pass the selected schema remain in that source document. A runtime `SemanticGraph` is a target-specific executable projection of one -logical model scope, either at the root or inside the older envelope. It contains only constructs Sidemantic can lower +logical model scope, either at the root or inside the older envelope. It contains only constructs sqlctx can lower safely for the selected runtime dialect. It is not an archival copy of the source document and cannot reproduce alternate expression dialects, lexical YAML details, ontology content, or every Ossie field. @@ -159,11 +159,11 @@ use the same dataset or metric names without colliding. ## Target-aware expression selection Executable import requires a target dialect. For each field or metric, -Sidemantic selects the exact matching Ossie expression when Ossie defines a +sqlctx selects the exact matching Ossie expression when Ossie defines a label for that target: `BIGQUERY`, `SNOWFLAKE`, or `DATABRICKS`. Otherwise it lowers an `OSSIE_SQL_2026` variant when present, then falls back to an explicit `ANSI_SQL` variant. If none exists, the construct is -diagnosed and excluded; Sidemantic does not select an arbitrary first variant, +diagnosed and excluded; sqlctx does not select an arbitrary first variant, relabel SQL, or claim that unchanged text was transpiled. For the November profile, `expression.sql` supplies the authoritative portable @@ -248,7 +248,7 @@ Distinct source rows with identical values remain distinct, including datasets without declared primary keys. ```bash -sidemantic query --models scott_model.ossie.yaml --db scott.duckdb --engine rust --no-fallback \ +sqlctx query --models scott_model.ossie.yaml --db scott.duckdb --engine rust --no-fallback \ 'SELECT d.dname, AGG(e.sum_sal) AS salary FROM scott_model.emp e LEFT JOIN scott_model.dept d ON e.deptno = d.deptno GROUP BY d.dname' ``` @@ -292,9 +292,9 @@ The strict Layer 3 binding accepts only `dimensions`, `metrics`, and one `filter Use `--ossie-wide` with a JSON argument or `-` for stdin: ```bash -sidemantic query --models scott_model.ossie.yaml --db scott.duckdb --engine python --ossie-wide \ +sqlctx query --models scott_model.ossie.yaml --db scott.duckdb --engine python --ossie-wide \ '{"dimensions":["dept.dname"],"metrics":["emp.sum_sal","emp.emp_count"]}' -sidemantic rewrite --models scott_model.ossie.yaml --engine rust --no-fallback --ossie-wide \ +sqlctx rewrite --models scott_model.ossie.yaml --engine rust --no-fallback --ossie-wide \ '{"metrics":["emp.sum_sal","emp.emp_count"]}' ``` @@ -331,7 +331,7 @@ ancestry, and embedded logical-model structure. Their complete validated canonical data can be preserved and serialized as an opaque source document. -Sidemantic does not perform ontology reasoning, does not turn ontology concepts +sqlctx does not perform ontology reasoning, does not turn ontology concepts or mappings into runtime models, and does not execute ontology documents. Ontology lowering therefore produces no executable catalog scopes. @@ -352,7 +352,7 @@ may change. Cross-serialization between YAML and JSON is always canonical. Exact-byte reuse is an explicit source-document option. It succeeds only when original bytes were retained, output serialization matches the input, and -reparsing those bytes produces the current canonical data. Otherwise Sidemantic +reparsing those bytes produces the current canonical data. Otherwise sqlctx emits canonical output and reports an `ossie.serialization.exact_source_mismatch` warning. This guarantee does not apply to an Ossie -> runtime graph -> Ossie conversion. @@ -372,7 +372,7 @@ snapshot, or `schema_revision="831f48e582731cf1ee2e65380ca5abf8157869c7"` or CLI `--ossie-schema-revision 831f48e582731cf1ee2e65380ca5abf8157869c7` to synthesize the older envelope. Preserved-document export retains its source shape. -Sidemantic emits one expression variant with the supplied label +sqlctx emits one expression variant with the supplied label and validates the completed document against the pinned schema. It validates that expression text in the named dialect but does not infer its origin, transpile it, or relabel it as another dialect. @@ -387,9 +387,9 @@ Simple aggregate filters are emitted as conditional SQL and null filling as reference a constant dataset field so they retain their row source. For native behaviors that Ossie core cannot express, synthesis preserves the -graph in a versioned `SIDEMANTIC` custom extension. This includes non-additive, +graph in a versioned `SQLCTX` custom extension. This includes non-additive, time and window metrics, inheritance, security restrictions, private fields, -custom or inactive joins, and relationship role aliases. Python Sidemantic restores +custom or inactive joins, and relationship role aliases. Python sqlctx restores these definitions on import; security templates are evaluated for each query's user context. The extension records its SQL dialect and a fingerprint of the core projection. Unsupported versions, malformed payloads, incompatible dialects, @@ -398,8 +398,8 @@ and edits that make the projection stale are rejected. Extension-dependent documents contain only an empty placeholder dataset in their core projection. Real sources and metrics live in the extension, so consumers that ignore it cannot execute unrestricted or simplified definitions. -Export emits a warning that Sidemantic extension support is required. Use -`sidemantic convert ... --ossie-portable-only` (or `portable_only=True` in the +Export emits a warning that sqlctx extension support is required. Use +`sqlctx convert ... --ossie-portable-only` (or `portable_only=True` in the export API) to require portable core output instead. Invalid SQL, unresolved inheritance references, and other invalid declarations still fail export. @@ -424,9 +424,9 @@ explicitly named files report an error. Import one explicit scope for a BigQuery runtime projection: ```bash -sidemantic convert commerce.ossie.yaml \ +sqlctx convert commerce.ossie.yaml \ --from ossie \ - --to sidemantic \ + --to sqlctx \ --output models.yml \ --ossie-scope commerce \ --ossie-target-dialect bigquery @@ -436,8 +436,8 @@ Synthesize a new Ossie document while labeling only SQL already intended for BigQuery: ```bash -sidemantic convert models/orders.yml \ - --from sidemantic \ +sqlctx convert models/orders.yml \ + --from sqlctx \ --to ossie \ --output commerce.ossie.yaml \ --ossie-scope commerce \ diff --git a/docs/compatibility/sigma.md b/docs/compatibility/sigma.md index 856e2e6b0..9c04270f3 100644 --- a/docs/compatibility/sigma.md +++ b/docs/compatibility/sigma.md @@ -1,7 +1,7 @@ # Sigma compatibility `--from sigma` and `--to sigma` use the separately installed official -`ossie-sigma` executable. Sidemantic never installs it, downloads dependencies, +`ossie-sigma` executable. sqlctx never installs it, downloads dependencies, or calls Sigma automatically. Install it in a separate environment and expose its executable on `PATH`; the converter requires Python 3.11+. See the [upstream converter documentation](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/sigma/README.md). @@ -14,10 +14,10 @@ different installed converter version is used. ## CLI ```sh -sidemantic convert data-model.json --from sigma --to sidemantic \ +sqlctx convert data-model.json --from sigma --to sqlctx \ --output models.yml -sidemantic convert models.yml --from sidemantic --to sigma \ +sqlctx convert models.yml --from sqlctx --to sigma \ --ossie-expression-dialect ANSI_SQL --ossie-scope commerce \ --output data-model.json ``` @@ -30,7 +30,7 @@ Import uses the official converter's translated ANSI SQL and lowers to DuckDB by default. `--ossie-target-dialect` selects another supported execution dialect. Export requires `--ossie-expression-dialect ANSI_SQL`: other dialect labels are rejected, and the bridge does not relabel their SQL. `--ossie-scope` optionally -names the intermediate semantic model (default `sidemantic`). Official-compatible, +names the intermediate semantic model (default `sqlctx`). Official-compatible, portable Ossie export is applied internally; `--ossie-official-compatible` itself is reserved for `--to ossie`. Use `--force` only to replace an existing output. @@ -73,7 +73,7 @@ be treated as a faithful update to existing Sigma objects. The pinned official exporter can synthesize a relationship's `targetColumnId` from the **source** element's column-ID map. The result can reference a column -that does not exist on the target element. Sidemantic validates native IDs and +that does not exist on the target element. sqlctx validates native IDs and ordered key pairs before publishing and **rejects those exports**, including the composite-key case exercised during validation. Prefer models without relationships for this pinned Sigma export path; do not assume relationship @@ -86,14 +86,14 @@ The bridge stages conversion through validated Ossie, rejects empty output, checks model/field/metric/relationship counts, and compares relationship endpoints and ordered key pairs. It binds the official converter's quoted metric references to their exact logical declarations without changing physical -field SQL. Export rejects features requiring Sidemantic runtime extensions. +field SQL. Export rejects features requiring sqlctx runtime extensions. Upstream stderr is surfaced. Every upstream warning is checked; only the reported `OPAQUE_DATATYPE` approximation is allowed. Unknown warnings, dropped metrics, untranslatable expressions, and unresolved relationships fail the conversion. Existing destinations remain unchanged when conversion is rejected. -Offline tests exercised native and Sidemantic-origin exports, reimports, +Offline tests exercised native and sqlctx-origin exports, reimports, DuckDB aggregation results, composite-key import, and rejection of incorrect exported keys. They provide no blanket Sigma feature or deployment guarantee. See [conversion fidelity and Ossie interoperability](conversion.md) for the diff --git a/docs/compatibility/yardstick.md b/docs/compatibility/yardstick.md index fbc944c10..bd356d4c3 100644 --- a/docs/compatibility/yardstick.md +++ b/docs/compatibility/yardstick.md @@ -1,6 +1,6 @@ # Yardstick Compatibility -Sidemantic's Yardstick adapter parses SQL files containing `CREATE VIEW` statements that use the `AS MEASURE` syntax from Julian Hyde's ["Measures in SQL" proposal](https://arxiv.org/abs/2307.14009). It maps Yardstick concepts to Sidemantic's semantic model (Model, Dimension, Metric) and supports `SEMANTIC SELECT`, optional-prefix `AGGREGATE()`, and `AT` query modifiers for measure-aware SQL queries. +sqlctx's Yardstick adapter parses SQL files containing `CREATE VIEW` statements that use the `AS MEASURE` syntax from Julian Hyde's ["Measures in SQL" proposal](https://arxiv.org/abs/2307.14009). It maps Yardstick concepts to sqlctx's semantic model (Model, Dimension, Metric) and supports `SEMANTIC SELECT`, optional-prefix `AGGREGATE()`, and `AT` query modifiers for measure-aware SQL queries. Features are marked **supported**, **partial support**, or **unsupported**. Partial support entries include notes explaining the limitation. @@ -119,7 +119,7 @@ When a measure expression contains aggregate functions (detected by walking the ## Query Semantics -The Yardstick adapter works in tandem with Sidemantic's query rewriter to support `SEMANTIC SELECT`, optional-prefix `AGGREGATE()`, and `AT` modifiers described in the Measures in SQL proposal. +The Yardstick adapter works in tandem with sqlctx's query rewriter to support `SEMANTIC SELECT`, optional-prefix `AGGREGATE()`, and `AT` modifiers described in the Measures in SQL proposal. ### SEMANTIC Prefix @@ -148,10 +148,10 @@ The Yardstick adapter works in tandem with Sidemantic's query rewriter to suppor ### Upstream Parity Tests -The default test suite replays a vendored Yardstick `measures.test` fixture for stable CI coverage. To check against the live upstream Yardstick repository without copying fixtures into Sidemantic, run: +The default test suite replays a vendored Yardstick `measures.test` fixture for stable CI coverage. To check against the live upstream Yardstick repository without copying fixtures into sqlctx, run: ```bash -SIDEMANTIC_YARDSTICK_UPSTREAM_TESTS=1 uv run pytest -q tests/queries/test_yardstick_measures_replay.py -m yardstick_upstream +SQLCTX_YARDSTICK_UPSTREAM_TESTS=1 uv run pytest -q tests/queries/test_yardstick_measures_replay.py -m yardstick_upstream ``` The same command runs in the `Yardstick Upstream Parity` GitHub Actions workflow. That workflow runs nightly, can be triggered manually with a Yardstick ref override, and runs on pull requests that touch Yardstick-specific code or tests. @@ -161,18 +161,18 @@ The live replay fetches `https://github.com/sidequery/yardstick.git` at `main` b | Facet | Coverage | |-------|----------| | Model/metric definitions | Checks every parsed `CREATE VIEW ... AS MEASURE`, including definitions within batches, asserting model name, source table/base SQL, primary key, Yardstick metadata, dimension SQL/type/granularity, and metric `agg`/`sql`/`filters`/`type` | -| Query execution | Replays every upstream query block against Sidemantic's Yardstick rewriter and compares result rows | +| Query execution | Replays every upstream query block against sqlctx's Yardstick rewriter and compares result rows | -The live definition check covers the `CREATE VIEW ... AS MEASURE` definitions used by Yardstick's SQL tests. Sidemantic's native SQL definition parser owns `MODEL(...)`, `METRIC(...)`, and `DIMENSION(...)` files separately from the Yardstick adapter; the live upstream replay does not treat Yardstick's top-level `yardstick_definitions.sql` helper file as part of the SQL-test corpus. +The live definition check covers the `CREATE VIEW ... AS MEASURE` definitions used by Yardstick's SQL tests. sqlctx's native SQL definition parser owns `MODEL(...)`, `METRIC(...)`, and `DIMENSION(...)` files separately from the Yardstick adapter; the live upstream replay does not treat Yardstick's top-level `yardstick_definitions.sql` helper file as part of the SQL-test corpus. The replay preserves complete SQLLogicTest records, including regex error expectations and statements after the final query. Its setup runner executes batches transactionally, restores model metadata on rollback, manages permanent and temporary measure views, and applies warning policy when prepared statements -execute. Query expansion uses Sidemantic's production rewriter. This test setup +execute. Query expansion uses sqlctx's production rewriter. This test setup does not enable multi-statement execution on the public query API. -Sidemantic emits `YardstickWarning` when `AT (ALL ...)` drops an outer filter that +sqlctx emits `YardstickWarning` when `AT (ALL ...)` drops an outer filter that the remaining evaluation context does not preserve. Python callers can treat that warning as an error using the standard `warnings` module. Repeated queries observe the current warning policy. The literal `yardstick('SELECT ...')` table diff --git a/docs/duckdb-extension.md b/docs/duckdb-extension.md index 5176b30c3..52fa380f6 100644 --- a/docs/duckdb-extension.md +++ b/docs/duckdb-extension.md @@ -1,52 +1,34 @@ # DuckDB Extension -The Sidemantic DuckDB extension embeds the Rust native runtime in DuckDB. It is a native-format deployment path, separate from the Python CLI and Python adapter ecosystem. +The sqlctx DuckDB extension embeds the Rust native runtime in DuckDB. It is a native-format deployment path, separate from the Python CLI and Python adapter ecosystem. ## Status The extension is experimental and targets **DuckDB 1.5.6** only. It is **not** in the -DuckDB community extension registry, so `INSTALL sidemantic FROM community` fails. +DuckDB community extension registry, so `INSTALL sqlctx FROM community` fails. Community publication is planned; once it lands, installation will be: ```sql -INSTALL sidemantic FROM community; -LOAD sidemantic; +INSTALL sqlctx FROM community; +LOAD sqlctx; ``` -Until then, use a prebuilt GitHub release artifact or build from source. Both are -unsigned, so start the DuckDB CLI with unsigned-extension loading enabled: +Build sqlctx from source until a release artifact is available. Start the +DuckDB CLI with unsigned-extension loading enabled: ```bash duckdb -unsigned ``` -## Install a Release Artifact - -The [`sidemantic-duckdb-v0.1.0`](https://github.com/sidequery/sidemantic/releases/tag/sidemantic-duckdb-v0.1.0) -release ships unsigned builds for DuckDB 1.5.6: - -- `sidemantic-duckdb-1.5.6-linux_amd64.duckdb_extension` -- `sidemantic-duckdb-1.5.6-linux_arm64.duckdb_extension` -- `sidemantic-duckdb-1.5.6-osx_amd64.duckdb_extension` -- `sidemantic-duckdb-1.5.6-osx_arm64.duckdb_extension` - -Linux builds use a glibc 2.28 baseline. Download the asset for your platform, -verify it against the release's `SHA256SUMS`, rename it to -`sidemantic.duckdb_extension`, and load it by absolute path from a DuckDB 1.5.6 -shell started with `-unsigned`: - -```sql -LOAD '/absolute/path/to/sidemantic.duckdb_extension'; -``` - -There are no Windows builds and no builds for other DuckDB versions. +[The pre-rename release](https://github.com/sidequery/sqlctx/releases/tag/sidemantic-duckdb-v0.1.0) +contains builds for DuckDB 1.5.6 under the original extension name. ## Build From Source The extension build needs Rust, DuckDB extension build tooling, and Ninja. ```bash -cd sidemantic-duckdb +cd sqlctx-duckdb make deps DUCKDB_VERSION=v1.5.6 make make test @@ -61,7 +43,7 @@ different DuckDB tag. The local loadable extension is produced at: ```text -sidemantic-duckdb/build/release/extension/sidemantic/sidemantic.duckdb_extension +sqlctx-duckdb/build/release/extension/sqlctx/sqlctx.duckdb_extension ``` Load it in the DuckDB shell built by the extension workflow: @@ -71,17 +53,21 @@ Load it in the DuckDB shell built by the extension workflow: ``` ```sql -LOAD 'build/release/extension/sidemantic/sidemantic.duckdb_extension'; +LOAD 'build/release/extension/sqlctx/sqlctx.duckdb_extension'; ``` For embedded clients, set DuckDB's `allow_unsigned_extensions` database configuration before opening the connection. +The extension reads existing `__sidemantic_catalog` snapshots and +`.sidemantic.sql` sidecars. A catalog mutation stores the updated snapshot in +`__sqlctx_catalog`. + ## Runtime API Load native YAML: ```sql -SELECT * FROM sidemantic_load(' +SELECT * FROM sqlctx_load(' version: 1 models: - name: orders @@ -97,13 +83,13 @@ models: Load native YAML from disk: ```sql -SELECT * FROM sidemantic_load_file('/path/to/models.yml'); +SELECT * FROM sqlctx_load_file('/path/to/models.yml'); ``` Load native SQL definitions from disk: ```sql -SELECT * FROM sidemantic_load_file('/path/to/models.sql'); +SELECT * FROM sqlctx_load_file('/path/to/models.sql'); ``` Native SQL definitions can also be entered directly through the parser extension: @@ -128,13 +114,13 @@ model orders from orders ( Inspect loaded models: ```sql -SELECT * FROM sidemantic_models(); +SELECT * FROM sqlctx_models(); ``` Rewrite semantic SQL without executing it: ```sql -SELECT sidemantic_rewrite_sql('SELECT orders.revenue FROM orders'); +SELECT sqlctx_rewrite_sql('SELECT orders.revenue FROM orders'); ``` Run a semantic query through the parser override: @@ -155,7 +141,7 @@ The workflow: - builds the Rust-backed extension for `linux_amd64`, `linux_arm64`, `osx_amd64`, and `osx_arm64`, - runs the DuckDB sqllogictests, including native YAML load, native SQL definition file load, relationship rewrite, semantic select, persistence, and invalid-version coverage, - uploads the four extension artifacts with their checksums, -- on a `sidemantic-duckdb-v*` tag push (or a manual run with `create_github_release`), creates the GitHub release with the artifacts, `SHA256SUMS`, and `LICENSE`. It never overwrites an existing release. +- on a `sqlctx-duckdb-v*` tag push (or a manual run with `create_github_release`), creates the GitHub release with the artifacts, `SHA256SUMS`, and `LICENSE`. It never overwrites an existing release. It does not publish to the DuckDB community extension registry. diff --git a/docs/native-fixtures.md b/docs/native-fixtures.md index 7866c2a20..ff89ba96d 100644 --- a/docs/native-fixtures.md +++ b/docs/native-fixtures.md @@ -1,6 +1,6 @@ # Native Fixture Suite -The native fixture suite is the shared compatibility corpus for native Sidemantic YAML and SQL projects. It lives under `tests/native-fixtures/` and is driven by `tests/native-fixtures/manifest.yml`. +The native fixture suite is the shared compatibility corpus for native sqlctx YAML and SQL projects. It lives under `tests/native-fixtures/` and is driven by `tests/native-fixtures/manifest.yml`. Runtime support claims are declared in the machine-readable [`runtime-conformance.yml`](runtime-conformance.yml). The generated @@ -60,7 +60,7 @@ Invalid fixtures set `valid: false` and list stable error text fragments: valid: false expected_validation: expected/validation.json error_contains: - - Unsupported native Sidemantic format version + - Unsupported native sqlctx format version ``` `sql_contains` is a shape check, not SQL string parity. It should assert stable semantic clauses or identifiers, not formatting. @@ -110,7 +110,7 @@ The Python runner loads every manifest fixture and asserts `expected/validation. Rust runner: ```bash -cd sidemantic-rs +cd sqlctx-rs cargo test --test native_fixtures cargo test --features adbc-exec --test native_fixtures native_fixtures_execute_expected_results_with_duckdb_adbc ``` diff --git a/docs/native-format.md b/docs/native-format.md index 278d30588..104560eb3 100644 --- a/docs/native-format.md +++ b/docs/native-format.md @@ -1,6 +1,6 @@ -# Native Sidemantic Format +# Native sqlctx Format -This document defines the native Sidemantic project format consumed by the Rust native runtime and the Python native adapter. +This document defines the native sqlctx project format consumed by the Rust native runtime and the Python native adapter. The native format has two source forms: @@ -14,8 +14,8 @@ The native format is the runtime contract. External formats such as LookML, Metr The Rust runtime and Rust CLI directory loader intentionally have a smaller direct input surface than Python: -- `.yml` / `.yaml`: native Sidemantic YAML or Cube YAML. -- `.sql`: native Sidemantic SQL definition files. +- `.yml` / `.yaml`: native sqlctx YAML or Cube YAML. +- `.sql`: native sqlctx SQL definition files. They do not auto-detect LookML, MetricFlow/dbt manifests, Hex, Rill, Malloy, Omni, Superset, GoodData, Snowflake Cortex, ThoughtSpot, Holistics, Tableau, @@ -171,7 +171,7 @@ models: ``` ```sh -sidemantic query --models ./models --metric daily_activity.activity_count \ +sqlctx query --models ./models --metric daily_activity.activity_count \ --dimension daily_activity.test_name \ --filter "daily_activity.event_date >= '2026-01-01'" ``` @@ -572,9 +572,9 @@ explores: ```bash # Every customer region; regions without orders have NULL revenue and a zero count. -sidemantic query --explore by_customer --metric orders.revenue --metric orders.order_count --dimension region +sqlctx query --explore by_customer --metric orders.revenue --metric orders.order_count --dimension region # Both populations: regions without orders and orders without a region. -sidemantic query --metric orders.revenue --metric customers.customer_count --dimension customers.region +sqlctx query --metric orders.revenue --metric customers.customer_count --dimension customers.region ``` Releases through 0.13.1 anchored a single-model metric query on its first @@ -872,23 +872,23 @@ the Rust loader rejects it because it cannot pick a single owning model. ## Authoring contracts -Use the default full Sidemantic contract for native semantics such as non-additive +Use the default full sqlctx contract for native semantics such as non-additive metrics, policies, and other runtime features: ```bash -sidemantic validate ./models --authoring-mode sidemantic +sqlctx validate ./models --authoring-mode sqlctx ``` To author a model intended for Ossie core interchange, check representability while editing, before exporting: ```bash -sidemantic validate ./models --authoring-mode ossie-portable --ossie-expression-dialect ANSI_SQL +sqlctx validate ./models --authoring-mode ossie-portable --ossie-expression-dialect ANSI_SQL ``` This uses the same portable-only synthesis checks as `convert --ossie-portable-only`. It reports stable `ossie.synthesis.*` diagnostics and object paths for semantics -that require Sidemantic or cannot be represented. Dropped or approximated source +that require sqlctx or cannot be represented. Dropped or approximated source semantics are errors in this mode. The declared expression dialect must describe the actual SQL; validation does not translate SQL or rewrite source files. The default profile is `ossie-core` at the pinned `0.2.0.dev0` schema; select @@ -899,10 +899,10 @@ the `0.1.0` dbt compatibility alias is not used for synthesized validation. Portable validation certifies a core representation, not execution by every consumer. Preserved external expressions still have to lower through the normal strict source importer; schema validity alone is insufficient. Extension-dependent -native models remain valid under the full Sidemantic contract, but fail the +native models remain valid under the full sqlctx contract, but fail the portable contract. Invalid source fails both. `--engine` controls separate runtime compatibility checks, and `--live` checks database schema; neither selects the -authoring contract. The default authoring contract remains `sidemantic`. +authoring contract. The default authoring contract remains `sqlctx`. Validation never exports, migrates, or replaces the authoritative source. When ready to export, continue to supply an explicit scope, expression dialect, and diff --git a/docs/pyodide.md b/docs/pyodide.md index fee56e5cf..ce0f0111f 100644 --- a/docs/pyodide.md +++ b/docs/pyodide.md @@ -1,20 +1,20 @@ # Pyodide Runtime -Sidemantic's browser/WASM path is a no-dependency wheel install. Install the Pyodide-compatible runtime packages first, then install the Sidemantic wheel with dependency resolution disabled: +sqlctx's browser/WASM path is a no-dependency wheel install. Install the Pyodide-compatible runtime packages first, then install the sqlctx wheel with dependency resolution disabled: ```python import micropip await pyodide.loadPackage(["micropip", "pydantic", "pyyaml", "jinja2"]) await micropip.install(["sqlglot", "lkml", "inflect"], deps=False) -await micropip.install("emfs:/tmp/sidemantic--py3-none-any.whl", deps=False) +await micropip.install("emfs:/tmp/sqlctx--py3-none-any.whl", deps=False) ``` This is intentional. The published Python package includes CLI/database dependencies that are not part of the Pyodide runtime contract. The supported Pyodide import surface is the core semantic model API, for example: ```python -from sidemantic import Model, Dimension, Metric, Relationship -from sidemantic.core.semantic_graph import SemanticGraph +from sqlctx import Model, Dimension, Metric, Relationship +from sqlctx.core.semantic_graph import SemanticGraph ``` Optional server, workbench, chart, and database execution paths are not Pyodide targets. diff --git a/docs/reviews/ossie-conformance-2026-11-05.md b/docs/reviews/ossie-conformance-2026-11-05.md index 69abe9815..4b4380527 100644 --- a/docs/reviews/ossie-conformance-2026-11-05.md +++ b/docs/reviews/ossie-conformance-2026-11-05.md @@ -176,7 +176,7 @@ Reproduce the maintained query corpus with a current source-built Rust extension tests/interchange/ossie/test_layer2_conformance.py \ tests/interchange/ossie/test_layer3_conformance.py RUST_MIN_STACK=16777216 CARGO_BUILD_JOBS=2 \ - cargo test -p sidemantic --lib --test ossie_forward -- --test-threads=2 + cargo test -p sqlctx --lib --test ossie_forward -- --test-threads=2 ``` ## Coverage limits diff --git a/docs/reviews/ossie-converter-comparison-2026-11-06.md b/docs/reviews/ossie-converter-comparison-2026-11-06.md index 0a740d871..0cd363056 100644 --- a/docs/reviews/ossie-converter-comparison-2026-11-06.md +++ b/docs/reviews/ossie-converter-comparison-2026-11-06.md @@ -1,21 +1,21 @@ -# Sidemantic versus official Apache Ossie converters +# sqlctx versus official Apache Ossie converters -Research date: November 6, 2026. Six parallel investigations covered all **23 projects** in the official converter registry, Sidemantic's complete format registry, source implementations, fixtures, selected unit suites, and targeted conversion probes. This is a conversion comparison, not a query-engine benchmark or vendor certification. +Research date: November 6, 2026. Six parallel investigations covered all **23 projects** in the official converter registry, sqlctx's complete format registry, source implementations, fixtures, selected unit suites, and targeted conversion probes. This is a conversion comparison, not a query-engine benchmark or vendor certification. -**Recommendation:** retain Sidemantic's broad source-format importers and CLI, prioritize semantic fidelity in existing exports, and selectively integrate official converters for missing formats. Replacing our adapters wholesale would lose useful input directions and source-language support. Treating every official converter as a reliable drop-in would also be incorrect: several silently omit newer dataset-scoped metrics. +**Recommendation:** retain sqlctx's broad source-format importers and CLI, prioritize semantic fidelity in existing exports, and selectively integrate official converters for missing formats. Replacing our adapters wholesale would lose useful input directions and source-language support. Treating every official converter as a reliable drop-in would also be incorrect: several silently omit newer dataset-scoped metrics. ## Reproducible baseline | Component | Inspected revision | |---|---| -| Sidemantic | [`a7df3c9eae7c1a9a916ebe317ee378408d7d721b`](https://github.com/sidequery/sidemantic/tree/a7df3c9eae7c1a9a916ebe317ee378408d7d721b) | +| sqlctx | [`a7df3c9eae7c1a9a916ebe317ee378408d7d721b`](https://github.com/sidequery/sqlctx/tree/a7df3c9eae7c1a9a916ebe317ee378408d7d721b) | | Official converters | [`011ea9f9a1e2c941f351e18e071622339ccae881`](https://github.com/apache/ossie-converters/tree/011ea9f9a1e2c941f351e18e071622339ccae881) | | Official converters' Ossie submodule | [`01a5488d840deda309aac68cc0b312c195369b8d`](https://github.com/apache/ossie/tree/01a5488d840deda309aac68cc0b312c195369b8d) | | Our latest supported Ossie draft pin | [`172a3e566f2fc9c0a733ebbb470e97c33d2bd8b1`](https://github.com/apache/ossie/tree/172a3e566f2fc9c0a733ebbb470e97c33d2bd8b1) | “Official” here means checked-in implementation in `apache/ossie-converters`, rather than an ecosystem member, issue proposal, or README illustration. The repository was located through current web/GitHub research and checked out with its pinned core submodule. Open issues were used as leads and status context, not as proof of current defects. -Our [registry](../../sidemantic/formats.py) has **20 formats: 20 import-capable, 17 export-capable**, including native Sidemantic and Ossie. This is **18 external format families, 15 with export**. These counts are declarations of entry points, not fidelity scores. Apache's 23 projects also include ontology infrastructure, a catalog service integration, and a deliberately fixture-scoped pipeline; the counts are not directly comparable. +Our [registry](../../sqlctx/formats.py) has **20 formats: 20 import-capable, 17 export-capable**, including native sqlctx and Ossie. This is **18 external format families, 15 with export**. These counts are declarations of entry points, not fidelity scores. Apache's 23 projects also include ontology infrastructure, a catalog service integration, and a deliberately fixture-scoped pipeline; the counts are not directly comparable. ## Complete official inventory @@ -72,7 +72,7 @@ These are bounded source/probe findings at the pinned revisions, not assertions | **P1** | Our MetricFlow export loses saved queries, conversion specifications and parts of cumulative/derived semantics; official dbt also drops some metadata. | Keep source-YAML and manifest support as separate declared capabilities; preserve or report unsupported features in each direction. | | **P1** | GoodData composite reference mapping loses the target's full key identity locally. | Test ordered source→target column pairs, not just relationship counts. | -The existing CLI already stages output and checks an import-fidelity report. The missing step is complete instrumentation and an **export/conversion report**: several adapters do not emit structured fidelity diagnostics, and valid graph construction says nothing about losses in the destination exporter. See [CLI conversion](../../sidemantic/cli.py), [fidelity reporting](../../sidemantic/fidelity.py), and [generic graph conversion](../../sidemantic/formats.py). +The existing CLI already stages output and checks an import-fidelity report. The missing step is complete instrumentation and an **export/conversion report**: several adapters do not emit structured fidelity diagnostics, and valid graph construction says nothing about losses in the destination exporter. See [CLI conversion](../../sqlctx/cli.py), [fidelity reporting](../../sqlctx/fidelity.py), and [generic graph conversion](../../sqlctx/formats.py). ## Ossie interoperability is a separate axis @@ -80,7 +80,7 @@ Our active `osi` alias resolves to the newer `OssieAdapter`; the older `adapters The official converters pin an older core snapshot despite sharing the `0.2.0.dev0` version string with newer drafts. Our newer parser supports constructs such as `expression.sql` and open dialect labels. **Pin age alone is not a compatibility failure**: our default native synthesis emits `expression.dialects`, and a simple native SUM model passed the official validator and selected exporters. -There is nevertheless a real feature mismatch: **dataset-scoped metrics are omitted by official Cube, dbt, Snowflake and Omni in the probes**, whereas official BigQuery/LookML retains them. Ordinary native Sidemantic model metrics synthesize at the root; imported Ossie dataset metrics retain their scope through metadata and can trigger the mismatch on re-export. This requires a consumer-specific capability check or a proven normalization, not simply a schema-version switch. +There is nevertheless a real feature mismatch: **dataset-scoped metrics are omitted by official Cube, dbt, Snowflake and Omni in the probes**, whereas official BigQuery/LookML retains them. Ordinary native sqlctx model metrics synthesize at the root; imported Ossie dataset metrics retain their scope through metadata and can trigger the mismatch on re-export. This requires a consumer-specific capability check or a proven normalization, not simply a schema-version switch. Inbound tests also found narrower incompatibilities: the official Flights example fails our strict model-name identifier check, and quoted source names require an API source-dialect option that our conversion CLI does not expose. Seven of ten official contract fixtures lower cleanly with default DuckDB settings; two more need their matching target dialect, and the quoted-source case works with the explicit API source dialect. The official TPC-DS example lowers cleanly. A separate outbound probe found that a native `numeric` dimension without `logical_data_type` emits no Ossie datatype and can become a string downstream. @@ -91,7 +91,7 @@ Likewise, these operations have different guarantees: - **Vendor A → graph/Ossie → vendor B:** additionally depends on both adapters, expression translation, key/predicate representation, and target capabilities. - **Native state stored in a vendor extension:** may restore a same-vendor round trip while remaining unusable to other consumers. -Our `SIDEMANTIC` runtime extension preserves otherwise inexpressible semantics and uses an empty portable core placeholder. That is deliberately not useful executable content for official tools that do not understand the extension. Use portable-only synthesis when the destination requires portable core, and report refusal clearly; do not advertise extension restoration as universal interchange. +Our `SQLCTX` runtime extension preserves otherwise inexpressible semantics and uses an empty portable core placeholder. That is deliberately not useful executable content for official tools that do not understand the extension. Use portable-only synthesis when the destination requires portable core, and report refusal clearly; do not advertise extension restoration as universal interchange. ## Recommended sequence @@ -113,6 +113,6 @@ Our `SIDEMANTIC` runtime extension preserves otherwise inexpressible semantics a Each note distinguishes executed tests/probes from source/test inspection. Passing existing unit suites does not contradict the demonstrated gaps: those suites do not assert all cross-format semantics. No production adapter code was changed. No live vendor deployment, full pairwise matrix, or query-equivalence certification was performed. -The disjoint selected Sidemantic adapter suites recorded **1,029 passed, 29 skipped**. Selected official suites recorded **4,610 passed, 60 skipped**; a further focused Cube rerun recorded 43 passed/10 skipped and is excluded from those totals. Skips/exclusions include optional DAX, vendor CLIs, built Cube compiler, packaging and Microsoft TOM integration. Databricks/Polaris Java and the nine ontology/remaining projects were source/test-inspected, not executed; official Hex was also not executed. The notes record exact commands and boundaries. These counts measure checks run, not comparative quality. +The disjoint selected sqlctx adapter suites recorded **1,029 passed, 29 skipped**. Selected official suites recorded **4,610 passed, 60 skipped**; a further focused Cube rerun recorded 43 passed/10 skipped and is excluded from those totals. Skips/exclusions include optional DAX, vendor CLIs, built Cube compiler, packaging and Microsoft TOM integration. Databricks/Polaris Java and the nine ontology/remaining projects were source/test-inspected, not executed; official Hex was also not executed. The notes record exact commands and boundaries. These counts measure checks run, not comparative quality. The official interop harness is a useful starting point, but its default mode returns success even when individual conversions fail, and strict mode still permits `LOSSY` outcomes. Its broad structural checks do not prove general SQL equivalence, type preservation or access-policy preservation. See the pinned [interop grading and exit rules](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/interop/README.md#L150). This research did not run the full harness. diff --git a/docs/reviews/ossie-converter-pr-review-2026-11-06.md b/docs/reviews/ossie-converter-pr-review-2026-11-06.md index ebe6754a1..3fed9575e 100644 --- a/docs/reviews/ossie-converter-pr-review-2026-11-06.md +++ b/docs/reviews/ossie-converter-pr-review-2026-11-06.md @@ -34,7 +34,7 @@ the core lazy-import smoke passed. The full runtime/version matrix remains for C ### 1. Default LookML and Malloy conversions fail validation -Location: `sidemantic/formats.py:383–384`. +Location: `sqlctx/formats.py:383–384`. `validate_conversion_output` infers serialization from the destination suffix. The CLI defaults to `converted.{target}.yml`, including LookML and Malloy. With @@ -44,7 +44,7 @@ Validate using the target format, or select a matching default extension. ### 2. Directed one-to-many joins double a derived metric -Location: `sidemantic/sql/generator.py:3249`. +Location: `sqlctx/sql/generator.py:3249`. The preaggregation decision recognizes only `many_to_one` paths. For forward-only `customers → orders` declared `one_to_many`, customer credit 100, two orders worth @@ -55,7 +55,7 @@ one-to-many direction as well. ### 3. Forward-only nested roles omit their join keys -Location: `sidemantic/core/semantic_graph.py:600`; interacts with +Location: `sqlctx/core/semantic_graph.py:600`; interacts with `SQLGenerator._model_needs_keyed_join_columns`. For `orders → buyer(customers) → buyer$regions`, forward-only many-to-one edges @@ -67,7 +67,7 @@ consider incoming role-instance edges or the actual query join plan. ### 4. Both official bridges misbind calculated-column dependencies -Location: `sidemantic/adapters/official.py:376–386`. +Location: `sqlctx/adapters/official.py:376–386`. Lightdash accepts `amount.sql = ${TABLE}.raw_amount`, `doubled.sql = ${amount} * 2` and a sum metric on `doubled`. The official converter emits the logical reference @@ -82,7 +82,7 @@ lowering. Both reproductions used the actual pinned official CLIs. ### 5. Sigma changes physical source identity -Location: `sidemantic/adapters/official.py:184–187` (export checks also at 575–580). +Location: `sqlctx/adapters/official.py:184–187` (export checks also at 575–580). Native `source.path: ["a.b"]` imports as SQL `a.b`, rather than the single table identifier `"a.b"`. With both tables present, the bridge reads schema `a`/table @@ -93,7 +93,7 @@ values, or reject unsupported paths in both directions. ### 6. Snowflake restores an implicit join type over an explicit edit -Location: `sidemantic/adapters/snowflake.py:1267–1268`. +Location: `sqlctx/adapters/snowflake.py:1267–1268`. Import a relationship with no `join_type`, then set both its `join_type` and `bsl_how` metadata to `inner`. Export unconditionally removes `join_type` because @@ -102,7 +102,7 @@ property while its effective semantics remain the original default. ### 7. Omni topics recreate deleted relationships -Location: `sidemantic/adapters/omni.py:859–862`. +Location: `sqlctx/adapters/omni.py:859–862`. Import a topic joining orders to customers plus an explicit keyed relationship, clear the orders relationships, and export to a fresh directory. The retained @@ -112,7 +112,7 @@ conflicting edits. ### 8. Omni ignores edited time granularities -Location: `sidemantic/adapters/omni.py:957`. +Location: `sqlctx/adapters/omni.py:957`. Import `timeframes: [date, month]`, then set `granularity="year"` and `supported_granularities=["year"]`. Export still emits the original timeframes; @@ -121,7 +121,7 @@ unchanged-projection check. ### 9. Hex ignores date/timestamp granularity edits -Location: `sidemantic/adapters/hex.py:619`. +Location: `sqlctx/adapters/hex.py:619`. Native type replay compares only `dim.type`, although dates and timestamps both map to `time`. Changing an imported date's granularity to hour still exports a @@ -131,7 +131,7 @@ granularity in the replay guard or diagnose an incompatible edit. ### 10. Cube source properties overwrite an edited dimension type -Location: `sidemantic/adapters/cube.py:1753`. +Location: `sqlctx/adapters/cube.py:1753`. Import a switch dimension, change it to numeric with `sql="amount"`, then export. Unconditional source-property replay restores `type: switch` and the original @@ -141,7 +141,7 @@ projection, as the CASE branch already does. A related probe found retained ### 11. MetricFlow legacy conversion export ignores edited summary fields -Location: `sidemantic/adapters/metricflow.py:1114–1115`. +Location: `sqlctx/adapters/metricflow.py:1114–1115`. Import a legacy conversion metric with a seven-day window, then change its `graph.metadata["metricflow_conversion_metrics"][name]["window"]` to `"30 days"`. @@ -152,7 +152,7 @@ reject conflicting changes. ### 12. ThoughtSpot Table routing drops edited expressions -Location: `sidemantic/adapters/thoughtspot.py:1657–1663`. +Location: `sqlctx/adapters/thoughtspot.py:1657–1663`. Import `tests/fixtures/thoughtspot/table_joins.table.tml`, change the orders metric SQL to `amount * 2`, export and reimport. SQL becomes `amount` because the @@ -162,7 +162,7 @@ expressions before retaining Table shape or export them faithfully. ### 13. GoodData retains an obsolete physical attribute binding -Location: `sidemantic/adapters/gooddata.py:788`. +Location: `sqlctx/adapters/gooddata.py:788`. Import an unlabelled attribute `{id: status, sourceColumn: old_status}`, change its dimension SQL to `new_status`, and export. The attribute still points to diff --git a/docs/reviews/ossie-converter-pr-stack-2026-11-06.md b/docs/reviews/ossie-converter-pr-stack-2026-11-06.md index 77a779ec9..6ae4a1da5 100644 --- a/docs/reviews/ossie-converter-pr-stack-2026-11-06.md +++ b/docs/reviews/ossie-converter-pr-stack-2026-11-06.md @@ -1,19 +1,19 @@ # Converter PR map — 2026-11-06 -The combined implementation in [#469](https://github.com/sidequery/sidemantic/pull/469) +The combined implementation in [#469](https://github.com/sidequery/sqlctx/pull/469) is superseded by focused PRs. Each code PR includes its own regression tests and compatibility documentation. The research, initial implementation validation and review-resolution records remain together in this documentation change. | PR | Scope | Review base / prerequisite | |---|---|---| -| [#470](https://github.com/sidequery/sidemantic/pull/470) | Shared export fidelity, staged publication and Ossie modes | `main` | -| [#471](https://github.com/sidequery/sidemantic/pull/471) | Directed joins, aggregate populations and nested role keys | #470 | -| [#472](https://github.com/sidequery/sidemantic/pull/472) | Cube and MetricFlow source semantics | #471 | -| [#473](https://github.com/sidequery/sidemantic/pull/473) | Hex, Holistics and Omni fidelity | #472 | -| [#474](https://github.com/sidequery/sidemantic/pull/474) | Snowflake keys/types and LookML relationships | #473 | -| [#475](https://github.com/sidequery/sidemantic/pull/475) | ThoughtSpot, TMDL and GoodData fidelity | #474 | -| [#476](https://github.com/sidequery/sidemantic/pull/476) | Optional guarded Lightdash and Sigma bridges | #475 | +| [#470](https://github.com/sidequery/sqlctx/pull/470) | Shared export fidelity, staged publication and Ossie modes | `main` | +| [#471](https://github.com/sidequery/sqlctx/pull/471) | Directed joins, aggregate populations and nested role keys | #470 | +| [#472](https://github.com/sidequery/sqlctx/pull/472) | Cube and MetricFlow source semantics | #471 | +| [#473](https://github.com/sidequery/sqlctx/pull/473) | Hex, Holistics and Omni fidelity | #472 | +| [#474](https://github.com/sidequery/sqlctx/pull/474) | Snowflake keys/types and LookML relationships | #473 | +| [#475](https://github.com/sidequery/sqlctx/pull/475) | ThoughtSpot, TMDL and GoodData fidelity | #474 | +| [#476](https://github.com/sidequery/sqlctx/pull/476) | Optional guarded Lightdash and Sigma bridges | #475 | | This documentation PR | Research comparison, evidence and review resolutions | `main` | ## Merge order @@ -34,7 +34,7 @@ no conflicting product behavior; overlapping target-model fixtures were deduplic ## Initial split verification -Before the PR-review fixes below, all product files under `sidemantic/` in the +Before the PR-review fixes below, all product files under `sqlctx/` in the recombined tree were byte-for-byte identical to reviewed implementation commit `a6a6b47f5b594c58fbff080a329f863747ac8e93`. The only test-content change separated the former combined Ossie/bridge CLI test into an Ossie test and a parametrized diff --git a/docs/reviews/ossie-converters-2026-11-06/bi-models.md b/docs/reviews/ossie-converters-2026-11-06/bi-models.md index 53ed2c097..c0ba32c35 100644 --- a/docs/reviews/ossie-converters-2026-11-06/bi-models.md +++ b/docs/reviews/ossie-converters-2026-11-06/bi-models.md @@ -1,41 +1,41 @@ # BI converter comparison: Microsoft, ThoughtSpot, GoodData -Inspected source, fixtures and tests on 2026-11-06. Sidemantic HEAD `a7df3c9eae7c1a9a916ebe317ee378408d7d721b`; official Apache converters HEAD `011ea9f9a1e2c941f351e18e071622339ccae881`. Product code unchanged. This compares native Sidemantic adapters with the official converters; the Sidemantic canonical Ossie boundary is a separate layer, and a native parse/export round trip does **not** establish Ossie intermediary preservation. +Inspected source, fixtures and tests on 2026-11-06. sqlctx HEAD `a7df3c9eae7c1a9a916ebe317ee378408d7d721b`; official Apache converters HEAD `011ea9f9a1e2c941f351e18e071622339ccae881`. Product code unchanged. This compares native sqlctx adapters with the official converters; the sqlctx canonical Ossie boundary is a separate layer, and a native parse/export round trip does **not** establish Ossie intermediary preservation. ## Microsoft Power BI / Fabric -**Directions/formats.** Both are bidirectional, but they do not have the same input contract. Sidemantic implements a native Python **TMDL** parser and emits a single TMDL script or split `definition/{database,model,tables,relationships}.tmdl`. It can take a directory containing `definition/`, or a file, but does not resolve a `.pbip` manifest or parse BIM/TMSL JSON. Official Microsoft accepts **BIM/TMSL mappings or JSON**, plus single-document TMDL and split TMDL/PBIP through optional Microsoft TOM/.NET. Plain BIM conversion requires neither TOM nor an online service. Sidemantic therefore has lower setup overhead for TMDL; official has broader Microsoft format coverage and the vendor object model for TMDL handling. Evidence: [Sidemantic source](/workspace/sidemantic/sidemantic/adapters/tmdl.py:152), [immutable](https://github.com/sidequery/sidemantic/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sidemantic/adapters/tmdl.py#L152-L191); [official README](/workspace/ossie-converters-research/microsoft/README.md:108), [immutable](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/microsoft/README.md#L108-L135). +**Directions/formats.** Both are bidirectional, but they do not have the same input contract. sqlctx implements a native Python **TMDL** parser and emits a single TMDL script or split `definition/{database,model,tables,relationships}.tmdl`. It can take a directory containing `definition/`, or a file, but does not resolve a `.pbip` manifest or parse BIM/TMSL JSON. Official Microsoft accepts **BIM/TMSL mappings or JSON**, plus single-document TMDL and split TMDL/PBIP through optional Microsoft TOM/.NET. Plain BIM conversion requires neither TOM nor an online service. sqlctx therefore has lower setup overhead for TMDL; official has broader Microsoft format coverage and the vendor object model for TMDL handling. Evidence: [sqlctx source](/workspace/sqlctx/sqlctx/adapters/tmdl.py:152), [immutable](https://github.com/sidequery/sqlctx/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sqlctx/adapters/tmdl.py#L152-L191); [official README](/workspace/ossie-converters-research/microsoft/README.md:108), [immutable](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/microsoft/README.md#L108-L135). -**Import semantics.** Sidemantic maps tables/columns/measures/relationships into executable models; stores original DAX, expression language and passthrough syntax; reports unavailable optional `sidemantic_dax`, parse errors, and untranslatable measures. It translates a small native aggregate subset, with a particularly good `DISTINCTCOUNT` SQL compensation preserving BLANK-as-distinct and BLANK-on-empty semantics. Official defaults to DAX-tagged Ossie expressions with no SQL claim; opt-in `--translate-dax` handles exact supported aggregates, DIVIDE, arithmetic with BLANK rules, measure references and VAR/RETURN, preserving original DAX alongside SQL. Neither should be described as translating arbitrary DAX/context semantics. Evidence: [Sidemantic import](/workspace/sidemantic/sidemantic/adapters/tmdl.py:596), [immutable](https://github.com/sidequery/sidemantic/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sidemantic/adapters/tmdl.py#L596-L645); [Sidemantic distinct-count compensation](/workspace/sidemantic/sidemantic/adapters/tmdl.py:1152), [immutable](https://github.com/sidequery/sidemantic/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sidemantic/adapters/tmdl.py#L1152-L1160); [official translation scope](/workspace/ossie-converters-research/microsoft/README.md:422), [immutable](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/microsoft/README.md#L422-L442). +**Import semantics.** sqlctx maps tables/columns/measures/relationships into executable models; stores original DAX, expression language and passthrough syntax; reports unavailable optional `sqlctx_dax`, parse errors, and untranslatable measures. It translates a small native aggregate subset, with a particularly good `DISTINCTCOUNT` SQL compensation preserving BLANK-as-distinct and BLANK-on-empty semantics. Official defaults to DAX-tagged Ossie expressions with no SQL claim; opt-in `--translate-dax` handles exact supported aggregates, DIVIDE, arithmetic with BLANK rules, measure references and VAR/RETURN, preserving original DAX alongside SQL. Neither should be described as translating arbitrary DAX/context semantics. Evidence: [sqlctx import](/workspace/sqlctx/sqlctx/adapters/tmdl.py:596), [immutable](https://github.com/sidequery/sqlctx/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sqlctx/adapters/tmdl.py#L596-L645); [sqlctx distinct-count compensation](/workspace/sqlctx/sqlctx/adapters/tmdl.py:1152), [immutable](https://github.com/sidequery/sqlctx/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sqlctx/adapters/tmdl.py#L1152-L1160); [official translation scope](/workspace/ossie-converters-research/microsoft/README.md:422), [immutable](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/microsoft/README.md#L422-L442). -**Preservation versus portability.** Sidemantic retains graph/model/column/metric TMDL properties, unknown child nodes, comments, raw names and DAX for same-adapter round trips. The loader explicitly merges `_tmdl_` graph attributes. Official has a versioned JSON `POWER_BI` custom-extension stash covering unknown properties, roles, partitions, hierarchies, perspectives, formatting, excluded tables and relationships. Official emits warnings for semantically unrepresented constructs, has CLI `--strict`, and separates structural TOM validation from opt-in real engine validation. Neither preserving roles in a blob nor retaining a TMDL role node means enforcing security in Sidemantic SQL or another Ossie consumer. Evidence: [Sidemantic passthrough](/workspace/sidemantic/sidemantic/adapters/tmdl.py:70), [immutable](https://github.com/sidequery/sidemantic/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sidemantic/adapters/tmdl.py#L70-L149); [official loss policy](/workspace/ossie-converters-research/microsoft/README.md:251), [immutable](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/microsoft/README.md#L251-L290). +**Preservation versus portability.** sqlctx retains graph/model/column/metric TMDL properties, unknown child nodes, comments, raw names and DAX for same-adapter round trips. The loader explicitly merges `_tmdl_` graph attributes. Official has a versioned JSON `POWER_BI` custom-extension stash covering unknown properties, roles, partitions, hierarchies, perspectives, formatting, excluded tables and relationships. Official emits warnings for semantically unrepresented constructs, has CLI `--strict`, and separates structural TOM validation from opt-in real engine validation. Neither preserving roles in a blob nor retaining a TMDL role node means enforcing security in sqlctx SQL or another Ossie consumer. Evidence: [sqlctx passthrough](/workspace/sqlctx/sqlctx/adapters/tmdl.py:70), [immutable](https://github.com/sidequery/sqlctx/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sqlctx/adapters/tmdl.py#L70-L149); [official loss policy](/workspace/ossie-converters-research/microsoft/README.md:251), [immutable](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/microsoft/README.md#L251-L290). -**High-priority Sidemantic export defect, reproduced.** `_metric_to_dax` maps `count_distinct(customer_id)` to `DISTINCTCOUNT(Sales[customer_id])`, adding BLANK to the distinct count, and maps count(flag) to `COUNT(Sales[flag])`, which is unsuitable for boolean columns. Derived `metric.sql` is copied verbatim into DAX; probe `COALESCE(SUM(amount), 0)` remained unqualified SQL-shaped code. Official emits `DISTINCTCOUNTNOBLANK('Sales'[customer_id])` and `COUNTA('Sales'[flag])`, resolves physical versus model identifiers, and warns plus uses annotated BLANK placeholders when translation is unsupported. Fix export semantics and reject/report untranslatable SQL before adding format breadth. Evidence: [Sidemantic export](/workspace/sidemantic/sidemantic/adapters/tmdl.py:2277), [immutable](https://github.com/sidequery/sidemantic/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sidemantic/adapters/tmdl.py#L2277-L2302); [official SQL-to-DAX rules](/workspace/ossie-converters-research/microsoft/src/ossie_microsoft/_sql_to_dax.py:25), [immutable](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/microsoft/src/ossie_microsoft/_sql_to_dax.py#L25-L105). +**High-priority sqlctx export defect, reproduced.** `_metric_to_dax` maps `count_distinct(customer_id)` to `DISTINCTCOUNT(Sales[customer_id])`, adding BLANK to the distinct count, and maps count(flag) to `COUNT(Sales[flag])`, which is unsuitable for boolean columns. Derived `metric.sql` is copied verbatim into DAX; probe `COALESCE(SUM(amount), 0)` remained unqualified SQL-shaped code. Official emits `DISTINCTCOUNTNOBLANK('Sales'[customer_id])` and `COUNTA('Sales'[flag])`, resolves physical versus model identifiers, and warns plus uses annotated BLANK placeholders when translation is unsupported. Fix export semantics and reject/report untranslatable SQL before adding format breadth. Evidence: [sqlctx export](/workspace/sqlctx/sqlctx/adapters/tmdl.py:2277), [immutable](https://github.com/sidequery/sqlctx/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sqlctx/adapters/tmdl.py#L2277-L2302); [official SQL-to-DAX rules](/workspace/ossie-converters-research/microsoft/src/ossie_microsoft/_sql_to_dax.py:25), [immutable](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/microsoft/src/ossie_microsoft/_sql_to_dax.py#L25-L105). ## ThoughtSpot -**Directions/formats.** Sidemantic imports Table, legacy Worksheet, and modern Model TML. Each document becomes its own Sidemantic model; modern model joins can become derived SQL. Export emits only Table or Worksheet TML, including imported modern Models; it has no Model document emitter and no SQL View input branch. Official expects a set containing one modern Model plus its Table/SQL View documents, and emits the corresponding set. Its datasets represent participating Model table instances, so role-playing aliases are distinct datasets. It excludes predecessor Worksheets explicitly. Neither is a simple superset: Sidemantic covers legacy Worksheets and executable SQL, official covers modern document-set reconstruction. Evidence: [Sidemantic dispatch](/workspace/sidemantic/sidemantic/adapters/thoughtspot.py:662), [immutable](https://github.com/sidequery/sidemantic/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sidemantic/adapters/thoughtspot.py#L662-L705); [Sidemantic export dispatch](/workspace/sidemantic/sidemantic/adapters/thoughtspot.py:1539), [immutable](https://github.com/sidequery/sidemantic/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sidemantic/adapters/thoughtspot.py#L1539-L1574); [official mapping](/workspace/ossie-converters-research/thoughtspot/README.md:98), [immutable](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/thoughtspot/README.md#L98-L110). +**Directions/formats.** sqlctx imports Table, legacy Worksheet, and modern Model TML. Each document becomes its own sqlctx model; modern model joins can become derived SQL. Export emits only Table or Worksheet TML, including imported modern Models; it has no Model document emitter and no SQL View input branch. Official expects a set containing one modern Model plus its Table/SQL View documents, and emits the corresponding set. Its datasets represent participating Model table instances, so role-playing aliases are distinct datasets. It excludes predecessor Worksheets explicitly. Neither is a simple superset: sqlctx covers legacy Worksheets and executable SQL, official covers modern document-set reconstruction. Evidence: [sqlctx dispatch](/workspace/sqlctx/sqlctx/adapters/thoughtspot.py:662), [immutable](https://github.com/sidequery/sqlctx/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sqlctx/adapters/thoughtspot.py#L662-L705); [sqlctx export dispatch](/workspace/sqlctx/sqlctx/adapters/thoughtspot.py:1539), [immutable](https://github.com/sidequery/sqlctx/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sqlctx/adapters/thoughtspot.py#L1539-L1574); [official mapping](/workspace/ossie-converters-research/thoughtspot/README.md:98), [immutable](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/thoughtspot/README.md#L98-L110). -**Expression honesty.** Sidemantic rewrites bracket references into SQL and inlines nested formulas, but does not provide a complete ThoughtSpot-language translator or dialect preservation boundary in the native adapter. Official preserves formulas verbatim tagged THOUGHTSPOT and produces ANSI_SQL only for a resolvable bare column reference; reverse expression inventory exists but is explicitly not wired into import. Official export has an Ossie construct catalog (146 constructs, 108 native, 37 opaque warehouse SQL pass-through, one unsupported according to its README), structured issues and explicit fallback. Do not mistake catalog breadth for ThoughtSpot-to-SQL translation coverage. Evidence: [Sidemantic rewrites](/workspace/sidemantic/sidemantic/adapters/thoughtspot.py:121), [immutable](https://github.com/sidequery/sidemantic/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sidemantic/adapters/thoughtspot.py#L121-L161); [official scope](/workspace/ossie-converters-research/thoughtspot/README.md:152), [immutable](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/thoughtspot/README.md#L152-L209). +**Expression honesty.** sqlctx rewrites bracket references into SQL and inlines nested formulas, but does not provide a complete ThoughtSpot-language translator or dialect preservation boundary in the native adapter. Official preserves formulas verbatim tagged THOUGHTSPOT and produces ANSI_SQL only for a resolvable bare column reference; reverse expression inventory exists but is explicitly not wired into import. Official export has an Ossie construct catalog (146 constructs, 108 native, 37 opaque warehouse SQL pass-through, one unsupported according to its README), structured issues and explicit fallback. Do not mistake catalog breadth for ThoughtSpot-to-SQL translation coverage. Evidence: [sqlctx rewrites](/workspace/sqlctx/sqlctx/adapters/thoughtspot.py:121), [immutable](https://github.com/sidequery/sqlctx/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sqlctx/adapters/thoughtspot.py#L121-L161); [official scope](/workspace/ossie-converters-research/thoughtspot/README.md:152), [immutable](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/thoughtspot/README.md#L152-L209). -**Preservation/reliability gap, reproduced.** A Sidemantic table round trip discarded `connection` and `rls_rules`, and changed INT64 to DOUBLE with no adapter loss report. A SQL View document parsed to an empty graph. The native adapter constructs a selected semantic subset rather than stashing the full input. Official carries versioned THOUGHTSPOT vendor payloads, preserves foreign extensions, uses witnesses to avoid replaying stale metadata after edits, and emits structured ERROR for RLS loss. It deliberately drops GUID/obj_id/fqn and reports presentation/predecessor exclusions, so its broad README “lossless” language must be read with the coverage matrix. Priority: structured loss reporting and RLS failure, native Model+SQL View support, data-type/source metadata preservation, and bounded formula translation. Evidence: [Sidemantic field/model subset](/workspace/sidemantic/sidemantic/adapters/thoughtspot.py:763), [immutable](https://github.com/sidequery/sidemantic/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sidemantic/adapters/thoughtspot.py#L763-L801); [type export](/workspace/sidemantic/sidemantic/adapters/thoughtspot.py:1593), [immutable](https://github.com/sidequery/sidemantic/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sidemantic/adapters/thoughtspot.py#L1593-L1605); [official RLS error](/workspace/ossie-converters-research/thoughtspot/src/ossie_thoughtspot/tml_to_ossie.py:1982), [immutable](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/thoughtspot/src/ossie_thoughtspot/tml_to_ossie.py#L1982-L2003); [official exceptions](/workspace/ossie-converters-research/thoughtspot/README.md:220), [immutable](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/thoughtspot/README.md#L220-L227). +**Preservation/reliability gap, reproduced.** A sqlctx table round trip discarded `connection` and `rls_rules`, and changed INT64 to DOUBLE with no adapter loss report. A SQL View document parsed to an empty graph. The native adapter constructs a selected semantic subset rather than stashing the full input. Official carries versioned THOUGHTSPOT vendor payloads, preserves foreign extensions, uses witnesses to avoid replaying stale metadata after edits, and emits structured ERROR for RLS loss. It deliberately drops GUID/obj_id/fqn and reports presentation/predecessor exclusions, so its broad README “lossless” language must be read with the coverage matrix. Priority: structured loss reporting and RLS failure, native Model+SQL View support, data-type/source metadata preservation, and bounded formula translation. Evidence: [sqlctx field/model subset](/workspace/sqlctx/sqlctx/adapters/thoughtspot.py:763), [immutable](https://github.com/sidequery/sqlctx/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sqlctx/adapters/thoughtspot.py#L763-L801); [type export](/workspace/sqlctx/sqlctx/adapters/thoughtspot.py:1593), [immutable](https://github.com/sidequery/sqlctx/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sqlctx/adapters/thoughtspot.py#L1593-L1605); [official RLS error](/workspace/ossie-converters-research/thoughtspot/src/ossie_thoughtspot/tml_to_ossie.py:1982), [immutable](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/thoughtspot/src/ossie_thoughtspot/tml_to_ossie.py#L1982-L2003); [official exceptions](/workspace/ossie-converters-research/thoughtspot/README.md:220), [immutable](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/thoughtspot/README.md#L220-L227). ## GoodData -**Sidemantic is broader in native input shape.** It accepts Cloud LDM, legacy projectModel, wrapped/unwrapped data and SDK snake_case variants; SQL-backed datasets including object-form SQL; old flat sourceColumns and new references.sources; aggregatedFacts; date instances/dimensions. It exports Cloud LDM, carries labels/format/source metadata and unknown per-object extras, and re-emits workspaceDataFilterColumns as metadata. This is not an implementation of workspace security enforcement or MAQL analytical-model metrics. Official consumes a typed declarative `ldm` shape, rejects old sourceColumns, emits fields for facts rather than inventing aggregations, and explicitly does not convert metrics, aggregatedFacts or workspace filters. Its dataclass deserializer also has no SQL-backed-dataset field: a probe discarded SQL, aggregatedFacts and workspaceDataFilterColumns and emitted source `orders`, while Sidemantic retained SQL and both fact/aggregated-fact metrics. Evidence: [Sidemantic payloads](/workspace/sidemantic/sidemantic/adapters/gooddata.py:98), [immutable](https://github.com/sidequery/sidemantic/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sidemantic/adapters/gooddata.py#L98-L172); [Sidemantic export](/workspace/sidemantic/sidemantic/adapters/gooddata.py:724), [immutable](https://github.com/sidequery/sidemantic/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sidemantic/adapters/gooddata.py#L724-L744); [official deserializer](/workspace/ossie-converters-research/gooddata/src/ossie_gooddata/models.py:243), [immutable](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/gooddata/src/ossie_gooddata/models.py#L243-L266); [official limitations](/workspace/ossie-converters-research/gooddata/README.md:101), [immutable](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/gooddata/README.md#L101-L113). +**sqlctx is broader in native input shape.** It accepts Cloud LDM, legacy projectModel, wrapped/unwrapped data and SDK snake_case variants; SQL-backed datasets including object-form SQL; old flat sourceColumns and new references.sources; aggregatedFacts; date instances/dimensions. It exports Cloud LDM, carries labels/format/source metadata and unknown per-object extras, and re-emits workspaceDataFilterColumns as metadata. This is not an implementation of workspace security enforcement or MAQL analytical-model metrics. Official consumes a typed declarative `ldm` shape, rejects old sourceColumns, emits fields for facts rather than inventing aggregations, and explicitly does not convert metrics, aggregatedFacts or workspace filters. Its dataclass deserializer also has no SQL-backed-dataset field: a probe discarded SQL, aggregatedFacts and workspaceDataFilterColumns and emitted source `orders`, while sqlctx retained SQL and both fact/aggregated-fact metrics. Evidence: [sqlctx payloads](/workspace/sqlctx/sqlctx/adapters/gooddata.py:98), [immutable](https://github.com/sidequery/sqlctx/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sqlctx/adapters/gooddata.py#L98-L172); [sqlctx export](/workspace/sqlctx/sqlctx/adapters/gooddata.py:724), [immutable](https://github.com/sidequery/sqlctx/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sqlctx/adapters/gooddata.py#L724-L744); [official deserializer](/workspace/ossie-converters-research/gooddata/src/ossie_gooddata/models.py:243), [immutable](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/gooddata/src/ossie_gooddata/models.py#L243-L266); [official limitations](/workspace/ossie-converters-research/gooddata/README.md:101), [immutable](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/gooddata/README.md#L101-L113). -**Semantic tradeoff and confirmed key defect.** Sidemantic turns numeric facts into default SUM metrics, which is useful for querying but an assumption absent from LDM. Official preserves facts as non-dimension fields with ANSI_SQL and MAQL references and does not imply an aggregate. Sidemantic sets primary_key to only `grain_ids[0]` and ignores explicit reference-source target IDs in query relationships, backfilling the target model's scalar primary key. Probe target grain [a,b], with sources ordered fk_b→b then fk_a→a, yielded foreign_key=[fk_b,fk_a], primary_key='a'. Official emitted exact ordered physical target columns [pk_b,pk_a]. Preserving full grain/source objects in metadata enables same-format reconstruction but does not repair execution semantics. Priority: honor full grain and each source.target mapping; make inferred aggregations explicit; preserve unknown/missing datatypes instead of asserting precision. Evidence: [Sidemantic grain](/workspace/sidemantic/sidemantic/adapters/gooddata.py:167), [immutable](https://github.com/sidequery/sidemantic/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sidemantic/adapters/gooddata.py#L167-L168); [Sidemantic reference](/workspace/sidemantic/sidemantic/adapters/gooddata.py:405), [immutable](https://github.com/sidequery/sidemantic/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sidemantic/adapters/gooddata.py#L405-L435); [Sidemantic backfill](/workspace/sidemantic/sidemantic/adapters/gooddata.py:918), [immutable](https://github.com/sidequery/sidemantic/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sidemantic/adapters/gooddata.py#L918-L925); [official reference resolution](/workspace/ossie-converters-research/gooddata/src/ossie_gooddata/gooddata_to_ossie.py:223), [immutable](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/gooddata/src/ossie_gooddata/gooddata_to_ossie.py#L223-L264). +**Semantic tradeoff and confirmed key defect.** sqlctx turns numeric facts into default SUM metrics, which is useful for querying but an assumption absent from LDM. Official preserves facts as non-dimension fields with ANSI_SQL and MAQL references and does not imply an aggregate. sqlctx sets primary_key to only `grain_ids[0]` and ignores explicit reference-source target IDs in query relationships, backfilling the target model's scalar primary key. Probe target grain [a,b], with sources ordered fk_b→b then fk_a→a, yielded foreign_key=[fk_b,fk_a], primary_key='a'. Official emitted exact ordered physical target columns [pk_b,pk_a]. Preserving full grain/source objects in metadata enables same-format reconstruction but does not repair execution semantics. Priority: honor full grain and each source.target mapping; make inferred aggregations explicit; preserve unknown/missing datatypes instead of asserting precision. Evidence: [sqlctx grain](/workspace/sqlctx/sqlctx/adapters/gooddata.py:167), [immutable](https://github.com/sidequery/sqlctx/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sqlctx/adapters/gooddata.py#L167-L168); [sqlctx reference](/workspace/sqlctx/sqlctx/adapters/gooddata.py:405), [immutable](https://github.com/sidequery/sqlctx/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sqlctx/adapters/gooddata.py#L405-L435); [sqlctx backfill](/workspace/sqlctx/sqlctx/adapters/gooddata.py:918), [immutable](https://github.com/sidequery/sqlctx/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sqlctx/adapters/gooddata.py#L918-L925); [official reference resolution](/workspace/ossie-converters-research/gooddata/src/ossie_gooddata/gooddata_to_ossie.py:223), [immutable](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/gooddata/src/ossie_gooddata/gooddata_to_ossie.py#L223-L264). ## Schema and test boundaries -Official converters emit one root model beside `version: 0.2.0.dev0`, not old semantic_model wrappers. Vendor data is JSON text under custom_extensions; dialect preservation is intentional. Current Sidemantic has a canonical schema-validated Ossie adapter; its `osi.py` opening module text describes legacy behavior, so do not use that docstring to claim current incompatibility. Native private `_tmdl_` attributes or `metadata.gooddata` are not automatically the same contract as official vendor payload schemas. Validate the actual full native→Ossie→native route separately. +Official converters emit one root model beside `version: 0.2.0.dev0`, not old semantic_model wrappers. Vendor data is JSON text under custom_extensions; dialect preservation is intentional. Current sqlctx has a canonical schema-validated Ossie adapter; its `osi.py` opening module text describes legacy behavior, so do not use that docstring to claim current incompatibility. Native private `_tmdl_` attributes or `metadata.gooddata` are not automatically the same contract as official vendor payload schemas. Validate the actual full native→Ossie→native route separately. Commands executed: -- Sidemantic: `uv run --no-sync pytest -q tests/adapters/thoughtspot tests/adapters/gooddata tests/adapters/tmdl`: **183 passed, 29 skipped**, one duplicate-model fixture warning. DAX-dependent cases skipped because optional `sidemantic_dax` is unavailable. Existing tests include real upstream Microsoft fixtures and a focused NULL/empty-set DISTINCTCOUNT suite; no real Power BI engine used. -- Official GoodData: `PYTHONPATH=src uv run --project /workspace/sidemantic --no-sync python -m pytest -q tests --ignore=tests/test_packaging.py --ignore=tests/test_tom_integration.py`: **94 passed**. +- sqlctx: `uv run --no-sync pytest -q tests/adapters/thoughtspot tests/adapters/gooddata tests/adapters/tmdl`: **183 passed, 29 skipped**, one duplicate-model fixture warning. DAX-dependent cases skipped because optional `sqlctx_dax` is unavailable. Existing tests include real upstream Microsoft fixtures and a focused NULL/empty-set DISTINCTCOUNT suite; no real Power BI engine used. +- Official GoodData: `PYTHONPATH=src uv run --project /workspace/sqlctx --no-sync python -m pytest -q tests --ignore=tests/test_packaging.py --ignore=tests/test_tom_integration.py`: **94 passed**. - Official Microsoft: same command in microsoft/: **962 passed, 1 skipped**. Packaging and TOM integration explicitly excluded; neither .NET nor real Fabric deployment exercised. Unit tests for engine APIs are mocks, not engine validation evidence. - Official ThoughtSpot: initial same command failed collection because Hypothesis was absent; retried with `--with hypothesis`. Final result appended below. Unit/property/schema evidence should not be represented as live ThoughtSpot import validation. - Reproduction scripts [BI probes](/workspace/probe-bi-models.py) and [GoodData keys](/workspace/probe-gooddata-keys.py) execute the findings above against both checkouts. They are research artifacts outside product code. -Official ThoughtSpot final command: `PYTHONPATH=src uv run --project /workspace/sidemantic --no-sync --with hypothesis python -m pytest -q tests --ignore=tests/test_packaging.py`: **1,044 passed in 46.50 s**. This includes Hypothesis/property tests; packaging was not run. The temporary `uv --with` environment supplied Hypothesis without changing either repository's dependency files. +Official ThoughtSpot final command: `PYTHONPATH=src uv run --project /workspace/sqlctx --no-sync --with hypothesis python -m pytest -q tests --ignore=tests/test_packaging.py`: **1,044 passed in 46.50 s**. This includes Hypothesis/property tests; packaging was not run. The temporary `uv --with` environment supplied Hypothesis without changing either repository's dependency files. diff --git a/docs/reviews/ossie-converters-2026-11-06/cube-dbt.md b/docs/reviews/ossie-converters-2026-11-06/cube-dbt.md index 7f6cbe45b..434c5ec99 100644 --- a/docs/reviews/ossie-converters-2026-11-06/cube-dbt.md +++ b/docs/reviews/ossie-converters-2026-11-06/cube-dbt.md @@ -2,27 +2,27 @@ ## Pins and method -- Sidemantic: `a7df3c9eae7c1a9a916ebe317ee378408d7d721b` (`https://github.com/sidequery/sidemantic`). Main Python adapters; not Rust. +- sqlctx: `a7df3c9eae7c1a9a916ebe317ee378408d7d721b` (`https://github.com/sidequery/sqlctx`). Main Python adapters; not Rust. - Apache converter: `011ea9f9a1e2c941f351e18e071622339ccae881` (`https://github.com/apache/ossie-converters`). - Its initialized Ossie dependency: `01a5488d840deda309aac68cc0b312c195369b8d`. - Read implementations, tests, fixture assertions, issue handling; ran suites and cross-implementation fixture probes. No product changes. Probe artifacts: `/workspace/probe-cube-dbt.py`, `/workspace/probe-cube-dbt-results.json`, `/workspace/probe-official-dbt.py`, `/workspace/probe-official-dbt-results.json`. ## Central finding -Neither is uniformly more complete. Official Cube is a much stronger **reversible format bridge**, with named extension stashes and stricter refusal/parking of unrepresentable runtime behavior. Sidemantic supports **execution of more modeled concepts** (inheritance, some rolling metrics, row policies, native nonadditive metrics), but its exporters are less faithful than importer comments imply. Official dbt is a **compiled-manifest bridge**, not a source-YAML competitor; it has more principled entity resolution and aggregation expression conversion, but substantial loss and an important current dataset-local metric blind spot. +Neither is uniformly more complete. Official Cube is a much stronger **reversible format bridge**, with named extension stashes and stricter refusal/parking of unrepresentable runtime behavior. sqlctx supports **execution of more modeled concepts** (inheritance, some rolling metrics, row policies, native nonadditive metrics), but its exporters are less faithful than importer comments imply. Official dbt is a **compiled-manifest bridge**, not a source-YAML competitor; it has more principled entity resolution and aggregation expression conversion, but substantial loss and an important current dataset-local metric blind spot. ### Artifact boundaries -| Direction | Sidemantic | Apache Ossie | +| Direction | sqlctx | Apache Ossie | |---|---|---| | Cube import | YAML file/directory → SemanticGraph. YAML only; JS files warned/skipped. Models include expanded Cube views. | Mapping of filenames to YAML text / CLI file or directory → root Ossie YAML document. Normalizes list or keyed collections and camelCase keys. JS/TS/Python/Jinja and nonmodel YAML can be parked verbatim alongside static cubes. | | Cube export | Graph → one YAML file with `cubes:` only. Model-local metrics emitted. Views explicitly skipped. | Root Ossie YAML → map of files, normally `model/cubes/*.yml` and `model/views/*.yml`; prior paths/views/extras restored. | | dbt import | Source YAML: legacy `semantic_models` + measures + `metrics.type_params`, and latest `models[].semantic_model`, column entity/dimension declarations and folded simple metrics. | Actual `semantic_manifest.json`, parsed through MetricFlow semantic interfaces and transformed before conversion. | | dbt export | Graph → **legacy source YAML only**, lowering latest folded measures to model measures. | Ossie document → JSON `PydanticSemanticManifest`, with metric aggregation params on metrics and `measures=[]`. Not a deployable dbt source project. | -Source links: [ours Cube parse/export](https://github.com/sidequery/sidemantic/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sidemantic/adapters/cube.py#L283), [ours MetricFlow parsing](https://github.com/sidequery/sidemantic/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sidemantic/adapters/metricflow.py#L97), [ours MetricFlow export](https://github.com/sidequery/sidemantic/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sidemantic/adapters/metricflow.py#L932), [official Cube input](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/cube/src/ossie_cube/cube_to_ossie.py#L132), [official Cube output](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/cube/src/ossie_cube/ossie_to_cube.py#L101), [official dbt CLI](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/dbt/src/ossie_dbt/cli.py#L85). +Source links: [ours Cube parse/export](https://github.com/sidequery/sqlctx/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sqlctx/adapters/cube.py#L283), [ours MetricFlow parsing](https://github.com/sidequery/sqlctx/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sqlctx/adapters/metricflow.py#L97), [ours MetricFlow export](https://github.com/sidequery/sqlctx/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sqlctx/adapters/metricflow.py#L932), [official Cube input](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/cube/src/ossie_cube/cube_to_ossie.py#L132), [official Cube output](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/cube/src/ossie_cube/ossie_to_cube.py#L101), [official dbt CLI](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/dbt/src/ossie_dbt/cli.py#L85). -Local anchors: `/workspace/sidemantic/sidemantic/adapters/cube.py:283`, `:1504`; `/workspace/sidemantic/sidemantic/adapters/metricflow.py:97`, `:932`; `/workspace/ossie-converters-research/dbt/src/ossie_dbt/cli.py:85`. +Local anchors: `/workspace/sqlctx/sqlctx/adapters/cube.py:283`, `:1504`; `/workspace/sqlctx/sqlctx/adapters/metricflow.py:97`, `:932`; `/workspace/ossie-converters-research/dbt/src/ossie_dbt/cli.py:85`. ## Cube: meaningful differences @@ -31,21 +31,21 @@ Local anchors: `/workspace/sidemantic/sidemantic/adapters/cube.py:283`, `:1504`; 1. **Preservation is systematic.** Unmapped cube/dimension/measure properties go into `custom_extensions` vendor `CUBE` JSON stashes, including views and original files. Foreign Ossie extensions, AI context, unique keys, and original expressions park under Cube `meta.ossie` for the reverse direction. This is much broader than ours' hand-selected `meta.cube_internal` fields. The feature fixture roundtrip comparison normalizes only equivalent `{CUBE}.column` / bare-column SQL spelling, not arbitrary semantics. All ten official feature fixtures roundtripped in the probe. 2. **Views survive the format roundtrip.** Ordinary import preserves view curation as extensions; `--project --view` instead exposes a selected public surface and reports dropped projection properties. Our importer expands views to graph models, but exporter explicitly skips them. The official `view_curation.yml` imported as ours `orders, users, sales`, and exported only `orders, users`, with no warning. 3. **Unrepresentable execution is kept out of native metrics.** Official rolling windows, multi_stage/group_by/time_shift/rank, measure references nested in aggregates, and nonstatic dependent measures are parked, with structured issues. `sub_query` and switch dimensions similarly stay out of ordinary fields. Our rank is an explicitly warned COUNT fallback, and multi-stage measures remain queryable using simplified SQL, with warnings. -4. **Fanout visibility.** Official reports `FANOUT_UNSAFE_METRIC` and optionally refuses with `--strict-fanout`; it explicitly distinguishes irreversible loss, inert parked values and approximations. This is not a full SQL execution solution: static Ossie SQL cannot recreate Cube query-time deduplication. Sidemantic's execution engine may handle fanout itself; compare query planning separately from the importer's field mapping. +4. **Fanout visibility.** Official reports `FANOUT_UNSAFE_METRIC` and optionally refuses with `--strict-fanout`; it explicitly distinguishes irreversible loss, inert parked values and approximations. This is not a full SQL execution solution: static Ossie SQL cannot recreate Cube query-time deduplication. sqlctx's execution engine may handle fanout itself; compare query planning separately from the importer's field mapping. 5. **Dynamic CASE labels work.** Official `conditional_dimensions.yml` includes a CASE label mapping containing SQL. Official converts and roundtrips it. Ours crashes at `.replace()` on a dict (`cube.py:743` / `:747`). This is a concrete supported input shape missing in ours, not merely a metadata gap. -Evidence: [official collection/normalization](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/cube/src/ossie_cube/cube_to_ossie.py#L270), [native keys vs stash](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/cube/src/ossie_cube/cube_to_ossie.py#L98), [parking nonstatic measures](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/cube/src/ossie_cube/cube_to_ossie.py#L1444), [issue taxonomy](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/cube/src/ossie_cube/converter_issues.py#L35), [feature contract](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/cube/tests/test_feature_matrix.py#L18), [ours dynamic label bug](https://github.com/sidequery/sidemantic/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sidemantic/adapters/cube.py#L735). +Evidence: [official collection/normalization](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/cube/src/ossie_cube/cube_to_ossie.py#L270), [native keys vs stash](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/cube/src/ossie_cube/cube_to_ossie.py#L98), [parking nonstatic measures](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/cube/src/ossie_cube/cube_to_ossie.py#L1444), [issue taxonomy](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/cube/src/ossie_cube/converter_issues.py#L35), [feature contract](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/cube/tests/test_feature_matrix.py#L18), [ours dynamic label bug](https://github.com/sidequery/sqlctx/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sqlctx/adapters/cube.py#L735). -Local anchors: `/workspace/ossie-converters-research/cube/src/ossie_cube/cube_to_ossie.py:98`, `:270`, `:1444`; `/workspace/ossie-converters-research/cube/tests/test_feature_matrix.py:18`; `/workspace/sidemantic/sidemantic/adapters/cube.py:735`. +Local anchors: `/workspace/ossie-converters-research/cube/src/ossie_cube/cube_to_ossie.py:98`, `:270`, `:1444`; `/workspace/ossie-converters-research/cube/tests/test_feature_matrix.py:18`; `/workspace/sqlctx/sqlctx/adapters/cube.py:735`. -### Sidemantic strengths and official limits +### sqlctx strengths and official limits - Ours resolves cube inheritance and inherited hierarchies plus view inheritance (`cube.py:325-383`). Official **rejects cube `extends` outright**, requiring flattening (`cube_to_ossie.py:304`). Official view curation may be preserved losslessly without being executed/projected. - Ours maps supported Cube row-level `access_policy` filters into `SecurityPolicy` and native segments/preaggregations/hierarchy parents. Official preserves these mostly as extension data, so another Ossie consumer does not automatically enforce a Cube access policy or execute preaggregations. Neither metadata preservation nor a clean roundtrip means runtime enforcement. - Ours models trailing/to-date rolling windows and some period comparisons natively; official preserves them but excludes them from static metrics. Ours leading/offset still inert; many complex time_shift cases do not translate. - Official refuses duplicate member names, bad joins and unknown aggregate types; ours accepts some unknown dimensions as categorical and unknown measures as COUNT with fidelity notes. Stricter rejection can block a whole conversion; it also prevents silently invented meaning. -Links: [ours inheritance](https://github.com/sidequery/sidemantic/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sidemantic/adapters/cube.py#L325), [ours policies](https://github.com/sidequery/sidemantic/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sidemantic/adapters/cube.py#L220), [official extends rejection](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/cube/src/ossie_cube/cube_to_ossie.py#L304). +Links: [ours inheritance](https://github.com/sidequery/sqlctx/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sqlctx/adapters/cube.py#L325), [ours policies](https://github.com/sidequery/sqlctx/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sqlctx/adapters/cube.py#L220), [official extends rejection](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/cube/src/ossie_cube/cube_to_ossie.py#L304). ### Ours export fidelity defects beyond views @@ -59,7 +59,7 @@ Confirmed against official feature fixtures: These are more consequential than key order or SQL normalization. Ours does correctly restore selected `cube_internal` fields such as geo latitude/longitude, sub_query, rank properties, governance flags, and rolling leading/offset. Do not characterize all its meta handling as absent. -Evidence: [ours granularities import](https://github.com/sidequery/sidemantic/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sidemantic/adapters/cube.py#L801), [ours multi-stage meta](https://github.com/sidequery/sidemantic/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sidemantic/adapters/cube.py#L1078), [ours export](https://github.com/sidequery/sidemantic/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sidemantic/adapters/cube.py#L1504). +Evidence: [ours granularities import](https://github.com/sidequery/sqlctx/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sqlctx/adapters/cube.py#L801), [ours multi-stage meta](https://github.com/sidequery/sqlctx/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sqlctx/adapters/cube.py#L1078), [ours export](https://github.com/sidequery/sqlctx/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sqlctx/adapters/cube.py#L1504). ## dbt/MetricFlow: meaningful differences @@ -71,7 +71,7 @@ Evidence: [ours granularities import](https://github.com/sidequery/sidemantic/bl - Official produces structured issues for dropped conversion/private metrics, natural entities, nonportable time-spine/fill/offset dependencies, ambiguous references, and unresolved row-count ownership. Cumulative metrics are retained as base aggregate with `CUMULATIVE_SEMANTICS_LOSS`; this is explicitly lossy. - Reverse direction parses SQL ASTs to recover simple aggregations and ratios, with generated submetric collision handling. It can handle compound scalar operands and percentile parameters, and refuses complex aggregate combinations it cannot express safely. -Evidence: [official manifest conversion](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/dbt/src/ossie_dbt/msi_to_ossie.py#L146), [official entity index](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/dbt/src/ossie_dbt/msi_to_ossie.py#L534), [official aggregation](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/dbt/src/ossie_dbt/msi_to_ossie.py#L616), [reverse AST conversion](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/dbt/src/ossie_dbt/ossie_to_msi.py#L338), [ours entity heuristic](https://github.com/sidequery/sidemantic/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sidemantic/adapters/metricflow.py#L1230). +Evidence: [official manifest conversion](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/dbt/src/ossie_dbt/msi_to_ossie.py#L146), [official entity index](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/dbt/src/ossie_dbt/msi_to_ossie.py#L534), [official aggregation](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/dbt/src/ossie_dbt/msi_to_ossie.py#L616), [reverse AST conversion](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/dbt/src/ossie_dbt/ossie_to_msi.py#L338), [ours entity heuristic](https://github.com/sidequery/sqlctx/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sqlctx/adapters/metricflow.py#L1230). ### Ours strengths and official limits @@ -82,17 +82,17 @@ Evidence: [official manifest conversion](https://github.com/apache/ossie-convert - Official filter Jinja support is best-effort: e.g. `Dimension('order__status')` becomes the token `order__status`, **not an actually resolved warehouse column**; source comments explicitly leave this resolution to consumers. Thus valid-looking generated SQL can still need downstream semantic resolution. - Official reverse drops expressions such as `SUM(a)+SUM(b)` instead of producing general derived metrics; it rejects composite keys. Its result is not guaranteed a fully usable dbt project with model files, calendar/time spine and validation defaults. -Links: [ours nonadditive](https://github.com/sidequery/sidemantic/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sidemantic/adapters/metricflow.py#L606), [official default DAY / discarded params](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/dbt/src/ossie_dbt/ossie_to_msi.py#L106), [official filter resolution limitation](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/dbt/src/ossie_dbt/filter_utils.py#L133). +Links: [ours nonadditive](https://github.com/sidequery/sqlctx/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sqlctx/adapters/metricflow.py#L606), [official default DAY / discarded params](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/dbt/src/ossie_dbt/ossie_to_msi.py#L106), [official filter resolution limitation](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/dbt/src/ossie_dbt/filter_utils.py#L133). ### Ours export gaps verified from source and probes - `graph.metadata.saved_queries` and `metricflow_conversion_metrics` are never emitted by MetricFlow export, despite comments describing roundtripping. A probe with both lost both on export. Retained on import is not roundtrip support. - Cumulative export only writes window; it omits base/input measure, grain_to_date and period_agg. Probe `revenue_7d` emitted only `type:cumulative, type_params.cumulative_type_params.window:7 days`. - Derived export recomputes dependencies and omits stored input aliases, input filters and offsets; preservation in `metric.metadata.input_metrics` is not enough. Offset/filtered aliases remain registered in a graph metric despite lacking a proper executable equivalent. -- Model table export discards catalog/schema and writes `ref(last_component)`. Model SQL is emitted as a Sidemantic-supported `sql` extension rather than native dbt semantic-model source `model`. Dimension exporter writes internal dimension types directly, so numeric/boolean graph dimensions from another adapter are not converted to MetricFlow categorical types. Latest folded aggregate lowering writes internal `avg`, unlike regular measure export's `average` mapping. +- Model table export discards catalog/schema and writes `ref(last_component)`. Model SQL is emitted as a sqlctx-supported `sql` extension rather than native dbt semantic-model source `model`. Dimension exporter writes internal dimension types directly, so numeric/boolean graph dimensions from another adapter are not converted to MetricFlow categorical types. Latest folded aggregate lowering writes internal `avg`, unlike regular measure export's `average` mapping. - Relationship resolution/export and field-level opaque metadata need dedicated fidelity coverage, beyond existing roundtrip tests that explicitly disable relationship/table-schema comparison. -Links: [ours export body](https://github.com/sidequery/sidemantic/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sidemantic/adapters/metricflow.py#L932), [ours metric export](https://github.com/sidequery/sidemantic/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sidemantic/adapters/metricflow.py#L1154), [current roundtrip-test limits](https://github.com/sidequery/sidemantic/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/tests/adapters/metricflow/test_roundtrip.py#L57). +Links: [ours export body](https://github.com/sidequery/sqlctx/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sqlctx/adapters/metricflow.py#L932), [ours metric export](https://github.com/sidequery/sqlctx/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sqlctx/adapters/metricflow.py#L1154), [current roundtrip-test limits](https://github.com/sidequery/sqlctx/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/tests/adapters/metricflow/test_roundtrip.py#L57). ## Current schema interoperability: critical shared official defect @@ -101,7 +101,7 @@ Both official exporters still read **only root/model `metrics`**, although the p - official dbt: zero output metrics, **zero issues**; - official Cube: no output measures, no metric-loss issue (only an unrelated missing-datatype approximation on the field). -This makes newer Sidemantic Ossie output with dataset-local metrics incompatible with these official spokes unless hoisted or fixed. It is an observed current bug, not stale issue wording. Cube's `version` check is exact `0.2.0.dev0`; official dbt's Pydantic model validates against its pinned schema, so version equality alone does not prove feature compatibility. +This makes newer sqlctx Ossie output with dataset-local metrics incompatible with these official spokes unless hoisted or fixed. It is an observed current bug, not stale issue wording. Cube's `version` check is exact `0.2.0.dev0`; official dbt's Pydantic model validates against its pinned schema, so version equality alone does not prove feature compatibility. Evidence: [official Cube root-metric loops](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/cube/src/ossie_cube/ossie_to_cube.py#L1038), [official dbt root-metric loop](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/dbt/src/ossie_dbt/ossie_to_msi.py#L300). Local `/workspace/ossie-converters-research/cube/src/ossie_cube/ossie_to_cube.py:1054`, `:1079`; `/workspace/ossie-converters-research/dbt/src/ossie_dbt/ossie_to_msi.py:304`. @@ -109,7 +109,7 @@ Dialect caveat: upstream issue wording about selecting the first expression is n ## Priorities -1. **P0 interoperability:** support/fix dataset-local metrics in both official spokes (or add an explicit Sidemantic compatibility lowering option). Add an end-to-end fixture based on current Sidemantic Ossie export, not only handcrafted root metrics. +1. **P0 interoperability:** support/fix dataset-local metrics in both official spokes (or add an explicit sqlctx compatibility lowering option). Add an end-to-end fixture based on current sqlctx Ossie export, not only handcrafted root metrics. 2. **P1 ours correctness:** dynamic CASE SQL-label input; export cumulative base/grain/period parameters; use an entity-name index; ensure unsupported rank/multi-stage concepts cannot accidentally look equivalent to runnable metrics. 3. **P1 ours roundtrip:** emit saved queries/conversion metadata and derived modifiers; restore Cube view definitions, hierarchies, granularities and multi-stage properties at correct schema locations. Consider a generic versioned adapter stash rather than an expanding list of special cases. Distinguish executable mappings, inert preservation and loss in machine-readable reports in both directions. 4. **P1 official correctness:** report/preserve semiadditive semantics rather than flatten with zero issue; preserve/issue saved query and metadata loss; fix dataset metrics before adding more connectors. @@ -117,9 +117,9 @@ Dialect caveat: upstream issue wording about selecting the first expression is n ## Validation performed -- `uv run pytest -q tests/adapters/cube tests/adapters/metricflow` in Sidemantic: **482 passed, 322 warnings**, 17.73s. +- `uv run pytest -q tests/adapters/cube tests/adapters/metricflow` in sqlctx: **482 passed, 322 warnings**, 17.73s. - `uv run pytest -q` in official dbt: **317 passed**, five snapshots passed, 4.72s. - `uv run pytest -q` in official Cube: **1191 passed, 52 skipped**, 123.39s. Cube compiler is not installed/configured; no claim of compiler validation in this environment. Focused `uv run pytest -q -rs tests/test_feature_matrix.py` after core initialization: **43 passed, 10 skipped**; all ten skips explicitly require a built Cube checkout via OSSIE_CUBE_REPO. Schema validation passed in that focused run. - Cross-fixture script: six official Cube fixtures tested through both import/export paths; direct canonical check of **all ten** official feature fixtures passed official roundtrip. Initial raw-equality booleans in JSON are false on two official fixtures only due to documented `{CUBE}.column` normalization; do not count these as losses. - Direct probes confirmed ours metadata/cumulative/entity and source-relation gaps, official saved-query/nonadditive losses, and both official dataset-local metric omissions. -- No product code or committed tests changed. Full Sidemantic suite, live dbt execution and actual Cube compiler checks were not run. +- No product code or committed tests changed. Full sqlctx suite, live dbt execution and actual Cube compiler checks were not run. diff --git a/docs/reviews/ossie-converters-2026-11-06/interop.md b/docs/reviews/ossie-converters-2026-11-06/interop.md index fe95cb4e3..f2b3a7e19 100644 --- a/docs/reviews/ossie-converters-2026-11-06/interop.md +++ b/docs/reviews/ossie-converters-2026-11-06/interop.md @@ -1,19 +1,19 @@ # Interoperability and format coverage research -Research date 2026-11-06. No product changes. Sidemantic checkout `a7df3c9eae7c1a9a916ebe317ee378408d7d721b`; official apache/ossie-converters `011ea9f9a1e2c941f351e18e071622339ccae881`; official Ossie submodule `01a5488d840deda309aac68cc0b312c195369b8d`. +Research date 2026-11-06. No product changes. sqlctx checkout `a7df3c9eae7c1a9a916ebe317ee378408d7d721b`; official apache/ossie-converters `011ea9f9a1e2c941f351e18e071622339ccae881`; official Ossie submodule `01a5488d840deda309aac68cc0b312c195369b8d`. ## Conclusions -1. Sidemantic has **20 registered import formats, 17 export formats**. These count Ossie and Sidemantic itself. Three formats are import-only: Graphene, Tableau XML/archive formats, Yardstick. A registered exporter is a graph serializer, not proof that all native semantics survive a pairwise conversion. Registry: `/workspace/sidemantic/sidemantic/formats.py:72-224`, [pinned source](https://github.com/sidequery/sidemantic/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sidemantic/formats.py#L72). +1. sqlctx has **20 registered import formats, 17 export formats**. These count Ossie and sqlctx itself. Three formats are import-only: Graphene, Tableau XML/archive formats, Yardstick. A registered exporter is a graph serializer, not proof that all native semantics survive a pairwise conversion. Registry: `/workspace/sqlctx/sqlctx/formats.py:72-224`, [pinned source](https://github.com/sidequery/sqlctx/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sqlctx/formats.py#L72). 2. **LookML is present upstream**, under `bigquery`, export-only. Do not count it among wholly absent formats. Official `native_format: lookml` and `import: null`: `/workspace/ossie-converters-research/interop/manifest.yaml:23-32`, [pinned](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/interop/manifest.yaml#L23). Our LookML import/export is an additional direction. -3. Current default Sidemantic synthesis interoperates for a simple native SUM model: official schema+semantic validator passes, BigQuery/LookML, Omni, and Cube exporters retain the revenue measure. **Do not claim the different Ossie pins make all output incompatible.** -4. Imported **dataset-scoped metrics** are a real silent-loss boundary: Sidemantic preserves their scope on graph re-export; the official validator accepts it; official Cube and Omni drop the measure. BigQuery retains it. This is narrower than “Sidemantic always emits dataset metrics”: synthesis emits them only when metadata `ossie_dataset_metric` is true (usually from Ossie import), not for ordinary native model metrics. `/workspace/sidemantic/sidemantic/interchange/ossie/synthesis.py:815-849`, [pinned](https://github.com/sidequery/sidemantic/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sidemantic/interchange/ossie/synthesis.py#L815). Official Cube reads only `model.get("metrics")` in `_build_measures` (`cube/src/ossie_cube/ossie_to_cube.py:1054,1079`), Omni likewise (`omni/src/ossie_omni/ossie_to_omni.py:192`). -5. **Preserved-document roundtrip and generic conversion are different contracts.** `OssieAdapter.parse_document` + `export_document(exact_source=True)` can preserve source bytes, opaque extensions, and AI context. Generic `convert` loads a runtime `SemanticGraph`, then synthesizes; probe shows foreign `custom_extensions` and root `ai_context` disappear even on Ossie→Ossie. `/workspace/sidemantic/sidemantic/formats.py:302-321`, [pinned](https://github.com/sidequery/sidemantic/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sidemantic/formats.py#L302); document API `/workspace/sidemantic/sidemantic/adapters/ossie.py:189-218`, [pinned](https://github.com/sidequery/sidemantic/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sidemantic/adapters/ossie.py#L189). -6. **Portable output is opt-in enforcement.** An invariant filter causes default synthesis to store the executable graph in `SIDEMANTIC` extension and expose an empty sentinel dataset. Official BigQuery/Omni export succeeds, but exports only that empty dataset and warns that extension is dropped. This is a deliberate fail-safe, not successful functional conversion. `--ossie-portable-only` rejects the export. `/workspace/sidemantic/sidemantic/interchange/ossie/synthesis.py:933-969`, [pinned](https://github.com/sidequery/sidemantic/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sidemantic/interchange/ossie/synthesis.py#L933). +3. Current default sqlctx synthesis interoperates for a simple native SUM model: official schema+semantic validator passes, BigQuery/LookML, Omni, and Cube exporters retain the revenue measure. **Do not claim the different Ossie pins make all output incompatible.** +4. Imported **dataset-scoped metrics** are a real silent-loss boundary: sqlctx preserves their scope on graph re-export; the official validator accepts it; official Cube and Omni drop the measure. BigQuery retains it. This is narrower than “sqlctx always emits dataset metrics”: synthesis emits them only when metadata `ossie_dataset_metric` is true (usually from Ossie import), not for ordinary native model metrics. `/workspace/sqlctx/sidemantic/interchange/ossie/synthesis.py:815-849`, [pinned](https://github.com/sidequery/sqlctx/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sidemantic/interchange/ossie/synthesis.py#L815). Official Cube reads only `model.get("metrics")` in `_build_measures` (`cube/src/ossie_cube/ossie_to_cube.py:1054,1079`), Omni likewise (`omni/src/ossie_omni/ossie_to_omni.py:192`). +5. **Preserved-document roundtrip and generic conversion are different contracts.** `OssieAdapter.parse_document` + `export_document(exact_source=True)` can preserve source bytes, opaque extensions, and AI context. Generic `convert` loads a runtime `SemanticGraph`, then synthesizes; probe shows foreign `custom_extensions` and root `ai_context` disappear even on Ossie→Ossie. `/workspace/sqlctx/sqlctx/formats.py:302-321`, [pinned](https://github.com/sidequery/sqlctx/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sqlctx/formats.py#L302); document API `/workspace/sqlctx/sqlctx/adapters/ossie.py:189-218`, [pinned](https://github.com/sidequery/sqlctx/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sqlctx/adapters/ossie.py#L189). +6. **Portable output is opt-in enforcement.** An invariant filter causes default synthesis to store the executable graph in `SQLCTX` extension and expose an empty sentinel dataset. Official BigQuery/Omni export succeeds, but exports only that empty dataset and warns that extension is dropped. This is a deliberate fail-safe, not successful functional conversion. `--ossie-portable-only` rejects the export. `/workspace/sqlctx/sidemantic/interchange/ossie/synthesis.py:933-969`, [pinned](https://github.com/sidequery/sqlctx/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sidemantic/interchange/ossie/synthesis.py#L933). ## Added coverage beyond official projects -| Sidemantic format | Directions | Concrete boundary | Official equivalent | +| sqlctx format | Directions | Concrete boundary | Official equivalent | |---|---|---|---| | AtScale SML | import/export | YAML files/project → graph; directory export | No registered spoke | | BSL | import/export | Boring Semantic Layer YAML/Ibis expressions | No registered spoke | @@ -24,15 +24,15 @@ Research date 2026-11-06. No product changes. Sidemantic checkout `a7df3c9eae7c1 | Tableau | import only | `.tds/.twb/.tdsx/.twbx` data sources/workbooks | Official Salesforce semantic model JSON is a different boundary; do not equate it with Tableau XML | | Yardstick | import only | SQL CREATE VIEW with `AGG(expr) AS MEASURE name` | No registered spoke | | LookML | import/export | `.lkml` model/view language | Official `bigquery` exports LookML; has no importer | -| Sidemantic | import/export | native YAML/SQL | Sidemantic-only runtime interchange | +| sqlctx | import/export | native YAML/SQL | sqlctx-only runtime interchange | -Evidence: central registry above; BSL `/workspace/sidemantic/sidemantic/adapters/bsl.py:1-10,38-64`; Graphene `adapters/graphene.py:128-139`; Yardstick `adapters/yardstick.py:77-81`; Tableau `adapters/tableau.py:1026-1038`; Malloy `adapters/malloy.py:3308-3327`. All under [pinned adapters tree](https://github.com/sidequery/sidemantic/tree/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sidemantic/adapters). Absence evidence is complete official 23-project manifest, not a text search alone. +Evidence: central registry above; BSL `/workspace/sqlctx/sqlctx/adapters/bsl.py:1-10,38-64`; Graphene `adapters/graphene.py:128-139`; Yardstick `adapters/yardstick.py:77-81`; Tableau `adapters/tableau.py:1026-1038`; Malloy `adapters/malloy.py:3308-3327`. All under [pinned adapters tree](https://github.com/sidequery/sqlctx/tree/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sqlctx/adapters). Absence evidence is complete official 23-project manifest, not a text search alone. -**Runtime support is separate:** Sidemantic's BigQuery/Databricks/Snowflake/Postgres/etc database adapters establish where Sidemantic SQL executes. They do not establish a BigQuery LookML or Databricks Metric View converter. `/workspace/sidemantic/sidemantic/db/__init__.py:8-41`, [pinned](https://github.com/sidequery/sidemantic/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sidemantic/db/__init__.py#L8). The semantic format registry has `lookml` but no `bigquery` format, and no `databricks` Metric View format. +**Runtime support is separate:** sqlctx's BigQuery/Databricks/Snowflake/Postgres/etc database adapters establish where sqlctx SQL executes. They do not establish a BigQuery LookML or Databricks Metric View converter. `/workspace/sqlctx/sqlctx/db/__init__.py:8-41`, [pinned](https://github.com/sidequery/sqlctx/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sqlctx/db/__init__.py#L8). The semantic format registry has `lookml` but no `bigquery` format, and no `databricks` Metric View format. ## Schema versions and real compatibility limits -Ours supports upstream `0.1.1`, legacy wrapped `0.2.0.dev0` at `831f48e`, flat draft at `b6c702e`, and latest flat draft at `172a3e5`; dbt consumer profile also permits `0.1.0` as an explicit compatibility alias, not upstream schema version. `/workspace/sidemantic/sidemantic/interchange/ossie/profiles.py:8-10,89-176`, [pinned](https://github.com/sidequery/sidemantic/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sidemantic/interchange/ossie/profiles.py#L89). Shape autodetection chooses pins; flat alone does not distinguish all revisions (`validation.py:282-340`). Export defaults to latest `172a3e5` (`adapters/ossie.py:246-254`). +Ours supports upstream `0.1.1`, legacy wrapped `0.2.0.dev0` at `831f48e`, flat draft at `b6c702e`, and latest flat draft at `172a3e5`; dbt consumer profile also permits `0.1.0` as an explicit compatibility alias, not upstream schema version. `/workspace/sqlctx/sidemantic/interchange/ossie/profiles.py:8-10,89-176`, [pinned](https://github.com/sidequery/sqlctx/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sidemantic/interchange/ossie/profiles.py#L89). Shape autodetection chooses pins; flat alone does not distinguish all revisions (`validation.py:282-340`). Export defaults to latest `172a3e5` (`adapters/ossie.py:246-254`). Official converters document flat `0.2.0.dev0`, one model per document; reject old wrappers; official harness uses submodule `01a5488` schema and semantic validator (`interop/checks.py:32-58`). README [pinned](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/README.md#L49), validator [pinned](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/interop/checks.py#L32). @@ -43,7 +43,7 @@ JSON-normalized diff between ours latest vendored core schema and official submo - Ours describes dataset metrics as able to use `source.column`; official prohibits references to undeclared raw source fields and qualified dataset-metric references in semantic validation. - Other differences include minimum string lengths and extension description wording. Both already have flat root, datatypes, dataset metrics. -Schema evidence: [ours pinned latest](https://github.com/sidequery/sidemantic/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sidemantic/interchange/ossie/schemas/logical/0.2.0.dev0-172a3e5/schema.json), [official pinned core](https://github.com/apache/ossie/blob/01a5488d840deda309aac68cc0b312c195369b8d/core-spec/ossie-schema.json), [official scoped metric validation](https://github.com/apache/ossie/blob/01a5488d840deda309aac68cc0b312c195369b8d/validation/validate.py#L481). +Schema evidence: [ours pinned latest](https://github.com/sidequery/sqlctx/blob/a7df3c9eae7c1a9a916ebe317ee378408d7d721b/sidemantic/interchange/ossie/schemas/logical/0.2.0.dev0-172a3e5/schema.json), [official pinned core](https://github.com/apache/ossie/blob/01a5488d840deda309aac68cc0b312c195369b8d/core-spec/ossie-schema.json), [official scoped metric validation](https://github.com/apache/ossie/blob/01a5488d840deda309aac68cc0b312c195369b8d/validation/validate.py#L481). Crucial caveat: ours graph synthesis emits `dialects`, not `sql`, and supports four explicit synthesis SQL labels (`ANSI_SQL`, `BIGQUERY`, `DATABRICKS`, `SNOWFLAKE`), so ordinary synthesized output avoids the first two mismatch classes (`synthesis.py:43-44,93-94`). Preserved latest documents can still expose those mismatches. Probe `expression-sql` gets six official schema errors and BigQuery “Missing expression for Field 'orders.id'”. @@ -59,26 +59,26 @@ All 10 official `interop/fixtures/contracts/*/input.yaml` plus official TPC-DS a ## Reproducible outbound probes and commands -Research script: `/workspace/interop-probes.py`. Full output: `/workspace/interop-probe-output/results.txt`. Inputs, serialized outputs and native exports saved alongside. Uses actual official converter functions loaded from their source directories in the Sidemantic environment; no live vendor compilation/warehouse execution claimed. Installed environment supplies PyYAML/sqlglot/jsonschema dependencies. Research run does not run each spoke's locked unit suite. +Research script: `/workspace/interop-probes.py`. Full output: `/workspace/interop-probe-output/results.txt`. Inputs, serialized outputs and native exports saved alongside. Uses actual official converter functions loaded from their source directories in the sqlctx environment; no live vendor compilation/warehouse execution claimed. Installed environment supplies PyYAML/sqlglot/jsonschema dependencies. Research run does not run each spoke's locked unit suite. ```bash -cd /workspace/sidemantic +cd /workspace/sqlctx uv run --no-sync python /workspace/interop-probes.py -uv run --no-sync sidemantic convert /workspace/ossie-converters-research/interop/fixtures/contracts/keys-single/input.yaml --from ossie --to ossie --ossie-scope orders_model --ossie-expression-dialect ANSI_SQL --ossie-portable-only --output /workspace/interop-probe-output/cli-keys-roundtrip.yaml -uv run --no-sync sidemantic convert /workspace/interop-probe-output/dataset-metric.yaml --from ossie --to ossie --ossie-scope sales --ossie-expression-dialect ANSI_SQL --ossie-portable-only --output /workspace/interop-probe-output/cli-dataset-metric.yaml +uv run --no-sync sqlctx convert /workspace/ossie-converters-research/interop/fixtures/contracts/keys-single/input.yaml --from ossie --to ossie --ossie-scope orders_model --ossie-expression-dialect ANSI_SQL --ossie-portable-only --output /workspace/interop-probe-output/cli-keys-roundtrip.yaml +uv run --no-sync sqlctx convert /workspace/interop-probe-output/dataset-metric.yaml --from ossie --to ossie --ossie-scope sales --ossie-expression-dialect ANSI_SQL --ossie-portable-only --output /workspace/interop-probe-output/cli-dataset-metric.yaml ``` Both CLI conversions exit 0, report one converted model and all recognized import constructs translated. Existing output requires fresh path or `--force` when rerunning. Probe script exits 0. | Probe | Actual result | |---|---| -| Native orders(id,amount), SUM(amount) → Sidemantic default latest core | Schema-valid under official validator; root metric retained by official BigQuery, Omni, Cube | -| That core → official LookML → Sidemantic LookML import | orders table `analytics.orders`, metric revenue agg=sum SQL `({model}.amount)` retained | -| Dataset metric → Sidemantic import/export → official validator/Cube | Official validator accepts; Sidemantic preserves one dataset metric; Cube emits no measures and no dropped-metric diagnostic (only untyped-field approximations) | +| Native orders(id,amount), SUM(amount) → sqlctx default latest core | Schema-valid under official validator; root metric retained by official BigQuery, Omni, Cube | +| That core → official LookML → sqlctx LookML import | orders table `analytics.orders`, metric revenue agg=sum SQL `({model}.amount)` retained | +| Dataset metric → sqlctx import/export → official validator/Cube | Official validator accepts; sqlctx preserves one dataset metric; Cube emits no measures and no dropped-metric diagnostic (only untyped-field approximations) | | Dataset metric → official Omni | No measures; no warnings | | Dataset metric → official BigQuery | `measure: revenue` retained with SUM | | expression.sql-only core → official validator/BigQuery | Rejected schema, exporter missing expression | -| Model invariant filter → default Sidemantic Ossie | Explicit runtime-extension warning; empty core sentinel; BigQuery and Omni convert sentinel and drop foreign extension | +| Model invariant filter → default sqlctx Ossie | Explicit runtime-extension warning; empty core sentinel; BigQuery and Omni convert sentinel and drop foreign extension | | Same invariant filter with portable_only=True | OssieSynthesisError; no portable output | | Annotated Ossie → preserve document/exact source | Byte-identical output, including foreign extension and AI context | | Annotated Ossie → generic graph conversion → Ossie | Foreign extension and root AI context absent | @@ -91,4 +91,4 @@ The official repo registers all 23 projects, with capability skips rather than p Do not interpret green Actions as full interoperability: default mode returns zero despite converter failures, empty results, skips, and lossy outcomes; `--strict` blocks FAIL/EMPTY/unexpected SKIP but LOSSY still not blocking (`README:162-179`). CI intentionally invokes without `--strict`; general SQL equivalence, data types, AI context and metadata are not checked (`README:176-179,350-362`). [Pinned CI policy](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/interop/README.md#L350). -Actionable ideas for Sidemantic: adopt shared small fixture corpus/structural grades; add an Ossie consumer-target profile to reject unsupported modern constructs before downstream export; gate portable exports explicitly; provide preserved-document CLI route separately from graph conversion; expose source dialect; add typed-field roundtrips; contribute/extend upstream dataset-metric tests. Report runtime-extension output as requiring Sidemantic, not as vendor-portable success. +Actionable ideas for sqlctx: adopt shared small fixture corpus/structural grades; add an Ossie consumer-target profile to reject unsupported modern constructs before downstream export; gate portable exports explicitly; provide preserved-document CLI route separately from graph conversion; expose source dialect; add typed-field roundtrips; contribute/extend upstream dataset-metric tests. Report runtime-extension output as requiring sqlctx, not as vendor-portable success. diff --git a/docs/reviews/ossie-converters-2026-11-06/ontology-rest.md b/docs/reviews/ossie-converters-2026-11-06/ontology-rest.md index 4f410b488..83ccb27a0 100644 --- a/docs/reviews/ossie-converters-2026-11-06/ontology-rest.md +++ b/docs/reviews/ossie-converters-2026-11-06/ontology-rest.md @@ -1,20 +1,20 @@ -# Remaining official Ossie converter surfaces versus Sidemantic +# Remaining official Ossie converter surfaces versus sqlctx -Research snapshot: Apache `ossie-converters` HEAD **011ea9f9a1e2c941f351e18e071622339ccae881**, local checkout `/workspace/ossie-converters-research`; Sidemantic HEAD **a7df3c9eae7c1a9a916ebe317ee378408d7d721b** plus current working tree. Source/test inspection only; no converter tests executed or product files modified. All nine directories below contain implementations in the Apache-hosted repository, not merely roadmap entries. OrionBelt additionally identifies an external canonical development/publishing repository. +Research snapshot: Apache `ossie-converters` HEAD **011ea9f9a1e2c941f351e18e071622339ccae881**, local checkout `/workspace/ossie-converters-research`; sqlctx HEAD **a7df3c9eae7c1a9a916ebe317ee378408d7d721b** plus current working tree. Source/test inspection only; no converter tests executed or product files modified. All nine directories below contain implementations in the Apache-hosted repository, not merely roadmap entries. OrionBelt additionally identifies an external canonical development/publishing repository. -Arrows below describe file/model conversion directions, not live warehouse execution. Every named native surface in this matrix is absent from Sidemantic's registered formats ([local registry](/workspace/sidemantic/sidemantic/formats.py:66)). Its generic Ossie document preservation does not implement those vendor conversions. Its Tableau adapter reads `.tds/.twb/.tdsx/.twbx` ([source](/workspace/sidemantic/sidemantic/adapters/tableau.py:1)), a different surface from Salesforce Semantic Model JSON/Tableau Next. +Arrows below describe file/model conversion directions, not live warehouse execution. Every named native surface in this matrix is absent from sqlctx's registered formats ([local registry](/workspace/sqlctx/sqlctx/formats.py:66)). Its generic Ossie document preservation does not implement those vendor conversions. Its Tableau adapter reads `.tds/.twb/.tdsx/.twbx` ([source](/workspace/sqlctx/sqlctx/adapters/tableau.py:1)), a different surface from Salesforce Semantic Model JSON/Tableau Next. -| Official project | Implemented surface and direction | Fidelity / important boundaries | Dependencies and Sidemantic comparison | +| Official project | Implemented surface and direction | Fidelity / important boundaries | Dependencies and sqlctx comparison | |---|---|---|---| -| **ontology** | Ossie ontology spec YAML/Pydantic DTOs ↔ in-memory `OssieOntology` model. Parses derived/required formulas and mapping expressions into ASTs; supplies ontology reasoner/model tooling. This is shared ontology infrastructure, not another vendor spoke. | Real semantic object construction, concept/relationship/mapping resolution, formula parsing; structure and YAML snapshot corpus tests. Do not count its two internal converters as two external formats. | Python ≥3.11, Pydantic, PLY, PyYAML; local/offline. Sidemantic instead preserves/serializes ontology documents and performs static checks, without ontology execution/reasoning/model lowering. [O1–O2] | -| **NVIDIA Auto Ontology** | Native model-document YAML ↔ Ossie core semantic model; native → separate Ossie ontology **and standalone mapping** documents; optional embedded ontology variant. Formerly GSF, same surface rather than an extra converter. | Datasets→catalog table terms, columns/computed fields, custom-analysis metrics, joins/FKs; full native snapshot extension retains IDs, catalog-only metadata and native SQL. Export from arbitrary Ossie loses AI context/dimensions/synonyms/extensions. Exactly one represented table per native term; cross-database SQL objects rejected. Ontology path declares concepts without keys but cannot map them; fields without portable types omitted. | Python ≥3.11, PyYAML + sqlglot; offline, no NVIDIA instance required. Genuine Sidemantic import/export and ontology-generation gap. [N1–N3] | -| **RelationalAI** | Ossie ontology → in-memory PyRel `OntologyModel`, serializable to PyRel source. **Export only**, no PyRel importer. | Concepts, identities, relationships, mappings and parsed formulas become PyRel constructs. Row-field SQL accepts scalar subset; functions, CASE, CAST and qualified columns rejected. Raw/unparsed formulas skipped. Source compilation tests are not live engine execution. | Python ≥3.11 + ontology package; functioning converter requires optional `relationalai==1.39.0` proprietary SDK and config. Default `warehouse_table` reads warehouse metadata; `declared_table` enables offline conversion/compilation. Running generated code requires configured RelationalAI/Snowflake service. Sidemantic has no ontology→PyRel surface. [R1–R3] | -| **Palantir** | Extracted ontology JSON + `data_sets/*.json`, or ZIP → Ossie ontology with embedded logical model and mappings. **Import only**, no Palantir export. Can chain through ontology package to YAML and optionally RelationalAI. | Converts object/property/relationship structure, keys, status-policy hooks, multi-dataset mappings, inferred PK→PK inheritance. Missing identifying fields skip concept mapping; array-valued property mapping skipped with warning. Not proof of arbitrary Foundry asset/action portability. | Python ≥3.11 + ontology package; offline exported files, no Palantir client/service dependency. Optional downstream RelationalAI chain has separate SDK requirement. Genuine Sidemantic ontology import gap. [P1–P3] | -| **Salesforce** | Salesforce Semantic Model JSON ↔ Ossie YAML (Data Cloud/Tableau Next Tua model). | Preserves unmapped Salesforce properties in extensions. SQL/TABLEAU metric expression validation and Tua generation; unsupported calculated field dialects omitted with warnings; formula/semantic-field relationships preserved only as extensions. No universal “lossless” semantic conversion: arbitrary Ossie time types and computed fields have direction-specific limits. Published Salesforce schema can reject API-valid `Dmo` models. | Java 21+, Maven build, bundled Ossie schema; Salesforce JSON schema must be obtained separately for validation, schema-dependent tests can otherwise skip. No live Salesforce account needed for file conversion. Sidemantic Tableau XML support is distinct and does not close this gap. [S1–S3] | -| **Sigma** | Sigma Data Model code-representation JSON (`/v2/dataModels/{id}/spec`) ↔ Ossie YAML. | Native IDs/formulas and unmodeled presentation/governance/source blocks preserved. Sigma formula parser↔sqlglot; `SIGMA` expression always retained, ANSI only on successful translation. Unsupported output formula columns/metrics omitted with issues; foreign-origin cross-dataset metrics dropped; only warehouse-table sources become portable sources, derived sources only native extension + marker. Two native fixture round trips compare normalized structures, not actual original bytes. | Python ≥3.11, Apache Ossie package + PyYAML + sqlglot. Offline conversion; sigcli/API only needed to obtain/apply native files. Genuine Sidemantic missing native format. [G1–G3] | -| **OrionBelt/OBML** | OBML ↔ Ossie core model; additionally OBML → Ossie ontology (embedded model/mapping), **no ontology reverse converter**. | Core metrics translate filters, totals, windows/cumulative calculations when faithful; unsupported semantics retained in extensions with warnings. Foreign extensions and unconvertible Ossie metrics round-trip, but preserved metrics are not queryable in OBML. Ontology path is narrower: skips many-to-many; no column-level value concepts/metrics; first PK column only for composite keys, falls back to first column when no PK. | Python ≥3.12 + PyYAML/jsonschema/referencing/sqlglot; optional full OrionBelt engine only for deeper OBML validation. Apache-hosted copy, but README names `ralfbecher/orionbelt-semantic-layer/packages/ossie-orionbelt` as canonical/publishing source. Genuine Sidemantic native-format and ontology-generation gaps. [B1–B3] | -| **Wisdom** | WisdomAI domain-export JSON format `1.0` ↔ Ossie core model. | Fields/formulas/measures, model instructions/knowledge, composite equality joins; cardinality encoded using exact AI-context notes. OR joins dropped; many-to-many warns; export drops unique keys/extensions and field/metric AI context + synonyms/examples. Deterministic connection placeholders must be remapped on import; unresolved metric placement falls back to first dataset. | Python ≥3.11 + Apache Ossie/PyYAML; offline files. Missing Sidemantic native format; not general knowledge/security/reviewed-query portability. [W1–W2] | -| **wisdom-semantic-view** | Snowflake semantic-view YAML ↔ Ossie ↔ Wisdom format-1.0 JSON, with optional enrichment; four internal conversion functions and two pipeline CLIs. | **Explicit finance-fixture-only implementation**, not general Snowflake/Wisdom interoperability. Only bare-column expressions or exact `SUM(bookings.amount)`; metric references must be `bookings`; restricted keys/types/one relationship. Preserves fixture metric synonyms + `sql_generation` instructions through knowledge items. Golden round-trip tests exercise finance fixture. | Python ≥3.11 + PyYAML only; no accounts/network, deliberately independent of `snowflake` and `wisdom` converters. Missing exact pipeline in Sidemantic but should not be weighted as another broad vendor gap; Sidemantic Snowflake work is a separate comparison. [V1–V3] | +| **ontology** | Ossie ontology spec YAML/Pydantic DTOs ↔ in-memory `OssieOntology` model. Parses derived/required formulas and mapping expressions into ASTs; supplies ontology reasoner/model tooling. This is shared ontology infrastructure, not another vendor spoke. | Real semantic object construction, concept/relationship/mapping resolution, formula parsing; structure and YAML snapshot corpus tests. Do not count its two internal converters as two external formats. | Python ≥3.11, Pydantic, PLY, PyYAML; local/offline. sqlctx instead preserves/serializes ontology documents and performs static checks, without ontology execution/reasoning/model lowering. [O1–O2] | +| **NVIDIA Auto Ontology** | Native model-document YAML ↔ Ossie core semantic model; native → separate Ossie ontology **and standalone mapping** documents; optional embedded ontology variant. Formerly GSF, same surface rather than an extra converter. | Datasets→catalog table terms, columns/computed fields, custom-analysis metrics, joins/FKs; full native snapshot extension retains IDs, catalog-only metadata and native SQL. Export from arbitrary Ossie loses AI context/dimensions/synonyms/extensions. Exactly one represented table per native term; cross-database SQL objects rejected. Ontology path declares concepts without keys but cannot map them; fields without portable types omitted. | Python ≥3.11, PyYAML + sqlglot; offline, no NVIDIA instance required. Genuine sqlctx import/export and ontology-generation gap. [N1–N3] | +| **RelationalAI** | Ossie ontology → in-memory PyRel `OntologyModel`, serializable to PyRel source. **Export only**, no PyRel importer. | Concepts, identities, relationships, mappings and parsed formulas become PyRel constructs. Row-field SQL accepts scalar subset; functions, CASE, CAST and qualified columns rejected. Raw/unparsed formulas skipped. Source compilation tests are not live engine execution. | Python ≥3.11 + ontology package; functioning converter requires optional `relationalai==1.39.0` proprietary SDK and config. Default `warehouse_table` reads warehouse metadata; `declared_table` enables offline conversion/compilation. Running generated code requires configured RelationalAI/Snowflake service. sqlctx has no ontology→PyRel surface. [R1–R3] | +| **Palantir** | Extracted ontology JSON + `data_sets/*.json`, or ZIP → Ossie ontology with embedded logical model and mappings. **Import only**, no Palantir export. Can chain through ontology package to YAML and optionally RelationalAI. | Converts object/property/relationship structure, keys, status-policy hooks, multi-dataset mappings, inferred PK→PK inheritance. Missing identifying fields skip concept mapping; array-valued property mapping skipped with warning. Not proof of arbitrary Foundry asset/action portability. | Python ≥3.11 + ontology package; offline exported files, no Palantir client/service dependency. Optional downstream RelationalAI chain has separate SDK requirement. Genuine sqlctx ontology import gap. [P1–P3] | +| **Salesforce** | Salesforce Semantic Model JSON ↔ Ossie YAML (Data Cloud/Tableau Next Tua model). | Preserves unmapped Salesforce properties in extensions. SQL/TABLEAU metric expression validation and Tua generation; unsupported calculated field dialects omitted with warnings; formula/semantic-field relationships preserved only as extensions. No universal “lossless” semantic conversion: arbitrary Ossie time types and computed fields have direction-specific limits. Published Salesforce schema can reject API-valid `Dmo` models. | Java 21+, Maven build, bundled Ossie schema; Salesforce JSON schema must be obtained separately for validation, schema-dependent tests can otherwise skip. No live Salesforce account needed for file conversion. sqlctx Tableau XML support is distinct and does not close this gap. [S1–S3] | +| **Sigma** | Sigma Data Model code-representation JSON (`/v2/dataModels/{id}/spec`) ↔ Ossie YAML. | Native IDs/formulas and unmodeled presentation/governance/source blocks preserved. Sigma formula parser↔sqlglot; `SIGMA` expression always retained, ANSI only on successful translation. Unsupported output formula columns/metrics omitted with issues; foreign-origin cross-dataset metrics dropped; only warehouse-table sources become portable sources, derived sources only native extension + marker. Two native fixture round trips compare normalized structures, not actual original bytes. | Python ≥3.11, Apache Ossie package + PyYAML + sqlglot. Offline conversion; sigcli/API only needed to obtain/apply native files. Genuine sqlctx missing native format. [G1–G3] | +| **OrionBelt/OBML** | OBML ↔ Ossie core model; additionally OBML → Ossie ontology (embedded model/mapping), **no ontology reverse converter**. | Core metrics translate filters, totals, windows/cumulative calculations when faithful; unsupported semantics retained in extensions with warnings. Foreign extensions and unconvertible Ossie metrics round-trip, but preserved metrics are not queryable in OBML. Ontology path is narrower: skips many-to-many; no column-level value concepts/metrics; first PK column only for composite keys, falls back to first column when no PK. | Python ≥3.12 + PyYAML/jsonschema/referencing/sqlglot; optional full OrionBelt engine only for deeper OBML validation. Apache-hosted copy, but README names `ralfbecher/orionbelt-semantic-layer/packages/ossie-orionbelt` as canonical/publishing source. Genuine sqlctx native-format and ontology-generation gaps. [B1–B3] | +| **Wisdom** | WisdomAI domain-export JSON format `1.0` ↔ Ossie core model. | Fields/formulas/measures, model instructions/knowledge, composite equality joins; cardinality encoded using exact AI-context notes. OR joins dropped; many-to-many warns; export drops unique keys/extensions and field/metric AI context + synonyms/examples. Deterministic connection placeholders must be remapped on import; unresolved metric placement falls back to first dataset. | Python ≥3.11 + Apache Ossie/PyYAML; offline files. Missing sqlctx native format; not general knowledge/security/reviewed-query portability. [W1–W2] | +| **wisdom-semantic-view** | Snowflake semantic-view YAML ↔ Ossie ↔ Wisdom format-1.0 JSON, with optional enrichment; four internal conversion functions and two pipeline CLIs. | **Explicit finance-fixture-only implementation**, not general Snowflake/Wisdom interoperability. Only bare-column expressions or exact `SUM(bookings.amount)`; metric references must be `bookings`; restricted keys/types/one relationship. Preserves fixture metric synonyms + `sql_generation` instructions through knowledge items. Golden round-trip tests exercise finance fixture. | Python ≥3.11 + PyYAML only; no accounts/network, deliberately independent of `snowflake` and `wisdom` converters. Missing exact pipeline in sqlctx but should not be weighted as another broad vendor gap; sqlctx Snowflake work is a separate comparison. [V1–V3] | ## Evidence (immutable source/test links; local paths correspond to same commit) @@ -28,9 +28,9 @@ Arrows below describe file/model conversion directions, not live warehouse execu - **W1** [Wisdom importer](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/wisdom/src/ossie_wisdom/wisdom_to_ossie.py#L64), [exporter](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/wisdom/src/ossie_wisdom/ossie_to_wisdom.py#L62); **W2** [round-trip and loss-report tests](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/wisdom/tests/test_ossie_to_wisdom.py#L164-L204), [directional limitations](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/wisdom/README.md#L87-L115). - **V1** [pipeline implementations](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/wisdom-semantic-view/src/ossie_wisdom_semantic_view/pipeline.py#L44-L75); **V2** [hard-coded expression restriction](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/wisdom-semantic-view/src/ossie_wisdom_semantic_view/model.py#L60-L105); **V3** [golden tests](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/wisdom-semantic-view/tests/test_round_trip.py#L55-L101). -## Sidemantic boundary evidence and practical priorities +## sqlctx boundary evidence and practical priorities -- [Ontology capability documentation](/workspace/sidemantic/docs/compatibility/ossie.md:325) explicitly says static checks/source preservation only, no reasoning or runtime conversion; [lowering regression test](/workspace/sidemantic/tests/interchange/ossie/test_lowering.py:606) asserts no executable catalog for ontology. [Exact/canonical source round-trip documentation](/workspace/sidemantic/docs/compatibility/ossie.md:346) is a preservation claim, not semantic migration. +- [Ontology capability documentation](/workspace/sqlctx/docs/compatibility/ossie.md:325) explicitly says static checks/source preservation only, no reasoning or runtime conversion; [lowering regression test](/workspace/sqlctx/tests/interchange/ossie/test_lowering.py:606) asserts no executable catalog for ontology. [Exact/canonical source round-trip documentation](/workspace/sqlctx/docs/compatibility/ossie.md:346) is a preservation claim, not semantic migration. - For broad additional native semantic-model coverage, **Sigma, Salesforce Semantic Model, OBML, NVIDIA, Wisdom** are concrete missing adapters. Existing Ossie bridge may make official converters usable as external preprocessing/postprocessing, but that is integration potential, not present native support or verified end-to-end fidelity. - **Palantir and RelationalAI** require an explicit ontology roadmap/architecture decision; treating them as ordinary SQL-model adapters would lose their concept/rule/identity semantics. NVIDIA/OBML ontology generation likewise exceeds opaque ontology retention. - **ontology** and **wisdom-semantic-view** should be separated in converter counts: shared ontology infrastructure versus deliberately fixture-scoped pipeline. The root README's generic bidirectional responsibility does not override actual Palantir import-only and RelationalAI export-only code. diff --git a/docs/reviews/ossie-converters-2026-11-06/warehouse.md b/docs/reviews/ossie-converters-2026-11-06/warehouse.md index b992e9aca..db1a596d9 100644 --- a/docs/reviews/ossie-converters-2026-11-06/warehouse.md +++ b/docs/reviews/ossie-converters-2026-11-06/warehouse.md @@ -1,6 +1,6 @@ # Warehouse converter comparison -Inspected official apache/ossie-converters commit `011ea9f9a1e2c941f351e18e071622339ccae881` and local `/workspace/sidemantic`. Product source unchanged. Upstream references below are immutable. +Inspected official apache/ossie-converters commit `011ea9f9a1e2c941f351e18e071622339ccae881` and local `/workspace/sqlctx`. Product source unchanged. Upstream references below are immutable. ## Coverage matrix @@ -11,7 +11,7 @@ Inspected official apache/ossie-converters commit `011ea9f9a1e2c941f351e18e07162 | BigQuery | Offline Ossie → **LookML** using BigQuery SQL; no reverse importer | Bidirectional general LookML adapter plus separate BigQuery SQL connector | Overlap is LookML, not native BigQuery semantics; official exporter has stronger relationship/explore output | | Apache Polaris | Live Iceberg REST catalog ↔ Ossie table-schema bootstrap, Java | No Polaris converter/connector in format registry/db adapters | Genuine catalog integration gap; official is explicitly not semantic-model API integration | -Local registry evidence: [LookML](/workspace/sidemantic/sidemantic/formats.py:127), [Snowflake](/workspace/sidemantic/sidemantic/formats.py:181), and whole registry `/workspace/sidemantic/sidemantic/formats.py:72`. Database connector evidence: [Databricks connection](/workspace/sidemantic/sidemantic/db/databricks.py:92), [lazy BigQuery import](/workspace/sidemantic/sidemantic/db/__init__.py:18). These database connections execute/query databases and do not imply Metric View or BigQuery semantic-document converters. +Local registry evidence: [LookML](/workspace/sqlctx/sqlctx/formats.py:127), [Snowflake](/workspace/sqlctx/sqlctx/formats.py:181), and whole registry `/workspace/sqlctx/sqlctx/formats.py:72`. Database connector evidence: [Databricks connection](/workspace/sqlctx/sqlctx/db/databricks.py:92), [lazy BigQuery import](/workspace/sqlctx/sqlctx/db/__init__.py:18). These database connections execute/query databases and do not imply Metric View or BigQuery semantic-document converters. ## Snowflake @@ -21,14 +21,14 @@ Official preserves all composite primary-key columns and unique keys (omitting a Official losses: labels, custom extensions, structured AI context other than consumed synonyms; relationship AI context; metric datatype. **Dataset-scoped metrics are silently ignored**: `_convert_dataset` processes fields only; root `_convert_model` processes metrics. Confirmed in executable probe, no warning. This is a specific upstream weakness relative to the local Cortex adapter, which parses table metrics and root metrics. The official converter has no Snowflake importer despite other documentation elsewhere discussing eventual reverse conversion. -Local strengths: bidirectional facts/legacy measures, table and graph metrics, segments↔filters, synonyms/sample values, private access, nested Cortex search services, non-additive dimensions, relationship names referenced by `using_relationships`, labels/tags, verified queries, custom/module instructions. Selected metadata survives native serialization. [Field metadata](/workspace/sidemantic/sidemantic/adapters/snowflake.py:511), [top-level sections](/workspace/sidemantic/sidemantic/adapters/snowflake.py:537), [export metadata](/workspace/sidemantic/sidemantic/adapters/snowflake.py:785). +Local strengths: bidirectional facts/legacy measures, table and graph metrics, segments↔filters, synonyms/sample values, private access, nested Cortex search services, non-additive dimensions, relationship names referenced by `using_relationships`, labels/tags, verified queries, custom/module instructions. Selected metadata survives native serialization. [Field metadata](/workspace/sqlctx/sqlctx/adapters/snowflake.py:511), [top-level sections](/workspace/sqlctx/sqlctx/adapters/snowflake.py:537), [export metadata](/workspace/sqlctx/sqlctx/adapters/snowflake.py:785). Local losses/compatibility concerns, confirmed by source: -- Composite PK reduces to first column; omitted PK becomes invented `id`. No dataset unique-key preservation. [Parsing](/workspace/sidemantic/sidemantic/adapters/snowflake.py:269). Tests explicitly assert this truncation [test](/workspace/sidemantic/tests/adapters/snowflake/test_parsing.py:234). -- Composite relationship retains first pair only; export forces `left_outer`. [Parsing](/workspace/sidemantic/sidemantic/adapters/snowflake.py:684), [export](/workspace/sidemantic/sidemantic/adapters/snowflake.py:1121). -- **Official `Integer` → `NUMBER(38,0)` is misread as categorical and re-exported as TEXT.** Parser recognizes exact `NUMBER`, `INT`, `INTEGER`, etc., not parameterized NUMBER/DECIMAL. It also reduces temporal exports to TIMESTAMP and fact types to NUMBER. [Type parsing](/workspace/sidemantic/sidemantic/adapters/snowflake.py:331), [exports](/workspace/sidemantic/sidemantic/adapters/snowflake.py:917). -- Model name becomes output filename stem; root description is not emitted. `base_table.definition` has no local parse path (`database/schema/table` only), so official subquery-backed source loses source SQL. [Table parsing](/workspace/sidemantic/sidemantic/adapters/snowflake.py:256), [root export](/workspace/sidemantic/sidemantic/adapters/snowflake.py:740). +- Composite PK reduces to first column; omitted PK becomes invented `id`. No dataset unique-key preservation. [Parsing](/workspace/sqlctx/sqlctx/adapters/snowflake.py:269). Tests explicitly assert this truncation [test](/workspace/sqlctx/tests/adapters/snowflake/test_parsing.py:234). +- Composite relationship retains first pair only; export forces `left_outer`. [Parsing](/workspace/sqlctx/sqlctx/adapters/snowflake.py:684), [export](/workspace/sqlctx/sqlctx/adapters/snowflake.py:1121). +- **Official `Integer` → `NUMBER(38,0)` is misread as categorical and re-exported as TEXT.** Parser recognizes exact `NUMBER`, `INT`, `INTEGER`, etc., not parameterized NUMBER/DECIMAL. It also reduces temporal exports to TIMESTAMP and fact types to NUMBER. [Type parsing](/workspace/sqlctx/sqlctx/adapters/snowflake.py:331), [exports](/workspace/sqlctx/sqlctx/adapters/snowflake.py:917). +- Model name becomes output filename stem; root description is not emitted. `base_table.definition` has no local parse path (`database/schema/table` only), so official subquery-backed source loses source SQL. [Table parsing](/workspace/sqlctx/sqlctx/adapters/snowflake.py:256), [root export](/workspace/sqlctx/sqlctx/adapters/snowflake.py:740). Executable probe: minimal flat Ossie with Integer dimensions, composite PK `[tenant_id,id]`, unique key `[id,sku]`, dataset metric COUNT(*). Official output had two NUMBER(38,0) dimensions and full keys but no dataset metric, warnings `[]`. Feeding that YAML through local Snowflake parse/export produced TEXT dimensions, only tenant_id PK, no unique keys. This demonstrates actual cross-converter interoperability loss, not just differing feature lists. @@ -44,7 +44,7 @@ Do not repeat README's blanket “lossless” as universal: it applies to suppor ## BigQuery (really LookML) -Official output includes views **and explores with transitive joins**; local LookML export emits `data = {"views": views}` and no explores/relationships. Local import is much broader and bidirectional, while official BigQuery has no reverse importer. [Local export](/workspace/sidemantic/sidemantic/adapters/lookml.py:4076), [official planning](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/bigquery/src/ossie_bigquery/ossie_to_lookml.py#L153), [official explores](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/bigquery/src/ossie_bigquery/ossie_to_lookml.py#L1103). +Official output includes views **and explores with transitive joins**; local LookML export emits `data = {"views": views}` and no explores/relationships. Local import is much broader and bidirectional, while official BigQuery has no reverse importer. [Local export](/workspace/sqlctx/sqlctx/adapters/lookml.py:4076), [official planning](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/bigquery/src/ossie_bigquery/ossie_to_lookml.py#L153), [official explores](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/bigquery/src/ossie_bigquery/ossie_to_lookml.py#L1103). Official strongest features: BIGQUERY→ANSI_SQL→OSSIE_SQL_2026 selection with sqlglot conversion into BigQuery dialect; logical types/date groups and timezone distinction; collision-aware names and timeframe expansion; composite PK hidden dimensions; root and dataset-scoped metric ownership resolution; filtered aggregate rewriting; compound aggregate helper measures preserving Looker's symmetric aggregation; composite joins, aliases, transitive explore paths. [Metric planning](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/bigquery/src/ossie_bigquery/ossie_to_lookml.py#L802), [full mapping and caveats](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/bigquery/README.md). @@ -61,7 +61,7 @@ Schema nuance: parser rejects wrapper/removed root dialect/vendor fields and req ## Verification - Local `uv run --no-sync pytest -q tests/adapters/snowflake`: **136 passed** (7.80s). -- Upstream Snowflake using local environment and `PYTHONPATH=/snowflake/src`, `uv run --no-sync --project /workspace/sidemantic pytest -q tests` from snowflake dir: **194 passed** (1.87s). +- Upstream Snowflake using local environment and `PYTHONPATH=/snowflake/src`, `uv run --no-sync --project /workspace/sqlctx pytest -q tests` from snowflake dir: **194 passed** (1.87s). - Upstream BigQuery equivalent in bigquery dir: **170 passed**, two expected warning messages (2.67s). - Initial combined upstream invocation failed import setup; corrected PYTHONPATH combined invocation had same-basename fixture collisions, so reran each suite separately, all pass. No upstream bug claimed from harness setup. - Databricks Java and Polaris Java tests inspected, not run (Maven unavailable). Databricks suites include generated seeded roundtrips, dialect classification, CLI, fixtures. Polaris includes parser/generator roundtrip, exporter request construction, exact type precedence, dropped-semantics warnings, importer metadata mappings and namespace-safe filenames. No live warehouse/catalog execution performed. diff --git a/docs/reviews/ossie-converters-2026-11-06/yaml-tools.md b/docs/reviews/ossie-converters-2026-11-06/yaml-tools.md index d0f5dc8cb..86920bb5f 100644 --- a/docs/reviews/ossie-converters-2026-11-06/yaml-tools.md +++ b/docs/reviews/ossie-converters-2026-11-06/yaml-tools.md @@ -1,12 +1,12 @@ # Hex, Holistics, Omni, Lightdash, Honeydew comparison -Inspected Sidemantic working tree (clean), commit `a7df3c9eae7c1a9a916ebe317ee378408d7d721b`; Apache `ossie-converters`, commit `011ea9f9a1e2c941f351e18e071622339ccae881`. These five upstream directories contain actual source and tests, not merely links to vendor tools. All are offline converters; none inspected here is a hosted conversion service. Findings are from source, tests, and the probes below, not README claims alone. +Inspected sqlctx working tree (clean), commit `a7df3c9eae7c1a9a916ebe317ee378408d7d721b`; Apache `ossie-converters`, commit `011ea9f9a1e2c941f351e18e071622339ccae881`. These five upstream directories contain actual source and tests, not merely links to vendor tools. All are offline converters; none inspected here is a hosted conversion service. Findings are from source, tests, and the probes below, not README claims alone. -Important scope correction: Sidemantic's public `osi` alias resolves to the modern `OssieAdapter`, not the historical implementation retained earlier in `adapters/osi.py`. The modern flat-schema path is current; do not report wrapper incompatibility based on legacy code. See `/workspace/sidemantic/sidemantic/formats.py:159` and `/workspace/sidemantic/sidemantic/adapters/osi.py:1044`. +Important scope correction: sqlctx's public `osi` alias resolves to the modern `OssieAdapter`, not the historical implementation retained earlier in `adapters/osi.py`. The modern flat-schema path is current; do not report wrapper incompatibility based on legacy code. See `/workspace/sqlctx/sqlctx/formats.py:159` and `/workspace/sqlctx/sqlctx/adapters/osi.py:1044`. ## Direction and real input/output -| Tool | Sidemantic | Official Apache converter | +| Tool | sqlctx | Official Apache converter | |---|---|---| | Hex | Reads model/view YAML, including multi-document files; writes one YAML per model/view in a directory. A YAML output filename writes only the first model. | **Only Ossie → Hex is implemented**, despite “bidirectional” README/package wording. Takes one flat Ossie file; writes Hex project resources. CLI exposes only `export`. | | Holistics | Reads raw `.aml` files/directories using its ANTLR parser; resolves constants, imports, partial models, dataset definitions, and standalone metrics. Exports model AML plus relationships; a single `.aml` output takes the first model. | Compiled Holistics dataset JSON → Ossie; Ossie → AML source directory, including dataset file and model files. Requires `holistics aml compile` before import; not a raw AML parser. One AML Dataset becomes one Ossie model. | @@ -14,15 +14,15 @@ Important scope correction: Sidemantic's public `osi` alias resolves to the mode | Lightdash | No native Lightdash adapter/registration found in Python source. Generic dbt support is not Lightdash-meta support. | Bidirectional. Imports both native Lightdash `type: model` files and dbt schema YAML with Lightdash meta. Default export is deployable native model directory/config; optional dbt-meta schema output, including dbt 1.10 `config.meta`. | | Honeydew | No native Honeydew adapter/registration found. | Bidirectional Ossie file ↔ Honeydew workspace directory (`workspace.yml`, `schema//...`, datasets, calculated attributes, metrics). | -Evidence: Sidemantic `/workspace/sidemantic/sidemantic/adapters/hex.py:28`, `:466`; `/workspace/sidemantic/sidemantic/adapters/holistics.py:242`, `:353`; `/workspace/sidemantic/sidemantic/adapters/omni.py:28`, `:717`. Upstream [Hex CLI](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/hex/src/ossie_hex/cli/main.py#L47), [Holistics usage](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/holistics/README.md#L14), [Omni layout](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/omni/README.md#L24), [Lightdash modes](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/lightdash/README.md#L20), [Honeydew implementation](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/honeydew/src/ossie_honeydew/converter.py#L79). +Evidence: sqlctx `/workspace/sqlctx/sqlctx/adapters/hex.py:28`, `:466`; `/workspace/sqlctx/sqlctx/adapters/holistics.py:242`, `:353`; `/workspace/sqlctx/sqlctx/adapters/omni.py:28`, `:717`. Upstream [Hex CLI](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/hex/src/ossie_hex/cli/main.py#L47), [Holistics usage](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/holistics/README.md#L14), [Omni layout](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/omni/README.md#L24), [Lightdash modes](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/lightdash/README.md#L20), [Honeydew implementation](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/honeydew/src/ossie_honeydew/converter.py#L79). ## Hex -Sidemantic has the broader direction coverage: real import, views preserved on `meta` (`base`, `contents`, visibility), display labels, filters, and full semi-additive object preservation. This is useful for native Hex roundtrips and querying supported SQL measures. Official Hex has no implemented import; statements about a HEX custom extension on import in its README are future/descriptive, not executable functionality. +sqlctx has the broader direction coverage: real import, views preserved on `meta` (`base`, `contents`, visibility), display labels, filters, and full semi-additive object preservation. This is useful for native Hex roundtrips and querying supported SQL measures. Official Hex has no implemented import; statements about a HEX custom extension on import in its README are future/descriptive, not executable functionality. Official export is substantially more deliberate about validation, SQL references, target ID allocation, dialect choice and losses. It loads/validates Ossie into typed objects, parses SQL with SQLGlot, analyzes references/relationship paths, and rewrites `dataset.field` to `${field}` or `${relation.field}`. Problems carry severity, phase and source cause path; CLI errors/fatals produce exit 1. Unsupported AI context, custom extensions, composite keys and temporal-role metadata are reported. Metric analysis reports zero referenced datasets and more than two referenced datasets as errors: this is not unrestricted cross-model export. -Sidemantic fidelity defects verified with executable probe: +sqlctx fidelity defects verified with executable probe: * Hex `boolean` dimension imports as categorical, then exports `string`; `timestamp_naive` also collapses to timestamp_tz through its mapping. * `func: median` imports as median, but export only recognizes count/count_distinct/sum/avg/min/max and falls back to **count**. The same mismatch affects imported stddev/variance variants. @@ -32,11 +32,11 @@ Sidemantic fidelity defects verified with executable probe: Priority: fix aggregate fallback and predicate loss, retain native type/expression-kind metadata, add a structured loss result, and define single-file multi-resource output explicitly. Existing view/semi-additive preservation provides a useful precedent. -Local: `/workspace/sidemantic/sidemantic/adapters/hex.py:210` (type mapping), `:285` (aggregate import), `:435` (join parse), `:479` (first model output), `:539` (type export), `:601` (aggregate export). Upstream [SQL rewrite](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/hex/src/ossie_hex/ossie_to_hex/convert_ossie_dialect_expression.py#L72), [metric restrictions](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/hex/src/ossie_hex/ossie_to_hex/convert_ossie_metric.py#L34), [loss codes](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/hex/src/ossie_hex/ossie_to_hex/problem_code.py#L20). +Local: `/workspace/sqlctx/sqlctx/adapters/hex.py:210` (type mapping), `:285` (aggregate import), `:435` (join parse), `:479` (first model output), `:539` (type export), `:601` (aggregate export). Upstream [SQL rewrite](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/hex/src/ossie_hex/ossie_to_hex/convert_ossie_dialect_expression.py#L72), [metric restrictions](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/hex/src/ossie_hex/ossie_to_hex/convert_ossie_metric.py#L34), [loss codes](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/hex/src/ossie_hex/ossie_to_hex/problem_code.py#L20). ## Holistics -Sidemantic's direct AML parsing is a distinct advantage: no Holistics CLI compilation prerequisite. It supports composition, dataset-level metrics and selected AQL-to-SQL lowering. However its export emits Models and Relationships, not a reconstructed Dataset/import/module topology, and does not stash connection, owner, persistence, hidden state or arbitrary AML constructs. It maps selected label/description/format properties, not the entire original document. +sqlctx's direct AML parsing is a distinct advantage: no Holistics CLI compilation prerequisite. It supports composition, dataset-level metrics and selected AQL-to-SQL lowering. However its export emits Models and Relationships, not a reconstructed Dataset/import/module topology, and does not stash connection, owner, persistence, hidden state or arbitrary AML constructs. It maps selected label/description/format properties, not the entire original document. Most consequential finding: AQL lowering intentionally discards table-shaping and metric-scope modifiers without a warning. Verified examples: @@ -49,21 +49,21 @@ orders | filter(orders.status == "paid") | sum(orders.amount) The last expression loses the filter, and the others lose grouping/window semantics. This is executable semantic corruption, not just metadata loss. Export subsequently emits SQL and cannot recover the AQL. -Official import keeps AQL explicitly under `HOLISTICS_AQL`, emits an informational issue that it was not translated, and preserves vendor-specific details in versioned JSON-string `HOLISTICS` custom extensions. Its reverse converter restores dataset scope, module paths, data source, labels, hidden state, formats, params, persistence and relationship attributes. It can translate supported **Ossie SQL → AQL** for cross-dataset metrics (different direction from Sidemantic's AQL → SQL), reporting unsupported constructs, reference problems and dialect mismatches. It warns on relationship filters/inactive relationships because those change semantics for core-only consumers; range/many-to-many joins are stash-only. File provenance/comments/order are not retained from compiled JSON, so “same AML models” does not mean byte-identical source files. +Official import keeps AQL explicitly under `HOLISTICS_AQL`, emits an informational issue that it was not translated, and preserves vendor-specific details in versioned JSON-string `HOLISTICS` custom extensions. Its reverse converter restores dataset scope, module paths, data source, labels, hidden state, formats, params, persistence and relationship attributes. It can translate supported **Ossie SQL → AQL** for cross-dataset metrics (different direction from sqlctx's AQL → SQL), reporting unsupported constructs, reference problems and dialect mismatches. It warns on relationship filters/inactive relationships because those change semantics for core-only consumers; range/many-to-many joins are stash-only. File provenance/comments/order are not retained from compiled JSON, so “same AML models” does not mean byte-identical source files. Priority: preserve original AQL, reject or explicitly report unsupported scope/filter modifiers, and use a loss-aware compiled-JSON import/export path if migration fidelity matters. Keep raw AML import for convenience; do not replace it with a compilation requirement. -Local: `/workspace/sidemantic/sidemantic/adapters/holistics.py:353`, `:1128`, `:1852`, `:2072`. Upstream [compiled input contract](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/holistics/README.md#L14), [limitations and issue codes](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/holistics/docs/limitations.md#L14), [versioned payload](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/holistics/src/ossie_holistics/stash.py#L47), [reverse conversion](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/holistics/src/ossie_holistics/ossie_to_aml.py#L1254). +Local: `/workspace/sqlctx/sqlctx/adapters/holistics.py:353`, `:1128`, `:1852`, `:2072`. Upstream [compiled input contract](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/holistics/README.md#L14), [limitations and issue codes](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/holistics/docs/limitations.md#L14), [versioned payload](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/holistics/src/ossie_holistics/stash.py#L47), [reverse conversion](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/holistics/src/ossie_holistics/ossie_to_aml.py#L1254). ## Omni -Sidemantic imports dimensions/measures/filters, time-comparison constructs, relationships and topic records. It preserves selected metadata in memory, but export doesn't restore much of that state: it never writes topics, drops original paths/model configuration, conflates view description with label, forces `join_type: always_left`, and discards `reversible`. The directory scanner discovers only `.yaml`/`.yml`, not bare `.view`/`.topic`; when a `views` directory exists it scans only that directory's immediate YAML files. Names derive from schema/table or filename, not the canonical header. +sqlctx imports dimensions/measures/filters, time-comparison constructs, relationships and topic records. It preserves selected metadata in memory, but export doesn't restore much of that state: it never writes topics, drops original paths/model configuration, conflates view description with label, forces `join_type: always_left`, and discards `reversible`. The directory scanner discovers only `.yaml`/`.yml`, not bare `.view`/`.topic`; when a `views` directory exists it scans only that directory's immediate YAML files. Names derive from schema/table or filename, not the canonical header. Verified public API roundtrip of `${orders.amount} > ${users.threshold}`, `join_type: inner`, plus a topic: ```text -Sidemantic output files: model.yaml, views/orders.yaml, views/users.yaml -Sidemantic join: ${orders.amount} = ${users.threshold}, join_type: always_left +sqlctx output files: model.yaml, views/orders.yaml, views/users.yaml +sqlctx join: ${orders.amount} = ${users.threshold}, join_type: always_left Official warning: non-equi join has no Ossie relationship form; preserved in custom_extensions only Official restored join: original > predicate, join_type: inner Official restored topic: {base_view: orders, label: Sales} @@ -75,11 +75,11 @@ Official import/export preserves extensive Omni-only state (model/topics, view/d Priority: retain arbitrary join predicates and join metadata, reject unsupported lowering, preserve canonical names/paths, support API suffixes, and restore topics/configuration. Build native-file roundtrip assertions in addition to graph-equivalence tests. -Local: `/workspace/sidemantic/sidemantic/adapters/omni.py:64`, `:188`, `:623`, `:717`, `:940`; `/workspace/sidemantic/tests/adapters/omni/test_roundtrip.py:18`. Upstream [real-world import](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/omni/src/ossie_omni/omni_to_ossie.py#L74), [non-equi handling](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/omni/src/ossie_omni/omni_to_ossie.py#L444), [roundtrip assertions](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/omni/tests/test_roundtrip.py#L47). +Local: `/workspace/sqlctx/sqlctx/adapters/omni.py:64`, `:188`, `:623`, `:717`, `:940`; `/workspace/sqlctx/tests/adapters/omni/test_roundtrip.py:18`. Upstream [real-world import](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/omni/src/ossie_omni/omni_to_ossie.py#L74), [non-equi handling](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/omni/src/ossie_omni/omni_to_ossie.py#L444), [roundtrip assertions](https://github.com/apache/ossie-converters/blob/011ea9f9a1e2c941f351e18e071622339ccae881/omni/tests/test_roundtrip.py#L47). ## Lightdash and Honeydew: concrete coverage additions, with caveats -Lightdash is a substantial actual implementation. It handles native/dbt-meta layouts, seeds, catalog type enrichment, metric placement/namespacing, SQL references and aliases, composite keys and joins. It uses typed Ossie models plus structured `ConverterResult(output, issues)`. Metadata is stored in `LIGHTDASH` JSON extensions and restored. SQLGlot qualification respects literals, comments and nested query scope; expression dialect fallback is explicit. Its “exact roundtrip” README claim should be qualified: unsupported query-time templating/parameters cause affected fields/metrics to be skipped; number/time types normalize; metric and row filters are stash-only, so core Ossie sees unfiltered expressions/unrestricted rows; alias joins flatten identity with an issue. No native Sidemantic adapter means this is a strong interoperability target, not proven support via Sidemantic's generic dbt adapter. +Lightdash is a substantial actual implementation. It handles native/dbt-meta layouts, seeds, catalog type enrichment, metric placement/namespacing, SQL references and aliases, composite keys and joins. It uses typed Ossie models plus structured `ConverterResult(output, issues)`. Metadata is stored in `LIGHTDASH` JSON extensions and restored. SQLGlot qualification respects literals, comments and nested query scope; expression dialect fallback is explicit. Its “exact roundtrip” README claim should be qualified: unsupported query-time templating/parameters cause affected fields/metrics to be skipped; number/time types normalize; metric and row filters are stash-only, so core Ossie sees unfiltered expressions/unrestricted rows; alias joins flatten identity with an issue. No native sqlctx adapter means this is a strong interoperability target, not proven support via sqlctx's generic dbt adapter. Honeydew likewise has real two-way files, metadata/extensions, calculated attributes, metrics, composite keys and relationship direction handling. It uses Python warnings plus errors rather than Lightdash's structured result. Limitations: one primary source dataset per entity; datatypes are approximated on export and not emitted as Ossie `datatype` on reimport; all Honeydew metrics export as `number`; perspectives/domains aren't converted. It emits Honeydew SQL as ANSI_SQL while retaining entity.attribute syntax, so labeling is not a portability guarantee. `ANSI_SQL` is preferred on export, falling back to the first dialect with a warning. Foreign extension/AI metadata is preserved in Honeydew metadata. Original connection expressions roundtrip in HONEYDEW extensions. @@ -87,16 +87,16 @@ Upstream [Lightdash issues](https://github.com/apache/ossie-converters/blob/011e ## Validation performed -Using the existing Sidemantic virtual environment, with converter sources added to PYTHONPATH where required: +Using the existing sqlctx virtual environment, with converter sources added to PYTHONPATH where required: * Official Omni: **206 passed** (includes fixture/property roundtrips and core-schema checks). * Official Honeydew: **151 passed**, two expected warnings in malformed-expression cases. * Official Holistics: **92 passed, 6 skipped**; skips require external Holistics CLI, so generated AML was not vendor-compiled in this session. Schema/issue/snapshot tests did run. * Official Lightdash: **189 passed, 1 skipped**; skipped test requires external Lightdash CLI. No deployed Lightdash/warehouse validation performed. -* Sidemantic Hex/Omni/Holistics focused suite: **228 passed in 133.21s**, via `uv run --no-sync pytest -q tests/adapters/hex tests/adapters/omni tests/adapters/holistics` from `/workspace/sidemantic`. +* sqlctx Hex/Omni/Holistics focused suite: **228 passed in 133.21s**, via `uv run --no-sync pytest -q tests/adapters/hex tests/adapters/omni tests/adapters/holistics` from `/workspace/sqlctx`. * Custom small executable probes reproduced Hex type/aggregate/join loss, AQL filter/scope loss and public Omni roundtrip behavior above. * Official Hex reviewed from implementation/tests but not executed; requires `hex-sl-utils` and its pinned current dependencies. -Official suites used `/workspace/sidemantic/.venv/bin/python -m pytest -q tests` from each converter directory. Honeydew added `PYTHONPATH=src`; Lightdash added `PYTHONPATH=src:../ossie/python/src`. These passing suites coexist with the reproduced Sidemantic defects because the existing tests do not assert all the lost native semantics. +Official suites used `/workspace/sqlctx/.venv/bin/python -m pytest -q tests` from each converter directory. Honeydew added `PYTHONPATH=src`; Lightdash added `PYTHONPATH=src:../ossie/python/src`. These passing suites coexist with the reproduced sqlctx defects because the existing tests do not assert all the lost native semantics. No product source was changed. This comparison distinguishes native restoration, portable semantics and runnable queries: preserving unsupported features in vendor extensions is valuable for roundtrip restoration, but it is not equivalent to implementing those semantics in another engine. diff --git a/docs/runtime-conformance.yml b/docs/runtime-conformance.yml index 18d35bad1..4140c96cf 100644 --- a/docs/runtime-conformance.yml +++ b/docs/runtime-conformance.yml @@ -15,11 +15,11 @@ runtimes: duckdb_extension: label: DuckDB extension lifecycle: experimental - scope: DuckDB-native wrapper around selected sidemantic-rs contracts. + scope: DuckDB-native wrapper around selected sqlctx-rs contracts. wasm: label: WASM lifecycle: experimental - scope: Browser-safe sidemantic-rs subset; not the Python/Pyodide product surface. + scope: Browser-safe sqlctx-rs subset; not the Python/Pyodide product surface. capabilities: shared_native_fixture_contract: label: Shared native YAML/SQL fixture contract @@ -29,15 +29,15 @@ capabilities: fixtures: all rust: status: supported - evidence: [sidemantic-rs/tests/native_fixtures.rs] + evidence: [sqlctx-rs/tests/native_fixtures.rs] fixtures: all duckdb_extension: status: partial - evidence: [sidemantic-duckdb/test/sql/sidemantic_native_contract.test] + evidence: [sqlctx-duckdb/test/sql/sqlctx_native_contract.test] detail: Dedicated extension cases, not the complete shared manifest. wasm: status: partial - evidence: [sidemantic-rs/tests/wasm_parity_subset.rs] + evidence: [sqlctx-rs/tests/wasm_parity_subset.rs] detail: Curated parity subset, not the complete shared manifest. native_yaml_load: label: Native YAML load @@ -47,14 +47,14 @@ capabilities: fixtures: [basic_model] rust: status: supported - evidence: [sidemantic-rs/tests/native_fixtures.rs] + evidence: [sqlctx-rs/tests/native_fixtures.rs] fixtures: [basic_model] duckdb_extension: status: supported - evidence: [sidemantic-duckdb/test/sql/sidemantic_native_contract.test] + evidence: [sqlctx-duckdb/test/sql/sqlctx_native_contract.test] wasm: status: supported - evidence: [sidemantic-rs/tests/wasm_parity_subset.rs] + evidence: [sqlctx-rs/tests/wasm_parity_subset.rs] native_sql_definitions: label: Native SQL and frontmatter definitions python: @@ -63,14 +63,14 @@ capabilities: fixtures: [native_sql_definitions, sql_frontmatter_definitions, compact_sql_model] rust: status: supported - evidence: [sidemantic-rs/tests/native_fixtures.rs] + evidence: [sqlctx-rs/tests/native_fixtures.rs] fixtures: [native_sql_definitions, sql_frontmatter_definitions, compact_sql_model] duckdb_extension: status: partial - evidence: [sidemantic-duckdb/test/sql/sidemantic_native_contract.test] + evidence: [sqlctx-duckdb/test/sql/sqlctx_native_contract.test] wasm: status: partial - evidence: [sidemantic-rs/tests/wasm_parity_subset.rs] + evidence: [sqlctx-rs/tests/wasm_parity_subset.rs] structured_query_compile: label: Structured metric/dimension query compilation python: @@ -79,14 +79,14 @@ capabilities: fixtures: all_valid rust: status: supported - evidence: [sidemantic-rs/tests/native_fixtures.rs] + evidence: [sqlctx-rs/tests/native_fixtures.rs] fixtures: all_valid duckdb_extension: status: partial - evidence: [sidemantic-duckdb/test/sql/sidemantic.test] + evidence: [sqlctx-duckdb/test/sql/sqlctx.test] wasm: status: partial - evidence: [sidemantic-rs/tests/wasm_parity_subset.rs] + evidence: [sqlctx-rs/tests/wasm_parity_subset.rs] semantic_sql_rewrite: label: Semantic SQL rewrite python: @@ -94,14 +94,14 @@ capabilities: evidence: [tests/native_compat/test_basic_model_fixture.py, tests/queries/test_sql_rewriter.py] rust: status: partial - evidence: [sidemantic-rs/tests/native_fixtures.rs] + evidence: [sqlctx-rs/tests/native_fixtures.rs] detail: Native subset; Python remains the full rewrite implementation. duckdb_extension: status: partial - evidence: [sidemantic-duckdb/test/sql/sidemantic.test] + evidence: [sqlctx-duckdb/test/sql/sqlctx.test] wasm: status: partial - evidence: [sidemantic-rs/tests/wasm_parity_subset.rs] + evidence: [sqlctx-rs/tests/wasm_parity_subset.rs] relationships_and_joins: label: Relationships, composite keys, and multi-hop joins python: @@ -110,14 +110,14 @@ capabilities: fixtures: [relationships, composite_keys, multi_hop_joins, many_to_many_relationship] rust: status: supported - evidence: [sidemantic-rs/tests/native_fixtures.rs] + evidence: [sqlctx-rs/tests/native_fixtures.rs] fixtures: [relationships, composite_keys, multi_hop_joins, many_to_many_relationship] duckdb_extension: status: partial - evidence: [sidemantic-duckdb/test/sql/sidemantic_native_contract.test] + evidence: [sqlctx-duckdb/test/sql/sqlctx_native_contract.test] wasm: status: partial - evidence: [sidemantic-rs/tests/wasm_parity_subset.rs] + evidence: [sqlctx-rs/tests/wasm_parity_subset.rs] advanced_metrics: label: Cumulative, comparison, conversion, retention, and cohort metrics python: @@ -126,13 +126,13 @@ capabilities: fixtures: [advanced_metrics] rust: status: supported - evidence: [sidemantic-rs/tests/native_fixtures.rs] + evidence: [sqlctx-rs/tests/native_fixtures.rs] fixtures: [advanced_metrics] duckdb_extension: status: unsupported wasm: status: partial - evidence: [sidemantic-rs/tests/wasm_parity_subset.rs] + evidence: [sqlctx-rs/tests/wasm_parity_subset.rs] preaggregation_routing: label: Pre-aggregation routing python: @@ -141,13 +141,13 @@ capabilities: fixtures: [preaggregation_routing] rust: status: supported - evidence: [sidemantic-rs/tests/native_fixtures.rs] + evidence: [sqlctx-rs/tests/native_fixtures.rs] fixtures: [preaggregation_routing] duckdb_extension: status: unsupported wasm: status: partial - evidence: [sidemantic-rs/tests/wasm_parity_subset.rs] + evidence: [sqlctx-rs/tests/wasm_parity_subset.rs] duckdb_execution: label: DuckDB query execution python: @@ -155,10 +155,10 @@ capabilities: evidence: [tests/native_compat/test_basic_model_fixture.py] rust: status: supported - evidence: [sidemantic-rs/tests/adbc_duckdb_e2e.rs] + evidence: [sqlctx-rs/tests/adbc_duckdb_e2e.rs] duckdb_extension: status: supported - evidence: [sidemantic-duckdb/test/sql/sidemantic.test] + evidence: [sqlctx-duckdb/test/sql/sqlctx.test] wasm: status: unsupported external_format_import: @@ -190,7 +190,7 @@ capabilities: evidence: [tests/server/test_api_server.py, tests/server/test_connection.py, tests/widget/test_widget_examples.py] rust: status: partial - evidence: [sidemantic-rs/tests/http_server.rs, sidemantic-rs/tests/mcp_protocol.rs] + evidence: [sqlctx-rs/tests/http_server.rs, sqlctx-rs/tests/mcp_protocol.rs] detail: Experimental native HTTP/MCP binaries; no Python widget/notebook parity. duckdb_extension: status: unsupported diff --git a/docs/runtime-feature-matrix.md b/docs/runtime-feature-matrix.md index 7a52d74f0..79a886f86 100644 --- a/docs/runtime-feature-matrix.md +++ b/docs/runtime-feature-matrix.md @@ -2,7 +2,7 @@ -This matrix describes the checked runtime contract for native Sidemantic projects. A capability +This matrix describes the checked runtime contract for native sqlctx projects. A capability status is meaningful only within the lifecycle and scope of its runtime. ## Runtime lifecycle @@ -11,8 +11,8 @@ status is meaningful only within the lifecycle and scope of its runtime. |---|---|---| | Python | Stable | Canonical import, migration, orchestration, and full semantic-query runtime. | | Rust native runtime | Experimental | Native format runtime; not an external-format compatibility layer. | -| DuckDB extension | Experimental | DuckDB-native wrapper around selected sidemantic-rs contracts. | -| WASM | Experimental | Browser-safe sidemantic-rs subset; not the Python/Pyodide product surface. | +| DuckDB extension | Experimental | DuckDB-native wrapper around selected sqlctx-rs contracts. | +| WASM | Experimental | Browser-safe sqlctx-rs subset; not the Python/Pyodide product surface. | Rust, DuckDB extension, and WASM surfaces are experimental even where an individual capability is fixture-backed. `Supported` does not promote an experimental runtime to stable. @@ -39,64 +39,64 @@ capability is fixture-backed. `Supported` does not promote an experimental runti ### Shared native YAML/SQL fixture contract - Python: status: `supported`; evidence: [`tests/native_compat/test_basic_model_fixture.py`](../tests/native_compat/test_basic_model_fixture.py); fixtures: `all` shared fixtures. -- Rust native runtime: status: `supported`; evidence: [`sidemantic-rs/tests/native_fixtures.rs`](../sidemantic-rs/tests/native_fixtures.rs); fixtures: `all` shared fixtures. -- DuckDB extension: status: `partial`; evidence: [`sidemantic-duckdb/test/sql/sidemantic_native_contract.test`](../sidemantic-duckdb/test/sql/sidemantic_native_contract.test). -- WASM: status: `partial`; evidence: [`sidemantic-rs/tests/wasm_parity_subset.rs`](../sidemantic-rs/tests/wasm_parity_subset.rs). +- Rust native runtime: status: `supported`; evidence: [`sqlctx-rs/tests/native_fixtures.rs`](../sqlctx-rs/tests/native_fixtures.rs); fixtures: `all` shared fixtures. +- DuckDB extension: status: `partial`; evidence: [`sqlctx-duckdb/test/sql/sqlctx_native_contract.test`](../sqlctx-duckdb/test/sql/sqlctx_native_contract.test). +- WASM: status: `partial`; evidence: [`sqlctx-rs/tests/wasm_parity_subset.rs`](../sqlctx-rs/tests/wasm_parity_subset.rs). ### Native YAML load - Python: status: `supported`; evidence: [`tests/native_compat/test_basic_model_fixture.py`](../tests/native_compat/test_basic_model_fixture.py); fixtures: `basic_model`. -- Rust native runtime: status: `supported`; evidence: [`sidemantic-rs/tests/native_fixtures.rs`](../sidemantic-rs/tests/native_fixtures.rs); fixtures: `basic_model`. -- DuckDB extension: status: `supported`; evidence: [`sidemantic-duckdb/test/sql/sidemantic_native_contract.test`](../sidemantic-duckdb/test/sql/sidemantic_native_contract.test). -- WASM: status: `supported`; evidence: [`sidemantic-rs/tests/wasm_parity_subset.rs`](../sidemantic-rs/tests/wasm_parity_subset.rs). +- Rust native runtime: status: `supported`; evidence: [`sqlctx-rs/tests/native_fixtures.rs`](../sqlctx-rs/tests/native_fixtures.rs); fixtures: `basic_model`. +- DuckDB extension: status: `supported`; evidence: [`sqlctx-duckdb/test/sql/sqlctx_native_contract.test`](../sqlctx-duckdb/test/sql/sqlctx_native_contract.test). +- WASM: status: `supported`; evidence: [`sqlctx-rs/tests/wasm_parity_subset.rs`](../sqlctx-rs/tests/wasm_parity_subset.rs). ### Native SQL and frontmatter definitions - Python: status: `supported`; evidence: [`tests/native_compat/test_basic_model_fixture.py`](../tests/native_compat/test_basic_model_fixture.py); fixtures: `native_sql_definitions`, `sql_frontmatter_definitions`, `compact_sql_model`. -- Rust native runtime: status: `supported`; evidence: [`sidemantic-rs/tests/native_fixtures.rs`](../sidemantic-rs/tests/native_fixtures.rs); fixtures: `native_sql_definitions`, `sql_frontmatter_definitions`, `compact_sql_model`. -- DuckDB extension: status: `partial`; evidence: [`sidemantic-duckdb/test/sql/sidemantic_native_contract.test`](../sidemantic-duckdb/test/sql/sidemantic_native_contract.test). -- WASM: status: `partial`; evidence: [`sidemantic-rs/tests/wasm_parity_subset.rs`](../sidemantic-rs/tests/wasm_parity_subset.rs). +- Rust native runtime: status: `supported`; evidence: [`sqlctx-rs/tests/native_fixtures.rs`](../sqlctx-rs/tests/native_fixtures.rs); fixtures: `native_sql_definitions`, `sql_frontmatter_definitions`, `compact_sql_model`. +- DuckDB extension: status: `partial`; evidence: [`sqlctx-duckdb/test/sql/sqlctx_native_contract.test`](../sqlctx-duckdb/test/sql/sqlctx_native_contract.test). +- WASM: status: `partial`; evidence: [`sqlctx-rs/tests/wasm_parity_subset.rs`](../sqlctx-rs/tests/wasm_parity_subset.rs). ### Structured metric/dimension query compilation - Python: status: `supported`; evidence: [`tests/native_compat/test_basic_model_fixture.py`](../tests/native_compat/test_basic_model_fixture.py); fixtures: `all_valid` shared fixtures. -- Rust native runtime: status: `supported`; evidence: [`sidemantic-rs/tests/native_fixtures.rs`](../sidemantic-rs/tests/native_fixtures.rs); fixtures: `all_valid` shared fixtures. -- DuckDB extension: status: `partial`; evidence: [`sidemantic-duckdb/test/sql/sidemantic.test`](../sidemantic-duckdb/test/sql/sidemantic.test). -- WASM: status: `partial`; evidence: [`sidemantic-rs/tests/wasm_parity_subset.rs`](../sidemantic-rs/tests/wasm_parity_subset.rs). +- Rust native runtime: status: `supported`; evidence: [`sqlctx-rs/tests/native_fixtures.rs`](../sqlctx-rs/tests/native_fixtures.rs); fixtures: `all_valid` shared fixtures. +- DuckDB extension: status: `partial`; evidence: [`sqlctx-duckdb/test/sql/sqlctx.test`](../sqlctx-duckdb/test/sql/sqlctx.test). +- WASM: status: `partial`; evidence: [`sqlctx-rs/tests/wasm_parity_subset.rs`](../sqlctx-rs/tests/wasm_parity_subset.rs). ### Semantic SQL rewrite - Python: status: `supported`; evidence: [`tests/native_compat/test_basic_model_fixture.py`](../tests/native_compat/test_basic_model_fixture.py), [`tests/queries/test_sql_rewriter.py`](../tests/queries/test_sql_rewriter.py). -- Rust native runtime: status: `partial`; evidence: [`sidemantic-rs/tests/native_fixtures.rs`](../sidemantic-rs/tests/native_fixtures.rs). -- DuckDB extension: status: `partial`; evidence: [`sidemantic-duckdb/test/sql/sidemantic.test`](../sidemantic-duckdb/test/sql/sidemantic.test). -- WASM: status: `partial`; evidence: [`sidemantic-rs/tests/wasm_parity_subset.rs`](../sidemantic-rs/tests/wasm_parity_subset.rs). +- Rust native runtime: status: `partial`; evidence: [`sqlctx-rs/tests/native_fixtures.rs`](../sqlctx-rs/tests/native_fixtures.rs). +- DuckDB extension: status: `partial`; evidence: [`sqlctx-duckdb/test/sql/sqlctx.test`](../sqlctx-duckdb/test/sql/sqlctx.test). +- WASM: status: `partial`; evidence: [`sqlctx-rs/tests/wasm_parity_subset.rs`](../sqlctx-rs/tests/wasm_parity_subset.rs). ### Relationships, composite keys, and multi-hop joins - Python: status: `supported`; evidence: [`tests/native_compat/test_basic_model_fixture.py`](../tests/native_compat/test_basic_model_fixture.py); fixtures: `relationships`, `composite_keys`, `multi_hop_joins`, `many_to_many_relationship`. -- Rust native runtime: status: `supported`; evidence: [`sidemantic-rs/tests/native_fixtures.rs`](../sidemantic-rs/tests/native_fixtures.rs); fixtures: `relationships`, `composite_keys`, `multi_hop_joins`, `many_to_many_relationship`. -- DuckDB extension: status: `partial`; evidence: [`sidemantic-duckdb/test/sql/sidemantic_native_contract.test`](../sidemantic-duckdb/test/sql/sidemantic_native_contract.test). -- WASM: status: `partial`; evidence: [`sidemantic-rs/tests/wasm_parity_subset.rs`](../sidemantic-rs/tests/wasm_parity_subset.rs). +- Rust native runtime: status: `supported`; evidence: [`sqlctx-rs/tests/native_fixtures.rs`](../sqlctx-rs/tests/native_fixtures.rs); fixtures: `relationships`, `composite_keys`, `multi_hop_joins`, `many_to_many_relationship`. +- DuckDB extension: status: `partial`; evidence: [`sqlctx-duckdb/test/sql/sqlctx_native_contract.test`](../sqlctx-duckdb/test/sql/sqlctx_native_contract.test). +- WASM: status: `partial`; evidence: [`sqlctx-rs/tests/wasm_parity_subset.rs`](../sqlctx-rs/tests/wasm_parity_subset.rs). ### Cumulative, comparison, conversion, retention, and cohort metrics - Python: status: `supported`; evidence: [`tests/native_compat/test_basic_model_fixture.py`](../tests/native_compat/test_basic_model_fixture.py); fixtures: `advanced_metrics`. -- Rust native runtime: status: `supported`; evidence: [`sidemantic-rs/tests/native_fixtures.rs`](../sidemantic-rs/tests/native_fixtures.rs); fixtures: `advanced_metrics`. +- Rust native runtime: status: `supported`; evidence: [`sqlctx-rs/tests/native_fixtures.rs`](../sqlctx-rs/tests/native_fixtures.rs); fixtures: `advanced_metrics`. - DuckDB extension: status: `unsupported`. -- WASM: status: `partial`; evidence: [`sidemantic-rs/tests/wasm_parity_subset.rs`](../sidemantic-rs/tests/wasm_parity_subset.rs). +- WASM: status: `partial`; evidence: [`sqlctx-rs/tests/wasm_parity_subset.rs`](../sqlctx-rs/tests/wasm_parity_subset.rs). ### Pre-aggregation routing - Python: status: `supported`; evidence: [`tests/native_compat/test_basic_model_fixture.py`](../tests/native_compat/test_basic_model_fixture.py); fixtures: `preaggregation_routing`. -- Rust native runtime: status: `supported`; evidence: [`sidemantic-rs/tests/native_fixtures.rs`](../sidemantic-rs/tests/native_fixtures.rs); fixtures: `preaggregation_routing`. +- Rust native runtime: status: `supported`; evidence: [`sqlctx-rs/tests/native_fixtures.rs`](../sqlctx-rs/tests/native_fixtures.rs); fixtures: `preaggregation_routing`. - DuckDB extension: status: `unsupported`. -- WASM: status: `partial`; evidence: [`sidemantic-rs/tests/wasm_parity_subset.rs`](../sidemantic-rs/tests/wasm_parity_subset.rs). +- WASM: status: `partial`; evidence: [`sqlctx-rs/tests/wasm_parity_subset.rs`](../sqlctx-rs/tests/wasm_parity_subset.rs). ### DuckDB query execution - Python: status: `supported`; evidence: [`tests/native_compat/test_basic_model_fixture.py`](../tests/native_compat/test_basic_model_fixture.py). -- Rust native runtime: status: `supported`; evidence: [`sidemantic-rs/tests/adbc_duckdb_e2e.rs`](../sidemantic-rs/tests/adbc_duckdb_e2e.rs). -- DuckDB extension: status: `supported`; evidence: [`sidemantic-duckdb/test/sql/sidemantic.test`](../sidemantic-duckdb/test/sql/sidemantic.test). +- Rust native runtime: status: `supported`; evidence: [`sqlctx-rs/tests/adbc_duckdb_e2e.rs`](../sqlctx-rs/tests/adbc_duckdb_e2e.rs). +- DuckDB extension: status: `supported`; evidence: [`sqlctx-duckdb/test/sql/sqlctx.test`](../sqlctx-duckdb/test/sql/sqlctx.test). - WASM: status: `unsupported`. ### External format import and migration @@ -116,7 +116,7 @@ capability is fixture-backed. `Supported` does not promote an experimental runti ### HTTP, PostgreSQL wire, MCP, notebook, and widget surfaces - Python: status: `supported`; evidence: [`tests/server/test_api_server.py`](../tests/server/test_api_server.py), [`tests/server/test_connection.py`](../tests/server/test_connection.py), [`tests/widget/test_widget_examples.py`](../tests/widget/test_widget_examples.py). -- Rust native runtime: status: `partial`; evidence: [`sidemantic-rs/tests/http_server.rs`](../sidemantic-rs/tests/http_server.rs), [`sidemantic-rs/tests/mcp_protocol.rs`](../sidemantic-rs/tests/mcp_protocol.rs). +- Rust native runtime: status: `partial`; evidence: [`sqlctx-rs/tests/http_server.rs`](../sqlctx-rs/tests/http_server.rs), [`sqlctx-rs/tests/mcp_protocol.rs`](../sqlctx-rs/tests/mcp_protocol.rs). - DuckDB extension: status: `unsupported`. - WASM: status: `unsupported`. diff --git a/docs/rust-engine-mode.md b/docs/rust-engine-mode.md index 4d18fcba6..395d46bc8 100644 --- a/docs/rust-engine-mode.md +++ b/docs/rust-engine-mode.md @@ -18,37 +18,39 @@ on stdout. ## CLI -Install the optional Rust backend first: +Build the optional Rust backend in the repository environment: ```bash -uv tool install "sidemantic[rust]" +git clone https://github.com/sidequery/sqlctx.git +cd sqlctx +uv sync --extra rust ``` -For a project environment, use `uv add "sidemantic[rust]"` instead. Python remains -the default engine after installation; select Rust explicitly below. +Run the examples below with `uv run` from that checkout. The default engine is +Python. Select Rust explicitly for each command. Validation: ```bash -sidemantic validate ./models --engine rust +sqlctx validate ./models --engine rust ``` Semantic SQL dry run: ```bash -sidemantic query "select orders.total_revenue from metrics" --models ./models --engine rust --dry-run +sqlctx query "select orders.total_revenue from metrics" --models ./models --engine rust --dry-run ``` Semantic SQL rewrite without execution: ```bash -sidemantic rewrite "select orders.total_revenue from metrics" --models ./models --engine rust +sqlctx rewrite "select orders.total_revenue from metrics" --models ./models --engine rust ``` Fallback: ```bash -sidemantic query "select orders.total_revenue from metrics" --models ./models --engine rust --fallback +sqlctx query "select orders.total_revenue from metrics" --models ./models --engine rust --fallback ``` ## Config @@ -85,10 +87,10 @@ propagate. `layer.last_engine_selection` reports the selected engine and reason. The older environment variables still work for CI and migration tests: -- `SIDEMANTIC_RS_SQL_GENERATOR` -- `SIDEMANTIC_RS_QUERY_VALIDATION` -- `SIDEMANTIC_RS_REWRITER` -- `SIDEMANTIC_RS_SQL_GENERATOR_VERIFY` -- `SIDEMANTIC_RS_NO_FALLBACK` +- `SQLCTX_RS_SQL_GENERATOR` +- `SQLCTX_RS_QUERY_VALIDATION` +- `SQLCTX_RS_REWRITER` +- `SQLCTX_RS_SQL_GENERATOR_VERIFY` +- `SQLCTX_RS_NO_FALLBACK` They should not be the primary documented user interface. diff --git a/docs/rust-native-runtime-packaging.md b/docs/rust-native-runtime-packaging.md index 5e1b55028..d23a8600a 100644 --- a/docs/rust-native-runtime-packaging.md +++ b/docs/rust-native-runtime-packaging.md @@ -6,12 +6,12 @@ Python remains the default engine; installing the Rust bindings does not promote | Artifact | Metadata | Release workflow | Qualification | |---|---|---|---| -| Python `sidemantic` | Root `pyproject.toml` | `publish.yml` | Full suite, built wheel and DAX smoke; separate Pyodide CI | -| Python `sidemantic-rs` (`sidemantic_rs` import) | `sidemantic-rs/pyproject.toml` | `sidemantic-rs-wheels.yml` | Install and smoke each actual native wheel, plus sdist creation | -| Rust `sidemantic` crate and base CLI | `sidemantic-rs/Cargo.toml` | `rust-runtime-release.yml` | Crate package/dry-run, packaged CLI compilation smoke | -| Rust CLI and companion binaries | `sidemantic-rs/Cargo.toml` | `release-rust-binaries.yml` | Explicit existing release tag, matching crate version, binary smoke | -| Browser `sidemantic-wasm` | `sidemantic-wasm/package.json` | `wasm-package-release.yml` | WASM and consumer smoke tests | -| DuckDB extension | `sidemantic-duckdb/Makefile` | `duckdb-extension-release.yml` | Pinned DuckDB build and sqllogictests | +| Python `sqlctx` | Root `pyproject.toml` | `publish.yml` | Full suite, built wheel and DAX smoke; separate Pyodide CI | +| Python `sqlctx-rs` (`sqlctx_rs` import) | `sqlctx-rs/pyproject.toml` | `sqlctx-rs-wheels.yml` | Install and smoke each actual native wheel, plus sdist creation | +| Rust `sqlctx` crate and base CLI | `sqlctx-rs/Cargo.toml` | `rust-runtime-release.yml` | Crate package/dry-run, packaged CLI compilation smoke | +| Rust CLI and companion binaries | `sqlctx-rs/Cargo.toml` | `release-rust-binaries.yml` | Explicit existing release tag, matching crate version, binary smoke | +| Browser `sqlctx-wasm` | `sqlctx-wasm/package.json` | `wasm-package-release.yml` | WASM and consumer smoke tests | +| DuckDB extension | `sqlctx-duckdb/Makefile` | `duckdb-extension-release.yml` | Pinned DuckDB build and sqllogictests | Workflow files live in `.github/workflows/`. Rust crate and wheel versions must match; package metadata tests enforce this. Root Python and WASM versions are @@ -24,31 +24,31 @@ The Python CLI remains the normal entry point: ```bash uv tool install . -sidemantic validate ./models +sqlctx validate ./models ``` For the optional Rust binding, install a compatible downloaded wheel into the -same environment as Sidemantic. Source installation requires a Rust toolchain: +same environment as sqlctx. Source installation requires a Rust toolchain: ```bash -uv add ./sidemantic-rs -sidemantic validate ./models --engine rust --no-fallback +uv add ./sqlctx-rs +sqlctx validate ./models --engine rust --no-fallback ``` The release wheel enables `python-adbc`. ADBC execution also requires an actual database driver; a successful compiler smoke does not establish driver availability. A compile-only binding can be built with -`uvx maturin build --manifest-path sidemantic-rs/Cargo.toml --no-default-features --features python`. +`uvx maturin build --manifest-path sqlctx-rs/Cargo.toml --no-default-features --features python`. Core Python imports and Pyodide do not require either Rust wheel. For the standalone base Rust CLI: ```bash -cargo install --path sidemantic-rs --locked -sidemantic compile --models ./models --metric orders.revenue +cargo install --path sqlctx-rs --locked +sqlctx compile --models ./models --metric orders.revenue ``` -The Rust and Python CLIs both use the executable name `sidemantic`; choose an +The Rust and Python CLIs both use the executable name `sqlctx`; choose an isolated installation or invoke the desired binary by its full path. The base Rust release uses default features and is a compiler/rewriter. It does not include ADBC execution or the optional server, MCP, LSP, and workbench binaries. The @@ -63,7 +63,7 @@ formats continue through the Python import and migration path. See For DuckDB build/load instructions, use [duckdb-extension.md](duckdb-extension.md). The release workflow currently produces Linux amd64 artifacts only. Community registry publication, signing, and additional platforms remain separate work; -`INSTALL sidemantic FROM community` is not an established installation path here. +`INSTALL sqlctx FROM community` is not an established installation path here. ## Release checks and publication boundaries diff --git a/docs/rust-native-runtime-roadmap.md b/docs/rust-native-runtime-roadmap.md index 9447f79b8..ac114b2e1 100644 --- a/docs/rust-native-runtime-roadmap.md +++ b/docs/rust-native-runtime-roadmap.md @@ -6,7 +6,7 @@ Date: 2026-05-22 ## Scope Assumption -This plan assumes the Rust port only needs to support the native Sidequery/Sidemantic adapter formats: +This plan assumes the Rust port only needs to support the native Sidequery/sqlctx adapter formats: - Native YAML semantic projects. - Native SQL semantic definitions. @@ -685,7 +685,7 @@ Recommended transition: 1. Short term: Rust matches Python behavior on native fixtures. 2. Medium term: Rust becomes the canonical engine for native compile/rewrite/validation. -3. Long term: Python delegates native compile/rewrite/validation to Rust by default when `sidemantic_rs` is installed. +3. Long term: Python delegates native compile/rewrite/validation to Rust by default when `sqlctx_rs` is installed. This avoids freezing Rust around Python implementation details that may be accidental. @@ -876,7 +876,7 @@ Unsupported SQL Good: ```text -Explicit JOIN syntax is not supported in semantic SQL. Reference fields from related models instead and let Sidemantic infer the join path. +Explicit JOIN syntax is not supported in semantic SQL. Reference fields from related models instead and let sqlctx infer the join path. ``` ## Phase 7: Make ADBC The Rust Execution Boundary @@ -923,7 +923,7 @@ Gate with env/credentials: Recommended: ```bash -sidemantic-rs query \ +sqlctx-rs query \ --models ./models \ --metric orders.total_revenue \ --dimension orders.status \ @@ -933,7 +933,7 @@ sidemantic-rs query \ Also support direct ADBC: ```bash -sidemantic-rs query \ +sqlctx-rs query \ --models ./models \ --metric orders.total_revenue \ --driver adbc_driver_duckdb \ @@ -948,10 +948,10 @@ The DuckDB extension is the strongest Rust-only product path. It should become a The extension should support: -- `sidemantic_load(yaml)` -- `sidemantic_load_file(path)` -- `sidemantic_models()` -- `sidemantic_rewrite_sql(sql)` +- `sqlctx_load(yaml)` +- `sqlctx_load_file(path)` +- `sqlctx_models()` +- `sqlctx_rewrite_sql(sql)` - `SEMANTIC SELECT` - `SEMANTIC CREATE MODEL` - `SEMANTIC CREATE METRIC` @@ -1028,7 +1028,7 @@ Every Python adapter should be able to answer: Recommended CLI: ```bash -sidemantic migrator convert \ +sqlctx migrator convert \ --from lookml \ --input ./lookml_project \ --output ./native_models \ @@ -1038,7 +1038,7 @@ sidemantic migrator convert \ Or: ```bash -sidemantic convert \ +sqlctx convert \ --from cube \ --input ./cube_models \ --output ./models \ @@ -1068,9 +1068,9 @@ Current Rust routing through environment variables is useful for internal testin Add explicit engine selection: ```bash -sidemantic validate ./models --engine rust -sidemantic query ./models --engine rust --metric orders.total_revenue -sidemantic rewrite ./models --engine rust "select orders.total_revenue from metrics" +sqlctx validate ./models --engine rust +sqlctx query ./models --engine rust --metric orders.total_revenue +sqlctx rewrite ./models --engine rust "select orders.total_revenue from metrics" ``` ### Config Mode @@ -1125,7 +1125,7 @@ Add an always-on native compatibility job: ```bash uv run pytest tests/native_compat -cd sidemantic-rs && cargo test +cd sqlctx-rs && cargo test ``` More specific: @@ -1188,8 +1188,8 @@ Keep these as separate artifacts: | Artifact | Purpose | |---|---| -| `sidemantic` Python package | Main Python CLI, adapters, existing UX. | -| `sidemantic-rs` Python extension | Rust runtime bridge for Python users. | +| `sqlctx` Python package | Main Python CLI, adapters, existing UX. | +| `sqlctx-rs` Python extension | Rust runtime bridge for Python users. | | Rust crate | Native runtime library and CLI. | | DuckDB extension | Embedded DuckDB semantic runtime. | | WASM package | Browser/runtime embedding. | @@ -1199,14 +1199,14 @@ Keep these as separate artifacts: Recommended: ```bash -uv add sidemantic -uv add sidemantic-rs +uv add git+https://github.com/sidequery/sqlctx +uv add sqlctx-rs ``` or optional extra if publication allows: ```bash -uv add "sidemantic[rust]" +uv add "sqlctx[rust]" ``` The main Python package should not require Rust until Rust installation is reliable on all target platforms. @@ -1216,13 +1216,13 @@ The main Python package should not require Rust until Rust installation is relia Potential options: ```bash -cargo install sidemantic +cargo install sqlctx ``` or GitHub release binaries: ```bash -curl -LsSf https://.../sidemantic-rs/install.sh | sh +curl -LsSf https://.../sqlctx-rs/install.sh | sh ``` The install path should be decided before documenting Rust as a primary runtime. @@ -1232,8 +1232,8 @@ The install path should be decided before documenting Rust as a primary runtime. Target: ```sql -install sidemantic from community; -load sidemantic; +install sqlctx from community; +load sqlctx; ``` Until then, docs should clearly say "build from source." @@ -1523,7 +1523,7 @@ Tasks: - Decide crate/package names. - Add Rust release workflow. -- Add `sidemantic-rs` wheel release workflow. +- Add `sqlctx-rs` wheel release workflow. - Add DuckDB extension release workflow. - Add version compatibility docs. @@ -1549,7 +1549,7 @@ Output: Use: -> The Rust runtime supports native Sidemantic YAML and SQL projects. Use Python to import or convert third-party semantic formats into native projects. +> The Rust runtime supports native sqlctx YAML and SQL projects. Use Python to import or convert third-party semantic formats into native projects. Avoid: @@ -1561,7 +1561,7 @@ Use: Avoid: -> Rust supports every Sidemantic adapter. +> Rust supports every sqlctx adapter. Use: diff --git a/docs/rust-parity-exceptions.json b/docs/rust-parity-exceptions.json index 7cba1fd4b..6cda173de 100644 --- a/docs/rust-parity-exceptions.json +++ b/docs/rust-parity-exceptions.json @@ -45,13 +45,13 @@ "selection_rules": [ { "path": "pyproject.toml", - "source": "-m 'not integration' --cov=sidemantic --cov-report=term-missing", + "source": "-m 'not integration' --cov=sqlctx --cov-report=term-missing", "category": "external-service" }, { "path": ".github/workflows/ci.yml", "line": 19, - "source": "SIDEMANTIC_ENGINE: ${{ matrix.engine }}" + "source": "SQLCTX_ENGINE: ${{ matrix.engine }}" }, { "path": ".github/workflows/ci.yml", @@ -166,12 +166,12 @@ { "path": ".github/workflows/wasm-package-release.yml", "line": 86, - "source": "bun pm pack --ignore-scripts --filename sidemantic-wasm.tgz" + "source": "bun pm pack --ignore-scripts --filename sqlctx-wasm.tgz" }, { "path": ".github/workflows/wasm-package-release.yml", "line": 113, - "source": "npm publish sidemantic-wasm.tgz --access public --ignore-scripts" + "source": "npm publish sqlctx-wasm.tgz --access public --ignore-scripts" }, { "path": ".github/workflows/yardstick-upstream.yml", @@ -187,7 +187,7 @@ "kind": "implementation-import", "category": "real-gap", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.generator import SQLGenerator", + "source": "from sqlctx.sql.generator import SQLGenerator", "rationale": "reason-2", "affected_scope": "scope-1" }, @@ -198,7 +198,7 @@ "kind": "implementation-import", "category": "real-gap", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.generator import SQLGenerator", + "source": "from sqlctx.sql.generator import SQLGenerator", "rationale": "reason-2", "affected_scope": "scope-2" }, @@ -209,7 +209,7 @@ "kind": "implementation-import", "category": "real-gap", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.generator import SQLGenerator", + "source": "from sqlctx.sql.generator import SQLGenerator", "rationale": "reason-2", "affected_scope": "scope-3" }, @@ -220,7 +220,7 @@ "kind": "implementation-import", "category": "real-gap", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.generator import SQLGenerator", + "source": "from sqlctx.sql.generator import SQLGenerator", "rationale": "reason-2", "affected_scope": "scope-4" }, @@ -231,7 +231,7 @@ "kind": "implementation-import", "category": "real-gap", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.generator import SQLGenerator", + "source": "from sqlctx.sql.generator import SQLGenerator", "rationale": "reason-2", "affected_scope": "scope-5" }, @@ -242,7 +242,7 @@ "kind": "implementation-import", "category": "real-gap", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.generator import SQLGenerator", + "source": "from sqlctx.sql.generator import SQLGenerator", "rationale": "reason-2", "affected_scope": "scope-6" }, @@ -253,7 +253,7 @@ "kind": "implementation-import", "category": "real-gap", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.generator import SQLGenerator", + "source": "from sqlctx.sql.generator import SQLGenerator", "rationale": "reason-2", "affected_scope": "scope-7" }, @@ -264,7 +264,7 @@ "kind": "implementation-import", "category": "real-gap", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.generator import SQLGenerator", + "source": "from sqlctx.sql.generator import SQLGenerator", "rationale": "reason-2", "affected_scope": "scope-8" }, @@ -275,7 +275,7 @@ "kind": "implementation-import", "category": "real-gap", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.generator import SQLGenerator", + "source": "from sqlctx.sql.generator import SQLGenerator", "rationale": "reason-2", "affected_scope": "scope-9" }, @@ -286,7 +286,7 @@ "kind": "implementation-import", "category": "real-gap", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.generator import SQLGenerator", + "source": "from sqlctx.sql.generator import SQLGenerator", "rationale": "reason-2", "affected_scope": "scope-10" }, @@ -297,7 +297,7 @@ "kind": "implementation-import", "category": "real-gap", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.generator import SQLGenerator", + "source": "from sqlctx.sql.generator import SQLGenerator", "rationale": "reason-2", "affected_scope": "scope-11" }, @@ -308,7 +308,7 @@ "kind": "implementation-import", "category": "real-gap", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.generator import SQLGenerator", + "source": "from sqlctx.sql.generator import SQLGenerator", "rationale": "reason-2", "affected_scope": "scope-12" }, @@ -319,7 +319,7 @@ "kind": "engine-control", "category": "real-gap", "exclusion_direction": "rust-coverage-exclusion", - "source": "os.environ.get(\"SIDEMANTIC_OSI_BACKEND\", \"python\")", + "source": "os.environ.get(\"SQLCTX_OSI_BACKEND\", \"python\")", "rationale": "reason-3", "affected_scope": "scope-13" }, @@ -330,7 +330,7 @@ "kind": "importorskip", "category": "optional-host", "exclusion_direction": "both-engines", - "source": "pytest.importorskip(\"sidemantic_rs\")", + "source": "pytest.importorskip(\"sqlctx_rs\")", "rationale": "reason-4", "affected_scope": "scope-13" }, @@ -341,7 +341,7 @@ "kind": "legacy-adapter-import", "category": "real-gap", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.adapters.osi import LegacyOSIAdapter as OSIAdapter", + "source": "from sqlctx.adapters.osi import LegacyOSIAdapter as OSIAdapter", "rationale": "reason-5", "affected_scope": "scope-14" }, @@ -352,7 +352,7 @@ "kind": "legacy-adapter-import", "category": "real-gap", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.adapters.osi import LegacyOSIAdapter as OSIAdapter", + "source": "from sqlctx.adapters.osi import LegacyOSIAdapter as OSIAdapter", "rationale": "reason-5", "affected_scope": "scope-15" }, @@ -363,18 +363,18 @@ "kind": "importorskip", "category": "optional-host", "exclusion_direction": "both-engines", - "source": "pytest.importorskip(\"sidemantic_rs\")", + "source": "pytest.importorskip(\"sqlctx_rs\")", "rationale": "reason-4", "affected_scope": "scope-16" }, { - "path": "tests/adapters/sidemantic_adapter/test_parsing.py", + "path": "tests/adapters/sqlctx_adapter/test_parsing.py", "line": 1325, "scope": "test_dimension_window_in_sql_generation", "kind": "implementation-import", "category": "real-gap", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.generator import SQLGenerator", + "source": "from sqlctx.sql.generator import SQLGenerator", "rationale": "reason-2", "affected_scope": "scope-17" }, @@ -385,7 +385,7 @@ "kind": "implementation-import", "category": "real-gap", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.generator import SQLGenerator", + "source": "from sqlctx.sql.generator import SQLGenerator", "rationale": "reason-2", "affected_scope": "scope-18" }, @@ -424,7 +424,7 @@ "kind": "legacy-adapter-import", "category": "real-gap", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.adapters.osi import LegacyOSIAdapter as OSIAdapter", + "source": "from sqlctx.adapters.osi import LegacyOSIAdapter as OSIAdapter", "rationale": "reason-5", "affected_scope": "scope-21" }, @@ -435,7 +435,7 @@ "kind": "implementation-import", "category": "real-gap", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.generator import SQLGenerator", + "source": "from sqlctx.sql.generator import SQLGenerator", "rationale": "reason-2", "affected_scope": "scope-22" }, @@ -446,7 +446,7 @@ "kind": "legacy-adapter-import", "category": "real-gap", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.adapters.osi import LegacyOSIAdapter as OSIAdapter", + "source": "from sqlctx.adapters.osi import LegacyOSIAdapter as OSIAdapter", "rationale": "reason-5", "affected_scope": "scope-23" }, @@ -457,7 +457,7 @@ "kind": "implementation-import", "category": "real-gap", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.generator import SQLGenerator", + "source": "from sqlctx.sql.generator import SQLGenerator", "rationale": "reason-2", "affected_scope": "scope-24" }, @@ -468,7 +468,7 @@ "kind": "implementation-import", "category": "real-gap", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.generator import SQLGenerator", + "source": "from sqlctx.sql.generator import SQLGenerator", "rationale": "reason-2", "affected_scope": "scope-25" }, @@ -479,7 +479,7 @@ "kind": "skip", "category": "optional-host", "exclusion_direction": "both-engines", - "source": "pytest.skip(\"sidemantic_dax not installed\")", + "source": "pytest.skip(\"sqlctx_dax not installed\")", "rationale": "reason-6", "affected_scope": "scope-26" }, @@ -493,7 +493,7 @@ "conditions": [ "'native module is not available' in str(exc)" ], - "source": "pytest.skip(\"sidemantic_dax native module not available\")", + "source": "pytest.skip(\"sqlctx_dax native module not available\")", "rationale": "reason-6", "affected_scope": "scope-26" }, @@ -504,7 +504,7 @@ "kind": "importorskip", "category": "optional-host", "exclusion_direction": "both-engines", - "source": "pytest.importorskip(\"sidemantic_dax\")", + "source": "pytest.importorskip(\"sqlctx_dax\")", "rationale": "reason-4", "affected_scope": "scope-27" }, @@ -515,7 +515,7 @@ "kind": "importorskip", "category": "optional-host", "exclusion_direction": "both-engines", - "source": "pytest.importorskip(\"sidemantic_dax\")", + "source": "pytest.importorskip(\"sqlctx_dax\")", "rationale": "reason-4", "affected_scope": "scope-28" }, @@ -526,7 +526,7 @@ "kind": "importorskip", "category": "optional-host", "exclusion_direction": "both-engines", - "source": "pytest.importorskip(\"sidemantic_dax\")", + "source": "pytest.importorskip(\"sqlctx_dax\")", "rationale": "reason-4", "affected_scope": "scope-29" }, @@ -537,7 +537,7 @@ "kind": "importorskip", "category": "optional-host", "exclusion_direction": "both-engines", - "source": "pytest.importorskip(\"sidemantic_dax\")", + "source": "pytest.importorskip(\"sqlctx_dax\")", "rationale": "reason-4", "affected_scope": "scope-30" }, @@ -548,7 +548,7 @@ "kind": "importorskip", "category": "optional-host", "exclusion_direction": "both-engines", - "source": "pytest.importorskip(\"sidemantic_dax\")", + "source": "pytest.importorskip(\"sqlctx_dax\")", "rationale": "reason-4", "affected_scope": "scope-31" }, @@ -559,7 +559,7 @@ "kind": "importorskip", "category": "optional-host", "exclusion_direction": "both-engines", - "source": "pytest.importorskip(\"sidemantic_dax\")", + "source": "pytest.importorskip(\"sqlctx_dax\")", "rationale": "reason-4", "affected_scope": "scope-32" }, @@ -570,7 +570,7 @@ "kind": "importorskip", "category": "optional-host", "exclusion_direction": "both-engines", - "source": "pytest.importorskip(\"sidemantic_dax\")", + "source": "pytest.importorskip(\"sqlctx_dax\")", "rationale": "reason-4", "affected_scope": "scope-33" }, @@ -581,7 +581,7 @@ "kind": "importorskip", "category": "optional-host", "exclusion_direction": "both-engines", - "source": "pytest.importorskip(\"sidemantic_dax\")", + "source": "pytest.importorskip(\"sqlctx_dax\")", "rationale": "reason-4", "affected_scope": "scope-34" }, @@ -592,7 +592,7 @@ "kind": "importorskip", "category": "optional-host", "exclusion_direction": "both-engines", - "source": "pytest.importorskip(\"sidemantic_dax\")", + "source": "pytest.importorskip(\"sqlctx_dax\")", "rationale": "reason-4", "affected_scope": "scope-35" }, @@ -603,7 +603,7 @@ "kind": "importorskip", "category": "optional-host", "exclusion_direction": "both-engines", - "source": "pytest.importorskip(\"sidemantic_dax\")", + "source": "pytest.importorskip(\"sqlctx_dax\")", "rationale": "reason-4", "affected_scope": "scope-36" }, @@ -614,7 +614,7 @@ "kind": "importorskip", "category": "optional-host", "exclusion_direction": "both-engines", - "source": "pytest.importorskip(\"sidemantic_dax\")", + "source": "pytest.importorskip(\"sqlctx_dax\")", "rationale": "reason-4", "affected_scope": "scope-37" }, @@ -625,7 +625,7 @@ "kind": "importorskip", "category": "optional-host", "exclusion_direction": "both-engines", - "source": "pytest.importorskip(\"sidemantic_dax\")", + "source": "pytest.importorskip(\"sqlctx_dax\")", "rationale": "reason-4", "affected_scope": "scope-38" }, @@ -636,7 +636,7 @@ "kind": "importorskip", "category": "optional-host", "exclusion_direction": "both-engines", - "source": "pytest.importorskip(\"sidemantic_dax\")", + "source": "pytest.importorskip(\"sqlctx_dax\")", "rationale": "reason-4", "affected_scope": "scope-39" }, @@ -702,7 +702,7 @@ "kind": "implementation-import", "category": "real-gap", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.generator import SQLGenerator", + "source": "from sqlctx.sql.generator import SQLGenerator", "rationale": "reason-2", "affected_scope": "scope-43" }, @@ -779,7 +779,7 @@ "kind": "implementation-import", "category": "real-gap", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.query_rewriter import QueryRewriter", + "source": "from sqlctx.sql.query_rewriter import QueryRewriter", "rationale": "reason-2", "affected_scope": "scope-50" }, @@ -790,7 +790,7 @@ "kind": "implementation-import", "category": "intentional-Python-only", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.generator import SQLGenerator", + "source": "from sqlctx.sql.generator import SQLGenerator", "rationale": "reason-2", "affected_scope": "scope-51" }, @@ -801,7 +801,7 @@ "kind": "implementation-import", "category": "real-gap", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.generator import SQLGenerator", + "source": "from sqlctx.sql.generator import SQLGenerator", "rationale": "reason-2", "affected_scope": "scope-52" }, @@ -812,7 +812,7 @@ "kind": "importorskip", "category": "optional-host", "exclusion_direction": "both-engines", - "source": "pytest.importorskip(\"sidemantic_dax.ast\")", + "source": "pytest.importorskip(\"sqlctx_dax.ast\")", "rationale": "reason-4", "affected_scope": "scope-53" }, @@ -826,7 +826,7 @@ "conditions": [ "'native module is not available' in str(exc)" ], - "source": "pytest.skip(\"sidemantic_dax native module not available\")", + "source": "pytest.skip(\"sqlctx_dax native module not available\")", "rationale": "reason-6", "affected_scope": "scope-54" }, @@ -840,7 +840,7 @@ "conditions": [ "'native module is not available' in str(exc)" ], - "source": "pytest.skip(\"sidemantic_dax native module not available\")", + "source": "pytest.skip(\"sqlctx_dax native module not available\")", "rationale": "reason-6", "affected_scope": "scope-55" }, @@ -854,7 +854,7 @@ "conditions": [ "'native module is not available' in str(exc)" ], - "source": "pytest.skip(\"sidemantic_dax native module not available\")", + "source": "pytest.skip(\"sqlctx_dax native module not available\")", "rationale": "reason-6", "affected_scope": "scope-56" }, @@ -868,7 +868,7 @@ "conditions": [ "'native module is not available' in str(exc)" ], - "source": "pytest.skip(\"sidemantic_dax native module not available\")", + "source": "pytest.skip(\"sqlctx_dax native module not available\")", "rationale": "reason-6", "affected_scope": "scope-57" }, @@ -882,7 +882,7 @@ "conditions": [ "'native module is not available' in str(exc)" ], - "source": "pytest.skip(\"sidemantic_dax native module not available\")", + "source": "pytest.skip(\"sqlctx_dax native module not available\")", "rationale": "reason-6", "affected_scope": "scope-58" }, @@ -896,7 +896,7 @@ "conditions": [ "'native module is not available' in str(exc)" ], - "source": "pytest.skip(\"sidemantic_dax native module not available\")", + "source": "pytest.skip(\"sqlctx_dax native module not available\")", "rationale": "reason-6", "affected_scope": "scope-59" }, @@ -910,7 +910,7 @@ "conditions": [ "'native module is not available' in str(exc)" ], - "source": "pytest.skip(\"sidemantic_dax native module not available\")", + "source": "pytest.skip(\"sqlctx_dax native module not available\")", "rationale": "reason-6", "affected_scope": "scope-60" }, @@ -924,7 +924,7 @@ "conditions": [ "'native module is not available' in str(exc)" ], - "source": "pytest.skip(\"sidemantic_dax native module not available\")", + "source": "pytest.skip(\"sqlctx_dax native module not available\")", "rationale": "reason-6", "affected_scope": "scope-61" }, @@ -938,7 +938,7 @@ "conditions": [ "'native module is not available' in str(exc)" ], - "source": "pytest.skip(\"sidemantic_dax native module not available\")", + "source": "pytest.skip(\"sqlctx_dax native module not available\")", "rationale": "reason-6", "affected_scope": "scope-62" }, @@ -952,7 +952,7 @@ "conditions": [ "'native module is not available' in str(exc)" ], - "source": "pytest.skip(\"sidemantic_dax native module not available\")", + "source": "pytest.skip(\"sqlctx_dax native module not available\")", "rationale": "reason-6", "affected_scope": "scope-63" }, @@ -963,7 +963,7 @@ "kind": "importorskip", "category": "optional-host", "exclusion_direction": "both-engines", - "source": "pytest.importorskip(\"sidemantic_dax.ast\")", + "source": "pytest.importorskip(\"sqlctx_dax.ast\")", "rationale": "reason-4", "affected_scope": "scope-64" }, @@ -997,9 +997,9 @@ "category": "external-service", "exclusion_direction": "both-engines", "conditions": [ - "os.environ.get('SIDEMANTIC_DAX_ENGINE_CONFORMANCE') != '1'" + "os.environ.get('SQLCTX_DAX_ENGINE_CONFORMANCE') != '1'" ], - "source": "pytest.skip(\"set SIDEMANTIC_DAX_ENGINE_CONFORMANCE=1 to probe Power BI\")", + "source": "pytest.skip(\"set SQLCTX_DAX_ENGINE_CONFORMANCE=1 to probe Power BI\")", "rationale": "reason-15", "affected_scope": "scope-65" }, @@ -1021,7 +1021,7 @@ "kind": "importorskip", "category": "optional-host", "exclusion_direction": "both-engines", - "source": "pytest.importorskip(\"sidemantic_dax\")", + "source": "pytest.importorskip(\"sqlctx_dax\")", "rationale": "reason-4", "affected_scope": "scope-66" }, @@ -1035,7 +1035,7 @@ "conditions": [ "'native module is not available' in str(exc)" ], - "source": "pytest.skip(\"sidemantic_dax native module not available\")", + "source": "pytest.skip(\"sqlctx_dax native module not available\")", "rationale": "reason-6", "affected_scope": "scope-66" }, @@ -1046,7 +1046,7 @@ "kind": "importorskip", "category": "optional-host", "exclusion_direction": "both-engines", - "source": "pytest.importorskip(\"sidemantic_dax.ast\")", + "source": "pytest.importorskip(\"sqlctx_dax.ast\")", "rationale": "reason-4", "affected_scope": "scope-67" }, @@ -1057,7 +1057,7 @@ "kind": "skipif", "category": "external-service", "exclusion_direction": "both-engines", - "source": "pytest.mark.skipif(\n os.environ.get(\"SIDEMANTIC_DAX_ONLINE_CONFORMANCE\") != \"1\",\n reason=\"set SIDEMANTIC_DAX_ONLINE_CONFORMANCE=1 to probe DAX Formatter\",\n)", + "source": "pytest.mark.skipif(\n os.environ.get(\"SQLCTX_DAX_ONLINE_CONFORMANCE\") != \"1\",\n reason=\"set SQLCTX_DAX_ONLINE_CONFORMANCE=1 to probe DAX Formatter\",\n)", "rationale": "reason-15", "affected_scope": "scope-67" }, @@ -1068,7 +1068,7 @@ "kind": "importorskip", "category": "optional-host", "exclusion_direction": "both-engines", - "source": "pytest.importorskip(\"sidemantic_dax\")", + "source": "pytest.importorskip(\"sqlctx_dax\")", "rationale": "reason-4", "affected_scope": "scope-68" }, @@ -1082,7 +1082,7 @@ "conditions": [ "'native module is not available' in str(exc)" ], - "source": "pytest.skip(\"sidemantic_dax native module not available\")", + "source": "pytest.skip(\"sqlctx_dax native module not available\")", "rationale": "reason-6", "affected_scope": "scope-68" }, @@ -1906,7 +1906,7 @@ "conditions": [ "route == 'public_rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Requires a source-built Rust extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Requires a source-built Rust extension\")", "rationale": "reason-4", "affected_scope": "scope-117" }, @@ -1920,7 +1920,7 @@ "conditions": [ "engine == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Requires a source-built Rust extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Requires a source-built Rust extension\")", "rationale": "reason-4", "affected_scope": "scope-118" }, @@ -1931,7 +1931,7 @@ "kind": "implementation-import", "category": "real-gap", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.generator import SQLGenerator", + "source": "from sqlctx.sql.generator import SQLGenerator", "rationale": "reason-2", "affected_scope": "scope-119" }, @@ -1942,7 +1942,7 @@ "kind": "implementation-import", "category": "real-gap", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.generator import SQLGenerator", + "source": "from sqlctx.sql.generator import SQLGenerator", "rationale": "reason-2", "affected_scope": "scope-120" }, @@ -1956,7 +1956,7 @@ "conditions": [ "engine == 'python'" ], - "source": "pytest.importorskip(\"sidemantic_rs\")", + "source": "pytest.importorskip(\"sqlctx_rs\")", "rationale": "reason-4", "affected_scope": "scope-121" }, @@ -1967,7 +1967,7 @@ "kind": "importorskip", "category": "optional-host", "exclusion_direction": "both-engines", - "source": "pytest.importorskip(\"sidemantic_rs\")", + "source": "pytest.importorskip(\"sqlctx_rs\")", "rationale": "reason-4", "affected_scope": "scope-122" }, @@ -1981,7 +1981,7 @@ "conditions": [ "engine == 'python'" ], - "source": "pytest.importorskip(\"sidemantic_rs\")", + "source": "pytest.importorskip(\"sqlctx_rs\")", "rationale": "reason-4", "affected_scope": "scope-123" }, @@ -1995,7 +1995,7 @@ "conditions": [ "engine == 'python'" ], - "source": "pytest.importorskip(\"sidemantic_rs\")", + "source": "pytest.importorskip(\"sqlctx_rs\")", "rationale": "reason-4", "affected_scope": "scope-124" }, @@ -2006,7 +2006,7 @@ "kind": "implementation-import", "category": "real-gap", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.generator import SQLGenerator", + "source": "from sqlctx.sql.generator import SQLGenerator", "rationale": "reason-2", "affected_scope": "scope-125" }, @@ -2017,7 +2017,7 @@ "kind": "implementation-import", "category": "real-gap", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.generator import SQLGenerator", + "source": "from sqlctx.sql.generator import SQLGenerator", "rationale": "reason-2", "affected_scope": "scope-126" }, @@ -2028,7 +2028,7 @@ "kind": "implementation-import", "category": "real-gap", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.generator import SQLGenerator", + "source": "from sqlctx.sql.generator import SQLGenerator", "rationale": "reason-2", "affected_scope": "scope-127" }, @@ -2039,7 +2039,7 @@ "kind": "implementation-import", "category": "intentional-Python-only", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.generator import SQLGenerator", + "source": "from sqlctx.sql.generator import SQLGenerator", "rationale": "reason-2", "affected_scope": "scope-128" }, @@ -2050,7 +2050,7 @@ "kind": "implementation-import", "category": "real-gap", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.generator import SQLGenerator", + "source": "from sqlctx.sql.generator import SQLGenerator", "rationale": "reason-2", "affected_scope": "scope-129" }, @@ -2061,7 +2061,7 @@ "kind": "implementation-import", "category": "real-gap", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.generator import SQLGenerator", + "source": "from sqlctx.sql.generator import SQLGenerator", "rationale": "reason-2", "affected_scope": "scope-130" }, @@ -2075,7 +2075,7 @@ "conditions": [ "engine == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\")", + "source": "pytest.importorskip(\"sqlctx_rs\")", "rationale": "reason-4", "affected_scope": "scope-131" }, @@ -2089,7 +2089,7 @@ "conditions": [ "engine == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\")", + "source": "pytest.importorskip(\"sqlctx_rs\")", "rationale": "reason-4", "affected_scope": "scope-132" }, @@ -2100,7 +2100,7 @@ "kind": "implementation-import", "category": "real-gap", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.generator import SQLGenerator", + "source": "from sqlctx.sql.generator import SQLGenerator", "rationale": "reason-2", "affected_scope": "scope-133" }, @@ -2111,7 +2111,7 @@ "kind": "implementation-import", "category": "real-gap", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.generator import SQLGenerator", + "source": "from sqlctx.sql.generator import SQLGenerator", "rationale": "reason-2", "affected_scope": "scope-134" }, @@ -2122,7 +2122,7 @@ "kind": "implementation-import", "category": "real-gap", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.generator import SQLGenerator", + "source": "from sqlctx.sql.generator import SQLGenerator", "rationale": "reason-2", "affected_scope": "scope-135" }, @@ -2136,7 +2136,7 @@ "conditions": [ "engine == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\")", + "source": "pytest.importorskip(\"sqlctx_rs\")", "rationale": "reason-4", "affected_scope": "scope-136" }, @@ -2147,7 +2147,7 @@ "kind": "implementation-import", "category": "intentional-Python-only", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.query_rewriter import QueryRewriter", + "source": "from sqlctx.sql.query_rewriter import QueryRewriter", "rationale": "reason-2", "affected_scope": "scope-137" }, @@ -2158,7 +2158,7 @@ "kind": "importorskip", "category": "optional-host", "exclusion_direction": "both-engines", - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Requires the built Rust extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Requires the built Rust extension\")", "rationale": "reason-4", "affected_scope": "scope-138" }, @@ -2169,7 +2169,7 @@ "kind": "importorskip", "category": "optional-host", "exclusion_direction": "both-engines", - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Requires the built Rust extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Requires the built Rust extension\")", "rationale": "reason-4", "affected_scope": "scope-139" }, @@ -2180,7 +2180,7 @@ "kind": "implementation-import", "category": "intentional-Python-only", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.query_rewriter import QueryRewriter", + "source": "from sqlctx.sql.query_rewriter import QueryRewriter", "rationale": "reason-2", "affected_scope": "scope-140" }, @@ -2191,7 +2191,7 @@ "kind": "implementation-import", "category": "intentional-Python-only", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.query_rewriter import QueryRewriter", + "source": "from sqlctx.sql.query_rewriter import QueryRewriter", "rationale": "reason-2", "affected_scope": "scope-141" }, @@ -2202,7 +2202,7 @@ "kind": "implementation-import", "category": "real-gap", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.query_rewriter import QueryRewriter", + "source": "from sqlctx.sql.query_rewriter import QueryRewriter", "rationale": "reason-2", "affected_scope": "scope-142" }, @@ -2214,9 +2214,9 @@ "category": "external-service", "exclusion_direction": "both-engines", "conditions": [ - "not _env_flag('SIDEMANTIC_YARDSTICK_UPSTREAM_TESTS')" + "not _env_flag('SQLCTX_YARDSTICK_UPSTREAM_TESTS')" ], - "source": "pytest.skip(\"Set SIDEMANTIC_YARDSTICK_UPSTREAM_TESTS=1 to fetch and replay live upstream Yardstick tests\")", + "source": "pytest.skip(\"Set SQLCTX_YARDSTICK_UPSTREAM_TESTS=1 to fetch and replay live upstream Yardstick tests\")", "rationale": "reason-15", "affected_scope": "scope-143" }, @@ -2244,7 +2244,7 @@ "conditions": [ "request.param == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Absent count acceptance requires the installed Rust extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Absent count acceptance requires the installed Rust extension\")", "rationale": "reason-4", "affected_scope": "scope-145" }, @@ -2258,7 +2258,7 @@ "conditions": [ "request.param == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"CLI acceptance requires the real Rust extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"CLI acceptance requires the real Rust extension\")", "rationale": "reason-4", "affected_scope": "scope-146" }, @@ -2272,7 +2272,7 @@ "conditions": [ "request.param == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Explore acceptance requires the real extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Explore acceptance requires the real extension\")", "rationale": "reason-4", "affected_scope": "scope-147" }, @@ -2286,7 +2286,7 @@ "conditions": [ "request.param == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Alias acceptance requires the real Rust extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Alias acceptance requires the real Rust extension\")", "rationale": "reason-4", "affected_scope": "scope-148" }, @@ -2297,7 +2297,7 @@ "kind": "importorskip", "category": "optional-host", "exclusion_direction": "both-engines", - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Alias rejection requires the real Rust extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Alias rejection requires the real Rust extension\")", "rationale": "reason-4", "affected_scope": "scope-149" }, @@ -2311,7 +2311,7 @@ "conditions": [ "request.param == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Requires the real Rust extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Requires the real Rust extension\")", "rationale": "reason-4", "affected_scope": "scope-150" }, @@ -2325,7 +2325,7 @@ "conditions": [ "request.param == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Requires the real Rust extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Requires the real Rust extension\")", "rationale": "reason-4", "affected_scope": "scope-151" }, @@ -2367,7 +2367,7 @@ "conditions": [ "engine == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"The real Rust extension must be installed for acceptance\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"The real Rust extension must be installed for acceptance\")", "rationale": "reason-4", "affected_scope": "scope-154" }, @@ -2381,7 +2381,7 @@ "conditions": [ "engine == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Cohort acceptance requires the real extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Cohort acceptance requires the real extension\")", "rationale": "reason-4", "affected_scope": "scope-155" }, @@ -2395,7 +2395,7 @@ "conditions": [ "request.param == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Complete filter acceptance requires the real Rust extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Complete filter acceptance requires the real Rust extension\")", "rationale": "reason-4", "affected_scope": "scope-156" }, @@ -2406,7 +2406,7 @@ "kind": "importorskip", "category": "optional-host", "exclusion_direction": "both-engines", - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Complete filter rejection requires the real Rust extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Complete filter rejection requires the real Rust extension\")", "rationale": "reason-4", "affected_scope": "scope-157" }, @@ -2420,7 +2420,7 @@ "conditions": [ "engine == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\")", + "source": "pytest.importorskip(\"sqlctx_rs\")", "rationale": "reason-4", "affected_scope": "scope-158" }, @@ -2434,7 +2434,7 @@ "conditions": [ "engine == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\")", + "source": "pytest.importorskip(\"sqlctx_rs\")", "rationale": "reason-4", "affected_scope": "scope-159" }, @@ -2445,7 +2445,7 @@ "kind": "importorskip", "category": "optional-host", "exclusion_direction": "both-engines", - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Complete filter rejection requires the real Rust extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Complete filter rejection requires the real Rust extension\")", "rationale": "reason-4", "affected_scope": "scope-160" }, @@ -2467,7 +2467,7 @@ "kind": "implementation-import", "category": "intentional-Python-only", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.generator import SQLGenerator", + "source": "from sqlctx.sql.generator import SQLGenerator", "rationale": "reason-2", "affected_scope": "scope-161" }, @@ -2489,7 +2489,7 @@ "kind": "implementation-import", "category": "intentional-Python-only", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.generator import SQLGenerator", + "source": "from sqlctx.sql.generator import SQLGenerator", "rationale": "reason-2", "affected_scope": "scope-162" }, @@ -2500,7 +2500,7 @@ "kind": "importorskip", "category": "optional-host", "exclusion_direction": "both-engines", - "source": "pytest.importorskip(\"sidemantic_rs\")", + "source": "pytest.importorskip(\"sqlctx_rs\")", "rationale": "reason-4", "affected_scope": "scope-163" }, @@ -2522,7 +2522,7 @@ "kind": "implementation-import", "category": "real-gap", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.generator import SQLGenerator", + "source": "from sqlctx.sql.generator import SQLGenerator", "rationale": "reason-2", "affected_scope": "scope-164" }, @@ -2536,7 +2536,7 @@ "conditions": [ "not dsn" ], - "source": "pytest.skip(\"PostgreSQL execution requires SIDEMANTIC_TEST_POSTGRES_DSN\")", + "source": "pytest.skip(\"PostgreSQL execution requires SQLCTX_TEST_POSTGRES_DSN\")", "rationale": "reason-15", "affected_scope": "scope-165" }, @@ -2550,7 +2550,7 @@ "conditions": [ "not dsn" ], - "source": "pytest.skip(\"PostgreSQL execution requires SIDEMANTIC_TEST_POSTGRES_DSN\")", + "source": "pytest.skip(\"PostgreSQL execution requires SQLCTX_TEST_POSTGRES_DSN\")", "rationale": "reason-15", "affected_scope": "scope-166" }, @@ -2564,7 +2564,7 @@ "conditions": [ "not dsn" ], - "source": "pytest.skip(\"PostgreSQL execution requires SIDEMANTIC_TEST_POSTGRES_DSN\")", + "source": "pytest.skip(\"PostgreSQL execution requires SQLCTX_TEST_POSTGRES_DSN\")", "rationale": "reason-15", "affected_scope": "scope-167" }, @@ -2578,7 +2578,7 @@ "conditions": [ "not dsn" ], - "source": "pytest.skip(\"PostgreSQL execution requires SIDEMANTIC_TEST_POSTGRES_DSN\")", + "source": "pytest.skip(\"PostgreSQL execution requires SQLCTX_TEST_POSTGRES_DSN\")", "rationale": "reason-15", "affected_scope": "scope-168" }, @@ -2589,7 +2589,7 @@ "kind": "importorskip", "category": "optional-host", "exclusion_direction": "both-engines", - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Computed-key acceptance requires the real Rust extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Computed-key acceptance requires the real Rust extension\")", "rationale": "reason-4", "affected_scope": "scope-169" }, @@ -2600,7 +2600,7 @@ "kind": "importorskip", "category": "optional-host", "exclusion_direction": "both-engines", - "source": "pytest.importorskip(\"sidemantic_rs\")", + "source": "pytest.importorskip(\"sqlctx_rs\")", "rationale": "reason-4", "affected_scope": "scope-170" }, @@ -2614,7 +2614,7 @@ "conditions": [ "request.param == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Conversion acceptance requires the real extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Conversion acceptance requires the real extension\")", "rationale": "reason-4", "affected_scope": "scope-171" }, @@ -2628,7 +2628,7 @@ "conditions": [ "request.param == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Cross relationship parity requires the real extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Cross relationship parity requires the real extension\")", "rationale": "reason-4", "affected_scope": "scope-172" }, @@ -2639,7 +2639,7 @@ "kind": "importorskip", "category": "optional-host", "exclusion_direction": "both-engines", - "source": "pytest.importorskip(\"sidemantic_rs\")", + "source": "pytest.importorskip(\"sqlctx_rs\")", "rationale": "reason-4", "affected_scope": "scope-173" }, @@ -2653,7 +2653,7 @@ "conditions": [ "request.param == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Cross-source window acceptance requires the real Rust extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Cross-source window acceptance requires the real Rust extension\")", "rationale": "reason-4", "affected_scope": "scope-174" }, @@ -2664,7 +2664,7 @@ "kind": "implementation-import", "category": "real-gap", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.generator import SQLGenerator", + "source": "from sqlctx.sql.generator import SQLGenerator", "rationale": "reason-2", "affected_scope": "scope-175" }, @@ -2678,7 +2678,7 @@ "conditions": [ "request.param == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Requires real native extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Requires real native extension\")", "rationale": "reason-4", "affected_scope": "scope-176" }, @@ -2692,7 +2692,7 @@ "conditions": [ "request.param == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Requires matching native extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Requires matching native extension\")", "rationale": "reason-4", "affected_scope": "scope-177" }, @@ -2762,7 +2762,7 @@ "conditions": [ "request.param == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Direct relationship parity requires the real extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Direct relationship parity requires the real extension\")", "rationale": "reason-4", "affected_scope": "scope-182" }, @@ -2776,7 +2776,7 @@ "conditions": [ "request.param == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Migration acceptance requires the real Rust extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Migration acceptance requires the real Rust extension\")", "rationale": "reason-4", "affected_scope": "scope-183" }, @@ -2790,7 +2790,7 @@ "conditions": [ "request.param == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Count family acceptance requires the real Rust extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Count family acceptance requires the real Rust extension\")", "rationale": "reason-4", "affected_scope": "scope-184" }, @@ -2812,7 +2812,7 @@ "kind": "implementation-import", "category": "intentional-Python-only", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.generator import SQLGenerator", + "source": "from sqlctx.sql.generator import SQLGenerator", "rationale": "reason-2", "affected_scope": "scope-185" }, @@ -2823,7 +2823,7 @@ "kind": "importorskip", "category": "optional-host", "exclusion_direction": "both-engines", - "source": "pytest.importorskip(\"sidemantic_rs\")", + "source": "pytest.importorskip(\"sqlctx_rs\")", "rationale": "reason-4", "affected_scope": "scope-186" }, @@ -2837,7 +2837,7 @@ "conditions": [ "request.param == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Row-expression acceptance requires the real Rust extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Row-expression acceptance requires the real Rust extension\")", "rationale": "reason-4", "affected_scope": "scope-187" }, @@ -2851,7 +2851,7 @@ "conditions": [ "not dsn" ], - "source": "pytest.skip(\"PostgreSQL execution requires SIDEMANTIC_TEST_POSTGRES_DSN\")", + "source": "pytest.skip(\"PostgreSQL execution requires SQLCTX_TEST_POSTGRES_DSN\")", "rationale": "reason-15", "affected_scope": "scope-188" }, @@ -2863,9 +2863,9 @@ "category": "optional-host", "exclusion_direction": "both-engines", "conditions": [ - "os.environ.get('SIDEMANTIC_DIFFERENTIAL_REQUIRE_RUST', '0') == '1'" + "os.environ.get('SQLCTX_DIFFERENTIAL_REQUIRE_RUST', '0') == '1'" ], - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Differential execution requires the real Rust extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Differential execution requires the real Rust extension\")", "rationale": "reason-4", "affected_scope": "scope-189" }, @@ -2879,7 +2879,7 @@ "conditions": [ "request.param == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\")", + "source": "pytest.importorskip(\"sqlctx_rs\")", "rationale": "reason-4", "affected_scope": "scope-190" }, @@ -2890,7 +2890,7 @@ "kind": "importorskip", "category": "optional-host", "exclusion_direction": "both-engines", - "source": "pytest.importorskip(\"sidemantic_rs\")", + "source": "pytest.importorskip(\"sqlctx_rs\")", "rationale": "reason-4", "affected_scope": "scope-191" }, @@ -2901,7 +2901,7 @@ "kind": "importorskip", "category": "optional-host", "exclusion_direction": "both-engines", - "source": "pytest.importorskip(\"sidemantic_rs\")", + "source": "pytest.importorskip(\"sqlctx_rs\")", "rationale": "reason-4", "affected_scope": "scope-192" }, @@ -2915,7 +2915,7 @@ "conditions": [ "request.param == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Funnel acceptance requires the real Rust extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Funnel acceptance requires the real Rust extension\")", "rationale": "reason-4", "affected_scope": "scope-193" }, @@ -2926,7 +2926,7 @@ "kind": "importorskip", "category": "optional-host", "exclusion_direction": "both-engines", - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Nested policy SQL requires the installed Rust extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Nested policy SQL requires the installed Rust extension\")", "rationale": "reason-4", "affected_scope": "scope-194" }, @@ -2940,7 +2940,7 @@ "conditions": [ "request.param == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Null-fill acceptance requires the matching Rust extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Null-fill acceptance requires the matching Rust extension\")", "rationale": "reason-4", "affected_scope": "scope-195" }, @@ -2951,7 +2951,7 @@ "kind": "importorskip", "category": "optional-host", "exclusion_direction": "both-engines", - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Requires the source-built Rust runtime\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Requires the source-built Rust runtime\")", "rationale": "reason-4", "affected_scope": "scope-196" }, @@ -2962,7 +2962,7 @@ "kind": "importorskip", "category": "optional-host", "exclusion_direction": "both-engines", - "source": "pytest.importorskip(\"sidemantic_rs\")", + "source": "pytest.importorskip(\"sqlctx_rs\")", "rationale": "reason-4", "affected_scope": "scope-197" }, @@ -2976,7 +2976,7 @@ "conditions": [ "request.param == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Requires matching native extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Requires matching native extension\")", "rationale": "reason-4", "affected_scope": "scope-198" }, @@ -2990,7 +2990,7 @@ "conditions": [ "request.param == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Population acceptance requires the real Rust extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Population acceptance requires the real Rust extension\")", "rationale": "reason-4", "affected_scope": "scope-199" }, @@ -3001,7 +3001,7 @@ "kind": "importorskip", "category": "optional-host", "exclusion_direction": "both-engines", - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Policy CLI acceptance requires the real Rust extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Policy CLI acceptance requires the real Rust extension\")", "rationale": "reason-4", "affected_scope": "scope-200" }, @@ -3015,7 +3015,7 @@ "conditions": [ "not dsn" ], - "source": "pytest.skip(\"PostgreSQL policy execution requires SIDEMANTIC_TEST_POSTGRES_DSN\")", + "source": "pytest.skip(\"PostgreSQL policy execution requires SQLCTX_TEST_POSTGRES_DSN\")", "rationale": "reason-15", "affected_scope": "scope-201" }, @@ -3029,7 +3029,7 @@ "conditions": [ "request.param == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Catalog acceptance requires the real extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Catalog acceptance requires the real extension\")", "rationale": "reason-4", "affected_scope": "scope-202" }, @@ -3040,7 +3040,7 @@ "kind": "importorskip", "category": "optional-host", "exclusion_direction": "both-engines", - "source": "pytest.importorskip(\"sidemantic_rs\")", + "source": "pytest.importorskip(\"sqlctx_rs\")", "rationale": "reason-4", "affected_scope": "scope-203" }, @@ -3051,7 +3051,7 @@ "kind": "importorskip", "category": "optional-host", "exclusion_direction": "both-engines", - "source": "pytest.importorskip(\"sidemantic_rs\")", + "source": "pytest.importorskip(\"sqlctx_rs\")", "rationale": "reason-4", "affected_scope": "scope-204" }, @@ -3065,7 +3065,7 @@ "conditions": [ "request.param == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Requires the actual Rust extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Requires the actual Rust extension\")", "rationale": "reason-4", "affected_scope": "scope-205" }, @@ -3079,7 +3079,7 @@ "conditions": [ "request.param == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Requires the real Rust extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Requires the real Rust extension\")", "rationale": "reason-4", "affected_scope": "scope-206" }, @@ -3093,7 +3093,7 @@ "conditions": [ "engine == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"The real Rust extension must be installed for acceptance\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"The real Rust extension must be installed for acceptance\")", "rationale": "reason-4", "affected_scope": "scope-207" }, @@ -3107,7 +3107,7 @@ "conditions": [ "request.param == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Scoped role acceptance requires the real Rust extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Scoped role acceptance requires the real Rust extension\")", "rationale": "reason-4", "affected_scope": "scope-208" }, @@ -3121,7 +3121,7 @@ "conditions": [ "request.param == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Requires the built Rust extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Requires the built Rust extension\")", "rationale": "reason-4", "affected_scope": "scope-209" }, @@ -3135,7 +3135,7 @@ "conditions": [ "request.param == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Retention parity requires the real Rust extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Retention parity requires the real Rust extension\")", "rationale": "reason-4", "affected_scope": "scope-210" }, @@ -3149,7 +3149,7 @@ "conditions": [ "request.param == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\")", + "source": "pytest.importorskip(\"sqlctx_rs\")", "rationale": "reason-4", "affected_scope": "scope-211" }, @@ -3177,7 +3177,7 @@ "conditions": [ "request.param == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\")", + "source": "pytest.importorskip(\"sqlctx_rs\")", "rationale": "reason-4", "affected_scope": "scope-213" }, @@ -3191,7 +3191,7 @@ "conditions": [ "request.param == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Rollup execution requires the matching Rust extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Rollup execution requires the matching Rust extension\")", "rationale": "reason-4", "affected_scope": "scope-214" }, @@ -3205,7 +3205,7 @@ "conditions": [ "rust" ], - "source": "pytest.importorskip(\"sidemantic_rs\")", + "source": "pytest.importorskip(\"sqlctx_rs\")", "rationale": "reason-4", "affected_scope": "scope-215" }, @@ -3219,7 +3219,7 @@ "conditions": [ "not dsn" ], - "source": "pytest.skip(\"PostgreSQL execution requires SIDEMANTIC_TEST_POSTGRES_DSN\")", + "source": "pytest.skip(\"PostgreSQL execution requires SQLCTX_TEST_POSTGRES_DSN\")", "rationale": "reason-15", "affected_scope": "scope-216" }, @@ -3258,7 +3258,7 @@ "kind": "importorskip", "category": "optional-host", "exclusion_direction": "both-engines", - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Rollup acceptance requires the matching Rust extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Rollup acceptance requires the matching Rust extension\")", "rationale": "reason-4", "affected_scope": "scope-219" }, @@ -3272,7 +3272,7 @@ "conditions": [ "request.param == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Requires real native extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Requires real native extension\")", "rationale": "reason-4", "affected_scope": "scope-220" }, @@ -3283,7 +3283,7 @@ "kind": "importorskip", "category": "optional-host", "exclusion_direction": "both-engines", - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Requires real native extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Requires real native extension\")", "rationale": "reason-4", "affected_scope": "scope-221" }, @@ -3297,7 +3297,7 @@ "conditions": [ "not dsn" ], - "source": "pytest.skip(\"PostgreSQL execution requires SIDEMANTIC_TEST_POSTGRES_DSN\")", + "source": "pytest.skip(\"PostgreSQL execution requires SQLCTX_TEST_POSTGRES_DSN\")", "rationale": "reason-15", "affected_scope": "scope-222" }, @@ -3311,7 +3311,7 @@ "conditions": [ "request.param == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Requires the built Rust extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Requires the built Rust extension\")", "rationale": "reason-4", "affected_scope": "scope-223" }, @@ -3325,7 +3325,7 @@ "conditions": [ "request.param == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Sibling fanout acceptance requires the real Rust extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Sibling fanout acceptance requires the real Rust extension\")", "rationale": "reason-4", "affected_scope": "scope-224" }, @@ -3339,7 +3339,7 @@ "conditions": [ "request.param == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Snapshot parity requires the real Rust extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Snapshot parity requires the real Rust extension\")", "rationale": "reason-4", "affected_scope": "scope-225" }, @@ -3350,7 +3350,7 @@ "kind": "importorskip", "category": "optional-host", "exclusion_direction": "both-engines", - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Requires matching native extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Requires matching native extension\")", "rationale": "reason-4", "affected_scope": "scope-226" }, @@ -3364,7 +3364,7 @@ "conditions": [ "request.param == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Requires real native extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Requires real native extension\")", "rationale": "reason-4", "affected_scope": "scope-227" }, @@ -3375,7 +3375,7 @@ "kind": "importorskip", "category": "optional-host", "exclusion_direction": "both-engines", - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Requires real native extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Requires real native extension\")", "rationale": "reason-4", "affected_scope": "scope-228" }, @@ -3389,7 +3389,7 @@ "conditions": [ "request.param == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Population parity requires the real Rust extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Population parity requires the real Rust extension\")", "rationale": "reason-4", "affected_scope": "scope-229" }, @@ -3403,7 +3403,7 @@ "conditions": [ "request.param == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Temporal dialect parity requires the Rust extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Temporal dialect parity requires the Rust extension\")", "rationale": "reason-4", "affected_scope": "scope-230" }, @@ -3417,7 +3417,7 @@ "conditions": [ "request.param == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Temporal fill requires matching installed Rust extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Temporal fill requires matching installed Rust extension\")", "rationale": "reason-4", "affected_scope": "scope-231" }, @@ -3431,7 +3431,7 @@ "conditions": [ "request.param == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\")", + "source": "pytest.importorskip(\"sqlctx_rs\")", "rationale": "reason-4", "affected_scope": "scope-232" }, @@ -3459,7 +3459,7 @@ "conditions": [ "request.param == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Window acceptance requires the Rust extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Window acceptance requires the Rust extension\")", "rationale": "reason-4", "affected_scope": "scope-234" }, @@ -3487,7 +3487,7 @@ "conditions": [ "request.param == 'rust'" ], - "source": "pytest.importorskip(\"sidemantic_rs\", reason=\"Requires matching native extension\")", + "source": "pytest.importorskip(\"sqlctx_rs\", reason=\"Requires matching native extension\")", "rationale": "reason-4", "affected_scope": "scope-236" }, @@ -3856,7 +3856,7 @@ "kind": "implementation-import", "category": "real-gap", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.generator import SQLGenerator", + "source": "from sqlctx.sql.generator import SQLGenerator", "rationale": "reason-2", "affected_scope": "scope-252" }, @@ -4164,7 +4164,7 @@ "kind": "implementation-import", "category": "real-gap", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.generator import SQLGenerator", + "source": "from sqlctx.sql.generator import SQLGenerator", "rationale": "reason-2", "affected_scope": "scope-268" }, @@ -4354,7 +4354,7 @@ "kind": "implementation-import", "category": "intentional-Python-only", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.query_rewriter import QueryRewriter", + "source": "from sqlctx.sql.query_rewriter import QueryRewriter", "rationale": "reason-2", "affected_scope": "scope-283" }, @@ -4365,7 +4365,7 @@ "kind": "implementation-import", "category": "intentional-Python-only", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.query_rewriter import QueryRewriter", + "source": "from sqlctx.sql.query_rewriter import QueryRewriter", "rationale": "reason-2", "affected_scope": "scope-284" }, @@ -4376,7 +4376,7 @@ "kind": "implementation-import", "category": "intentional-Python-only", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.generator import SQLGenerator", + "source": "from sqlctx.sql.generator import SQLGenerator", "rationale": "reason-2", "affected_scope": "scope-285" }, @@ -4387,7 +4387,7 @@ "kind": "implementation-import", "category": "intentional-Python-only", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.generator import SQLGenerator", + "source": "from sqlctx.sql.generator import SQLGenerator", "rationale": "reason-2", "affected_scope": "scope-286" }, @@ -4398,7 +4398,7 @@ "kind": "implementation-import", "category": "intentional-Python-only", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.generator import SQLGenerator", + "source": "from sqlctx.sql.generator import SQLGenerator", "rationale": "reason-2", "affected_scope": "scope-287" }, @@ -4409,7 +4409,7 @@ "kind": "implementation-import", "category": "intentional-Python-only", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.query_rewriter import QueryRewriter", + "source": "from sqlctx.sql.query_rewriter import QueryRewriter", "rationale": "reason-2", "affected_scope": "scope-288" }, @@ -4420,7 +4420,7 @@ "kind": "implementation-import", "category": "intentional-Python-only", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.generator import SQLGenerator", + "source": "from sqlctx.sql.generator import SQLGenerator", "rationale": "reason-2", "affected_scope": "scope-289" }, @@ -4431,7 +4431,7 @@ "kind": "implementation-import", "category": "real-gap", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.query_rewriter import QueryRewriter", + "source": "from sqlctx.sql.query_rewriter import QueryRewriter", "rationale": "reason-2", "affected_scope": "scope-290" }, @@ -4442,7 +4442,7 @@ "kind": "implementation-import", "category": "real-gap", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.query_rewriter import QueryRewriter", + "source": "from sqlctx.sql.query_rewriter import QueryRewriter", "rationale": "reason-2", "affected_scope": "scope-291" }, @@ -4453,7 +4453,7 @@ "kind": "implementation-import", "category": "real-gap", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.generator import SQLGenerator", + "source": "from sqlctx.sql.generator import SQLGenerator", "rationale": "reason-2", "affected_scope": "scope-292" }, @@ -4464,7 +4464,7 @@ "kind": "implementation-import", "category": "real-gap", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.generator import SQLGenerator", + "source": "from sqlctx.sql.generator import SQLGenerator", "rationale": "reason-2", "affected_scope": "scope-293" }, @@ -4475,7 +4475,7 @@ "kind": "implementation-import", "category": "real-gap", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.generator import SQLGenerator", + "source": "from sqlctx.sql.generator import SQLGenerator", "rationale": "reason-2", "affected_scope": "scope-294" }, @@ -4486,7 +4486,7 @@ "kind": "implementation-import", "category": "intentional-Python-only", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.generator import SQLGenerator", + "source": "from sqlctx.sql.generator import SQLGenerator", "rationale": "reason-2", "affected_scope": "scope-295" }, @@ -4497,7 +4497,7 @@ "kind": "implementation-import", "category": "intentional-Python-only", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.generator import SQLGenerator", + "source": "from sqlctx.sql.generator import SQLGenerator", "rationale": "reason-2", "affected_scope": "scope-296" }, @@ -4508,7 +4508,7 @@ "kind": "implementation-import", "category": "intentional-Python-only", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.generator import SQLGenerator", + "source": "from sqlctx.sql.generator import SQLGenerator", "rationale": "reason-2", "affected_scope": "scope-297" }, @@ -4519,7 +4519,7 @@ "kind": "implementation-import", "category": "real-gap", "exclusion_direction": "rust-coverage-exclusion", - "source": "from sidemantic.sql.query_rewriter import QueryRewriter", + "source": "from sqlctx.sql.query_rewriter import QueryRewriter", "rationale": "reason-2", "affected_scope": "scope-298" }, @@ -4551,20 +4551,20 @@ "Native source-dialect literal contract": 12, "Native subquery scope regression": 1, "PostgreSQL adapter available, tested in integration tests": 1, - "PostgreSQL execution requires SIDEMANTIC_TEST_POSTGRES_DSN": 44, - "PostgreSQL policy execution requires SIDEMANTIC_TEST_POSTGRES_DSN": 36, + "PostgreSQL execution requires SQLCTX_TEST_POSTGRES_DSN": 44, + "PostgreSQL policy execution requires SQLCTX_TEST_POSTGRES_DSN": 36, "Python joins physical keys; native computed-key identity has its own independent oracle": 1, "Python reparses completed Redshift aggregates with its generic SQL parser": 3, "Rust target emission; Python reparses Redshift using its generic parser": 3, - "Set SIDEMANTIC_YARDSTICK_UPSTREAM_TESTS=1 to fetch and replay live upstream Yardstick tests": 2, + "Set SQLCTX_YARDSTICK_UPSTREAM_TESTS=1 to fetch and replay live upstream Yardstick tests": 2, "Strict Rust compiler validation contract": 9, "could not import 'anywidget': No module named 'anywidget'": 8, "could not import 'textual': No module named 'textual'": 2, - "set SIDEMANTIC_DAX_ONLINE_CONFORMANCE=1 to probe DAX Formatter": 11 + "set SQLCTX_DAX_ONLINE_CONFORMANCE=1 to probe DAX Formatter": 11 }, "limitations": "JUnit does not enumerate deselected tests. Historical results do not validate current edits.", "omissions_by_reason": { - "set SIDEMANTIC_DAX_ONLINE_CONFORMANCE=1 to probe DAX Formatter": { + "set SQLCTX_DAX_ONLINE_CONFORMANCE=1 to probe DAX Formatter": { "category": "external-service", "type": "pytest.skip", "tests": [ @@ -4588,7 +4588,7 @@ "tests.db.test_semantic_layer_adapters::test_postgres_url_recognized" ] }, - "Set SIDEMANTIC_YARDSTICK_UPSTREAM_TESTS=1 to fetch and replay live upstream Yardstick tests": { + "Set SQLCTX_YARDSTICK_UPSTREAM_TESTS=1 to fetch and replay live upstream Yardstick tests": { "category": "external-service", "type": "pytest.skip", "tests": [ @@ -4614,7 +4614,7 @@ "tests.semantic_conformance.test_approximate_distinct::test_redshift_nested_approximate_expressions_use_independent_parser[python-NULLIF(APPROX_COUNT_DISTINCT(user_id), 0)]" ] }, - "PostgreSQL execution requires SIDEMANTIC_TEST_POSTGRES_DSN": { + "PostgreSQL execution requires SQLCTX_TEST_POSTGRES_DSN": { "category": "external-service", "type": "pytest.skip", "tests": [ @@ -4709,7 +4709,7 @@ "tests.semantic_conformance.test_dialect_boundary::test_source_dialect_preserves_typed_policy_and_parameter_values[python-O'Brien-spark]" ] }, - "PostgreSQL policy execution requires SIDEMANTIC_TEST_POSTGRES_DSN": { + "PostgreSQL policy execution requires SQLCTX_TEST_POSTGRES_DSN": { "category": "external-service", "type": "pytest.skip", "tests": [ @@ -5765,12 +5765,12 @@ ] }, "scope-17": { - "path": "tests/adapters/sidemantic_adapter/test_parsing.py", + "path": "tests/adapters/sqlctx_adapter/test_parsing.py", "declared_tests": [ "test_dimension_window_in_sql_generation" ], "collected_tests": [ - "tests/adapters/sidemantic_adapter/test_parsing.py::test_dimension_window_in_sql_generation" + "tests/adapters/sqlctx_adapter/test_parsing.py::test_dimension_window_in_sql_generation" ] }, "scope-18": { @@ -14280,12 +14280,12 @@ "test_native_source_changes_invalidate_uv_wheels" ], "collected_tests": [ - "tests/test_native_build_cache.py::test_native_source_changes_invalidate_uv_wheels[sidemantic-rs-src/lib.rs]", - "tests/test_native_build_cache.py::test_native_source_changes_invalidate_uv_wheels[sidemantic-rs-build.rs]", - "tests/test_native_build_cache.py::test_native_source_changes_invalidate_uv_wheels[sidemantic-rs-../Cargo.lock]", + "tests/test_native_build_cache.py::test_native_source_changes_invalidate_uv_wheels[sqlctx-rs-src/lib.rs]", + "tests/test_native_build_cache.py::test_native_source_changes_invalidate_uv_wheels[sqlctx-rs-build.rs]", + "tests/test_native_build_cache.py::test_native_source_changes_invalidate_uv_wheels[sqlctx-rs-../Cargo.lock]", "tests/test_native_build_cache.py::test_native_source_changes_invalidate_uv_wheels[crates/dax-pyo3-src/lib.rs]", "tests/test_native_build_cache.py::test_native_source_changes_invalidate_uv_wheels[crates/dax-pyo3-../dax-parser/src/functions.rs]", - "tests/test_native_build_cache.py::test_native_source_changes_invalidate_uv_wheels[crates/dax-pyo3-python/sidemantic_dax/__init__.py]" + "tests/test_native_build_cache.py::test_native_source_changes_invalidate_uv_wheels[crates/dax-pyo3-python/sqlctx_dax/__init__.py]" ] }, "scope-283": { @@ -14521,7 +14521,7 @@ "evidence": "reason-1" } }, - "tests/adapters/sidemantic_adapter/test_parsing.py": { + "tests/adapters/sqlctx_adapter/test_parsing.py": { "test_dimension_window_in_sql_generation": { "category": "real-gap", "evidence": "reason-1" @@ -15910,56 +15910,56 @@ "reason-11": "docs/rust-parity-helper-evidence.json#timezone-routing: Timezone queries bypass UTC rollups; quote/space/backslash/newline injection attempts are rejected before SQL. Counterparts: tests/semantic_conformance/test_query_timezone_parity.py::test_timezone_bypasses_utc_rollup; tests/semantic_conformance/test_query_timezone_parity.py::test_timezone_rejects_invalid_characters", "reason-12": "Direct private implementation-unit calls: SQLGenerator(g, dialect='bigquery', timezone='America/New_York')._date_trunc, SQLGenerator(g, dialect='mysql', timezone='UTC')._date_trunc, SQLGenerator(g, dialect='snowflake', timezone='America/New_York')._date_trunc, SQLGenerator(g, dialect='spark', timezone='America/New_York')._date_trunc", "reason-13": "docs/rust-parity-helper-evidence.json#model-conversion-window: Model-local conversion metric selects distinct signup entities and counts purchases within an inclusive seven-day window; late purchases do not convert. Counterparts: tests/semantic_conformance/test_conversion_parity.py::test_unique_entities_and_inclusive_window Limitation: Python graph auto-registration bookkeeping remains Python-owned; the public native fixture tests model-local resolution and results.", - "reason-14": "docs/rust-parity-helper-evidence.json#timezone-period-lookup: Named dod/wow/mom/qoq/yoy map to calendar intervals without a declared grain; month result regression independently verifies sparse periods and category partitions. Counterparts: sidemantic-rs/src/sql/generator/temporal.rs::named_comparisons_have_calendar_intervals_without_declared_granularity; tests/semantic_conformance/test_feature_parity.py::test_named_calendar_comparison_without_declared_granularity Limitation: All five intervals have native unit assertions; the dual-engine result counterpart executes month specifically.", + "reason-14": "docs/rust-parity-helper-evidence.json#timezone-period-lookup: Named dod/wow/mom/qoq/yoy map to calendar intervals without a declared grain; month result regression independently verifies sparse periods and category partitions. Counterparts: sqlctx-rs/src/sql/generator/temporal.rs::named_comparisons_have_calendar_intervals_without_declared_granularity; tests/semantic_conformance/test_feature_parity.py::test_named_calendar_comparison_without_declared_granularity Limitation: All five intervals have native unit assertions; the dual-engine result counterpart executes month specifically.", "reason-15": "Explicit external database, network oracle, or integration environment gate.", "reason-16": "Deselected by default addopts; may additionally have dependency or behavioral skips.", "reason-17": "Behavioral or emulator limitation; do not count the omitted contract as parity.", "reason-18": "Connection contract delegated to the integration suite.", - "reason-19": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_advanced.py-test_conversion_metric: This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", - "reason-20": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_advanced.py-test_conversion_metric_backwards_compatible: This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", - "reason-21": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_advanced.py-test_conversion_metric_steps_and_base_event: This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", + "reason-19": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_advanced.py-test_conversion_metric: This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", + "reason-20": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_advanced.py-test_conversion_metric_backwards_compatible: This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", + "reason-21": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_advanced.py-test_conversion_metric_steps_and_base_event: This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", "reason-22": "docs/rust-parity-helper-evidence.json#temporal-null-fill: Fill applies to final cumulative/comparison/offset-ratio result; empty/prior-missing periods use the declared default instead of feeding a filled base value into the temporal operation. Counterparts: tests/semantic_conformance/test_temporal_null_fill.py::test_cumulative_final_default_keeps_null_base_and_partitions; tests/semantic_conformance/test_temporal_null_fill.py::test_missing_prior_and_zero_denominator_fill_after_calculation; tests/semantic_conformance/test_temporal_null_fill.py::test_offset_ratio_default_applies_after_sparse_prior_division", "reason-23": "docs/rust-parity-helper-evidence.json#null-default-dependencies: Model leaf defaults are used by direct, derived and ratio dependencies; null groups/empty aggregates retain explicit defaults. Counterparts: tests/semantic_conformance/test_null_fill.py::test_metric_result_and_dependency_defaults; tests/semantic_conformance/test_null_fill.py::test_filled_leaf_participates_in_cross_source_calculation", - "reason-24": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_advanced.py-test_filter_dimension_with_model_qualified_sql_expr: This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", + "reason-24": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_advanced.py-test_filter_dimension_with_model_qualified_sql_expr: This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", "reason-25": "docs/rust-parity-helper-evidence.json#sparse-month-comparison: Month comparison subtracts the matching prior calendar month within each category and yields null across a missing month. Counterparts: tests/semantic_conformance/test_feature_parity.py::test_sparse_comparison_uses_calendar_month_and_category", - "reason-26": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_advanced.py-test_multistep_conversion_2_steps_via_steps_list: This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", - "reason-27": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_advanced.py-test_multistep_conversion_funnel: This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", - "reason-28": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_advanced.py-test_multistep_funnel_chronological_order_enforced: This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", - "reason-29": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_advanced.py-test_multistep_funnel_expression_timestamp: This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", - "reason-30": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_advanced.py-test_multistep_funnel_model_name_prefix_step_predicates: This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", - "reason-31": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_advanced.py-test_multistep_funnel_model_placeholder_filter: This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", - "reason-32": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_advanced.py-test_multistep_funnel_model_placeholder_step_predicates: This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", - "reason-33": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_advanced.py-test_multistep_funnel_model_placeholder_timestamp: This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", - "reason-34": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_advanced.py-test_multistep_funnel_monotonic_counts: This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", - "reason-35": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_advanced.py-test_multistep_funnel_only_prior_step2_not_counted: This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", - "reason-36": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_advanced.py-test_multistep_funnel_or_step_with_filter: This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", - "reason-37": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_advanced.py-test_multistep_funnel_order_by_metric_name: This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", - "reason-38": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_advanced.py-test_multistep_funnel_qualified_filters: This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", - "reason-39": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_advanced.py-test_multistep_funnel_repeated_actions_valid_path: This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", - "reason-40": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_advanced.py-test_multistep_funnel_total_excludes_non_entrants: This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", - "reason-41": "docs/rust-parity-helper-evidence.json#cumulative-year-reset: Year-to-date window partitions on calendar year rather than retaining prior-year rows. Counterparts: sidemantic-rs/src/sql/generator/temporal.rs::cumulative_frames_preserve_groups_and_calendar_reset Limitation: Native counterpart asserts emitted calendar-year partition/frame; it is not a result-level duplicate of the original fixture.", + "reason-26": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_advanced.py-test_multistep_conversion_2_steps_via_steps_list: This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", + "reason-27": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_advanced.py-test_multistep_conversion_funnel: This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", + "reason-28": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_advanced.py-test_multistep_funnel_chronological_order_enforced: This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", + "reason-29": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_advanced.py-test_multistep_funnel_expression_timestamp: This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", + "reason-30": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_advanced.py-test_multistep_funnel_model_name_prefix_step_predicates: This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", + "reason-31": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_advanced.py-test_multistep_funnel_model_placeholder_filter: This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", + "reason-32": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_advanced.py-test_multistep_funnel_model_placeholder_step_predicates: This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", + "reason-33": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_advanced.py-test_multistep_funnel_model_placeholder_timestamp: This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", + "reason-34": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_advanced.py-test_multistep_funnel_monotonic_counts: This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", + "reason-35": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_advanced.py-test_multistep_funnel_only_prior_step2_not_counted: This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", + "reason-36": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_advanced.py-test_multistep_funnel_or_step_with_filter: This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", + "reason-37": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_advanced.py-test_multistep_funnel_order_by_metric_name: This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", + "reason-38": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_advanced.py-test_multistep_funnel_qualified_filters: This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", + "reason-39": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_advanced.py-test_multistep_funnel_repeated_actions_valid_path: This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", + "reason-40": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_advanced.py-test_multistep_funnel_total_excludes_non_entrants: This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", + "reason-41": "docs/rust-parity-helper-evidence.json#cumulative-year-reset: Year-to-date window partitions on calendar year rather than retaining prior-year rows. Counterparts: sqlctx-rs/src/sql/generator/temporal.rs::cumulative_frames_preserve_groups_and_calendar_reset Limitation: Native counterpart asserts emitted calendar-year partition/frame; it is not a result-level duplicate of the original fixture.", "reason-42": "docs/rust-parity-helper-evidence.json#cohort-group-results: Model-local inner count-distinct/HAVING cohort qualification preserves outer dimension/time-grain names; outer average reads qualified inner aggregate values, and reserved output dimensions are quoted. Counterparts: tests/semantic_conformance/test_cohort_parity.py::test_count_counts_qualified_inner_groups_including_null_entity; tests/semantic_conformance/test_cohort_parity.py::test_query_grouping_changes_inner_and_outer_grain; tests/semantic_conformance/test_cohort_parity.py::test_time_bucket_is_carried_through_to_outer_output; tests/semantic_conformance/test_cohort_parity.py::test_outer_aggregations_read_qualified_inner_values; tests/semantic_conformance/test_cohort_parity.py::test_reserved_output_dimension_is_quoted Limitation: Counterparts cover the same operations with independent synthetic populations; graph-owner inference is explicitly excluded from this mapping.", - "reason-43": "docs/rust-parity-helper-evidence.json#unowned-graph-cohort: Python infers the unique source model from the graph-level cohort entity without metric_owners. Rust strict graph scope requires an explicit cohort owner and rejects this valid Python shape. Counterparts: tests/semantic_conformance/test_cohort_parity.py::test_owned_graph_cohort_unsupported_shapes_remain_gated; sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Counterpart is negative evidence: mutation=unowned is intentionally rejected. SemanticLayer.add_metric does not supply an owner, and graph_to_semantic_input preserves that absence. Source-confirmed; live repro remains lead-owned.", + "reason-43": "docs/rust-parity-helper-evidence.json#unowned-graph-cohort: Python infers the unique source model from the graph-level cohort entity without metric_owners. Rust strict graph scope requires an explicit cohort owner and rejects this valid Python shape. Counterparts: tests/semantic_conformance/test_cohort_parity.py::test_owned_graph_cohort_unsupported_shapes_remain_gated; sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Counterpart is negative evidence: mutation=unowned is intentionally rejected. SemanticLayer.add_metric does not supply an owner, and graph_to_semantic_input preserves that absence. Source-confirmed; live repro remains lead-owned.", "reason-44": "Co-located engine-parametrized native/reference oracle; inspect test and Rust import.", "reason-45": "tests/core/test_pure_rust_python_test_parity.py::test_existing_python_layer_contract_matches_pure_rust[tests.metrics.test_cumulative::test_cumulative_with_time_comparison]", "reason-46": "Direct private implementation-unit calls: generator._add_where_filters_to_query, generator._split_where_having_filters, snowflake_generator._split_where_having_filters", "reason-47": "Direct private implementation-unit calls: generator._split_where_having_filters", "reason-48": "Direct private implementation-unit calls: generator._add_where_filters_to_query", - "reason-49": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_retention.py-test_retention_aliased_entity_dimension: This positive test adds a retention metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", - "reason-50": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_retention.py-test_retention_day_granularity_results: This positive test adds a retention metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", - "reason-51": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_retention.py-test_retention_default_activity_event: This positive test adds a retention metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", - "reason-52": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_retention.py-test_retention_filter_with_model_qualified_sql_expr: This positive test adds a retention metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", - "reason-53": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_retention.py-test_retention_metric_level_filters: This positive test adds a retention metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", + "reason-49": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_retention.py-test_retention_aliased_entity_dimension: This positive test adds a retention metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", + "reason-50": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_retention.py-test_retention_day_granularity_results: This positive test adds a retention metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", + "reason-51": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_retention.py-test_retention_default_activity_event: This positive test adds a retention metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", + "reason-52": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_retention.py-test_retention_filter_with_model_qualified_sql_expr: This positive test adds a retention metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", + "reason-53": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_retention.py-test_retention_metric_level_filters: This positive test adds a retention metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", "reason-54": "docs/rust-parity-helper-evidence.json#model-retention: Model-local retention executes with a fixed cohort/period/active_users/cohort_size/percentage schema. Counterparts: tests/semantic_conformance/test_retention_parity.py::test_first_cohort_sparse_periods_nulls_and_inactive_denominator", - "reason-55": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_retention.py-test_retention_model_placeholder_expansion_sql_model: This positive test adds a retention metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", - "reason-56": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_retention.py-test_retention_model_placeholder_expansion_table_model: This positive test adds a retention metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", - "reason-57": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_retention.py-test_retention_model_placeholder_in_time_dimension: This positive test adds a retention metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", - "reason-58": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_retention.py-test_retention_offset_in_sql: This positive test adds a retention metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", - "reason-59": "docs/rust-parity-helper-evidence.json#retention-period-validation: Zero retention periods are rejected instead of silently defaulting to 28. Counterparts: sidemantic-rs/src/sql/generator/retention.rs::retention_requires_valid_period_and_granularity", - "reason-60": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_retention.py-test_retention_sql_generation: This positive test adds a retention metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", - "reason-61": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_retention.py-test_retention_week_granularity: This positive test adds a retention metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", + "reason-55": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_retention.py-test_retention_model_placeholder_expansion_sql_model: This positive test adds a retention metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", + "reason-56": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_retention.py-test_retention_model_placeholder_expansion_table_model: This positive test adds a retention metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", + "reason-57": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_retention.py-test_retention_model_placeholder_in_time_dimension: This positive test adds a retention metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", + "reason-58": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_retention.py-test_retention_offset_in_sql: This positive test adds a retention metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", + "reason-59": "docs/rust-parity-helper-evidence.json#retention-period-validation: Zero retention periods are rejected instead of silently defaulting to 28. Counterparts: sqlctx-rs/src/sql/generator/retention.rs::retention_requires_valid_period_and_granularity", + "reason-60": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_retention.py-test_retention_sql_generation: This positive test adds a retention metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", + "reason-61": "docs/rust-parity-helper-evidence.json#unowned-tests-metrics-test_retention.py-test_retention_week_granularity: This positive test adds a retention metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", "reason-62": "Direct private implementation-unit calls: generator._has_fanout_joins", - "reason-63": "docs/rust-parity-helper-evidence.json#shared-native-manifest-rewrite: Both harnesses load tests/native-fixtures/manifest.yml rewrite_queries and assert each sql_contains token after semantic rewrite. Counterparts: sidemantic-rs/tests/native_fixtures.rs::native_fixtures_load_and_compile Limitation: Compilation/token assertions only; this source test does not execute rewritten SQL.", + "reason-63": "docs/rust-parity-helper-evidence.json#shared-native-manifest-rewrite: Both harnesses load tests/native-fixtures/manifest.yml rewrite_queries and assert each sql_contains token after semantic rewrite. Counterparts: sqlctx-rs/tests/native_fixtures.rs::native_fixtures_load_and_compile Limitation: Compilation/token assertions only; this source test does not execute rewritten SQL.", "reason-64": "docs/rust-parity-helper-evidence.json#legacy-rewriter-route: Explicit Python route override and monkeypatched Python _rewrite_python RuntimeError propagation test the legacy implementation contract, not a missing native semantic query feature.", "reason-65": "Python optimizer plan/rule contract (module docstring); engine-selected SemanticLayer execution assertions remain active.", "reason-66": "tests/queries/test_rust_sql_rewriter_parity.py::test_semantic_sql_contract[test_dry_run_with_postprocess_subquery]", @@ -15993,11 +15993,11 @@ "reason-94": "Direct helper behavioral coverage has no established replay counterpart; requires native coverage adjudication, not a confirmed Rust defect.", "reason-95": "Engine-asymmetric contract: skips the Python parameter; Rust still runs. Not a Rust-default blocker by itself.", "reason-96": "Engine-parametrized layer fixture and result/rows helper branch between Rust bridge and Python helper in this module.", - "reason-97": "docs/rust-parity-helper-evidence.json#unowned-tests-test_bugfix_batch.py-test_conversion_dimension_join_prevents_cross_group_leaking: This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", - "reason-98": "docs/rust-parity-helper-evidence.json#unowned-tests-test_bugfix_batch.py-test_conversion_with_derived_dimension_sql: This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", - "reason-99": "docs/rust-parity-helper-evidence.json#unowned-tests-test_bugfix_batch.py-test_conversion_with_dimension: This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", - "reason-100": "docs/rust-parity-helper-evidence.json#unowned-tests-test_bugfix_batch.py-test_conversion_with_time_granularity: This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", - "reason-101": "docs/rust-parity-helper-evidence.json#unowned-tests-test_bugfix_batch.py-test_conversion_without_dimensions_still_works: This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", + "reason-97": "docs/rust-parity-helper-evidence.json#unowned-tests-test_bugfix_batch.py-test_conversion_dimension_join_prevents_cross_group_leaking: This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", + "reason-98": "docs/rust-parity-helper-evidence.json#unowned-tests-test_bugfix_batch.py-test_conversion_with_derived_dimension_sql: This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", + "reason-99": "docs/rust-parity-helper-evidence.json#unowned-tests-test_bugfix_batch.py-test_conversion_with_dimension: This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", + "reason-100": "docs/rust-parity-helper-evidence.json#unowned-tests-test_bugfix_batch.py-test_conversion_with_time_granularity: This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", + "reason-101": "docs/rust-parity-helper-evidence.json#unowned-tests-test_bugfix_batch.py-test_conversion_without_dimensions_still_works: This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract. Counterparts: sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners Limitation: Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported.", "reason-102": "Direct private implementation-unit calls: gen._has_fanout_joins", "reason-103": "Direct private implementation-unit calls: gen._classify_filters_for_pushdown, self._build_graph", "reason-104": "tests/core/test_pure_rust_python_test_parity.py::test_existing_python_layer_contract_matches_pure_rust[tests.test_foreign_key_dimensions::test_foreign_key_as_dimension_no_join]", diff --git a/docs/rust-parity-exceptions.md b/docs/rust-parity-exceptions.md index 8233d77a9..5bba1d9af 100644 --- a/docs/rust-parity-exceptions.md +++ b/docs/rust-parity-exceptions.md @@ -88,7 +88,7 @@ Each count below is a unique declared function, not parametrized cases. Native c | `tests/adapters/bsl/test_parsing.py` | 0 | 0 | 6 | | `tests/adapters/cube/test_fixtures.py` | 0 | 0 | 5 | | `tests/adapters/metricflow/test_parsing.py` | 0 | 0 | 7 | -| `tests/adapters/sidemantic_adapter/test_parsing.py` | 0 | 0 | 1 | +| `tests/adapters/sqlctx_adapter/test_parsing.py` | 0 | 0 | 1 | | `tests/adapters/tableau/test_real_world.py` | 0 | 0 | 2 | | `tests/adapters/test_added_fixture_coverage.py` | 0 | 0 | 2 | | `tests/adapters/test_fixture_functionality_contracts.py` | 0 | 0 | 4 | @@ -153,13 +153,13 @@ JUnit does not enumerate deselected tests. Historical results do not validate cu | Native source-dialect literal contract | 12 | | Native subquery scope regression | 1 | | PostgreSQL adapter available, tested in integration tests | 1 | -| PostgreSQL execution requires SIDEMANTIC_TEST_POSTGRES_DSN | 44 | -| PostgreSQL policy execution requires SIDEMANTIC_TEST_POSTGRES_DSN | 36 | +| PostgreSQL execution requires SQLCTX_TEST_POSTGRES_DSN | 44 | +| PostgreSQL policy execution requires SQLCTX_TEST_POSTGRES_DSN | 36 | | Python joins physical keys; native computed-key identity has its own independent oracle | 1 | | Python reparses completed Redshift aggregates with its generic SQL parser | 3 | | Rust target emission; Python reparses Redshift using its generic parser | 3 | -| Set SIDEMANTIC_YARDSTICK_UPSTREAM_TESTS=1 to fetch and replay live upstream Yardstick tests | 2 | +| Set SQLCTX_YARDSTICK_UPSTREAM_TESTS=1 to fetch and replay live upstream Yardstick tests | 2 | | Strict Rust compiler validation contract | 9 | | could not import 'anywidget': No module named 'anywidget' | 8 | | could not import 'textual': No module named 'textual' | 2 | -| set SIDEMANTIC_DAX_ONLINE_CONFORMANCE=1 to probe DAX Formatter | 11 | +| set SQLCTX_DAX_ONLINE_CONFORMANCE=1 to probe DAX Formatter | 11 | diff --git a/docs/rust-parity-helper-evidence.json b/docs/rust-parity-helper-evidence.json index 467fa933a..861a97575 100644 --- a/docs/rust-parity-helper-evidence.json +++ b/docs/rust-parity-helper-evidence.json @@ -25,7 +25,7 @@ ], "behavior": "Both harnesses load tests/native-fixtures/manifest.yml rewrite_queries and assert each sql_contains token after semantic rewrite.", "counterparts": [ - "sidemantic-rs/tests/native_fixtures.rs::native_fixtures_load_and_compile" + "sqlctx-rs/tests/native_fixtures.rs::native_fixtures_load_and_compile" ], "limitation": "Compilation/token assertions only; this source test does not execute rewritten SQL." }, @@ -50,7 +50,7 @@ ], "behavior": "Named dod/wow/mom/qoq/yoy map to calendar intervals without a declared grain; month result regression independently verifies sparse periods and category partitions.", "counterparts": [ - "sidemantic-rs/src/sql/generator/temporal.rs::named_comparisons_have_calendar_intervals_without_declared_granularity", + "sqlctx-rs/src/sql/generator/temporal.rs::named_comparisons_have_calendar_intervals_without_declared_granularity", "tests/semantic_conformance/test_feature_parity.py::test_named_calendar_comparison_without_declared_granularity" ], "limitation": "All five intervals have native unit assertions; the dual-engine result counterpart executes month specifically." @@ -64,7 +64,7 @@ ], "behavior": "Year-to-date window partitions on calendar year rather than retaining prior-year rows.", "counterparts": [ - "sidemantic-rs/src/sql/generator/temporal.rs::cumulative_frames_preserve_groups_and_calendar_reset" + "sqlctx-rs/src/sql/generator/temporal.rs::cumulative_frames_preserve_groups_and_calendar_reset" ], "limitation": "Native counterpart asserts emitted calendar-year partition/frame; it is not a result-level duplicate of the original fixture." }, @@ -145,7 +145,7 @@ ], "behavior": "Zero retention periods are rejected instead of silently defaulting to 28.", "counterparts": [ - "sidemantic-rs/src/sql/generator/retention.rs::retention_requires_valid_period_and_granularity" + "sqlctx-rs/src/sql/generator/retention.rs::retention_requires_valid_period_and_granularity" ] }, { @@ -206,7 +206,7 @@ "behavior": "Python infers the unique source model from the graph-level cohort entity without metric_owners. Rust strict graph scope requires an explicit cohort owner and rejects this valid Python shape.", "counterparts": [ "tests/semantic_conformance/test_cohort_parity.py::test_owned_graph_cohort_unsupported_shapes_remain_gated", - "sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners" + "sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners" ], "limitation": "Counterpart is negative evidence: mutation=unowned is intentionally rejected. SemanticLayer.add_metric does not supply an owner, and graph_to_semantic_input preserves that absence. Source-confirmed; live repro remains lead-owned." }, @@ -219,7 +219,7 @@ ], "behavior": "This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract.", "counterparts": [ - "sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners" + "sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners" ], "limitation": "Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported." }, @@ -232,7 +232,7 @@ ], "behavior": "This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract.", "counterparts": [ - "sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners" + "sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners" ], "limitation": "Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported." }, @@ -245,7 +245,7 @@ ], "behavior": "This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract.", "counterparts": [ - "sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners" + "sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners" ], "limitation": "Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported." }, @@ -258,7 +258,7 @@ ], "behavior": "This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract.", "counterparts": [ - "sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners" + "sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners" ], "limitation": "Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported." }, @@ -271,7 +271,7 @@ ], "behavior": "This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract.", "counterparts": [ - "sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners" + "sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners" ], "limitation": "Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported." }, @@ -284,7 +284,7 @@ ], "behavior": "This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract.", "counterparts": [ - "sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners" + "sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners" ], "limitation": "Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported." }, @@ -297,7 +297,7 @@ ], "behavior": "This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract.", "counterparts": [ - "sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners" + "sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners" ], "limitation": "Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported." }, @@ -310,7 +310,7 @@ ], "behavior": "This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract.", "counterparts": [ - "sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners" + "sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners" ], "limitation": "Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported." }, @@ -323,7 +323,7 @@ ], "behavior": "This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract.", "counterparts": [ - "sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners" + "sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners" ], "limitation": "Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported." }, @@ -336,7 +336,7 @@ ], "behavior": "This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract.", "counterparts": [ - "sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners" + "sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners" ], "limitation": "Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported." }, @@ -349,7 +349,7 @@ ], "behavior": "This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract.", "counterparts": [ - "sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners" + "sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners" ], "limitation": "Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported." }, @@ -362,7 +362,7 @@ ], "behavior": "This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract.", "counterparts": [ - "sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners" + "sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners" ], "limitation": "Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported." }, @@ -375,7 +375,7 @@ ], "behavior": "This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract.", "counterparts": [ - "sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners" + "sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners" ], "limitation": "Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported." }, @@ -388,7 +388,7 @@ ], "behavior": "This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract.", "counterparts": [ - "sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners" + "sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners" ], "limitation": "Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported." }, @@ -401,7 +401,7 @@ ], "behavior": "This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract.", "counterparts": [ - "sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners" + "sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners" ], "limitation": "Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported." }, @@ -414,7 +414,7 @@ ], "behavior": "This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract.", "counterparts": [ - "sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners" + "sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners" ], "limitation": "Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported." }, @@ -427,7 +427,7 @@ ], "behavior": "This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract.", "counterparts": [ - "sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners" + "sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners" ], "limitation": "Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported." }, @@ -440,7 +440,7 @@ ], "behavior": "This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract.", "counterparts": [ - "sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners" + "sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners" ], "limitation": "Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported." }, @@ -453,7 +453,7 @@ ], "behavior": "This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract.", "counterparts": [ - "sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners" + "sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners" ], "limitation": "Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported." }, @@ -466,7 +466,7 @@ ], "behavior": "This positive test adds a retention metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract.", "counterparts": [ - "sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners" + "sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners" ], "limitation": "Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported." }, @@ -479,7 +479,7 @@ ], "behavior": "This positive test adds a retention metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract.", "counterparts": [ - "sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners" + "sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners" ], "limitation": "Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported." }, @@ -492,7 +492,7 @@ ], "behavior": "This positive test adds a retention metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract.", "counterparts": [ - "sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners" + "sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners" ], "limitation": "Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported." }, @@ -505,7 +505,7 @@ ], "behavior": "This positive test adds a retention metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract.", "counterparts": [ - "sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners" + "sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners" ], "limitation": "Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported." }, @@ -518,7 +518,7 @@ ], "behavior": "This positive test adds a retention metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract.", "counterparts": [ - "sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners" + "sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners" ], "limitation": "Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported." }, @@ -531,7 +531,7 @@ ], "behavior": "This positive test adds a retention metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract.", "counterparts": [ - "sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners" + "sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners" ], "limitation": "Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported." }, @@ -544,7 +544,7 @@ ], "behavior": "This positive test adds a retention metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract.", "counterparts": [ - "sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners" + "sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners" ], "limitation": "Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported." }, @@ -557,7 +557,7 @@ ], "behavior": "This positive test adds a retention metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract.", "counterparts": [ - "sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners" + "sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners" ], "limitation": "Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported." }, @@ -570,7 +570,7 @@ ], "behavior": "This positive test adds a retention metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract.", "counterparts": [ - "sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners" + "sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners" ], "limitation": "Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported." }, @@ -583,7 +583,7 @@ ], "behavior": "This positive test adds a retention metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract.", "counterparts": [ - "sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners" + "sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners" ], "limitation": "Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported." }, @@ -596,7 +596,7 @@ ], "behavior": "This positive test adds a retention metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract.", "counterparts": [ - "sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners" + "sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners" ], "limitation": "Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported." }, @@ -609,7 +609,7 @@ ], "behavior": "This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract.", "counterparts": [ - "sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners" + "sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners" ], "limitation": "Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported." }, @@ -622,7 +622,7 @@ ], "behavior": "This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract.", "counterparts": [ - "sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners" + "sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners" ], "limitation": "Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported." }, @@ -635,7 +635,7 @@ ], "behavior": "This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract.", "counterparts": [ - "sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners" + "sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners" ], "limitation": "Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported." }, @@ -648,7 +648,7 @@ ], "behavior": "This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract.", "counterparts": [ - "sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners" + "sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners" ], "limitation": "Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported." }, @@ -661,7 +661,7 @@ ], "behavior": "This positive test adds a conversion metric with graph.add_metric and no owner. The positive public counterparts reviewed use model-local metrics; they do not prove the graph-scoped contract.", "counterparts": [ - "sidemantic-rs/src/sql/generator.rs::strict_graph_metric_owners" + "sqlctx-rs/src/sql/generator.rs::strict_graph_metric_owners" ], "limitation": "Strict owner discovery does not inspect entity/event fields; live native rejection and any source inference from qualified filters must be checked before calling every variant unsupported." }, @@ -688,7 +688,7 @@ "tests/adapters/metricflow/test_parsing.py::test_metricflow_inline_exprless_non_count_uses_metric_column", "tests/adapters/metricflow/test_parsing.py::test_metricflow_keyless_inline_count_planner_contract", "tests/adapters/metricflow/test_parsing.py::test_metricflow_latest_spec_inline_metric_queryable_alone", - "tests/adapters/sidemantic_adapter/test_parsing.py::test_dimension_window_in_sql_generation", + "tests/adapters/sqlctx_adapter/test_parsing.py::test_dimension_window_in_sql_generation", "tests/adapters/tableau/test_real_world.py::test_sf_trial_joined_metric_uses_collection_sql", "tests/adapters/tableau/test_real_world.py::test_shapes_joined_dimension_uses_collection_sql", "tests/adapters/test_added_fixture_coverage.py::test_added_fixtures_execute_sql_for_execution_candidates", diff --git a/docs/rust-parity-matrix.json b/docs/rust-parity-matrix.json index 0b96b411f..22e2e73fe 100644 --- a/docs/rust-parity-matrix.json +++ b/docs/rust-parity-matrix.json @@ -4,7 +4,7 @@ "runtime_contract": "docs/runtime-conformance.yml", "runtime_lifecycle": "experimental", "status_legend": { - "rust_backed": "The subsystem is backed by the experimental sidemantic-rs runtime and may be required by strict mode.", + "rust_backed": "The subsystem is backed by the experimental sqlctx-rs runtime and may be required by strict mode.", "rust_backed_opt_in": "A Rust path exists but is not complete enough for strict all-subsystem enforcement.", "python_only": "The subsystem is intentionally Python-only." }, @@ -12,19 +12,19 @@ "sql_generator_entrypoint": { "status": "rust_backed", "python_surface": "SemanticLayer.compile and CLI structured query compilation", - "rust_surface": "sidemantic-rs native query compiler", + "rust_surface": "sqlctx-rs native query compiler", "notes": "Covers structured metric/dimension query compilation through the Rust entrypoint." }, "semantic_core_query_validation": { "status": "rust_backed", "python_surface": "SemanticLayer query reference validation", - "rust_surface": "sidemantic-rs validate_query_references", + "rust_surface": "sqlctx-rs validate_query_references", "notes": "Covers metric and dimension reference validation before query compilation." }, "semantic_sql_rewriter": { "status": "rust_backed_opt_in", "python_surface": "QueryRewriter and CLI semantic SQL rewrite", - "rust_surface": "sidemantic-rs semantic SQL rewriter", + "rust_surface": "sqlctx-rs semantic SQL rewriter", "notes": "Rust supports the native semantic SQL subset, but Python remains the full rewrite implementation." } } diff --git a/docs/rust-runtime.md b/docs/rust-runtime.md index 74f3e0f25..5e2a7cd12 100644 --- a/docs/rust-runtime.md +++ b/docs/rust-runtime.md @@ -1,6 +1,6 @@ # Rust Native Runtime -The Rust runtime supports native Sidemantic YAML and SQL projects. It is not a Rust port of every Python adapter. +The Rust runtime supports native sqlctx YAML and SQL projects. It is not a Rust port of every Python adapter. Use Python to import external semantic formats, then export or normalize them into native YAML/SQL. Use Rust to validate, compile, rewrite, and eventually execute those native projects. @@ -8,8 +8,8 @@ Export adapter output to the native contract with: ```bash mkdir -p ./native-models -sidemantic convert ./adapter-project --to sidemantic --output ./native-models/sidemantic.yml -sidemantic validate ./native-models --engine rust +sqlctx convert ./adapter-project --to sqlctx --output ./native-models/sqlctx.yml +sqlctx validate ./native-models --engine rust ``` ## Supported Inputs @@ -50,17 +50,16 @@ Those remain Python-owned import paths. ## Default runtime and installation -A normal `uv tool install sidemantic` uses Python and does not install the Rust -backend. Install `uv tool install "sidemantic[rust]"` for the CLI or -`uv add "sidemantic[rust]"` in a project to include the matching `sidemantic-rs` -package. The `full` extra also includes it. Installing the extra leaves Python -as the default for validation, compilation, and semantic SQL rewriting. +A normal `uv tool install git+https://github.com/sidequery/sqlctx` uses the Python +engine. From a source checkout, `uv sync --extra rust` builds and installs the +matching `sqlctx-rs` package. The `full` extra also includes it. Python remains +the default for validation, compilation, and semantic SQL rewriting. Select `--engine rust` to use the native runtime and report an error if it is unavailable or a capability is unsupported, or `--engine auto` to allow fallback for known unsupported capabilities. Invalid input and unexpected -failures still propagate. `SIDEMANTIC_ENGINE=rust` sets a process-wide default; +failures still propagate. `SQLCTX_ENGINE=rust` sets a process-wide default; explicit engine selection and project runtime configuration take precedence. -The process-wide choice overrides legacy `SIDEMANTIC_RS_*` flags. +The process-wide choice overrides legacy `SQLCTX_RS_*` flags. Pyodide excludes the native dependency and defaults to Python. The distributed Python extension uses the lightweight `python` feature; database execution @@ -72,7 +71,7 @@ source build with `python-adbc`. Python users can select the native runtime explicitly: ```python -from sidemantic import SemanticLayer +from sqlctx import SemanticLayer layer = SemanticLayer(engine="rust") ``` @@ -92,15 +91,15 @@ layer = SemanticLayer(engine="rust", fallback=True) The Python CLI exposes engine selection on native validation and semantic SQL query paths: ```bash -sidemantic validate ./models --engine rust -sidemantic query "select orders.total_revenue from metrics" --models ./models --engine rust --dry-run -sidemantic rewrite "select orders.total_revenue from metrics" --models ./models --engine rust +sqlctx validate ./models --engine rust +sqlctx query "select orders.total_revenue from metrics" --models ./models --engine rust --dry-run +sqlctx rewrite "select orders.total_revenue from metrics" --models ./models --engine rust ``` Use `--fallback` when trying Rust but allowing Python fallback: ```bash -sidemantic query "select orders.total_revenue from metrics" --models ./models --engine rust --fallback +sqlctx query "select orders.total_revenue from metrics" --models ./models --engine rust --fallback ``` Config files can set the same behavior: @@ -111,7 +110,7 @@ runtime: fallback: false ``` -Environment variables such as `SIDEMANTIC_RS_SQL_GENERATOR` and `SIDEMANTIC_RS_REWRITER` remain internal migration and CI controls. New user-facing docs should prefer `engine`. +Environment variables such as `SQLCTX_RS_SQL_GENERATOR` and `SQLCTX_RS_REWRITER` remain internal migration and CI controls. New user-facing docs should prefer `engine`. ## Compatibility Checks @@ -119,7 +118,7 @@ Native compatibility is enforced by: ```bash uv run pytest tests/native_compat -v -cd sidemantic-rs && cargo test --test native_fixtures +cd sqlctx-rs && cargo test --test native_fixtures ``` CI runs these in the `Native Compatibility` job. diff --git a/docs/security.md b/docs/security.md index e298b2433..8d39e980b 100644 --- a/docs/security.md +++ b/docs/security.md @@ -1,6 +1,6 @@ # Security (row-level filters, access gates, field visibility) -Sidemantic can enforce **model-level security policies** — per-user row filters and +sqlctx can enforce **model-level security policies** — per-user row filters and access gates — plus **field-level visibility**. Enforcement happens at query-compile time: the policy is baked into the generated SQL before it runs, so a scoped query can never return rows the user isn't allowed to see. @@ -95,25 +95,25 @@ Parameter values are emitted as SQL literals using the query dialect, including inside Jinja conditionals and loops. Control-flow comparisons still use the raw typed parameter values. -### HTTP (`sidemantic serve`) +### HTTP (`sqlctx serve`) Client-supplied identity headers are rejected by default. Enable `--trust-user-header` only behind a header-sanitizing proxy that authenticates users, -sets the JSON `X-Sidemantic-User` header, and owns the API bearer credential. Do not +sets the JSON `X-sqlctx-User` header, and owns the API bearer credential. Do not give that credential to clients who can reach the trusted-header endpoint directly. Custom applications can instead supply `create_app(user_attributes_resolver=...)` to derive attributes from a verified principal. The shared bearer by itself does not verify caller-supplied roles or tenants. Resolved attributes scope structured queries, semantic SQL, mounted MCP tools, and result-cache keys. -For example: `sidemantic serve ./models --auth-token-file .secrets/api-token --trust-user-header`. +For example: `sqlctx serve ./models --auth-token-file .secrets/api-token --trust-user-header`. The additional header-name, required-attributes, and visibility options below are -available on `sidemantic server api`. +available on `sqlctx server api`. | Flag | Effect | |------|--------| | `--trust-user-header` | Explicitly trust identity headers from an authenticated proxy; requires bearer authentication. | -| `--user-header NAME` | Header carrying the JSON user-attributes object (default `X-Sidemantic-User`). | +| `--user-header NAME` | Header carrying the JSON user-attributes object (default `X-sqlctx-User`). | | `--require-user-attrs` | Reject data requests that lack the header (HTTP 400). | | `--enforce-visibility` | Apply field-visibility enforcement. | @@ -125,7 +125,7 @@ The embedded web UI never reads bearer tokens from a URL, persists them in bearer-protected, the UI prompts once and exchanges the bearer through `POST /auth/session` for a short-lived credential. Same-origin deployments receive an HttpOnly, `SameSite=Strict` cookie. Cross-origin deployments receive a short-lived -credential kept only in memory and sent with the `Sidemantic-Session` authorization +credential kept only in memory and sent with the `sqlctx-Session` authorization scheme. The server stores only a SHA-256 digest of either session credential and expires it after ten minutes. API clients may continue to send the configured bearer directly. @@ -169,9 +169,9 @@ behind a TLS-terminating proxy or a private network before exposing it. Stdio MCP may use `--user-attrs-file` as a local process identity. HTTP MCP (`--http` or `--apps`) requires `--auth-token-file` and rejects static identity -files. Install both optional extras for this transport: `uv add 'sidemantic[mcp,api]'`. +files. Install both optional extras for this transport: `uv add 'sqlctx[mcp,api] @ git+https://github.com/sidequery/sqlctx'`. Use `--trust-user-header` behind the authenticated, header-sanitizing proxy described -above to resolve each request's `X-Sidemantic-User` attributes. This option works with +above to resolve each request's `X-sqlctx-User` attributes. This option works with both `--http` and `--apps`; stdio rejects it and retains `--user-attrs-file`. It uses the same authenticated `/mcp/` mount as the API. All mounted transport methods require the API's bearer or browser session when authentication is configured. @@ -183,7 +183,7 @@ across requests. Both `run_query` and `run_sql` enforce row filters. Defaults can be adjusted with `--max-result-rows`, `--max-response-bytes`, `--query-timeout` (seconds), `--max-concurrent-queries`, and `--query-queue-timeout` -(seconds) on `sidemantic serve` and the API/MCP CLI, or +(seconds) on `sqlctx serve` and the API/MCP CLI, or `create_app(server_limits=ServerLimits(...))` in a custom application. By default, query transports reject results above 10,000 rows or 16 MiB, admit at most four @@ -204,7 +204,7 @@ memory bound. CLI and direct SemanticLayer execution defaults are unchanged. - **Cube** `access_policy` `row_level.filters` are imported into an enforced `SecurityPolicy` (see [Cube compatibility](compatibility/cube.md#access-control-access_policy--accesspolicy)). - **Rill** metrics-view `security:` blocks (`access`, `row_filter`) are imported, with - Go-template `.user.*` references translated to Sidemantic's `user.*` namespace. + Go-template `.user.*` references translated to sqlctx's `user.*` namespace. ## Limitations diff --git a/docs/semantic-input.md b/docs/semantic-input.md index 284cbcb2b..ff5c261dd 100644 --- a/docs/semantic-input.md +++ b/docs/semantic-input.md @@ -461,7 +461,7 @@ The Rust CI job executes both output paths against a PostgreSQL 16 service using its newly built Python extension wheel. The synthetic acceptance population checks tenant and invariant exclusions, quoted/injection-shaped values, numeric, boolean and null attributes, access denial, and visibility. Local runs without -`SIDEMANTIC_TEST_POSTGRES_DSN` skip this host test; a configured job fails if the +`SQLCTX_TEST_POSTGRES_DSN` skip this host test; a configured job fails if the service, driver, extension or expected rows are unavailable. PostgreSQL parity is not qualified until that execution job passes. Other policy output dialects use polyglot target generation. The conformance corpus checks DuckDB, PostgreSQL, diff --git a/docs/table-calculation-selection.md b/docs/table-calculation-selection.md index e5f509c0d..5f3ddc008 100644 --- a/docs/table-calculation-selection.md +++ b/docs/table-calculation-selection.md @@ -3,7 +3,7 @@ Declare table calculations in your native model file, then select names with the CLI: ```bash -sidemantic query --explore revenue_overview --order-by 'orders.revenue DESC' \ +sqlctx query --explore revenue_overview --order-by 'orders.revenue DESC' \ --table-calculation running --table-calculation share \ --models ./models --db data.duckdb ``` diff --git a/docs/terminal.md b/docs/terminal.md index cc209257c..bd136431c 100644 --- a/docs/terminal.md +++ b/docs/terminal.md @@ -1,17 +1,17 @@ # Terminal help, paging, and completion -The installed CLI is its own offline documentation. Use `sidemantic help` for +The installed CLI is its own offline documentation. Use `sqlctx help` for the command index and pass a nested path for a specific workflow: ```console -sidemantic help validate -sidemantic help migrate generate -sidemantic help preagg recommend +sqlctx help validate +sqlctx help migrate generate +sqlctx help preagg recommend ``` `-h` and `--help` work at the same command levels. The generated -`sidemantic(1)` page is installed under `share/man/man1` by wheels, so standard -environment managers can expose it through `man sidemantic`. The checked-in +`sqlctx(1)` page is installed under `share/man/man1` by wheels, so standard +environment managers can expose it through `man sqlctx`. The checked-in copy is generated from the live Click command tree: ```console @@ -25,7 +25,7 @@ A behavioral test fails when the generated page is stale. Long human-readable `info`, `explain`, `validate`, and pre-aggregation reports use a pager only when stdout is an interactive terminal and the report exceeds the terminal height. `--pager` requests paging for any non-empty human report; -`--no-pager` disables it. `SIDEMANTIC_PAGER` takes precedence over `PAGER`; if +`--no-pager` disables it. `SQLCTX_PAGER` takes precedence over `PAGER`; if neither is set, the platform default is used. Paging is always disabled for redirected output, `TERM=dumb`, `--quiet`, @@ -37,8 +37,8 @@ written to redirected stdout. Color follows the normal CLI color policy. Typer can install completion for Bash, Zsh, Fish, and PowerShell: ```console -sidemantic --install-completion -sidemantic --show-completion zsh +sqlctx --install-completion +sqlctx --show-completion zsh ``` Completion covers command and option names plus relevant values: diff --git a/docs/testing.md b/docs/testing.md index e60dd8043..9b0fb5b84 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -1,10 +1,10 @@ # Testing and trust -Sidemantic treats "will my metrics stay correct?" as a first-class product +sqlctx treats "will my metrics stay correct?" as a first-class product question. Three mechanisms cover it: golden-query tests, live schema validation, and the cross-surface SQL guarantee. -## Golden-query tests (`sidemantic test`) +## Golden-query tests (`sqlctx test`) Golden tests pin a query to its expected result so a metric definition cannot drift silently. They live in the project's `tests/` directory as YAML files @@ -45,23 +45,23 @@ tests: Run them with: ```bash -sidemantic test # project tests/ directory -sidemantic test tests/revenue.yml # specific files or directories -sidemantic test --json # machine-readable report +sqlctx test # project tests/ directory +sqlctx test tests/revenue.yml # specific files or directories +sqlctx test --json # machine-readable report ``` The command exits 1 when any test fails, so it slots directly into CI. -`sidemantic init` and `sidemantic demo` scaffold a starting test file. +`sqlctx init` and `sqlctx demo` scaffold a starting test file. -## Live schema validation (`sidemantic validate --live`) +## Live schema validation (`sqlctx validate --live`) Static validation cannot see a column that was dropped or renamed in the warehouse; the model still parses and only fails at query time. `--live` probes the configured database and fails validation instead: ```bash -sidemantic validate --live # uses the project connection -sidemantic validate --live --db data.duckdb +sqlctx validate --live # uses the project connection +sqlctx validate --live --db data.duckdb ``` Every table-backed model is probed with a zero-row select, and plainly diff --git a/docs/ui-architecture.md b/docs/ui-architecture.md index dd5e818c2..ae4af822f 100644 --- a/docs/ui-architecture.md +++ b/docs/ui-architecture.md @@ -1,6 +1,6 @@ # UI architecture -Sidemantic supports several HTML hosts through one React component implementation. Runtime adapters may translate data and mount components, but must not contain component markup or styling. +sqlctx supports several HTML hosts through one React component implementation. Runtime adapters may translate data and mount components, but must not contain component markup or styling. ## Canonical owners @@ -8,15 +8,15 @@ Sidemantic supports several HTML hosts through one React component implementatio | --- | --- | --- | | Product application shell, catalog, query orchestration, date controls, and interactive time series | `webapp/src/` | Built into the Python and Rust servers | | Reusable charts, leaderboards, previews, query debugging, and state primitives | `webapp/src/components/` via `webapp/src/ui.ts` | Built as React ESM and self-contained browser distributions | -| Portable standalone charts and live crossfilter dashboards | `sidemantic/viz.py` | Used by `sidemantic chart` and `sidemantic dashboard serve` | -| Notebook trait synchronization and mounting | `js/widget.js` and `sidemantic/widget/` | Mounts the canonical React distribution | -| MCP Apps chart embedding | `sidemantic/apps/chart_widget.html` | Returned by the MCP `create_chart` tool | +| Portable standalone charts and live crossfilter dashboards | `sqlctx/viz.py` | Used by `sqlctx chart` and `sqlctx dashboard serve` | +| Notebook trait synchronization and mounting | `js/widget.js` and `sqlctx/widget/` | Mounts the canonical React distribution | +| MCP Apps chart embedding | `sqlctx/apps/chart_widget.html` | Returned by the MCP `create_chart` tool | The React webapp, static/WASM apps, and AnyWidget have separate lifecycle adapters but share the same compiled component code. `webapp/src/static-api.tsx` is the sole imperative mount adapter. The framework-free/WASM leaderboard is the visual champion for ranked cards: contiguous hairline panels, compact rows, lavender magnitude fills, full formatted values, and an understated expand affordance. The React `LeaderboardPanel` keeps ownership of querying, null handling, stale-result protection, and crossfilter behavior while rendering that presentation. -The consolidated component gallery is available at `/components`. `scripts/build_ui_distribution.py` produces `sidemantic-ui.js`, `sidemantic-ui-static.js`, and `sidemantic-ui.css` directly from `webapp/src`; there are no parallel JSX, DOM-renderer, or CSS component sources. +The consolidated component gallery is available at `/components`. `scripts/build_ui_distribution.py` produces `sqlctx-ui.js`, `sqlctx-ui-static.js`, and `sqlctx-ui.css` directly from `webapp/src`; there are no parallel JSX, DOM-renderer, or CSS component sources. ## Generated and synchronized copies @@ -24,27 +24,27 @@ These files are deployment artifacts or synchronized examples, not independent c | Copy | Canonical source | Update command | | --- | --- | --- | -| `sidemantic/ui/static/` | `webapp/` | `uv run scripts/build_webapp.py` | -| `sidemantic-rs/ui/` | `webapp/` | `uv run scripts/build_webapp.py` | -| `sidemantic/widget/static/widget.js` | `js/widget.js` | `cd js && bun run build` | -| `plugins/sidemantic/skills/webapp-builder/assets/ui-dist/` | `webapp/src/ui.ts` and `webapp/src/static-api.tsx` | `uv run scripts/build_ui_distribution.py` | -| `examples/sidemantic_wasm_demo/src/components/sidemantic/` | Built UI distribution | See below | +| `sqlctx/ui/static/` | `webapp/` | `uv run scripts/build_webapp.py` | +| `sqlctx-rs/ui/` | `webapp/` | `uv run scripts/build_webapp.py` | +| `sqlctx/widget/static/widget.js` | `js/widget.js` | `cd js && bun run build` | +| `plugins/sqlctx/skills/webapp-builder/assets/ui-dist/` | `webapp/src/ui.ts` and `webapp/src/static-api.tsx` | `uv run scripts/build_ui_distribution.py` | +| `examples/sqlctx_wasm_demo/src/components/sqlctx/` | Built UI distribution | See below | Synchronize the WASM demo with the canonical static component kit: ```bash -uv run plugins/sidemantic/skills/webapp-builder/scripts/copy_components.py \ +uv run plugins/sqlctx/skills/webapp-builder/scripts/copy_components.py \ --kind static \ - --target examples/sidemantic_wasm_demo/src/components/sidemantic \ + --target examples/sqlctx_wasm_demo/src/components/sqlctx \ --force ``` Check for drift without writing files: ```bash -uv run plugins/sidemantic/skills/webapp-builder/scripts/copy_components.py \ +uv run plugins/sqlctx/skills/webapp-builder/scripts/copy_components.py \ --kind static \ - --target examples/sidemantic_wasm_demo/src/components/sidemantic \ + --target examples/sqlctx_wasm_demo/src/components/sqlctx \ --check ``` diff --git a/examples/adbc_snowflake/.gitignore b/examples/adbc_snowflake/.gitignore index 3d2fa8540..2af5f9c2a 100644 --- a/examples/adbc_snowflake/.gitignore +++ b/examples/adbc_snowflake/.gitignore @@ -1,3 +1,3 @@ -sidemantic.yaml +sqlctx.yaml snowflake_key.p8 snowflake_key.pub diff --git a/examples/adbc_snowflake/README.md b/examples/adbc_snowflake/README.md index 217694249..4620c0b3c 100644 --- a/examples/adbc_snowflake/README.md +++ b/examples/adbc_snowflake/README.md @@ -16,10 +16,10 @@ pip install adbc-driver-snowflake ## Config (CLI) -Copy `sidemantic.yaml.example` to `sidemantic.yaml` and fill in your Snowflake details. +Copy `sqlctx.yaml.example` to `sqlctx.yaml` and fill in your Snowflake details. ```bash -sidemantic query "SELECT orders.total_revenue, orders.region FROM orders" +sqlctx query "SELECT orders.total_revenue, orders.region FROM orders" ``` ## Python API @@ -29,8 +29,8 @@ When your semantic model YAML is generated from another tool (Cube, dbt, etc.) a ### Option 1: Pass ADBCAdapter directly ```python -from sidemantic import SemanticLayer, load_from_directory -from sidemantic.db.adbc import ADBCAdapter +from sqlctx import SemanticLayer, load_from_directory +from sqlctx.db.adbc import ADBCAdapter adapter = ADBCAdapter( driver="snowflake", diff --git a/examples/adbc_snowflake/sidemantic.yaml.example b/examples/adbc_snowflake/sqlctx.yaml.example similarity index 100% rename from examples/adbc_snowflake/sidemantic.yaml.example rename to examples/adbc_snowflake/sqlctx.yaml.example diff --git a/examples/advanced/comprehensive_demo.py b/examples/advanced/comprehensive_demo.py index b28473bbc..fcb33560b 100755 --- a/examples/advanced/comprehensive_demo.py +++ b/examples/advanced/comprehensive_demo.py @@ -1,8 +1,8 @@ #!/usr/bin/env python3 # /// script -# dependencies = ["sidemantic", "duckdb"] +# dependencies = ["sqlctx @ git+https://github.com/sidequery/sqlctx", "duckdb"] # /// -"""Comprehensive demo of Sidemantic semantic layer features. +"""Comprehensive demo of sqlctx semantic layer features. This script demonstrates: - Auto-detecting dependencies from SQL expressions @@ -13,18 +13,18 @@ - Multiple metric types (simple, ratio, derived, cumulative) - View generation for reusable queries -Run with: uv run https://raw.githubusercontent.com/sidequery/sidemantic/main/examples/advanced/comprehensive_demo.py +Run with: uv run https://raw.githubusercontent.com/sidequery/sqlctx/main/examples/advanced/comprehensive_demo.py """ import duckdb -from sidemantic.core.dimension import Dimension -from sidemantic.core.metric import Metric -from sidemantic.core.model import Model -from sidemantic.core.relationship import Relationship -from sidemantic.core.semantic_graph import SemanticGraph -from sidemantic.sql.generator import SQLGenerator -from sidemantic.sql.query_rewriter import QueryRewriter +from sqlctx.core.dimension import Dimension +from sqlctx.core.metric import Metric +from sqlctx.core.model import Model +from sqlctx.core.relationship import Relationship +from sqlctx.core.semantic_graph import SemanticGraph +from sqlctx.sql.generator import SQLGenerator +from sqlctx.sql.query_rewriter import QueryRewriter def print_section(title: str): @@ -50,7 +50,7 @@ def print_results(results, description: str = "Results"): def main(): - print_section("Sidemantic Comprehensive Demo") + print_section("sqlctx Comprehensive Demo") # ========================================================================= # 1. Set up semantic layer models diff --git a/examples/advanced/comprehensive_example.py b/examples/advanced/comprehensive_example.py index 8c1b95d69..1eb63fe93 100644 --- a/examples/advanced/comprehensive_example.py +++ b/examples/advanced/comprehensive_example.py @@ -1,11 +1,11 @@ #!/usr/bin/env python3 # /// script # dependencies = [ -# "sidemantic", +# "sqlctx @ git+https://github.com/sidequery/sqlctx", # "duckdb", # ] # /// -"""Comprehensive example showcasing all sidemantic features. +"""Comprehensive example showcasing all sqlctx features. This example demonstrates: 1. Parameters (user input) @@ -16,15 +16,15 @@ import duckdb -from sidemantic.core.dimension import Dimension -from sidemantic.core.metric import Metric -from sidemantic.core.model import Model -from sidemantic.core.parameter import Parameter -from sidemantic.core.relationship import Relationship -from sidemantic.core.semantic_graph import SemanticGraph -from sidemantic.core.table_calculation import TableCalculation -from sidemantic.sql.generator import SQLGenerator -from sidemantic.sql.table_calc_processor import TableCalculationProcessor +from sqlctx.core.dimension import Dimension +from sqlctx.core.metric import Metric +from sqlctx.core.model import Model +from sqlctx.core.parameter import Parameter +from sqlctx.core.relationship import Relationship +from sqlctx.core.semantic_graph import SemanticGraph +from sqlctx.core.table_calculation import TableCalculation +from sqlctx.sql.generator import SQLGenerator +from sqlctx.sql.table_calc_processor import TableCalculationProcessor def print_section(title): diff --git a/examples/basic/basic_example.py b/examples/basic/basic_example.py index eec696fb1..bfc83baac 100644 --- a/examples/basic/basic_example.py +++ b/examples/basic/basic_example.py @@ -1,6 +1,6 @@ -"""Basic example of using Sidemantic.""" +"""Basic example of using sqlctx.""" -from sidemantic import Dimension, Metric, Model, Relationship, SemanticLayer +from sqlctx import Dimension, Metric, Model, Relationship, SemanticLayer # Create semantic layer sl = SemanticLayer() diff --git a/examples/basic/simplified_api_example.py b/examples/basic/simplified_api_example.py index adad09418..7a1d35620 100644 --- a/examples/basic/simplified_api_example.py +++ b/examples/basic/simplified_api_example.py @@ -1,13 +1,13 @@ #!/usr/bin/env python3 # /// script -# dependencies = ["sidemantic", "pandas"] +# dependencies = ["sqlctx @ git+https://github.com/sidequery/sqlctx", "pandas"] # /// """Example showing the Metric API.""" -from sidemantic.core.dimension import Dimension -from sidemantic.core.metric import Metric -from sidemantic.core.model import Model -from sidemantic.core.semantic_layer import SemanticLayer +from sqlctx.core.dimension import Dimension +from sqlctx.core.metric import Metric +from sqlctx.core.model import Model +from sqlctx.core.semantic_layer import SemanticLayer # Create semantic layer layer = SemanticLayer() diff --git a/examples/cloudflare_containers/Dockerfile b/examples/cloudflare_containers/Dockerfile index 289032503..41679a146 100644 --- a/examples/cloudflare_containers/Dockerfile +++ b/examples/cloudflare_containers/Dockerfile @@ -1,10 +1,10 @@ -FROM sidequery/sidemantic:latest +FROM sidequery/sqlctx:latest -ENV SIDEMANTIC_MODE=api -ENV SIDEMANTIC_API_PORT=4400 +ENV SQLCTX_MODE=api +ENV SQLCTX_API_PORT=4400 # The base image ships the demo models and a seeded demo.duckdb in /app/models, -# and src/index.ts points SIDEMANTIC_DB at that file, so the example deploys +# and src/index.ts points SQLCTX_DB at that file, so the example deploys # without local models. For a real deployment, see "Switching from demo to real # models" in README.md. WORKDIR /app/models diff --git a/examples/cloudflare_containers/README.md b/examples/cloudflare_containers/README.md index 7e6b7540a..5e5f28c66 100644 --- a/examples/cloudflare_containers/README.md +++ b/examples/cloudflare_containers/README.md @@ -1,25 +1,25 @@ # Cloudflare Containers -This example runs the Sidemantic HTTP API behind a Cloudflare Worker that proxies requests into Cloudflare Containers. +This example runs the sqlctx HTTP API behind a Cloudflare Worker that proxies requests into Cloudflare Containers. ## Deployment shape - HTTPS terminates at the Worker. -- The Worker starts a Sidemantic container and forwards requests to port `4400`. -- The container runs `SIDEMANTIC_MODE=api`. -- The example image uses the demo models and seeded `demo.duckdb` that the published image ships in `/app/models`. +- The Worker starts a sqlctx container and forwards requests to port `4400`. +- The container runs `SQLCTX_MODE=api`. +- The example image uses the demo models and seeded `demo.duckdb` from `/app/models` in the base image. For a real deployment, the clean shape is: - bake your semantic models into the container image -- point Sidemantic at an external database with `SIDEMANTIC_CONNECTION` +- point sqlctx at an external database with `SQLCTX_CONNECTION` - keep DuckDB files out of the container unless they are disposable, because Cloudflare container disks reset on stop ## Files - `wrangler.jsonc`: Cloudflare Worker and container binding config - `src/index.ts`: Worker entrypoint and container proxy -- `Dockerfile`: Sidemantic container image used by Cloudflare, built on the published `sidequery/sidemantic` image +- `Dockerfile`: sqlctx container image used by Cloudflare, built on the `sidequery/sqlctx` image - `package.json`: Worker dependencies and the `deploy` script ## Prereqs @@ -32,9 +32,10 @@ For a real deployment, the clean shape is: ## Deploy the demo ```bash +docker build -t sidequery/sqlctx . cd examples/cloudflare_containers bun install -bunx wrangler secret put SIDEMANTIC_API_TOKEN +bunx wrangler secret put SQLCTX_API_TOKEN bun run deploy ``` @@ -63,10 +64,10 @@ curl -s https://YOUR-WORKER.workers.dev/query \ Edit `Dockerfile` to bake in your models: ```dockerfile -FROM sidequery/sidemantic:latest +FROM sidequery/sqlctx:latest -ENV SIDEMANTIC_MODE=api -ENV SIDEMANTIC_API_PORT=4400 +ENV SQLCTX_MODE=api +ENV SQLCTX_API_PORT=4400 # Replace the demo models that ship in /app/models. RUN rm -rf /app/models/* @@ -74,19 +75,19 @@ COPY models/ /app/models/ WORKDIR /app/models ``` -Then remove `SIDEMANTIC_DB` from the default container env in [src/index.ts](src/index.ts). +Then remove `SQLCTX_DB` from the default container env in [src/index.ts](src/index.ts). Then set your warehouse connection: ```bash -bunx wrangler secret put SIDEMANTIC_CONNECTION +bunx wrangler secret put SQLCTX_CONNECTION ``` -The Worker passes `SIDEMANTIC_CONNECTION`, `SIDEMANTIC_API_TOKEN`, and `SIDEMANTIC_CORS_ORIGINS` into the container at startup. +The Worker passes `SQLCTX_CONNECTION`, `SQLCTX_API_TOKEN`, and `SQLCTX_CORS_ORIGINS` into the container at startup. ## Auth -The container already supports bearer-token auth via `SIDEMANTIC_API_TOKEN`. +The container already supports bearer-token auth via `SQLCTX_API_TOKEN`. If you want proper edge auth, put the deployed hostname behind Cloudflare Access and use service tokens or your IdP there. Keep the app bearer token as a second gate if you want defense in depth. diff --git a/examples/cloudflare_containers/bun.lock b/examples/cloudflare_containers/bun.lock index 3b37bb23d..8dfd20b1e 100644 --- a/examples/cloudflare_containers/bun.lock +++ b/examples/cloudflare_containers/bun.lock @@ -3,7 +3,7 @@ "configVersion": 1, "workspaces": { "": { - "name": "sidemantic-cloudflare-containers", + "name": "sqlctx-cloudflare-containers", "dependencies": { "@cloudflare/containers": "latest", }, diff --git a/examples/cloudflare_containers/package.json b/examples/cloudflare_containers/package.json index 4cd061d84..7539953f7 100644 --- a/examples/cloudflare_containers/package.json +++ b/examples/cloudflare_containers/package.json @@ -1,5 +1,5 @@ { - "name": "sidemantic-cloudflare-containers", + "name": "sqlctx-cloudflare-containers", "private": true, "type": "module", "scripts": { diff --git a/examples/cloudflare_containers/src/index.ts b/examples/cloudflare_containers/src/index.ts index fff8fcdaa..e1b153d50 100644 --- a/examples/cloudflare_containers/src/index.ts +++ b/examples/cloudflare_containers/src/index.ts @@ -1,37 +1,37 @@ import { Container, getRandom } from "@cloudflare/containers"; const DEFAULT_CONTAINER_ENV = { - SIDEMANTIC_MODE: "api", - SIDEMANTIC_API_PORT: "4400", - SIDEMANTIC_DB: "/app/models/demo.duckdb", + SQLCTX_MODE: "api", + SQLCTX_API_PORT: "4400", + SQLCTX_DB: "/app/models/demo.duckdb", } as const; const CONTAINER_ENTRYPOINT = ["/docker-entrypoint.sh"]; type Env = { - SIDEMANTIC_API: DurableObjectNamespace; - SIDEMANTIC_API_TOKEN?: string; - SIDEMANTIC_CONNECTION?: string; - SIDEMANTIC_CORS_ORIGINS?: string; + SQLCTX_API: DurableObjectNamespace; + SQLCTX_API_TOKEN?: string; + SQLCTX_CONNECTION?: string; + SQLCTX_CORS_ORIGINS?: string; }; function buildContainerEnv(env: Env): Record { const containerEnv: Record = { ...DEFAULT_CONTAINER_ENV }; - if (env.SIDEMANTIC_API_TOKEN) { - containerEnv.SIDEMANTIC_API_TOKEN = env.SIDEMANTIC_API_TOKEN; + if (env.SQLCTX_API_TOKEN) { + containerEnv.SQLCTX_API_TOKEN = env.SQLCTX_API_TOKEN; } - if (env.SIDEMANTIC_CONNECTION) { - delete containerEnv.SIDEMANTIC_DB; - containerEnv.SIDEMANTIC_CONNECTION = env.SIDEMANTIC_CONNECTION; + if (env.SQLCTX_CONNECTION) { + delete containerEnv.SQLCTX_DB; + containerEnv.SQLCTX_CONNECTION = env.SQLCTX_CONNECTION; } - if (env.SIDEMANTIC_CORS_ORIGINS) { - containerEnv.SIDEMANTIC_CORS_ORIGINS = env.SIDEMANTIC_CORS_ORIGINS; + if (env.SQLCTX_CORS_ORIGINS) { + containerEnv.SQLCTX_CORS_ORIGINS = env.SQLCTX_CORS_ORIGINS; } return containerEnv; } -export class SidemanticApiContainer extends Container { +export class SqlctxApiContainer extends Container { defaultPort = 4400; requiredPorts = [4400]; sleepAfter = "15m"; @@ -43,7 +43,7 @@ export class SidemanticApiContainer extends Container { export default { async fetch(request: Request, env: Env): Promise { - const container = await getRandom(env.SIDEMANTIC_API, 3); + const container = await getRandom(env.SQLCTX_API, 3); await container.startAndWaitForPorts({ startOptions: { diff --git a/examples/cloudflare_containers/wrangler.jsonc b/examples/cloudflare_containers/wrangler.jsonc index 7874ed7b7..2261921f9 100644 --- a/examples/cloudflare_containers/wrangler.jsonc +++ b/examples/cloudflare_containers/wrangler.jsonc @@ -1,10 +1,10 @@ { - "name": "sidemantic-api", + "name": "sqlctx-api", "main": "src/index.ts", "compatibility_date": "2026-03-06", "containers": [ { - "class_name": "SidemanticApiContainer", + "class_name": "SqlctxApiContainer", "image": "./Dockerfile", "instance_type": "standard-1", "max_instances": 3 @@ -13,8 +13,8 @@ "durable_objects": { "bindings": [ { - "name": "SIDEMANTIC_API", - "class_name": "SidemanticApiContainer" + "name": "SQLCTX_API", + "class_name": "SqlctxApiContainer" } ] }, @@ -22,7 +22,7 @@ { "tag": "v1", "new_sqlite_classes": [ - "SidemanticApiContainer" + "SqlctxApiContainer" ] } ], diff --git a/examples/cube_demo/run_demo.py b/examples/cube_demo/run_demo.py index aa0cc4291..48b938e57 100644 --- a/examples/cube_demo/run_demo.py +++ b/examples/cube_demo/run_demo.py @@ -1,11 +1,11 @@ #!/usr/bin/env python3 # /// script -# dependencies = ["sidemantic"] +# dependencies = ["sqlctx @ git+https://github.com/sidequery/sqlctx"] # /// -"""Cube Demo: Export sidemantic models to Cube and run Playground in Docker. +"""Cube Demo: Export sqlctx models to Cube and run Playground in Docker. This demo: -1. Loads a sidemantic YAML definition (e-commerce model with joins) +1. Loads a sqlctx YAML definition (e-commerce model with joins) 2. Exports to Cube YAML format 3. Generates a complete Cube project with DuckDB 4. Builds and runs Cube Playground in Docker @@ -14,7 +14,7 @@ - Docker installed and running Usage: - git clone https://github.com/sidequery/sidemantic && cd sidemantic + git clone https://github.com/sidequery/sqlctx && cd sqlctx uv run examples/cube_demo/run_demo.py """ @@ -23,7 +23,7 @@ import sys from pathlib import Path -IMAGE_NAME = "sidemantic-cube-demo" +IMAGE_NAME = "sqlctx-cube-demo" # Sample data for the e-commerce demo - generated with DuckDB SAMPLE_DATA_SQL = """ @@ -182,7 +182,7 @@ # Cube.js configuration template CUBE_CONFIG = """module.exports = { dbType: 'duckdb', - apiSecret: 'sidemantic-cube-demo-secret', + apiSecret: 'sqlctx-cube-demo-secret', devServer: true, scheduledRefreshTimer: false, driverFactory: () => { @@ -198,19 +198,19 @@ def main(): demo_dir = Path(__file__).parent - sidemantic_yaml = demo_dir / "sidemantic.yaml" + sqlctx_yaml = demo_dir / "sqlctx.yaml" cube_project_dir = demo_dir / "cube_project" print("=" * 60) - print(" Sidemantic to Cube Demo") + print(" sqlctx to Cube Demo") print("=" * 60) - # Step 1: Load sidemantic YAML - print("\n[1/5] Loading sidemantic.yaml...") - from sidemantic.adapters.sidemantic import SidemanticAdapter + # Step 1: Load sqlctx YAML + print("\n[1/5] Loading sqlctx.yaml...") + from sqlctx.adapters.sqlctx import SqlctxAdapter - adapter = SidemanticAdapter() - graph = adapter.parse(sidemantic_yaml) + adapter = SqlctxAdapter() + graph = adapter.parse(sqlctx_yaml) print(f" Loaded {len(graph.models)} model(s)") for model_name, model in graph.models.items(): dims = len(model.dimensions) @@ -220,7 +220,7 @@ def main(): # Step 2: Export to Cube print("\n[2/5] Exporting to Cube project...") - from sidemantic.adapters.cube import CubeAdapter + from sqlctx.adapters.cube import CubeAdapter # Clean previous output if cube_project_dir.exists(): diff --git a/examples/cube_demo/sidemantic.yaml b/examples/cube_demo/sqlctx.yaml similarity index 100% rename from examples/cube_demo/sidemantic.yaml rename to examples/cube_demo/sqlctx.yaml diff --git a/examples/docker/README.md b/examples/docker/README.md index 9477504f9..625a96565 100644 --- a/examples/docker/README.md +++ b/examples/docker/README.md @@ -1,6 +1,10 @@ # Docker -The published image is [`sidequery/sidemantic`](https://hub.docker.com/repository/docker/sidequery/sidemantic) on Docker Hub, built for `linux/amd64` and `linux/arm64`. It includes all database drivers, the PostgreSQL wire-protocol server, the HTTP API server, and the MCP server. It uses the default Python engine; the optional Rust engine is not installed. +The image includes all database drivers, the PostgreSQL wire-protocol server, the HTTP API server, and the MCP server. It uses the Python engine. Build it from the repository root: + +```bash +docker build -t sidequery/sqlctx . +``` ## Mounting your models @@ -8,10 +12,10 @@ The container looks for model files (YAML, SQL, etc.) in `/app/models`. Use a vo ```bash # If your models are in ~/my-project/models/ -docker run -p 5433:5433 -v ~/my-project/models:/app/models sidequery/sidemantic +docker run -p 5433:5433 -v ~/my-project/models:/app/models sidequery/sqlctx # Or from the current directory -docker run -p 5433:5433 -v $(pwd)/models:/app/models sidequery/sidemantic +docker run -p 5433:5433 -v $(pwd)/models:/app/models sidequery/sqlctx ``` The `-v local/path:/app/models` flag maps a folder on your machine into the container. Any `.yml`, `.sql`, or other semantic model files in that folder will be auto-detected and loaded. @@ -21,24 +25,24 @@ The `-v local/path:/app/models` flag maps a folder on your machine into the cont Mount your models directory and expose port 5433: ```bash -docker run -p 5433:5433 -v ./models:/app/models sidequery/sidemantic +docker run -p 5433:5433 -v ./models:/app/models sidequery/sqlctx ``` Connect with any PostgreSQL client: ```bash -psql -h localhost -p 5433 -U any -d sidemantic +psql -h localhost -p 5433 -U any -d sqlctx ``` -Authentication is off by default and the server listens on all interfaces inside the container. Set `SIDEMANTIC_USERNAME` and `SIDEMANTIC_PASSWORD` to require credentials. +Authentication is off by default and the server listens on all interfaces inside the container. Set `SQLCTX_USERNAME` and `SQLCTX_PASSWORD` to require credentials. With a backend database connection: ```bash docker run -p 5433:5433 \ -v ./models:/app/models \ - -e SIDEMANTIC_CONNECTION="postgres://user:pass@host:5432/db" \ - sidequery/sidemantic + -e SQLCTX_CONNECTION="postgres://user:pass@host:5432/db" \ + sidequery/sqlctx ``` ## MCP server @@ -46,7 +50,7 @@ docker run -p 5433:5433 \ The MCP server speaks JSON-RPC over stdio, so keep stdin open with `-i`: ```bash -docker run -i --rm -v ./models:/app/models -e SIDEMANTIC_MODE=mcp sidequery/sidemantic +docker run -i --rm -v ./models:/app/models -e SQLCTX_MODE=mcp sidequery/sqlctx ``` To use it from an MCP client, configure the same command: @@ -54,9 +58,9 @@ To use it from an MCP client, configure the same command: ```json { "mcpServers": { - "sidemantic": { + "sqlctx": { "command": "docker", - "args": ["run", "-i", "--rm", "-e", "SIDEMANTIC_MODE=mcp", "sidequery/sidemantic", "--demo"] + "args": ["run", "-i", "--rm", "-e", "SQLCTX_MODE=mcp", "sidequery/sqlctx", "--demo"] } } } @@ -69,9 +73,9 @@ Replace `"--demo"` with `"-v", "/absolute/path/to/models:/app/models"` (before t ```bash docker run -p 4400:4400 \ -v ./models:/app/models \ - -e SIDEMANTIC_MODE=api \ - -e SIDEMANTIC_API_TOKEN=secret \ - sidequery/sidemantic + -e SQLCTX_MODE=api \ + -e SQLCTX_API_TOKEN=secret \ + sidequery/sqlctx ``` The examples below use the demo models; start the server with `--demo` instead of the volume mount to run them as written. @@ -100,16 +104,16 @@ curl -s http://localhost:4400/query \ Runs the PG server in the background and MCP on stdio: ```bash -docker run -i -p 5433:5433 -v ./models:/app/models -e SIDEMANTIC_MODE=both sidequery/sidemantic +docker run -i -p 5433:5433 -v ./models:/app/models -e SQLCTX_MODE=both sidequery/sqlctx ``` ## Demo mode -Pass `--demo` (or set `SIDEMANTIC_DEMO=1`) to serve the built-in sample models and data in any mode: +Pass `--demo` (or set `SQLCTX_DEMO=1`) to serve the built-in sample models and data in any mode: ```bash -docker run -p 5433:5433 sidequery/sidemantic --demo -docker run -p 4400:4400 -e SIDEMANTIC_MODE=api -e SIDEMANTIC_API_TOKEN=secret sidequery/sidemantic --demo +docker run -p 5433:5433 sidequery/sqlctx --demo +docker run -p 4400:4400 -e SQLCTX_MODE=api -e SQLCTX_API_TOKEN=secret sidequery/sqlctx --demo ``` ## Baking models into the image @@ -117,7 +121,7 @@ docker run -p 4400:4400 -e SIDEMANTIC_MODE=api -e SIDEMANTIC_API_TOKEN=secret si `/app/models` ships with the demo models, so clear it before copying yours in; otherwise both sets load: ```dockerfile -FROM sidequery/sidemantic +FROM sidequery/sqlctx RUN rm -rf /app/models/* COPY my_models/ /app/models/ ``` @@ -126,34 +130,34 @@ COPY my_models/ /app/models/ | Variable | Description | |----------|-------------| -| `SIDEMANTIC_MODE` | `serve` (default, PostgreSQL), `mcp`, `api`, or `both` | -| `SIDEMANTIC_DEMO` | Any non-empty value serves the built-in demo (same as `--demo`) | -| `SIDEMANTIC_CONNECTION` | Database connection string | -| `SIDEMANTIC_DB` | Path to DuckDB file (inside container) | -| `SIDEMANTIC_USERNAME` | PG server auth username | -| `SIDEMANTIC_PASSWORD` | PG server auth password | -| `SIDEMANTIC_PG_PASSWORD_FILE` | Path to a file holding the PG server password (for mounted secrets) | -| `SIDEMANTIC_PORT` | PG server port (default 5433) | -| `SIDEMANTIC_API_PORT` | HTTP API port (default 4400) | -| `SIDEMANTIC_API_TOKEN` | HTTP API bearer token | -| `SIDEMANTIC_API_AUTH_TOKEN_FILE` | Path to a file holding the HTTP API bearer token (for mounted secrets) | -| `SIDEMANTIC_CORS_ORIGINS` | Comma-separated list of allowed CORS origins | -| `SIDEMANTIC_MAX_REQUEST_BODY_BYTES` | Max HTTP request body size in bytes | - -The entrypoint hands `SIDEMANTIC_PASSWORD` and `SIDEMANTIC_API_TOKEN` to the server as private files, so they do not appear in the server's command line. +| `SQLCTX_MODE` | `serve` (default, PostgreSQL), `mcp`, `api`, or `both` | +| `SQLCTX_DEMO` | Any non-empty value serves the built-in demo (same as `--demo`) | +| `SQLCTX_CONNECTION` | Database connection string | +| `SQLCTX_DB` | Path to DuckDB file (inside container) | +| `SQLCTX_USERNAME` | PG server auth username | +| `SQLCTX_PASSWORD` | PG server auth password | +| `SQLCTX_PG_PASSWORD_FILE` | Path to a file holding the PG server password (for mounted secrets) | +| `SQLCTX_PORT` | PG server port (default 5433) | +| `SQLCTX_API_PORT` | HTTP API port (default 4400) | +| `SQLCTX_API_TOKEN` | HTTP API bearer token | +| `SQLCTX_API_AUTH_TOKEN_FILE` | Path to a file holding the HTTP API bearer token (for mounted secrets) | +| `SQLCTX_CORS_ORIGINS` | Comma-separated list of allowed CORS origins | +| `SQLCTX_MAX_REQUEST_BODY_BYTES` | Max HTTP request body size in bytes | + +The entrypoint hands `SQLCTX_PASSWORD` and `SQLCTX_API_TOKEN` to the server as private files, so they do not appear in the server's command line. ## Building from source From the repo root: ```bash -docker build -t sidemantic . +docker build -t sqlctx . ``` The first build compiles the `riffq` PostgreSQL wire-protocol package from source with Rust, which takes several minutes. To check a build in every mode: ```bash -python3 scripts/docker_smoke_test.py sidemantic +python3 scripts/docker_smoke_test.py sqlctx ``` ## Integration test services (docker compose) @@ -162,7 +166,7 @@ The `docker-compose.yml` in this directory starts Postgres, a BigQuery emulator, ```bash docker compose -f examples/docker/docker-compose.yml up -d postgres -POSTGRES_TEST=1 POSTGRES_HOST=localhost POSTGRES_PORT=5433 POSTGRES_DB=sidemantic_test POSTGRES_USER=test POSTGRES_PASSWORD=test \ +POSTGRES_TEST=1 POSTGRES_HOST=localhost POSTGRES_PORT=5433 POSTGRES_DB=sqlctx_test POSTGRES_USER=test POSTGRES_PASSWORD=test \ uv run --extra postgres pytest -m integration tests/db/test_postgres_integration.py -v ``` diff --git a/examples/docker/docker-compose.yml b/examples/docker/docker-compose.yml index ecaedf90c..2366cda77 100644 --- a/examples/docker/docker-compose.yml +++ b/examples/docker/docker-compose.yml @@ -4,7 +4,7 @@ services: environment: POSTGRES_USER: test POSTGRES_PASSWORD: test - POSTGRES_DB: sidemantic_test + POSTGRES_DB: sqlctx_test ports: - "5433:5432" # Use 5433 to avoid conflicts with local Postgres healthcheck: diff --git a/examples/ecommerce/README.md b/examples/ecommerce/README.md index afbd88ca1..d84a440b6 100644 --- a/examples/ecommerce/README.md +++ b/examples/ecommerce/README.md @@ -35,13 +35,13 @@ This replaces `ecommerce.db` with realistic sample data: ### View semantic layer info ```bash -sidemantic info examples/ecommerce/models +sqlctx info examples/ecommerce/models ``` ### Interactive workbench ```bash -uvx --from "sidemantic[workbench]" sidemantic workbench examples/ecommerce/models --db examples/ecommerce/data/ecommerce.db +uvx --from "sqlctx[workbench] @ git+https://github.com/sidequery/sqlctx" sqlctx workbench examples/ecommerce/models --db examples/ecommerce/data/ecommerce.db ``` ### Query from command line @@ -52,35 +52,35 @@ them from the virtual `metrics` table (`FROM metrics`). Total revenue: ```bash -sidemantic query "SELECT total_revenue FROM metrics" \ +sqlctx query "SELECT total_revenue FROM metrics" \ --models examples/ecommerce/models \ --db examples/ecommerce/data/ecommerce.db ``` Revenue by country: ```bash -sidemantic query "SELECT orders.revenue, customers.country FROM orders ORDER BY orders.revenue DESC" \ +sqlctx query "SELECT orders.revenue, customers.country FROM orders ORDER BY orders.revenue DESC" \ --models examples/ecommerce/models \ --db examples/ecommerce/data/ecommerce.db ``` Orders by status: ```bash -sidemantic query "SELECT orders.order_count, orders.revenue, orders.status FROM orders" \ +sqlctx query "SELECT orders.order_count, orders.revenue, orders.status FROM orders" \ --models examples/ecommerce/models \ --db examples/ecommerce/data/ecommerce.db ``` Customer lifetime value by tier: ```bash -sidemantic query "SELECT customer_lifetime_value, customers.tier FROM metrics" \ +sqlctx query "SELECT customer_lifetime_value, customers.tier FROM metrics" \ --models examples/ecommerce/models \ --db examples/ecommerce/data/ecommerce.db ``` Product performance: ```bash -sidemantic query "SELECT order_items.net_revenue, products.category FROM order_items ORDER BY order_items.net_revenue DESC LIMIT 10" \ +sqlctx query "SELECT order_items.net_revenue, products.category FROM order_items ORDER BY order_items.net_revenue DESC LIMIT 10" \ --models examples/ecommerce/models \ --db examples/ecommerce/data/ecommerce.db ``` @@ -90,7 +90,7 @@ sidemantic query "SELECT order_items.net_revenue, products.category FROM order_i Start a server that BI tools can connect to: ```bash -uvx --from "sidemantic[serve]" sidemantic server postgres examples/ecommerce/models \ +uvx --from "sqlctx[serve] @ git+https://github.com/sidequery/sqlctx" sqlctx server postgres examples/ecommerce/models \ --db examples/ecommerce/data/ecommerce.db \ --port 5433 ``` diff --git a/examples/features/cross_model_metrics_example.py b/examples/features/cross_model_metrics_example.py index de22c96aa..09a2d8afe 100644 --- a/examples/features/cross_model_metrics_example.py +++ b/examples/features/cross_model_metrics_example.py @@ -1,12 +1,12 @@ #!/usr/bin/env python3 # /// script -# dependencies = ["sidemantic", "duckdb"] +# dependencies = ["sqlctx @ git+https://github.com/sidequery/sqlctx", "duckdb"] # /// """Test cross-model metrics.""" import duckdb -from sidemantic import Dimension, Metric, Model, Relationship, SemanticLayer +from sqlctx import Dimension, Metric, Model, Relationship, SemanticLayer # Create test data conn = duckdb.connect(":memory:") diff --git a/examples/features/multi_hop_joins_example.py b/examples/features/multi_hop_joins_example.py index bfb55b303..c5f1ec2fc 100644 --- a/examples/features/multi_hop_joins_example.py +++ b/examples/features/multi_hop_joins_example.py @@ -1,12 +1,12 @@ #!/usr/bin/env python3 # /// script -# dependencies = ["sidemantic", "duckdb"] +# dependencies = ["sqlctx @ git+https://github.com/sidequery/sqlctx", "duckdb"] # /// """Test multi-hop joins.""" import duckdb -from sidemantic import Dimension, Metric, Model, Relationship, SemanticLayer +from sqlctx import Dimension, Metric, Model, Relationship, SemanticLayer conn = duckdb.connect(":memory:") diff --git a/examples/features/parameters_example.py b/examples/features/parameters_example.py index 0b7040f7d..1c099d2c4 100644 --- a/examples/features/parameters_example.py +++ b/examples/features/parameters_example.py @@ -1,12 +1,12 @@ #!/usr/bin/env python3 """Example demonstrating parameters (dynamic user input).""" -from sidemantic.core.dimension import Dimension -from sidemantic.core.metric import Metric -from sidemantic.core.model import Model -from sidemantic.core.parameter import Parameter -from sidemantic.core.semantic_graph import SemanticGraph -from sidemantic.sql.generator import SQLGenerator +from sqlctx.core.dimension import Dimension +from sqlctx.core.metric import Metric +from sqlctx.core.model import Model +from sqlctx.core.parameter import Parameter +from sqlctx.core.semantic_graph import SemanticGraph +from sqlctx.sql.generator import SQLGenerator # Create semantic graph graph = SemanticGraph() diff --git a/examples/features/symmetric_aggregates_example.py b/examples/features/symmetric_aggregates_example.py index fb053602e..5a0f7825f 100644 --- a/examples/features/symmetric_aggregates_example.py +++ b/examples/features/symmetric_aggregates_example.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 # /// script # dependencies = [ -# "sidemantic", +# "sqlctx @ git+https://github.com/sidequery/sqlctx", # "duckdb", # "pandas", # ] @@ -9,20 +9,20 @@ """Example demonstrating fan-out-safe (symmetric) aggregation. A naive join from a base model to several "many" side tables multiplies the -base rows (fan-out) and double-counts their measures. Sidemantic avoids this by +base rows (fan-out) and double-counts their measures. sqlctx avoids this by aggregating each model on its own before joining the results. -Run with: uv run https://raw.githubusercontent.com/sidequery/sidemantic/main/examples/features/symmetric_aggregates_example.py +Run with: uv run https://raw.githubusercontent.com/sidequery/sqlctx/main/examples/features/symmetric_aggregates_example.py """ import duckdb -from sidemantic.core.dimension import Dimension -from sidemantic.core.metric import Metric -from sidemantic.core.model import Model -from sidemantic.core.relationship import Relationship -from sidemantic.core.semantic_graph import SemanticGraph -from sidemantic.sql.generator import SQLGenerator +from sqlctx.core.dimension import Dimension +from sqlctx.core.metric import Metric +from sqlctx.core.model import Model +from sqlctx.core.relationship import Relationship +from sqlctx.core.semantic_graph import SemanticGraph +from sqlctx.sql.generator import SQLGenerator # Set up sample data conn = duckdb.connect(":memory:") @@ -205,23 +205,23 @@ print() # With fan-out-safe aggregation (the Example 2 results above) -print("With fan-out-safe aggregation (sidemantic, Example 2):") +print("With fan-out-safe aggregation (sqlctx, Example 2):") for row in result: print(f" {row[0]!s}: revenue = {row[1]}") print() print("=" * 80) -print("How Sidemantic Avoids Fan-Out:") +print("How sqlctx Avoids Fan-Out:") print("=" * 80) print(""" -When a query uses metrics from several models, Sidemantic: +When a query uses metrics from several models, sqlctx: 1. Aggregates each model separately at the requested grain (one CTE per model), joining only the models it needs for the dimensions 2. Joins the aggregated rows on the shared dimensions (FULL OUTER JOIN) 3. Result: each order, item and shipment is counted exactly once! When a measure is grouped by a dimension on the "many" side of a join (for -example, order revenue by an item attribute), Sidemantic instead deduplicates +example, order revenue by an item attribute), sqlctx instead deduplicates the joined rows by the measure model's primary key before aggregating. This ensures correct aggregation even when joins create duplicate rows. diff --git a/examples/headless_dashboard/README.md b/examples/headless_dashboard/README.md index 4c6fdc682..86201a3c4 100644 --- a/examples/headless_dashboard/README.md +++ b/examples/headless_dashboard/README.md @@ -5,9 +5,9 @@ This example shows the declarative dashboard authoring path. The dashboard is defined in committed files: - `models.yml` defines the semantic model. -- `dashboard.yml` defines the dashboard served by the Sidemantic CLI. +- `dashboard.yml` defines the dashboard served by the sqlctx CLI. - `dashboard.ts` shows the same dashboard shape with generated TypeScript field types. -- `sidemantic.generated.ts` is generated from the semantic model and committed here so the typing contract is visible. +- `sqlctx.generated.ts` is generated from the semantic model and committed here so the typing contract is visible. `setup_data.py` only creates demo data. It does not define the dashboard. @@ -15,10 +15,10 @@ The dashboard is defined in committed files: ```bash uv run examples/headless_dashboard/setup_data.py -uv run sidemantic dashboard validate examples/headless_dashboard/dashboard.yml \ +uv run sqlctx dashboard validate examples/headless_dashboard/dashboard.yml \ --models examples/headless_dashboard \ --db examples/headless_dashboard/data/orders.db -uv run sidemantic dashboard serve examples/headless_dashboard/dashboard.yml \ +uv run sqlctx dashboard serve examples/headless_dashboard/dashboard.yml \ --models examples/headless_dashboard \ --db examples/headless_dashboard/data/orders.db \ --port 8877 @@ -33,9 +33,9 @@ http://127.0.0.1:8877/crossfilter.html ## Regenerate TypeScript Types ```bash -uv run sidemantic dashboard types \ +uv run sqlctx dashboard types \ --models examples/headless_dashboard \ - --out examples/headless_dashboard/sidemantic.generated.ts + --out examples/headless_dashboard/sqlctx.generated.ts ``` The CLI serves YAML or JSON dashboard specs. The TypeScript file is for app authors who want editor-checked metric and dimension names while producing the same dashboard configuration shape. diff --git a/examples/headless_dashboard/dashboard.ts b/examples/headless_dashboard/dashboard.ts index 4115dd26d..8fb81a871 100644 --- a/examples/headless_dashboard/dashboard.ts +++ b/examples/headless_dashboard/dashboard.ts @@ -1,9 +1,9 @@ -import { defineDashboard, type DashboardRenderer } from "./sidemantic.generated"; +import { defineDashboard, type DashboardRenderer } from "./sqlctx.generated"; const renderer: DashboardRenderer = "vega-lite"; export default defineDashboard({ - schema: "sidemantic.dashboard.v1", + schema: "sqlctx.dashboard.v1", title: "Revenue Performance Explorer", defaults: { renderer, diff --git a/examples/headless_dashboard/dashboard.yml b/examples/headless_dashboard/dashboard.yml index c3ad4406f..221dd8db7 100644 --- a/examples/headless_dashboard/dashboard.yml +++ b/examples/headless_dashboard/dashboard.yml @@ -1,4 +1,4 @@ -schema: sidemantic.dashboard.v1 +schema: sqlctx.dashboard.v1 title: Revenue Performance Explorer defaults: renderer: vega-lite diff --git a/examples/headless_dashboard/queries.ts b/examples/headless_dashboard/queries.ts index f5b618b81..76f44fe85 100644 --- a/examples/headless_dashboard/queries.ts +++ b/examples/headless_dashboard/queries.ts @@ -1,16 +1,16 @@ // Sample typed semantic-SQL usage for the headless dashboard models. // // Regenerate the types after editing queries: -// sidemantic gen types -m . --no-yaml -o sidemantic.client.generated.ts -// sidemantic gen sql -m . queries.ts -o sidemantic.queries.generated.ts +// sqlctx gen types -m . --no-yaml -o sqlctx.client.generated.ts +// sqlctx gen sql -m . queries.ts -o sqlctx.queries.generated.ts // // Structured client: autocomplete + typed rows over metrics/dimensions. // SQL client: write semantic SQL, get typed rows keyed by the exact query string. -import { createClient, createSqlClient } from "sidemantic-wasm/client"; -import { schema } from "./sidemantic.client.generated"; -import { queryParamTypes } from "./sidemantic.queries.generated"; -import type { GeneratedQueries } from "./sidemantic.queries.generated"; +import { createClient, createSqlClient } from "sqlctx-wasm/client"; +import { schema } from "./sqlctx.client.generated"; +import { queryParamTypes } from "./sqlctx.queries.generated"; +import type { GeneratedQueries } from "./sqlctx.queries.generated"; type Run = (query: unknown) => Promise[]>; type SqlRun = ( diff --git a/examples/headless_dashboard/sidemantic.client.generated.ts b/examples/headless_dashboard/sqlctx.client.generated.ts similarity index 94% rename from examples/headless_dashboard/sidemantic.client.generated.ts rename to examples/headless_dashboard/sqlctx.client.generated.ts index 7c831be7f..7f39cc3af 100644 --- a/examples/headless_dashboard/sidemantic.client.generated.ts +++ b/examples/headless_dashboard/sqlctx.client.generated.ts @@ -1,4 +1,4 @@ -/* Generated by `sidemantic gen types`. Do not edit by hand. */ +/* Generated by `sqlctx gen types`. Do not edit by hand. */ export const schema = { "models": { diff --git a/examples/headless_dashboard/sidemantic.generated.ts b/examples/headless_dashboard/sqlctx.generated.ts similarity index 93% rename from examples/headless_dashboard/sidemantic.generated.ts rename to examples/headless_dashboard/sqlctx.generated.ts index b1b5c1965..c4635c844 100644 --- a/examples/headless_dashboard/sidemantic.generated.ts +++ b/examples/headless_dashboard/sqlctx.generated.ts @@ -1,6 +1,6 @@ -/* Generated by `sidemantic dashboard types`. Do not edit by hand. */ -export const sidemanticSchema = { - "schema": "sidemantic.schema.v1", +/* Generated by `sqlctx dashboard types`. Do not edit by hand. */ +export const sqlctxSchema = { + "schema": "sqlctx.schema.v1", "models": { "orders": { "metrics": { @@ -138,10 +138,10 @@ export const sidemanticSchema = { } } as const; -export type SidemanticSchema = typeof sidemanticSchema; -export type Metric = typeof sidemanticSchema.metrics[number]; -export type Dimension = typeof sidemanticSchema.dimensions[number]; -export type SemanticField = typeof sidemanticSchema.fields[number]; +export type SqlctxSchema = typeof sqlctxSchema; +export type Metric = typeof sqlctxSchema.metrics[number]; +export type Dimension = typeof sqlctxSchema.dimensions[number]; +export type SemanticField = typeof sqlctxSchema.fields[number]; export type DashboardRenderer = "vega-lite" | "plotly" | "observable-plot" | "d3" | "crossfilter"; export type ChartType = "auto" | "bar" | "line" | "area" | "scatter" | "point"; @@ -167,7 +167,7 @@ export interface FieldValueMap { export type FieldValue = F extends keyof FieldValueMap ? FieldValueMap[F] : never; export type DashboardConfig = { - schema?: "sidemantic.dashboard.v1"; + schema?: "sqlctx.dashboard.v1"; title: string; defaults?: DashboardDefaults; tabs: readonly DashboardTab[]; diff --git a/examples/headless_dashboard/sidemantic.queries.generated.ts b/examples/headless_dashboard/sqlctx.queries.generated.ts similarity index 88% rename from examples/headless_dashboard/sidemantic.queries.generated.ts rename to examples/headless_dashboard/sqlctx.queries.generated.ts index 5a6ae10bb..f14d51526 100644 --- a/examples/headless_dashboard/sidemantic.queries.generated.ts +++ b/examples/headless_dashboard/sqlctx.queries.generated.ts @@ -1,4 +1,4 @@ -/* Generated by `sidemantic gen sql`. Do not edit by hand. */ +/* Generated by `sqlctx gen sql`. Do not edit by hand. */ export interface GeneratedQueries { "SELECT orders.region, orders.revenue FROM orders": { row: { "region": string; "revenue": number }; diff --git a/examples/headless_dashboard/vite.config.example.ts b/examples/headless_dashboard/vite.config.example.ts index a6842c749..3f7880cbd 100644 --- a/examples/headless_dashboard/vite.config.example.ts +++ b/examples/headless_dashboard/vite.config.example.ts @@ -1,25 +1,25 @@ -// Example Vite config: regenerate Sidemantic types automatically. +// Example Vite config: regenerate sqlctx types automatically. // -// With this plugin the "build step" is invisible — `sidemantic.client.generated.ts` and -// `sidemantic.queries.generated.ts` are rewritten on dev-server start and whenever +// With this plugin the "build step" is invisible — `sqlctx.client.generated.ts` and +// `sqlctx.queries.generated.ts` are rewritten on dev-server start and whenever // `models.yml` (or a scanned source) changes. You import the real generated files, so the // editor / `tsc` get full `as const` autocomplete with no manual `gen types` command. // -// import { schema } from "./sidemantic.client.generated"; -// import type { GeneratedQueries } from "./sidemantic.queries.generated"; -// import { createClient, createSqlClient } from "sidemantic-wasm/client"; +// import { schema } from "./sqlctx.client.generated"; +// import type { GeneratedQueries } from "./sqlctx.queries.generated"; +// import { createClient, createSqlClient } from "sqlctx-wasm/client"; import { defineConfig } from "vite"; -import { sidemantic } from "sidemantic-wasm/vite"; +import { sqlctx } from "sqlctx-wasm/vite"; export default defineConfig({ plugins: [ - sidemantic({ + sqlctx({ models: "models.yml", - output: "sidemantic.client.generated.ts", + output: "sqlctx.client.generated.ts", sql: { sources: ["queries.ts"], - output: "sidemantic.queries.generated.ts", + output: "sqlctx.queries.generated.ts", }, }), ], diff --git a/examples/hive_parquet/README.md b/examples/hive_parquet/README.md index 417ff31fe..d3dd09eee 100644 --- a/examples/hive_parquet/README.md +++ b/examples/hive_parquet/README.md @@ -1,6 +1,6 @@ # Hive-Partitioned Parquet Files -DuckDB natively supports [Hive-partitioned parquet](https://duckdb.org/docs/data/partitioning/hive_partitioning) directories. Sidemantic works with them by using the `sql` field on a model with `read_parquet(..., hive_partitioning=true)`. +DuckDB natively supports [Hive-partitioned parquet](https://duckdb.org/docs/data/partitioning/hive_partitioning) directories. sqlctx works with them by using the `sql` field on a model with `read_parquet(..., hive_partitioning=true)`. ## Examples @@ -28,7 +28,7 @@ data/events/ Define a model using `sql` instead of `table`: ```python -from sidemantic import Model, Dimension, Metric +from sqlctx import Model, Dimension, Metric events = Model( name="events", @@ -77,7 +77,7 @@ Partition columns (`year`, `month`) become regular columns you can use as dimens For large parquet datasets, you can materialize rollup tables in DuckDB so dashboards don't need to scan raw files on every query. Define pre-aggregations on the model: ```python -from sidemantic.core.pre_aggregation import PreAggregation +from sqlctx.core.pre_aggregation import PreAggregation events = Model( name="events", diff --git a/examples/hive_parquet/hive_parquet_example.py b/examples/hive_parquet/hive_parquet_example.py index ec7e49c90..2257b1097 100644 --- a/examples/hive_parquet/hive_parquet_example.py +++ b/examples/hive_parquet/hive_parquet_example.py @@ -1,11 +1,11 @@ #!/usr/bin/env python3 # /// script -# dependencies = ["sidemantic", "duckdb", "pandas"] +# dependencies = ["sqlctx @ git+https://github.com/sidequery/sqlctx", "duckdb", "pandas"] # /// -"""Example: Using Sidemantic with Hive-partitioned parquet files. +"""Example: Using sqlctx with Hive-partitioned parquet files. DuckDB natively supports reading Hive-partitioned parquet directories. -Sidemantic works with them via the `sql` field on a Model, which lets you +sqlctx works with them via the `sql` field on a Model, which lets you use read_parquet() with hive_partitioning=true. This example: @@ -25,7 +25,7 @@ import duckdb -from sidemantic import Dimension, Metric, Model, SemanticLayer +from sqlctx import Dimension, Metric, Model, SemanticLayer def create_hive_partitioned_data(base_dir: str): diff --git a/examples/hive_parquet/hive_parquet_preagg_example.py b/examples/hive_parquet/hive_parquet_preagg_example.py index eed074f3a..2df5e82a0 100644 --- a/examples/hive_parquet/hive_parquet_preagg_example.py +++ b/examples/hive_parquet/hive_parquet_preagg_example.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # /// script -# dependencies = ["sidemantic", "duckdb", "pandas"] +# dependencies = ["sqlctx @ git+https://github.com/sidequery/sqlctx", "duckdb", "pandas"] # /// """Example: DuckDB pre-aggregation layer on top of Hive-partitioned parquet. @@ -25,8 +25,8 @@ import duckdb -from sidemantic import Dimension, Metric, Model, SemanticLayer -from sidemantic.core.pre_aggregation import PreAggregation +from sqlctx import Dimension, Metric, Model, SemanticLayer +from sqlctx.core.pre_aggregation import PreAggregation def create_hive_partitioned_data(base_dir: str): diff --git a/examples/integrations/chart_example.py b/examples/integrations/chart_example.py index 470eed055..95da501e7 100644 --- a/examples/integrations/chart_example.py +++ b/examples/integrations/chart_example.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # /// script -# dependencies = ["sidemantic[charts]", "duckdb"] +# dependencies = ["sqlctx[charts] @ git+https://github.com/sidequery/sqlctx", "duckdb"] # /// """Example demonstrating chart generation from semantic layer queries. @@ -9,8 +9,8 @@ from pathlib import Path -from sidemantic import SemanticLayer, load_from_directory -from sidemantic.charts import chart_to_vega, create_chart +from sqlctx import SemanticLayer, load_from_directory +from sqlctx.charts import chart_to_vega, create_chart def setup_demo_data(layer): diff --git a/examples/integrations/export_example.py b/examples/integrations/export_example.py index 2df902e5e..c0a7551b0 100644 --- a/examples/integrations/export_example.py +++ b/examples/integrations/export_example.py @@ -1,13 +1,13 @@ #!/usr/bin/env python """Example demonstrating export functionality for Cube and MetricFlow.""" -from sidemantic.adapters.cube import CubeAdapter -from sidemantic.adapters.metricflow import MetricFlowAdapter -from sidemantic.core.semantic_layer import SemanticLayer +from sqlctx.adapters.cube import CubeAdapter +from sqlctx.adapters.metricflow import MetricFlowAdapter +from sqlctx.core.semantic_layer import SemanticLayer -# Load from native Sidemantic YAML -print("Loading native Sidemantic YAML...") -sl = SemanticLayer.from_yaml("tests/fixtures/sidemantic/orders.yml") +# Load from native sqlctx YAML +print("Loading native sqlctx YAML...") +sl = SemanticLayer.from_yaml("tests/fixtures/sqlctx/orders.yml") print(f"Loaded {len(sl.list_models())} models and {len(sl.list_metrics())} metrics") # Export to Cube format @@ -22,12 +22,12 @@ mf_adapter.export(sl.graph, "/tmp/semantic_models_exported.yml") print("Exported to /tmp/semantic_models_exported.yml") -# Demonstrate round-trip: Cube -> Sidemantic -> Cube +# Demonstrate round-trip: Cube -> sqlctx -> Cube print("\nDemonstrating Cube round-trip...") cube_graph = cube_adapter.parse("/tmp/orders_exported.yml") print(f"Re-imported {len(cube_graph.models)} models from Cube") -# Demonstrate round-trip: MetricFlow -> Sidemantic -> MetricFlow +# Demonstrate round-trip: MetricFlow -> sqlctx -> MetricFlow print("\nDemonstrating MetricFlow round-trip...") mf_graph = mf_adapter.parse("/tmp/semantic_models_exported.yml") print(f"Re-imported {len(mf_graph.models)} models and {len(mf_graph.metrics)} metrics from MetricFlow") diff --git a/examples/integrations/headless_charting.py b/examples/integrations/headless_charting.py index 9ede9893b..ff9fd4ec5 100644 --- a/examples/integrations/headless_charting.py +++ b/examples/integrations/headless_charting.py @@ -7,7 +7,7 @@ surface in one place. Run: - uv run examples/integrations/headless_charting.py --output-dir /tmp/sidemantic-charts + uv run examples/integrations/headless_charting.py --output-dir /tmp/sqlctx-charts """ from __future__ import annotations @@ -18,9 +18,9 @@ import yaml -from sidemantic import Dimension, Metric, Model, SemanticLayer -from sidemantic.dashboard import DASHBOARD_SCHEMA, generate_dashboard_typescript -from sidemantic.viz import ChartBuilder, CrossfilterDashboard, CrossfilterTab +from sqlctx import Dimension, Metric, Model, SemanticLayer +from sqlctx.dashboard import DASHBOARD_SCHEMA, generate_dashboard_typescript +from sqlctx.viz import ChartBuilder, CrossfilterDashboard, CrossfilterTab def build_layer( @@ -300,7 +300,7 @@ def main() -> None: parser.add_argument( "--output-dir", type=Path, - default=Path("/tmp/sidemantic-headless-charting"), + default=Path("/tmp/sqlctx-headless-charting"), help="Directory to write renderer specs and preview HTML", ) parser.add_argument("--large-records", type=int, default=200_000, help="Rows to generate for the large tab") @@ -416,7 +416,7 @@ def main() -> None: ) (args.output_dir / "dashboard.yml").write_text(yaml.safe_dump(dashboard_spec, sort_keys=False)) (args.output_dir / "dashboard.ts").write_text(_dashboard_ts_example(dashboard_spec)) - (args.output_dir / "sidemantic.generated.ts").write_text(generate_dashboard_typescript(layer)) + (args.output_dir / "sqlctx.generated.ts").write_text(generate_dashboard_typescript(layer)) (args.output_dir / "interactive_gallery.html").write_text(_gallery_html(html_outputs)) @@ -520,7 +520,7 @@ def _dashboard_ts_example(spec: dict) -> str: tab_calls.append(f' revenueExplorerTab("{tab["id"]}", "{tab["label"]}", "{model_name}", "{chart["title"]}")') model_union = " | ".join(f'"{model_name}"' for model_name in model_names) tab_calls_source = ",\n".join(tab_calls) - return f"""import {{ defineDashboard, type DashboardRenderer }} from "./sidemantic.generated"; + return f"""import {{ defineDashboard, type DashboardRenderer }} from "./sqlctx.generated"; type OrdersModel = {model_union}; @@ -568,7 +568,7 @@ def _dashboard_ts_example(spec: dict) -> str: }} export default defineDashboard({{ - schema: "sidemantic.dashboard.v1", + schema: "sqlctx.dashboard.v1", title: "{spec["title"]}", defaults: {{ renderer, @@ -597,7 +597,7 @@ def _gallery_html(html_outputs: dict[str, str]) -> str: - Sidemantic Headless Charting Gallery + sqlctx Headless Charting Gallery