mirror of
https://github.com/bitbaum/causius.git
synced 2026-12-04 05:48:05 +01:00
* Build out Causius: case intake, case file, helper marketplace Replace the day-zero page with the product: a landing page, letter intake with env-gated AI analysis, a case view (deadline, checklist, translations, draft reply), browser-only case storage with export/import, and the helper marketplace rules for legal assistants and licensed lawyers. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012EJFFkKhmaVnnH8E3mHnaZ * Put Causius on the fleet's stack and its three planes - AI: replace the hand-rolled single-vendor fetch with @bitbaum/ai-kit complete() over the shared free chain; no pinned model id. Add the fleet's own-model flow (ai-kit byok + probe), key kept in the browser. - Validation with zod, rate limits with limitkit, tests with Vitest. - Identity rendered from the Loki fleet map; ROADMAP.md and CHANGELOG.md as the public record, shown through bip-kit. - Helpers live on OrangeCat as services; OrangeCat and Solon links appear only when the fleet map reports the profiles exist. - Nav contract: routes constant, aria-current, 44px targets. Beta label. - CI and auto-merge from the current site template; TypeScript 6, ESLint 10, Node 24; AGENTS.md from the fleet template. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012EJFFkKhmaVnnH8E3mHnaZ * Speak English, German and French; make intake work end to end - next-intl with locale routing (en unprefixed, /de, /fr), every string in the message catalogues, a parity test, Swiss German spelling. - The analysis is written in the reader's language. - Several pages per letter; photos are shrunk in the browser so a phone picture fits. - The deadline is shown with the sentence it was read from, and the model is told never to compute a date the letter does not state. - /api/health, and the intake page says up front what the free models can do. `pnpm run check:analyze` runs the sample letter through a real model. - A down fleet map no longer stalls on-demand pages. - Refuse the two build scripts next-intl brought, so installs stay clean. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012EJFFkKhmaVnnH8E3mHnaZ --------- Co-authored-by: Claude <noreply@anthropic.com>
134 lines
5.5 KiB
YAML
134 lines
5.5 KiB
YAML
name: CI
|
|
|
|
# WHY THIS FILE EXISTS, AND WHY IT IS NOT OPTIONAL
|
|
#
|
|
# loki's ci-gate.sh treats "CI green" and "no CI at all" identically —
|
|
# both exit 0 and let the deploy proceed. That is a sane default for a repo
|
|
# that has not set CI up yet, and it means a site WITHOUT this file deploys
|
|
# every push completely unverified while looking exactly like one that passed.
|
|
#
|
|
# Substrata shipped to production that way. So the scaffold emits this file with
|
|
# every new site: the gate has something real to wait for from the first commit.
|
|
#
|
|
# Runs the same bundle as `pnpm run verify` locally — one definition of verified.
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
workflow_dispatch: {}
|
|
|
|
# A newer push supersedes an older run. ci-gate.sh understands cancelled-and-
|
|
# superseded as a clean skip rather than a failure.
|
|
concurrency:
|
|
group: ci-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
verify:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
# pnpm BEFORE setup-node: `cache: pnpm` needs the binary to resolve the
|
|
# store path, and setup-node fails outright if pnpm is not on PATH yet.
|
|
- uses: pnpm/action-setup@v4
|
|
|
|
# Sites scaffolded before the starter shipped .nvmrc have none, and
|
|
|
|
# setup-node fails on a missing version file (kaffeeklappe-sep11 #3,
|
|
|
|
# 2026-09-11). Default to the fleet's Node line; a committed .nvmrc wins.
|
|
|
|
- name: Node version file
|
|
|
|
run: "[ -f .nvmrc ] || echo 22 > .nvmrc"
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version-file: ".nvmrc"
|
|
cache: pnpm
|
|
|
|
# pnpm, not npm: the box deploys with `pnpm run build`, and this template
|
|
# previously scaffolded an npm CI over a repo that had no package-lock.json
|
|
# — so `npm ci` could never succeed and a new site's CI was red or absent
|
|
# from its first commit. .nvmrc is pinned to 22 for the same reason: pnpm 11
|
|
# imports node:sqlite, which does not exist before Node 22.13.
|
|
- run: pnpm install --frozen-lockfile
|
|
|
|
# Next keeps its compiler output in .next/cache, and this job BUILDS. With
|
|
# nothing restoring it, every run of every scaffolded site recompiles from
|
|
# scratch — and the deploy then compiles a second time.
|
|
#
|
|
# This file is the third copy of the golden CI floor. The other two live in
|
|
# fleet/templates/ci/, and they gained this step on 2026-09-07 when a fleet
|
|
# sweep found 14 of 32 repos building cold. This one is the copy the
|
|
# scaffold ACTUALLY uses, so it was the one that mattered and the one that
|
|
# was missed — every site created between then and now started cold by
|
|
# construction. Held fleet-wide by fleet's cicd-hygiene-audit.sh, but that
|
|
# ratchet can only flag a repo after it exists; a template fixes it before.
|
|
#
|
|
# Keyed on the lockfile so a dependency change invalidates it. The bare
|
|
# restore-key is last on purpose: a stale cache still beats no cache, and
|
|
# Next validates its own entries rather than trusting them.
|
|
- name: Cache Next.js build
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: .next/cache
|
|
key: nextjs-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.sha }}
|
|
restore-keys: |
|
|
nextjs-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}-
|
|
nextjs-${{ runner.os }}-
|
|
|
|
- name: Type check
|
|
run: pnpm run type-check
|
|
|
|
- name: Lint
|
|
# The Loki starter declares no linter yet; a missing script must
|
|
# not fail the site's first CI run.
|
|
run: pnpm run --if-present lint
|
|
|
|
# The golden CI floor's third gate: assertions that exist and actually
|
|
# run. Hermetic — no secrets, no network; the model call is injected.
|
|
- name: Test
|
|
run: pnpm run test
|
|
|
|
# The build is the real test for a content site: a broken import or a bad
|
|
# config surfaces here and nowhere earlier.
|
|
- name: Build
|
|
run: pnpm run build
|
|
|
|
# A sweep merge uses GITHUB_TOKEN, and a push made with that token triggers
|
|
# no workflows; the CI the sweep then re-arms is itself a dispatch, whose
|
|
# workflow_run event GitHub also suppresses. So after an agent's PR is
|
|
# auto-merged here, NOTHING starts Deploy — kaffeeklappe-sep11 sat an hour
|
|
# on 2026-09-11 with the change merged, CI green, and the site serving the
|
|
# previous release. The sweep's reconciler catches it on its next tick,
|
|
# which is correct, self-healing, and up to ten minutes late.
|
|
#
|
|
# A dispatch is not a push, so this job may start Deploy directly the moment
|
|
# CI proves main green. Same shape as bitbaum/loki's own ci.yml.
|
|
#
|
|
# Only for workflow_dispatch: a real push to main chains through
|
|
# workflow_run by itself, and dispatching here too would ship twice.
|
|
ship:
|
|
needs: verify
|
|
if: github.ref == 'refs/heads/main' && github.event_name == 'workflow_dispatch'
|
|
runs-on: ubuntu-latest
|
|
# contents: read is not optional. A job-level permissions block turns
|
|
# everything it does not list OFF, and on a PRIVATE repo a token without
|
|
# contents cannot even check out its own code: "Repository not found",
|
|
# CI red on main, and the fleet sweep never ships a red main — so a new
|
|
# private site stopped one step before going live (probe-loop, 2026-09-26).
|
|
permissions:
|
|
actions: write
|
|
contents: read
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Dispatch Deploy now that main is green
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: gh workflow run deploy.yml --ref main
|