225 Commits
Author SHA1 Message Date
CatoandClaude Opus 5.5 ebcb85af72 feat(i18n): the start-a-business guide in eight languages; per-language pending lists for the messages check (#675)
* fix(i18n): check:messages leaves out each language's own pending namespaces

langkit's command line takes one --pending list for every language, but
Amend is pending only outside AMEND_LOCALES, so main failed check:messages
with 366 missing Amend keys in zh, ja and ko. scripts/check-messages.ts
calls langkit's checkMessages with a per-language map, read from
src/i18n/pending.ts, which the parity test now shares.

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

* feat(i18n): the start-a-business guide in all eight languages

The page's words are the StartBusiness messages (metadata too); the guide's
facts stay written once, in English, and read their other languages from
data/i18n/config.json by their English words. guideTexts() lists every
text the page can show from the guide files, for every country and
region, so pnpm run i18n:config finds them and the configuration test holds
each to every language. Official names keep their original (in brackets
where the English has them; as they are in German). The route counts as
translated. The title no longer hyphenates words that fit a 320px line.
Chinese, Japanese and Korean are machine translations, not yet read by a
native speaker, as for the rest of the site.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-12-02 03:12:31 +01:00
CatoandClaude 7e16bbf5df fix(i18n): restore dropped links in fr/it, Russian plural forms; langkit in verify (#661)
* fix(i18n): restore dropped source links in fr/it and Russian plural forms

An ASCII apostrophe right before a tag opens an ICU quote, so French and
Italian readers saw the literal text "L<geostat>office statistique</geostat>"
instead of a link (Statistics.why.example.sources, Places.profile.source).
Those strings now use the typographic apostrophe. Three Russian plurals
(Places.compare.law.whyHint/whySure, Statistics.checks.sum.result) gain
the few and many forms they need.

Co-Authored-By: Claude <noreply@anthropic.com>

* chore(i18n): run langkit check:messages in verify

Adds @bitbaum/langkit and a check:messages script (with the parity test's
PENDING_TRANSLATION namespaces as --pending) to the verify gate, as the fleet
template does, and documents it. The verify lines in AGENTS.md, README.md and
.claude/CLAUDE.md now list every step the script runs.

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-12-02 01:55:22 +01:00
CatoandClaude bcfd87d971 feat(places): the West Bank, East Jerusalem, Gaza and the Golan, side by side; Israel's localities (#662)
The contest model holds layered places (shape C, design 2026-11-contested-law.md §5.2) as data:
a side may name its own world place or names of its own, administer the place, govern only the
zones a source draws, and must quote the words its role rests on; a contest quotes how others
(UN Security Council resolutions) describe the place, attributed. No place is named in code.

- world list: west-bank, east-jerusalem, gaza-strip, golan-heights (Wikidata items), claimedBy
  the State of Palestine / Syria.
- contests (src/lib/config/places/contests/levant.ts): Areas A, B, C and each side's
  jurisdiction from the Interim Agreement (1995, UN-circulated text); Israel's Basic Laws
  (Knesset translations) and the Golan Heights Law; the Amended Basic Law of Palestine and its
  UN membership application; Syria's Constitutional Declaration (2025); SC resolutions 478, 497,
  2334, 2803; PwC tax summaries cited as summaries. Every page opened 2026-12-01; every quote
  translated in data/i18n/config.json for de, fr, it, ru.
- the weekly source check reads PDFs by their text layer (unpdf), so the resolutions and the
  Basic Laws are checked like any page.
- an israel pack from the Central Bureau of Statistics' locality file on data.gov.il
  (scripts/places-il-cbs-localities.ts): 7 districts and 1,267 localities, 127 in the file's
  Judea and Samaria Area; Israel and its ISO districts move out of the world pack with their ids.
  A pack may name the language its paths are read from (Hebrew is not transliterated).
- ROADMAP: what is still open (PCBS localities, CBS subdistricts, a second reader, statutes).


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-12-01 20:59:20 +01:00
CatoandClaude Fable 5.2 e17644712a feat: the reader chooses the model; pricing with a waitlist until Solon can charge (#653)
* feat(chat): the reader chooses which model answers: a free one, or their own key

Both chats (the law, governance) get chatkit's model button and sheet
through useModelOptions; /api/law/ask and /api/chat choose the chain
with ai-kit/choice. A reader's own key replaces Solon's models for
their questions and is never stored here. Under a long answer a free
model wrote, one line leads to the sheet.

Needs @bitbaum/ai-kit 1.33.0 and @bitbaum/chatkit 0.48.0 (kits#20);
the lockfile follows once they are published.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvTCDbJAYNKQpNyKzz

* feat(pricing): what Solon offers, at what price, with a waitlist until it can be sold

/pricing shows four tiers (Free, Plus, Professional, Organization) as
sitekit's PlanTable, in five languages. The paid ones are not on sale:
the price is what we plan to charge and the button takes an address
(plan_waitlist, migration 0038, additive) through paykit's joinWaitlist.
The model sheet's third way and the Hire page lead there.

Prices live in lib/config/plans.ts only and are a proposal, not yet
confirmed by the owner.

Needs @bitbaum/paykit 0.5.0 and @bitbaum/sitekit 0.9.0 (kits#21) and
kits#20; the lockfile follows once they are published.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvTCDbJAYNKQpNyKzz

* chore: lockfile for ai-kit 1.33.0, chatkit 0.48.0, paykit 0.5.0, sitekit 0.9.0

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvTCDbJAYNKQpNyKzz

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-30 21:39:41 +01:00
CatoandClaude 48e13a8c6b feat(chat): the chats in a page open over the whole screen (chatkit 0.47 expandable) (#646)
Owner, 2026-11-29, on the law chat in Lugano's page: the window should be
expandable to full screen, designed and working like the other chats, from
the package. chatkit 0.47.0 (kits#18) adds `expandable` to ChatApp; this
turns it on for LawChat (place pages, /law/ask, the amend form) and the
governance chat.

- @bitbaum/chatkit ^0.45.0 → ^0.47.0.
- `expandable` on both ChatApps; labels expand/collapse in en, de, fr, it, ru.
- globals.css: opened, the chat screen fills the screen instead of the
  75dvh it has in the page.

Checked in a browser on a production build with the package's tarball,
phone and desktop, /de/law/ask and a place page: the button is there, open
it covers the screen exactly and nothing of the site is drawn over it, the
typed words stay, Escape puts it back, no page errors (24 checks). tsc,
eslint, prettier, design:check, check:cycles and the unit suite pass with
the published 0.47.0.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-29 22:05:06 +01:00
CatoandClaude 94a7d3a6a9 statistics: use the published @bitbaum/datakit instead of Solon's own copy (#637)
The checks were moved to the shared kits and published on npm as
@bitbaum/datakit 0.1.0, identical to src/lib/datakit. Solon depends on the
package; its release gate on the score stays here, with its sample.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-28 10:26:06 +01:00
CatoandClaude 8bd897ee9b datakit: a benchmark that scores the checks on planted mistakes (#633)
Plants seven kinds of publisher mistake into real series, one at a time and
seeded, and counts what the checks hold, mark or miss, and how many true
figures they wrongly doubt. pnpm run datakit:benchmark scores the site's own
national series.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-28 04:14:19 +01:00
CatoandClaude 1d084d5b78 blog: The State of Solon, rewritten with charts and diagrams; blog and whitepaper render diagrams (#625)
Claude-Session: https://claude.ai/code/session_019MDtmvTCDbJAYNKQpNyKzz

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-27 20:24:35 +01:00
CatoandClaude Opus 5.5 5b8fac2fa7 Photos straight from Cloudflare R2; the box does no image work (#620)
* feat(photos): serve photographs straight from R2, no image work on the box

With NEXT_PUBLIC_MEDIA_BASE set at build time, the app box sends no
photograph bytes and resizes nothing; unset, everything is as before.

- src/lib/media: self-contained pipeline (no app imports, for a later move
  into @bitbaum/sitekit alongside Heidi's copy). media:render renders the
  bundled photographs at 640/960/1280/1920/2560 as AVIF and WebP with
  sharp and writes a committed manifest; media:upload (dry run by default,
  idempotent, immutable Cache-Control) sends them to the PHOTOS_S3_* bucket.
  A custom next/image loader, switched on only when the base is set, names
  the nearest variant; MediaImage draws AVIF with a WebP fallback and keeps
  the blur placeholder. ThemedPhoto, the menu feature and the ideas page
  use it. A test fails while the manifest lags an original.
- Place photographs: with a base set, photoUrl points at the bucket object
  (place-photos/<file>@<width>) instead of /api/place-photo, which stays
  for the fallback and for PLACE_PHOTOS_VIA_APP=1 while the bucket fills.
  places:photos:to-r2 is now dry run by default; --apply copies what is
  only in place_photo_bytes and reads the rest of the shown widths from
  Commons straight into the bucket. Nothing is dropped.
- places:photos:warm checks the bucket first and only falls back to the
  route for a miss.
- .env.example and AGENTS.md document the variables and the order.

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

* feat(photos): the box's build fills the bucket and switches it on itself

Nobody runs manual steps on the box, so `pnpm run build` now starts with
scripts/media-ensure.ts. On the box's build (SELF_HOST=1, or MEDIA_ENSURE=1)
with PHOTOS_S3_* and MEDIA_PUBLIC_BASE set, it HEADs every manifest variant,
renders (sharp, concurrency 1, no cache) and uploads only the missing ones,
reads one back through the public base, and only on a 200 with the image's
content type writes NEXT_PUBLIC_MEDIA_BASE into .env.production.local
(gitignored) for next build. Anything missing or failing is one log line,
takes back a base an earlier build wrote, and exits 0: the build never
fails because of media. An explicit NEXT_PUBLIC_MEDIA_BASE still overrides.

Place photographs stay on /api/place-photo by default (it copies DB-only
photographs into the bucket on first request); PLACE_PHOTOS_DIRECT=1 is
the later, explicit switch to direct addresses.

The decision logic (src/lib/media/ensure.ts) is pure and tested; sharp's
settings are shared by media:render and the build. AGENTS.md and
.env.example: an operator only gives the bucket a public domain and puts
the five variables in /opt/fleet/env.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-26 12:53:30 +01:00
CatoandClaude ffc16763ce feat(law): Zürich's official routes as data, and the letter that carries a proposal (#law-route, #law-handoff) (#619)
* feat(law-route): the City of Zürich's routes as sourced data, on every proposal

Petition, Einzelinitiative, Volksinitiative (3,000 in six months), motion or
postulate, and contesting one's own fine, each with whom it is open to and the
provision that says so. A proposal shows them as "What it takes to make this
real here", the case routes apart.

Co-Authored-By: Claude <noreply@anthropic.com>

* feat(law-handoff): write the petition or Einzelinitiative from a proposal, as a PDF made on the writer's device

The writer's details stay in the browser: no request carries them, nothing is
stored, the page is not indexed. Whoever may not take a voters-only route is
shown the petition.

Co-Authored-By: Claude <noreply@anthropic.com>

* feat(law): the act API gives the version id, so a signer can file a change with their own key

scripts/amendment-file.ts pins each change to its provision's hash, computes the
revision hash as the server does, signs and files. First spec: Art. 8 of the
City of Zürich's Parkkartenverordnung.

Co-Authored-By: Claude <noreply@anthropic.com>

* docs(law): roadmap, changelog and design for #law-route and #law-handoff

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-26 12:17:29 +01:00
822189e377 chore(deps): bip-kit, limitkit, ai-forms and threadkit from the @bitbaum scope (#502)
Owner, 2026-11-06: the fleet's packages belong under the @bitbaum npm
organization (fleet docs/package-scope-migration-plan.md). Same code and
versions; dependency keys and import specifiers moved with
scripts/packages/rename-package.mjs from fleet.


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

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Cato <cato@orangecat.ch>
2026-11-20 15:49:48 +01:00
CatoandClaude Opus 5.5 6ce6ff7832 feat(places): keep place photographs in R2, not Postgres (#605)
place_photo_bytes held 4,234 Wikimedia Commons thumbnails (1.7 GB of a 4.3 GB
database), copied into every nightly backup until the off-site store filled
(2026-11-16). Photographs are files: they belong in object storage.

- photo-keep-r2.ts: an S3/R2 keep, and a layered keep (R2 first; a photograph
  found only in Postgres is copied to R2 on first read; new ones go to R2).
- The place-photo and og routes use placePhotoKeep(): R2 when the four
  PHOTOS_S3_* settings exist, Postgres exactly as before otherwise.
- scripts/places-photos-to-r2.ts (places:photos:to-r2): one-off resumable copy.
- Same S3 client as evig (@aws-sdk/client-s3).

Expand first: the table stays until R2 is verified serving; dropping it is a
later change (a drop in the same deploy blocks later deploys).

Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:30:03 +01:00
CatoandClaude Opus 5.5 fdca9eb964 fix(deps): next 16.4.6 — known vulnerabilities (#603)
Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 21:24:22 +01:00
Catoandfleet-reconciler b4f4034f6d chore(deps): raise shared package floors to published versions (#601)
Opened by bitbaum/fleet .github/workflows/internal-currency.yml.

The fleet's own packages ship features in MINORS, so
version-currency.mjs — which judges by major — reports nothing while
consumers drift. This is the instrument that sees it, and it opens
the fix rather than reporting it.

If this PR is red, that is the useful outcome: it names a repo that
cannot take the new version, which nothing else in the fleet would
have told us.

Co-authored-by: fleet-reconciler <fleet@bitbaum.invalid>
2026-11-19 15:11:06 +01:00
CatoandClaude Opus 5.5 c6d4a7d6f1 Give one-line prose fields the microphone; chatkit 0.45.0 (#599)
* Give one-line prose fields the microphone (TextBox multiline={false})

Proposal title, amendment title and heading, organization name, place
fields and founder name, and the statistics question now use TextBox, so
each has chatkit's dictation like the longer text boxes.

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

* Bump @bitbaum/chatkit to ^0.45.0; the door's question gets the microphone

chatkit 0.45.0 lets DictationField be uncontrolled (name + defaultValue),
so the plain GET form on What you can do uses TextBox multiline={false}
and still posts its title without client state. TextBox already passes
every DictationField prop through, so it needs no change.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-15 20:52:05 +01:00
Catoandfleet-reconciler 4541eb2cec chore(deps): raise shared package floors to published versions (#600)
Opened by bitbaum/fleet .github/workflows/internal-currency.yml.

The fleet's own packages ship features in MINORS, so
version-currency.mjs — which judges by major — reports nothing while
consumers drift. This is the instrument that sees it, and it opens
the fix rather than reporting it.

If this PR is red, that is the useful outcome: it names a repo that
cannot take the new version, which nothing else in the fleet would
have told us.

Co-authored-by: fleet-reconciler <fleet@bitbaum.invalid>
2026-11-15 19:33:49 +01:00
Catoandfleet-reconciler 9808c64b87 chore(deps): raise shared package floors to published versions (#598)
Opened by bitbaum/fleet .github/workflows/internal-currency.yml.

The fleet's own packages ship features in MINORS, so
version-currency.mjs — which judges by major — reports nothing while
consumers drift. This is the instrument that sees it, and it opens
the fix rather than reporting it.

If this PR is red, that is the useful outcome: it names a repo that
cannot take the new version, which nothing else in the fleet would
have told us.

Co-authored-by: fleet-reconciler <fleet@bitbaum.invalid>
2026-11-15 18:22:45 +01:00
Catoandfleet-reconciler c6d285d524 chore(deps): raise shared package floors to published versions (#597)
Opened by bitbaum/fleet .github/workflows/internal-currency.yml.

The fleet's own packages ship features in MINORS, so
version-currency.mjs — which judges by major — reports nothing while
consumers drift. This is the instrument that sees it, and it opens
the fix rather than reporting it.

If this PR is red, that is the useful outcome: it names a repo that
cannot take the new version, which nothing else in the fleet would
have told us.

Co-authored-by: fleet-reconciler <fleet@bitbaum.invalid>
2026-11-15 17:23:38 +01:00
Catoandfleet-reconciler da450387fc chore(deps): raise shared package floors to published versions (#596)
Opened by bitbaum/fleet .github/workflows/internal-currency.yml.

The fleet's own packages ship features in MINORS, so
version-currency.mjs — which judges by major — reports nothing while
consumers drift. This is the instrument that sees it, and it opens
the fix rather than reporting it.

If this PR is red, that is the useful outcome: it names a repo that
cannot take the new version, which nothing else in the fleet would
have told us.

Co-authored-by: fleet-reconciler <fleet@bitbaum.invalid>
2026-11-15 16:32:49 +01:00
Catoandfleet-reconciler fd6ac823fe chore(deps): raise shared package floors to published versions (#595)
Opened by bitbaum/fleet .github/workflows/internal-currency.yml.

The fleet's own packages ship features in MINORS, so
version-currency.mjs — which judges by major — reports nothing while
consumers drift. This is the instrument that sees it, and it opens
the fix rather than reporting it.

If this PR is red, that is the useful outcome: it names a repo that
cannot take the new version, which nothing else in the fleet would
have told us.

Co-authored-by: fleet-reconciler <fleet@bitbaum.invalid>
2026-11-15 15:05:42 +01:00
Catoandfleet-reconciler 68c239abc8 chore(deps): raise shared package floors to published versions (#594)
Opened by bitbaum/fleet .github/workflows/internal-currency.yml.

The fleet's own packages ship features in MINORS, so
version-currency.mjs — which judges by major — reports nothing while
consumers drift. This is the instrument that sees it, and it opens
the fix rather than reporting it.

If this PR is red, that is the useful outcome: it names a repo that
cannot take the new version, which nothing else in the fleet would
have told us.

Co-authored-by: fleet-reconciler <fleet@bitbaum.invalid>
2026-11-15 13:57:15 +01:00
Catoandfleet-reconciler 813f6b2913 chore(deps): raise shared package floors to published versions (#593)
Opened by bitbaum/fleet .github/workflows/internal-currency.yml.

The fleet's own packages ship features in MINORS, so
version-currency.mjs — which judges by major — reports nothing while
consumers drift. This is the instrument that sees it, and it opens
the fix rather than reporting it.

If this PR is red, that is the useful outcome: it names a repo that
cannot take the new version, which nothing else in the fleet would
have told us.

Co-authored-by: fleet-reconciler <fleet@bitbaum.invalid>
2026-11-15 12:44:10 +01:00
Catoandfleet-reconciler 3ddefaeae1 chore(deps): raise shared package floors to published versions (#592)
Opened by bitbaum/fleet .github/workflows/internal-currency.yml.

The fleet's own packages ship features in MINORS, so
version-currency.mjs — which judges by major — reports nothing while
consumers drift. This is the instrument that sees it, and it opens
the fix rather than reporting it.

If this PR is red, that is the useful outcome: it names a repo that
cannot take the new version, which nothing else in the fleet would
have told us.

Co-authored-by: fleet-reconciler <fleet@bitbaum.invalid>
2026-11-15 12:02:58 +01:00
Catoandfleet-reconciler 6518bf447d chore(deps): raise shared package floors to published versions (#591)
Opened by bitbaum/fleet .github/workflows/internal-currency.yml.

The fleet's own packages ship features in MINORS, so
version-currency.mjs — which judges by major — reports nothing while
consumers drift. This is the instrument that sees it, and it opens
the fix rather than reporting it.

If this PR is red, that is the useful outcome: it names a repo that
cannot take the new version, which nothing else in the fleet would
have told us.

Co-authored-by: fleet-reconciler <fleet@bitbaum.invalid>
2026-11-15 04:02:52 +01:00
Catoandfleet-reconciler d01a51be02 chore(deps): raise shared package floors to published versions (#590)
Opened by bitbaum/fleet .github/workflows/internal-currency.yml.

The fleet's own packages ship features in MINORS, so
version-currency.mjs — which judges by major — reports nothing while
consumers drift. This is the instrument that sees it, and it opens
the fix rather than reporting it.

If this PR is red, that is the useful outcome: it names a repo that
cannot take the new version, which nothing else in the fleet would
have told us.

Co-authored-by: fleet-reconciler <fleet@bitbaum.invalid>
2026-11-15 02:31:56 +01:00
Catoandfleet-reconciler df971d5705 chore(deps): raise shared package floors to published versions (#589)
Opened by bitbaum/fleet .github/workflows/internal-currency.yml.

The fleet's own packages ship features in MINORS, so
version-currency.mjs — which judges by major — reports nothing while
consumers drift. This is the instrument that sees it, and it opens
the fix rather than reporting it.

If this PR is red, that is the useful outcome: it names a repo that
cannot take the new version, which nothing else in the fleet would
have told us.

Co-authored-by: fleet-reconciler <fleet@bitbaum.invalid>
2026-11-15 02:03:14 +01:00
Catoandfleet-reconciler c83d104b44 chore(deps): raise shared package floors to published versions (#588)
Opened by bitbaum/fleet .github/workflows/internal-currency.yml.

The fleet's own packages ship features in MINORS, so
version-currency.mjs — which judges by major — reports nothing while
consumers drift. This is the instrument that sees it, and it opens
the fix rather than reporting it.

If this PR is red, that is the useful outcome: it names a repo that
cannot take the new version, which nothing else in the fleet would
have told us.

Co-authored-by: fleet-reconciler <fleet@bitbaum.invalid>
2026-11-14 19:36:31 +01:00
Catoandfleet-reconciler 253178e824 chore(deps): raise shared package floors to published versions (#587)
Opened by bitbaum/fleet .github/workflows/internal-currency.yml.

The fleet's own packages ship features in MINORS, so
version-currency.mjs — which judges by major — reports nothing while
consumers drift. This is the instrument that sees it, and it opens
the fix rather than reporting it.

If this PR is red, that is the useful outcome: it names a repo that
cannot take the new version, which nothing else in the fleet would
have told us.

Co-authored-by: fleet-reconciler <fleet@bitbaum.invalid>
2026-11-14 13:26:09 +01:00
Catoandfleet-reconciler 76dffe6c9d chore(deps): raise shared package floors to published versions (#584)
Opened by bitbaum/fleet .github/workflows/internal-currency.yml.

The fleet's own packages ship features in MINORS, so
version-currency.mjs — which judges by major — reports nothing while
consumers drift. This is the instrument that sees it, and it opens
the fix rather than reporting it.

If this PR is red, that is the useful outcome: it names a repo that
cannot take the new version, which nothing else in the fleet would
have told us.

Co-authored-by: fleet-reconciler <fleet@bitbaum.invalid>
2026-11-14 11:45:23 +01:00
Catoandfleet-reconciler a55a59e7ea chore(deps): raise shared package floors to published versions (#398)
Opened by bitbaum/fleet .github/workflows/internal-currency.yml.

The fleet's own packages ship features in MINORS, so
version-currency.mjs — which judges by major — reports nothing while
consumers drift. This is the instrument that sees it, and it opens
the fix rather than reporting it.

If this PR is red, that is the useful outcome: it names a repo that
cannot take the new version, which nothing else in the fleet would
have told us.

Co-authored-by: fleet-reconciler <fleet@bitbaum.invalid>
2026-11-14 11:04:51 +01:00
CatoandClaude 71383bbaf4 Blog: post on OrangeCat in one tap, share anywhere (#524)
* feat(blog): post any blog post on OrangeCat in one tap

Each post is served as bip-kit's cross-post JSON at /api/blog/<slug>
(prerendered with the site, links made absolute), and the post page ends
with "Post on OrangeCat", which opens OrangeCat's article composer filled in
with Solon's project named. Whoever taps it posts on their own wall; the owner
of Solon's OrangeCat project gets Solon's wall preselected too.

bip-kit 0.7.0 is consumed from its verified Git release (v0.7.0): its npm
publish failed with ENEEDAUTH because the npm trusted-publisher link for
@bitbaum/bip-kit is not configured.

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

* fix(deps): bip-kit v0.7.1, which builds from its Git release in CI

v0.7.0 failed to build when pnpm 11 prepared it inside CI's store
(TS2883 on inferred component types); 0.7.1 declares every component's
return type. Reproduced with a store under a node_modules path: v0.7.0
fails, v0.7.1 installs and builds.

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

* feat(blog): a shared post previews as itself

Post pages inherited the layout's Open Graph block, so a link shared on X,
LinkedIn or WhatsApp previewed as "Solon". Each post now carries its own
title, summary, canonical URL, author and date (type article).

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

* feat(blog): share a post anywhere, OrangeCat first

The post page ends with bip-kit's ShareRow: "Post on OrangeCat" (the
cross-post, the one primary action), Copy link, the device share sheet where
there is one, then X, LinkedIn, Bluesky, Hacker News, WhatsApp, Telegram and
email, in one line that scrolls sideways. bip-kit v0.8.0 from its Git release.

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

* fix(deps): bip-kit v0.8.1, the share button's label readable on Solon's transparent page

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

* fix(deps): bip-kit 0.8.1 from npm, now that trusted publishing works

Drops the Git-release install and its build allowance.

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

* fix(deps): bip-kit 0.9.1 (components build under React 18 too, so the canary can take it)

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-13 20:41:31 +01:00
CatoandClaude Fable 5.2 0af51df8f9 chore(deps): @bitbaum/ai-kit 1.26.0: Google out of the free AI chain (#579)
* chore(deps): @bitbaum/ai-kit 1.26.0: Google out of the free AI chain

ai-kit <=1.25 put Google's Gemini API in the free model chain on the
fleet-wide GEMINI_API_KEY, which sits on a billed Google project.
1.26 builds no Google link (freeChain = Groq, then OpenRouter :free),
keeps paid AI off unless an app opts in, and adds daily caps.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtUQb9BM11ycpApwGq

* chore(deps): @bitbaum/ai-kit 1.27.0, the version kivvi canaries now

Kivvi moved to 1.27.0 (the fleet usage log), so the rollout gate no longer
passes 1.26.0. Same spend rules; adds one line per model call under
AI_USAGE_DIR when the box sets it.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtUQb9BM11ycpApwGq

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-13 11:02:39 +01:00
CatoandClaude 7fc0b7e731 Rate limit: limitkit decides, the windows live in Postgres (#569)
* Rate limit: limitkit decides, the windows live in Postgres

The assistants' limiter was a per-process Map: every deploy gave everyone a
fresh allowance and each instance counted on its own. The decision is now
@bitbaum/limitkit's sliding window, and the windows are held in
rate_limit_windows (migration 0035, additive), one transaction per decision,
serialized per key.

- Seven routes take their bucket from one table of numbers (unchanged).
- Retry-After and the RateLimit headers come from the window, not a constant.
- The address is the hop the proxy wrote (limitkit clientIp), not the first
  X-Forwarded-For entry, which the caller chooses.
- Stored keys are keyed digests; no address or account id is held.
- Without a database, or while it is unreachable, the same rule runs from
  memory and the store is retried after 30 seconds.

Replaces #563, whose migration number collided with 0034_member_person_tag.

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

* Rate limit: refusals never reach the database; the limiter has its own pool

Review of this change found that every check, refused or not, ran a
transaction on the app's only pool and waited on the advisory lock while
holding a connection: a flood from one address made unrelated queries wait
seconds. And a database that hangs never fell back to memory.

- A refusal is remembered per process until its window opens (other
  instances can only add hits, so it cannot open earlier), and writes
  nothing when it is decided by the database.
- Decisions for one key run one at a time per process, so a burst from one
  caller takes one connection, not all of them.
- The limiter has its own pool (3 connections, 1 s to get one), lock and
  statement timeouts, and a 1.5 s deadline per decision; past it, memory
  decides. The 30 s back-off is measured from the failure.
- Memory shadows this process's allowed requests, so a fallback continues
  the count instead of starting a fresh one.
- No session secret, no shared store: the keys would be plain digests of
  addresses. The digest input is domain-separated.
- The sweep compares on the database's clock, the one that wrote touched_at.
- The warning log carries an error code, never the query or its parameters.

Measured on Postgres 16: 3000 concurrent requests from one refused caller
allow none, and an unrelated query on another pool answers in 4 ms (it
waited 2.5-6.8 s before).

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-12 18:34:07 +01:00
CatoandClaude Opus 5.5 5f27700b14 feat(places): a new country pack takes its country over from the world pack; generated data refreshed monthly (#577)
* fix(law): a recut keeps the mark of a text read by OCR

The weekly recut wrote every cantonal version it examined back with the plain
importer version, so a text read from a scan by OCR (`…+ocr`) lost the mark
that says how it was read, and an older version so marked was examined again
at the head of every run. Any version carrying this reader's version with a
mark (+archive, +ocr, or both) is now current, and a version brought up to
date keeps every mark it had.

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

* feat(places): a pack of its own takes a country over from the world pack

Adding a pack is how a country gets places in depth, and the path had never
run: a new pack's root resolved to the world pack's row, which kept its pack
and path; the new pack's places hung under world/...; and a world file still
stating the country would set the root's level back and give it a parent.

- A pack may `yield` (the world pack does): it holds a place only until a
  pack of the place's own names it.
- Then the place moves: same row (its figures and records stay), new pack and
  path, the new path canonical in place_paths and the old one redirecting, and
  the parents other sources stated for it superseded.
- What the world pack held under a moved place that the batch does not restate
  ends that day; restated later, it moves and is current again.
- A batch of a yielding pack leaves alone a place another pack holds and every
  place it states under one, so a world file not yet regenerated, the
  countries' or the subdivisions', cannot take a country back.
- An integration test adds Quuxland, a made-up country the world pack holds
  first, and checks all of it, rerun-safe on one database.

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

* feat(data): one command refreshes every generated dataset, and a monthly workflow opens the PR

The world's profiles, its countries, every country's subdivisions, the world
list's photographs and the law plan were refreshed only when someone ran three
to five commands on a laptop, in an order nobody wrote down; all were last
read on 2026-11-10.

- `pnpm run data:refresh [--only a,b] [--list]` (scripts/data-refresh.ts)
  runs the generators in the order they build on each other. One that fails
  keeps its old files and is reported; the rest still run. A new generator is
  one entry.
- .github/workflows/data-refresh.yml runs it on the 4th of each month (or on
  dispatch, for some), and opens a pull request when anything changed, as
  bitbaum/substrata's recheck-data.yml does; the sweep merges it on green CI
  and the deploy's places-data job imports it.

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-12 09:27:44 +01:00
CatoandClaude Opus 5.5 266a4d5b68 perf: the World Bank fetched from a runner; statistics in one query; imports and deploys skip what did not change (#576)
* perf(places): place pages kept for an hour; the run log indexed and bounded; a place's country by its ISO code

- A place's country (its profile, budget, photograph and share card) is its
  own ISO 3166-1 code, else its pack's root, else a world nation's slug, never
  the last slug segment: the Djibouti Region (world/djibouti/djibouti), the
  City of San Marino and the US state of Georgia showed a country's page.
- /places/[...slug] is ISR for an hour with nothing built ahead, instead of
  force-dynamic: its queries run about once an hour per place and language.
- place_import_runs gets indexes on (source_key, started_at) and (status,
  finished_at); sourceRuns is one DISTINCT ON query, read once per call and
  passed to the worker.
- Runs a stopped process left `running` are closed as failed after two worker
  budgets, so they are reported once and backed off.
- The worker starts on a day with nothing due as well, for the daily rebuild
  of the ancestors view.
- verify runs places:world-countries --check, now comparing the countries the
  file holds rather than CLDR's names; geography:world writes its registry as
  Prettier formats it. The engineering audit's claim that both were checked is
  corrected.

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

* feat(places): a source a publisher refuses to the box is fetched daily from a runner

The World Bank's API answers the box HTTP 403 (2026-11-10), and its source is
the only one for eight statistics in about 210 countries: none had ever loaded
in production, and the box's queue failed it and alerted every cycle.

- A source may say `fetchFrom: "runner"`. The box's worker leaves it out of
  its queue; `pnpm run places:queue --from runner` drains it, with the same
  cadence, retries and run log.
- places-load-cloud.yml runs that daily (and on dispatch with kind=queue),
  through its SSH tunnel to the production database, copying the snapshots
  back to the box as it already did for hand-dispatched loads.
- The World Bank's source is the one runner source; a test fails if another
  side gets it.

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

* refactor(statistics): a governance indicator is five lines; shared scopes and sentence()

- statistic-templates.ts holds sentence() (moved from the budgets' metrics),
  the scope of general government at every level and the scope of a
  perception score, and wgiMetric({ key, code, name }).
- The six Worldwide Governance Indicators are written with wgiMetric: 204
  lines become 66, and the generated metrics were checked identical to the
  hand-written ones, word for word in every language.
- Government consumption and tax revenue share one scope sentence instead of
  two copies.

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

* perf(statistics): every statistic in one query; a new statistic adds no queries

- loadSeriesFor(db, config, keys, locale, { latestOnly }) reads any number of
  metrics in one facts query and names their places once. latestOnly keeps
  each place's latest value within the metric's plausible band, as a chart's
  screening leaves it.
- /statistics: 4 queries instead of 136 (34 statistics x loadSeries +
  placeLabels); 104-131 ms instead of 325-548 ms on a database holding the
  live OECD, Eurostat and World Bank figures. Checked identical to the old
  per-metric query for all 34 statistics (2,403 series), and latest-only
  identical to the screened full series.
- The dimension, event, compare and saved-view pages load their metrics in
  one call each.
- placeLabels groups names and codes once instead of filtering every row per
  place, and builds one Intl.DisplayNames for the list.
- facts gets a partial index on (metric_key, jurisdiction_id, valid_from DESC)
  for current, unvaried figures.

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

* perf(ci): a deploy that touched no Places data clones, installs and reads nothing

places-data.yml ran after every deploy: a full clone and pnpm install on the
memory-tight box, a runner install, and 798 image requests through the live
site, though most deploys change no Places data and no photograph.

- A first job diffs the deployed commit against the one this workflow last
  loaded successfully (a failed load is retried by the next deploy; a
  dispatch, perhaps a dry run, does not count). The import runs when Places
  data, its config, adapters or importer changed; the photo warm-up when
  photos.json or the photo code changed. A dispatch runs both.
- The box fetches the deployed commit at depth 1 instead of cloning the
  repository's history.

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

* perf(places): an old /places/<slug> link is redirected after a two-query lookup

It ran the full place-page load (about 17 queries) only to learn whether the
world pack holds the place. Links no longer point there (#572); the redirect
stays for old ones.

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

* perf(law): a register import reads only its own register, and stops when nothing changed

About 34 register imports run every week. Each made one query per law
authority (311, one after another) and read every current act, title, number
and page in the law database, however small its register; and
missingFromSource counted every act sharing the identity scheme, so it was
wrong for every publisher_ref register.

- A retrieval whose acts, as read, are those the register last applied is
  recorded as applied and `unchanged` and goes no further. The recorded
  importer version carries a hash of the rows read, so the same bytes read by
  a changed reader are applied again.
- The authorities the retrieval names are resolved to places in one query.
- Known acts are read for the identities the retrieval lists, a thousand at
  a time, with their titles, numbers and pages for those acts only.
- missingFromSource counts only the identities this register itself stated.

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

* fix(law): the weekly sync waits for a heavy load; verify reads a sample, a second apart

- law-sync.yml took /tmp/solon-law-load.lock while a heavy load dispatched by
  hand (law-text.yml) takes /tmp/solon-law-load-heavy.lock, so the two never
  excluded each other, the pairing that ran the box out of memory on
  2026-11-08. The sync now takes the heavy lock, and after two hours' wait
  leaves that week's sync be, saying so.
- `law:text verify` read its sample size from --limit, which the workflow
  passes every source (1,500 by default): a dispatch read 1,500 publisher
  pages back to back. It reads --sample (30 by default) and pauses a second
  between reads.

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

* fix(law): an act held in two languages is listed once, titled in the reader's language

recentChanges joined every current title to every current version, so an act
held in German and French appeared up to four times in a place's recent
changes (with repeated React keys), and a constitution's title on the
profile card came out in whichever language the database returned first.

- actTitleSql (src/lib/law/act-title.ts): an act's current title in the
  reader's language, else its first other language, as one value.
- recentChanges takes the reader's language and keeps one row an act, its
  latest current version; the profile's constitution lookup uses the same
  title rule.
- An integration test holds one act in two languages.

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

* refactor(generators): one polite Wikidata client; scratch scripts removed

world-profiles, places-photos and law-plan each carried their own SPARQL
helper: world-profiles retried any error four times (a 400 included), law-plan
did not retry at all, and each sent its own user agent. They use the shared
client (src/lib/wikidata/query.ts), which waits as long as the server asks on
a 429 or 503 and fails at once on anything else. law-plan now checks that
Constitute's index answered before reading it. scripts/_ws.ts and _ws2.ts,
committed scratch files, are deleted.

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

* refactor(statistics): one rule a unit, so a statistic in a new unit is a line in units.ts

What a unit means was decided in six places: the chart scale (present.ts),
the label (shared.ts), the brief's value text and points (brief.ts), the
profile figure's format (place-figures.tsx), the axis panel's percent sign
and the divisor a published percentage is stored with (sources.ts). A
statistic in a count or a currency would have been shown with no unit, or
scaled wrong, in some of them.

src/lib/config/places/units.ts holds, per unit, its scale and decimals,
whether publishers print it in per cent, whether it is a percentage, and the
key of its words under Statistics.units; every site reads it. A test fails
when a unit's words are missing in a language. Nothing shown changes.

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

* perf(law): a place's page counts its own authorities' acts, not the whole register's

loadPlaceLaw ran loadLawCoverage, three aggregates over every act and version
in the law database, to show the counts of a handful of authorities: the
place's chain and the parts of its nearest. loadLawCoverage takes an optional
list of authorities and counts only theirs; a place's page passes the ones it
shows. Checked against a database of 9,119 acts in 14 authorities: the counts
of all 132 shown authorities are the same as before. The pages that show the
whole register still count it all.

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

* fix: findings of an adversarial review of this stack

- Place pages are rendered on every visit again: ISR made Next keep every
  rendered URL on the server's disk (a few thousand places in five languages,
  and any made-up path besides, with no bound), and kept a not-found path as
  not found for an hour. A view's cost is cut where it is spent instead.
- A failed source retried by a once-a-day queue (the runner's) waited a full
  24 hours from the failed run's start, so the next day's run, starting a few
  minutes earlier, missed it: retries allow two hours' slack.
- Abandoned runs are closed after eight hours, longer than any import runs
  from the box or a runner (a workflow job stops at six), instead of after
  two worker budgets.
- One concurrency group for every cloud load, so the daily queue and a fetch
  dispatched by hand never write the same source at once.
- The saved-axis page scores, as the index does, on each place's latest
  plausible value; loadSeriesFor dedupes its keys.
- places-data runs the import weekly whatever changed, for a file applied
  while some of its places were not held (`+partial`) or one whose import
  failed.
- An unchanged register import still reports what the register no longer
  lists.
- The shared Wikidata client retries 500, 502 and 504 too, as world-profiles
  did; a bad query still fails at once.
- The weekly law sync waits 45 minutes for the heavy lock, not two hours.

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-12 09:11:31 +01:00
CatoandClaude 3cb4b06b80 feat(places): the places inside every country, from Wikidata's ISO 3166-2 codes (#570)
- scripts/places-world-subdivisions.ts writes data/places/world/subdivisions.json:
  every item with an ISO 3166-2 code (P300, statement neither ended nor
  deprecated, item not dissolved) in every country no pack holds, named in
  five languages, with its item number. 4,759 places in 194 countries.
- Each sits under its nearest coded ancestor by P131+ (a department in its
  region), else under its country (src/lib/places/nesting.ts, pure, tested):
  two equally near ancestors that do not lie in each other (Brcko District)
  mean the place lies in both, so it sits under what they share. The world
  pack gains three tiers below a country.
- Neutral by the world list's rule: an item that is itself a world entry, and
  the codes in SUBDIVISIONS_WITH_OWN_PAGE (Taiwan, Abkhazia, Transnistria,
  Kosovo), keep their own pages and are not listed inside a claimant.
- The world-subdivisions source imports it after the deploy, like every file
  under data/places. Ten seconds locally.
- The importer inserts identifiers, names, relations and instruments a
  thousand rows a statement: five thousand places passed Postgres's 65,535
  parameters in one.
- One Wikidata helper (src/lib/wikidata/query.ts) for scripts.
- A banner photo fills a tile at full width, not enlarged from 960 into a
  blur; a place's line no longer names the world.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-12 07:16:16 +01:00
CatoandClaude 6f009b424f Tests: verify measures coverage and holds a floor (#564)
verify ran the unit tests without measuring them. It now runs
test:coverage (v8, every file under src counted), prints the summary, and
fails below a floor set just under today's figures (statements 46.8,
branches 37.6, functions 42.7, lines 46.8). pnpm run test stays the
unmeasured quick loop. The three places that describe verify say what it
runs, check:cycles included.

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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-12 05:58:25 +01:00
Cato fe2da787c2 feat(brand): monochrome accent from the pack (1.7.1), icons without orange (#518)
* chore(deps): design-tokens 1.7.1

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

* feat(brand): data-brand solon; the share card reads the pack's ink

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

* chore(brand): icons and exports in the pack's ink, not orange

Claude-Session: https://claude.ai/code/session_019MDtmudxb9cZtsEkrVmPx7
2026-11-11 14:40:21 +01:00
Cato ccc4ceabbf deps: chatkit 0.24; localized sign-in and busy dictation problems in every locale (#513)
Claude-Session: https://claude.ai/code/session_019MDtmvGASoUtc3fejF7Lsy
2026-11-11 14:36:12 +01:00
CatoandClaude d874861492 feat(snapshots): source snapshots are kept gzipped on disk (#535)
The snapshot store held 17 GB on 2026-11-11, on a disk every site on the
box shares and that had reached 89%. Almost all of it is law text and
register pages: XML, HTML and JSON.

- FileSnapshotStore writes <sha256>.gz and hands back the same bytes; the
  key is unchanged, and a snapshot written before this is still read
- snapshots:compress converts the existing files one at a time: compressed
  aside, read back and checked against the sha256 in its name, renamed, and
  only then is the plain copy removed. A file whose bytes do not match its
  name is left alone and reported
- snapshots-compress.yml runs it on the box at lowest priority; it refuses
  to write unless the live app's release receipt is on code that reads a
  compressed snapshot. Dry run by default
- geometry files are served to browsers as they are and are not touched


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-11 13:32:54 +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 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
Cato 471702175e chore(deps): @bitbaum/geo-kit ^0.8.0: a tap picks the place drawn on top (#514)
A tap inside Narva selected Russia: geo-kit's pickAt ignored layers, so
the coarse country listed first won. 0.7.0 picks the topmost layer, 0.8.0
strokes borders layer by layer. No change to src/components/atlas: the
layers the atlas already sets (countries 0, admin1 1, other 2, a
country's places 3) are what the fix follows.

Claude-Session: https://claude.ai/code/session_019MDtmsK7DLpfrBNHLWnWaM
2026-11-10 14:37:13 +01:00
CatoandClaude 2dd925e9f4 refactor(brand): the owl comes from @bitbaum/design-tokens/marks (#509)
Solon's mark now lives where the fleet's marks live (design-tokens 1.6.1,
`marks/solon.mjs`), the same data OrangeCat's tiles draw. mark.ts reads it
from the package, the icons and exports are written from it with the
package's own helpers (so Solon's icon has the fleet's proportions), and
brand/solon-mark.svg is gone. The test fails if an icon drifts from the
package or a drawing of its own reappears.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-10 12:21:35 +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 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