Commit Graph
119 Commits
Author SHA1 Message Date
CatoandClaude 4913a47792 feat(places): what a place is like, measured; how its law is changed; what changed (#533)
- Measured: the figures a reader acts on, chosen in config
  (PROFILE_FIGURES) and shown only where the place has a value: what the
  state takes and spends (OECD, else the World Bank's government
  consumption under its own label), four World Bank governance indicators,
  homicides. Each with its latest value and year, its position among the
  countries reporting that year (left out below 20; the ends said as
  highest and lowest), a 15-year sparkline and its source; chartkit's
  Meter and Sparkline.
- How its law is changed: the official routes of every authority from the
  place up, the same card an act's page shows.
- What changed lately: acts that took effect in the past year by the
  publisher's own date, newest first, with the count.
- The glance no longer repeats the routes; the law card says "below it",
  not "communes", for every place under a country; Russian sentences no
  longer put a place's name after a preposition undeclined.


Claude-Session: https://claude.ai/code/session_019MDtmuJdjaMYdbLjujoC3k

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-11 08:00:24 +01:00
CatoandClaude bb6fbffa2c feat(places): one page shape for every place, photographs for every subdivision, served by Solon (#532)
- The page: a hero with where the place sits, its kind, name, status line,
  headline facts and one main action (its constitution, else its law); below,
  the law and what a resident can do beside the place at a glance, which no
  longer repeats the hero. The same shape with or without a photograph.
- The places inside a place are photo tiles, the world index's tile, when most
  have a photograph. The world index opens on the Earth from Apollo 17 and is
  grouped by kind of place.
- Photographs for 9,296 places: places:photos --all reads every ISO 3166-2
  subdivision, Swiss commune, US state and county Wikidata holds; a Swiss
  canton's FSO number reaches its ISO code through a config crosswalk. Iran,
  Tanzania, Appenzell Ausserrhoden and Jura chosen by hand.
- Solon serves the photographs itself (/api/place-photo, place_photo_bytes):
  each Commons thumbnail read once, politely, kept across deploys. About one in
  sixteen tiles came up black when the image optimiser hit Wikimedia's limits.
  The places-data workflow reads the world list's photographs after a deploy.
- /credits pages through the place photographs.
- Fixed: the chat's "Thought for {time}" label threw a formatting error in
  every language.


Claude-Session: https://claude.ai/code/session_019MDtmuJdjaMYdbLjujoC3k

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-10 21:55:46 +01:00
CatoandClaude 8c27ece452 feat(places): every place opens on its photograph, and shares with it (#531)
- places:photos finds any place on Wikidata by its world entry or by an
  identifier whose scheme names a Wikidata property (ISO 3166-1/-2, FSO
  municipality, US FIPS), and chooses one free photograph from Commons:
  the original of its Wikivoyage banner, its image, aerial or night view,
  else a panorama as a strip. A person can replace any choice in one line.
- A full-screen hero on country, territory and subdivision pages: name,
  kind, capital, population, area, and the photo's author and licence.
- A share card for every place (/api/og/place) with its photograph.
- /credits lists every place photograph; the world index is a wall of
  photographs.


Claude-Session: https://claude.ai/code/session_019MDtmuJdjaMYdbLjujoC3k

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-10 21:12:42 +01:00
CatoandClaude 09b0a02928 feat(world,law): every place's profile, places beyond the UN on the map, more constitutions (#530)
- Kinds of place, by what each does (src/lib/config/world/kinds.ts): UN
  member (un.org's list, with admission), observer, self-governing, territory,
  proclaimed (one stated rule: Wikidata micronation, not dissolved, at least
  30 Wikipedias: Sealand, Liberland, Molossia, ...), special jurisdiction
  (Próspera), project (seasteading). They join the world list with pages,
  law authorities (keyed by slug) and places in the law plan.
- `pnpm run world:profiles` writes every place's facts from Wikidata (CC0)
  and the UN's list: data/world/profiles.json for pages, a small extras.json
  for the map. Area: the preferred figure, else the smallest (Taiwan's
  governed area, not its claim).
- A profile card on every country, territory, self-governing and proclaimed
  place page: its kind in a neutral sentence, capital, population, area,
  languages, currency, government, heads of state and government, UN
  admission or founding, website, the way into its constitution and law,
  and where the facts come from. Wikidata descriptions only for special
  jurisdictions and projects (they can judge: "Scheinstaat").
- The map: "All places" or "Beyond the UN", shading and dots, and a list by
  kind under the switch.
- Constitutions: the owner decided a law's text is never held back for want
  of a recorded copyright provision (LicenseRef-official-law; the country's
  own provision is cited where recorded). The copy reader follows indexes of
  editions (only from a short page, only to the same document), reads a
  constitution split into subpages whole, reads Markdown, cuts more article
  forms (Art. 1º, Article premier, Roman numerals, § only without articles,
  第一条, المادة/الفصل), and stops at a second printing. Liberland's
  constitution from its own repository.
- docs/design/2026-11-world-of-jurisdictions.md; roadmap, changelog.


Claude-Session: https://claude.ai/code/session_019MDtmuJdjaMYdbLjujoC3k

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-10 20:41:45 +01:00
CatoandClaude 68759b9847 feat(law): a plan for every country's law, and Russia's and Ukraine's constitutions (#529)
- A law authority for every country of the world list: listed ones keep
  their key; any other is its alpha-2 code, or alpha-3 where a canton holds
  the two letters (fra, geo, bel).
- The plan as data (data/law/plan.json, src/lib/law/plan): per country,
  the constitution in force by Constitute's index, candidate copies from
  Wikidata, the source chosen by an unambiguous rule or by a person with a
  reason, the provision of its own law that puts official texts outside
  copyright, the national readers. `pnpm run law:plan seed` re-reads the
  sources and keeps every person's decision; `pnpm run law:plan status`
  counts progress from the database and derives each country's next step.
- One reader for any country's constitution (law:text plan-constitutions):
  a Wikisource page through the REST API or any document copy (PDF/HTML),
  cut into articles for many languages, stored as status `copy` with who
  keeps it and the day read. Refused: no copyright basis recorded, too few
  articles, or a copy naming no year since the last recorded amendment. A
  copy attaches to the constitution a register already lists; a country
  whose constitution is held from its publisher is left alone. Waits as
  long as a 429 asks.
- Russia's Constitution (ru.wikisource, as amended in 2020: 137 articles
  and the five inserted) and Ukraine's (the Constitutional Court's copy,
  with the 2016 and 2019 amendments; uk.wikisource's was refused as older),
  with their routes: Russia Art. 134-136; Ukraine Art. 93, 154-157 and the
  people's referendum (Art. 72, 74). Licences: Russia Civil Code Art.
  1259(6), Ukraine Law No. 2811-IX Art. 8(1)(3).
- The act page says whose copy a text is. Law sync runs Russia's register
  and the plan's constitutions weekly.
- statistics sync test writes the metric it names, instead of relying on
  another file having done so first.
- docs/design/2026-11-law-of-every-country.md; roadmap, changelog.


Claude-Session: https://claude.ai/code/session_019MDtmuJdjaMYdbLjujoC3k

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-10 20:11:43 +01:00
CatoandClaude Opus 5.5 2829402aa0 feat(law,amend,contested): propose in Russian, Russia's register and routes, a pseudonym per proposal (#528)
* feat(contested,amend): a South Ossetian reader can propose a change in Russian

- Amend pages (write a change, support it, the official route) translated
  into Russian, French and Italian; AMEND_LOCALES now holds every language.
- "Propose terms" on a contested place led to the primary organization's
  form ("you are not a member of OrangeCat"). It now opens each side's law
  to pick the article, where amendments are filed and supported.
- The claimant's quotes, published only in English, read in the reader's
  language from the config catalog; their labels too. The coverage test
  holds them to every language.
- Roadmap: a scenario side (as a subject of the Russian Federation), "my
  life under each", Georgia's budget.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuJdjaMYdbLjujoC3k

* feat(law,amend): Russia's register, its official routes, and a pseudonym per proposal

- Pseudonyms: a signed-in person is named in the public amendment record by
  anon:<HMAC(key, proposal, account)>, never actor:<id>, so their proposals
  cannot be linked to each other or to them. Rows written earlier keep their
  name and are recognised as the same person. The filing rate limit moves
  into the process, so no lasting list of who filed is kept to count it.
  SOLON_PSEUDONYM_SECRET (falls back to the session secret).
- Russia: one reader over the official publication portal's JSON API
  (PRAVO_GOV_RU), one entry per authority: federal Constitution, laws on its
  amendment, federal constitutional and federal laws (8,012 acts), and North
  Ossetia–Alania's constitutional laws and laws (1,095). The portal's
  robots.txt disallows /File, where the scanned texts are, so the register
  only. Laws are not objects of copyright (Civil Code Art. 1259(6)).
- Routes: federal bills (Constitution Art. 104, citizens hold no initiative)
  and the Russian Public Initiative, federal and regional bars, each from the
  page opened; in Russian. An act page shows its official routes whether or
  not Solon holds its text.
- Authorities may carry their own names per language (North Ossetia–Alania).
- docs/research/2026-11-russia-sources.md; roadmap and changelog.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuJdjaMYdbLjujoC3k

* test(law): count only this file's acts in the South Ossetian dry-run check

Another integration file registers the Parliament's acts at the same time,
so counting every parliamentrso act raced it (CI: expected 8 to be 5).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuJdjaMYdbLjujoC3k

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-10 19:34:05 +01:00
CatoandClaude Opus 5.5 d3cd864ca5 feat(i18n,money): every page in the reader's language and one currency (#527)
* feat: one currency and one language for the reader; codes read from their Word files

Money: every amount on the budget and comparison pages is in the currency
the reader picks (?in=, CHF by default), converted at the budget year's
average rate, and the page says from what and whose rate. Rates are data
(data/money/rates.json, pnpm run money:rates): Eurostat's annual euro rates
for 151 currencies and, for the rouble after 2021, the Bank of Russia's
official rate averaged over the year. src/lib/money imports nothing from
Solon, ready to become the fleet's package. Eurostat budgets are now also
read in million euro beside the shares of GDP (generated from the same
taxonomies); a budget knows its GDP, so both show.

Language: a law in another language reads in the reader's, as a machine
translation labelled as one with the authentic text a click away. The
translations are a cache keyed by the sha256 of the words (text_translations,
migration 0030), each answer checked before it is kept (one per passage,
every number kept, no passage ballooned); titles in lists use it too, and
pnpm run law:translate fills titles ahead of readers. Places are named in
the reader's language when the data has the name (Tskhinval, not город
Цхинвал), their own names still listed.

Texts: a South Ossetian code printed as a page linking Word files is read
from the file worded as its text (never the contents file), with
word-extractor; --stubs reads again the acts held only as such a page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuJdjaMYdbLjujoC3k

* feat(i18n,money): every page in the reader's language and one currency

- Money defaults to US dollars; the reader's choice is remembered site-wide
  in a cookie (/api/preferences/currency) and used by budgets, contested
  places and the structures comparison, which now adds the reader's
  equivalent beside an amount quoted in its own currency.
- Configured words (statistics scales, tax forms, budget lines and their
  COFOG/ESA labels, source attributions, publishers) get their other
  languages from one catalog, data/i18n/config.json, keyed by the English.
  localized() and cite() read it; a test fails while any text a translated
  page shows lacks a language; pnpm run i18n:config reports gaps.
- Citations rewritten in English instead of mixed Russian/English; source
  lists show the localized attribution; budget document captions read in
  the reader's language with the original quoted below.
- The voting method lab and South Ossetia's legislative route translated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuJdjaMYdbLjujoC3k

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-10 17:28:03 +01:00
CatoandClaude a25b15a4a5 feat: one currency and one language for the reader; codes read from their Word files (#526)
Money: every amount on the budget and comparison pages is in the currency
the reader picks (?in=, CHF by default), converted at the budget year's
average rate, and the page says from what and whose rate. Rates are data
(data/money/rates.json, pnpm run money:rates): Eurostat's annual euro rates
for 151 currencies and, for the rouble after 2021, the Bank of Russia's
official rate averaged over the year. src/lib/money imports nothing from
Solon, ready to become the fleet's package. Eurostat budgets are now also
read in million euro beside the shares of GDP (generated from the same
taxonomies); a budget knows its GDP, so both show.

Language: a law in another language reads in the reader's, as a machine
translation labelled as one with the authentic text a click away. The
translations are a cache keyed by the sha256 of the words (text_translations,
migration 0030), each answer checked before it is kept (one per passage,
every number kept, no passage ballooned); titles in lists use it too, and
pnpm run law:translate fills titles ahead of readers. Places are named in
the reader's language when the data has the name (Tskhinval, not город
Цхинвал), their own names still listed.

Texts: a South Ossetian code printed as a page linking Word files is read
from the file worded as its text (never the contents file), with
word-extractor; --stubs reads again the acts held only as such a page.


Claude-Session: https://claude.ai/code/session_019MDtmuJdjaMYdbLjujoC3k

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-10 15:34:48 +01:00
CatoandClaude 32e7f6cb28 feat(budgets): public budgets as a product, on one model for every place (#525)
Budgets become their own section, /budgets and /budgets/<place>, built so
that every page and analysis works for any place and any source:

- Taxonomies are the single source (src/lib/config/budgets): COFOG for
  what money is spent on (80 codes, Eurostat's labels), ESA 2010 for where
  it comes from. They generate the budget.<scope>.<side>.<code> metrics and
  the per-country Eurostat sources; scope (general government or a state
  budget) is part of every key.
- Eurostat's government finance for 30 countries from 1995, through a new
  eurostat_json adapter (a JSON-stat reader that knows no country): spending
  by function and group, revenue by kind, the balance, in shares of GDP.
  Every division is also a statistic with its map and ranking. Reuse is
  authorised with acknowledgement (LicenseRef-eurostat-reuse).
- Budget laws are documents held to their stated totals: South Ossetia's
  2023 outturn (revenue line by line) and 2023 allocations by section, each
  line placed on the classifications, the placement explained.
- src/lib/budgets: one Budget shape for both inputs; pure analysis
  (breakdown with what the parts leave over, allowing for rounding; a total
  given with no breakdown; self-reliance; history; which year to show).
- Pages: key figures, who pays, spending by function opened into groups,
  revenue by kind, the years, sources down to the publisher's own lines,
  "propose a change to this budget"; a budget card on a country's page.
- The contested places' budget section now uses these components; their
  ledger, the quote component and rowsOf were made shared rather than kept
  as copies, and SITE_URL lives in site-config.

Design: docs/design/2026-11-budgets.md.


Claude-Session: https://claude.ai/code/session_019MDtmuJdjaMYdbLjujoC3k

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-10 15:04:10 +01:00
CatoandClaude Opus 5.5 e17536ddd1 Contested law: each side's budget, who may propose a law, taxes; the plan from comparison to change (#521)
* feat(places): contested law, one place's two sets of law side by side

Every place the world list marks as claimed (South Ossetia, Abkhazia,
Transnistria, Northern Cyprus, Somaliland, Kosovo) gets a comparison page at
/places/contested/<slug>: the same questions for every place, each side's own
words quoted in their language beside a translation, with the page and the day
read; a side with nothing read shows the gap. South Ossetia and Georgia are
compared from their constitutions on four questions (territory, citizenship,
moving and leaving, defence). /places/contested lists them all.

- Config: src/lib/config/places/contested.ts (topics in five languages, the
  contest, the quotes); schema and checks in src/lib/places/contested.ts;
  the pure view in src/lib/places/contest-view.ts.
- Every page of a claimed place says who claims it and links the comparison,
  which also restores the line the South Ossetia pack page lost when the world
  slug began redirecting to the pack.
- statistics:verify re-reads every quoted page weekly.
- Design: docs/design/2026-11-contested-law.md (why, as a system: rule sets
  competing for the same people, results per side, terms proposed with support
  counted per electorate; the plan for shared-area and layered disputes).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuJdjaMYdbLjujoC3k

* feat(places): what each side's budget rests on, who may propose a law, taxes

The South Ossetia comparison gains three things a resident can act on:

- Taxes, quoted from the Tax Code (Part Two) the Parliament publishes as a
  Word file: 12% on a person's income (Art. 228), 20% on profit (Art. 286),
  10% VAT (Art. 166); Georgia's rates from PwC's summary, cited as a summary.
- Who may propose a law: South Ossetia's Constitution gives the right to the
  President, deputies, the Government and named bodies, not to citizens
  (Art. 69); Georgia's to 25,000 voters among others (Art. 45). South
  Ossetia's official route is now data: a bill reaches the Parliament through
  any one deputy.
- The 2023 budget as its execution law states it, as a ledger whose lines
  must add up to the stated total: 81% of revenue was aid from the Russian
  Federation; own revenue covered 18.5% of spending; spending the same from
  own revenue alone would take 5.4 times that revenue or 81.5% less spending.
  Arithmetic on the law's figures, labelled as not a forecast.

Every held article on the page links "propose a change". A quote in the
reader's own language is shown without a translation.

docs/design/2026-11-from-comparison-to-change.md: the three columns (now,
the other side, could be), the loop from reading the law to changing it and
the gap at each step for South Ossetia, the safety work needed before Solon is
promoted where proposing is risky (the public amendment log names the account
behind every act today), credibility by electorate, and the build order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuJdjaMYdbLjujoC3k

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-10 14:25:55 +01:00
CatoandClaude 7fc644dbb1 feat(places): contested law, one place's two sets of law side by side (#520)
Every place the world list marks as claimed (South Ossetia, Abkhazia,
Transnistria, Northern Cyprus, Somaliland, Kosovo) gets a comparison page at
/places/contested/<slug>: the same questions for every place, each side's own
words quoted in their language beside a translation, with the page and the day
read; a side with nothing read shows the gap. South Ossetia and Georgia are
compared from their constitutions on four questions (territory, citizenship,
moving and leaving, defence). /places/contested lists them all.

- Config: src/lib/config/places/contested.ts (topics in five languages, the
  contest, the quotes); schema and checks in src/lib/places/contested.ts;
  the pure view in src/lib/places/contest-view.ts.
- Every page of a claimed place says who claims it and links the comparison,
  which also restores the line the South Ossetia pack page lost when the world
  slug began redirecting to the pack.
- statistics:verify re-reads every quoted page weekly.
- Design: docs/design/2026-11-contested-law.md (why, as a system: rule sets
  competing for the same people, results per side, terms proposed with support
  counted per electorate; the plan for shared-area and layered disputes).


Claude-Session: https://claude.ai/code/session_019MDtmuJdjaMYdbLjujoC3k

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-10 14:02:51 +01:00
Cato 3b0e2a86d5 South Ossetia: the Republic's own copyright law admits the Parliament's texts (#512)
Law of the Republic on copyright and related rights (12 December 2012, no. 64),
Art. 8: laws, court decisions and other legislative, administrative and judicial
texts are not objects of copyright. Found by reading the titles of all 575 acts
in the Parliament's listings; quoted on a new licence entry. The Parliament's
texts are admitted, the register's counts are now exact (480 laws, 33
constitutional laws, 62 resolutions).
2026-11-10 12:11:22 +01:00
Cato b469b0552a Law: an act's status can be 'not stated by the publisher'; South Ossetia's acts are recorded so (#499)
* Law: an act's status can be 'not stated by the publisher'; South Ossetia's acts are recorded so

legal_acts.status_stated (default true, migration 0025). When false, in_force
only keeps the act findable and no page, count, Markdown or tool calls it in
force: coverage counts it apart, the place tree still lists the place, act
rows and pages say the status is not stated, in five languages. The register
importer takes statusStated per row and updates it; the South Ossetia
registers set it false.

* Law counts: say that an act with no stated status is counted
2026-11-10 11:55:21 +01:00
Cato 39ddbf253f South Ossetia: text reader for the President's decrees (and the Parliament's, held back) (#500)
* South Ossetia: text reader (L1) for the Parliament's acts and the President's decrees

A node page or post cut into preamble, chapters and articles, dated by the
Parliament's own date field or the decree's closing lines, numbered from the
header or closing lines when it prints one (act_number, <year>/<number>).
Commands law:text parliamentrso-text|presidentruo-text, paced by the site's
crawl-delay and a second respectively; verify reads only the act's body on a
Drupal page. Fixtures from the live pages, unit and database tests.

* South Ossetia: text reader (L1): the President's decrees stored, the Parliament's refused until its terms are found

A node page or post cut into preamble, chapters and articles, dated by the
Parliament's date field or a decree's closing lines, numbered <year>/<number>
(act_number) when the act prints one. law:text presidentruo-text and
parliamentrso-text, --act to read chosen ids, paced by the site's crawl-delay
and a second. The Parliament's texts are refused while its config says no
terms admit them. verify reads only the act's body on a Drupal page.
2026-11-10 11:32:50 +01:00
CatoandClaude Opus 5.5 7dcbdc2787 Places, statistics, navigation and a new mark: the globe, every country a place, methods, gaps, research with AI, a header that fits, the owl (#458)
* feat(places): a globe that names the world, and zooms where you point

geo-kit 0.4.0 labels; countries, subdivisions (Natural Earth 1:10m) and
every place of 1,000+ people (GeoNames, CC BY 4.0) loaded a country at a
time; blue sea, land on the page surface, light and dark; credit line
names the sources and how to steer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmsX15QgjkDp9MQaQ92

* feat(statistics): how the rankings are made; one country registry

Nine indexes of freedom and governance described the same way, with
quoted licence terms, what is unread, the same critical questions per
kind, and checked AI explanation from what was read. Country codes for
the law globe, statistics map and OECD sources come from one registry
generated from Natural Earth; a test ties every named country to it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmsX15QgjkDp9MQaQ92

* fix(places): calm labels on geo-kit 0.5.0, towns actually drawn, land never drawn as sea

Quiet type hierarchy with room per style; zoom buttons kept clear;
subdivisions and states painted on their own layers; GeoNames towns were
loaded but never added to the labels (a patch had not applied), and the
loaders no longer drop a fetch when the view changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmsX15QgjkDp9MQaQ92

* feat(places): every country a place; governance scores for all

A world pack of 235 countries generated from the registry, World Bank
indicators for each and OECD tax series for its 38 members, staggered so
no publisher sees a burst; six World Bank governance scores (CC BY 4.0)
on a governance dimension; a rate fixed by law is no longer flagged for
staying put; the importer names itself and paces the OECD.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmsX15QgjkDp9MQaQ92

* feat(statistics): deep research with AI over Solon's data and law

A model with read-only tools (catalog, series, dimensions, methods, law,
and the web where configured) gathers numbered sources; the report is
written from them alone and checked: numbers, citations, paragraphs,
verdict words. Failing reports are dropped; sources stay listed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmsX15QgjkDp9MQaQ92

* fix(places): the world pack has one root, so countries are world/<name>

235 nations in one pack each claimed the root path; Andorra became
'world'. A root place (the Earth) now holds them, as other packs hold
their subdivisions.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmsX15QgjkDp9MQaQ92

* test(places): the world pack's data has one root

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmsX15QgjkDp9MQaQ92

* docs(roadmap): second-level subdivisions need a licence read per country

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmsX15QgjkDp9MQaQ92

* feat(statistics): code compulsory old-age provision for CH and US

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmsX15QgjkDp9MQaQ92

* fix(places): the OECD answers a plain request, not Node's default

Its gateway returned 500 for accept-language: * and 200 for a plain
language and a data type (found by trying headers one at a time; the
earlier rate-limit explanation was wrong). The importer now sends
accept and accept-language; the 6 s OECD pacing and the five-minute
stagger are gone.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmsX15QgjkDp9MQaQ92

* feat(statistics): what is measured, and where it is not

A registry and pages for the places where statistical offices collect and
publish different things: per topic and breakdown, what each office's own
pages say (checked weekly), the law that frames it, where a gap lies, what
must accompany a new measure, the objections with safeguards, who decides.
First topic: crime by a person's background, nine places; descriptive, no
characterisation of offices or people.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmsX15QgjkDp9MQaQ92

* feat(site): a header that fits, Find over everything, an engineering audit

Four panels of four or five links (Law, Places, Data, Governance) instead
of 27, a Find palette over pages, statistics, places and laws (Ctrl/Cmd+K
or /), the phone menu as folds. Six import cycles fixed and gated in
verify; docs/design/2026-11-engineering-audit.md records what was measured,
the one-source map and the debt in order.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmsX15QgjkDp9MQaQ92

* feat(brand): the owl, and one drawing behind every place the mark appears

Solon's mark is now Athens' little owl (the bird on the coins of Solon's
city) with the fleet's rotorelief rings for eyes: the Cat's sibling, where
the old balance was a line icon from no family.

brand/solon-mark.svg is the only drawing. `pnpm run brand` writes the
mark data (header, footer, share card), the favicon, the app icons and
the deck/press exports from it; a test fails when a copy drifts. The
candidates it was chosen over are in brand/concepts with the reasons.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmsX15QgjkDp9MQaQ92

* docs(brand): where the marks should live next, and why a copy remains

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmsX15QgjkDp9MQaQ92

* test(e2e): follow the curated header and the folded phone menu

The phone menu folds the site by section (only the current one opens), so
the test opens Platform before it looks for Security. The Governance
panel no longer carries the ideas page (the footer does); the panel test
follows Decisions instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmsX15QgjkDp9MQaQ92

* refactor(law): name an authority by its place, in the reader's language

Law authorities hand-wrote 80 English names ("Confederation", "Zürich")
for places Places already names in every language. Pages now read the
place's own name (loadAuthorityNames, once per request); a country with no
place yet is named by Intl, the cantons together and the European Union
from messages, and two places of one name get their level ("Zürich
(Gemeinde)"). The config's field is now `label`: English, for logs, the
API, llms.txt and prompts only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmsX15QgjkDp9MQaQ92

* feat(brand): one statement of what Solon is, on the card, in search and on the phone

The share card, the meta description and the app manifest each carried
their own line about Solon, and all three still described governance
alone. They now read the home page's hero (Home.hero), in the reader's
language: the card is per locale, set in Inter from the design-tokens
package (Cyrillic included, nothing fetched), with the owl, and sizes its
headline so every language fits on two lines. Meta.description is gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmsX15QgjkDp9MQaQ92

* fix(brand): the owl favicon is linked, and iOS gets its own icon

The layout's explicit `icons` replaced Next's file convention, so the
generated icon.svg was never linked and only favicon.ico was. Without it,
Next links favicon.ico, icon.svg and apple-icon.png (180, full bleed,
written by `pnpm run brand -- --png` like the others).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmsX15QgjkDp9MQaQ92

* Test: the world pack's own root is not a reserved path segment

Claude-Session: https://claude.ai/code/session_019MDtmsegw9dJ7eykLcT7Fe

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-10 11:11:37 +01:00
CatoandClaude Sonnet 5.5 57b0be27a8 Design: every place at every level, one model, one page, one map behaviour (#486)
* Design: every place at every level, one model, one page, one map behaviour

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmsegw9dJ7eykLcT7Fe

* Design: acceptance criteria from the 2026-11-10 QA walk, each mapped to a step

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmsegw9dJ7eykLcT7Fe

* Design: the globe sidebar's count is part of the count-contradiction item

Claude-Session: https://claude.ai/code/session_019MDtmsegw9dJ7eykLcT7Fe

* Design: what a real browser showed, and QA 8 is already #458's

Claude-Session: https://claude.ai/code/session_019MDtmsegw9dJ7eykLcT7Fe

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 11:00:31 +01:00
Cato 8e7fc9cada South Ossetia: register of acts (L0) from the Parliament's listings and the President's API (#487)
Authority `rso` (place Wikidata Q23427, topLevel: no ISO code, and `so` is
Solothurn's). Two format readers, config-driven: a Drupal taxonomy listing
(Parliament, honours the 90 s crawl-delay) and the WordPress REST API
(President, 1,849 acts with decrees, documents and treaties under one id).
Fixtures from the live pages, unit tests and a database integration test;
commands `law:text parliamentrso|presidentruo` and the two workflows' lists.
Licence entry for the President's site quoting its reuse page.

Claude-Session: https://claude.ai/code/session_019MDtmuWnz7uS87NvSiDSDs
2026-11-10 10:49:12 +01:00
Cato f48c443671 South Ossetia: sources research note and the place's structure (#484)
* South Ossetia: research note and the place's structure (pack, Wikidata scheme, five units)

Adds the sources research note (publishers, reachability from a runner, counts
measured, statistics read, gaps) and the first rows of the place: a pack with no
ISO code (identified by Wikidata), the five administrative-territorial units of
Constitution Art. 3 para. 2 as part_of the nation, names with the authority's
own Russian first. Claims, administration and recognitions follow as their own
sources, once the world backbone rows they point at are on main.

Claude-Session: https://claude.ai/code/session_019MDtmuWnz7uS87NvSiDSDs

* South Ossetia research note: recognitions, Georgia's own wording, what the place model needs

Claude-Session: https://claude.ai/code/session_019MDtmuWnz7uS87NvSiDSDs
2026-11-10 10:11:27 +01:00
CatoandClaude f7ead78789 feat(statistics): exit dimension coded from law; index licences read (#457)
Rubrics exit.renounce_citizenship and exit.departure_tax; CH, EE, US
codings from BüG, KodS, 8 USC 1481 and 26 USC 877A. Licence findings
for ten freedom indexes recorded.


Claude-Session: https://claude.ai/code/session_019MDtmsX15QgjkDp9MQaQ92

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-09 11:42:30 +01:00
CatoandClaude 83093c5dbf feat(statistics): screen charts for sense, and explain pages with checked AI (#456)
Figures outside a metric's plausible band are left out and listed; misleading
comparisons carry a warning. Each page's figures become numbered facts; an AI
explanation is written from them only and dropped unless every number and
citation is in them.


Claude-Session: https://claude.ai/code/session_019MDtmsX15QgjkDp9MQaQ92

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-09 11:17:33 +01:00
CatoandClaude Sonnet 5.5 33d8a690cd Statistics: coded assessments and the compulsion dimension (#453)
* feat(statistics): the law beside the numbers — series, law links, timelines, axes, saved views

Implements the roadmap section {#stats} (docs/design/2026-11-freedom-laws-statistics.md):

- Series as facts: a `statistic` block on metrics (definition, publisher,
  series code); World Bank (WDI API) and OECD (SDMX) adapters; five series
  for CH, LI, EE and US, read monthly; a publisher's 5xx is retried twice.
- An append-only `statistic_records` log for law links, events and
  enforcement, written from a curated, source-checked list by
  `statistics:sync` and the daily places cron; three links checked against
  Fedlex and Riigi Teataja.
- /statistics (ranked bars, axes with reader or group weights),
  /statistics/<metric> (line chart, a timeline of linked acts' versions over
  the same years, the law, enforcement, sources), /statistics/view/<sha256>;
  on @bitbaum/chartkit; five languages.
- Saved views under the sha256 of their spec; a proposal that links one
  carries it as evidence (proposal_evidence), attached in the same
  transaction.
- Roadmap and changelog updated; what remains is listed with its reason.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmsX15QgjkDp9MQaQ92

* feat(statistics): law event pages, clickable timelines, maps, scatter, parallel coordinates, reader-built axes

- Events: what changed (wording before/after), how it came about, votes with
  party breakdowns, who initiated/sponsored/recommended/opposed, claims and
  critiques kept apart from what happened, each line with the page it was read
  on; five loaded (Estonia 2023, US TCJA 2017, two Swiss firearms ballots,
  Kennesaw 1982). /statistics/event/<slug>, /statistics/events; timeline marks
  open them; the numbers around an event (line cut at the change, peers apart,
  a before/at/after table).
- Numbers that mean the same everywhere: central-government-only series
  retired for all-levels OECD series; a per-statistic scope sentence; central
  share of tax as a decentralisation proxy; SDMX series told apart by `match`.
- A world map per statistic on geo-kit, /statistics/compare scatter, parallel
  coordinates per axis, a reader-built axis kept in the link, saved axes.
- Fetch: four retries with backoff and a pause between a source's requests.
- Tests, roadmap, changelog and design note updated.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmsX15QgjkDp9MQaQ92

* feat(statistics): coded assessments and the compulsion dimension

A rubric registry and an assessment record kind in the append-only log.
A coding names its rubric version, a point of the written scale, the
provisions and quotes it was read from, a confidence and its reason, and
is settled only when someone other than the coder has reviewed it.
First codings, from statutes: compulsory military service in CH, EE, US.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmsX15QgjkDp9MQaQ92

* feat(statistics): coded assessments and the compulsion dimension

A rubric registry and an assessment record kind in the append-only log.
A coding names its rubric version, a point of the written scale, the
provisions and quotes it was read from, a confidence and its reason, and
is settled only when someone other than the coder has reviewed it.
First codings, from statutes: compulsory military service in CH, EE, US.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmsX15QgjkDp9MQaQ92

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-09 10:06:14 +01:00
CatoandClaude Sonnet 5.5 c50c65fffa Statistics: law, practice and outcome as layers, data-integrity plumbing, and the freedom framework (#452)
* feat(statistics): the law beside the numbers — series, law links, timelines, axes, saved views

Implements the roadmap section {#stats} (docs/design/2026-11-freedom-laws-statistics.md):

- Series as facts: a `statistic` block on metrics (definition, publisher,
  series code); World Bank (WDI API) and OECD (SDMX) adapters; five series
  for CH, LI, EE and US, read monthly; a publisher's 5xx is retried twice.
- An append-only `statistic_records` log for law links, events and
  enforcement, written from a curated, source-checked list by
  `statistics:sync` and the daily places cron; three links checked against
  Fedlex and Riigi Teataja.
- /statistics (ranked bars, axes with reader or group weights),
  /statistics/<metric> (line chart, a timeline of linked acts' versions over
  the same years, the law, enforcement, sources), /statistics/view/<sha256>;
  on @bitbaum/chartkit; five languages.
- Saved views under the sha256 of their spec; a proposal that links one
  carries it as evidence (proposal_evidence), attached in the same
  transaction.
- Roadmap and changelog updated; what remains is listed with its reason.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmsX15QgjkDp9MQaQ92

* feat(statistics): law event pages, clickable timelines, maps, scatter, parallel coordinates, reader-built axes

- Events: what changed (wording before/after), how it came about, votes with
  party breakdowns, who initiated/sponsored/recommended/opposed, claims and
  critiques kept apart from what happened, each line with the page it was read
  on; five loaded (Estonia 2023, US TCJA 2017, two Swiss firearms ballots,
  Kennesaw 1982). /statistics/event/<slug>, /statistics/events; timeline marks
  open them; the numbers around an event (line cut at the change, peers apart,
  a before/at/after table).
- Numbers that mean the same everywhere: central-government-only series
  retired for all-levels OECD series; a per-statistic scope sentence; central
  share of tax as a decentralisation proxy; SDMX series told apart by `match`.
- A world map per statistic on geo-kit, /statistics/compare scatter, parallel
  coordinates per axis, a reader-built axis kept in the link, saved axes.
- Fetch: four retries with backoff and a pause between a source's requests.
- Tests, roadmap, changelog and design note updated.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmsX15QgjkDp9MQaQ92

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-09 09:40:57 +01:00
CatoandClaude Sonnet 5.5 568fc14323 Statistics beside the law: series, law events, timelines, maps, axes and saved views (#441)
* feat(statistics): the law beside the numbers — series, law links, timelines, axes, saved views

Implements the roadmap section {#stats} (docs/design/2026-11-freedom-laws-statistics.md):

- Series as facts: a `statistic` block on metrics (definition, publisher,
  series code); World Bank (WDI API) and OECD (SDMX) adapters; five series
  for CH, LI, EE and US, read monthly; a publisher's 5xx is retried twice.
- An append-only `statistic_records` log for law links, events and
  enforcement, written from a curated, source-checked list by
  `statistics:sync` and the daily places cron; three links checked against
  Fedlex and Riigi Teataja.
- /statistics (ranked bars, axes with reader or group weights),
  /statistics/<metric> (line chart, a timeline of linked acts' versions over
  the same years, the law, enforcement, sources), /statistics/view/<sha256>;
  on @bitbaum/chartkit; five languages.
- Saved views under the sha256 of their spec; a proposal that links one
  carries it as evidence (proposal_evidence), attached in the same
  transaction.
- Roadmap and changelog updated; what remains is listed with its reason.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmsX15QgjkDp9MQaQ92

* feat(statistics): law event pages, clickable timelines, maps, scatter, parallel coordinates, reader-built axes

- Events: what changed (wording before/after), how it came about, votes with
  party breakdowns, who initiated/sponsored/recommended/opposed, claims and
  critiques kept apart from what happened, each line with the page it was read
  on; five loaded (Estonia 2023, US TCJA 2017, two Swiss firearms ballots,
  Kennesaw 1982). /statistics/event/<slug>, /statistics/events; timeline marks
  open them; the numbers around an event (line cut at the change, peers apart,
  a before/at/after table).
- Numbers that mean the same everywhere: central-government-only series
  retired for all-levels OECD series; a per-statistic scope sentence; central
  share of tax as a decentralisation proxy; SDMX series told apart by `match`.
- A world map per statistic on geo-kit, /statistics/compare scatter, parallel
  coordinates per axis, a reader-built axis kept in the link, saved axes.
- Fetch: four retries with backoff and a pause between a source's requests.
- Tests, roadmap, changelog and design note updated.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmsX15QgjkDp9MQaQ92

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-09 09:15:42 +01:00
CatoandClaude d1b06d5c9f Cut 'Article N – Title' headings into articles; re-cut held municipal PDFs (#439)
A commune's regulation whose headings put a dash between the number and the
title (Neuchâtel) was stored as one block. The cutter accepts the dash, and
recut-municipal cuts the held PDFs again from their snapshots.


Claude-Session: https://claude.ai/code/session_019MDtmsWmge2YFXGRyA2au4

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-08 14:59:04 +01:00
CatoandClaude 79cbd7760e docs(roadmap): the law beside the numbers — statistics, enforcement, axes and charts (#438)
Records the owner's direction for a statistics, enforcement and
visualization layer: series as facts in the existing places model, links
from data to provisions, enforcement as attributed assertions beside the
statute, law events read from act versions, axes and weights as versioned
policies rather than a Solon score, chartkit/geo-kit charts traceable to
source and statute, saved views as proposal evidence. Narrated explainers
recorded under Later.


Claude-Session: https://claude.ai/code/session_019MDtmsX15QgjkDp9MQaQ92

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-08 14:58:19 +01:00
CatoandClaude Opus 5.5 cfdd8267a8 Law: Genève, Lausanne, Köniz, Fribourg, Neuchâtel, Lugano and Bellinzona from the pages they link their acts from (#432)
* Law: Köniz, Fribourg and Neuchâtel from the page each links its acts from

Three of Switzerland's twenty most populous communes link their regulations
as PDFs from one page of their own, the way Liechtenstein's communes do, so
each is a config of the linked-documents adapter. The adapter now takes the
commune's language (Fribourg and Neuchâtel are read in French) and may leave
out documents by their address, as Köniz marks acts adopted but not yet in
force, and repealed ones, only in the file's name. Tests use the documents'
real addresses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmsWmge2YFXGRyA2au4

* Law: Lugano and Bellinzona from the page each links its acts from

Ticino's two largest communes link their regulations from one page each:
Lugano's "Legislazione", whose act pages (/law/<id>/<title>) serve the PDF,
and Bellinzona's "Legislazione comunale", whose files are served by document
id. Both are configs of the linked-documents adapter, read in Italian, with
what Ticino's communes call an act and what a form or a message. Tests use
the documents' real addresses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmsWmge2YFXGRyA2au4

* Law: Genève and Lausanne; a commune's list may run past 40 pages

Genève lists its about 250 municipal regulations ten to a page, each with
its file or its own page; Lausanne lists about 190 acts, each with its own
entry and a file served by id. Both are configs of the linked-documents
adapter, read in French. The adapter now opens as many pages as a config
says (maxPages, 40 unless said), skips a page after the first that cannot be
read instead of failing the whole list, and knows French and Italian download
buttons, so a button-only link is titled by its title attribute.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmsWmge2YFXGRyA2au4

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-08 12:26:12 +01:00
CatoandClaude 209748197a Law: one reader for communes on the i-web CMS; Luzern, Thun, Chur, Schaffhausen and Sion (#431)
Five of Switzerland's twenty most populous communes publish their
collection through the i-web CMS's legal module. The new adapter
(publishers/iweb.ts) is config-driven like linked-documents: the pages that
hold the collection and which links lead to more of it. It reads the list
from the table's data-entities JSON, each act's in-force and end days and
earlier versions from its page's <dl> (German and French labels), the
document from the page's own table, and an earlier version's file past the
notice i-web puts in front of it.

The module's shape comes from two public readers of i-web sites, as none of
the cities could be opened from the sandbox; the fixtures say so. Unit tests
cover the parsing and the adapter, an integration test loads a collection end
to end with history. Names in the cities' languages are aliases, so a
question about Lucerne or Coire asks the city's law with the canton's.


Claude-Session: https://claude.ai/code/session_019MDtmsWmge2YFXGRyA2au4

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-08 12:12:36 +01:00
CatoandClaude Opus 5.5 93082c148a Law: Winterthur, St. Gallen and Biel/Bienne from their LexWork collections (#430)
* Law: Winterthur, St. Gallen and Biel/Bienne from their LexWork collections

Three of Switzerland's twenty most populous communes keep their systematic
collections on LexWork (winterthur.tlex.ch, st.gallen.tlex.ch,
biel-bienne.tlex.ch), the platform Solon already reads for Zug's and
Glarus's communes. Each is a commune authority within its canton, with the
names people use for it, and a configured collection. A test holds every
configured collection to a commune the register knows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmsWmge2YFXGRyA2au4

* Design: the LexWork section names the three cities added

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmsWmge2YFXGRyA2au4

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-08 11:38:00 +01:00
CatoandClaude 8ea236862f Design: the 2026-11-08 direction, as principles (#417)
The owner's direction after seeing the globe and the Places map side by
side, recorded beside the 2026-11-06 direction: the legal puzzle of the
world shown layer by layer with local rules first-class, exit easy, one of
each thing, find the law rather than report it blocked, AI that helps the
citizen act, building in public, packages by default, robust plumbing.
Marked as guidance, not copy: Solon's own words stay neutral.


Claude-Session: https://claude.ai/code/session_019MDtmsWmge2YFXGRyA2au4

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-08 08:44:32 +01:00
CatoandClaude 36536730c5 Light theme: follow the device, or the reader's pick in the header (#414)
Solon was pinned to dark. The shared tokens already carry both themes
(:root light, .dark overrides), so this decides which one is on:

- src/components/theme/: the choices, a head script that sets the `dark`
  class, `data-theme` and `color-scheme` before the first paint (no flash),
  and a header toggle (Light / Dark / Device) kept in localStorage. No
  framework or Solon name in theme.ts, so it can move into
  @bitbaum/design-tokens ({#theme-package}).
- <html> drops the pinned class and carries suppressHydrationWarning.
- Photographs stay dark on purpose: FullBleed and AudienceTile wear `dark`,
  and the transparent header over a page that opens on a photograph does
  too (HEADER_OVER_PHOTO_ROUTES, held to the pages by a test).
- Bands that used bg-surface-public (near-black in both themes) use a new
  `.band`: the public surface in dark, white in light. The footer too.
- bip-kit's variables are set in both themes, not only under html.dark.
- The law globe reads its tokens again when <html>'s class changes.
- text-white and text-green-400 replaced by tokens.
- Toggle words in all five languages; e2e check of device, pick and reload.
- Docs: ui-guidelines theme section, CLAUDE.md, AGENTS.md, README, ROADMAP
  {#themes}, CHANGELOG {#theme-light}.


Claude-Session: https://claude.ai/code/session_019MDtmsWmge2YFXGRyA2au4

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-08 08:38:24 +01:00
CatoandClaude f514bff14b Law: read a refusing publisher from the Internet Archive's dated copy; Triesenberg (#413)
When a publisher's page or document answers with a refusal (HTTP 403, 429,
503, or a bot-check page such as LiteSpeed's "Bot Verification"), the
publisher reader asks the Wayback Machine for its newest capture and reads
the raw bytes (id_). Solon keeps its own user agent and solves nothing.

Links in a captured page resolve to the publisher's addresses, so the act's
identity stays the official URL. A version read from a copy records the
copy's address (web.archive.org/web/<timestamp>id_/<original>) as its
source, which names the archive and the capture day, so no migration is
needed; the importer version is marked +archive. The act page says "Copy
read on {date} from the Internet Archive's copy of {captured}" in all five
languages, the Markdown and the search tool name the copy apart from the
publisher's page.

Triesenberg (li7004) is configured as a WordPress commune and is the first
read this way. The ask-scope test now uses Bern (BFS 351) as a commune
without a collection.


Claude-Session: https://claude.ai/code/session_019MDtmsWmge2YFXGRyA2au4

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-08 08:29:14 +01:00
CatoandClaude 8156da240b The engine for amending the law (#401)
Anyone can propose a change to an act Solon holds, and the record of it
cannot be quietly rewritten (design: docs/design/2026-11-amending-the-law.md).

- Changes are replace / insert / repeal on one provision each (Akoma Ntoso's
  textual modifications), each pinned to the sha256 of the exact text it
  amends; changes that do not fit the text in force are refused with the
  reason, and an amendment whose text the publisher later changes is shown
  as outdated rather than silently re-applied
- Revisions are immutable and carry a content hash; support binds to one
  revision, by account or by a Bitcoin signature anyone can recount; anyone
  may fork, and the lineage is kept
- Every act is an event in one hash-chained log (verifyChain recomputes it);
  triggers make the database refuse any UPDATE or DELETE on all four tables
- The redline is computed word by word (jsdiff; the fleet has no diff package)
- Official routes as sourced data: the federal popular initiative (Art. 139)
  and petition (Art. 33) to start; each amendment shows the routes its act
  can take
- Abuse limits: 20 filings an hour per author; a support that changes
  nothing is refused
- API under /api/v1/law/amendments; 27 integration tests against Postgres,
  and the full integration suite passes on a fresh database


Claude-Session: https://claude.ai/code/session_019MDtmsWmge2YFXGRyA2au4

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-06 16:04:34 +01:00
CatoandClaude Opus 5.5 a7cdf46f40 Put the law in the main menu and lead with it (#400)
* Put the law in the main menu and lead with it

Production has held the text of every federal, cantonal and Liechtenstein
act in force since 2026-11-01, but /law was in neither the header nor the
footer, and the roadmap and coverage page still said the text was not held.

- Law is a header panel (find, ask, what Solon holds); use cases move to
  the footer to keep the header at four panels
- The home page leads with the open law; the Glarus section becomes one
  root among three (open assembly, public ledger, forkable rules)
- The ideas page adds the public ledger, rules as open source and
  polycentric law
- The coverage page and ROADMAP.md say what production holds; the roadmap
  gains "Law you can act on", the globe, Wyoming, exit/fork and a provable
  record
- docs/design/2026-11-global-law-and-exit.md records the direction and order

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmsWmge2YFXGRyA2au4

* Point the header e2e test at a panel that is still in the header

Use cases moved to the footer, so the panel-navigation test now opens
Governance and follows its ideas link.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmsWmge2YFXGRyA2au4

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-06 14:43:45 +01:00
CatoandClaude Sonnet 5.5 2e47306422 feat(law): search goes through searchkit (typos forgiven, titles ranked, did-you-mean) (#383)
* feat(law): read scanned commune acts by OCR, and never drop text before a late first article

A commune that publishes a scan (pages as pictures, no text layer) failed as
"no text in the PDF": Vaduz 5, Schaan 4, Eschen 2, Schellenberg 2. The
commune loader now draws each page (unpdf + @napi-rs/canvas) and reads it with
tesseract.js in the act's language, in process: nothing to install on the box,
no model called. The version's source says so: law-text-publisher-1+ocr.

Schellenberg's hall regulation numbers sections "1." and "2." before an
"Art. 3"; the cutter kept Art. 3 and dropped the rest. When the first article
found is not article 1, the text before it is now kept as one provision.

Live on schellenberg.li: both scans read (2 of 2), 6 acts, 106 provisions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* fix(law): an act's page address follows the register when the publisher's address changes

An act first listed at a wrong address kept it for ever: the register import
added a page address only for a new act. Schellenberg's 35 acts were first read
without the page's <base href> (fixed in #361) and stayed at /service/files/...,
so the load kept fetching a web page instead of the PDF ("Invalid PDF
structure" x35), and the official page shown to readers was a dead link.

For a known act, a different official_url now supersedes the old one and the
new is current; unchanged is untouched. Reproduced locally with stale
addresses: 35 corrected, 3 acts loaded, 55 provisions.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* fix(law): store a PDF's NUL as a space, and find Lilex pages the issue number does not give

Cantonal: a 47-page intercantonal annex (LexFind 24607) failed to insert. Its
PDF holds one NUL where a glyph has no character (a dash between two words),
and Postgres cannot store NUL. cleanPdfText and blockText replace it with a
space, so no reader can hit it.

Lilex: an act's page address came only from its Landesgesetzblatt issue.
- 59 acts had none (Austrian-era decrees, issues like 60/1): the publisher's own
  Gebietssystematik names each page; all 59 resolve (the act's listing, then each
  parent, once per listing).
- The EEA agreement's page is ...001, not ...000; found the same way (the first
  of the rows a treaty is listed under).
- Two acts have no consolidated page at all (a Bekanntmachung of 1941, a 2020
  EEA decision): the gazette entry links a PDF, which is read.
- gesetze.li answers an unknown address with a maintenance notice carrying the
  proof-of-work script; that is now "no page", not a challenge that stops the run.
- refresh reads these the same way, so they stay current.

Live against gesetze.li into a local database: 0.110 (129 provisions), 641.291,
0.110.042.08 (4), 210.109, 210.111, 210.116 all store.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* feat(law): read a scanned cantonal document by OCR

LexFind document 13622 (a 881 KB scan, no text layer) failed as "no text in
the document": the cantonal importer had no OCR fallback. It now uses the
shared provisionsOfPdf (the commune loader's), reading German, French and
Italian together because the file's own language is not known. A scanned
version's source carries law-text-cantonal-2+ocr.

On the real scan: scanned, 2 articles (Geltungsdauer und Kuendigung, Aenderung
der Vereinbarung).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* docs(law): how Swiss communes publish their law — a survey of the 26 cantons

Five research passes, each reporting only what it opened. No canton hosts its
communes' law centrally except Basel-Stadt (3 communes). Two platforms span many
communes: LexWork (name.tlex.ch, about thirty found) and the i-web.ch CMS (about
fifty estimated). Basel-Landschaft's single CMS is behind a Cloudflare challenge,
reported and not worked around. Lists the order to build in and what is not verified.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* feat(law): read the communes' LexWork collections — Zug and Glarus, 14 communes, 1,164 acts with their dated versions

Many communes keep their law in a LexWork (Sitrox) collection at
<commune>.tlex.ch. The app's own JSON interface is open (no login; robots.txt
blocks only the search endpoints), so it is read as data: the list of acts,
each act by systematic number, the day each version took effect (versions are
dated by the publisher), and the article tree. Versions older than the
structured text are held as a PDF and read like any PDF.

- config LEXWORK: the 14 instances verified live (11 Zug communes, 3 Glarus), each
  an authority bfs<number>, within its canton; ACT_TEXT_FORMATS gains json.
- text/lexwork.ts (fetch, dates, versions, article tree), text/import-lexwork.ts.
- law:text lexwork [--host]; Law text load workflow source lexwork.
- Survey doc: the interface is confirmed open.

Live into a local database: Zug 50 versions then 0 failures, Glarus Nord 12 versions /
452 provisions, no failures. Integration test: old version ends the day before the
new one, a second run stores nothing.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* fix(law): a LexWork version that cannot be read no longer stops the current one

The first production load of Zug and Glarus stored 1,498 dated versions
(21,823 provisions) and left 4 acts without text: one old version of each
failed with "no text", and the loop, which stores oldest first, stopped
there and never reached the current version.

Each version is now read on its own: a failure is reported for that version
and the rest go on. A version the publisher holds with no text at all (Cham's
act 3-1 is a blank Word page published under a placeholder 1900 date) is
reported as emptyAtPublisher, not as a failure, and nothing is invented.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* feat(law): register the federal acts Fedlex lists and the register lacks; tell two acts of one number apart

The register of federal acts comes from LexFind, which lags Fedlex by days. Fedlex's
own list showed two acts the register did not hold (SR 0.973.276.71, 129.1) and one
number carried by two acts (SR 0.424.21: the 2005 framework agreement on nuclear-energy
research and its 2025 renewal), which the importer skipped, leaving the registered one
without any text.

The Fedlex text load now:
- tells two acts of one number apart by the address of their own Fedlex page (the
  register's official_url or ch_eli), never guessing; where the register cannot tell,
  the number is still reported ambiguous and left alone;
- registers any act Fedlex lists that the register lacks, from Fedlex's own list (title
  from the act's expression, ch_eli, its page), and reads it.

Against real Fedlex into a scratch database: 5,336 acts registered, none with a
placeholder title, SR 0.424.21 held as two acts with their 2005 and 2025 titles.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* fix(law): ask Fedlex for titles apart from the list, which had lost five acts

The title I added to the Fedlex list query in #380 made Fedlex return five fewer
acts in force (5,336 against 5,341, which an independent count of the same filter
confirms): those five were still held, but would no longer have been kept current.
The list query is back to what it was; the titles of the acts to be registered are
asked in a second, small query (VALUES over their addresses, validated, 100 at a time).

Against real Fedlex: 5,341 versions again, 5,340 distinct numbers, and the 2005 and
2025 framework agreements' titles come back.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* feat(law): find the law by words or by place; act contents; llms.txt, sitemap, Markdown for models

One search box over titles and text, a place tree derived from the authorities,
place pages, breadcrumb and contents on acts, /llms.txt, robots, sitemaps,
per-act Markdown/JSON, place hierarchy in law_authorities, offset in law_find_acts.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* fix(law): list sitemaps without a database, which the build does not have

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* feat(law): search goes through searchkit: typos forgiven, titles ranked and marked, did-you-mean

The vocabulary of act-title words expands what is typed; the database returns
candidates; searchkit ranks titles. Landing, MCP law_find_acts/law_search and
REST search share one path. foldedSql moves to places/fold for both searches.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* style: format places/search.ts

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-02 09:21:37 +01:00
CatoandClaude Sonnet 5.5 4531541601 feat(law): find the law by words or by place; contents on acts; llms.txt, sitemap and Markdown for models (#382)
* feat(law): read scanned commune acts by OCR, and never drop text before a late first article

A commune that publishes a scan (pages as pictures, no text layer) failed as
"no text in the PDF": Vaduz 5, Schaan 4, Eschen 2, Schellenberg 2. The
commune loader now draws each page (unpdf + @napi-rs/canvas) and reads it with
tesseract.js in the act's language, in process: nothing to install on the box,
no model called. The version's source says so: law-text-publisher-1+ocr.

Schellenberg's hall regulation numbers sections "1." and "2." before an
"Art. 3"; the cutter kept Art. 3 and dropped the rest. When the first article
found is not article 1, the text before it is now kept as one provision.

Live on schellenberg.li: both scans read (2 of 2), 6 acts, 106 provisions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* fix(law): an act's page address follows the register when the publisher's address changes

An act first listed at a wrong address kept it for ever: the register import
added a page address only for a new act. Schellenberg's 35 acts were first read
without the page's <base href> (fixed in #361) and stayed at /service/files/...,
so the load kept fetching a web page instead of the PDF ("Invalid PDF
structure" x35), and the official page shown to readers was a dead link.

For a known act, a different official_url now supersedes the old one and the
new is current; unchanged is untouched. Reproduced locally with stale
addresses: 35 corrected, 3 acts loaded, 55 provisions.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* fix(law): store a PDF's NUL as a space, and find Lilex pages the issue number does not give

Cantonal: a 47-page intercantonal annex (LexFind 24607) failed to insert. Its
PDF holds one NUL where a glyph has no character (a dash between two words),
and Postgres cannot store NUL. cleanPdfText and blockText replace it with a
space, so no reader can hit it.

Lilex: an act's page address came only from its Landesgesetzblatt issue.
- 59 acts had none (Austrian-era decrees, issues like 60/1): the publisher's own
  Gebietssystematik names each page; all 59 resolve (the act's listing, then each
  parent, once per listing).
- The EEA agreement's page is ...001, not ...000; found the same way (the first
  of the rows a treaty is listed under).
- Two acts have no consolidated page at all (a Bekanntmachung of 1941, a 2020
  EEA decision): the gazette entry links a PDF, which is read.
- gesetze.li answers an unknown address with a maintenance notice carrying the
  proof-of-work script; that is now "no page", not a challenge that stops the run.
- refresh reads these the same way, so they stay current.

Live against gesetze.li into a local database: 0.110 (129 provisions), 641.291,
0.110.042.08 (4), 210.109, 210.111, 210.116 all store.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* feat(law): read a scanned cantonal document by OCR

LexFind document 13622 (a 881 KB scan, no text layer) failed as "no text in
the document": the cantonal importer had no OCR fallback. It now uses the
shared provisionsOfPdf (the commune loader's), reading German, French and
Italian together because the file's own language is not known. A scanned
version's source carries law-text-cantonal-2+ocr.

On the real scan: scanned, 2 articles (Geltungsdauer und Kuendigung, Aenderung
der Vereinbarung).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* docs(law): how Swiss communes publish their law — a survey of the 26 cantons

Five research passes, each reporting only what it opened. No canton hosts its
communes' law centrally except Basel-Stadt (3 communes). Two platforms span many
communes: LexWork (name.tlex.ch, about thirty found) and the i-web.ch CMS (about
fifty estimated). Basel-Landschaft's single CMS is behind a Cloudflare challenge,
reported and not worked around. Lists the order to build in and what is not verified.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* feat(law): read the communes' LexWork collections — Zug and Glarus, 14 communes, 1,164 acts with their dated versions

Many communes keep their law in a LexWork (Sitrox) collection at
<commune>.tlex.ch. The app's own JSON interface is open (no login; robots.txt
blocks only the search endpoints), so it is read as data: the list of acts,
each act by systematic number, the day each version took effect (versions are
dated by the publisher), and the article tree. Versions older than the
structured text are held as a PDF and read like any PDF.

- config LEXWORK: the 14 instances verified live (11 Zug communes, 3 Glarus), each
  an authority bfs<number>, within its canton; ACT_TEXT_FORMATS gains json.
- text/lexwork.ts (fetch, dates, versions, article tree), text/import-lexwork.ts.
- law:text lexwork [--host]; Law text load workflow source lexwork.
- Survey doc: the interface is confirmed open.

Live into a local database: Zug 50 versions then 0 failures, Glarus Nord 12 versions /
452 provisions, no failures. Integration test: old version ends the day before the
new one, a second run stores nothing.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* fix(law): a LexWork version that cannot be read no longer stops the current one

The first production load of Zug and Glarus stored 1,498 dated versions
(21,823 provisions) and left 4 acts without text: one old version of each
failed with "no text", and the loop, which stores oldest first, stopped
there and never reached the current version.

Each version is now read on its own: a failure is reported for that version
and the rest go on. A version the publisher holds with no text at all (Cham's
act 3-1 is a blank Word page published under a placeholder 1900 date) is
reported as emptyAtPublisher, not as a failure, and nothing is invented.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* feat(law): register the federal acts Fedlex lists and the register lacks; tell two acts of one number apart

The register of federal acts comes from LexFind, which lags Fedlex by days. Fedlex's
own list showed two acts the register did not hold (SR 0.973.276.71, 129.1) and one
number carried by two acts (SR 0.424.21: the 2005 framework agreement on nuclear-energy
research and its 2025 renewal), which the importer skipped, leaving the registered one
without any text.

The Fedlex text load now:
- tells two acts of one number apart by the address of their own Fedlex page (the
  register's official_url or ch_eli), never guessing; where the register cannot tell,
  the number is still reported ambiguous and left alone;
- registers any act Fedlex lists that the register lacks, from Fedlex's own list (title
  from the act's expression, ch_eli, its page), and reads it.

Against real Fedlex into a scratch database: 5,336 acts registered, none with a
placeholder title, SR 0.424.21 held as two acts with their 2005 and 2025 titles.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* fix(law): ask Fedlex for titles apart from the list, which had lost five acts

The title I added to the Fedlex list query in #380 made Fedlex return five fewer
acts in force (5,336 against 5,341, which an independent count of the same filter
confirms): those five were still held, but would no longer have been kept current.
The list query is back to what it was; the titles of the acts to be registered are
asked in a second, small query (VALUES over their addresses, validated, 100 at a time).

Against real Fedlex: 5,341 versions again, 5,340 distinct numbers, and the 2005 and
2025 framework agreements' titles come back.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* feat(law): find the law by words or by place; act contents; llms.txt, sitemap, Markdown for models

One search box over titles and text, a place tree derived from the authorities,
place pages, breadcrumb and contents on acts, /llms.txt, robots, sitemaps,
per-act Markdown/JSON, place hierarchy in law_authorities, offset in law_find_acts.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* fix(law): list sitemaps without a database, which the build does not have

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-02 08:56:15 +01:00
CatoandClaude Sonnet 5.5 0473c417ae feat(law): register the federal acts Fedlex lists and the register lacks; tell two acts of one number apart (#380)
* feat(law): read scanned commune acts by OCR, and never drop text before a late first article

A commune that publishes a scan (pages as pictures, no text layer) failed as
"no text in the PDF": Vaduz 5, Schaan 4, Eschen 2, Schellenberg 2. The
commune loader now draws each page (unpdf + @napi-rs/canvas) and reads it with
tesseract.js in the act's language, in process: nothing to install on the box,
no model called. The version's source says so: law-text-publisher-1+ocr.

Schellenberg's hall regulation numbers sections "1." and "2." before an
"Art. 3"; the cutter kept Art. 3 and dropped the rest. When the first article
found is not article 1, the text before it is now kept as one provision.

Live on schellenberg.li: both scans read (2 of 2), 6 acts, 106 provisions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* fix(law): an act's page address follows the register when the publisher's address changes

An act first listed at a wrong address kept it for ever: the register import
added a page address only for a new act. Schellenberg's 35 acts were first read
without the page's <base href> (fixed in #361) and stayed at /service/files/...,
so the load kept fetching a web page instead of the PDF ("Invalid PDF
structure" x35), and the official page shown to readers was a dead link.

For a known act, a different official_url now supersedes the old one and the
new is current; unchanged is untouched. Reproduced locally with stale
addresses: 35 corrected, 3 acts loaded, 55 provisions.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* fix(law): store a PDF's NUL as a space, and find Lilex pages the issue number does not give

Cantonal: a 47-page intercantonal annex (LexFind 24607) failed to insert. Its
PDF holds one NUL where a glyph has no character (a dash between two words),
and Postgres cannot store NUL. cleanPdfText and blockText replace it with a
space, so no reader can hit it.

Lilex: an act's page address came only from its Landesgesetzblatt issue.
- 59 acts had none (Austrian-era decrees, issues like 60/1): the publisher's own
  Gebietssystematik names each page; all 59 resolve (the act's listing, then each
  parent, once per listing).
- The EEA agreement's page is ...001, not ...000; found the same way (the first
  of the rows a treaty is listed under).
- Two acts have no consolidated page at all (a Bekanntmachung of 1941, a 2020
  EEA decision): the gazette entry links a PDF, which is read.
- gesetze.li answers an unknown address with a maintenance notice carrying the
  proof-of-work script; that is now "no page", not a challenge that stops the run.
- refresh reads these the same way, so they stay current.

Live against gesetze.li into a local database: 0.110 (129 provisions), 641.291,
0.110.042.08 (4), 210.109, 210.111, 210.116 all store.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* feat(law): read a scanned cantonal document by OCR

LexFind document 13622 (a 881 KB scan, no text layer) failed as "no text in
the document": the cantonal importer had no OCR fallback. It now uses the
shared provisionsOfPdf (the commune loader's), reading German, French and
Italian together because the file's own language is not known. A scanned
version's source carries law-text-cantonal-2+ocr.

On the real scan: scanned, 2 articles (Geltungsdauer und Kuendigung, Aenderung
der Vereinbarung).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* docs(law): how Swiss communes publish their law — a survey of the 26 cantons

Five research passes, each reporting only what it opened. No canton hosts its
communes' law centrally except Basel-Stadt (3 communes). Two platforms span many
communes: LexWork (name.tlex.ch, about thirty found) and the i-web.ch CMS (about
fifty estimated). Basel-Landschaft's single CMS is behind a Cloudflare challenge,
reported and not worked around. Lists the order to build in and what is not verified.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* feat(law): read the communes' LexWork collections — Zug and Glarus, 14 communes, 1,164 acts with their dated versions

Many communes keep their law in a LexWork (Sitrox) collection at
<commune>.tlex.ch. The app's own JSON interface is open (no login; robots.txt
blocks only the search endpoints), so it is read as data: the list of acts,
each act by systematic number, the day each version took effect (versions are
dated by the publisher), and the article tree. Versions older than the
structured text are held as a PDF and read like any PDF.

- config LEXWORK: the 14 instances verified live (11 Zug communes, 3 Glarus), each
  an authority bfs<number>, within its canton; ACT_TEXT_FORMATS gains json.
- text/lexwork.ts (fetch, dates, versions, article tree), text/import-lexwork.ts.
- law:text lexwork [--host]; Law text load workflow source lexwork.
- Survey doc: the interface is confirmed open.

Live into a local database: Zug 50 versions then 0 failures, Glarus Nord 12 versions /
452 provisions, no failures. Integration test: old version ends the day before the
new one, a second run stores nothing.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* fix(law): a LexWork version that cannot be read no longer stops the current one

The first production load of Zug and Glarus stored 1,498 dated versions
(21,823 provisions) and left 4 acts without text: one old version of each
failed with "no text", and the loop, which stores oldest first, stopped
there and never reached the current version.

Each version is now read on its own: a failure is reported for that version
and the rest go on. A version the publisher holds with no text at all (Cham's
act 3-1 is a blank Word page published under a placeholder 1900 date) is
reported as emptyAtPublisher, not as a failure, and nothing is invented.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* feat(law): register the federal acts Fedlex lists and the register lacks; tell two acts of one number apart

The register of federal acts comes from LexFind, which lags Fedlex by days. Fedlex's
own list showed two acts the register did not hold (SR 0.973.276.71, 129.1) and one
number carried by two acts (SR 0.424.21: the 2005 framework agreement on nuclear-energy
research and its 2025 renewal), which the importer skipped, leaving the registered one
without any text.

The Fedlex text load now:
- tells two acts of one number apart by the address of their own Fedlex page (the
  register's official_url or ch_eli), never guessing; where the register cannot tell,
  the number is still reported ambiguous and left alone;
- registers any act Fedlex lists that the register lacks, from Fedlex's own list (title
  from the act's expression, ch_eli, its page), and reads it.

Against real Fedlex into a scratch database: 5,336 acts registered, none with a
placeholder title, SR 0.424.21 held as two acts with their 2005 and 2025 titles.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 21:49:08 +01:00
CatoandClaude Sonnet 5.5 6ec36ff7bf fix(law): a LexWork version that cannot be read no longer stops the current one (#376)
* feat(law): read scanned commune acts by OCR, and never drop text before a late first article

A commune that publishes a scan (pages as pictures, no text layer) failed as
"no text in the PDF": Vaduz 5, Schaan 4, Eschen 2, Schellenberg 2. The
commune loader now draws each page (unpdf + @napi-rs/canvas) and reads it with
tesseract.js in the act's language, in process: nothing to install on the box,
no model called. The version's source says so: law-text-publisher-1+ocr.

Schellenberg's hall regulation numbers sections "1." and "2." before an
"Art. 3"; the cutter kept Art. 3 and dropped the rest. When the first article
found is not article 1, the text before it is now kept as one provision.

Live on schellenberg.li: both scans read (2 of 2), 6 acts, 106 provisions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* fix(law): an act's page address follows the register when the publisher's address changes

An act first listed at a wrong address kept it for ever: the register import
added a page address only for a new act. Schellenberg's 35 acts were first read
without the page's <base href> (fixed in #361) and stayed at /service/files/...,
so the load kept fetching a web page instead of the PDF ("Invalid PDF
structure" x35), and the official page shown to readers was a dead link.

For a known act, a different official_url now supersedes the old one and the
new is current; unchanged is untouched. Reproduced locally with stale
addresses: 35 corrected, 3 acts loaded, 55 provisions.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* fix(law): store a PDF's NUL as a space, and find Lilex pages the issue number does not give

Cantonal: a 47-page intercantonal annex (LexFind 24607) failed to insert. Its
PDF holds one NUL where a glyph has no character (a dash between two words),
and Postgres cannot store NUL. cleanPdfText and blockText replace it with a
space, so no reader can hit it.

Lilex: an act's page address came only from its Landesgesetzblatt issue.
- 59 acts had none (Austrian-era decrees, issues like 60/1): the publisher's own
  Gebietssystematik names each page; all 59 resolve (the act's listing, then each
  parent, once per listing).
- The EEA agreement's page is ...001, not ...000; found the same way (the first
  of the rows a treaty is listed under).
- Two acts have no consolidated page at all (a Bekanntmachung of 1941, a 2020
  EEA decision): the gazette entry links a PDF, which is read.
- gesetze.li answers an unknown address with a maintenance notice carrying the
  proof-of-work script; that is now "no page", not a challenge that stops the run.
- refresh reads these the same way, so they stay current.

Live against gesetze.li into a local database: 0.110 (129 provisions), 641.291,
0.110.042.08 (4), 210.109, 210.111, 210.116 all store.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* feat(law): read a scanned cantonal document by OCR

LexFind document 13622 (a 881 KB scan, no text layer) failed as "no text in
the document": the cantonal importer had no OCR fallback. It now uses the
shared provisionsOfPdf (the commune loader's), reading German, French and
Italian together because the file's own language is not known. A scanned
version's source carries law-text-cantonal-2+ocr.

On the real scan: scanned, 2 articles (Geltungsdauer und Kuendigung, Aenderung
der Vereinbarung).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* docs(law): how Swiss communes publish their law — a survey of the 26 cantons

Five research passes, each reporting only what it opened. No canton hosts its
communes' law centrally except Basel-Stadt (3 communes). Two platforms span many
communes: LexWork (name.tlex.ch, about thirty found) and the i-web.ch CMS (about
fifty estimated). Basel-Landschaft's single CMS is behind a Cloudflare challenge,
reported and not worked around. Lists the order to build in and what is not verified.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* feat(law): read the communes' LexWork collections — Zug and Glarus, 14 communes, 1,164 acts with their dated versions

Many communes keep their law in a LexWork (Sitrox) collection at
<commune>.tlex.ch. The app's own JSON interface is open (no login; robots.txt
blocks only the search endpoints), so it is read as data: the list of acts,
each act by systematic number, the day each version took effect (versions are
dated by the publisher), and the article tree. Versions older than the
structured text are held as a PDF and read like any PDF.

- config LEXWORK: the 14 instances verified live (11 Zug communes, 3 Glarus), each
  an authority bfs<number>, within its canton; ACT_TEXT_FORMATS gains json.
- text/lexwork.ts (fetch, dates, versions, article tree), text/import-lexwork.ts.
- law:text lexwork [--host]; Law text load workflow source lexwork.
- Survey doc: the interface is confirmed open.

Live into a local database: Zug 50 versions then 0 failures, Glarus Nord 12 versions /
452 provisions, no failures. Integration test: old version ends the day before the
new one, a second run stores nothing.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* fix(law): a LexWork version that cannot be read no longer stops the current one

The first production load of Zug and Glarus stored 1,498 dated versions
(21,823 provisions) and left 4 acts without text: one old version of each
failed with "no text", and the loop, which stores oldest first, stopped
there and never reached the current version.

Each version is now read on its own: a failure is reported for that version
and the rest go on. A version the publisher holds with no text at all (Cham's
act 3-1 is a blank Word page published under a placeholder 1900 date) is
reported as emptyAtPublisher, not as a failure, and nothing is invented.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 19:46:21 +01:00
CatoandClaude Sonnet 5.5 663afd685e feat(law): read the communes' LexWork collections — Zug and Glarus, 14 communes, 1,164 acts with dated versions (#374)
* feat(law): read scanned commune acts by OCR, and never drop text before a late first article

A commune that publishes a scan (pages as pictures, no text layer) failed as
"no text in the PDF": Vaduz 5, Schaan 4, Eschen 2, Schellenberg 2. The
commune loader now draws each page (unpdf + @napi-rs/canvas) and reads it with
tesseract.js in the act's language, in process: nothing to install on the box,
no model called. The version's source says so: law-text-publisher-1+ocr.

Schellenberg's hall regulation numbers sections "1." and "2." before an
"Art. 3"; the cutter kept Art. 3 and dropped the rest. When the first article
found is not article 1, the text before it is now kept as one provision.

Live on schellenberg.li: both scans read (2 of 2), 6 acts, 106 provisions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* fix(law): an act's page address follows the register when the publisher's address changes

An act first listed at a wrong address kept it for ever: the register import
added a page address only for a new act. Schellenberg's 35 acts were first read
without the page's <base href> (fixed in #361) and stayed at /service/files/...,
so the load kept fetching a web page instead of the PDF ("Invalid PDF
structure" x35), and the official page shown to readers was a dead link.

For a known act, a different official_url now supersedes the old one and the
new is current; unchanged is untouched. Reproduced locally with stale
addresses: 35 corrected, 3 acts loaded, 55 provisions.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* fix(law): store a PDF's NUL as a space, and find Lilex pages the issue number does not give

Cantonal: a 47-page intercantonal annex (LexFind 24607) failed to insert. Its
PDF holds one NUL where a glyph has no character (a dash between two words),
and Postgres cannot store NUL. cleanPdfText and blockText replace it with a
space, so no reader can hit it.

Lilex: an act's page address came only from its Landesgesetzblatt issue.
- 59 acts had none (Austrian-era decrees, issues like 60/1): the publisher's own
  Gebietssystematik names each page; all 59 resolve (the act's listing, then each
  parent, once per listing).
- The EEA agreement's page is ...001, not ...000; found the same way (the first
  of the rows a treaty is listed under).
- Two acts have no consolidated page at all (a Bekanntmachung of 1941, a 2020
  EEA decision): the gazette entry links a PDF, which is read.
- gesetze.li answers an unknown address with a maintenance notice carrying the
  proof-of-work script; that is now "no page", not a challenge that stops the run.
- refresh reads these the same way, so they stay current.

Live against gesetze.li into a local database: 0.110 (129 provisions), 641.291,
0.110.042.08 (4), 210.109, 210.111, 210.116 all store.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* feat(law): read a scanned cantonal document by OCR

LexFind document 13622 (a 881 KB scan, no text layer) failed as "no text in
the document": the cantonal importer had no OCR fallback. It now uses the
shared provisionsOfPdf (the commune loader's), reading German, French and
Italian together because the file's own language is not known. A scanned
version's source carries law-text-cantonal-2+ocr.

On the real scan: scanned, 2 articles (Geltungsdauer und Kuendigung, Aenderung
der Vereinbarung).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* docs(law): how Swiss communes publish their law — a survey of the 26 cantons

Five research passes, each reporting only what it opened. No canton hosts its
communes' law centrally except Basel-Stadt (3 communes). Two platforms span many
communes: LexWork (name.tlex.ch, about thirty found) and the i-web.ch CMS (about
fifty estimated). Basel-Landschaft's single CMS is behind a Cloudflare challenge,
reported and not worked around. Lists the order to build in and what is not verified.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* feat(law): read the communes' LexWork collections — Zug and Glarus, 14 communes, 1,164 acts with their dated versions

Many communes keep their law in a LexWork (Sitrox) collection at
<commune>.tlex.ch. The app's own JSON interface is open (no login; robots.txt
blocks only the search endpoints), so it is read as data: the list of acts,
each act by systematic number, the day each version took effect (versions are
dated by the publisher), and the article tree. Versions older than the
structured text are held as a PDF and read like any PDF.

- config LEXWORK: the 14 instances verified live (11 Zug communes, 3 Glarus), each
  an authority bfs<number>, within its canton; ACT_TEXT_FORMATS gains json.
- text/lexwork.ts (fetch, dates, versions, article tree), text/import-lexwork.ts.
- law:text lexwork [--host]; Law text load workflow source lexwork.
- Survey doc: the interface is confirmed open.

Live into a local database: Zug 50 versions then 0 failures, Glarus Nord 12 versions /
452 provisions, no failures. Integration test: old version ends the day before the
new one, a second run stores nothing.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 18:52:17 +01:00
CatoandClaude Sonnet 5.5 9f46e1febf docs(law): how Swiss communes publish their law — a survey of the 26 cantons (#373)
* feat(law): read scanned commune acts by OCR, and never drop text before a late first article

A commune that publishes a scan (pages as pictures, no text layer) failed as
"no text in the PDF": Vaduz 5, Schaan 4, Eschen 2, Schellenberg 2. The
commune loader now draws each page (unpdf + @napi-rs/canvas) and reads it with
tesseract.js in the act's language, in process: nothing to install on the box,
no model called. The version's source says so: law-text-publisher-1+ocr.

Schellenberg's hall regulation numbers sections "1." and "2." before an
"Art. 3"; the cutter kept Art. 3 and dropped the rest. When the first article
found is not article 1, the text before it is now kept as one provision.

Live on schellenberg.li: both scans read (2 of 2), 6 acts, 106 provisions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* fix(law): an act's page address follows the register when the publisher's address changes

An act first listed at a wrong address kept it for ever: the register import
added a page address only for a new act. Schellenberg's 35 acts were first read
without the page's <base href> (fixed in #361) and stayed at /service/files/...,
so the load kept fetching a web page instead of the PDF ("Invalid PDF
structure" x35), and the official page shown to readers was a dead link.

For a known act, a different official_url now supersedes the old one and the
new is current; unchanged is untouched. Reproduced locally with stale
addresses: 35 corrected, 3 acts loaded, 55 provisions.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* fix(law): store a PDF's NUL as a space, and find Lilex pages the issue number does not give

Cantonal: a 47-page intercantonal annex (LexFind 24607) failed to insert. Its
PDF holds one NUL where a glyph has no character (a dash between two words),
and Postgres cannot store NUL. cleanPdfText and blockText replace it with a
space, so no reader can hit it.

Lilex: an act's page address came only from its Landesgesetzblatt issue.
- 59 acts had none (Austrian-era decrees, issues like 60/1): the publisher's own
  Gebietssystematik names each page; all 59 resolve (the act's listing, then each
  parent, once per listing).
- The EEA agreement's page is ...001, not ...000; found the same way (the first
  of the rows a treaty is listed under).
- Two acts have no consolidated page at all (a Bekanntmachung of 1941, a 2020
  EEA decision): the gazette entry links a PDF, which is read.
- gesetze.li answers an unknown address with a maintenance notice carrying the
  proof-of-work script; that is now "no page", not a challenge that stops the run.
- refresh reads these the same way, so they stay current.

Live against gesetze.li into a local database: 0.110 (129 provisions), 641.291,
0.110.042.08 (4), 210.109, 210.111, 210.116 all store.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* feat(law): read a scanned cantonal document by OCR

LexFind document 13622 (a 881 KB scan, no text layer) failed as "no text in
the document": the cantonal importer had no OCR fallback. It now uses the
shared provisionsOfPdf (the commune loader's), reading German, French and
Italian together because the file's own language is not known. A scanned
version's source carries law-text-cantonal-2+ocr.

On the real scan: scanned, 2 articles (Geltungsdauer und Kuendigung, Aenderung
der Vereinbarung).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* docs(law): how Swiss communes publish their law — a survey of the 26 cantons

Five research passes, each reporting only what it opened. No canton hosts its
communes' law centrally except Basel-Stadt (3 communes). Two platforms span many
communes: LexWork (name.tlex.ch, about thirty found) and the i-web.ch CMS (about
fifty estimated). Basel-Landschaft's single CMS is behind a Cloudflare challenge,
reported and not worked around. Lists the order to build in and what is not verified.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 18:38:45 +01:00
CatoandClaude Sonnet 5.5 0709f41fcd feat(law): read a scanned cantonal document by OCR (#370)
* feat(law): read scanned commune acts by OCR, and never drop text before a late first article

A commune that publishes a scan (pages as pictures, no text layer) failed as
"no text in the PDF": Vaduz 5, Schaan 4, Eschen 2, Schellenberg 2. The
commune loader now draws each page (unpdf + @napi-rs/canvas) and reads it with
tesseract.js in the act's language, in process: nothing to install on the box,
no model called. The version's source says so: law-text-publisher-1+ocr.

Schellenberg's hall regulation numbers sections "1." and "2." before an
"Art. 3"; the cutter kept Art. 3 and dropped the rest. When the first article
found is not article 1, the text before it is now kept as one provision.

Live on schellenberg.li: both scans read (2 of 2), 6 acts, 106 provisions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* fix(law): an act's page address follows the register when the publisher's address changes

An act first listed at a wrong address kept it for ever: the register import
added a page address only for a new act. Schellenberg's 35 acts were first read
without the page's <base href> (fixed in #361) and stayed at /service/files/...,
so the load kept fetching a web page instead of the PDF ("Invalid PDF
structure" x35), and the official page shown to readers was a dead link.

For a known act, a different official_url now supersedes the old one and the
new is current; unchanged is untouched. Reproduced locally with stale
addresses: 35 corrected, 3 acts loaded, 55 provisions.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* fix(law): store a PDF's NUL as a space, and find Lilex pages the issue number does not give

Cantonal: a 47-page intercantonal annex (LexFind 24607) failed to insert. Its
PDF holds one NUL where a glyph has no character (a dash between two words),
and Postgres cannot store NUL. cleanPdfText and blockText replace it with a
space, so no reader can hit it.

Lilex: an act's page address came only from its Landesgesetzblatt issue.
- 59 acts had none (Austrian-era decrees, issues like 60/1): the publisher's own
  Gebietssystematik names each page; all 59 resolve (the act's listing, then each
  parent, once per listing).
- The EEA agreement's page is ...001, not ...000; found the same way (the first
  of the rows a treaty is listed under).
- Two acts have no consolidated page at all (a Bekanntmachung of 1941, a 2020
  EEA decision): the gazette entry links a PDF, which is read.
- gesetze.li answers an unknown address with a maintenance notice carrying the
  proof-of-work script; that is now "no page", not a challenge that stops the run.
- refresh reads these the same way, so they stay current.

Live against gesetze.li into a local database: 0.110 (129 provisions), 641.291,
0.110.042.08 (4), 210.109, 210.111, 210.116 all store.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* feat(law): read a scanned cantonal document by OCR

LexFind document 13622 (a 881 KB scan, no text layer) failed as "no text in
the document": the cantonal importer had no OCR fallback. It now uses the
shared provisionsOfPdf (the commune loader's), reading German, French and
Italian together because the file's own language is not known. A scanned
version's source carries law-text-cantonal-2+ocr.

On the real scan: scanned, 2 articles (Geltungsdauer und Kuendigung, Aenderung
der Vereinbarung).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 11:15:13 +01:00
CatoandClaude Sonnet 5.5 c968dcab29 fix(law): store a PDF's NUL as a space, and find the Lilex pages the issue number does not give (#369)
* feat(law): read scanned commune acts by OCR, and never drop text before a late first article

A commune that publishes a scan (pages as pictures, no text layer) failed as
"no text in the PDF": Vaduz 5, Schaan 4, Eschen 2, Schellenberg 2. The
commune loader now draws each page (unpdf + @napi-rs/canvas) and reads it with
tesseract.js in the act's language, in process: nothing to install on the box,
no model called. The version's source says so: law-text-publisher-1+ocr.

Schellenberg's hall regulation numbers sections "1." and "2." before an
"Art. 3"; the cutter kept Art. 3 and dropped the rest. When the first article
found is not article 1, the text before it is now kept as one provision.

Live on schellenberg.li: both scans read (2 of 2), 6 acts, 106 provisions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* fix(law): an act's page address follows the register when the publisher's address changes

An act first listed at a wrong address kept it for ever: the register import
added a page address only for a new act. Schellenberg's 35 acts were first read
without the page's <base href> (fixed in #361) and stayed at /service/files/...,
so the load kept fetching a web page instead of the PDF ("Invalid PDF
structure" x35), and the official page shown to readers was a dead link.

For a known act, a different official_url now supersedes the old one and the
new is current; unchanged is untouched. Reproduced locally with stale
addresses: 35 corrected, 3 acts loaded, 55 provisions.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* fix(law): store a PDF's NUL as a space, and find Lilex pages the issue number does not give

Cantonal: a 47-page intercantonal annex (LexFind 24607) failed to insert. Its
PDF holds one NUL where a glyph has no character (a dash between two words),
and Postgres cannot store NUL. cleanPdfText and blockText replace it with a
space, so no reader can hit it.

Lilex: an act's page address came only from its Landesgesetzblatt issue.
- 59 acts had none (Austrian-era decrees, issues like 60/1): the publisher's own
  Gebietssystematik names each page; all 59 resolve (the act's listing, then each
  parent, once per listing).
- The EEA agreement's page is ...001, not ...000; found the same way (the first
  of the rows a treaty is listed under).
- Two acts have no consolidated page at all (a Bekanntmachung of 1941, a 2020
  EEA decision): the gazette entry links a PDF, which is read.
- gesetze.li answers an unknown address with a maintenance notice carrying the
  proof-of-work script; that is now "no page", not a challenge that stops the run.
- refresh reads these the same way, so they stay current.

Live against gesetze.li into a local database: 0.110 (129 provisions), 641.291,
0.110.042.08 (4), 210.109, 210.111, 210.116 all store.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 10:28:00 +01:00
CatoandClaude 46ad4b38bf feat(law): read scanned commune acts by OCR, and never drop text before a late first article (#364)
A commune that publishes a scan (pages as pictures, no text layer) failed as
"no text in the PDF": Vaduz 5, Schaan 4, Eschen 2, Schellenberg 2. The
commune loader now draws each page (unpdf + @napi-rs/canvas) and reads it with
tesseract.js in the act's language, in process: nothing to install on the box,
no model called. The version's source says so: law-text-publisher-1+ocr.

Schellenberg's hall regulation numbers sections "1." and "2." before an
"Art. 3"; the cutter kept Art. 3 and dropped the rest. When the first article
found is not article 1, the text before it is now kept as one provision.

Live on schellenberg.li: both scans read (2 of 2), 6 acts, 106 provisions.


Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 07:37:58 +01:00
CatoandClaude 37aeccc42c chore(law): the law sync runs only when the owner starts it, Switzerland and Liechtenstein only (#363)
No schedule: it is started by hand, on request. Legilux is left out of it;
Luxembourg stays as loaded, not extended, while the two countries come first.


Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 07:23:48 +01:00
CatoandClaude 493f1a98e6 feat(law): read the law again every day — what changed, served to every model (#360)
- law-sync.yml: nightly on the box, registers then every text reader, each step continuing past a failure
- law:text refresh: re-read held cantonal and Lilex documents oldest first; same bytes mark checked, changed bytes become a new version (date_basis retrieved); stops at a bot check
- law:text municipal --publisher all
- loadLawChanges + GET /api/v1/law/changes + MCP/chat tool law_changes
- design doc: Staying current


Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 06:34:25 +01:00
CatoandClaude Opus 5.5 6b54ea11de feat(law): Luxembourg from Legilux — 1,134 acts and their consolidated text; Schellenberg (#359)
* feat(law): Luxembourg — 1,134 acts in force and their consolidated text, from Legilux

Legilux, the Grand Duchy's official legal database (Ministry of State,
Central Legislation Service), publishes under CC BY 4.0 through a SPARQL
endpoint that speaks JOLux, the ontology Fedlex uses. The reader asks for
every consolidated version Legilux marks `applicable` (one per act, 1,134 on
2026-11-01), registers the acts as the authority `lux` (identifier `lu_eli`),
and stores each version's French HTML cut into its articles under Legilux's
own anchors (`art_710-5`), dated by the day it applies from.

`pnpm run law:text legilux` (and the Law text load workflow, source
`legilux`); resumable, a page asked again on a dropped connection.

So that a French-only act reads everywhere: reading an act, its contents or a
provision prefers the language asked for and falls back to the one held.
So that Luxembourg is not asked about Swiss federal law: the planner adds the
Confederation when a Swiss place is in the question or none is
(`countryOf`, read from config). Tools, MCP instructions and prompts name
Luxembourg.

Loaded live into a fresh database: the 1,134 acts registered, three texts
read and cut, nothing failed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* feat(law): Schellenberg, and naming a commune's act when its link says only "Dokument herunterladen"

Schellenberg's page labels every document "Dokument herunterladen": an act is
now named by the link's title, else by its file's name ("3-1-abwasserreglement.pdf"
→ "Abwasserreglement"); a bare kind ("Reglement") gives way to the file's
fuller name. Hex entities (&#xFC;) are read, and a page that offers the same
act twice under two file names lists it once. Schellenberg: 35 acts, li7008.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 06:15:02 +01:00
CatoandClaude b34520aeb1 feat(law): Liechtenstein's communes, read from their own pages — six of eleven, about 185 acts (#358)
Most communes publish their acts as documents linked from their own pages,
with no collection behind them. One adapter reads them all
(publishers/linked-documents.ts); a commune is config: the pages that list its
acts, how a document link looks, folders to open, which titles are acts
rather than forms (Antrag, Formular, Merkblatt left out).

- Vaduz, Schaan, Planken, Gamprin (Concrete CMS), Ruggell (media archive in
  folders) and Eschen-Nendeln (WordPress): authorities li7001, li7005,
  li7006, li7009, li7010, li7007, each `within: "li"`, so a question about
  Vaduz is asked of Liechtenstein's law too (and the place page's chat
  searches it).
- Such pages state no day an act began: a version is dated by the day read
  (VersionRef.dateBasis "retrieved"), and the loader stores a document only if
  its bytes differ from the version in force. A title's own "gültig ab
  01.01.2027" dates the version as the publisher's, and it waits until then.
- A list that comes back empty fails the run (a changed page or a challenge
  is never "no acts"). Triesenberg answers with a bot check and is left out.
- `within` on LawAuthority replaces the Zürich special case for "a commune
  brings its canton's or country's law".

Loaded end to end on a fresh database from the communes' own sites: Vaduz's
Gemeindeordnung 19 articles, Planken's Abwasserreglement 44, Gamprin's
Gemeindeordnung 21; a second run stores nothing it already holds.


Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 06:02:33 +01:00
CatoandClaude 60661cfe40 feat(law): the register as tools for any model — an MCP server, and a law chat that can look further and read the web (#356)
- src/lib/law/tools.ts: law_authorities, law_search, law_find_acts,
  law_read_act, law_read_provision, each running the code its /api/v1/law twin
  runs; one definition for every caller.
- POST /api/mcp: a stateless MCP server (Streamable HTTP, JSON responses),
  public and read-only, bounded per address. Any AI app connects to
  https://solon.orangecat.ch/api/mcp.
- The law chat gains a research step between checking the search and writing:
  the model may call the same tools, and web_search / web_read from
  @bitbaum/ai-kit/web when a search backend is configured, for two rounds.
  Provisions read join the sources [L#]; pages read are web sources [W#],
  never cited as law. With no tool-capable model the answer is written from
  the search, as before. Each step shows in the chat's "Thought for" row.
- share-search-backend.yml copies the box's SearXNG settings into Solon's
  env, as Substrata does.
- The integration page lists the law API and the MCP endpoint.


Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 05:32:37 +01:00
CatoandClaude 259f78abf9 feat(structures): what the law requires of each form, year by year (#354)
Three rows, each citing the provision it rests on and checked against the
law register on every render, as the others are:
- A licensed member on the board: PGR Art. 180a, for the foundation (its
  Abs. 3 names supervised foundations), the establishment and the company.
- When the tax return is due: SteG Art. 95, set yearly by the tax
  administration and extendable on a written request.
- Yearly accounts of a Swiss company: OR Art. 958 Abs. 3 and Art. 699 Abs. 2,
  within six months of the financial year's end.

The Liechtenstein register (llv.li) and the FMA's register of licensed
trustees (fma-li.li) refuse automated reading, so neither is linked yet; the
design doc says so (§3.2).


Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-31 20:16:12 +01:00
CatoandClaude c9f105e01e feat(structures): a register of legal forms, side by side in the words of the law (#347)
/structures compares the Liechtenstein foundation, establishment and company
limited by shares with the Swiss company limited by shares, row by row:
founders, minimum capital, public register, supervision, liability, profit
tax, minimum tax, and the private asset structure.

Every fact cites the provision it comes from (act, anchor, the words that
state it, the sha256 of the provision when read). The page reads each cited
provision from the law register on every render and shows a fact only while
its words are still there; an amended provision that still says it is marked
as amended. A row with nothing behind it says so. No score, and a note that
choosing a form is a licensed adviser's call.

/law/<act>?at=<anchor> now opens the page that holds the provision, so each
citation lands on it.

Design doc: S0 as built (§3.1).


Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-31 04:42:48 +01:00
CatoandClaude Opus 5.5 dbbe1a49fd feat(places): the commune map on the fleet's one renderer, @bitbaum/geo-kit/map (#342)
* wip(places): the commune map on @bitbaum/geo-kit/map instead of MapLibre (lockfile follows the 0.2.0 release)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

* feat(places): the commune map on the fleet's one renderer, @bitbaum/geo-kit/map

Solon's map of places moves from MapLibre GL to @bitbaum/geo-kit/map 0.2.0,
the renderer extracted from Substrata's globe: the orthographic globe on
Canvas 2D, zoomed in to the country. Same props and behaviour for the page
(colours from the tokens, fills by commune, select, hover label, focus on a
place or an address); its own zoom buttons and hover label replace MapLibre's
control and popup. MapLibre, the script that copied it into public/vendor and
its stylesheet override are gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuxKPxNit33QRcXSCC

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-30 23:03:14 +01:00