22 Commits
Author SHA1 Message Date
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 Opus 5.5 a7ae061a79 perf(places): one national-statistics source per publisher, for every country; figures credited to whoever published them (#575)
* 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>
2026-11-12 08:58:20 +01:00
CatoandClaude 83093c5dbf feat(statistics): screen charts for sense, and explain pages with checked AI (#456)
Figures outside a metric's plausible band are left out and listed; misleading
comparisons carry a warning. Each page's figures become numbered facts; an AI
explanation is written from them only and dropped unless every number and
citation is in them.


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

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

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

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

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

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

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

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

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

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

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

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

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

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

---------

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

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

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

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

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

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

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

---------

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

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


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-08 08:38:24 +01:00
CatoandClaude Opus 5.5 22744ace39 docs: correct drift — tokens package, routes, accounts since #269 (#271)
* docs: correct drift in agent docs, README, roadmap and content

- Design tokens: the package is bitbaum/design-tokens, published as
  @bitbaum/design-tokens; Solon installs it as @fleet/design-tokens, Loki
  depends on it, OrangeCat does not (its globals.css mirrors values).
- verify includes check:places-literals; CI's verify job also runs the
  vendored-drift check, the ratification warning and the build.
- Next.js 16.4, five languages, beta wording, five properties.
- README API and page lists now match src/app (places API, members/register,
  cron, member pages, places, compare, faq, blog, roadmap, changelog, ...).
- Accounts after #269: Solon has its own accounts; OrangeCat is one way in
  (ROADMAP, FAQ, whitepaper, plan, uniform-auth superseded note).
- Member pages shipped; .env.example gaps named; ui-guidelines nav notes.

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

* docs(env): list CRON_SECRET and ORANGECAT_URL in .env.example

Both are read by the code (api/cron/places, lib/orangecat-group.ts) and were
missing from the example.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-19 12:04:17 +02:00
CatoandCursor 62afbef593 feat(places): the map on /places — communes coloured by the tax at your income, with address search and a list (#240)
* feat(places): the map on /places — communes coloured by the tax at your income, with address search and a list

Co-authored-by: Cursor <cursoragent@cursor.com>

* docs: changelog PR number

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-30 16:21:49 -07:00
CatoandCursor 3f432fb31f feat(places): import commune boundaries and publish them for maps (#238)
* feat(places): import commune boundaries and publish them for maps

swisstopo's swissBOUNDARIES3D edition becomes areas with administers
assertions and one content-addressed TopoJSON file, served with a
geo-kit manifest at /api/v1/places/geography.

Co-authored-by: Cursor <cursoragent@cursor.com>

* docs: changelog PR number

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(deps): declare @types/geojson

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-30 15:09:50 -07:00
CatoandCursor de4c161c46 feat(content): whitepaper, questions and answers, and a blog on bip-kit 0.5 (#227)
The deep side gets its long-form pages: /whitepaper, /faq and /blog,
read from content/ with bip-kit 0.5's readEntry, readCollection and Faq,
prerendered as static pages and themed through the shared tokens.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-30 07:22:49 -07:00
CatoandCursor e5933c0126 feat(ui): everyday pages in plain words, technical details one click away (#226)
Two depths: EVERYDAY_ROUTES speak plain words and keep IDs, addresses, raw
payloads and API links under a closed TechnicalDetails; the deep side stays
as technical as it needs to be. Dashboard uses the standard page header;
record entries read through event-gloss.ts; money reads in bitcoin. A
render check fails the build if an everyday page shows a stored code.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-30 06:27:05 -07:00
CatoandCursor 15ab13bfe1 fix(ui): decisions pages share one layout and speak plain words (#224)
Proposals, a proposal, and the suggestion form use PageLayout and .field.
Statuses, categories and voting rules go through plain-words.ts and
CATEGORY_LABEL instead of printing stored enum values. Error messages say
what happened and what to do.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-30 05:45:15 -07:00
CatoandClaude Opus 5.5 1783c8cd72 feat(i18n): Solon in five languages — English, German, French, Italian, Russian (#189)
Phase A of the plan of record (docs/design/2026-09-solon-plan.md, added here).

- next-intl, the fleet's i18n choice (STACK.md), in evig's layout: pages move
  under src/app/[locale]/ (API routes stay outside), English unprefixed, the
  others at /de /fr /it /ru, no Accept-Language guessing.
- messages/<locale>.json carry every sentence of the header, footer, mobile
  menu, home, /hire, /security, /credits and every photo's alt text. German
  follows Swiss spelling. Machine-drafted; native review is open.
- t() keys are typed against en.json (a missing key fails typecheck); a parity
  test fails if a language lacks, adds, empties or drops a {placeholder}.
- Language switcher in the header (native <select>) and the mobile menu.
- Pages not yet translated stay English and say so in the reader's language
  (TRANSLATED_ROUTES in site-config).
- Every internal link goes through @/i18n/navigation, so a reader on /de stays
  on /de; the last plain <a> links to internal pages became Links.
- Glarus copy corrected against sources: "since at least 1387" (first recorded,
  not continuous), plus the 2006 floor amendment that merged 25 municipalities
  into 3.
- e2e: each language's front page, the switcher, the notice, API routes
  outside languages. 41/41 locally against a production build.

Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-25 02:52:33 -07:00
CatoandClaude Opus 5.5 3704f26fc9 feat(site): rebuild Solon's front door — full-screen photography, sans headlines, plain words (#188)
* feat(site): rebuild Solon's front door — full-screen photography, sans headlines, plain words

A SpaceX-inspired redesign for Solon as governance any group can hire:
full-screen photographic sections with one statement and one action each,
a three-link header, and copy written for the person who runs a group — no
crypto or protocol vocabulary on the front pages.

- Home rebuilt: Earth at night (NASA) → the Landsgemeinde of Glarus → three
  steps → the live counting demo → the governance agent → who it's for →
  why trust it → hire. New /hire (what you get, who it suits, how it starts,
  what it costs: free for pilot groups in beta) and /credits.
- Photographs from Wikimedia Commons (public domain, CC0, CC BY), each
  registered with author, licence and source in lib/content/photos.ts;
  /credits renders that list.
- Headlines move from the shared serif to the sans (.headline /
  .headline-caps), matching OrangeCat and Loki; design:check now forbids
  font-display in Solon and requires a headline style at display sizes.
- Header: three links + sign-in + "Hire Solon" (was six mega-menus that
  wrapped at 1440px). Footer and mobile menu render one SITE_SECTIONS map;
  tests check every link resolves to a page and the header is a subset.
- Inner pages: left-aligned PageLayout; /security and /governance/voting
  rewritten; dashboard aligned to the page edge, no card-in-card.
- Fixes found by looking: phone layout scrolled sideways (grid min-width),
  mobile menu opened to nothing (fixed panel inside a backdrop-filter
  header), serif wordmark.
- CI: render checks (tests/e2e/render.spec.ts) run in the integration job
  against a built app — styled buttons, one-line header, no sideways scroll
  at 390px, menu opens. Mutation-tested: reintroducing two of the bugs fails
  exactly those checks.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>

* fix(types): commit the static-image types CI's typecheck needs

next-env.d.ts declares *.webp imports but is gitignored and only exists after
next build/dev, so verify (typecheck before build) could not resolve the
photographs. Proven by typechecking with next-env.d.ts moved away: 0 errors.

Co-Authored-By: Claude Opus 5.5 (1M context) <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 (1M context) <noreply@anthropic.com>
2026-09-25 01:01:44 -07:00
f59996b6ea chore: pnpm — the fleet has one package manager (#137)
* chore: pnpm — the fleet has one package manager

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

* fix: declare espree — pnpm's strict layout exposes the phantom dep

eslint.config.mjs imports espree directly; npm's flat hoisting provided it
by accident, pnpm does not. CI caught it (ERR_MODULE_NOT_FOUND).

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

---------

Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-09-04 00:33:33 +00:00
9ba0d54ebc chore: finish the move to the bitbaum org, and make verify honest again (#135)
* chore: the org is bitbaum now, so the links should say so

cd61f82 moved the deploy workflow to bitbaum/fleetcrown but stopped there.
Everything else still named catomean: the "view source" links on /about and
/security, the three URLs in ecosystem.ts behind them, the clone command in
the README, the design-tokens git dependency in package.json, and the
incident notes in the auto-merge sweep.

None of it is broken today only because GitHub 301-redirects a renamed org.
That redirect dies the moment anyone claims the catomean name, and it is not
a guarantee to hang a dependency resolution on. npm ci resolves the new URL
at the same commit sha, so the lockfile integrity is unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S8e9btkzguNLS4b6ShGQ9H

* fix(verify): the local gate failed on files CI never sees

`npm run verify` is the contract: green locally means green in CI. It was not.
Two kinds of file that exist on a developer machine and never in CI were
inside the gate's scope.

The harness checks this repo out a second time under .claude/worktrees/<branch>/
for concurrent sessions. Git treats that as a separate worktree, but prettier,
eslint and tsc read it as ordinary files — so `prettier --check .` failed on 88
files belonging to another branch, and tsc would have compiled that branch's
half-finished code into this branch's verdict. .claude/settings.local.json is
per-machine agent config, ignored only by the user's global gitignore, so
prettier checked a file the repo does not even own.

Both are now out of scope for all three tools, and both are ignored by this
repo rather than by whatever the developer happens to have in ~/.config/git.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S8e9btkzguNLS4b6ShGQ9H

---------

Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-01 06:07:07 +02:00
Mao Nakamoto af4df96005 chore(ci): GitHub owner maonakamoto -> catomean 2026-08-27 19:18:43 +02:00
GandClaude Opus 5 7d3dc0c44f design: one design SSOT for the stack, and a serif that means something (#81)
The tokens were hand-copied into three repos and drifted: Solon's globals.css
carried a comment claiming it matched OrangeCat's while sharing zero names or
values with it. Copies drift; imports cannot. So the tokens now live in one
place — @fleet/design-tokens — and Solon imports them.

  - globals.css goes from 168 lines to a comment and `height: 100%`
  - tailwind.config.js maps nothing; it consumes the shared preset
  - the package owns the self-hosted faces too, so changing the display
    typeface for all three products is one line in one file

Display face is now Instrument Serif. Every AI and infra company competes
inside the same dark-canvas grotesque, where the winner is whoever has the
biggest design budget; a high-contrast serif exits that comparison and reads
institutional, which is what a product whose output is *legitimacy* should
look like.

Two rules fell out of actually looking at it, both now enforced by
design:check rather than remembered:

  - the face has ONE weight, so `font-bold` next to `font-display` would make
    the browser synthesize a fake bold. Weight and tracking are declared with
    the face in the package, so a future face swap stays one line.
  - a high-contrast serif goes weak as it shrinks: at 18px the card titles
    rendered LIGHTER than the 16px body under them and the hierarchy
    inverted. Display type starts at text-2xl; below that, sans at 600. The
    uppercase, open-tracked wordmark is the one sanctioned exception.

Verified: design:check (incl. a negative test that the new rules fire),
typecheck, build, and a local prod render of the hero, cards and auth error.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-14 11:08:23 +00:00
GandClaude Opus 5 c6f4258e8d design: give Solon x.ai's spatial discipline, keeping the family palette (#79)
* design: give Solon x.ai's spatial discipline, keeping the family palette

#77 made Solon look like its siblings. It still read as compressed next to the
reference: the hero headline broke onto three lines inside a 768px column, every
section carried its own `py-20 sm:py-28` guess, and headings topped out at
text-4xl.

Colour is deliberately untouched. #ff5c00, the surface ramp and the type
families stay exactly as OrangeCat defines them — the three products still have
to read as one company. What is borrowed from x.ai is pace, not palette.

Pace and display size are now tokens, because "how much air does a section get"
is one decision and not a per-section guess — that is how a page ends up with
six slightly different rhythms:

  --section-py        clamp(5rem, 9vw, 9rem)     py-section
  --section-py-tight  clamp(3.5rem, 6vw, 6rem)   py-section-tight
  --text-display-1    clamp(2.75rem, 5.4vw, 4.5rem)
  --text-display-2    clamp(2rem, 3.4vw, 3rem)
  --text-display-3    clamp(1.5rem, 2vw, 1.875rem)

Fluid, so one confident size resolves itself per viewport instead of three
breakpoint variants per heading.

Measured rather than eyeballed, at 1440: the h1 goes 60px/3 lines to 72px/2
lines, hero padding 80px to 129.6px. The two-line break needed the hero column
widened to max-w-5xl — and that showed the h1's own `max-w-hero` never bound,
so the token is gone rather than left in place doing nothing.

`page-layout.tsx` is the shell every content page renders through, so the new
rhythm reaches /about, /features, /security and the rest from one edit.

Cards take hairline borders (border-subtle, hovering to border-default) and
p-10, and the public backdrop is dialled down — glow 0.10 to 0.07, grid stroke
0.04 to 0.025, cell 80px to 96px. Same effect, same token names as FleetCrown,
felt rather than read.

Verified: `npm run verify` green (33 tests), rendered at 1440 and 375 — no
horizontal scroll, no overflowing element, h1 lands on its 44px clamp floor.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* docs(ui): document the rhythm and display tokens

The guidelines were rewritten one commit before these tokens existed, so they
already described a system with no answer to "how much padding does a section
get". Adds the five utilities, and the rule the hero measurement taught: a
headline takes its width from its column, never from a max-width of its own.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-14 01:58:00 +00:00
GandClaude Opus 5 0c3e63d7a3 docs: make the repo describe the Solon that exists (#78)
The README documented a product that was replaced. Of the four "pillars" it
described, three referenced Prisma models that do not exist — BitcoinTransaction,
BudgetAllocation, Decision, ServiceRequest, ServiceBid. It claimed 10 models
(there are 9), an `xpub` field for multi-sig derivation, BigInt satoshi amounts,
a five-metric "Transparency Engine", and five components including
`lib/transparency-engine.ts` — none of which are in the tree. Its route map
listed `/api/bitcoin/wallet/[orgId]` and `/api/voting/[sessionId]/cryptographic-vote`;
the real API is `/api/orgs/{slug}/*`, `/api/proposals`, `/api/sessions/{id}/*`
and `/api/v1/decisions/{sessionId}`. Auth was not mentioned at all. The clone
URL was `your-org/solon`.

Reality, from the schema and `src/lib/config/governance.ts`: Solon is the
governance rail for the OrangeCat stack. Proposals become voting sessions,
members (HUMAN or AGENT) cast Bitcoin signed messages, closing writes a decision
plus a policy version and an audit event, and the treasury is watch-only — a
label and an address, with no amount field and no path that can spend. Four
categories are constitutionally humans-only. The README now says that.

Also removed, all unreferenced:
- `docs/MIGHTVILLE.md`, `docs/DEYVILLE.md`, `docs/dottown-town-profiles.json` —
  idea capture from June for a movement/rename that did not happen. Copied to
  ~/ideas/, which is the SSOT for ideas; a product repo is not.
- `docs/CODEX.md`, `docs/GEMINI.md` — near-identical copies of AGENTS.md, last
  touched 2026-01-08. AGENTS.md is the cross-tool standard and is now the SSOT.
- `ralph.sh` + `PROMPT.md` — a task runner whose header still reads "Ralph Loop
  for Revamp-Hirn"; never adapted, superseded by FleetCrown dispatch.
- `test-results/.last-run.json` — a Playwright artifact that was tracked.

Fixed docs that would actively mislead an agent:
- `docs/development/ui-guidelines.md` listed the navy palette #77 just deleted.
  It now names no colours at all and points at globals.css as the token SSOT.
- `.cursor/rules/` gave `bg-navy text-solon-orange` as the CORRECT example —
  that fails `design:check` today — and described a Marketplace nav section and
  a Transaction interface that do not exist.
- `AGENTS.md` said the theme was "Bitcoin-orange + navy", that `.env` holds
  BTCPAY_*/BITCOIN_*/Clerk keys (it is NextAuth), that verify was lint+typecheck
  (it is lint+typecheck+design:check+test), that build was not gated in CI (it
  is), and that CI never touches a database (the integration job replays
  migrations against a fresh one).

Added `.env.example` — every variable the code reads, with the AUTH_URL-behind-a-
proxy trap called out. `.gitignore` needed `!.env.example` to not swallow it.

SECURITY.md now leads with the custody model, since "no keys, no funds, no
rewritable history, a decision is evidence not authority" is the product's
actual security claim.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-14 01:31:21 +00:00
g-butandClaude Opus 4.5 d56893467f chore: add agentic development files
Add universal AI agent configuration:
- AGENTS.md - Universal guide for all AI agents
- .claude/CLAUDE.md - Claude Code specific
- .cursor/rules/*.mdc - Cursor IDE rules

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 00:21:00 +01:00