🌐 US-Proxy
id="body-softwares" class="foundation-grid action-show controller-softwares engine-home">

Inspiration

In the United States, whoever buys contaminated land can inherit the cleanup bill (CERCLA). So before a purchase, the environmental review known as a Phase I (ASTM E1527-21) has to look at what the lot was used for in the past. Its main historical source is a set of maps that stopped being drawn more than half a century ago: the Sanborn fire insurance maps. Between 1867 and 1970 they recorded every building in thousands of American towns, and the Library of Congress keeps them online.

A forgotten map language, read again: a 1951 sheet, the DRY CLEAN'G label, and the key from the sheet's abbreviation to today's risk

The maps survived, but the language they are written in did not. Pink means brick and yellow means wood. FILL'G STA. is a filling station, DRY CLEAN'G a dry cleaner, G.T. a gasoline tank, and a small number inside a building gives its floors. Each atlas came with a printed key, and today almost nobody reads it. A consultant still goes through the sheets one by one, by hand.

Underlot brings that language back to life for a job people do today. It reads the old key building by building, translates each abbreviation into a present-day soil risk, and shows the whole translation on screen, so a land buyer can decide whether a Phase I study is worth paying for.

What it does

Underlot is a static web app. A Python pipeline reads the sheets ahead of time, and the app answers one question for any lot in its blocks: what was here, year by year, and did any of it put the soil at risk?

The map: the 1951 sheet over today's streets, the verdict "Risk on site 1951" and the lot record back to 1887

  • Map: search an address or tap a lot. The sheet of each year sits on today's OpenStreetMap, clipped to its block, with a year ruler and an opacity slider. A search that starts with a house number lands on the building whose label carries that number on a sheet of 1908 or later, on the correct side of the street.
  • Reveal: the sheets play year by year, oldest first, while each row of the lot record lights up. Then the verdict lands as a stamp.
  • Lot card: the verdict, the record from today back to the oldest sheet, and every risk on site, adjoining or within 60 m. Each risk card carries its evidence: the crop of the sheet, the label as written, and the decode chain from the abbreviation to what it meant then and what it means now.
  • 3D view: the block in three.js, year by year, with buildings raised by floors and colored by material, risk buildings in acid green with their labels, over the sheet, today's map or only the ink lines.
  • Report: a printable page for an environmental professional, with the Library of Congress sources reviewed, the lot record, the risks within 150 m with their crops and decode chains, the data gaps and the next steps.
  • Verification page: a person checks each risk crop (is the label legible, is the box in place) and a random sample of buildings, and downloads the answers in the format the pipeline reads.

On an Android phone: search, the verdict and the record, and the evidence decoded

It covers two places, chosen to show the same reading works on very different sheets:

New Orleans, Louisiana Williams, Arizona
Area St. Claude Ave corridor, Elysian Fields Ave to France St Downtown on Route 66
Blocks 43 2
Sheet crops 120 (1887 to 1951) 7 (1892 to 1948)
Buildings traced 8,509 143
Soil-risk uses 38 8
Median location error 1.06 m over 116 sheets 0.92 m over 7 sheets

The 3D view of the block in 1951, with the dry cleaner and the gas station labeled

The labels were read by AI reader agents and every risk was reviewed on its crop. In New Orleans, a person also confirmed all 26 risks of the first 27 blocks on the verification page, and each risk card says who read it, who reviewed it and whether a person verified it.

Underlot is a quick reference. The environmental conclusion, including any recognized environmental condition (REC), belongs to an environmental professional, and the app and the report say so.

Built with Kiro

Built in Kiro, layer by layer: steering, specs, correctness properties, bugfix specs and tested code, with hooks, custom agents, MCP, an assets guard and the crop download tool alongside

Underlot was built in Kiro with spec-driven development. Every part of the work began as a spec with requirements, a design and a task list, the specs were reviewed before a line of code existed, and Kiro then worked through the tasks one by one.

  • Four specs, in work order. 02 ran the pipeline on two test blocks, 03 on every block of both cities, 04 built the app and 06 published it on Vercel: 46 requirements and 249 WHEN/SHALL acceptance criteria. Each spec closes with a layer audit and a QA pass before the next one starts.
  • Specs that keep their decisions. Whenever a spec left a point open, or the data could not meet a figure a requirement asked for, Kiro stopped and asked instead of tuning a parameter. Each answer became one of 19 numbered decisions in product.md and was written back into the spec, so later sessions read it instead of guessing.
  • Steering in two layers. Four files are always loaded (product, structure, tech, workflow). Six others load only next to the files they govern: app, design system, geometry, pipeline, the Sanborn domain and testing, so the pipeline rules stay out of the app and the other way around.
  • Ten correctness properties. The design of spec 04 states what must always hold, such as "distance never strengthens the relation" and "the latest action wins". fast-check drives the real app in a browser with random searches, clicks, Back, Forward and reloads to try to break them.
  • An audit that became two bugfix specs. The layer-auditor agent caught a parking lot read as a street in Williams and a divided avenue in New Orleans. Each fix went through a bugfix spec whose first property reproduces the defect.
  • Hooks with brakes. Seven hooks, all on. An assets guard blocks any write to the delivered input, a schema check runs on every readings file, an agent hook checks the Sanborn key, and four check hooks run when the agent ends a turn, skip when nothing changed, give up after 3 failures and end their own process tree.
  • Agents that can only touch their own files. sanborn-reader writes readings, risk-reviewer writes corrections, layer-auditor writes reports, and qa-judge is ready to use the app like a demanding consultant.
  • MCP. Playwright for the agents that check the running app, and context7 so the app tasks look up current Leaflet, three.js, Vite and Playwright APIs.
  • Data that keeps growing. A crop download tool from spec 03 later fetched 16 more blocks, and the reader agent read them, without touching the original input.

The full Kiro setup, with tables for every steering file, spec, property, hook and agent: https://github.com/Abel1011/underlot#built-with-kiro

How we built it

From a 1951 sheet to a verdict: the sheet, the tracing, the reading and the verdict

The pipeline is Python 3.12 with OpenCV, NumPy and shapely, one command-line tool per step, driven by each city's city.json:

  1. Blocks from the city file, with trapezoid blocks built from their real street crossings.
  2. Tracing: OpenCV finds the ink, the long street lines and the block edges, then traces each building by its Sanborn color, with a separate rule for yellowed paper and filters for thin strips and hand-drawn crayon marks.
  3. Reading: each crop is cut into strips with a coordinate ruler, and a reader agent writes one readings file per block and year.
  4. Review: a second agent looks at each proposed risk on the crop and confirms, corrects or rejects it.
  5. Street widths: measured widths are compared with the widths written on the sheet.
  6. Georeference: a similarity fit on the four street crossings, or an affine fit on the OldInsuranceMaps.net control points for trapezoid blocks.
  7. Assembly: labels are matched to outlines, and each building gets its use, floors, material, doubts, history and today's OpenStreetMap footprint.
  8. Images, coverage, verification sample and data check.

Every threshold lives once in pipeline/params.py, and two runs of the pipeline write byte-identical files. The color ranges, the street rule, the georeference, the distance tiers of the verdict and the data contract are explained in the README: https://github.com/Abel1011/underlot#how-it-works

The app is Vite and TypeScript with plain modules and four pages, Leaflet 1.9 for the map and three.js for the 3D view. One analysis module feeds the card, the report and the 3D panel, so all three show the same verdict and the same risk names. The built site is deployed to Vercel with a strict content security policy: the only outside services are the map tiles and the address search.

Tests use public interfaces only: the pipeline through its command-line tools and the files they write (pytest), and the app in a real browser on the built site (Playwright), at phone and desktop sizes, with the property sequences from fast-check.

Challenges we ran into

  • Reading a code nobody uses anymore. The 27 entries of the key had to be copied exactly, in order, and mapped to today's risks. A conformance test compares the app's key with the pipeline's, and every risk name in the data must match what the key produces. Three labels on the sheets match no entry, and their cards show the label without a chain instead of inventing one.
  • Putting 100-year-old sheets on today's map. Corners moved, avenues gained medians, and some blocks are trapezoids. The georeference uses the street crossings in OpenStreetMap or the OldInsuranceMaps.net control points, and every sheet reports its own location error.
  • A parking lot taken for a street. The Williams sheets have no block corners, and an empty lot labeled "AUTO PARKING" passed for N 3rd St. The traced block came out 144 × 177 ft instead of 144 × 303 ft, and the sheet landed 13 to 27 m off. The fix picks the street gap whose block length matches the one expected from the OpenStreetMap crossings: the error went from 13.4 m to under 1 m, and six risks moved onto their buildings.
  • A divided avenue. Franklin Ave is 128 ft wide with a median, and two of its crossings were single nodes on one carriageway, so three block polygons landed 10 to 24 m off. The fix uses the mean of every node where the streets meet and the width written on the sheet.
  • A site light enough for a phone. With the full sheet crops the build weighed 238 MB. The 3D view now loads a 1,600 px version of each crop, and the site is about 92 MB.
  • Never tuning a number to pass a check. When a figure a requirement asked for missed, the measured value was reported, the decision went to the author, and the spec was updated.

Accomplishments that we're proud of

  • 8,652 buildings traced from 127 sheet crops, with a median location error of about one meter.
  • 46 soil-risk uses, each with its evidence crop, its Library of Congress link and its decode chain.
  • All 26 risks of the first 27 New Orleans blocks confirmed by a person.
  • A pipeline that writes the same bytes on every run and never touches its input.
  • Two audit findings turned into bugfix specs, each with a property that reproduces the defect first.
  • 16 blocks added later with the project's own download tool and reader agent.

What we learned

  • Specs reviewed before code bring the open questions up early. Kiro stopped at each conflict, and the answer went into the spec and the steering for good.
  • An independent audit finds what tests miss. Both bugfix specs came from looking at the layers, not from a failing test.
  • Automatic checks need their own limits. Skipping unchanged folders, a failure cap and a time limit kept seven hooks from looping or leaving processes behind.
  • Agents are easier to trust when each one can write to a single place.

What's next for Underlot

Williams, Arizona: a 1948 gas station on Route 66

  • The older sheets of the 16 added blocks, which today have only 1951, and more blocks with the same download tool: OldInsuranceMaps.net has already placed 1,711 New Orleans sheets on the map.
  • A person's check of the 12 risks of the added blocks and the 8 in Williams.
  • More towns from the Library of Congress Sanborn collection, each one a city file and a run of the pipeline.

Built With

Share this project:

Updates

Submission history