Skip to content

Dependency roads: render the import graph as edges between buildings #115

Description

@thalida

Draw the repo's real dependency graph as roads/wires between buildings — so the streets aren't just directories, they're coupling. The "why is everything wired to that file" view.

Why it's compelling

Today streets = directory structure (where files live). Dependency edges show how files actually relate — the coupling graph, in 3D, over the city you already know.

What's already built (feasibility)

  • Path/edge rendering exists: streets render as paths (app/src/city/components/streets/, streetPath, pathLine) — the machinery to draw a line between two world points (building A → building B) is largely there.
  • Buildings have stable world positions post-layout, so an edge is just a curve between two building anchors.

The hard parts (design-first)

  • Import parsing (backend, language-specific). Resolve each file's imports/requires to other files in the repo. Start with 1-2 ecosystems (e.g. JS/TS via import/require, Python via import) rather than all languages; unresolved/external imports are dropped. tree-sitter or lightweight regex per language.
  • Graph scale. A large repo has huge edge counts — needs LOD / filtering (show edges only for the selected building, or only cross-directory edges, or a threshold). Drawing all edges at once will be noise + a perf hit (ties to Large-repo render hang: architectural perf pass (profile-first) #75).
  • Rendering language. Arcs/wires over the city (glowing-rune / holographic vocabulary), directional (who imports whom), highlight on select. Avoid a hairball: default to "edges for the selected/hovered building" and make full-graph opt-in.
  • New manifest data: a per-file dependency edge list → just gen-types + cache bump.

Phasing

  1. Backend: import resolution for JS/TS (and/or Python) → per-file edge list in the manifest.
  2. Frontend: on select/hover a building, draw its in/out dependency edges to other buildings.
  3. Filters / LOD for a "show the whole graph" mode.

Exploration: prove the parse + single-building edges first; the full-graph view is where the design/perf work lives.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ideaSuggested feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions