You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(dbt-tools): run dbt Fusion without Python, and pin the stale-manifest fixes - #1757
dbt Fusion works through altimate-dbt with no Python.altimate-dbt's prerequisite check demanded Python and dbt-core in every mode. In Fusion mode it checks the project and a dbt 2.x binary (findDbtV2Binary, judged as the adapter does: script launchers count). The adapter gets "" when the config has no Python path. Other modes are unchanged.
Real dbt Fusion 2.0.9, {projectRoot, dbtIntegration: "fusion"}, PATH holding only dbt:
main:info, children and doctor stop at "Prerequisites not met: python: No Python path configured".
this PR:info and children --model orders answer (no model isExternalProject), and doctor reports fusion ok and project ok.
no dbt at all: "dbt Fusion was not found…".
Also:
takes @altimateai/dbt-integration ^0.3.20 (the lockfile moves to 0.3.20 only);
an end-to-end test pinning 0.3.19's stale-manifest fix;
the stale shape in the six skill references;
schema-verify's stale note drops an empty parse time.
Claims:
C1: With dbtIntegration: fusion, the checks are fusion and project only, and a missing or empty pythonPath passes.
C2: Other modes' checks and messages are as on main, and the Fusion lookup never runs.
C3: The stale note quotes written_at only when it's a non-empty string.
How did you verify your code works?
Fail on main: the Fusion prerequisite tests, the empty parse-time test; the stale test fails on dbt-integration 0.3.17.
Local: typecheck 13/13; dbt-tools 124 pass; the stale test passes on dbt 1.8, 1.10 and 1.11; opencode validators 834 pass; leak and marker checks clean.
Cost side effects
None.
Checklist
I have tested my changes locally
I have not included unrelated changes in this PR
I checked for cost side effects (model calls, queries or cloud resources that grow with user data) and described them, or wrote "none"
Fusion mode now checks for a compatible dbt 2.x installation and provides guidance when one isn’t found. The check can run without a configured Python path; the project check remains required.
Bug Fixes
Stale-manifest notices show a parse timestamp only when it’s valid and non-empty, and keep displayed values concise.
Documentation
Clarified that when a project check fails, model relationships may come from the last successful parse and be outdated. Without a prior manifest, the commands return an error.
…est fixes
Fusion's prerequisite check looks for a dbt 2.x binary instead of Python and dbt-core. An e2e
test pins isExternalProject on a stale manifest; the skill references and the stale note follow.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VEmKQx8gR7vd6ettA3mWjP
No actionable comments were generated in the recent review.
Walkthrough
This change adds Fusion-specific prerequisite checks, documents stale-manifest graph responses, and updates schema-verification timestamp handling and tests.
Changes: Fusion prerequisite checks
Layer / File(s)
Summary
Select and validate Fusion prerequisites packages/dbt-tools/src/adapter.ts, packages/dbt-tools/src/check.ts, packages/dbt-tools/test/check.test.ts, packages/dbt-tools/package.json
Fusion mode looks up a dbt 2.x binary and checks the project without Python or dbt-core checks. Other modes retain their existing prerequisite checks. The adapter defaults a nullish Python path to an empty string. Tests cover lookup outcomes and integration modes, and the test script includes test/check.test.ts.
Stale graph results
Layer / File(s)
Summary
Document and verify stale graph responses .opencode/skills/*/references/altimate-dbt-commands.md, packages/dbt-tools/test/e2e/dbt-versions.test.ts
The skill references describe the { stale_manifest, models } response when the project check fails and note that its models can come from an earlier parse. An end-to-end test checks the stale result and verifies that returned models are internal.
Stale schema-verification notes
Layer / File(s)
Summary
Format and test stale schema notes packages/opencode/src/altimate/validators/dbt-schema-verify.ts, packages/opencode/test/altimate/validators/dbt-schema-verify-stale.test.ts
The verifier includes a parse timestamp only when written_at is a non-blank string. Tests check current and stale messages, invalid timestamp values, and a response with both stale and current model answers.
AltimateAI/altimate-code#1704: This PR introduced the stale-manifest schema note and updated the dbt integration dependency used by the stale-manifest tests.
Suggested reviewers:suryaiyer95, saravmajestic
Merge Risk: Minimal · up to f5156
This change lets altimate-dbt run in Fusion mode without Python or dbt-core, and it documents stale-manifest responses. No concrete merge-blocking risk was found.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: dbt Fusion runs in altimate-dbt without Python. It also names the stale-manifest pinning, which the changeset includes as a secondary item. The title is in a conventio…
Linked Issues check
Directly linked issue #1756 has four coding objectives. The whole-PR summary at head f515621 shows each one implemented. The earlier source confirmation at 30302f1 still applies, and the summary does …
Out of Scope Changes check
Each changed area maps to an objective of #1756: - packages/dbt-tools/src/check.ts and check.test.ts: Fusion prerequisite and its tests. Other modes keep their checks. - packages/dbt-tools/src/adapter…
Description check
The description follows the template. It states the problem and the fix for Fusion mode, and it lists the verification steps and reported results. It also gives a cost side-effects section with "None"…
Full details: Title check
Explanation
The title names the main change: dbt Fusion runs in altimate-dbt without Python. It also names the stale-manifest pinning, which the changeset includes as a secondary item. The title is in a conventional commit form and is specific, but at 79 characters it is slightly long and combines two changes.
Full details: Linked Issues check
Explanation
Directly linked issue #1756 has four coding objectives. The whole-PR summary at head f515621 shows each one implemented. The earlier source confirmation at 30302f1 still applies, and the summary does not show any change that contradicts it.
(1) [#1756] Stale-manifest test: packages/dbt-tools/test/e2e/dbt-versions.test.ts adds a stale-manifest case for each dbt version. It renames the fixture profile so the project check fails, calls children, and asserts { stale_manifest, models } with every model marked isExternalProject false. The profile is restored in a finally block. Met.
(2) [#1756] Skill references: each of the six .opencode/skills/*/references/altimate-dbt-commands.md files adds two lines describing the { stale_manifest, models } answer and its possible staleness. Met.
(3) [#1756] Fusion prerequisites: packages/dbt-tools/src/check.ts runs the fusion check and the project check only when cfg.dbtIntegration is "fusion". The fusion check uses fusionBinary.find (findDbtV2Binary) with skipScripts: false and a 15 s timeout, and fails with a 'dbt Fusion was not found' error when no binary resolves. Other modes keep the python, dbt-core, and project checks. check.test.ts covers Fusion, core, corecommand, and cloud. The adapter.ts change supplies an empty pythonPath when the config value is nullish. Met.
(4) [#1756] schema-verify stale note: packages/opencode/src/altimate/validators/dbt-schema-verify.ts adds the timestamp only when written_at is a non-empty string after trimming. dbt-schema-verify-stale.test.ts covers blank and invalid parse times, a non-string written_at, a mixed stale/current run, and exact equality for the current-manifest message. Met.
Non-blocking follow-ups from the comments (doctor usage text, not-found wording for a bare pythonPath, parents test coverage) are not requirements of #1756. No required objective is unmet.
Full details: Out of Scope Changes check
Explanation
Each changed area maps to an objective of #1756:
packages/dbt-tools/src/check.ts and check.test.ts: Fusion prerequisite and its tests. Other modes keep their checks.
packages/dbt-tools/src/adapter.ts: empty pythonPath for the Fusion path.
packages/dbt-tools/package.json: adds check.test.ts to the test script and bumps @altimateai/dbt-integration to ^0.3.20. The bump supports the stale-manifest test (objective 1).
test/e2e/dbt-versions.test.ts: stale-manifest test (objective 1).
Six skill references: objective 2.
dbt-schema-verify.ts and its test: objective 4.
The PR description's cost and checklist notes are metadata, not code. No unrelated change was found. The adapter.ts and package.json evidence rests on the whole-PR summary and earlier source reads, not a fresh read at head f515621.
Full details: Description check
Explanation
The description follows the template. It states the problem and the fix for Fusion mode, and it lists the verification steps and reported results. It also gives a cost side-effects section with "None". It has the Issue reference (Closes #1756), a type of change (Bug fix), and a checklist. The template asks for an explanation of why the changes work. The author gives the reasoning for the prerequisite check and the adapter's empty pythonPath. The description is mostly complete. Minor gaps: the 'Screenshots' section is absent, which is acceptable for a non-UI change. The 'Type of change' list checks only Bug fix, which fits. The description also contains a 'Claude Code' attribution and session link, which is not part of the template but does not block review.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
A rabbit checks the dbt trail, Finds Fusion where old paths fail. Stale graph models wear a tag, Their last parse tucked inside the bag. Blank times vanish from the note, And tests keep every detail afloat.
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 0624f80a-ea9d-418c-b7c1-cc7e25f3ea5d
Commits
Reviewing files that changed from the base of the PR and between 30302f1 and f515621.
Files ignored due to path filters: 1
bun.lock is excluded by !**/*.lock
Files selected for processing: 2
packages/dbt-tools/package.json
packages/dbt-tools/src/adapter.ts
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
@codex review against the numbered claims in this PR's description: report only a reproducible trace that violates a numbered claim (C1–C3). A round with no claim violation ends review.
The reason will be displayed to describe this comment to others. Learn more.
2 issues found across 13 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/dbt-tools/test/check.test.ts">
<violation number="1" location="packages/dbt-tools/test/check.test.ts:95">
P2: This test never exercises the claimed dbt-core requirement: the empty `pythonPath` forces `all()` into the skipped-dbt branch, and the assertions only validate Python. Add a nonempty executable-path case and assert the dbt check result separately.</violation>
</file>
<file name=".opencode/skills/dbt-troubleshoot/references/altimate-dbt-commands.md">
<violation number="1" location=".opencode/skills/dbt-troubleshoot/references/altimate-dbt-commands.md:52">
P2: This overstates the fallback: a project-check failure only produces `{ stale_manifest, models }` when a previous manifest was successfully available; a first run or missing manifest can return an error instead. Qualify the condition so users do not attempt to read `models` from every failed check.</violation>
</file>
Tip: Get a Slack DM when cubic finishes reviewing your PRs. Connect Slack
The reason will be displayed to describe this comment to others. Learn more.
P2: This test never exercises the claimed dbt-core requirement: the empty pythonPath forces all() into the skipped-dbt branch, and the assertions only validate Python. Add a nonempty executable-path case and assert the dbt check result separately.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At packages/dbt-tools/test/check.test.ts, line 95:
<comment>This test never exercises the claimed dbt-core requirement: the empty `pythonPath` forces `all()` into the skipped-dbt branch, and the assertions only validate Python. Add a nonempty executable-path case and assert the dbt check result separately.</comment>
<file context>
@@ -0,0 +1,101 @@
+ }
+
+ for (const dbtIntegration of ["core", "corecommand", "cloud"]) {
+ const result = await all(config({ dbtIntegration }))
+ expect(result.passed).toBe(false)
+ expect(Object.keys(result.checks).sort()).toEqual(["dbt", "project", "python"])
</file context>
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 56ff802. The empty-path test now only claims that a Python path is required. A new test runs a stand-in interpreter that answers --version but has no dbt-core. For core, corecommand and cloud it asserts that python passes, dbt fails with "dbt-core is not installed in the configured Python environment", and project passes. It's a #!/bin/sh stand-in, so it skips on Windows.
When the project check fails (a broken profile, a missing env var), `children` and `parents` answer `{ stale_manifest, models }` instead of a list: `models` comes from the last successful parse and may predate the current files, so check for it before relying on the answer for impact analysis.
The reason will be displayed to describe this comment to others. Learn more.
P2: This overstates the fallback: a project-check failure only produces { stale_manifest, models } when a previous manifest was successfully available; a first run or missing manifest can return an error instead. Qualify the condition so users do not attempt to read models from every failed check.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At .opencode/skills/dbt-troubleshoot/references/altimate-dbt-commands.md, line 52:
<comment>This overstates the fallback: a project-check failure only produces `{ stale_manifest, models }` when a previous manifest was successfully available; a first run or missing manifest can return an error instead. Qualify the condition so users do not attempt to read `models` from every failed check.</comment>
<file context>
@@ -49,6 +49,8 @@ altimate-dbt children --model <name> # downstream models
altimate-dbt parents --model <name> # upstream models
+When the project check fails (a broken profile, a missing env var), children and parents answer { stale_manifest, models } instead of a list: models comes from the last successful parse and may predate the current files, so check for it before relying on the answer for impact analysis.
+
Packages
</file context>
</details>
```suggestion
When the project check fails but a previous manifest is available (for example, because of a broken profile or missing env var), `children` and `parents` answer `{ stale_manifest, models }` instead of a list: `models` comes from the last successful parse and may predate the current files, so check `stale_manifest` before relying on the answer for impact analysis.
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 56ff802, in all six references. The stale answer now depends on an earlier parse having left a manifest, and with no earlier manifest the commands answer an error.
The reason will be displayed to describe this comment to others. Learn more.
[SUGGESTION]: The configured-pythonPath message variant is never asserted
check.ts:57 builds a different message when a pythonPath is set (next to <path>, ), and that is the variant a user migrating from a Core config will see — but this test only covers the empty-pythonPath config. A second case with a path would pin the prefix:
const issue = await validate(config({ pythonPath: "/no/venv/bin/python" }))
expect(issue).toContain(
"fusion: dbt Fusion was not found: no dbt 2.x binary next to /no/venv/bin/python, in ~/.local/bin or on PATH",
)
The reason will be displayed to describe this comment to others. Learn more.
[SUGGESTION]: Error text hardcodes a Unix-only install location
The message names ~/.local/bin for every platform, while the rest of this package resolves binary locations per platform (config.ts:36-40 uses Scripts/.exe on Windows, dbt-resolve.ts:177-192 uses %APPDATA%). If findDbtV2Binary searches a Windows-specific directory, a Windows Fusion user is pointed at a path where dbt never lands. Consider wording that does not name the directory (e.g. "no dbt 2.x binary next to the configured Python, in the installer's location, or on PATH"), or confirm the lookup really is ~/.local/bin on every platform.
The reason will be displayed to describe this comment to others. Learn more.
Checked: ~/.local/bin is where dbt-integration's lookup searches on every platform, not just Unix. findDbtV2Binary builds its candidates as:
the interpreter's directory;
path.join(os.homedir(), ".local", "bin", process.platform === "win32" ? "dbt.exe" : "dbt"), the installer location, on Windows too;
then PATH.
So a Windows user is pointed at %USERPROFILE%\.local\bin, where the lookup really looks. If the library's candidates change, this message should follow them. No change here.
Status: 3 Issues Found | Recommendation: Address before merge
Overview
Severity
Count
CRITICAL
0
WARNING
0
SUGGESTION
3
Issue Details (click to expand)
SUGGESTION
File
Line
Issue
packages/dbt-tools/test/check.test.ts
136
The accept test can pass without proving skipScripts: false: by the block's own premise the real ~/.local/bin/dbt is tried before PATH, so a machine with a real Fusion there returns green even with the fix reverted. The rejection test at line 143 already guards with test.skipIf(realFusionInLocalBin()).
packages/dbt-tools/test/check.test.ts
130
The doctor fixture rebuilds the Config by hand instead of reusing the config() helper; read() casts the parsed JSON to Config without validation, so a later field addition would silently be undefined in this end-to-end test.
packages/dbt-tools/test/check.test.ts
133
Bun.spawnSyncexitCode/stderr are discarded, so a CLI crash with empty stdout fails as Unexpected end of JSON input with no cause.
Incremental check (since 30302f1): the new delta is the merge of main (the only conflict was this package's test script, which now runs test/check.test.ts plus main's test/adapter-target-path.test.ts — both files exist and neither line was dropped) and the @altimateai/dbt-integration^0.3.19 → ^0.3.20 bump. bun.lock moves both the workspace dependency entry and the resolved package entry to 0.3.20, and packages/dbt-tools is the only consumer in the repo, so the bump is internally consistent. No new issue on the bumped lines.
The three suggestions above are unchanged in current code (check.test.ts was not touched by this delta) and the author has replied to each thread deferring them to a follow-up on #1756; they remain open.
Status: 3 Issues Found | Recommendation: Address before merge
Overview
Severity
Count
CRITICAL
0
WARNING
0
SUGGESTION
3
Issue Details (click to expand)
SUGGESTION
File
Line
Issue
packages/dbt-tools/test/check.test.ts
136
The new accept test can pass without proving skipScripts: false: by the block's own premise the real ~/.local/bin/dbt is tried before PATH, so a machine with a real Fusion there returns green even with the fix reverted. The rejection test already guards with test.skipIf(realFusionInLocalBin()).
packages/dbt-tools/test/check.test.ts
130
The e2e config fixture rebuilds the Config by hand instead of reusing config({}); read() casts the parsed JSON to Config without validation, so a later field addition would silently be undefined in this test.
packages/dbt-tools/test/check.test.ts
133
Bun.spawnSyncexitCode/stderr are discarded, so a CLI crash with empty stdout fails as Unexpected end of JSON input with no cause.
Verified in packages/dbt-tools/src/check.ts:56-66: the Fusion check now passes skipScripts: false and timeoutMs: 15_000, matching the adapter's candidate judging, and the new mocked assertion (check.test.ts:47) pins both options. doctor's { passed, checks } shape (src/commands/doctor.ts:4-13) matches the doctorWith return type, configDir() uses process.env.HOME so the temp-HOME fixture in doctorWith is read, and afterEach removes every temp dir. No issue found on changed check.ts lines; no re-raise of the earlier ~/.local/bin wording thread.
Verified the incremental changes at 56ff802a7f against current source: the new Fusion test (packages/dbt-tools/test/check.test.ts:78) matches check.ts:57-60 exactly, including the next to <pythonPath>, prefix, so the previously unasserted variant is now pinned; the new non-Fusion test (:115) exercises the real dbt() path (check.ts:25-33) with an executable stand-in interpreter and asserts python ok / dbt "dbt-core is not installed in the configured Python environment" / project ok for core, corecommand, and cloud, while noFusion still guards against a Fusion lookup. Extracting noFusion removes duplicated inline stubs. Temp dirs are tracked in dirs and removed in afterEach, and fusionBinary.find is restored there, so no test-isolation leak. The six skill-reference rewordings now qualify the stale answer on an earlier manifest having been written and note the error when there is none, which matches stale-manifest.ts:21-29 and graph.ts:40-43. The earlier inline suggestion on the platform-specific ~/.local/bin wording was answered with the library's candidate construction (os.homedir()/.local/bin on all platforms, .exe on Windows); no re-raise.
Status: 2 Issues Found | Recommendation: Merge after suggested improvements
Overview
Severity
Count
CRITICAL
0
WARNING
0
SUGGESTION
2
Verified against the description's claims: C1 (Fusion mode checks only fusion + project, empty/missing pythonPath passes), C2 (other modes keep the exact python/dbt/project checks and never call the Fusion lookup), and C3 (the stale note omits a blank written_at) all hold in the changed code. No Python→Fusion leakage, no new cost path, and the altimate_change block in dbt-schema-verify.ts stays intact.
Issue Details (click to expand)
SUGGESTION
File
Line
Issue
packages/dbt-tools/test/check.test.ts
75
The next to <pythonPath> Fusion error variant (the one users with a leftover pythonPath see) is never asserted
packages/dbt-tools/src/check.ts
60
Fusion error text hardcodes the Unix-only ~/.local/bin location for all platforms
Files Reviewed (13 files)
.opencode/skills/dbt-analyze/references/altimate-dbt-commands.md - no issues
.opencode/skills/dbt-develop/references/altimate-dbt-commands.md - no issues
.opencode/skills/dbt-docs/references/altimate-dbt-commands.md - no issues
.opencode/skills/dbt-test/references/altimate-dbt-commands.md - no issues
.opencode/skills/dbt-troubleshoot/references/altimate-dbt-commands.md - no issues
.opencode/skills/dbt-unit-tests/references/altimate-dbt-commands.md - no issues
…he stale note
A stand-in Python without dbt-core shows core modes still require it, and Fusion's message
names the interpreter it looked next to. The skill references say the stale answer needs an
earlier manifest.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VEmKQx8gR7vd6ettA3mWjP
@codex review against the numbered claims in this PR's description: report only a reproducible trace that violates a numbered claim (C1–C3). A round with no claim violation ends review. Since the last round, 56ff802 is test- and docs-only: two new tests in packages/dbt-tools/test/check.test.ts and reworded skill references; no source change.
The reason will be displayed to describe this comment to others. Learn more.
Consensus review (Claude + Codex): approve
Panel: Claude (lead) and Codex (default model, read-only). Codex reviewed on its own first. Then it accepted each of my findings it hadn't raised, and I reproduced both of its minors. Nothing is critical or major.
The claims hold.
C1: in Fusion mode the checks are fusion and project, and a missing or empty pythonPath passes. I ran altimate-dbt live in Fusion mode, with no pythonPath and a stand-in native 2.0.9 binary in ~/.local/bin. doctor passes and info reports 2.0.9. The only processes started were that binary (--version, debug, deps, parse). Python was never called.
C2: other modes are as on main and never run the lookup.
C3: confirmed by test.
On the Fusion lookup:
A dbt 1.x dbt on PATH is rejected, because findDbtV2Binary checks --version.
An older 2.0.1 in ~/.local/bin beats a 2.0.9 on PATH, and the adapter runs that same 2.0.1.
With "" as the Python path, Fusion uses forBinaryWithoutInterpreter, and nothing starts the Python bridge.
The end-to-end stale test pins the fix. On dbt 1.10.23 it passes with dbt-integration 0.3.19. With 0.3.17 it fails on the isExternalProject === false assertion.
Both remaining minors are inline on check.ts. In each, the prerequisite check is stricter than the adapter it guards:
It rejects a Fusion behind a script launcher, and it gives --version 5 s where the adapter allows 15 s. Edge input: one-line fix, safe in a follow-up.
It is blocked by a non-executable dbt earlier on PATH. Edge input: comes from the library's PATH lookup.
Five nits, one item carried over from #1704, and a check of #1756 against this PR are in a separate comment.
Tests
Suite
Head
Base
dbt-tools, all 15 unit files
214 pass, 0 fail
206 pass, 0 fail (14 files)
dbt-tools bun run test
122 pass
114 pass
opencode test/altimate/validators
817 pass, 132 skip, 0 fail
814 pass, 132 skip, 0 fail
The new tests fail against base code.
Mutations of check.ts are all caught: dropping the binary check, dropping the project check in Fusion mode, running the lookup in core mode, and requiring Python in Fusion mode.
Typecheck 13/13.
Marker guard: "ok". I also confirmed by hand that none of the 13 files exists on upstream/dev.
The reason will be displayed to describe this comment to others. Learn more.
Minor (Codex, verified): the check rejects Fusion setups that the adapter runs.
findDbtV2Binary is called with the library's defaults:
skipScripts: true: it skips, without running them, any candidate that starts with #! or is under 1 MiB.
timeoutMs: 5000 for each --version.
The Fusion integration that runs the commands chooses its binary with isFusionBinary, which runs every candidate's --version with a 15 s timeout.
Reproduced: put an executable #!/bin/sh wrapper that prints dbt 2.0.9 on PATH, and no other Fusion. doctor reports "dbt Fusion was not found…", but the adapter would accept and run that wrapper. Examples of such wrappers are an asdf shim or a nix or company wrapper script.
This is also a narrow regression: on main, a user with Python and dbt-core configured got past the check, and the adapter then ran their wrapped Fusion. A cold --version that takes 5–15 s fails in the same way.
Suggested fix: pass skipScripts: false, timeoutMs: 15_000. The --version check still rejects dbt Core, so a 1.x dbt is not let through.
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 30302f1. The Fusion check now calls findDbtV2Binary with skipScripts: false, timeoutMs: 15_000, so it judges a candidate as the adapter does:
a script launcher whose --version reports 2.x passes;
a cold --version gets 15 s.
The --version check still rejects dbt Core. New tests run altimate-dbt doctor in its own process, with only a stand-in dbt on PATH: a #!/bin/sh launcher printing dbt 2.0.9 passes, and one printing dbt Core's version fails. Both tests fail on the previous commit. Running them in their own process keeps them clear of the child_process mock in dbt-cli.test.ts.
The reason will be displayed to describe this comment to others. Learn more.
Minor (Codex, verified): a non-executable dbt earlier on PATH hides a working Fusion.
The library's resolveOnPath takes the first regular file named dbt on PATH. It doesn't check that the file is executable, and when running that file fails it doesn't try the next one.
Reproduced:PATH=/a:/b, with /a/dbt not executable and a Fusion 2.0.9 at /b/dbt.
doctor fails with "dbt Fusion was not found".
execFile("dbt", ["--version"]) reaches /b/dbt under both node and bun, so the adapter would run it.
skipScripts: false doesn't fix this. The fix belongs in the library's PATH lookup.
Not blocking: edge input that comes from the library.
The reason will be displayed to describe this comment to others. Learn more.
Agreed. The fix belongs in the library's PATH lookup: skip a dbt that isn't executable, or try the next one when running it fails. Until then this check follows it. The follow-up list is on #1756. No change here.
Consensus review (Claude + Codex): nits, and a check against #1756
These are the findings that aren't on a diff line, plus all nits. Codex and I agree on each.
Nits
doctor's USAGE text (packages/dbt-tools/src/index.ts:11) still says "Check prerequisites (Python, dbt, project)". In Fusion mode doctor reports fusion and project.
"next to " in the not-found message (check.ts:57) appears whenever pythonPath is non-empty. But interpreterAdjacentFusionCandidate ignores a bare name such as python3, so the message names a place that wasn't searched. Your reply about ~/.local/bin on Windows holds; this is only about bare names.
The end-to-end stale test covers children only.parents goes through the same fromManifest, but nothing pins it from a stale manifest.
cfg.pythonPath ?? "" in adapter.ts has no test. Dropping ?? "" leaves every test green. It is harmless today: Fusion reads the Python path only in getFusionCandidatePaths, which accepts undefined.
(Pre-existing) The dbt-cli fallbacks aren't Fusion-aware. In Fusion mode index.ts:142 still configures execDbtLs, execDbtCompile and execDbtShow (used when the adapter throws a TypeError and similar). They resolve dbt with resolveDbt, which takes the first existing candidate without checking for Fusion. So a fallback can run a dbt Core binary where the adapter used Fusion. This predates the PR; the PR makes Python-less Fusion reachable.
The stale note still follows the reason line. The note leads fixHint, but session/prompt.ts renders reason first. So the agent reads "column-shape mismatch" before learning that the spec came from a stale manifest. The new test at dbt-schema-verify-stale.test.ts:108 keeps this order on purpose. Neither the issue nor the PR mentions it.
Done, as an end-to-end test instead of the unit test the issue proposed. CI runs it on 1.8, 1.10 and 1.11. Verified here on 1.10.23: passes with 0.3.19, fails with 0.3.17.
2. Skill references
Done. All six files are identical and match USAGE. Verified live: with no earlier manifest, children answers an error, as the new text says.
3. Fusion without Python
Done. See the two inline minors on lookup edge cases.
4. Stale note gaps
Done: empty or whitespace written_at, non-string written_at, a mixed run, and exact equality for the non-stale message.
…ter does
The Fusion check now runs script candidates and allows `--version` 15 s, as the adapter does,
so asdf, nix and wrapper launchers pass; dbt Core is still rejected.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VEmKQx8gR7vd6ettA3mWjP
@codex review — scoped round on 30302f1 only. Claim: in Fusion mode altimate-dbt's prerequisite check (packages/dbt-tools/src/check.ts) accepts any dbt the adapter would run, namely one whose --version reports 2.x, script launchers included, within 15 s, and it still rejects a dbt that isn't Fusion (dbt Core, the dbt Cloud CLI). A counterexample is a concrete PATH / ~/.local/bin setup where the check and the adapter disagree. Report only such a trace.
Thanks. The script-launcher minor is fixed in 30302f1 (see its thread). The nits, the PATH-lookup minor (for the library), and the item carried over from #1704 are listed as follow-ups on #1756, so they don't get lost when it closes.
The reason will be displayed to describe this comment to others. Learn more.
[SUGGESTION]: This test can pass without proving the skipScripts: false fix
By this block's own premise (line 103), the lookup always tries the real ~/.local/bin/dbt first, before anything on PATH. On a machine that has a real Fusion there, fusion returns it before the stand-in launcher is ever reached, so both assertions pass even if skipScripts: false were reverted: the regression test is green but proves nothing. The rejection test below already guards this with test.skipIf(realFusionInLocalBin()); applying the same guard here (or making the stand-in leave a marker file that the test asserts on) keeps the fix pinned.
The reason will be displayed to describe this comment to others. Learn more.
True, on a machine whose ~/.local/bin/dbt is a real Fusion. CI's runners have no ~/.local/bin/dbt, so there the test does reach the stand-in and pins the fix. It fails on the previous commit, which I checked here, where ~/.local/bin/dbt is the dbt Cloud CLI and is rejected. Giving it the same skipIf(realFusionInLocalBin()) guard, or a marker file, is in the follow-up issue for these tests. Not a break, so no change on this head, which is waiting on re-approval.
The reason will be displayed to describe this comment to others. Learn more.
[SUGGESTION]: This fixture rebuilds the config by hand instead of reusing the config() helper
config() above already produces a fusion config with the same queryLimit, and read() parses the file with JSON.parse(raw) as Config and no validation, so a field added to Config later would silently be undefined in this end-to-end test rather than failing loudly elsewhere.
The reason will be displayed to describe this comment to others. Learn more.
Fair, and it's in the follow-up for these tests. The hand-built config here is deliberate for now: config() writes pythonPath: "", and this test is about a config with no pythonPath key at all, as a Fusion-only user's would be. The follow-up will build it from config() and drop the key. No change on this head.
The reason will be displayed to describe this comment to others. Learn more.
[SUGGESTION]: A failing CLI run surfaces as an opaque JSON parse error
result.exitCode and result.stderr are discarded. If doctor exits non-zero with empty stdout (a spawn failure, a crash before bail, or a bun startup error), the test fails with Unexpected end of JSON input and nothing about the cause. Asserting result.exitCode === 0 (or folding result.stderr into the thrown message) keeps the failure diagnosable.
The reason will be displayed to describe this comment to others. Learn more.
Agreed: asserting result.exitCode === 0, with stderr in the failure message, is in the follow-up for these tests. Not a break, so no change on this head.
Keep both test files in the dbt-tools test script: check.test.ts from this
branch and adapter-target-path.test.ts from main.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VEmKQu1Qn99YbrBzhKdtAr
0.3.20 runs docs generate on dbt Fusion 2.0.9+ and stops re-reporting a deleted
Python interpreter on every start. No API change for dbt-tools.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VEmKQu1Qn99YbrBzhKdtAr
@codex review against the numbered claims (C1–C3) in this PR's description. The delta since your last clean round is a merge of main (a conflict in the dbt-tools test script only) plus the @altimateai/dbt-integration ^0.3.20 bump. Report only a reproducible trace that violates a numbered claim. A round with no claim violation ends review.
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
This branch has not been deployed
No deployments
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
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.
Issue for this PR
Closes #1756.
Type of change
What does this PR do?
dbt Fusion works through
altimate-dbtwith no Python.altimate-dbt's prerequisite check demanded Python and dbt-core in every mode. In Fusion mode it checks the project and a dbt 2.x binary (findDbtV2Binary, judged as the adapter does: script launchers count). The adapter gets""when the config has no Python path. Other modes are unchanged.Real dbt Fusion 2.0.9,
{projectRoot, dbtIntegration: "fusion"}, PATH holding onlydbt:info,childrenanddoctorstop at "Prerequisites not met: python: No Python path configured".infoandchildren --model ordersanswer (no modelisExternalProject), anddoctorreports fusion ok and project ok.dbtat all: "dbt Fusion was not found…".Also:
@altimateai/dbt-integration^0.3.20 (the lockfile moves to 0.3.20 only);Claims:
dbtIntegration: fusion, the checks arefusionandprojectonly, and a missing or emptypythonPathpasses.written_atonly when it's a non-empty string.How did you verify your code works?
bun install --frozen-lockfilepasses with the 3-day release-age gate on; after mergingmain(fix: dbt tools keep the project's manifest, time CTEs without dbt start-up, name graph clauses and bad arguments, key the daemon on the Python env #1781), dbt-tools' 126 tests and typecheck pass with 0.3.20 installed.Cost side effects
None.
Checklist
🤖 Generated with Claude Code
https://claude.ai/code/session_01VEmKQx8gR7vd6ettA3mWjP
Summary by CodeRabbit