From 5b3a5d5e30effd3f1503bcc9460946133d5b06bf Mon Sep 17 00:00:00 2001 From: anandgupta42 Date: Fri, 16 Oct 2026 12:51:01 -0700 Subject: [PATCH 1/3] chore: upgrade `@altimateai/altimate-core` to 0.8.0 - Pin `@altimateai/altimate-core` 0.8.0 and refresh `bun.lock` (main + 5 platform packages). - Exempt the first-party `@altimateai/altimate-core*` packages from the 3-day `minimumReleaseAge` in `bunfig.toml`, matching the existing first-party/pinned excludes, so a core release can be adopted on the day it ships. - Update the tests that pinned the old fail-closed behaviour: DuckDB `//`, `TIMESTAMPTZ '...'`, a `match` alias and SQLite `NOT GLOB` now parse and run as reads; enable the previously skipped `//` aggregate test; keep parse-failure coverage with a malformed `string_agg`. Closes #1529 Co-Authored-By: Claude Opus 5.5 --- bun.lock | 14 +++++++------- bunfig.toml | 2 +- packages/opencode/package.json | 2 +- .../test/altimate/tools/sql-classify.test.ts | 16 +++++++++------- .../test/altimate/tools/sql-execute.test.ts | 14 ++++++++++---- 5 files changed, 28 insertions(+), 20 deletions(-) diff --git a/bun.lock b/bun.lock index a48808397e..bc4498575b 100644 --- a/bun.lock +++ b/bun.lock @@ -272,7 +272,7 @@ "@ai-sdk/togetherai": "2.0.41", "@ai-sdk/vercel": "2.0.39", "@ai-sdk/xai": "3.0.82", - "@altimateai/altimate-core": "0.7.0", + "@altimateai/altimate-core": "0.8.0", "@altimateai/drivers": "workspace:*", "@aws-sdk/credential-providers": "3.1057.0", "@clack/prompts": "1.0.0-alpha.1", @@ -645,17 +645,17 @@ "@altimateai/altimate-code": ["@altimateai/altimate-code@workspace:packages/opencode"], - "@altimateai/altimate-core": ["@altimateai/altimate-core@0.7.0", "", { "optionalDependencies": { "@altimateai/altimate-core-darwin-arm64": "0.7.0", "@altimateai/altimate-core-darwin-x64": "0.7.0", "@altimateai/altimate-core-linux-arm64-gnu": "0.7.0", "@altimateai/altimate-core-linux-x64-gnu": "0.7.0", "@altimateai/altimate-core-win32-x64-msvc": "0.7.0" } }, "sha512-9LqXOUHhrsuZlvdfZEoFLyMGg5Uz83cHj6TrqMb0h8lK97UdeVBvd2S/53TB7sPVlYnpjFlI++fNh8swqADsLA=="], + "@altimateai/altimate-core": ["@altimateai/altimate-core@0.8.0", "", { "optionalDependencies": { "@altimateai/altimate-core-darwin-arm64": "0.8.0", "@altimateai/altimate-core-darwin-x64": "0.8.0", "@altimateai/altimate-core-linux-arm64-gnu": "0.8.0", "@altimateai/altimate-core-linux-x64-gnu": "0.8.0", "@altimateai/altimate-core-win32-x64-msvc": "0.8.0" } }, "sha512-Wmw99OBnrYF1faBDD4zrY6/LH6DLNOJKg1XBOPaNPf8HbFoskmOnsvUEnZK6qVAb11YHjVw/lh0y33zyatDaOQ=="], - "@altimateai/altimate-core-darwin-arm64": ["@altimateai/altimate-core-darwin-arm64@0.7.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-NBPwsfBT5Ul41u9zNiovYaOpZ+zhzHKq5+GqFWZcy4iW6k0aWUb30niTrz2Yse73/nWIt6G//pS4m4IX/nMy4g=="], + "@altimateai/altimate-core-darwin-arm64": ["@altimateai/altimate-core-darwin-arm64@0.8.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-qFvLLIE7WTCCWrSKFDylK9ypi9mHhRvphs/wcHIDWMhVUtLYmmP2KqYK7+2WKslGJafy9iypoP65VkqQx0cibg=="], - "@altimateai/altimate-core-darwin-x64": ["@altimateai/altimate-core-darwin-x64@0.7.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-pLEJT2ePh247XOIicaJw8x5i2hRsCF2HqgVUy9nKJf5ebynHLGZ2JFC0fMq4oRe9ZCmywN8EzMD1UwN1Nw9AUQ=="], + "@altimateai/altimate-core-darwin-x64": ["@altimateai/altimate-core-darwin-x64@0.8.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-DhQGxdyAdyK6uNlJEMPiE7OsdtzNv2eIpCpBhCtXVFNZTVKebwpXxb5RObpLq70j+x4NgjAMf1PVM8NHD/mRpA=="], - "@altimateai/altimate-core-linux-arm64-gnu": ["@altimateai/altimate-core-linux-arm64-gnu@0.7.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-co6Sm/iFIyYnsWxkhw7tUJRB9hfHH0Bjt0oa4bAysG8hVVoMhCN8ADS4fvPAg52Z8umk126mAN8k2XPfXh/ieA=="], + "@altimateai/altimate-core-linux-arm64-gnu": ["@altimateai/altimate-core-linux-arm64-gnu@0.8.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-UhhSJiTH7TRZSVQFzqc11MuHvYfdSDtqatXy6Q/RhFJ3s7AfL0XPL0BY3xW+BY9n+dsNxzeybkwtosGPE+iVTw=="], - "@altimateai/altimate-core-linux-x64-gnu": ["@altimateai/altimate-core-linux-x64-gnu@0.7.0", "", { "os": "linux", "cpu": "x64" }, "sha512-hc9tOl8v+DQFsy8TIkFPxZGTyohPcwpfUqquLgiuKn2U6MDyJK3962Nzf/TzgfcbHj+GQE34oyPJ709iaBZnGg=="], + "@altimateai/altimate-core-linux-x64-gnu": ["@altimateai/altimate-core-linux-x64-gnu@0.8.0", "", { "os": "linux", "cpu": "x64" }, "sha512-6LHZXcZi3DYwTvbGgzicS2dtC+MeJ6bzuFqWtb963Ulr1zFEUDWKUiiWWUsXs6JHVEoU9cX/xlGD0t3hZxA8Zg=="], - "@altimateai/altimate-core-win32-x64-msvc": ["@altimateai/altimate-core-win32-x64-msvc@0.7.0", "", { "os": "win32", "cpu": "x64" }, "sha512-GrykrvnilY1yZCgusNxVTvYr5ENkD1vpgjGib2qX/yvJVs0Nb59/JsSLzvA9XqAt2FVf7OcZ5ttH11OkxuFivg=="], + "@altimateai/altimate-core-win32-x64-msvc": ["@altimateai/altimate-core-win32-x64-msvc@0.8.0", "", { "os": "win32", "cpu": "x64" }, "sha512-AxjfES6ez0agb/2+hG82sVtRx/F/mlqmDC6WNPBBd5M1OALCNm/MKK5ydGRfNA94is9/mbqhNTtk1fGYUuJRGg=="], "@altimateai/dbt-integration": ["@altimateai/dbt-integration@0.2.14", "", { "dependencies": { "@altimateai/altimate-core": "0.1.6", "node-abort-controller": "^3.1.1", "node-fetch": "^3.3.2", "python-bridge": "^1.1.0", "semver": "^7.6.3", "yaml": "^2.5.0" }, "peerDependencies": { "patch-package": "^8.0.0" } }, "sha512-44hFBx3gXss2RUlRZE9cIpAocffB3miAzpjvmma1EED0jiOhyrgmzGsw3RXEZqs73OuLYpDehixvRUt1vTfcfQ=="], diff --git a/bunfig.toml b/bunfig.toml index c506ff57c4..4085c4e20d 100644 --- a/bunfig.toml +++ b/bunfig.toml @@ -2,7 +2,7 @@ exact = true # Only install newly resolved package versions published at least 3 days ago. minimumReleaseAge = 259200 -minimumReleaseAgeExcludes = ["@ai-sdk/amazon-bedrock", "@ai-sdk/anthropic", "@opentui/core", "@opentui/core-darwin-arm64", "@opentui/core-darwin-x64", "@opentui/core-linux-arm64", "@opentui/core-linux-arm64-musl", "@opentui/core-linux-x64", "@opentui/core-linux-x64-musl", "@opentui/core-win32-arm64", "@opentui/core-win32-x64", "@opentui/keymap", "@opentui/solid", "opentui-spinner", "gitlab-ai-provider", "opencode-gitlab-auth", "@ff-labs/fff-node", "@ff-labs/fff-bun", "@ff-labs/fff-bin-darwin-arm64", "@ff-labs/fff-bin-darwin-x64", "@ff-labs/fff-bin-linux-arm64-gnu", "@ff-labs/fff-bin-linux-arm64-musl", "@ff-labs/fff-bin-linux-x64-gnu", "@ff-labs/fff-bin-linux-x64-musl", "@ff-labs/fff-bin-win32-arm64", "@ff-labs/fff-bin-win32-x64", "@pierre/diffs", "@pierre/theming", "app-builder-lib", "dmg-builder", "electron-builder", "electron-publish"] +minimumReleaseAgeExcludes = ["@altimateai/altimate-core", "@altimateai/altimate-core-darwin-arm64", "@altimateai/altimate-core-darwin-x64", "@altimateai/altimate-core-linux-arm64-gnu", "@altimateai/altimate-core-linux-x64-gnu", "@altimateai/altimate-core-win32-x64-msvc", "@ai-sdk/amazon-bedrock", "@ai-sdk/anthropic", "@opentui/core", "@opentui/core-darwin-arm64", "@opentui/core-darwin-x64", "@opentui/core-linux-arm64", "@opentui/core-linux-arm64-musl", "@opentui/core-linux-x64", "@opentui/core-linux-x64-musl", "@opentui/core-win32-arm64", "@opentui/core-win32-x64", "@opentui/keymap", "@opentui/solid", "opentui-spinner", "gitlab-ai-provider", "opencode-gitlab-auth", "@ff-labs/fff-node", "@ff-labs/fff-bun", "@ff-labs/fff-bin-darwin-arm64", "@ff-labs/fff-bin-darwin-x64", "@ff-labs/fff-bin-linux-arm64-gnu", "@ff-labs/fff-bin-linux-arm64-musl", "@ff-labs/fff-bin-linux-x64-gnu", "@ff-labs/fff-bin-linux-x64-musl", "@ff-labs/fff-bin-win32-arm64", "@ff-labs/fff-bin-win32-x64", "@pierre/diffs", "@pierre/theming", "app-builder-lib", "dmg-builder", "electron-builder", "electron-publish"] [test] root = "./do-not-run-tests-from-root" diff --git a/packages/opencode/package.json b/packages/opencode/package.json index 764cae76e0..5df16693ba 100644 --- a/packages/opencode/package.json +++ b/packages/opencode/package.json @@ -79,7 +79,7 @@ "@ai-sdk/togetherai": "2.0.41", "@ai-sdk/vercel": "2.0.39", "@ai-sdk/xai": "3.0.82", - "@altimateai/altimate-core": "0.7.0", + "@altimateai/altimate-core": "0.8.0", "@altimateai/drivers": "workspace:*", "@aws-sdk/credential-providers": "3.1057.0", "@clack/prompts": "1.0.0-alpha.1", diff --git a/packages/opencode/test/altimate/tools/sql-classify.test.ts b/packages/opencode/test/altimate/tools/sql-classify.test.ts index 2032a7b35d..eda81c130d 100644 --- a/packages/opencode/test/altimate/tools/sql-classify.test.ts +++ b/packages/opencode/test/altimate/tools/sql-classify.test.ts @@ -341,18 +341,20 @@ describe("SQL-building aggregates are reads", () => { }) } - // Known core-parser gap (altimate-core-internal): DuckDB `//` integer division fails to parse, - // so a read-only string_agg query using it is conservatively classified as a write. - // Flip to `test` once the parser supports it. - test.skip("duckdb: `//` integer division in a string_agg query → read (core parser gap)", () => { + test("duckdb: `//` integer division in a string_agg query → read", () => { const sql = "SELECT 'c' || (rn // 240) c, count(*), string_agg('''' || Symbol || '''', ',' ORDER BY Symbol) FROM t GROUP BY 1" - expect(classifyAndCheck(sql, "duckdb").queryType).toBe("read") + expect(classifyAndCheck(sql, "duckdb")).toEqual({ queryType: "read", blocked: false }) }) - test("duckdb: `//` currently fails closed with an explanatory diagnostic", () => { + test("duckdb: `//` classifies as read without a parse diagnostic", () => { const r = classifyAndCheck("SELECT 'c' || (rn // 240) c, string_agg(Symbol, ',') FROM t GROUP BY 1", "duckdb") + expect(r).toEqual({ queryType: "read", blocked: false }) + }) + + test("duckdb: malformed string_agg fails closed with an explanatory diagnostic", () => { + const r = classifyAndCheck("SELECT string_agg(Symbol, ','", "duckdb") expect(r.queryType).toBe("write") expect(r.blocked).toBe(false) - expect(r.parseError).toBeTruthy() + expect(r.parseError).toMatch(/Parse error.*Expected RParen/) }) }) diff --git a/packages/opencode/test/altimate/tools/sql-execute.test.ts b/packages/opencode/test/altimate/tools/sql-execute.test.ts index 6c5b90d253..97a90d151b 100644 --- a/packages/opencode/test/altimate/tools/sql-execute.test.ts +++ b/packages/opencode/test/altimate/tools/sql-execute.test.ts @@ -109,14 +109,20 @@ describe("sql_execute parser read boundary", () => { ["sqlite", "SELECT 'article' NOT GLOB 'a*'"], ["duckdb", "SELECT TIMESTAMPTZ '2024-02-03 00:00:00+00'"], ["duckdb", "SELECT * FROM items match"], - ])("explains unsupported %s read syntax: %s", async (type, query) => { + ])("accepts %s read syntax the parser now supports: %s", async (type, query) => { const config = spyOn(Registry, "getConfig").mockReturnValue({ type }) const tool = await initTool(SqlExecuteTool) const ask = spyOn(ctx, "ask").mockImplementation(() => Effect.die(new Error("write denied by test"))) try { - await expect(tool.execute({ query, warehouse: "source" }, ctx)).rejects.toThrow("write denied by test") - expect(ask).toHaveBeenCalledTimes(1) - expect(dispatch).not.toHaveBeenCalled() + const result = await tool.execute({ query, warehouse: "source" }, ctx) + expect(result.metadata.error).toBeUndefined() + expect(ask).not.toHaveBeenCalled() + expect(dispatch).toHaveBeenCalledTimes(1) + expect(dispatch).toHaveBeenCalledWith( + "sql.execute", + expect.objectContaining({ sql: query, warehouse: "source" }), + expect.anything(), + ) } finally { ask.mockRestore() config.mockRestore() From 7507c57efe9e463ff82c035fd2ce15c42b923ac1 Mon Sep 17 00:00:00 2001 From: anandgupta42 Date: Fri, 16 Oct 2026 13:02:59 -0700 Subject: [PATCH 2/3] docs: update core pin reference to 0.8.0 Co-Authored-By: Claude Opus 5.5 --- docs/internal/deterministic-checks-engine-split.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/internal/deterministic-checks-engine-split.md b/docs/internal/deterministic-checks-engine-split.md index 4ae3a38ab8..6f96af9a63 100644 --- a/docs/internal/deterministic-checks-engine-split.md +++ b/docs/internal/deterministic-checks-engine-split.md @@ -34,7 +34,7 @@ Relevant because it sets the cost of "add something engine-side". layer), `altimate-core-node` (napi-rs), plus `polyglot-sql` for multi-dialect parse and transpile. - Published as the npm package `@altimateai/altimate-core` (per-platform native addon). - altimate-code pins it exactly: `packages/opencode/package.json` → `"@altimateai/altimate-core": "0.7.0"`. + altimate-code pins it exactly: `packages/opencode/package.json` → `"@altimateai/altimate-core": "0.8.0"`. - Consumer binding: `packages/opencode/src/altimate/native/altimate-core.ts` registers 42 `altimate_core.*` handlers on the dispatcher. Registration is lazy — the napi binary loads on the first `Dispatcher.call()` (`packages/opencode/src/altimate/native/index.ts`), so a From 9740204d786b4063d076423f73e31a10bf235f4c Mon Sep 17 00:00:00 2001 From: anandgupta42 Date: Fri, 16 Oct 2026 13:11:52 -0700 Subject: [PATCH 3/3] chore: wrap the bunfig core exemption in `altimate_change` markers Co-Authored-By: Claude Opus 5.5 --- bunfig.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bunfig.toml b/bunfig.toml index 4085c4e20d..17d9eed282 100644 --- a/bunfig.toml +++ b/bunfig.toml @@ -2,7 +2,9 @@ exact = true # Only install newly resolved package versions published at least 3 days ago. minimumReleaseAge = 259200 +# altimate_change start — first-party @altimateai/altimate-core* packages are adopted on release day minimumReleaseAgeExcludes = ["@altimateai/altimate-core", "@altimateai/altimate-core-darwin-arm64", "@altimateai/altimate-core-darwin-x64", "@altimateai/altimate-core-linux-arm64-gnu", "@altimateai/altimate-core-linux-x64-gnu", "@altimateai/altimate-core-win32-x64-msvc", "@ai-sdk/amazon-bedrock", "@ai-sdk/anthropic", "@opentui/core", "@opentui/core-darwin-arm64", "@opentui/core-darwin-x64", "@opentui/core-linux-arm64", "@opentui/core-linux-arm64-musl", "@opentui/core-linux-x64", "@opentui/core-linux-x64-musl", "@opentui/core-win32-arm64", "@opentui/core-win32-x64", "@opentui/keymap", "@opentui/solid", "opentui-spinner", "gitlab-ai-provider", "opencode-gitlab-auth", "@ff-labs/fff-node", "@ff-labs/fff-bun", "@ff-labs/fff-bin-darwin-arm64", "@ff-labs/fff-bin-darwin-x64", "@ff-labs/fff-bin-linux-arm64-gnu", "@ff-labs/fff-bin-linux-arm64-musl", "@ff-labs/fff-bin-linux-x64-gnu", "@ff-labs/fff-bin-linux-x64-musl", "@ff-labs/fff-bin-win32-arm64", "@ff-labs/fff-bin-win32-x64", "@pierre/diffs", "@pierre/theming", "app-builder-lib", "dmg-builder", "electron-builder", "electron-publish"] +# altimate_change end [test] root = "./do-not-run-tests-from-root"