global-law README

README проекта с github.com/lexifina/global-law. Одним файлом markdown: README.md.

Git for Global Law

The world's law in one git history. Every word traced to the law that wrote it for any country and any date.

An expansion of the same for the US Code, #1 on Hacker News (28/10/26). Semantic, searchable law on a global scale.

https://github.com/user-attachments/assets/f24f3411-24d9-416a-8c45-9cebc817c64e

Free to use: CC0. Fork it, build on it, ship it in a product: no permission or credit needed. The law text sits in each country's repository, under that repository's own terms.

Each body of law is its own repository: a country's law (lexifina/germany-law), a state's or a city's (lexifina/germany-brandenburg-law), or a court's decisions (lexifina/germany-bgh-caselaw). In a dated history every commit is one law taking effect, written by that law; in case law, one decision on the day it was decided. Where the publisher keeps only today's text, or each law as first enacted, the corpus says so (history in manifest.json). This repository holds them all as submodules, arranged by jurisdiction, and moves each one forward to its latest commit. The tools read the In-force date of every commit, so they give the law of any country on any date that its record covers.

global-law/
├── manifest.json                       every corpus: path, repository, history, coverage and dates
├── jurisdiction.json                   the world, and the jurisdictions in it
├── germany/bund/acts/                  a country's law (submodule: lexifina/germany-law)
├── germany/brandenburg/acts/           a state's
├── argentina/buenos-aires/salto/acts/  a city's
├── germany/bgh/caselaw/                a court's decisions
├── tools/                              law.py, the MCP server, countries.py
└── …

Questions as commands

Question Command
Every change to 11 U.S.C. §1182, with the law that made each python3 tools/law.py log united-states/federal/usc/title-11/1182.md
Which law wrote each line of it today? python3 tools/law.py blame 2026-01-01 united-states/federal/usc/title-11/1182.md
§1182 as in force on 1 May 2022 python3 tools/law.py show 2022-05-01 united-states/federal/usc/title-11/1182.md
What changed between two dates python3 tools/law.py diff 2022-05-01 2022-07-01 united-states/federal/usc/title-11/1182.md
The last law in force in every country on a day python3 tools/law.py world 1990-10-03

Each corpus is also a plain git repository (git -C united-states/federal/usc log -- title-11/1182.md); the tools order versions by their In-force date, which matters where a record was not committed in that order.

Outside git, we also host this record publicly, for free:

Both assistants read the record through the free Global law connector (MCP, https://global-law.lexifina.com/mcp); the first time, the chat gives you the link that adds it. Ask in any language; for one country, add ?country=romania to either link.

Host it yourself easily. All it takes is git and Python, and the tools run on your machine:

git clone --depth 1 https://github.com/lexifina/global-law && cd global-law
python3 tools/countries.py add united-states/federal/usc
python3 tools/law.py show 2022-05-01 united-states/federal/usc/title-11/1182.md

Opened in Claude Code, Cursor, VS Code or Codex, the clone also starts a local MCP server with the same tools (MCP.md). FEATURES.md lists every command and FAQ.md how to clone.

Case law

Court decisions sit beside the law, one commit per decision on the day it was decided (switzerland/bund/caselaw), and are added on their own: python3 tools/countries.py add switzerland/caselaw. A decision is a ruling, not a law (Kind: court), so the tools leave it out of everything about law unless you name it. check_precedent says whether the text a decision applied is still in force, and resolve_citations reads citations in each country's usual form (§ 823 Abs. 1 BGB, article 1240 du code civil). manifest.json gives each court's coverage.

More

Videos

https://github.com/user-attachments/assets/6020acb1-53f3-4b65-94a4-fe132b867358

https://github.com/user-attachments/assets/6119b018-5f5b-4bab-a2da-0aad30ef585f

License

This repository is CC0. The law text is in each country's repository, under that repository's own terms.

global-law (lexifina/global-law)

Ищем в базе…

Что это такое?Git for Global Law превращает законы всех стран в единую историю git: корпус законов каждой страны — это подмодуль, а каждый коммит соответствует одному закону, вступающему в силу в ту дату, когда он стал законом.
Это библиотека кода или скорее набор юридических данных?Это структурированный набор юридических данных, оформленный как репозиторий git: корпуса стран подключены как подмодули, а для запросов есть инструменты командной строки на Python (law.py, mcpserver.py). Импортировать его как библиотеку кода нельзя.
Как мне на самом деле искать законы в этом репозитории?Склонируйте его вместе с подмодулями, затем либо запустите tools/mcpserver.py как сервер MCP для Claude или других клиентов MCP, либо используйте инструмент командной строки law.py, либо выполняйте обычные команды git по истории.
Что нужно установить, чтобы запустить сервер MCP или law.py?Нужны только Python 3.10+ и git; всё работает локально через stdio, никакие ключи API и внешние сервисы не требуются.
Есть ли у каждой страны здесь полный и актуальный закон?Нет, охват сильно различается: в одних корпусах есть полный свод законов страны, а другие покрывают лишь несколько актов или выборку, например девять титулов из US Code или только законодательство Великобритании об особых образовательных потребностях.
Сервер MCP отправляет мои юридические запросы куда-нибудь?Нет, он работает полностью на вашем компьютере и никогда не обращается к сети, поэтому ваши запросы остаются локальными.
Что я могу делать с этими данными?Сама собранная история git распространяется по лицензии CC0, так что её можно форкать, развивать и использовать коммерчески без разрешения и указания авторства; текст законов в репозитории каждой страны остаётся под собственными условиями этого репозитория.
Могут ли ассистенты на базе ИИ, например Claude, запрашивать это напрямую?Да, tools/mcpserver.py предоставляет 18 инструментов MCP только для чтения, так что Claude, Claude Desktop, Cursor или любой клиент MCP может спросить, что говорил закон на определённую дату, и получить ответ вместе с периодом охвата записи.
Как обрабатываются даты до появления git, например законы до 1970 года?Поскольку git не может хранить даты раньше 1970 года, ранние изменения (например, в Grundgesetz) получают последовательные даты коммитов 1970 года с интервалом в одну секунду; настоящая дата хранится в служебной строке In-force каждого коммита, и инструменты читают именно её, а не метку времени git.
Как построена вся история и как проверяется её корректность?tools/build.py детерминированно пересобирает репозиторий из опубликованных корпусов по странам, упорядочивая каждый коммит по дате вступления в силу; 48 тестов и описанная в REPRODUCE.md пересборка с полностью совпадающими хешами подтверждают результат.
Можно ли обойтись без инструментов Python и использовать только git?Да, команды вроде git log --first-parent, git grep --recurse-submodules и git diff --submodule=diff подходят для хронологии, полнотекстового поиска по странам и сравнения между датами, но вместо прямого переключения на старые коммиты лучше использовать git worktree.
Какие есть похожие проекты?romania-law, leis, china-travel-kit, houritsu, okf-agent-memory, claude-db, xerj, Hyper-Extract
Автор
lexifina
Размер
698.3 MB
Звёзды
2.1K
Обновлён
КоммитNov 18
Возраст
21 д
Коммиты · 90 дней