You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduce a shared resolver API in hotdata-runtime and enforce it with contract tests so adapters can rely on one source of workspace selection semantics.
`hotdata-runtime` is the framework-agnostic runtime contract for Hotdata integrations.
4
+
5
+
## Scope
6
+
7
+
This package provides shared primitives for:
8
+
9
+
- Environment and workspace resolution
10
+
- Query execution and polling
11
+
- Normalized tabular result handling
12
+
- Basic workspace health checks
13
+
14
+
## Public Runtime Contract
15
+
16
+
The supported import surface is:
17
+
18
+
-`HotdataClient`
19
+
-`QueryResult`
20
+
-`from_env`
21
+
-`workspace_health_lines`
22
+
-`default_api_key`
23
+
-`default_host`
24
+
-`default_session_id`
25
+
-`explicit_workspace_id`
26
+
-`list_workspaces`
27
+
-`normalize_host`
28
+
-`pick_workspace`
29
+
-`resolve_workspace_selection`
30
+
-`WorkspaceSelection`
31
+
32
+
Adapters should import from `hotdata_runtime` and treat this surface as the stable API.
33
+
34
+
## Semantic Guarantees
35
+
36
+
### `HotdataClient`
37
+
38
+
- Represents runtime context: API key, host, workspace, optional session.
39
+
-`from_env()` resolves runtime context from env vars and selected workspace.
40
+
-`execute_sql(sql)` returns `QueryResult` or raises `RuntimeError`/`TimeoutError`.
41
+
-`get_result(result_id)` returns a ready `QueryResult` and waits for readiness when needed.
42
+
43
+
### `QueryResult`
44
+
45
+
- Canonical tabular result model with `columns`, `rows`, and `row_count`.
46
+
- Carries server identifiers and execution metadata when available.
47
+
-`to_pandas()` converts to a DataFrame with stable column ordering.
48
+
49
+
### Env Resolution
50
+
51
+
-`default_api_key()` reads `HOTDATA_API_KEY` then `HOTDATA_TOKEN`.
52
+
-`default_host()` reads `HOTDATA_API_URL` (default: `https://api.hotdata.dev`) and normalizes it.
53
+
-`default_session_id()` reads `HOTDATA_SANDBOX`.
54
+
-`pick_workspace()` prefers explicit env workspace, then active workspace, then first workspace.
55
+
-`resolve_workspace_selection()` is the canonical workspace selection algorithm. It returns `WorkspaceSelection` with selected workspace id, selection source, and discovered workspaces when auto-selected.
Copy file name to clipboardExpand all lines: README.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,8 @@
2
2
3
3
Shared runtime primitives for Hotdata integrations: workspace/session semantics, execution context, query state, run history, and replayable result handles. Framework packages (Marimo, Jupyter, Streamlit, LangGraph) depend on this package.
4
4
5
+
Runtime boundary and guarantees are defined in `CONTRACT.md`.
0 commit comments