A metric page was 14,890 px on a phone: the figure for the place asked for
appeared only as the last row of a data table, under a 187-row table and
~190 checkboxes, and every empty state and diagnostic panel was open.
Now the page leads with the place's figure (year, unit, rank, change since
the first year, and one link to the publisher's own number); then a short
ranking around the place beside the globe (Atlas via MetricMap, its table
removed); then the place year by year; then the sources. Scope, data checks,
an empty law or enforcement record and the AI explanation are behind one
closed "More about these figures". Every figure in the ranking opens the
publisher's page it was read from. 4,700 px on a phone.
- sanity: few_places counts the places the page ranks, not the one chosen
("Only 1 place(s) to compare" on a page that ranks 187).
- one place picker; several places and years behind a disclosure.
- a place asked for with no figure says so instead of silently showing all.
- one decimal count per page, so a column reads evenly.
- map caption no longer reads "Rule of Law, :" for a unitless measure.
- index rows open the measure on the place chosen there.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* feat(globe): one globe, one level per tap, one colour scale with its legend
The home page, /places, /places/tax and every statistic now draw the same
globe (`Atlas`, configured by `mode` and `layer`), not two renderers with
their own colours.
Drill-down: what is drawn and what a tap can reach follow the place chosen,
never the zoom (`drill.ts`). World -> country -> its first-level places
(Wyoming whole, beside the other states) -> the places Solon draws there
(Wyoming's counties) -> a county's towns. A tap reaches only a child of the
place open; Back goes up one level. Opening the United States used to draw
Wyoming's counties directly, so the tap after "Wyoming" chose a county.
The map data now carries the levels between a country and its drawn places
(`above`), the pack's ISO 3166-2 places (`regions`, so Texas opens its page),
and how much law Solon holds at each place (`law`, from counts.ts).
Colour: one scale from the design tokens, read out by a legend under the
globe on every page: acts of law in force, 1-9 to 10,000 and more, and
"none yet", which is now the colour such places are painted.
Phone: the canvas takes `touch-action: pan-y` so a vertical swipe scrolls the
page; town dots answer within 22px (a 44px target), nearest first; Back,
the place's page and the legend sit outside the canvas.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(ci): give tests 30 s on the merge check's shared, low-priority runners
Three CPU-heavy unit tests overran Vitest's 5 s default when the laptop ran
two forge-ops jobs at nice 15 and failed solon#607's merge check on code that
passes everywhere else.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* test(law): build each authority's chain once in the counts check
The check rebuilt every authority's chain once per pair (quadratic); it took
5–11 s and timed out under load, failing unrelated changes' verify. Same
assertion, chains computed up front: 0.18 s.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
* feat(statistics): one place across every measure, by theme — not 34 full rankings
/statistics was ~82 desktop / 134 phone screens: 34 ranked lists of every
country (2,923 rows), no way to find a place, the calculator mid-page.
- Pick a place (default Switzerland, ?place=): one row per measure with its
latest figure, year and where it stands in words ("Higher than 23% of the
186 other places", or highest/lowest), grouped into six themes.
- Themes in config (lib/config/statistics/themes.ts); a test keeps every
statistic in exactly one theme and every theme named in all five languages.
- The full ranking of every place stays one click away on each measure's page.
- The weighting calculator is folded until opened (opens itself when a link
carries weights). Now ~9 phone / ~5 desktop screens.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
---------
Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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>
Removes the fleet auto-merge sweep caller (and wake chain where present);
checks run on pull requests only, not again after merging; a deploy that
waited for CI on main now deploys on push. The forge merge check
(forge/verify) verifies each PR on its merge result and merges it.
Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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>
* 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
* fix(law): a page is translated when its reader asks
The translation loader asked on every view of a law page whose language was
not cached yet, so anything that ran the page's script spent the free AI day
every app on the server shares. On 14 Nov every labelled Solon call was law
translation. The page now offers "Translate this page"; a tap is a person.
What one reader had translated is stored for the next.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtUQb9BM11ycpApwGq
* test(person-seat): each seat joins after the last, so 'first to join' is decided
joined_at is stored to the millisecond; two seats inserted in a row could
share it, the tie fell to the random member id, and the backfill clash test
expected A before B one run in a few (CI on #586). The helper now gives each
seat a distinct, increasing join time.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtUQb9BM11ycpApwGq
---------
Co-authored-by: Claude <noreply@anthropic.com>
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>
Each ai-kit call names its feature (governance-chat, law-ask, law-translate,
statistics-research, statistics-explain, dictation), so the server's usage log
can say what Solon spent the shared free pool on. On 14 Nov Groq's whole free
day was used by Solon before 09:10 UTC and the log could not say for what. A
test keeps a new call from arriving without a label.
Claude-Session: https://claude.ai/code/session_019MDtmtUQb9BM11ycpApwGq
Co-authored-by: Claude <noreply@anthropic.com>
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>
* 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>
The limiter backs off 30 s from when the shared store FAILED, so the
back-off ends 30 s plus however long the failure took. The test asked at
exactly +30 000 ms and failed whenever the rejection took a millisecond:
twice in CI on 2026-11-13, the second time on main, which blocked the
deploy of #582.
Claude-Session: https://claude.ai/code/session_019MDtmtUQb9BM11ycpApwGq
Co-authored-by: Claude <noreply@anthropic.com>
A law page in a language Solon does not hold yet asks the server to
translate it as soon as it is opened, by anyone and by any crawler that
runs the page's script. With the free pools spent, every batch of every
page still walked every model: the fleet usage log showed 29 answered and
1,783 failed calls from Solon in ninety minutes on 2026-11-13, against the
pool every app on the server shares (it is why the Cat could not answer).
- translateMissing stops at the first batch nobody answers and reports it
(onUnanswered); a batch whose answer fails its checks still only skips
that batch.
- /api/law/translate pauses ten minutes after that, answering 503 without
asking a model, and answers 204 to a crawler's page view.
Tests: translate-guards (pause, crawler names, a person's browser passes);
translate.integration gains 'stops at the first batch nobody answers'.
Claude-Session: https://claude.ai/code/session_019MDtmtUQb9BM11ycpApwGq
Co-authored-by: Claude <noreply@anthropic.com>
The key was retired on the box on 2026-11-13 (loki fleet-env.sh retire):
it sat on a billed Google project and cost about $567 on 10-11 Nov. This
workflow could have written it back into this app's env.
Claude-Session: https://claude.ai/code/session_019MDtmtUQb9BM11ycpApwGq
Co-authored-by: Claude <noreply@anthropic.com>
* 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>
* 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>
/places printed Liechtenstein as 3,748 laws and its place page as 3,412
laws in force. Both were read from the same coverage query; they counted
different things. 3,412 is the national acts in force whose text Solon
holds; 3,748 is those plus the 336 of the eleven communes. The atlas list,
the globe tooltip and the /places/world tiles printed the total with a
bare "laws", while the place page and the Law page print the national
count and list the communes below it.
- counts.ts gains heldOf(coverage): what a count counts, said once. The
globe, the place page and loadLawCounts all build from it.
- globe.ts no longer sums a country's authorities itself; it reads
rollUp from counts.ts (the test still checks it against that old sum).
- The atlas list row, the map tooltip and the world tiles print `own`,
the figure the place page prints. The shade still covers everything
within. A country holding only communal law says so ("Regions and
communes: N") instead of "Places only".
* 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>
* 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>
* perf(places): one national-statistics source per publisher, for every country it covers
The OECD's and Eurostat's series were one source a country (68 sources, 310
requests a cycle) and the pack countries had World Bank sources of their own.
Each publisher is now one source that asks for every country at once: SDMX's
+-joined reference areas, JSON-stat's repeated geo. 17 requests instead of 350.
- A metric names its reader (series.read, and database for a World Bank series
outside the WDI); a publisher's source is generated from the metrics that name
it, so a new statistic is its metric and nothing else. Retired metrics are no
longer read.
- A pack's sources are computed from the sources that name the pack; a written
list that differs is a configuration error.
- formerKeys keep what was read under a source's old key credited to it:
findSource resolves them for a page's sources, coverage and budgets.
- A figure is credited to its metric's series where that reader read it, else
to the source that supplied it.
- A batch of figures alone leaves out, and reports once per place, figures for
a place not held here.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuJdjaMYdbLjujoC3k
* fix(places): left-out country figures are read again; one line per publisher; gaps reported
From an adversarial review of the previous commit:
- A retrieval that left out figures for a country not held here was recorded
as applied, so the same bytes were skipped as unchanged and the figures
never arrived. It is now recorded with a +partial importer version and read
again on the next run. Only a country is left out; any other unknown place
(a mistyped commune number in a hand-kept table) still fails the run.
- An unchanged figure keeps the key it was first read under, so a place or a
budget could list the same publisher twice. Both now merge by the source a
key resolves to, dated by its latest reading.
- Sources of many countries reported no gaps at all. They now report one line
a series: the countries asked for that it holds no value for (adapters/gaps.ts).
- Tests that passed for the wrong reason now fail on the defect they name: a
real two-country Eurostat cube, coverage with the current key read last, a
former key resolving to a publisher other than the series'.
- Stale docs: the Eurostat fetch command, where OECD_MEMBERS and
EUROSTAT_GOV_COUNTRIES live, the World Bank's request count.
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>
* fix(membership): one key cannot hold a second seat under its uncompressed address
verifyMessage named only the addresses of the serialization the header
chose. The header's compression flag is not signed, so the holder of a key
seated under its compressed address could lower the header by 4 and claim
the uncompressed P2PKH address with the same r||s. keyAddresses now always
holds every standard address of the recovered point: P2PKH of the
uncompressed key, and P2PKH, P2WPKH and P2SH-P2WPKH of the compressed key.
Validity stays tied to the claimed address and the header.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmubu4vMeqp2pdae1Zy
* fix(person-seat): decide on fresh person tags; a stored tag is only a cache
After an OrangeCat identity is handed over its tag changes, so the tag
Solon stored at admission was wrong both ways: the former holder was
refused (and the operator told the two were once linked), and the new
holder could take a second seat.
- personTagsFor asks OrangeCat for many accounts in one request (chunked
at 100); personTagFor uses it.
- No OrangeCat client configured is now "could not ask", not "cannot be
told apart", so add-member refuses instead of seating unchecked and the
backfill exits 1.
- seatHeldByPerson asks for the candidate and every non-retired human seat
at once, decides on those answers only, and rewrites stored tags that
changed (null for one OrangeCat now leaves out). planPersonTags never
writes one tag to two seats; a clash between existing seats is reported
instead of thrown, and add-member prints it.
- backfill-person-tags asks once per organization per 100 seats, has a
--refresh mode, and its dry run finds clashes between untagged seats.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmubu4vMeqp2pdae1Zy
---------
Co-authored-by: Claude <noreply@anthropic.com>
Overrides covered only languages and currencies. Capital, population,
area, government, head of state and of government, founding date and
website came from Wikidata with no way for a sourced correction to replace
them. Every one of them can now be overridden, for any place, in the
same table and the same shape as Wikidata's data; the card prints the
citation beside the value as it already did for languages.
- FactOverride is typed per fact; overrideProblem holds each row to its
fact's form (codes, names with English, a positive count and year, an
https source) and the table's test runs it on every row.
- applyOverrides is one generic function; loadWorldProfile takes the
table as an argument so a test can hand in made-up rows.
- No data changes: the one row (South Ossetia's languages, its
constitution, Art. 4) is unchanged. No place is named in code.
Claude-Session: https://claude.ai/code/session_019MDtmup8GiNe1XJoj1caTC
Co-authored-by: Claude <noreply@anthropic.com>
Checked on production after #560: the /places index linked the pack summary
by its key (/places/united_states, /places/south_ossetia: 308), and every
country no pack holds was linked as /places/<slug>, which answers 307 to
/places/world/<slug> (the world list, the atlas, the claimant on a contested
place's comparison: /places/georgia). The comparison table linked columns by
slug_path.
- regionHref (place-href.ts) applies the place page's own rule: a pack's
root; else the world pack's place for an ISO country; else the entry's own
page for a claimed place or one the world pack does not hold.
- The index uses packHref; comparison columns carry their canonical path.
- A test fails when any file other than place-href.ts and the redirects
themselves writes a /places/ path from a variable.
Claude-Session: https://claude.ai/code/session_019MDtmup8GiNe1XJoj1caTC
Co-authored-by: Claude <noreply@anthropic.com>
- A retrieval whose bytes the source last applied, read by the same importer,
is recorded as an applied run marked unchanged and goes no further. The
importer version now carries a hash of the source's options and packs
(applied.ts, importerVersion), so a changed option reads the same bytes
again; the repo-file importer uses the same string.
- Adapters say how retrievals compare: independentRetrievals (World Bank,
OECD, Eurostat: one part each) against their own address; any other
against the source's latest reading, so an earlier edition re-applies;
publishesFiles (boundaries) always read again. The snapshot is kept either
way.
- place_ancestors is rebuilt only when places or part_of relations changed
(a non-concurrent refresh locks it against page reads), and once a day by
the queue worker for relations whose validity starts or ends later.
- Facts are compared only for the metrics a batch states, and superseded and
inserted a thousand rows a statement instead of one.
Measured locally on a fresh database: an unchanged file now takes about a
second (process start); the 4,759 subdivisions import in 7 s (was 10).
Claude-Session: https://claude.ai/code/session_019MDtmuJdjaMYdbLjujoC3k
Co-authored-by: Claude <noreply@anthropic.com>
- 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>
The figures on country pages had loaded for four countries. Two causes:
- The cron route did all its work inside the request, and the box's timer
stops its curl at 300 s. It now starts one worker per process that drains
the queue of sources the run log says are behind (importQueue: latest run
not applied on or after the last day the cadence names) and answers at
once. A source never loaded loads whatever its day; a failed one is tried
again a day later, a week later after three in a row; a fetch that fails
before any import is recorded as a failed run. The route answers 500 when
a run failed since the last call. Replaces firstLoads.
- The World Bank's indicators were one source a country: 235 sources, ten
requests each, all due on the 9th. The adapter now also reads many
countries in one request (country/all), and the world pack has one source,
worldbank-wdi-world: ten requests. Pack countries keep theirs.
Also: a request that gets no answer is retried twice (the World Bank's API
hung for two minutes and answered the same request in half a second); a
profile's figures are ranked in one query instead of one per figure.
Claude-Session: https://claude.ai/code/session_019MDtmuJdjaMYdbLjujoC3k
Co-authored-by: Claude <noreply@anthropic.com>
OrangeCat's 'Govern it with Solon' sends a signed-out visitor to /propose
with the suggestion in the link. The draft survives sign-in and joining, but
the gate showed only 'Only members can make a suggestion' and two buttons
(seen on a phone, 2026-11-12): nothing said their words were kept, so the
page read as having forgotten what they came for.
The gate now shows the suggestion's title and says the form opens with it
filled in once they are a member.
Claude-Session: https://claude.ai/code/session_019MDtmtUQb9BM11ycpApwGq
Co-authored-by: Claude <noreply@anthropic.com>
A person on OrangeCat can hold several identities, each its own account
with its own actor id. A seat goes to an account, so one person could hold
several seats in the same organization, one per identity.
Solon now asks OrangeCat for a person tag per account (orangecat ADR-0014
D7): two accounts carry the same tag exactly when one person holds both.
The tag is keyed per client and per scope, and Solon's scope is the
organization, so it says nothing about who the person is or about their
seats elsewhere.
- members.person_tag, and a unique index on (organization, person_tag) for
human seats that are not retired. A suspended seat still counts: a
suspension is not dodged by being seated under another identity.
- seatHeldByPerson is what an admission asks before giving a seat. Three
answers: may be seated (with the tag to store), already seated (naming
the seat), or OrangeCat could not be asked, which is not a 'no' and not
a licence to seat either.
- The founding seat and an organization's founder are tagged as created.
No clash is possible there (nobody else is on the human roster), so the
seat never waits on another service; a missed tag is picked up by
scripts/backfill-person-tags.ts.
- scripts/add-member.ts checks before seating an --oc-actor, and refuses
when it cannot ask unless --skip-person-check is passed.
- 0034 also carries a snapshot correction: 0033 added
legal_provisions.heading_path by hand without recording it.
Claude-Session: https://claude.ai/code/session_019MDtmubu4vMeqp2pdae1Zy
Co-authored-by: Claude <noreply@anthropic.com>
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>
Found by running the order-aware verify offline on 27 acts; each cause is generic:
- footnote marks inside an annex, a heading or a one-block page glued digits to words
- a title above a single article (sacht before art), a title line under a numbered heading
(tit1ue) and a run of headings with no text between them were not held
- an annex's headings are listed above each annex, not once per page (II. printed twice)
- table cells with bare text were joined into one word (blockText)
Claude-Session: https://claude.ai/code/session_019MDtmt65Ai8jku68kDmxUU
Co-authored-by: Claude <noreply@anthropic.com>
* fix(membership): one Bitcoin key is one seat, under any of its addresses
verifyMessage accepts a claimed address when it matches any standard
derivation of the recovered key (P2PKH, P2WPKH, P2SH-P2WPKH), and the
founding-seat check compared the claimed address string. A key already
seated under one form could take a second seat in the same organization
under another: an agent's service key seated as 1..., then claimed again
as bc1q... by a human founder.
verifyMessage now reports every address the recovered key answers to,
and registerMember refuses when any of them holds a seat. No schema
change: existing members are stored by address only, and the public key
cannot be derived from an address, so the comparison stays on addresses.
The integration test seats a key under the legacy form and claims the
other two; it fails on the previous check.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmubu4vMeqp2pdae1Zy
* docs(changelog): one Fixed list per day
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmubu4vMeqp2pdae1Zy
---------
Co-authored-by: Claude <noreply@anthropic.com>
- verify reads PDF versions too (any authority): the text layer is read again, cut the way the
reader cuts it (repeated header/footer lines, page numbers, split words), and compared in
order. A scanned PDF is reported as not compared. A short title block at the start is
reported as such, never as word for word.
- parseCantonalProvisions keeps what comes before the first article when it is more than a
title (enacting formula, legal basis), not only when the first heading is a later number.
Claude-Session: https://claude.ai/code/session_019MDtmt65Ai8jku68kDmxUU
Breadcrumbs, child lists, the atlas, search, the map and the places API built
URLs from jurisdictions.slug_path; for a pack root written with underscores
each click redirected once. The loaders now carry the canonical path from
place_paths (canonicalPathSql), and placeHref/packHref in place-href.ts build
every link from it. Tests: a pure one with divergent paths, and an
integration one that resolves every rendered link through findPlace.
Claude-Session: https://claude.ai/code/session_019MDtmsegw9dJ7eykLcT7Fe
- Provision.headingPath (jsonb heading_path, migration 0033, additive): tit1/tit2/tit3 of a
gesetze.li page are attached to the articles under them, shown above the first one, and
counted by law:text verify. A heading is still not a provision.
- verify: a gazette masthead table is page furniture (FURNITURE_TABLES), footnote marks and
inline tags (CO<sub>2</sub>) are read as the reader reads them.
- verify: a sequence score (Myers diff over words) and the longest missing run next to the
bag score; an act is word-for-word only when every page word is held in the page's order.
Fixtures: Kundmachung 2022308000, AIFMV and Waffengesetz excerpts.
Claude-Session: https://claude.ai/code/session_019MDtmt65Ai8jku68kDmxUU
FACT_OVERRIDES (src/lib/config/world/overrides.ts) is a table of place, fact,
value and citation; applyOverrides takes it ahead of Wikidata in
loadWorldProfile and the profile card prints the citation beside the fact. No
place is named in code. First row: South Ossetia's official languages are
Ossetian and Russian (Constitution, Art. 4), not Wikidata's Georgian, Russian.
Claude-Session: https://claude.ai/code/session_019MDtmsegw9dJ7eykLcT7Fe