Skip to content

fix: dbt adapter refusal for a read-only target path, unchecked altimate-dbt doc examples, dbt_cost_estimate scanner #1796

Open

Description

@sahrizvi

Found during the v0.12.12 release review of #1779 and #1781. Deferred because none of these is a regression and each needs more than a quick fix.

  1. A read-only target_path gives a misleading refusal. The tools that start the dbt adapter create <target-path>/.altimate-code/ (dbtToolTargetPath in packages/opencode/src/altimate/native/connections/register.ts). When target_path points to a shared or read-only folder, the adapter fails to start, and the refusal from dbtAdapterFor names the Python dbt ran with rather than the folder it could not write. It should say the folder is not writable.
  2. altimate-dbt examples in the dbt Tools page are unchecked. fix(dbt-cost-estimate): follow-ups to the planner estimate; say what altimate-dbt is #1779 fixed the altimate-dbt execute --query example in docs/docs/data-engineering/tools/dbt-tools.md. The other altimate-dbt examples on that page have not been checked against packages/dbt-tools/src/index.ts.
  3. dbt_cost_estimate's SQL scanner is dense. scanSql and readsFiles in packages/opencode/src/altimate/tools/dbt-cost-estimate.ts hold many regex rules. A mistake today only means no estimate, never a missed file read, but each change is risky. Consider moving them onto the shared tokenizer planned in refactor: one SQL tokenizer and shared helpers for the dbt Power User tools #1783.

Activity

  1. sahrizvi commented on Nov 20, 2026

    @sahrizvi
    CollaboratorAuthor

    Three more small items from the v0.12.12 E2E (jaffle-shop on DuckDB):

    1. dbt_run_results prints raw float seconds, e.g. 0.3465549945831299s. Round to two decimals or milliseconds.
    2. dbt_map_relations reports partial for tables named exactly like their models (stg_orders -> {{ ref('stg_orders') }}). Say why it is not exact, or match it as exact.
    3. dbt_defer_state requires project_dir even when run inside the dbt project; other tools default to the session's project directory.
  2. sahrizvi commented on Nov 20, 2026

    @sahrizvi
    CollaboratorAuthor

    Two more from the bot reviews of the v0.12.12 release PR (#1798):

    1. readRunResults checks the 256 MiB cap with stat, then calls readFile. If dbt replaces or grows the file in between, the read can still buffer more than the cap. Read from an opened handle with a hard byte limit (packages/opencode/src/altimate/validators/validator-utils.ts).
    2. A run_results.json over the cap returns null, so callers report it as missing or invalid. Return a distinct "too large" result and say so.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions