Skip to content

feat: build the physical stage from the dbt project, not the manifest - #62

Merged
liam-machine merged 1 commit into
mainfrom
feat/physical-view-sources
Sep 15, 2026
Merged

liam-machine merged 1 commit into
mainfrom
feat/physical-view-sources

Conversation

@liam-machine

Copy link
Copy Markdown
Owner

Summary

  • Existence comes from the dbt project, not the manifest. A model exists if a .sql/.py/.csv sits under the model, seed or snapshot paths, or a schema YAML, manifest node or catalog relation names it — minus anything dbt has disabled. Previously "exists" meant "in the compiled manifest", so a project with no manifest.json rendered every model as a grey ghost. A model designed but not yet built now ghosts (with a reason) instead of vanishing silently.
  • target/catalog.json is read when present — the only dbt artifact that has actually seen the warehouse. Real column types and undocumented columns, unioned with the declared list rather than replacing it, since dbt docs generate runs far less often than dbt run.
  • Per-model provenance on the node and in the details panel: warehouse / your YAML / manifest / file on disk. Types resolve catalog → data_type: → manifest → blank, never invented.
  • Type comparison rebuilt on the spellings adapters really emit (Snowflake bare NUMBER/TEXT, Postgres character varying(255), BigQuery ARRAY<…>), plus a new undeclared status so an absent data_type: stops inflating the mismatch count.
  • Sync plans carry resolvedDataType — stage-absolute, so an assistant can no longer write the empty side of an undeclared column.
  • README restructured to lead with why, around a single diagram showing both stages.

Test plan

  • npm run compile, npm run build
  • npm test — 62 files / 1510 tests (was 1403)
  • mcp-server tsc --noEmit, npm run build, node test-smoke.mjs
  • vsce ls --no-dependencies → 12 files (limit 60)
  • Canvas verified visually: provenance chips, blank type left blank, absent vs disabled ghosts, and the no-artifacts notice
  • Reviewer: confirm the HARNESS_VERSION 16 → 17 bump is wanted in this release (it prompts every user who has installed harness files)

🤖 Generated with Claude Code

https://claude.ai/code/session_014ywafwDpxdWWBt26Q1keiP

The stage named Physical has never actually seen a warehouse. dbt copies
manifest.json's column types straight out of the schema YAML, so what the
canvas showed as physical types was the user's own documentation reflected
back — and because "exists" meant "present in the compiled manifest", a
project that had not run dbt rendered every model as a grey ghost, saying
nothing here exists when it meant you have not run dbt lately.

Existence now comes from the dbt project itself: a source file under the
model, seed or snapshot paths, or a schema YAML, manifest node or catalog
relation naming it, minus anything dbt has disabled. target/catalog.json is
read when present — the one artifact that has looked at the warehouse —
unioned with the declared columns rather than replacing them, because
dbt docs generate runs far less often than dbt run and a catalog-wins rule
would hide a column added an hour ago. Each model now reports where its
shape came from, so a type on the canvas is never an unattributed guess.

Type comparison is rebuilt on the spellings adapters actually emit, and a
type declared on only one side reports as undeclared rather than inflating
the mismatch count. Sync plans carry a stage-absolute resolvedDataType,
because the existing pair is named for the comparison direction and an
assistant following the old harness table could write the empty side.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014ywafwDpxdWWBt26Q1keiP
@liam-machine
liam-machine merged commit 28d7bc9 into main Sep 15, 2026
3 checks passed
@liam-machine
liam-machine deleted the feat/physical-view-sources branch September 15, 2026 02:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant