Skip to content

Commit 1aa0ece

Browse files
anandgupta42claude
andcommitted
fix: resolve merge conflict with main and fix LTS 24.3/24.8 CI timeout
LTS 24.3 and 24.8 test suites incorrectly used `CH_USE_CI` (tied to `TEST_CLICKHOUSE_HOST`) which made them skip Docker startup in CI but still try to connect on ports 18125/18126 — causing 60s timeouts. Give each LTS suite its own `_USE_CI` flag (`CH_243_USE_CI`, `CH_248_USE_CI`) so they properly fall through to Docker-start-or-skip behavior, matching how LTS 23.8 already works with `CH_LTS_USE_CI`. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2 parents 46ff94c + 8449bec commit 1aa0ece

28 files changed

Lines changed: 1199 additions & 173 deletions

‎CHANGELOG.md‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,29 @@ 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.5.15] - 2026-03-29
9+
10+
### Added
11+
12+
- **Plan agent two-step approach** — outline first, confirm, then expand; plan refinement loop with edit-in-place (capped at 5 revisions); approval phrase detection ("looks good", "proceed", "lgtm") (#556)
13+
- **Feature discovery & progressive disclosure** — contextual suggestions after warehouse connection (schema, SQL, lineage, PII); dbt auto-detection recommending `/dbt-develop`, `/dbt-troubleshoot` (#556)
14+
15+
### Fixed
16+
17+
- **SQL classifier fallback security hardening** — invert fallback to whitelist reads (not blacklist writes), handle multi-statement SQL, strip line comments, fix `HARD_DENY_PATTERN` `\s` → `\b`; fix `computeSqlFingerprint` referencing undefined `core` after safe-import refactor (#582)
18+
- **Edit tool nearest-match error messages** — `buildNotFoundMessage` with Levenshtein similarity search shows closest file content when `oldString` not found, helping LLM self-correct (#582)
19+
- **Webfetch failure caching and actionable errors** — session-level URL failure cache (404/410/451) with 5-min TTL; status-specific error messages telling the model whether to retry; URL sanitization in errors to prevent token leakage (#582)
20+
- **Nested `node_modules` in `NODE_PATH`** — `@altimateai/altimate-core` NAPI resolution now works for npm's hoisted and nested layouts (#576)
21+
- **Null guards across 8 tool formatters** — prevent literal `undefined` in user-facing output for sql-analyze, schema-inspect, sql-translate, dbt-manifest, finops, and warehouse tools; DuckDB auto-retry on `database is locked` (#571)
22+
- **Telemetry error classification** — add `http_error` class, expand connection/validation/permission patterns, redact sensitive keys in input signatures (#566)
23+
- **Pre-release review findings** — remove dead code, fix `classifySkillTrigger()` unknown trigger handling, add null guards in lineage/translate tools (#580)
24+
- **Binary alias hard copy** — use `cp` instead of symlink for `altimate-code` binary alias to fix cross-platform compatibility (#578)
25+
26+
### Testing
27+
28+
- Verdaccio sanity suite: 50 new tests across 3 phases, added to CI and release workflows (#560, #562)
29+
- 12 new tests for `buildNotFoundMessage`, `computeSqlFingerprint`, and webfetch error messages (#582)
30+
831
## [0.5.14] - 2026-03-28
932

1033
### Added

‎docs/docs/configure/warehouses.md‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,9 @@ If you're already authenticated via `gcloud`, omit `credentials_path`:
211211
|-------|----------|-------------|
212212
| `path` | No | Database file path. Omit or use `":memory:"` for in-memory |
213213

214+
!!! note "Concurrent access"
215+
DuckDB does not support concurrent write access to the same file. If another process holds a write lock, Altimate Code automatically retries the connection in **read-only** mode so you can still query the data. A clear error message is shown if read-only access also fails.
216+
214217
## MySQL
215218

216219
```json
@@ -279,6 +282,9 @@ If you're already authenticated via `gcloud`, omit `credentials_path`:
279282
!!! note
280283
MongoDB uses MQL (MongoDB Query Language) instead of SQL. Queries are submitted as JSON objects via the `execute` method. Supported commands: `find`, `aggregate`, `countDocuments`, `distinct`, `insertOne`, `insertMany`, `updateOne`, `updateMany`, `deleteOne`, `deleteMany`, `createIndex`, `listIndexes`, `createCollection`, `dropCollection`, `ping`.
281284

285+
!!! warning "Blocked operators"
286+
For safety, aggregate pipelines block `$out` and `$merge` (write stages) and `$function` and `$accumulator` (arbitrary JavaScript execution). Use `find`, `countDocuments`, or safe aggregate stages for read-only analysis.
287+
282288
!!! info "Server compatibility"
283289
The MongoDB driver (v6.x) supports MongoDB server versions 3.6 through 8.0, covering all releases from the last 3+ years.
284290

@@ -368,6 +374,17 @@ If you're already authenticated via `gcloud`, omit `credentials_path`:
368374
| `azure_auth` | No | Use Azure AD authentication (default: `false`) |
369375
| `trust_server_certificate` | No | Trust server certificate without validation (default: `false`) |
370376

377+
## Unsupported Databases
378+
379+
The following databases are not yet natively supported, but workarounds are available:
380+
381+
| Database | Workaround |
382+
|----------|------------|
383+
| ClickHouse | Use the bash tool with `clickhouse-client` or `curl` to query directly |
384+
| Cassandra | Use the bash tool with `cqlsh` to query directly |
385+
| CockroachDB | PostgreSQL-compatible — use `type: postgres` |
386+
| TimescaleDB | PostgreSQL extension — use `type: postgres` |
387+
371388
## SSH Tunneling
372389

373390
All warehouse types support SSH tunneling for connections behind a bastion host:

‎docs/docs/data-engineering/agent-modes.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ Refinements are capped at **5 revisions per session** to avoid endless loops. Af
163163

164164
### Example conversation
165165

166-
```
166+
```text
167167
You: Plan a migration of our raw_events table from a view to an incremental model
168168
169169
Plan: Here's my proposed approach:

‎packages/drivers/src/mongodb.ts‎

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,7 @@ export async function connect(config: ConnectionConfig): Promise<Connector> {
187187
if (val instanceof Date) {
188188
return val.toISOString()
189189
}
190-
// Arrays and plain objects — JSON-serialize for tabular display
191-
if (Array.isArray(val) || typeof (val as any).toJSON !== "function") {
192-
return JSON.stringify(val)
193-
}
190+
// Arrays, plain objects, and remaining BSON types — JSON-serialize for tabular display
194191
return JSON.stringify(val)
195192
}
196193

@@ -333,20 +330,37 @@ export async function connect(config: ConnectionConfig): Promise<Connector> {
333330
if (!parsed.pipeline || !Array.isArray(parsed.pipeline)) {
334331
throw new Error("aggregate requires a 'pipeline' array")
335332
}
336-
// Cap or append $limit to prevent OOM. Skip for $out/$merge write pipelines.
333+
// Block dangerous stages/operators:
334+
// - $out/$merge: write operations (top-level stage keys)
335+
// - $function/$accumulator: arbitrary JS execution (can be nested in expressions)
337336
const pipeline = [...parsed.pipeline]
338-
const hasWrite = pipeline.some((stage) => "$out" in stage || "$merge" in stage)
339-
if (!hasWrite) {
340-
const limitIdx = pipeline.findIndex((stage) => "$limit" in stage)
341-
if (limitIdx >= 0) {
342-
// Cap user-specified $limit against effectiveLimit
343-
const userLimit = (pipeline[limitIdx] as any).$limit
344-
if (typeof userLimit === "number" && userLimit > effectiveLimit) {
345-
pipeline[limitIdx] = { $limit: effectiveLimit + 1 }
346-
}
347-
} else {
348-
pipeline.push({ $limit: effectiveLimit + 1 })
337+
const blockedWriteStages = ["$out", "$merge"]
338+
const hasBlockedWrite = pipeline.some((stage) =>
339+
blockedWriteStages.some((s) => s in stage),
340+
)
341+
if (hasBlockedWrite) {
342+
throw new Error(
343+
`Pipeline contains a blocked write stage (${blockedWriteStages.join(", ")}). Write operations are not allowed.`,
344+
)
345+
}
346+
// $function/$accumulator can appear nested inside $project, $addFields, $group, etc.
347+
// Stringify and scan to catch them at any depth.
348+
const pipelineStr = JSON.stringify(pipeline)
349+
if (pipelineStr.includes('"$function"') || pipelineStr.includes('"$accumulator"')) {
350+
throw new Error(
351+
"Pipeline contains a blocked operator ($function, $accumulator). Executing arbitrary JavaScript is not allowed.",
352+
)
353+
}
354+
// Cap or append $limit to prevent OOM (write stages already blocked above).
355+
const limitIdx = pipeline.findIndex((stage) => "$limit" in stage)
356+
if (limitIdx >= 0) {
357+
// Cap user-specified $limit against effectiveLimit
358+
const userLimit = (pipeline[limitIdx] as any).$limit
359+
if (typeof userLimit === "number" && userLimit > effectiveLimit) {
360+
pipeline[limitIdx] = { $limit: effectiveLimit + 1 }
349361
}
362+
} else {
363+
pipeline.push({ $limit: effectiveLimit + 1 })
350364
}
351365

352366
const docs = await coll.aggregate(pipeline).toArray()

0 commit comments

Comments
 (0)