Summary for judges
Casebook is a map of crime in the City of London, then and now. It puts trials from the Old Bailey Proceedings (1674 to 1913) on the streets where they happened. Next to them, it shows today's police.uk crime counts for the same streets.
You can try it here: https://main.d2wt4ovblqt590.amplifyapp.com/
Kiro steering holds the ethics rules of the project. Six Kiro agent hooks guard those rules every time a file is saved. Two manual steering files run the monthly data refresh as slash commands.
Inspiration
Every street in the City of London has a past. I wanted to stand on any corner and ask a simple question: what happened here 300 years ago?
The answer already exists. From 1674, the Old Bailey court printed its trials as cheap pamphlets called the Proceedings. Londoners bought them on the street and read about robberies on roads they knew. For 239 years, this was how the city read about its own crime.
Today those pamphlets sit online as XML files. They are free and complete, but very few people read them. They have no map. You cannot stand on a corner and ask, "What happened right here?"
I wanted to bring the Proceedings back to the street, and that is my resurrection. A dead form of local news becomes a living map that you can carry in your pocket.
What it does
Open Casebook and share your location, or search for a place. The map fills with pins. Each pin is a real Old Bailey trial, placed on the street that the court record names.
Tap a pin and you get the case file:
- The charge, in the words of the court
- The verdict, always, in a clear badge
- The sentence and a short timeline of the trial
- A link to the original record on Old Bailey Online
- How sure we are about the place: exact place, street, or area
The grey pins show today. They are police.uk counts for the same streets, with no names and no single cases. The Compare view puts one street side by side: Old Bailey trials by decade, and the last year of police.uk counts for the street and for one mile around it. The app also says, in plain words, that these two numbers count different things. A trial in 1750 and a crime report in 2026 are not the same unit.
Casebook is a PWA, so you can add it to your phone's home screen and take it on a walk.
The rules that shaped everything
Real people are in these records. Some of them were hanged, and many were found not guilty. I did not want a ghost-story app that turns them into props. So before I wrote any code, I wrote rules:
- Two tones. Old cases get the casebook look: serif type, a case-file label, atmosphere. Recent data stays plain and factual. It gets no ghosts and no blood-red color.
- The 100-year rule. Names appear only on records that are more than 100 years old.
- Every case shows its verdict. A person found not guilty never appears as the person who did it.
- Every pin cites its source and says how sure the location match is.
- Violent cases get a content note. Nothing is scored or ranked.
These rules became the center of how I used Kiro.
How I built it with Kiro
Steering: the rules live where Kiro reads them
The file .kiro/steering/tone-and-data-rules.md holds the five rules above. Kiro reads it on every request. Kiro uses those rules when it writes UI copy and when it designs a database table.
Agent hooks: six guards that run when I save
Rules in a document are easy to forget when you are tired. So I turned each rule into a hook. All six are in .kiro/hooks/sherlock-data-quality.json:
- validate-case-and-trial-records: when I save an ingest script or an API route, Kiro reads the change against the steering rules. It looks for a missing verdict, a missing source, a name after the 100-year cutoff, and a name on a not-guilty verdict.
- etl-unit-tests: when I save any file in
scripts/, the ETL tests run. - schema-guard: when I change the database schema, Kiro makes sure that I bumped the schema version, that no data rule got weaker, and that the API types still match.
- ingest-report-review: when an ingest writes a new report, Kiro compares it with the last one. It flags a jump in rejected rows, a missing month, or a new category that nobody mapped.
- licence-and-attribution-guard: when I save an ingest script, Kiro makes sure that every row carries the right licence. The sources use four different licences.
- two-tone-guard: when I save a component that shows recent data, Kiro looks for casebook styling or any score that ranks an area.
Manual steering as slash commands
I wanted a button for "refresh this month's police data". The v1 hook format that I used has no manual trigger. So I wrote two steering files with inclusion: manual and ran them as slash commands:
/refresh-police-releaseruns the police.uk ingest, does a dry run of the database load, and compares the new report with the last one. The file also tells Kiro never to touch AWS in this workflow./check-upstream-releasesis read-only. It tells me if any source has a newer release.
Specs and one very long prompt
Two specs describe the work: .kiro/specs/data-ingestion.md for the ETL and .kiro/specs/map-and-ui.md for the map. They changed many times, because the data kept teaching me new things.
The largest job was the new data sources. For this, I wrote one long, careful prompt for Kiro. It is in docs/kiro-ingestion-prompt.md. First I tested each source with real requests. Then I wrote down what I found: file names, column names, and odd cases. For example, anti-social behaviour rows have no crime ID, and British Transport Police stopped publishing after January 2025. The prompt told Kiro to work like a senior data engineer: "When a source is ambiguous, stop and report; never guess."
The prompt also gave Kiro a fixed table of police.uk outcome wordings and told it to fail the run on any wording outside the table. Kiro did not have to guess, and neither did I.
How it works
Old Bailey XML and the police.uk monthly archive go into TypeScript ETL scripts. The scripts apply the rules once, place each record on the map, and build a SQLite database. A load script copies that build into a new DynamoDB table. The Next.js app reads it through three API routes. The app never calls a source while you browse.
The database CHECK constraints repeat the rules. A row with no verdict or no source cannot go into the database at all.
The current data build holds:
- 197,749 Old Bailey trials, about 121 million words of court record
- 32,486 charges with a place that we put on the map
- 36 months of police.uk street crime for the Met, the City of London Police and British Transport Police, with outcomes
- 1,127 judges' reports from the Digital Panopticon (1784 to 1827), with 448 of them linked to their trial
Challenges
The old court records name streets, not coordinates. "Fleet-street" in 1684 has to become a point on a modern map. I used the street names in today's police.uk data first, and Nominatim (OpenStreetMap) after that. Every answer goes into a cache in the repo, so a rebuild needs no new lookups. After about 1834 the XML stops marking places. For those years, the only clue is the wording of the charge.
The police data was harder than I expected. In October 2023 alone, the archive had 2,872 duplicate crime IDs. Outcome rows are dated by the outcome, not by the crime. Some crimes fall outside every neighbourhood. Each odd case became a rule in the code and a line in the ingest report. Nothing gets dropped without a count.
I also had to decide what not to show. Full transcripts name people who were found not guilty, inside the court text. I chose to keep the structured name fields empty for them. The rules make each of these choices visible in one place.
Accomplishments that I am proud of
A pin on Fleet Street opens a murder trial from 1684, with its verdict and a link to the original record. Beside it, you can see what that street looks like in police data today. Two records, 342 years apart, on the same few metres of pavement.
I am also proud of the guard rails. The hooks and the database constraints mean that the rules do not depend on my memory.
What I learned
I put values in steering, and I left code style out. A rule like "a person found not guilty is never shown as the culprit" is one short line, but it applies to every table, every API route and every panel.
Hooks turned my rules from advice into checks. And a prompt with verified facts gets better work than a prompt with guesses.
What's next
- Put more trials on the map. Most place names still need geocoding, and Nominatim allows one request per second.
- Add a historic map layer from the National Library of Scotland, so you can see the 1750s street plan under the pins.
- Add plain-English summaries of testimony with Amazon Bedrock, reviewed before they go live.
- Grow beyond the City of London to all of Greater London.
Data and credits
- Old Bailey Proceedings Online, 1674 to 1913: CC BY-NC 4.0. Casebook is non-commercial.
- police.uk street-level crime and outcomes: Open Government Licence v3.0.
- London Datastore, ONS boundaries, English indices of deprivation 2025: Open Government Licence.
- Digital Panopticon, Judges' Reports on Criminals: CC BY 4.0. Original records: The National Archives, HO 47.
- Map data from OpenStreetMap contributors, tiles by Stadia Maps.
Built With
- dynamodb
- kiro
- leaflet.js
- next.js
- react
- typescript
