001 · 2026
The Peruvian legal corpus, as git history
Peru publishes its laws, but not as data you can search, diff, or trust the history of. I helped build an engine that scrapes the whole corpus into Markdown and version-controls it with git — every reform a commit dated to the day the norm was actually published.
- Role
- Design engineer · scraping pipeline, web app, data model
- Status
- Open source · live · pre-1.0

Decision
Git as the versioning layer
Every legal reform is a commit dated to the norm's real publication date, so a plain `git log` on the 1993 Constitution replays its full 32-commit amendment history. The corpus lives in its own clean repo — just Markdown and git — so anyone can clone the raw data and build on top of it.
How it's built
Deterministic at scrape time
Peruvian portals are wildly inconsistent, so scraping runs through a three-fetcher cascade with a recon step captured once into a reproducible IR file — no LLM calls when it actually runs. The same corpus is then served three ways: a web app, a REST API, and an MCP server so AI clients can query the law directly.
Where it's at
It's live and open source, holding 21,244 norms across 26 jurisdictions today. Still pre-1.0 — the honest status is a growing corpus, expect breaking changes, not a finished product.