mirror of
https://github.com/bitbaum/solon.git
synced 2026-12-04 05:07:04 +01:00
Phases B and C of docs/design/2026-09-solon-plan.md, plus George's 2026-09-25 asks (a page per kind of group and one comparing them, network states, the art and science of governance, how Solon works with OrangeCat and Loki, a best-in-class menu). - /for compares companies, villages and towns, associations and co-ops, communities and network states side by side; /for/<slug> is one page per group (what goes wrong today, how Solon helps, example decisions, the rule template, what works today, the detail folded). Network states get the verified definition (Srinivasan 2022) and the seven-step path mapped to Solon, with a neutral stance and honest statuses. - /governance/ideas: Solon of Athens, the Landsgemeinde (Glarus as the model; Appenzell's 1990 court ruling as the lesson on who counts), Condorcet and Arrow, Ostrom, exit and voice, panarchy and Nozick, charter cities, the network state — every claim checked against sources, with the caveats the sources insist on. - /governance/new-era: records, money, work, connection, making, energy — what changed, what it means, and the limit of each; what technology cannot do. SMR status stated as of 2026, not hyped. - /platform: Solon decides, OrangeCat pays, Loki works; one decision start to finish; what works today vs next; "evidence, not authority" folded. - Mega menu: four panels (use cases, governance, platform, decisions), each with summary, every page described in one line, and a featured photograph; click to open, Escape/outside/navigation to close; the mobile menu and footer render the same map (site-config MENU). - lib/content/capabilities.ts is the one list of what is available now, in development or planned; pages show status from it, never their own. - Deeper component for progressive disclosure; two new photographs (Museum Appenzell painting, public domain; Starlink over Tübingen's town hall, CC0), both on /credits. - New essays are English-first (PENDING_TRANSLATION in the parity test); navigation and home stay translated in all five languages. - CI: a production-shaped smoke runs the standalone server behind a TLS proxy header — the combination that 500'd production today while every other check was green. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
194 lines
8.5 KiB
YAML
194 lines
8.5 KiB
YAML
# Golden CI floor — see bitbaum/fleet templates/ci/README.md.
|
|
# solon: pnpm + Drizzle. Floor = verify (lint + typecheck + design:check + test) + build.
|
|
# Lint is `eslint .` — Next 16 removed `next lint`, and ESLint 9 wants flat
|
|
# config, so the rules live in eslint.config.mjs (eslint-config-next already
|
|
# exports a flat array). `.eslintrc.json` is gone.
|
|
# `next build` is hermetic: the server components that touch the database catch
|
|
# errors and render demo fallbacks, so no live DB is needed. Drizzle has no
|
|
# codegen at all — types flow from src/lib/db/schema.ts at typecheck time.
|
|
# Playwright render checks run in the `integration` job, against a built app.
|
|
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
# On a branch the newest push is the only one that matters, so cancel the rest.
|
|
#
|
|
# On main the group is keyed per COMMIT. A commit cancelling a DIFFERENT
|
|
# commit's run breaks deployment, because every deploy path keys off that run:
|
|
# one that waits for CI to pass on the commit finds a cancelled run and stops,
|
|
# and one chained on `workflow_run` sees conclusion=cancelled and skips.
|
|
# auto-merge also re-arms CI with a dispatch, which under a single
|
|
# group-per-branch cancels the push run for the SAME commit.
|
|
#
|
|
# Measured 2026-09-11 across the fleet: 28 of 39 ci.yml files had this shape.
|
|
# loki stranded four merges silently (main green, nothing red, the box
|
|
# serving the previous build); hirnli failed its deploy loudly at the wait step.
|
|
concurrency:
|
|
group: ci-${{ github.ref }}-${{ github.ref == 'refs/heads/main' && github.sha || 'branch' }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
verify:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
env:
|
|
DATABASE_URL: postgres://ci:ci@localhost:5432/ci
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
|
|
- uses: pnpm/action-setup@v6
|
|
|
|
# Node version comes from .nvmrc, never from a literal here. The deploy
|
|
# (bitbaum/loki selfhost-deploy.yml) reads the same file and only falls
|
|
# back to its own input when a repo commits none — which is how a repo
|
|
# ends up verified on one Node major and built on another. npm/pnpm
|
|
# majors disagree about optional platform deps, so that split shows up
|
|
# as a lockfile "out of sync" failure at deploy time, after the merge.
|
|
- uses: actions/setup-node@v7
|
|
with:
|
|
node-version-file: .nvmrc
|
|
cache: pnpm
|
|
|
|
# Next keeps its compiler output in .next/cache. Without restoring it this
|
|
# job recompiles the whole app every run. Measured across the fleet on
|
|
# 2026-09-07: of eight repos, exactly one cached this.
|
|
#
|
|
# Deliberately only in `verify` — the `integration` job installs but never
|
|
# builds, so a cache there would restore an entry nothing reads.
|
|
- name: Cache Next.js build
|
|
uses: actions/cache@v6
|
|
with:
|
|
path: .next/cache
|
|
key: nextjs-${{ runner.os }}-${{ hashFiles('package-lock.json') }}-${{ github.sha }}
|
|
restore-keys: |
|
|
nextjs-${{ runner.os }}-${{ hashFiles('package-lock.json') }}-
|
|
nextjs-${{ runner.os }}-
|
|
|
|
- name: Install
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
# SSOT: lint + typecheck, defined in package.json `verify`.
|
|
- name: Verify
|
|
run: pnpm run verify
|
|
|
|
# Did this PR change the constitution, and was that decided? governance.ts
|
|
# says of itself that changing it IS a GOVERNANCE_RULES matter; this is the
|
|
# check behind the sentence. It records — a warning in the PR with a
|
|
# pre-filled ratification proposal — and never blocks: a rules change
|
|
# without a decision is a fact the record must show, not a build failure.
|
|
# See scripts/check-governance-ratified.ts. Needs the PR's history, hence
|
|
# the second, full-depth fetch only on pull requests.
|
|
- name: Fetch PR history for the governance check
|
|
if: github.event_name == 'pull_request'
|
|
run: git fetch --no-tags --depth=200 origin ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}
|
|
|
|
- name: Governance rules ratified?
|
|
if: github.event_name == 'pull_request'
|
|
env:
|
|
BASE_SHA: ${{ github.event.pull_request.base.sha }}
|
|
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
|
|
PR_URL: ${{ github.event.pull_request.html_url }}
|
|
PR_TITLE: ${{ github.event.pull_request.title }}
|
|
run: pnpm exec tsx scripts/check-governance-ratified.ts
|
|
|
|
# Build gate — hermetic (DB calls fall back without a live database, see header).
|
|
- name: Build
|
|
run: pnpm run build
|
|
|
|
# The vote spine against a real database: migration replay on a fresh
|
|
# postgres (proves the baseline + seed actually apply), then the
|
|
# propose → open → vote → close → policy-activation integration spec.
|
|
integration:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 25
|
|
services:
|
|
postgres:
|
|
image: postgres:16
|
|
env:
|
|
POSTGRES_USER: ci
|
|
POSTGRES_PASSWORD: ci
|
|
POSTGRES_DB: ci
|
|
ports:
|
|
- 5432:5432
|
|
options: >-
|
|
--health-cmd "pg_isready -U ci"
|
|
--health-interval 5s
|
|
--health-timeout 5s
|
|
--health-retries 10
|
|
env:
|
|
DATABASE_URL: postgres://ci:ci@localhost:5432/ci
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
|
|
- uses: pnpm/action-setup@v6
|
|
|
|
# .nvmrc, as in `verify` above — one declaration for both jobs.
|
|
- uses: actions/setup-node@v7
|
|
with:
|
|
node-version-file: .nvmrc
|
|
cache: pnpm
|
|
|
|
- name: Install
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Migration replay (baseline + seed on a fresh database)
|
|
run: pnpm exec drizzle-kit migrate
|
|
|
|
# Every *.integration.test.ts, matched by name — not a hand-kept list.
|
|
# This step used to name the vote-spine spec alone, so the membership
|
|
# spec that guards the founding seat existed and was never once run by
|
|
# CI. A list of files is how the next spec is born dead.
|
|
- name: Database integration specs
|
|
run: INTEGRATION=1 pnpm exec vitest run .integration.test.ts
|
|
|
|
# How the site actually renders — the one thing lint, typecheck and unit
|
|
# tests cannot see. A button class with no CSS behind it shipped to
|
|
# production for weeks; tests/e2e/render.spec.ts names each bug it
|
|
# guards. Runs here because this job already has a migrated database,
|
|
# so data pages render for real rather than as fallbacks.
|
|
- name: Build for the render checks
|
|
run: pnpm run build
|
|
env:
|
|
AUTH_SECRET: ci-render-check-secret-not-a-real-one
|
|
AUTH_URL: http://localhost:3000
|
|
|
|
- name: Install Chromium
|
|
run: pnpm exec playwright install --with-deps chromium
|
|
|
|
- name: Render checks (Playwright, Chromium)
|
|
env:
|
|
AUTH_SECRET: ci-render-check-secret-not-a-real-one
|
|
AUTH_URL: http://localhost:3000
|
|
BASE_URL: http://localhost:3000
|
|
run: |
|
|
pnpm exec next start -p 3000 > server.log 2>&1 &
|
|
for i in $(seq 1 60); do curl -fsS -o /dev/null http://localhost:3000/api/health && break; sleep 1; done
|
|
pnpm exec playwright test tests/e2e --project=chromium --reporter=line
|
|
|
|
# The server production runs is not `next start`: it is the standalone
|
|
# server.js, behind Caddy, which adds X-Forwarded-Proto: https. On
|
|
# 2026-09-25 that combination 500'd every English page — next-intl's
|
|
# rewrite looked external to Next under HOSTNAME=127.0.0.1 — while every
|
|
# check above stayed green, because none of them sent the header. This
|
|
# runs the app the way the box does (HOSTNAME mirrors Solon's BIND_HOST
|
|
# in /opt/solon/shared/.env) and requires 200 on pages that rewrite.
|
|
- name: Production-shaped smoke (standalone behind a TLS proxy)
|
|
env:
|
|
AUTH_SECRET: ci-render-check-secret-not-a-real-one
|
|
AUTH_URL: https://solon.orangecat.ch
|
|
run: |
|
|
cp -r .next/static .next/standalone/.next/static
|
|
cp -r public .next/standalone/public
|
|
HOSTNAME=0.0.0.0 PORT=3100 node .next/standalone/server.js > standalone.log 2>&1 &
|
|
for i in $(seq 1 60); do curl -fsS -o /dev/null http://127.0.0.1:3100/api/health && break; sleep 1; done
|
|
for p in / /hire /governance /for/network-states /de /de/hire; do
|
|
code=$(curl -s -o /dev/null -w '%{http_code}' -H 'Host: solon.orangecat.ch' -H 'X-Forwarded-Proto: https' "http://127.0.0.1:3100$p")
|
|
echo "$p -> $code"
|
|
if [ "$code" != "200" ]; then tail -30 standalone.log; exit 1; fi
|
|
done
|