-
Notifications
You must be signed in to change notification settings - Fork 39
feat: eliminate Python altimate-engine — all 73 methods native TypeScript #221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
e9b6d93
feat: [Phase 0] add Dispatcher abstraction layer for Python bridge mi…
anandgupta42 4d1f538
fix: address code review findings for dispatcher
anandgupta42 13681c9
feat: [Phase 1] wire altimate-core napi-rs bindings — 34 native handlers
anandgupta42 2bbfec8
feat: [Phase 2] connection manager + 10 Node.js database drivers
anandgupta42 e550ac2
feat: [Phase 3+4] schema cache, finops, dbt, and local testing
anandgupta42 2f72dcb
feat: register composite SQL dispatcher methods — 72/73 native
anandgupta42 f1a11d8
feat: [Phase 5] remove Python bridge fallback — all 73 methods native
anandgupta42 845ee98
feat: [Phase 5 final] delete Python bridge + engine, move types, upda…
anandgupta42 ec8ac00
fix: address all code review findings — security, correctness, robust…
anandgupta42 0753907
refactor: extract @altimateai/drivers shared workspace package
anandgupta42 31e57cb
chore: fix review NITs + protect new files in upstream merge config
anandgupta42 9129f1d
chore: rename telemetry type bridge_call -> native_call
anandgupta42 886d1d7
test: add E2E driver tests + driver docs + discover integration
anandgupta42 ae9bef7
ci: add driver-e2e CI job + env var support for CI services
anandgupta42 80b37f4
test: Snowflake E2E tests + encrypted key-pair auth fix
anandgupta42 069bdb2
test: Databricks E2E tests — 24 tests against live account
anandgupta42 c92caca
feat: add warehouse telemetry — connect, query, introspection, discov…
anandgupta42 9157fc2
test: adversarial telemetry safety tests + defensive helper fixes
anandgupta42 31bd592
test: BigQuery E2E tests — 25 tests against live account
anandgupta42 368d6bb
ci: fix test isolation — cloud tests skip without credentials, driver…
anandgupta42 5eea91d
chore: bump @altimateai/altimate-core to ^0.2.3 (semver range)
anandgupta42 224646e
fix: address all 17 Sentry bot review comments on PR #221
anandgupta42 555bd64
merge: resolve conflicts with origin/main
anandgupta42 75cfe00
chore: remove stray pr221.diff file
anandgupta42 0546eda
test: 30 adversarial tests + optionalDependencies for drivers package
anandgupta42 2f8b1d3
feat: dbt-first SQL execution — use dbt adapter before falling back t…
anandgupta42 82520a3
test: E2E tests for dbt-first SQL execution
anandgupta42 fe392db
docs: update all documentation for Python elimination + dbt-first exe…
anandgupta42 1c91d43
fix: resolve remaining Sentry review comments
anandgupta42 69ad471
chore: remove all Python engine infrastructure from CI and build
anandgupta42 93f8115
fix: CI Redshift database, DuckDB race condition, schema-sync SQL escape
anandgupta42 d71ca7b
perf: lazy handler registration — load napi binary on first call
anandgupta42 1b1be03
fix: eliminate all mock.module usage — tests now match main baseline
anandgupta42 8c0088c
fix: resolve merge conflicts + fix flaky test timeouts + update guards
anandgupta42 43d73da
fix: resolve remaining Sentry comments — Databricks DATE_SUB + SqlExe…
anandgupta42 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| /** | ||
| * Dispatcher — routes tool calls to either native TypeScript handlers or the | ||
| * Python bridge (fallback). This is the Strangler Fig migration layer. | ||
| * | ||
| * Feature flags: | ||
| * ALTIMATE_NATIVE_ONLY=1 — throws if no native handler (CI gate) | ||
| * ALTIMATE_SHADOW_MODE=1 — runs both native + bridge, logs mismatches | ||
| */ | ||
|
|
||
| import { Bridge } from "../bridge/client" | ||
| import { BridgeMethods, type BridgeMethod } from "../bridge/protocol" | ||
| import { Log } from "../../util/log" | ||
|
|
||
| type NativeHandler = (params: any) => Promise<any> | ||
|
|
||
| const nativeHandlers = new Map<string, NativeHandler>() | ||
|
|
||
| /** Register a native TypeScript handler for a bridge method. */ | ||
| export function register(method: string, handler: NativeHandler): void { | ||
| nativeHandlers.set(method, handler) | ||
| } | ||
|
|
||
| /** Dispatch a method call to native handler or bridge fallback. */ | ||
| export async function call<M extends BridgeMethod>( | ||
| method: M, | ||
| params: (typeof BridgeMethods)[M] extends { params: infer P } ? P : never, | ||
| ): Promise<(typeof BridgeMethods)[M] extends { result: infer R } ? R : never> { | ||
| const native = nativeHandlers.get(method as string) | ||
|
|
||
| if (native) { | ||
| if (process.env.ALTIMATE_SHADOW_MODE === "1") { | ||
| // Parity testing: run both native and bridge, log mismatches | ||
| try { | ||
| const [nativeResult, bridgeResult] = await Promise.allSettled([ | ||
| native(params), | ||
| Bridge.call(method, params), | ||
| ]) | ||
| if ( | ||
| nativeResult.status === "fulfilled" && | ||
| bridgeResult.status === "fulfilled" | ||
| ) { | ||
| const nativeJson = JSON.stringify(nativeResult.value, null, 0) | ||
| const bridgeJson = JSON.stringify(bridgeResult.value, null, 0) | ||
| if (nativeJson !== bridgeJson) { | ||
| Log.Default.warn("shadow mode mismatch", { | ||
| method: String(method), | ||
| native: nativeJson.slice(0, 500), | ||
| bridge: bridgeJson.slice(0, 500), | ||
| }) | ||
| } | ||
| } | ||
| if (nativeResult.status === "fulfilled") { | ||
| return nativeResult.value as any | ||
| } | ||
| // Native failed — fall through to bridge result or throw | ||
| if (bridgeResult.status === "fulfilled") { | ||
| return bridgeResult.value as any | ||
| } | ||
| throw nativeResult.reason | ||
| } catch (e) { | ||
| // Shadow mode should not break the user — fall through to bridge | ||
| return Bridge.call(method, params) | ||
| } | ||
| } | ||
| return native(params) as any | ||
| } | ||
|
|
||
| if (process.env.ALTIMATE_NATIVE_ONLY === "1") { | ||
| throw new Error( | ||
| `No native handler for ${String(method)} (ALTIMATE_NATIVE_ONLY=1)`, | ||
| ) | ||
| } | ||
|
|
||
| return Bridge.call(method, params) | ||
| } | ||
|
|
||
| /** Check if a native handler is registered for a method. */ | ||
| export function hasNativeHandler(method: string): boolean { | ||
| return nativeHandlers.has(method) | ||
| } | ||
|
|
||
| /** List all methods that have native handlers registered. */ | ||
| export function listNativeMethods(): string[] { | ||
| return Array.from(nativeHandlers.keys()) | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export * as Dispatcher from "./dispatcher" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.