Skip to content

Commit a5b4e44

Browse files
anandgupta42claude
andcommitted
merge: resolve conflicts with main (skill followups + sql findings)
Merged origin/main which added: - `has_followups` / `followup_count` fields to `skill_used` telemetry (#546) - `isRealFailure` and `findings` telemetry in sql-analyze (#545) Conflict resolution: - telemetry/index.ts: kept both `trigger` (ours) and `has_followups`/`followup_count` (main) - tool/skill.ts: kept followup logic (main) + trigger classification (ours) - sql-analyze.ts: kept findings telemetry (main) + progressive suggestions (ours) - Updated plan-skill-telemetry.test.ts to include new `has_followups`/`followup_count` fields Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2 parents 1fc5c05 + dbff413 commit a5b4e44

File tree

199 files changed

+19247
-1495
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

199 files changed

+19247
-1495
lines changed

.github/meta/commit.txt

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
1-
fix: Codespaces — skip machine-scoped `GITHUB_TOKEN`, cap retries, fix phantom command
1+
fix: remove flaky `setTimeout` in todo bus event test
22

3-
Closes #413
3+
`Bus.publish` is synchronous — the event is delivered immediately,
4+
no 50ms delay needed. Removes resource contention risk in parallel CI.
45

5-
- Skip auto-enabling `github-models` and `github-copilot` providers in
6-
machine environments (Codespaces: `CODESPACES=true`, GitHub Actions:
7-
`GITHUB_ACTIONS=true`) when only machine-scoped tokens (`GITHUB_TOKEN`,
8-
`GH_TOKEN`) are available. The Codespace/Actions token lacks
9-
`models:read` scope needed for GitHub Models API.
10-
- Cap retry attempts at 5 (`RETRY_MAX_ATTEMPTS`) to prevent infinite
11-
retry loops. Log actionable warning when retries exhaust.
12-
- Replace phantom `/discover-and-add-mcps` toast with actionable message.
13-
- Add `.devcontainer/` config (Node 22, Bun 1.3.10) for Codespaces.
14-
- Add 32 adversarial e2e tests covering full Codespace/Actions env
15-
simulation, `GH_TOKEN`, token variations, config overrides, retry bounds.
16-
- Update docs to reference `mcp_discover` tool.
6+
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

.github/workflows/ci.yml

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ jobs:
4545
- 'packages/opencode/src/altimate/native/connections/**'
4646
- 'packages/opencode/test/altimate/drivers-e2e.test.ts'
4747
- 'packages/opencode/test/altimate/drivers-docker-e2e.test.ts'
48+
- 'packages/opencode/test/altimate/drivers-mongodb-e2e.test.ts'
4849
- 'packages/opencode/test/altimate/connections.test.ts'
4950
dbt-tools:
5051
- 'packages/dbt-tools/**'
@@ -83,13 +84,45 @@ jobs:
8384
run: bun install
8485

8586
- name: Run tests
86-
run: bun test --timeout 30000
8787
working-directory: packages/opencode
8888
# Cloud E2E tests (Snowflake, BigQuery, Databricks) auto-skip when
8989
# ALTIMATE_CODE_CONN_* env vars are not set. Docker E2E tests auto-skip
9090
# when Docker is not available. No exclusion needed — skipIf handles it.
9191
# --timeout 30000: matches package.json "test" script; prevents 5s default
9292
# from cutting off tests that run bun install or bootstrap git instances.
93+
#
94+
# Bun 1.3.x has a known segfault during process cleanup after all tests
95+
# pass (exit code 143/SIGTERM or 134/SIGABRT). We capture test output and
96+
# check for real failures vs Bun crashes to avoid false CI failures.
97+
shell: bash
98+
run: |
99+
# Redirect bun output to file, then cat it for CI visibility.
100+
# This avoids tee/pipe issues where SIGTERM kills tee before flush.
101+
bun test --timeout 30000 > /tmp/test-output.txt 2>&1 || true
102+
cat /tmp/test-output.txt
103+
104+
# Extract pass/fail counts from Bun test summary (e.g., " 5362 pass")
105+
PASS_COUNT=$(awk '/^ *[0-9]+ pass$/{print $1}' /tmp/test-output.txt || true)
106+
FAIL_COUNT=$(awk '/^ *[0-9]+ fail$/{print $1}' /tmp/test-output.txt || true)
107+
108+
echo ""
109+
echo "--- Test Summary ---"
110+
echo "pass=${PASS_COUNT:-none} fail=${FAIL_COUNT:-none}"
111+
112+
# Real test failures — always fail CI
113+
if [ -n "$FAIL_COUNT" ] && [ "$FAIL_COUNT" != "0" ]; then
114+
echo "::error::$FAIL_COUNT test(s) failed"
115+
exit 1
116+
fi
117+
118+
# Tests passed (we have a pass count and zero/no failures)
119+
if [ -n "$PASS_COUNT" ] && [ "$PASS_COUNT" -gt 0 ] 2>/dev/null; then
120+
exit 0
121+
fi
122+
123+
# No test summary at all — Bun crashed before running tests
124+
echo "::error::No test results found in output — Bun may have crashed before running tests"
125+
exit 1
93126
94127
# ---------------------------------------------------------------------------
95128
# Driver E2E tests — only when driver code changes.
@@ -155,6 +188,16 @@ jobs:
155188
--health-timeout 5s
156189
--health-retries 10
157190
191+
mongodb:
192+
image: mongo:7.0
193+
ports:
194+
- 27017:27017
195+
options: >-
196+
--health-cmd "mongosh --eval 'db.runCommand({ping:1})' --quiet"
197+
--health-interval 5s
198+
--health-timeout 5s
199+
--health-retries 10
200+
158201
steps:
159202
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
160203

@@ -195,6 +238,13 @@ jobs:
195238
TEST_REDSHIFT_PORT: "15439"
196239
TEST_REDSHIFT_PASSWORD: testpass123
197240

241+
- name: Run MongoDB driver E2E
242+
run: bun test test/altimate/drivers-mongodb-e2e.test.ts
243+
working-directory: packages/opencode
244+
env:
245+
TEST_MONGODB_HOST: 127.0.0.1
246+
TEST_MONGODB_PORT: "27017"
247+
198248
# Cloud tests NOT included — they require real credentials
199249
# Run locally with:
200250
# ALTIMATE_CODE_CONN_SNOWFLAKE_TEST='...' bun test test/altimate/drivers-snowflake-e2e.test.ts

.github/workflows/release.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,25 @@ jobs:
9999
GH_REPO: ${{ env.GH_REPO }}
100100
MODELS_DEV_API_JSON: test/tool/fixtures/models-api.json
101101

102+
# Smoke-test: verify the compiled binary actually starts.
103+
# Only possible for native linux-x64 builds on the ubuntu runner.
104+
# This catches missing externals (e.g. @altimateai/altimate-core)
105+
# that compile fine but crash at runtime.
106+
- name: Smoke test binary
107+
if: matrix.name == 'linux-x64'
108+
run: |
109+
BINARY=$(find packages/opencode/dist -name altimate -type f | head -1)
110+
if [ -z "$BINARY" ]; then
111+
echo "::error::No binary found in dist/"
112+
exit 1
113+
fi
114+
chmod +x "$BINARY"
115+
116+
# Set NODE_PATH so the binary can resolve external NAPI modules
117+
# (mirrors what the npm bin wrapper does at runtime)
118+
NODE_PATH="$(pwd)/packages/opencode/node_modules:$(pwd)/node_modules" "$BINARY" --version
119+
echo "Smoke test passed: binary starts and prints version"
120+
102121
- name: Upload build artifact
103122
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
104123
with:
@@ -135,6 +154,25 @@ jobs:
135154
run: bun run build
136155
working-directory: packages/dbt-tools
137156

157+
- name: Smoke test dbt-tools bundle
158+
run: |
159+
# Verify node_python_bridge.py was copied into dist
160+
if [ ! -f packages/dbt-tools/dist/node_python_bridge.py ]; then
161+
echo "::error::node_python_bridge.py missing from dbt-tools dist"
162+
exit 1
163+
fi
164+
# Verify no hardcoded absolute path in __dirname (catches any CI runner OS)
165+
if grep -qE 'var __dirname\s*=\s*"(/|[A-Za-z]:\\)' packages/dbt-tools/dist/index.js; then
166+
echo "::error::dbt-tools bundle contains hardcoded absolute path in __dirname"
167+
exit 1
168+
fi
169+
# Verify __dirname was patched to runtime resolution
170+
if ! grep -q 'import.meta.dirname' packages/dbt-tools/dist/index.js; then
171+
echo "::error::dbt-tools bundle missing import.meta.dirname patch"
172+
exit 1
173+
fi
174+
echo "dbt-tools smoke test passed"
175+
138176
- name: Free disk space for artifact download + npm publish
139177
run: |
140178
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /usr/local/share/boost
@@ -168,6 +206,21 @@ jobs:
168206
# env:
169207
# AUR_SSH_PRIVATE_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
170208

209+
# Smoke-test a linux-x64 binary from the downloaded artifacts before publishing.
210+
# This is the last gate before npm publish — catches runtime crashes that
211+
# compile-time checks miss (e.g. missing NAPI externals like v0.5.10).
212+
- name: Pre-publish smoke test
213+
run: |
214+
BINARY=$(find packages/opencode/dist -path '*altimate-code-linux-x64/bin/altimate' -type f | head -1)
215+
if [ -z "$BINARY" ]; then
216+
echo "::error::No linux-x64 binary found in artifacts — cannot verify release"
217+
exit 1
218+
else
219+
chmod +x "$BINARY"
220+
NODE_PATH="$(pwd)/packages/opencode/node_modules:$(pwd)/node_modules" "$BINARY" --version
221+
echo "Pre-publish smoke test passed"
222+
fi
223+
171224
- name: Publish to npm
172225
run: bun run packages/opencode/script/publish.ts
173226
env:

.opencode/skills/dbt-analyze/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ If no manifest is available:
111111
1. Run `lineage_check` on the changed SQL
112112
2. Show column-level data flow
113113
3. Note: downstream impact requires a manifest
114-
4. Suggest: `altimate-dbt build-project` to generate one
114+
4. Suggest: `altimate-dbt build` to generate one
115115

116116
## Common Mistakes
117117

.opencode/skills/dbt-analyze/references/altimate-dbt-commands.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ altimate-dbt info # Project name, adapter, root
2020
## Build & Run
2121

2222
```bash
23-
altimate-dbt build --model <name> [--downstream] # compile + run + test
23+
altimate-dbt build # full project build (compile + run + test)
24+
altimate-dbt build --model <name> [--downstream] # build a single model
2425
altimate-dbt run --model <name> [--downstream] # materialize only
2526
altimate-dbt test --model <name> # run tests only
26-
altimate-dbt build-project # full project build
2727
```
2828

2929
## Compile

.opencode/skills/dbt-develop/references/altimate-dbt-commands.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ altimate-dbt info # Project name, adapter, root
2020
## Build & Run
2121

2222
```bash
23-
altimate-dbt build --model <name> [--downstream] # compile + run + test
23+
altimate-dbt build # full project build (compile + run + test)
24+
altimate-dbt build --model <name> [--downstream] # build a single model
2425
altimate-dbt run --model <name> [--downstream] # materialize only
2526
altimate-dbt test --model <name> # run tests only
26-
altimate-dbt build-project # full project build
2727
```
2828

2929
## Compile

.opencode/skills/dbt-docs/references/altimate-dbt-commands.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ altimate-dbt info # Project name, adapter, root
2020
## Build & Run
2121

2222
```bash
23-
altimate-dbt build --model <name> [--downstream] # compile + run + test
23+
altimate-dbt build # full project build (compile + run + test)
24+
altimate-dbt build --model <name> [--downstream] # build a single model
2425
altimate-dbt run --model <name> [--downstream] # materialize only
2526
altimate-dbt test --model <name> # run tests only
26-
altimate-dbt build-project # full project build
2727
```
2828

2929
## Compile

.opencode/skills/dbt-test/references/altimate-dbt-commands.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ altimate-dbt info # Project name, adapter, root
2020
## Build & Run
2121

2222
```bash
23-
altimate-dbt build --model <name> [--downstream] # compile + run + test
23+
altimate-dbt build # full project build (compile + run + test)
24+
altimate-dbt build --model <name> [--downstream] # build a single model
2425
altimate-dbt run --model <name> [--downstream] # materialize only
2526
altimate-dbt test --model <name> # run tests only
26-
altimate-dbt build-project # full project build
2727
```
2828

2929
## Compile

.opencode/skills/dbt-troubleshoot/references/altimate-dbt-commands.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ altimate-dbt info # Project name, adapter, root
2020
## Build & Run
2121

2222
```bash
23-
altimate-dbt build --model <name> [--downstream] # compile + run + test
23+
altimate-dbt build # full project build (compile + run + test)
24+
altimate-dbt build --model <name> [--downstream] # build a single model
2425
altimate-dbt run --model <name> [--downstream] # materialize only
2526
altimate-dbt test --model <name> # run tests only
26-
altimate-dbt build-project # full project build
2727
```
2828

2929
## Compile

CHANGELOG.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,64 @@ 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.13] - 2026-03-26
9+
10+
### Fixed
11+
12+
- **Pin `@altimateai/altimate-core` to exact version** — prevents npm from resolving stale cached binaries during install (#475)
13+
- **Flaky `dbt Profiles Auto-Discovery` tests in CI** — stabilized tests that failed intermittently due to timing issues
14+
15+
### Changed
16+
17+
- **Bump `yaml` from 2.8.2 to 2.8.3** — dependency update in `packages/opencode` (#473)
18+
19+
## [0.5.12] - 2026-03-25
20+
21+
### Added
22+
23+
- **`altimate-dbt` auto-discover config**`altimate-dbt` commands now auto-detect `dbt_project.yml` and Python from the current directory without requiring `altimate-dbt init` first; supports Windows paths (`Scripts/`, `.exe`, `path.delimiter`) (#464)
24+
- **Local E2E sanity test harness** — Docker-based test suite (`test/sanity/`) for install verification, smoke tests, upgrade scenarios, and resilience checks; runnable via `bun run sanity` (#461)
25+
26+
### Fixed
27+
28+
- **`altimate-dbt` commands fail with hardcoded CI path** — published binary contained a baked-in `/home/runner/work/...` path for the Python bridge; `copy-python.ts` now patches `__dirname` to use `import.meta.dirname` at runtime (#467)
29+
30+
### Testing
31+
32+
- 42 adversarial tests for config auto-discovery and dbt resolution: `findProjectRoot` edge cases (deep nesting, symlinks, nonexistent dirs), `discoverPython` with broken symlinks and malicious env vars, `resolveDbt` with conflicting env vars and priority ordering, `validateDbt` timeout/garbage handling, Windows constant correctness, `path.delimiter` usage, `buildDbtEnv` mutation safety
33+
- 484-line adversarial test suite for the `__dirname` patch: regex edge cases, ReDoS protection, mutation testing, idempotency, CI smoke test parity, bundle runtime structure validation
34+
35+
## [0.5.11] - 2026-03-25
36+
37+
### Fixed
38+
39+
- **README changelog gap** — updated README to reflect releases v0.5.1 through v0.5.11; previous README only listed up to v0.5.0
40+
- **npm publish transient 404s** — added retry logic (3 attempts with backoff) to `publish.ts` for concurrent scoped package publishes that hit npm registry race conditions
41+
42+
## [0.5.10] - 2026-03-24
43+
44+
### Added
45+
46+
- **`altimate-code check` CLI command** — deterministic SQL checks (linting, formatting, style) that run without an LLM, suitable for CI pipelines and pre-commit hooks (#453)
47+
- **Data-viz skill improvements** — lazy initialization, data-code separation, color contrast rules, icon semantics, field validation, and pre-delivery checklist (#434)
48+
49+
### Fixed
50+
51+
- **Snowflake Cortex not visible before authentication** — provider now appears in the provider list even when not yet authenticated (#447)
52+
- **New user detection race condition** — first-run welcome flow and telemetry events could fire out of order or be skipped entirely (#445)
53+
- **52 CI test failures from `mock.module` leaking across files** — test isolation fix for the new `check` command e2e tests (#460)
54+
- **Missing `altimate_change` marker** — added required upstream marker on `isStatelessCommand` guard to pass Marker Guard CI (#457)
55+
56+
### Changed
57+
58+
- **Rename Recap back to Trace** — reverted the Recap branding to Trace across 29 files for better AI model comprehension of session recording concepts (#443)
59+
60+
### Testing
61+
62+
- Consolidated 12 hourly test PRs into single batch: slugify, hints sort, skill formatting, batch tools, filesystem utilities, wildcard matching — 1,680 new test lines (#439)
63+
- `altimate-code check` unit + e2e test suites (1,687 lines) (#453)
64+
- Snowflake Cortex provider visibility tests (#447)
65+
866
## [0.5.9] - 2026-03-23
967

1068
### Fixed

0 commit comments

Comments
 (0)