46 Commits
Author SHA1 Message Date
CatoandClaude Sonnet 5.5 663afd685e feat(law): read the communes' LexWork collections — Zug and Glarus, 14 communes, 1,164 acts with dated versions (#374)
* feat(law): read scanned commune acts by OCR, and never drop text before a late first article

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 18:52:17 +01:00
CatoandClaude Opus 5.5 7985d5a5bb feat(governance): each organization sets its own humans-only categories (#368)
* feat(governance): each organization sets its own humans-only categories

Which decision categories only people may vote on is now each
organization's own rule, not a platform rule (owner's decision,
2026-11-01).

- organizations.humans_only_categories (text[], not null) defaults to
  exactly the four categories that were hard-coded, so every existing
  and new organization decides as before. A check constraint keeps it
  to real DecisionCategory values. Migration 0019 also adds the
  ELECTORATE_CHANGED audit event type.
- DEFAULT_HUMANS_ONLY_CATEGORIES in config/governance.ts is the one
  default list; CATEGORY_ELECTORATE is gone, DEFAULT_CATEGORY_ELECTORATE
  is derived from the list.
- electorateFor(category, humansOnlyCategories) reads the organization's
  list; openSession passes it and still snapshots the electorate, so no
  past or open vote changes.
- New `humans_only` effect, paired with GOVERNANCE_RULES and applied on
  approval with an ELECTORATE_CHANGED audit event.
- Generic pages describe the default and say each organization can
  change it; the org page, /ecosystem and the proposal form use the
  organization's own list. Home copy updated in all five languages.
- Tests: default equals today's four, empty list opens GOVERNANCE_RULES
  to agents, a larger list blocks agents on the added category, effect
  schema and pairing, and the list changing only by decision.

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

* docs: humans-only categories are each organization's own rule

The owner overrode "red lines, not defaults to tune" on 2026-11-01.
Update .claude/CLAUDE.md, AGENTS.md, README, ROADMAP and the
whitepaper to say the four categories are the default every
organization starts with, changed by a GOVERNANCE_RULES decision.

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

---------

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


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

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

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

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

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

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

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

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

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

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 06:15:02 +01:00
CatoandClaude c2faab03ae fix(law): cut cantonal acts into their articles the way the cantons print them, and re-cut what is held (#357)
A sample of 30 in-force acts per authority found many held as one block
("text"): Lucerne 17, Neuchâtel 13, Geneva 10, Schwyz and St. Gallen 6,
Ticino 5 (its tax law, LT 640.100, among them). The cutter missed what the
cantons' PDFs do:
- a paragraph number glued to the text ("Art. 2 1La présente loi");
- a footnote number glued to the article's ("Art. 13" for article 1,
  note 3; "Art. 198328"; "Art. 23)"), read as the shorter number only when
  it is the very next article;
- a numbered title or a sub-letter after the § ("§ 1 1. Gegenstand",
  "§ 4 b) Wirkungsorientierung"), a starred amended article ("Art. 1*");
- "Article premier", "1er", "primo"; "Article"/"Articolo"; any capital (É, À);
- repealed articles printed as one line ("Art. 91-94 …"): the next heading
  may now be up to ten numbers on;
- "Absatz", "alinéa", "capoverso" written out are references, like "Abs.".
On the real texts: Ticino's tax law goes from 1 provision to 300, with
Art. 198 "Dichiarazione d'imposta" and Art. 192 "Termini" where they belong;
Neuchâtel's RELGSU 1 → 26; Schwyz's finance acts 1 → 15, 18 and 65.
One-item decisions ("Ziff. 1") stay whole.

`pnpm run law:text recut [--authority lu]` (and the Law text load workflow,
source `recut`) cuts the held cantonal acts again from their snapshots,
without asking LexFind again; a version's provisions are replaced only when
the new cut finds more, and each version is re-cut once per reader version
(law-text-cantonal-2).


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

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

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

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

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

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-30 23:03:14 +01:00
CatoandClaude 453e3519bc feat(law): the chat looks at fifteen provisions per place before choosing; the question set reads like a planner (#295)
Claude-Session: https://claude.ai/code/session_018Lem7GyhyyjKhmwjG8G7Ud

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-24 18:20:57 +02:00
CatoandClaude 857f3bae3d feat(law): search prefers the fundamental act; a question set measures it (#294)
Claude-Session: https://claude.ai/code/session_018Lem7GyhyyjKhmwjG8G7Ud

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-24 18:11:20 +02:00
CatoandClaude 80a4860e4d feat(law): municipal collections through one adapter, starting with the City of Zürich (#289)
Claude-Session: https://claude.ai/code/session_018Lem7GyhyyjKhmwjG8G7Ud

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-24 07:17:12 +02:00
CatoandClaude Sonnet 5.5 270cedbcd8 feat(law): Zürich's laws from the canton's own collection, dated by the canton (#285)
* feat(law): Zürich's laws from the canton's own collection, dated by the canton

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

* docs(changelog): cite the Zürich reader pull request

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

* ci(law): keep the ssh session to the box alive on long loads

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-23 11:50:09 +02:00
CatoandClaude Sonnet 5.5 a45cf1a3e9 feat(law): Liechtenstein's text, cantonal text, and every Swiss act's own page (#284)
* feat(law): Liechtenstein's text from Lilex, dated by the day it was read

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

* feat(law): every Swiss act points to its own page at the authority that publishes it

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

* feat(law): cantonal acts read as documents, cut into articles

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

* docs(law): cantonal text, official links and Liechtenstein's text on the roadmap and in the design

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

* docs(changelog): cite the text readers pull request

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

* fix(law): law:register read the first argument as the value of --file

Without --file the source name was dropped, so every run read LexFind.

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

* feat(law): provisions say whether their date is the publisher's or the day they were read

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-23 11:14:40 +02:00
CatoandClaude Sonnet 5.5 c8de3865eb feat(law): Liechtenstein's laws in the register, from the Government's Systematic Register (#283)
* feat(law): Liechtenstein's laws in the register, from the Government's Systematic Register

3,407 acts in force, named by LR number with the Landesgesetzblatt issue.
The importer now applies generic rows, so a register is a function from its
bytes to rows. Titles and numbers only; the text is the next step.

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

* docs(changelog): cite the Liechtenstein register pull request

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-23 11:01:25 +02:00
CatoandClaude Sonnet 5.5 5412aec138 feat(law): federal text from Fedlex, article by article, with its source and hash (#282)
* feat(law): federal text from Fedlex, article by article, with its source and hash

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

* docs(changelog): cite the federal text pull request

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-23 10:29:17 +02:00
CatoandClaude Sonnet 5.5 585375dddc feat(law): the register of every Swiss act, with a coverage page and API (#281)
* feat(law): the register of every Swiss act, with a coverage page and API

Lists the 33,441 acts of the Confederation, the 26 cantons and the
intercantonal agreements (22,047 in force) with title and official number,
read from LexFind's list. Refuses a read short of the count the register
states. Titles and numbers only; text comes in L1.

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

* docs(changelog): cite the law register's pull request

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-23 10:10:05 +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 2904ac30d4 feat(places): Zürich tariffs and canton multiplier from ESTV — golden fixtures match the federal calculator (#217)
- POST retrievals: RetrievalRequest.body; the snapshot is an envelope of request
  and response text, since a tariff export does not name its year
- planning may probe the source; ESTV answers unpublished years with other
  years' figures, so the adapter asks the published year range first
- estv_tax_scales (thresholds or widths per table type, variants by group,
  splitting and unread table types skipped with reasons) and estv_simple_rates
- sources estv-income-tax-scales and estv-canton-multipliers (Art. 5 URG)
- golden: Zürich and Küsnacht 2025 at CHF 100,000, single and married, match
  API_calculateSimpleTaxes within its rounding
- docs: §6.2 limits of schema v1, §8.2 sources, §8.3 envelopes and probe, §11

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-29 23:06:31 +02:00
CatoandCursor b7027f1122 feat(places): Swiss structure — FSO commune register and Zürich quarters import through real adapters (#215)
* feat(places): Swiss structure — FSO commune register and Zürich quarters import through real adapters

- adapters parse formats and name no country; which levels and schemes rows
  become is each source's options in config, checked by the adapter's schema
- bfs_communes_snapshot (every canton, district, commune on a date),
  bfs_communes_mutations (mergers as succeeds), geojson_tiers (city quarters)
- places:fetch retrieves what an adapter declares; --backfill loads history once
- importer: relation-only batches, ended places filed under their last parent
- Swiss pack: levels, schemes, metrics, income-tax model (no church tax yet)
- licence policy: opendata.swiss terms and Art. 5 URG official acts
- acceptance: Witikon resolves to Switzerland and takes no tax; reruns change nothing

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

* docs(changelog): Swiss structure (#215)

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

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-29 22:44:16 +02:00
CatoandCursor ecb064f404 feat(places): CI guards — no country literals in the engine, neutral copy (#213)
- check:places-literals (in verify): a TypeScript-AST scan of src/lib/places,
  the vendored tax model and the place page for registry keys, ISO region
  and subdivision codes, currency codes and month-days. Keys come from the
  registries, codes from Intl; the engine's own vocabulary is exempt. A unit
  test runs it with Testland's keys, so it has teeth before any real pack.
- neutral-copy test over messages/*.json, terms per language in
  src/lib/config/places/neutral-terms.ts (phrases where a word has an
  innocent governance sense); an attributed quote is exempt.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-29 20:31:34 +02:00
CatoandCursor 291939c22c feat(places): importer framework, invariant engine, chain reader; Testland imports and evaluates (P0) (#211)
One run turns a retrieval of a source into rows or a precise refusal:
snapshot under sha256, parse with the adapter's schema, map to generic
shapes keyed by identifiers, check against config (quarantining values
outside a metric's plausible band), then in one transaction sync the
registries, record the source, apply (insert, end, supersede; never
delete) and run the invariant engine over the pack's hierarchy. Every run
is a place_import_runs row; a dry run rolls back with an exact diff.

- src/lib/places/importer/{batch,validate,snapshots,run}.ts
- src/lib/places/invariants.ts, slug.ts, chain.ts
- adapters/ with the fixture adapter
- pnpm run places:import <source-key> <file> [--dry-run]
- Testland register fixture + acceptance spec: import, idempotent
  re-import, supersede on change, hamlet chain, hand-computed tax estimate,
  hamlet takes no tax, invariant failure writes nothing, quarantine, dry
  run, licence refusal
- schema spec's fixture places are now long-ended and use their own
  source key, so parallel specs never share a live hierarchy

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-29 20:08:53 +02:00
CatoandCursor d8f79bbe8c feat(places): tables, config registries and places:sync-config (P0) (#210)
The foundations of docs/design/2026-09-places-and-jurisdictions.md §4-§5,
empty. No existing table changes.

- drizzle/0010_places_foundations: jurisdictions, names, identifiers, areas,
  area assertions, relations, facts, instruments, sources, import runs, and
  the place_* registries. Named constraints built from the vocabulary tuples
  (src/lib/places/vocabulary.ts). Triggers refuse reserved identifier
  schemes on founded places, any change of origin, and every DELETE.
- src/lib/config/places: the Zod contract, the registries (empty but the
  licence policy George decided), and cross-registry validation run at load.
  Engine code takes the config as a parameter.
- places:sync-config projects the registries into the database, refuses to
  pull a key out from under data, and records each change. Every import run
  will sync first in its own transaction, so deploy needs no new step. CI
  syncs and checks on the freshly migrated database.
- Testland, a made-up country, lives only in test fixtures and proves the
  contract holds with no engine change.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-29 19:59:19 +02:00
CatoandCursor 6ab4b8d36b feat(places): vendor @bitbaum/tax-model; one drift check for every vendored package (#209)
P0 of the Places design (docs/design/2026-09-places-and-jurisdictions.md
§6.2, §11). The tax evaluator's SSOT is bitbaum/orangecat
packages/tax-model (bitbaum/orangecat#1190); Solon carries a byte-for-byte
copy in src/lib/tax-model, like collective-kinds.

check-collective-kinds-drift.mjs becomes check-vendored-drift.mjs with a
list of packages, so the next vendored package is one line, not a second
script. The npm script is now check:vendored-drift. Nothing imports the
evaluator yet.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-29 19:50:47 +02:00
CatoandClaude 805b0a3db4 ci(kinds): the vendored collective kinds cannot drift from OrangeCat's package (#201)
src/lib/collective-kinds is a byte-for-byte copy of bitbaum/orangecat
packages/collective-kinds until that package ships on its own. A copy that
can drift silently is what SSOT forbids, so CI now fetches the package's
source from OrangeCat's main and fails when any vendored file differs
(scripts/check-collective-kinds-drift.mjs, `pnpm run check:kinds-drift`).

The directory is exempt from this repo's prettier so OrangeCat's formatting
is the formatting; the files are re-copied from main as they are there.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-28 06:47:29 -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
CatoandClaude e54d9d468f feat(propose): a link that carries context lands on a form that kept it (#172)
OrangeCat's "Govern it with Solon" button sent ?from=orangecat&entity_type=…
&entity_id=…&title=… to /dashboard, and nothing in this repo read it. The
visitor pressed a button about a specific thing and landed on a page that had
forgotten which thing. /propose then dropped the query a second time on its
sign-in redirect, and a third time on the way through /join.

Now /propose reads the query into a pre-filled draft — title, a body naming
the entity with a link back, the cheapest category as default with its
consequence stated beside it and one tap to change — and the draft survives
sign-in and /join (`?next=`), so the person signs the thing they came to
sign. /dashboard redirects links already in the wild to the same place.

Two things fell out of doing this honestly:

- The form's category hints ("Humans only, supermajority") were a hand copy
  of governance.ts, read by a member right before signing. They are now
  derived from the table that binds them (categoryConsequence).
- governance.ts says of itself that changing it IS a GOVERNANCE_RULES matter.
  That sentence was a comment. CI now checks it on every PR that touches the
  file — fetches any `Decision:` trailer's document from the public
  endpoint and recounts it (category, outcome, every signature) — and when
  nothing ratifies the change it warns, in the PR, with a pre-filled link to
  the proposal that would. It never fails the job: a rules change without a
  decision is a fact the record must show, not a build failure, and nobody
  should be stuck in CI over a governance question.

Both follow one rule, now written into .claude/CLAUDE.md: a gate records; it
never blocks. Every stop shows the way forward on the same screen.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-20 05:59:10 -07:00
CatoandClaude Fable 5.1 74843fbf71 chore: rename FleetCrown to Loki (#157)
The product was renamed on 2026-09-14: bitbaum/loki, loki.orangecat.ch,
LOKI_* env keys, loki-* units. This repo referenced the old name in
17 files changed, 33 insertions(+), 33 deletions(-).
Email addresses at the old sending domain stay until the new domain is
verified in Resend.


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

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-13 16:25:55 -07:00
CatoandClaude Opus 5 a5e0391786 ci(auto-merge): call the fleet sweep instead of carrying a stale copy of it (#154)
This repo shipped its own scripts/ci/auto-merge-sweep.sh: 297 lines against the
canonical's 446, differing on 149. Every fix that landed in bitbaum/fleet since
the copy was taken reached here never — which is the whole reason SHARED.md
tracks this duplication as a ratchet rather than as advice.

Auto-merge did not appear broken, and that is the point: a sweep merges what it
can and exits 0, so a copy missing a third of the canonical looks exactly like a
working one until the missing third is what you needed.

The concrete gain is the DEPLOY RECONCILER. The old copy listed deploy.yml in
REARM_WORKFLOWS, which dispatches it once and cannot tell whether the deploy
actually landed. The canonical compares main's tip against the last successful
deploy and re-dispatches when they differ, so a deploy that never fired — or
fired and failed — is retried on the next sweep instead of leaving a commit
merged-but-not-live. That failure is invisible without it: CI green, PR merged,
box unchanged.

Also gained: checks:read + statuses:read on the caller. Public repos do not need
them, so their absence is silent here — but the caller is now identical to every
other repo's, which is what makes the next fix a one-file change.

What stays local is only what genuinely varies: the workflow_run trigger must
name the CI workflow exactly as its own `name:` field spells it, and the
schedule. Everything else is inputs.

Verified: the generated YAML parses, resolves to
bitbaum/fleet/.github/workflows/auto-merge-sweep.yml@main, and passes
base_branch / ci_workflow / rearm_workflows / deploy_workflow — all four
confirmed against the reusable workflow's declared inputs. No file outside the
workflow still references the removed script.

NOTE: this PR touches .github/workflows, which GITHUB_TOKEN cannot merge, and
scheduled sweeps read the workflow from the default branch. It needs one
hand-merge; after that the sweep here is the shared one.


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

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-07 07:38:00 -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
0708055501 refactor(db): Prisma → Drizzle — the fleet has one ORM (#136)
Stack-uniformity migration (George: "Drizzle everywhere" for fleet-owned
Postgres apps), following the recipe proven in biaslens#26. Schema parity
with the live tables is byte-exact and proven by normalized pg_dump diff
(scratch replay AND against the production database itself); the deploy
ledger on the box is pre-baselined so the cutover is a no-op for prod data.

- src/lib/db/{schema,client,enums}.ts replace prisma/* + @prisma/client
- every call site rewritten (domain, API routes, pages, scripts, tests)
- drizzle/0000_init + 0001_seed_org1 replay the full schema + seed on a
  fresh database (CI integration job now runs drizzle-kit migrate)
- prisma deps, prisma.config.ts, generate steps and docs mentions removed


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-01 22:28:36 +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
GandClaude Opus 5 45935a4a02 chore: add a formatter (#123)
* chore: add a formatter, matching the style this repo already writes

singleQuote=false was chosen by counting this repo's own
imports, not by fleet decree. The fleet is genuinely split and the two repos
that already had a .prettierrc disagreed with each other, so there was no
standard to restore. Quote style does not cross repo boundaries; having a
gate does.

Markdown is ignored for now — prettier rewraps prose, which would bury the
real diff.

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

* style: format with prettier (87 files)

Mechanical. No behaviour change. This SHA is listed in
.git-blame-ignore-revs so `git blame` skips it.

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

* chore: teach git blame to skip the reformat

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

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-31 08:15:49 +00:00
Mao Nakamoto af4df96005 chore(ci): GitHub owner maonakamoto -> catomean 2026-08-27 19:18:43 +02:00
GandClaude Opus 5 456c40cbc0 design: put every heading on the display face, and teach the gate to notice (#89)
The dashboard was still bold Inter while the marketing pages ran Instrument
Serif — 21 headings across 13 files, the whole signed-in half of the product
reading as a different company than the half that sells it.

The gate could not have caught this. Every type rule in design-system-check.js
fires only once `font-display` is already present, so a heading that never
opted in was invisible to it. That is the blind spot that let the drift grow,
so this closes it rather than just sweeping the instances: above text-2xl the
display face is now the default, enforced, with font-mono exempt because a
balance or a hash is data, not a heading.

text-2xl and text-3xl both land inside --text-display-3 (clamp 1.5→1.875rem),
so rendered sizes are preserved; font-bold is dropped because the face ships
one weight and asking for another gets a synthesized fake.

Verified: negative-tested the new rule (reintroducing one bold-Inter heading
fails the gate, restoring it passes), npm run verify green, and the built page
measured in a browser — h1 renders "Instrument Serif" 400 at 24px with the
real face loaded, not a serif fallback.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-15 09:44:44 +00:00
G 1bbff998c6 feat(treasury): watch-only source script, stop claiming tx records (#88)
* feat(treasury): operator script to register a watch-only source, and stop claiming tx records

The dashboard already reads mempool.space. The marketing page still said
transactions were stored with txids. They are not. The script writes an
address George already watches — it does not invent one.

* fix(honesty): the hero offers the latest vote, not a live one

The only production session is closed. Promising a live vote was a lie.
2026-08-15 00:59:12 +00:00
GandClaude Opus 5 55f993cf93 deps: @noble v3, proven byte-identical on the signing path (#85)
@noble/secp256k1 2.3.0 -> 3.1.0 and @noble/hashes 1.8.0 -> 2.3.0. Both are
breaking majors on the code that decides whether a vote is real, so the
interesting part is not the upgrade — it is the evidence that it changed
nothing.

The tests could not supply that evidence. Every one of them signed and
verified with the same code, so a change that altered the wire format on both
sides would have passed all fifteen while silently invalidating every
signature a real wallet produces. Four known-answer tests now close that:

- Address derivation is anchored to BIP173's own published vector. The key is
  secret exponent 1, so its public key is the secp256k1 generator and its
  P2WPKH address is the one written into the spec.
- The signed-message digest is rebuilt from the spec inside the test rather
  than imported, and compared byte for byte.
- The signature base64 is asserted literally. RFC6979 makes signing
  deterministic, so this is stable across versions unless nonce derivation or
  encoding moved.
- OpenSSL, via node:crypto, verifies the signature independently. It is the
  only check in the repo that is not noble verifying noble.

All four were written and run against v2 first, so they are known to hold
before the upgrade rather than fitted to it afterwards. They pass unchanged on
v3: the golden signature is the same base64, so every signature already stored
in the treasury's audit trail still verifies.

The API moves themselves:

- hmac wiring is now secp.hashes.{sha256,hmacSha256}, and hmacSha256 takes a
  single message instead of varargs.
- sign() returns bytes, not a Signature. Recovery comes from
  format: 'recovered' (65 bytes, recovery || r || s), and prehash: false is
  now load-bearing — the Bitcoin digest is already double-sha256, and letting
  the library hash again would sign the wrong value.
- Signature.fromCompact().recoverPublicKey() became the top-level
  recoverPublicKey(), so verification rebuilds the recovered encoding from the
  Bitcoin header || r || s layout.
- randomPrivateKey -> randomSecretKey; secret keys are bytes, no longer hex.
- @noble/hashes v2 moved its submodules: sha256 to sha2.js, ripemd160 to
  legacy.js, and every deep import now needs the .js extension.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-14 14:44:28 +00: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 05f3ecef68 design: one visual language across OrangeCat, FleetCrown and Solon (#77)
* fix(auth): sign-in control visible on first paint

The loading branch rendered an empty placeholder, and SSR is always in
the loading state — so the nav's sign-in control was invisible until the
client-side session fetch finished. Default to the signed-out button
instead: most visitors are signed out, and a signed-in user just sees it
swap to their name.

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

* design(solon): one visual language across OrangeCat, FleetCrown and Solon

Solon looked like a different company: a light, blue-tinted site next to two
dark, orange-accented ones. The type system was already shared with OrangeCat
(Inter + Space Grotesk, same sizes, same nav height) — the divergence was the
colour canvas and the chrome around it.

Token SSOT now uses OrangeCat's vocabulary verbatim — same names, same values,
in HSL channels so alpha composes:
  --surface-public/page/base/raised/overlay, --text-primary/secondary/tertiary,
  --border-subtle/default/strong/interactive, --public-accent (#ff5c00),
  --tracking-display/label/caps, --shell-max, --public-nav-height,
  --radius-control/surface.
Solon's private palette (--navy*, --solon-*) is deleted, not aliased, so any
leftover usage fails the build instead of quietly rendering the old look. The
accent orange was #f97316 here and #ff5c00 on the other two — one value now.

Chrome:
- Hero is full-bleed over a shared backdrop (accent glow + masked grid, the
  same effect FleetCrown uses) instead of a navy rectangle floating in a
  gutter. The root layout no longer wraps every page in a container; sections
  own their width via .section-shell, which is why the box existed.
- Headline is the proposition, not the wordmark — the brand is already in the
  nav, exactly as on both siblings. No copy was rewritten: the existing
  tagline key moves to <h1>, so all four languages still work.
- Nav adopts the shared 76px height, translucent-over-canvas, accent CTA.
- Footer, cards, logo badge and the auth error card follow the same primitives.
- Mono is IBM Plex Mono (OrangeCat's) — a Bitcoin address should look the same
  on both sites.

Two latent bugs fixed on the way:
- Every shadow utility pointed at --shadow-* vars that were never defined, so
  `shadow-sm` rendered nothing. Removed; hierarchy is border + type.
- THEME in site-config.ts was a second, unused theme definition in TypeScript.

The design gate now fails on the legacy palette, on max-w-7xl, and on raw
radius/shadow utilities, so this cannot drift back.

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

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-14 03:08:37 +02:00
GandClaude Opus 5 cb6bd9e6b5 fix(ci): report why a PR could not be woken instead of guessing (#76)
The wake path read `mergeable` from the cached `gh pr list` payload. GitHub
computes that lazily and invalidates it whenever the base moves — which is
precisely when this workflow runs — so it is often UNKNOWN. A conflicted PR
therefore slipped past the CONFLICTING branch and was told it was "already
current with main", pointing at close/reopen, which would not have helped.

That is this file's own bug class: a skip line that reads plausible and
sends the reader somewhere useless. So on failure, ask GitHub for the real
mergeable state and name the actual reason — conflict, or genuinely current.
One extra API call on a path that only runs when a wake has already failed.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-14 01:02:59 +00:00
GandClaude Opus 5 1f67bab06c fix(ci): wake PRs that predate the CI floor so they can ever be judged (#75)
The sweep merges a PR only if it "has at least one check". Correct — but
GitHub never retroactively runs workflows, so every PR opened before this
repo gained its CI floor (2026-08-05/08-07) has zero checks, cannot gain
any on its own, and parks permanently. The script already spotted this and
only warned about it; warning does not move them.

Worse, they report as CLEAN, which reads as "ready to merge" and actually
means "nothing ever objected". Waking solon's five showed what CLEAN was
hiding: lucide-react, @noble/hashes and @noble/secp256k1 all fail verify —
secp256k1 v3 removes hmacSha256Sync, randomPrivateKey, sig.recovery,
toCompactRawBytes and Signature.fromCompact, which is the Bitcoin message
signing path. Only @playwright/test was genuinely green (merged, #37).

So the sweep now pushes such branches via update-branch, which fires
pull_request:synchronize and produces real checks. This grants nothing: a
woken PR still has to go green to merge, and a red one parks exactly where
it already was — it only replaces "no evidence" with evidence.

Capped at WAKE_MAX_PER_SWEEP (3) so a backlog does not stampede the
runners; waking does not touch the base, so the one-car-per-sweep rule
does not apply. Conflicted branches cannot be updated and are left to the
existing CONFLICTING report instead of burning a slot.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-14 00:40:33 +00:00
GandClaude Fable 5 8b3339fa58 feat(auth): sign in with OrangeCat — recognition, never authority (#73)
Solon gets its first and only login: NextAuth v5 with a single orangecat
OIDC provider (identity scopes only), mirroring FleetCrown's proven
config (client_secret_post, PKCE+state). Deliberately absent, as doctrine:

- no passwords, no registration — membership is granted by vote (or the
  documented operator bootstrap), never by a signup form
- no adapter, no auth tables — the JWT carries the OrangeCat actor id;
  membership is resolved fresh from members.oc_actor_id per request so a
  30-day token can never outlive a roster change
- no middleware — every page and API stays public; a session only adds
  recognition (the middleware-strangles-receivers class cannot exist here)
- anonymous OrangeCat accounts are rejected at the door (governance
  identities must be attributable); /auth/error explains why, and the
  gate is pinned by unit tests

Surfaces: nav sign-in control (hidden when the OAuth pair is unset;
SessionProvider keeps marketing pages static), /account showing OC
identity + live membership status, add-member.ts --oc-actor to link a
human member to their OrangeCat identity.

OC side has been ready since orangecat#661 (client registered, secrets
staged in /opt/solon/shared/.env); AUTH_SECRET staged alongside.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 17:00:09 +02:00
G 488e06be10 refactor(design): one token language, and a gate that fails on slop (#72)
Solon was speaking Tailwind slate/gray while OrangeCat and FleetCrown
speak semantic surfaces. Components now use the same names
(text-fg-*, bg-surface-*, border-default). Radii flatten to 8px.
Brand navy is a solid surface, not a gradient. design:check is in
verify so the next slate class is a red build, not a vibe.
2026-08-13 10:00:12 +00:00
GandClaude Fable 5 b6ea9e776e feat(governance): vote spine end-to-end — propose, open, vote, close over HTTP (#66)
S3 of the Solon v1 plan: the domain layer gets its public write surface, a
reference agent signer, and a database-backed acceptance spec in CI.

Routes (thin Zod-validated shells over lib/domain):
- POST /api/proposals — file a signed proposal; the Bitcoin signature over
  proposalMessage() is the authorization, and AGENT proposers must also
  present their transport API key (Authorization: Bearer sk_solon_…)
- POST /api/proposals/[id]/open — open the voting session (permissionless by
  design: the proposal is already signed and public, opening only starts the
  clock, and it can happen exactly once)
- GET /api/sessions/[id] — session, snapshotted rules, live tally
- POST /api/sessions/[id]/votes — cast a signed vote (replaces
  /api/voting/[id]/cryptographic-vote; UI + integration page updated)
- POST /api/sessions/[id]/close — close and decide the outcome

New domain code:
- lib/domain/proposals.ts createProposal(): content binding via sha256 of
  canonical JSON (lib/domain/canonical.ts — the cross-repo contract OrangeCat
  will re-hash against, pinned by golden-hash tests)
- closeRefusal() guard: a session cannot be closed while the voting window is
  open unless every eligible member has voted — nobody slams the door on a
  tally they like

Scripts:
- scripts/agent-vote.ts — reference agent signer (privkey from the agent's own
  env, signs and POSTs; the key never leaves the agent's box)
- scripts/add-member.ts — documented operator bootstrap for the genesis
  roster, with MEMBER_ADDED audit events and one-time API-key minting

CI: new `integration` job — postgres service container, `prisma migrate
deploy` on a fresh database (proves baseline + seed replay), then the
vote-spine integration spec: propose (agent transport auth enforced) → open
(rules snapshotted) → three signed votes → early-close refused → full
participation closes → APPROVED → policy v2 activated referencing the
session, v1 superseded, every step in the audit trail; plus the humans-only
electorate gate. Verified locally against a dockerized postgres 16.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 19:41:19 +00:00
G bed669eea2 fix(ci): declare the failing-job list before the branch that can skip it (#63) 2026-08-07 09:53:52 +00:00
G 1394f90fce fix(ci): a red base must not trap the PR that repairs it (#62) 2026-08-07 09:35:42 +00:00
G 35b77b8e7c fix(ci): stop skipping conflicts, and keep branches current (#59) 2026-08-07 07:12:01 +00:00
GandClaude Opus 5 d96e6576a5 fix(ci): drain the merge queue oldest-first, not newest-first (#58)
`gh pr list` returns newest-first, and the sweep merges the first eligible PR
then stops. So the newest green PR wins every sweep, and an older one can wait
indefinitely.

Observed in maonakamoto/fleetcrown on 2026-08-06: two consecutive sweeps merged
the two newest PRs while three older green ones sat untouched and were never
even evaluated. With several agent sessions opening PRs continuously that is
starvation — and it starves the worst candidate, since the longest-waiting PR
is the one whose checks were proven against the most now-stale base.

PR numbers increase monotonically with creation, so sorting ascending is FIFO.
The ordering was never a decision, just whatever gh happened to return.

Fixed upstream first (fleetcrown #182) and verified in production there: the
sweep immediately after it landed correctly took the oldest open PR rather than
the newest. This is that one-line change, applied to the fleet.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-06 13:43:25 +00:00
G a0728dccd7 ci: green PRs merge and deploy themselves (#55)
* ci: add the auto-merge sweep policy

* ci: green PRs merge and deploy themselves
2026-08-05 19:18:07 +02:00