Skip to content
← back to projects
2026·shipped·Creator & Maintainer

Brownfield Cartographer: What Breaks If I Change This?

A local-first repository analysis engine that maps code structure, dependency impact, and data lineage across Python, SQL, dbt, and Airflow, with file-and-line evidence for every result.

Started as a 10 Academy TRP brief
PythonSQLdbtAirflowMCPGitHub Actions

Architecture

Query engine
Impact + lineage with file:line evidence
↓ calls out to
Python
Calls, imports, embedded SQL
SQL
Best-fit dialect per file
dbt
Manifest v12 + fallback
Airflow
Tasks, order, what they run
CLI · API · MCP
Same answers everywhere

Highlights

  • Finds dependencies a language server can't see: a table written by a Python job, transformed in SQL, and consumed by a dbt model.
  • Column-level lineage that follows renames, with every edge marked as a straight copy or a derived value.
  • Anything it can't resolve (dynamic SQL, computed task ids, unknown columns) is reported as unresolved, never guessed.
  • One query engine behind a CLI, a Python API, a read-only MCP server, and a GitHub Action that comments impact on every PR.

The question it answers#

Language servers and grep answer questions about code symbols. The harder question in a brownfield codebase is what breaks downstream when you change something, and those dependencies usually cross language boundaries through table names in strings and configuration.

cartographer impact models/staging/stg_orders.sql    # what is downstream of this file?
cartographer lineage customers --direction upstream  # where does this table come from?
cartographer lineage customers::first_order          # which source columns feed this column?

Every result carries source evidence and coverage. Analysis is static and offline, needs no API key, and never executes repository code. On dbt’s public jaffle_shop example it finishes in about three seconds.

Coverage, stated plainly#

  • Python: functions, classes, imports, and calls between repository functions, plus SQL passed to execute, read_sql, and similar calls when it can be resolved from literals and constants.
  • SQL: SELECT, CTAS, INSERT, UPDATE, DELETE, and MERGE, each file parsed with the best-fitting dialect (DuckDB, BigQuery, Snowflake, Postgres, MySQL, Spark, T-SQL, Trino).
  • dbt and Airflow: models, seeds, snapshots, and sources from the manifest, and DAG tasks linked to the code and SQL they run.
  • JavaScript and TypeScript: functions, methods, and imports, including tsconfig path aliases.

Anything outside that is reported rather than treated as analyzed. An accuracy benchmark scores extraction against hand-written expected results for pinned dbt, Python, and SQL corpora, including known gaps, and it runs in CI.

Reviewing pull requests#

cartographer diff --base main maps changed lines to functions, SQL statements, dbt models, and Airflow tasks, then lists everything downstream with evidence. The merge base is analyzed too, so deleting a module reports the callers that still use it. The bundled GitHub Action keeps one PR comment up to date, and it works for pull requests from forks.

Where it started#

The first version was a one-week 10 Academy brief: four LLM-assisted agents that generated onboarding docs. I rebuilt it as a deterministic engine, because “what breaks if I change this?” needs an answer you can trust, not a plausible summary.

Write-ups