Skip to content

fix(databricks): bounded SDK clients, an example, and credentials only to hosts you chose - #1190

Open
fas89 wants to merge 10 commits into
mainfrom
fix/databricks-sdk-clients-and-credential-routes
Open

fas89 wants to merge 10 commits into
mainfrom
fix/databricks-sdk-clients-and-credential-routes

Conversation

@fas89

@fas89 fas89 commented Dec 5, 2026 •

Copy link
Copy Markdown
Collaborator

What

Four changes around Databricks and dbt credentials, one section each.

1. Databricks SDK clients: one factory, timeouts, printable text

  • One client factory, with timeouts. databricks_auth.workspace_client now builds every WorkspaceClient:
    • fluid verify (_verify_databricks._default_client) reads with the live check's 10 s on each HTTP attempt, as fluid doctor --live and fluid diff do.
    • The apply-time helpers (databricks_enforce.default_client: masks and row filters, keys, metric views, Genie, loads, job and pipeline runs, test results and dashboards) use 60 s on each attempt, and keep the SDK's own 300 s of retries, so a long throttle during a mask or row filter bind, or its deny-all fallback, is waited out. A statement asks the server to wait at most 30 s, so its request fits.
    • Before, both built the client with the SDK's defaults: 60 s per attempt and a 300 s retry budget, which the SDK's host metadata probe in Config() also used. A host that did not answer held fluid verify for about five minutes before its first read.
  • Printable SDK text. A server's text reached the terminal with its escape sequences in two places, and both now replace every character that is not printable with ? (databricks_auth.printable, the rule fluid diff prints server text by):
    • the SDK's own warnings, such as "Failed to automatically resolve config from host metadata: <the server's message>". A filter on each databricks.sdk logger rewrites such a record. A filter on a logger does not see its children's records, so every databricks.sdk.* logger the SDK has made gets one, once each. It redacts the record first, by argument and over the whole message, while the tabs and no-break spaces a redaction pattern needs are still there.
    • scrub and _scrub, which every SDK and HTTP error message passes through. They removed credential values and joined lines, but kept ESC, BEL and NUL.
      ? and not a spelled \xNN: the secret redactor runs after the log filter, on the handlers, and a spelled escape ends in a word character, which would hide a PASSWORD= right after it from the redactor's pattern.
  • The SDK's host metadata warning loses its reason. databricks-sdk 0.171.0 warns when Config()'s host metadata probe fails and puts the probe's error after the colon, so a server's own message reached stderr at the default level on every fluid doctor --live run against such a host. Against a stand-in that answers 403 with the caller's name on every path, that name reached the output, which the doctor row promises never to show. The log filter now keeps the warning's first part and replaces the reason with a fixed text: "Failed to automatically resolve config from host metadata; using the explicit configuration."
  • fluid verify names only the refusal kind when the Databricks emitter raises a refusal while verify works out what apply provisions: "fluid apply refuses this contract (); run fluid validate on it for the reason". It used to repeat the emitter's message and remediation, which can hold values resolved from {{ env.X }}. fluid diff already does this.

2. A Databricks Unity Catalog example

examples/ had no Databricks contract, and AGENTS.md named Databricks only in the cloud list.

  • examples/databricks-unity-catalog/: one Unity Catalog table, garden.produce.harvests, with SELECT for one reader group. The README names the environment it needs (DATABRICKS_HOST, a credential, DATABRICKS_WAREHOUSE_ID), the USE CATALOG grant a catalog admin runs once for the reader group (fluid apply never grants on a catalog, and prints that statement), and the commands from validate to verify.
  • tests/iac/test_iac_databricks_examples_fake_e2e.py finds every examples/databricks-* contract and runs its README's commands with the real fluid CLI, tofu and the databricks/databricks provider against the in-process workspace (tests/iac/_fake_databricks.py): validate --strict, generate iac --validate, doctor --live, apply, a second plan that changes nothing, diff --exit-on-drift and verify --strict --require-every-port.
  • The iac-tests stand-in lane runs it (with a require: line) with the databricks extra installed, as the README's users have it (a lane may now name its own extras), and a change under examples/databricks-* now starts that workflow.
  • tests/test_examples_pass_strict_validate.py exports DATABRICKS_WAREHOUSE_ID for a Databricks example, as its user would.
  • AGENTS.md has a section on a Databricks contract's shape: location.database is the catalog, the workspace and credential come from the environment only, readers need USE CATALOG from the catalog's admin, which commands read the live workspace, and that the example is the shape to start from (there is no fluid forge template for Databricks).

3. An LLM key goes only to a Databricks workspace you chose

With FLUID_LLM_PROVIDER=databricks and no DATABRICKS_API_BASE, litellm's databricks route asks databricks-sdk for the workspace (WorkspaceClient().config.host) and sends the key there. A project .env may set DATABRICKS_HOST next to its own DATABRICKS_TOKEN (the Databricks endpoint group pairs them), so once a process had loaded the project's dotenv files, the key forge resolved (FLUID_LLM_API_KEY, the keyring or a saved setup) went to the workspace the project named.

  • Both places forge calls litellm check first. litellm_backend._completion_via_router_or_direct is the one call every completion takes (call_llm blocking and streaming, fluid ai test, the staged agents, forge data-model --llm-provider), and fluid ai setup's key check (ai_setup._validate_api_key) runs the same check before its own call. A route listed in LITELLM_SDK_HOST_ROUTES (credentials/litellm_endpoints.py; today only databricks), on a call with no api_base while litellm's own base variable is unset, is refused while a project dotenv file supplied the host the SDK reads, unless the key in the call is the project's own FLUID_LLM_API_KEY. litellm routes by custom_llm_provider, else the model's prefix, and so does the check, so FLUID_LITELLM_MODEL_PREFIX cannot route around it.
  • Refused before litellm or the SDK runs: no request, not even the SDK's host metadata probe. The error, copilot_llm_key_withheld, names variables only: "Not sending your LLM key: a project dotenv file sets the Databricks workspace (DATABRICKS_HOST), and the databricks provider sends the key there when DATABRICKS_API_BASE is not set." Its fixes: export DATABRICKS_API_BASE (your model serving endpoint) in your shell or CI environment; or export DATABRICKS_HOST for your own workspace, which replaces the project's; or run the command outside this project. A catalog entry and the skills' error-code reference carry the same text. The staged agents do not retry it (failure_class withheld, as for a rejected key), and fluid ai test reports it as a setting to fix (exit 2).
  • Unchanged: any other provider; a DATABRICKS_API_BASE from the operator, or from the project paired with its own FLUID_LLM_API_KEY; no project workspace in effect (the operator's own DATABRICKS_HOST, ~/.databrickscfg); a project's own key with its own workspace; a call with no key.
  • Where it applies: fluid apply, verify and publish load a project's dotenv files, and so does the library engine (fluid_build.engine), which a host application runs in its own process before other forge calls; a plain fluid forge run loads none. The check holds for any process that loads them and then calls the LLM.
  • The endpoint pairing stays as it is: listing the LLM key among the Databricks group's pairing credentials would require it next to every project host and token, which a project that only runs Databricks jobs never has.
  • A classification test reads the installed litellm: every vendor SDK client its provider code builds (OpenAI, AzureOpenAI, WorkspaceClient, their async forms) takes its host from a variable an LLM endpoint group pairs with FLUID_LLM_API_KEY, or its provider is listed in the table. It fails on a route left out (checked by emptying the table), and checks the table against databricks-sdk's own Config.host variable.

4. dbt's profile comes from inside the project, or from you

A dbt profile names the host dbt connects to and the credentials it sends there.

  • A project .env may no longer set DBT_PROFILES_DIR, DBT_PROFILE, DBT_TARGET or DBT_PROJECT_DIR, nor the DBT_ENGINE_* forms dbt 1.11 and later read first (dbt 1.12.7 dbt/cli/params.py). Before, it could pick another of the operator's profiles in ~/.dbt or a profile outside the project. Each is ignored with the usual warning; the shell and CI may still set them, and a contract keeps build.properties.target.
  • Nor may it turn on dbt's artifact upload (DBT_UPLOAD_TO_ARTIFACTS_INGEST_API and its DBT_ENGINE_ form). In dbt 1.12.7 the upload posts the manifest and run results with Authorization: Token $DBT_CLOUD_TOKEN to https://<dbt-cloud.tenant_hostname>/api/private/accounts/..., the hostname read from the project's own dbt_project.yml (dbt/utils/artifact_upload.py); the switch is not a dbt_project.yml flag, so only the operator's shell or CI may turn it on. DBT_HOST is dbt docs serve's bind address and sends nothing.
  • A profiles.yml the project supplies must resolve inside the project, symlinks followed: in the dbt project's config/dbt/ or root, and, when forge writes no profile for the platform, in the contract's directory, where dbt runs and looks first. Inside means the contract's directory, a bundle's root, or the repository for a hybrid-reference build, as for the dbt project itself (_path_safety.workspace_root_of), never a repository that holds the operator's home directory (a dotfiles repository): the nearest repository around the contract stands in for it, else the contract's directory. Anything else raises DbtProfileError before a profile is written or dbt starts:
    • what: "build '' reads its dbt profile from outside the project (profiles.yml)"
    • why: "A dbt profile chooses the host dbt connects to and the credentials it sends there, so a profile outside the project or bundle is not the project's to choose."
    • fix: "Keep profiles.yml inside the project as a file of its own, not a link to one elsewhere, or export DBT_PROFILES_DIR in the shell or CI environment that runs the build to use a profile kept outside it."
      It names the field, never the path. A profile directory the runner cannot read is handed to dbt, which reports it; forge raises no traceback.
  • The build property profiles_dir is in no schema (0.7.1 to 0.7.7 reject it), so a contract cannot carry it; a caller that runs builds without schema validation can, and it gets the same rule (resolved from the contract's directory, where dbt runs, and handed to dbt as that absolute path).
  • Unchanged: the operator's DBT_PROFILES_DIR; profiles inside the project; the profile forge writes itself.

Checked and left as they are

  • _verify_databricks retention check: a live Delta property that is not an interval is reported with repr, which escapes control characters; a table property is not a credential.
  • _verify_databricks client refusals (sdk_config): they name variables and hosts, never a credential value.
  • databricks_enforce: a foreign row filter or mask names the live function (ForeignBinding), and a function mismatch names the live owner and parameters, with the body in repr. Both are the workspace's own names, shown to the operator who runs the apply.
  • databricks_metrics: a metric's aggregate that cannot be expressed repeats contract text, and the fail-safe note repeats an sdk_config refusal.
  • copilot/catalog/unity.py builds its own client from the catalog connection's credentials, not the apply credential, so it keeps its own path.
  • Every litellm call forge makes: litellm.completion in _completion_via_router_or_direct and in ai_setup._validate_api_key, both checked now. forge calls no acompletion, embedding, text_completion, responses or Router; its other litellm uses read local tables (model_cost, completion_cost, cost_per_token, token_counter). The coding-agent providers run an agent's own CLI, not litellm, and forge has no MCP sampling path any more. fluid ai setup's own choices cannot pick databricks today.
  • The GCP and AWS planners' dbt.prepare_profile actions carry a profiles_dir as plan text; the runner never reads it.

Borrow

  • Items 1 and 2, unchanged from their earlier review:
    • Repo: _preflight._LIVE_TIMEOUT_S and workspace_client, which fluid doctor --live and fluid diff already use; the emitter's RETRY_TIMEOUT_SECONDS; fluid diff's printable() rule and _console's note on redacting before spelling a control character; install_secret_redacting_filter's find-or-add idempotence; the import-linter contracts keep the filter out of cli. No Databricks example existed (only a test stub); tests/test_examples_pass_strict_validate.py already finds every example; tests/test_aws_examples_e2e.py is the per-cloud matrix this follows; tests/iac/_databricks_cli.py gives workspace isolation and the CLI runner.
    • databricks-sdk 0.171.0 (Apache-2.0), read in source: it logs as databricks.sdk in 56 modules and five children plus useragent; it offers no hook to clean its log text; http_timeout_seconds and retry_timeout_seconds are separate Config values (60 and 300).
    • Python logging docs: a logger's filter does not see records its descendants create. logging-formatter-anticrlf (BSD-2-Clause), rich control.py (MIT), OpenSSF pyscg-0022 and CWE-117 cover CR and LF only, so the filter is small and local.
    • Databricks Terraform provider docs (Apache-2.0) for databricks_sql_table and databricks_grants; Databricks Unity Catalog privilege docs (SELECT, USE SCHEMA, USE CATALOG); datacontract-cli's Databricks reference (MIT, v1.2.11); databricks/cli libs/testserver (Databricks License, idea only, no code taken).
  • Item 3:
    • Repo: protected_env's endpoint groups and dotenv_store.project_supplied (the same test llm/coding_agent.py uses to drop a project endpoint from an agent's environment); cli/ai_setup.py's withheld-key notice for the message's shape; tests/test_litellm_endpoint_names.py's scan of litellm's provider code for the classification test; tests/_dotenv_pairing_support.py's loopback listener and DNS guard.
    • litellm 1.111.1 installed and main f2f507c3 (2026-11-24, MIT), read in source: the databricks route still falls back to WorkspaceClient() in _get_databricks_credentials and _get_api_base; an explicit api_base is the only thing that skips it; there is no switch, and no upstream issue or discussion of it. databricks-sdk 0.171.0: Config.host reads DATABRICKS_HOST, and a host= argument would win, but litellm passes none.
    • Prior art for the rule: git's protected configuration (some settings count only from system, global or command-line scope, never the repository's), Terraform CLI credentials "<host>" blocks (a token bound to one host, read only from the user's configuration), npm's per-registry //host/:_authToken.
  • Item 4:
    • Repo: _path_safety.resolve_workspace_root and confine_to_workspace (the dbt project directory's own confinement), DbtProfileError and the runner's refusal path for the generated profile's host; PROTECTED_ENV_KEYS and libpq's service-file precedent (PGSERVICE, PGSERVICEFILE) in it.
    • dbt-core 1.10.23 and 1.12.7 source: --profiles-dir, --profile, --target and --project-dir read DBT_*, and 1.12 reads DBT_ENGINE_<X> first; the artifact upload in dbt/utils/artifact_upload.py and dbt/cli/requires.py; dbt docs on the profiles.yml lookup order.
    • Dagster's DbtCliResource and astronomer-cosmos's ProfileConfig (both Apache-2.0) check only that a profiles location exists; neither confines it, so the check is forge's own, on Python's documented Path.resolve() then is_relative_to.

Validation

  • Failing first:
    • Item 1: 8 tests failed on its base and pass here; the host metadata warning, 3 more on its parent.
    • Item 2: on its base the discovery test failed (no examples/databricks-*), and the example's first verify --strict failed for want of the reader's USE CATALOG, which is how the README's admin step was found.
    • Item 3: every test that pins a refusal failed first, against the code before it: 10 of the new file's 21 tests, in three rounds (7 for the route itself, 1 for fluid ai setup's key check, 2 for the retry and the exit code); the other 11 pin calls that must still go out and classify litellm's routes. Before the change, the loopback listener standing in for a project's workspace got POST /serving-endpoints/chat/completions with the operator's key as the bearer, after two GET /.well-known/databricks-config. Here the same probe ends in copilot_llm_key_withheld, and the listener records nothing.
    • Item 4: 37 of the new file's 41 tests failed first, against the code before each change, in four rounds (29 for the names and locations, 2 for the upload switch, 4 and 2 for the review findings); the other 4 pin profiles that must still be used. Before the change, is_protected_env_key was false for every dbt name, and a project .env's DBT_PROFILES_DIR chose the profile; here it is ignored with the warning.
  • Touched tests: the full suite below runs them. Before the base's latest change landed, the touched files of both changes (the Databricks SDK, verify, doctor and diff tests, the examples' stand-in run with real tofu, the dbt runner, dotenv, protected-name, litellm, ai setup, retry and plan tests) ran on the two stacked together: 6,792 passed, 2 failed, the two overlay cases of tests/fragments/test_compat_gate.py, which fail on main too, run alone (fluid bundle's stderr repeats its compile lines).
  • Lint battery as CI runs it: ruff, dead-code sweep, black 26.10.1, product guardrail, detect-secrets 1.5.0 on the changed files, license headers, both lint-imports configurations and the fences: clean. mypy --strict only its 3 rows in profiler/consumer_queries/check.py, as on the base; bare mypy on the changed files adds 2 rows of a pattern _ai_setup_test.py already has 15 times (exit codes bound from ai_setup at import, which mypy cannot see), and one row moved a line. tests/perf/test_startup_budget.py: 11 passed.
  • Quality delta (ripwire --quality-delta on the base with this diff applied; a no-op control there reports no rows): 20 rows, each expected.
    • Test idiom: the SDK client test's local HTTP handler has the shape of three other test servers (65 tokens) and of the doctor test's fixture (120 tokens); the new tests' small helpers and the one-line exit-code test match unrelated tests and helpers at 26 to 45 tokens, and the verify refusal test matches a verify test the base added.
    • Item 1's own, as in its earlier review: churn on workspace_client, and _default_client matching the shape of two unrelated lazy-import helpers (32 and 35 tokens).
    • Two data tables grew: PROTECTED_ENV_KEYS by the ten dbt names and their comments, _GUIDANCE by the new event.
  • Full suite once, on this head's tree, under the shared heavy lock (-n 3, seed 868334584, 28 min): 56,860 passed, 47 failed, 13 errors, none caused by this change.
    • 52 are profiler tests that need scipy, which main added for the profile history after this machine's environment was built. With scipy installed, the 10 files with a failure ran again: 469 passed, 7 failed.
    • Those 7: 4 DuckDB sandbox tests and test_dbt_does_not_reload_the_project_dotenv fail on main too, on this machine (no pandas, no dbt in the environment); the 2 overlay cases of tests/fragments/test_compat_gate.py fail on main too, run alone (fluid bundle's stderr repeats its compile lines).
    • test_an_overlay_composed_from_fragments_is_applied_and_listed passed on the second run.

Known limits

  • The host metadata rewrite matches databricks-sdk 0.171.0's wording. If a newer SDK rewords that warning, test_the_host_metadata_warning_never_carries_the_server_s_message fails, since it expects the fixed text. Other SDK warnings that repeat an error, such as a failed OAuth token refresh, are made printable and redacted but keep their text.
  • A host that never answers costs the SDK's host metadata probe before the first call: with --live's 10 s per attempt, fluid doctor --live waits about 20 s before it reports the failure. databricks-sdk 0.171.0 has no switch to skip the probe.
  • The timeouts bound each HTTP attempt, not the whole call: databricks-sdk 0.171.0 checks its retry deadline only between attempts, sleeps for a server's whole Retry-After, and sends its OAuth token and token exchange requests with no timeout. The comment at workspace_client names both.
  • The SDK writes a few DEBUG lines on the root logger, not its own; the filter does not see them (they show only at FLUID_LOG_LEVEL=DEBUG). At that level the SDK's request and response dump becomes one line, its line breaks shown as ?. A record's traceback is formatted after the filter and is not made printable (databricks-sdk 0.171.0 logs one only on its Azure CLI paths).
  • Item 3 covers the routes litellm 1.111.1 and its main branch have; the classification test names any new vendor SDK client in litellm's provider code before it ships.
  • Item 4 checks where a profile comes from, not the hosts inside a profile the project ships: a profiles.yml committed in the project still names its own host. That is a separate check.
  • With no profile from forge or the project, dbt falls back to the operator's ~/.dbt, and the dbt project's own profile: key picks one of its profiles. That is how dbt works, and it stays.

Reviews

  • Items 1 and 2, on their first base: verifier PASS; security review APPROVE with four LOWs (two fixed, two under Known limits); defect scan with no Critical to Medium finding; item 2's defect hunt found two Mediums, both fixed.
  • This group, sonnet verifier: PASS. It re-ran items 1 and 2 on this base (241 and 66 tests, real tofu 1.13.1), drove item 3's states (the wire test fails with the check removed; the classification with an empty table names llms/databricks/common_utils.py) and 30 profile-location cases for item 4, none of which escaped.
  • Security review (Opus) of the diff: APPROVE WITH CHANGES, no HIGH. The LLM route held against every bypass tried: the model prefix setting, litellm's globals, the no-key fallback, other host variables, case, blank values. Its two LOW dbt routes are fixed here with tests: a hybrid-reference repository that holds the home directory, and the profiles.yml dbt reads from its working directory when forge writes none. Its two LOW regressions are intended and named above: a project .env DBT_TARGET is ignored (use build.properties.target), and fluid verify no longer repeats the emitter's remediation.
  • Defect scan (diff mode, three hunters: logic, runtime with real fluid runs, cross-file contract; security left to the review above). Fixed here, each with a failing-first test: the refusal was retried three times by the staged agents; fluid ai test reported it as a resource problem (exit 4); the profiles.yml refusal's fix named a field no schema allows; the hybrid-reference root above; an unreadable profiles directory raised a traceback. Stated in this body instead of changed: the build property profiles_dir is schema-rejected, and the LLM check applies where a process has loaded the project's dotenv files.
  • Final judge (Opus) over the whole group: SHIP. It re-ran the two new test files and 685 neighbouring tests, probed the profile workspace and the working-directory profile itself, confirmed both litellm calls run the check and that litellm picks the provider from the model's first segment, and found the public text clean. Its findings were wording (this body's test counts, three sentences, one comment) and two LOWs in code, fixed here with failing-first tests: an unreadable dbt project profile directory raised a traceback, and a monorepo under a home-directory repository lost its own shared profile, which now falls back to the nearest repository around the contract.

Documentation

  • Docs PR linked
  • No docs needed
  • Docs TODO: draft forge_docs PR follows: the Databricks page (verify and apply timeouts, verify's refusal text), the AI authoring page (the databricks provider and a project's DATABRICKS_HOST), and the dbt and project .env pages (the protected dbt variables, the artifact upload switch, and where a project's profiles.yml may sit).

fas89 added 7 commits December 5, 2026 09:05
…ntable text

databricks_auth.workspace_client now builds the client fluid verify
reads with (10 s on each HTTP attempt and of retries, the live check's
bound) and the one the apply-time helpers use
(databricks_enforce.default_client: 60 s on each attempt, and the SDK's
own 300 s of retries, so a long throttle during a mask or row filter
bind is waited out). Both used the SDK defaults, which the host
metadata probe in Config() also used, so an unreachable host held
fluid verify for about five minutes.

A workspace's text reached the terminal with its escape sequences: in
databricks-sdk's own warnings, such as the host metadata one, and in
scrub and _scrub, which removed credentials but kept ESC, BEL and NUL.
util.excerpt.printable replaces every character that is not
printable with ?, the rule fluid diff used, which now calls it too.
workspace_client puts a filter on databricks.sdk and on each of its
child loggers before Config() runs. It redacts a record that holds such a character, by
argument and over the whole message, before it replaces the character,
so a tab or a no-break space a redaction pattern needs is still there.
Both scrub helpers apply printable after their redaction.

The timeouts bound each attempt, not a whole call: databricks-sdk
0.171.0 sleeps for a server's whole Retry-After and sends its OAuth
token requests with no timeout. The docstring of workspace_client says
so.

Signed-off-by: Speculator55005 <50082482+fas89@users.noreply.github.com>
…efuses

fluid verify repeated an emitter refusal's message and remediation,
which can hold values resolved from {{ env.X }}. It now says that fluid
apply refuses the contract, names the refusal kind and points to fluid
validate for the reason, as fluid diff does. A test pins that a table
the emitter refuses over an env-resolved principal stays not verified,
with the value nowhere in the result.

Signed-off-by: Speculator55005 <50082482+fas89@users.noreply.github.com>
… warning

databricks-sdk 0.171.0 warns when Config()'s host metadata probe fails
and puts the probe's error after a colon, so a server's own message (one
that names the caller, for example) reached stderr at the default level
on every fluid doctor --live run against such a host. The SDK log filter
now keeps the warning's first part and replaces the reason with a fixed
text. A stand-in that answers 403 with the caller's name on every path
shows no name in the log or in fluid doctor --live output.

Signed-off-by: Speculator55005 <50082482+fas89@users.noreply.github.com>
examples/databricks-unity-catalog holds one Unity Catalog table with a
reader group. Its README names the environment the workspace and the
credential come from, the USE CATALOG grant a catalog admin runs once
for the reader group (fluid apply never grants on a catalog), and the
commands from validate to verify. The strict-validate test finds it and
exports the SQL warehouse a Databricks user always has. AGENTS.md
describes the contract's shape: location.database is the catalog, and
the workspace comes from the environment only.

Signed-off-by: Speculator55005 <50082482+fas89@users.noreply.github.com>
…stand-in

tests/iac/test_iac_databricks_examples_fake_e2e.py finds every
examples/databricks-* contract and runs it with the real fluid CLI, tofu
and the databricks/databricks provider against the in-process workspace:
validate --strict, generate iac --validate, doctor --live, apply, a
second plan that changes nothing, diff --exit-on-drift and
verify --strict --require-every-port, after the USE CATALOG grant the
README asks a catalog admin to run.

The iac-tests stand-in lane runs it, and a change under
examples/databricks-* now starts that workflow.

Signed-off-by: Speculator55005 <50082482+fas89@users.noreply.github.com>
With FLUID_LLM_PROVIDER=databricks and no DATABRICKS_API_BASE, litellm's
databricks route asks databricks-sdk for the workspace and sends the key
there. A project .env may set DATABRICKS_HOST next to its own
DATABRICKS_TOKEN, so once a process had loaded the project's dotenv files,
the key forge resolved (FLUID_LLM_API_KEY, the keyring or a saved setup)
went to the workspace the project named.

Both places forge calls litellm now check first: the one completion call
every LLM request passes, and fluid ai setup's key check. A route listed in
LITELLM_SDK_HOST_ROUTES, with no api_base and its base variable unset, is
refused (copilot_llm_key_withheld) while a project dotenv file set the host
the SDK reads, unless the key is the project's own FLUID_LLM_API_KEY. The
error names the variable and how to point the provider at a workspace of
your own; the staged agents do not retry it, and fluid ai test reports it
as a setting to fix (exit 2). A classification test reads the installed
litellm: every vendor SDK client its provider code builds takes its host
from a variable an LLM group pairs with FLUID_LLM_API_KEY, or its provider
is listed in the table.

Signed-off-by: Speculator55005 <50082482+fas89@users.noreply.github.com>
… operator

A project .env may no longer set DBT_PROFILES_DIR, DBT_PROFILE, DBT_TARGET
or DBT_PROJECT_DIR, nor the DBT_ENGINE_ forms dbt 1.11 and later read
first. A profile names the host dbt connects to and the credentials it
sends there, so a project file could pick another of the operator's
profiles in ~/.dbt, or a profile outside the project. Nor may it turn on
dbt's artifact upload (DBT_UPLOAD_TO_ARTIFACTS_INGEST_API), which posts the
run's artifacts with the DBT_CLOUD_TOKEN in the environment to the host the
project's own dbt_project.yml names. Each is ignored with the usual
warning; the shell and CI may still set them.

A profiles.yml the project supplies (in the dbt project, or in the
contract's directory, where dbt looks when forge writes no profile) must
resolve inside the project, symlinks followed: the contract's directory, a
bundle's root, or the repository for a hybrid-reference build, unless that
repository holds the operator's home directory. A build property
profiles_dir, which no schema accepts and only an unvalidated caller can
pass, gets the same rule. Anything else raises DbtProfileError before a
profile is written or dbt starts, with the fix.

Signed-off-by: Speculator55005 <50082482+fas89@users.noreply.github.com>
@github-actions github-actions Bot added ci Continuous integration and automation changes security Security-related changes or reports cli Changes to the CLI surface or implementation tests Test coverage or test infrastructure changes labels Dec 5, 2026
Comment thread fluid_build/_error_catalog.py Fixed
Comment thread fluid_build/_error_catalog.py Fixed
Comment thread fluid_build/cli/_diff_live.py Fixed
fas89 added 3 commits December 5, 2026 09:19
The examples' README runs fluid doctor --live and fluid verify, which read
the workspace through databricks-sdk, as a user who follows it installs
it. Stage 1 installed only the dev and test-emulators extras, so doctor
reported the SDK missing and verify could not read the catalog grant. A
lane may now name its own extras; the Databricks lane adds databricks.

Signed-off-by: Speculator55005 <50082482+fas89@users.noreply.github.com>
…one string

diff and verify now import printable from util/excerpt, so _diff_live no
longer re-exports it. The withheld-key hints in the error catalog are one
string each, and the new LLM test imports the providers module one way.

Signed-off-by: Speculator55005 <50082482+fas89@users.noreply.github.com>
The new LLM test imports llm.providers before anything that loads
llm.litellm_backend, which _backend() relies on; the import line now
says so.

Signed-off-by: Speculator55005 <50082482+fas89@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continuous integration and automation changes cli Changes to the CLI surface or implementation security Security-related changes or reports tests Test coverage or test infrastructure changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant