Skip to content
← Documentation

docs/city-as-map.md


The city as a map, not an embedding

An embedding claims distance means something. A map claims these relationships hold and distorts geometry freely to show them. The distinction decides what the city is allowed to assert.

What the current layout claims, and whether it is true

claim status
2-D distance approximates coupling distance false — Kruskal stress-1 1.029, worse than a null configuration
the plane has two dimensions false — Pearson r(x,z) = −1.000000, one real axis (layout-is-a-line)
a district ring encloses a place false — mean span 39.5% of the city, 18/28 extent pairs overlap, src/lib spans 100%
position orders subjects by coupling true

Exactly one of four claims survives. The layout asserts a metric relationship it does not have, in a plane it does not have, around places that do not exist.

What a map would claim instead

A map layout would assert only what is exactly true:

  1. A building's district is its directory. Observed, exact.
  2. Within a district, order follows coupling order. Exact.
  3. Districts are ordered by first appearance in the coupling order. Exact.
  4. Nothing whatever about distance.

No claim is approximate. The metric assertion — the one that fails at stress 1.029 — is simply not made.

What it costs, measured

Districts are not contiguous runs today. Made contiguous:

district fragments in the coupling order 8.9 per district (src/lib in 19, tests in 18)
immediate coupling neighbours preserved 61.0% (108/177)
pairwise coupling order preserved 85.4% (Kendall concordance)

So a map trades away the global coupling ordering — 39% of immediate adjacencies separate — and keeps ordering within each district exactly.

This is a real loss and must be stated as one. It is a trade of a true global claim for a true containment claim plus a true local one, not an improvement in every direction.

What becomes possible because it is spatial

The test that now governs every rendering change: what understanding becomes available that search, review and the inspector cannot give?

available today from the city as a map
"where is retry.ts" — search answers it
"what changed" — review answers it
"why does this look like this" — inspector answers it
how big each part of the system is, relative to the others, at a glance
which parts sit next to which, i.e. which directories change together
that tests mirrors src in size — a structural fact no panel states

The first three are why the city currently earns nothing. The last three are relational and cannot be read from a list without holding eight numbers in your head.

Recommendation

Build it, and only if the screenshots show those three readings becoming obvious. The evaluation is not "is the geometry better" — it is whether a reader learns something spatial they could not otherwise learn.

Not started. It needs its own before/after captures, and the honest baseline is the depth-2 city as it stands now, not the 32-district version already replaced.

One risk to measure first. zustand places 5 buildings and httpie places 0. A map that lays out blocks must degrade truthfully at those sizes rather than drawing a neighbourhood around one building — the same failure the 32-district version had, in a new form.