Skip to content

Commit cdf89a6

Browse files
committed
release: v0.8.2
1 parent b61893e commit cdf89a6

2 files changed

Lines changed: 146 additions & 0 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.8.2] - 2026-06-03
9+
10+
A small correctness patch. The dbt PR reviewer's deterministic engine never required an altimate API key — but two tool descriptions said it did, which could push the reviewer into lint-only mode and send users chasing a key they don't need. This release corrects that and documents what "lint-only" actually means.
11+
12+
### Fixed
13+
14+
- **`dbt_pr_review` no longer implies it needs an altimate API key.** The native `altimate-core` engine behind the reviewer (column-lineage blast radius, query equivalence, PII classification, A–F grade) runs **fully offline** via the bundled napi binary — there is no `altimate_core.init` and no API-key gate in that path. Two tool descriptions (`altimate_core_column_lineage`, `altimate_core_track_lineage`) still carried a stale Python-bridge-era line claiming *"Requires `altimate_core.init()` with API key"*, so a stuck **lint-only** run was mis-diagnosed as missing auth. The descriptions now state the tools run offline with no key. **Lint-only actually means the dbt `manifest.json` didn't resolve** (wrong path, stale manifest, or wrong working directory) — the [dbt PR Review docs](https://docs.altimate.sh/usage/dbt-pr-review/) now spell out how to fix it. The only thing that ever needs a key is the optional advisory LLM lane, which can never block a verdict. (#882)
15+
816
## [0.8.1] - 2026-06-02
917

1018
A reliability + correctness patch on top of 0.8.0. Highlights: **8 new Snowflake Cortex models** (with a config escape-hatch so you never wait for a release again), a **trace-corruption fix** for long-running sessions, and a **behavior change to the dbt PR reviewer** — it now always posts a GitHub *comment* and never a formal *approval*.
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
// Adversarial / regression tests for the v0.8.2 release.
2+
//
3+
// v0.8.2 rolls up:
4+
// #882 — the native altimate-core lineage tools (`column_lineage`,
5+
// `track_lineage`) run FULLY OFFLINE via the bundled napi binary.
6+
// Two tool descriptions used to falsely claim "Requires
7+
// altimate_core.init() with API key" — a stale Python-bridge leftover
8+
// that made the reviewer agent demand a key and degrade dbt_pr_review
9+
// to lint-only. The claim was corrected to "no API key required".
10+
// #884 — hardened the regression guard: loosened the false-claim regex and
11+
// added a source sweep across every altimate-core-* tool.
12+
//
13+
// These tests attack the corrected invariant adversarially: with EVERY altimate
14+
// auth environment variable stripped, can the engine still resolve lineage
15+
// (proving the "no API key" claim at runtime, not just in description text)?
16+
// Does the offline path stay crash-safe on hostile input? And can the stale
17+
// `altimate_core.init()` marker sneak back into any tool source?
18+
import { describe, test, expect, beforeAll, afterAll } from "bun:test"
19+
import { readdirSync, readFileSync } from "node:fs"
20+
import { join } from "node:path"
21+
import * as Dispatcher from "../../src/altimate/native/dispatcher"
22+
import { registerAll } from "../../src/altimate/native/altimate-core"
23+
import { AltimateCoreColumnLineageTool } from "../../src/altimate/tools/altimate-core-column-lineage"
24+
import { AltimateCoreTrackLineageTool } from "../../src/altimate/tools/altimate-core-track-lineage"
25+
26+
// Plausible altimate auth/account env vars. The native engine reads NONE of
27+
// these — stripping them must not change lineage behavior. That is the whole
28+
// point of #882: lineage is offline.
29+
const ALTIMATE_AUTH_ENV = [
30+
"ALTIMATE_API_KEY",
31+
"ALTIMATE_AI_API_KEY",
32+
"ALTIMATE_INSTANCE",
33+
"ALTIMATE_URL",
34+
"ALTIMATE_TENANT",
35+
]
36+
37+
const saved: Record<string, string | undefined> = {}
38+
39+
beforeAll(() => {
40+
for (const k of ALTIMATE_AUTH_ENV) {
41+
saved[k] = process.env[k]
42+
delete process.env[k]
43+
}
44+
// Re-register in case Dispatcher.reset() ran in another test file.
45+
registerAll()
46+
})
47+
48+
afterAll(() => {
49+
for (const k of ALTIMATE_AUTH_ENV) {
50+
if (saved[k] === undefined) delete process.env[k]
51+
else process.env[k] = saved[k]
52+
}
53+
})
54+
55+
// ---------------------------------------------------------------------------
56+
// #882 — the "no API key" claim must hold at RUNTIME, with auth env stripped
57+
// ---------------------------------------------------------------------------
58+
describe("v0.8.2 — altimate-core lineage runs offline (no API key)", () => {
59+
test("column_lineage resolves with every altimate auth env var unset", async () => {
60+
for (const k of ALTIMATE_AUTH_ENV) expect(process.env[k]).toBeUndefined()
61+
const result = await Dispatcher.call("altimate_core.column_lineage", {
62+
sql: "SELECT id, name FROM users",
63+
})
64+
// success=true means the handler completed offline — no auth gate fired.
65+
expect(result.success).toBe(true)
66+
expect(result.data).toBeDefined()
67+
})
68+
69+
test("track_lineage resolves with every altimate auth env var unset", async () => {
70+
const result = await Dispatcher.call("altimate_core.track_lineage", {
71+
queries: ["CREATE TABLE stg AS SELECT id FROM raw", "SELECT id FROM stg"],
72+
})
73+
expect(result.success).toBe(true)
74+
expect(result.data).toBeDefined()
75+
})
76+
77+
// Text claim and runtime behavior must agree: a tool that SAYS "no API key"
78+
// must also WORK with no API key. Pin both together so neither can drift.
79+
test("description claim matches runtime: column_lineage", async () => {
80+
const { description } = await AltimateCoreColumnLineageTool.init()
81+
expect(description.toLowerCase()).toContain("no api key")
82+
expect(description.toLowerCase()).not.toContain("altimate_core.init")
83+
})
84+
85+
test("description claim matches runtime: track_lineage", async () => {
86+
const { description } = await AltimateCoreTrackLineageTool.init()
87+
expect(description.toLowerCase()).toContain("no api key")
88+
expect(description.toLowerCase()).not.toContain("altimate_core.init")
89+
})
90+
})
91+
92+
// ---------------------------------------------------------------------------
93+
// #882 — the offline path must stay crash-safe on hostile input
94+
// (a review must never crash CI; bad SQL is a structured result, not a throw)
95+
// ---------------------------------------------------------------------------
96+
describe("v0.8.2 — offline lineage is crash-safe on hostile input", () => {
97+
const hostileSql = [
98+
"", // empty
99+
" ", // whitespace
100+
"SELECT", // truncated
101+
"'; DROP TABLE users; --", // injection-shaped
102+
"SELECT __proto__, constructor FROM x", // prototype-pollution-shaped identifiers
103+
"SELECT * FROM " + "a,".repeat(500) + "b", // pathological width
104+
]
105+
106+
for (const sql of hostileSql) {
107+
test(`column_lineage returns a structured result (no throw) for ${JSON.stringify(sql.slice(0, 24))}`, async () => {
108+
const result = await Dispatcher.call("altimate_core.column_lineage", { sql })
109+
// Contract: the handler returns an envelope with a boolean success flag —
110+
// semantic failure lives in the data, it never throws.
111+
expect(typeof result.success).toBe("boolean")
112+
})
113+
}
114+
115+
test("track_lineage tolerates an empty query list without throwing", async () => {
116+
const result = await Dispatcher.call("altimate_core.track_lineage", { queries: [] })
117+
expect(typeof result.success).toBe("boolean")
118+
})
119+
})
120+
121+
// ---------------------------------------------------------------------------
122+
// #884 — the stale `altimate_core.init()` marker must never return to any tool
123+
// ---------------------------------------------------------------------------
124+
describe("v0.8.2 — no altimate-core tool reintroduces altimate_core.init()", () => {
125+
const toolsDir = join(import.meta.dir, "../../src/altimate/tools")
126+
const files = readdirSync(toolsDir).filter((f) => f.startsWith("altimate-core-") && f.endsWith(".ts"))
127+
128+
test("there is at least one altimate-core tool to scan", () => {
129+
expect(files.length).toBeGreaterThan(0)
130+
})
131+
132+
for (const file of files) {
133+
test(`${file} is free of the stale altimate_core.init() marker`, () => {
134+
const src = readFileSync(join(toolsDir, file), "utf8")
135+
expect(src).not.toContain("altimate_core.init")
136+
})
137+
}
138+
})

0 commit comments

Comments
 (0)