Commit Graph
76 Commits
Author SHA1 Message Date
dependabot[bot] ec08e85e0b chore(deps): bump the minor-and-patch group across 1 directory with 26 updates (#203)
Bumps the minor-and-patch group with 26 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [@bitbaum/ai-kit](https://github.com/bitbaum/ai-kit) | `1.4.0` | `1.10.0` |
| [@bitbaum/mail-kit](https://github.com/bitbaum/mail-kit) | `0.1.0` | `0.1.1` |
| [@headlessui/react](https://github.com/tailwindlabs/headlessui/tree/HEAD/packages/@headlessui-react) | `2.2.9` | `2.2.10` |
| [@supabase/ssr](https://github.com/supabase/ssr) | `0.8.0` | `0.12.7` |
| [@supabase/supabase-js](https://github.com/supabase/supabase-js/tree/HEAD/packages/core/supabase-js) | `2.93.3` | `2.116.0` |
| [bip-kit](https://github.com/bitbaum/bip-kit) | `0.2.7` | `0.3.0` |
| [date-fns](https://github.com/date-fns/date-fns) | `4.1.0` | `4.4.0` |
| [next](https://github.com/vercel/next.js) | `16.3.3` | `16.3.5` |
| [postcss](https://github.com/postcss/postcss) | `8.5.23` | `8.5.28` |
| [react](https://github.com/react/react/tree/HEAD/packages/react) | `19.2.8` | `19.3.0` |
| [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) | `19.2.17` | `19.3.0` |
| [react-dom](https://github.com/react/react/tree/HEAD/packages/react-dom) | `19.2.8` | `19.3.0` |
| [@types/react-dom](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-dom) | `19.2.3` | `19.3.0` |
| [react-hook-form](https://github.com/react-hook-form/react-hook-form) | `7.71.1` | `7.88.0` |
| [react-icons](https://github.com/react-icons/react-icons) | `5.5.0` | `5.7.0` |
| [sonner](https://github.com/emilkowalski/sonner) | `2.0.7` | `2.0.8` |
| [zod](https://github.com/colinhacks/zod) | `4.5.4` | `4.6.5` |
| [@playwright/test](https://github.com/microsoft/playwright) | `1.58.1` | `1.63.0` |
| [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) | `26.4.0` | `26.6.2` |
| [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) | `19.2.17` | `19.3.0` |
| [@types/react-dom](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-dom) | `19.2.3` | `19.3.0` |
| [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) | `8.65.0` | `8.70.0` |
| [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) | `8.65.0` | `8.70.0` |
| [eslint](https://github.com/eslint/eslint) | `10.9.1` | `10.11.0` |
| [eslint-config-next](https://github.com/vercel/next.js/tree/HEAD/packages/eslint-config-next) | `16.2.12` | `16.3.5` |
| [lint-staged](https://github.com/lint-staged/lint-staged) | `17.3.0` | `17.5.1` |
| [node-mocks-http](https://github.com/eugef/node-mocks-http) | `1.17.2` | `1.18.1` |
| [prettier](https://github.com/prettier/prettier) | `3.8.1` | `3.9.8` |



Updates `@bitbaum/ai-kit` from 1.4.0 to 1.10.0
- [Commits](https://github.com/bitbaum/ai-kit/compare/v1.4.0...v1.10.0)

Updates `@bitbaum/mail-kit` from 0.1.0 to 0.1.1
- [Commits](https://github.com/bitbaum/mail-kit/compare/v0.1.0...v0.1.1)

Updates `@headlessui/react` from 2.2.9 to 2.2.10
- [Release notes](https://github.com/tailwindlabs/headlessui/releases)
- [Changelog](https://github.com/tailwindlabs/headlessui/blob/main/packages/@headlessui-react/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/headlessui/commits/@headlessui/react@v2.2.10/packages/@headlessui-react)

Updates `@supabase/ssr` from 0.8.0 to 0.12.7
- [Release notes](https://github.com/supabase/ssr/releases)
- [Changelog](https://github.com/supabase/ssr/blob/main/CHANGELOG.md)
- [Commits](https://github.com/supabase/ssr/compare/v0.8.0...v0.12.7)

Updates `@supabase/supabase-js` from 2.93.3 to 2.116.0
- [Release notes](https://github.com/supabase/supabase-js/releases)
- [Changelog](https://github.com/supabase/supabase-js/blob/master/packages/core/supabase-js/CHANGELOG.md)
- [Commits](https://github.com/supabase/supabase-js/commits/v2.116.0/packages/core/supabase-js)

Updates `bip-kit` from 0.2.7 to 0.3.0
- [Commits](https://github.com/bitbaum/bip-kit/compare/v0.2.7...v0.3.0)

Updates `date-fns` from 4.1.0 to 4.4.0
- [Release notes](https://github.com/date-fns/date-fns/releases)
- [Commits](https://github.com/date-fns/date-fns/compare/v4.1.0...v4.4.0)

Updates `next` from 16.3.3 to 16.3.5
- [Release notes](https://github.com/vercel/next.js/releases)
- [Commits](https://github.com/vercel/next.js/compare/v16.3.3...v16.3.5)

Updates `postcss` from 8.5.23 to 8.5.28
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.5.23...8.5.28)

Updates `react` from 19.2.8 to 19.3.0
- [Release notes](https://github.com/react/react/releases)
- [Changelog](https://github.com/react/react/blob/main/CHANGELOG.md)
- [Commits](https://github.com/react/react/commits/v19.3.0/packages/react)

Updates `@types/react` from 19.2.17 to 19.3.0
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

Updates `react-dom` from 19.2.8 to 19.3.0
- [Release notes](https://github.com/react/react/releases)
- [Changelog](https://github.com/react/react/blob/main/CHANGELOG.md)
- [Commits](https://github.com/react/react/commits/v19.3.0/packages/react-dom)

Updates `@types/react-dom` from 19.2.3 to 19.3.0
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react-dom)

Updates `react-hook-form` from 7.71.1 to 7.88.0
- [Release notes](https://github.com/react-hook-form/react-hook-form/releases)
- [Changelog](https://github.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md)
- [Commits](https://github.com/react-hook-form/react-hook-form/compare/v7.71.1...v7.88.0)

Updates `react-icons` from 5.5.0 to 5.7.0
- [Release notes](https://github.com/react-icons/react-icons/releases)
- [Commits](https://github.com/react-icons/react-icons/compare/v5.5.0...v5.7.0)

Updates `sonner` from 2.0.7 to 2.0.8
- [Release notes](https://github.com/emilkowalski/sonner/releases)
- [Commits](https://github.com/emilkowalski/sonner/compare/v2.0.7...v2.0.8)

Updates `zod` from 4.5.4 to 4.6.5
- [Release notes](https://github.com/colinhacks/zod/releases)
- [Commits](https://github.com/colinhacks/zod/compare/v4.5.4...v4.6.5)

Updates `@playwright/test` from 1.58.1 to 1.63.0
- [Release notes](https://github.com/microsoft/playwright/releases)
- [Commits](https://github.com/microsoft/playwright/compare/v1.58.1...v1.63.0)

Updates `@types/node` from 26.4.0 to 26.6.2
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Updates `@types/react` from 19.2.17 to 19.3.0
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

Updates `@types/react-dom` from 19.2.3 to 19.3.0
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react-dom)

Updates `@typescript-eslint/eslint-plugin` from 8.65.0 to 8.70.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.70.0/packages/eslint-plugin)

Updates `@typescript-eslint/parser` from 8.65.0 to 8.70.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.70.0/packages/parser)

Updates `eslint` from 10.9.1 to 10.11.0
- [Release notes](https://github.com/eslint/eslint/releases)
- [Commits](https://github.com/eslint/eslint/compare/v10.9.1...v10.11.0)

Updates `eslint-config-next` from 16.2.12 to 16.3.5
- [Release notes](https://github.com/vercel/next.js/releases)
- [Commits](https://github.com/vercel/next.js/commits/v16.3.5/packages/eslint-config-next)

Updates `lint-staged` from 17.3.0 to 17.5.1
- [Release notes](https://github.com/lint-staged/lint-staged/releases)
- [Changelog](https://github.com/lint-staged/lint-staged/blob/main/CHANGELOG.md)
- [Commits](https://github.com/lint-staged/lint-staged/compare/v17.3.0...v17.5.1)

Updates `node-mocks-http` from 1.17.2 to 1.18.1
- [Release notes](https://github.com/eugef/node-mocks-http/releases)
- [Changelog](https://github.com/eugef/node-mocks-http/blob/master/HISTORY.md)
- [Commits](https://github.com/eugef/node-mocks-http/compare/v1.17.2...v1.18.1)

Updates `prettier` from 3.8.1 to 3.9.8
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.8.1...3.9.8)

---
updated-dependencies:
- dependency-name: "@bitbaum/ai-kit"
  dependency-version: 1.10.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: minor-and-patch
- dependency-name: "@bitbaum/mail-kit"
  dependency-version: 0.1.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor-and-patch
- dependency-name: "@headlessui/react"
  dependency-version: 2.2.10
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor-and-patch
- dependency-name: "@supabase/ssr"
  dependency-version: 0.12.7
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: minor-and-patch
- dependency-name: "@supabase/supabase-js"
  dependency-version: 2.116.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: minor-and-patch
- dependency-name: bip-kit
  dependency-version: 0.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: minor-and-patch
- dependency-name: date-fns
  dependency-version: 4.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: minor-and-patch
- dependency-name: next
  dependency-version: 16.3.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor-and-patch
- dependency-name: postcss
  dependency-version: 8.5.28
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor-and-patch
- dependency-name: react
  dependency-version: 19.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: minor-and-patch
- dependency-name: "@types/react"
  dependency-version: 19.3.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: minor-and-patch
- dependency-name: react-dom
  dependency-version: 19.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: minor-and-patch
- dependency-name: "@types/react-dom"
  dependency-version: 19.3.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: minor-and-patch
- dependency-name: react-hook-form
  dependency-version: 7.88.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: minor-and-patch
- dependency-name: react-icons
  dependency-version: 5.7.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: minor-and-patch
- dependency-name: sonner
  dependency-version: 2.0.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor-and-patch
- dependency-name: zod
  dependency-version: 4.6.5
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: minor-and-patch
- dependency-name: "@playwright/test"
  dependency-version: 1.63.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: minor-and-patch
- dependency-name: "@types/node"
  dependency-version: 26.6.2
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: minor-and-patch
- dependency-name: "@types/react"
  dependency-version: 19.3.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: minor-and-patch
- dependency-name: "@types/react-dom"
  dependency-version: 19.3.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: minor-and-patch
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-version: 8.70.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: minor-and-patch
- dependency-name: "@typescript-eslint/parser"
  dependency-version: 8.70.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: minor-and-patch
- dependency-name: eslint
  dependency-version: 10.11.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: minor-and-patch
- dependency-name: eslint-config-next
  dependency-version: 16.3.5
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: minor-and-patch
- dependency-name: lint-staged
  dependency-version: 17.5.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: minor-and-patch
- dependency-name: node-mocks-http
  dependency-version: 1.18.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: minor-and-patch
- dependency-name: prettier
  dependency-version: 3.9.8
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: minor-and-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-09-23 13:38:45 -07:00
CatoandClaude Opus 5 376b94f89d refactor: one rate limiter, one auth shell, one create flow, one icon frame (#198)
* refactor(rate-limit): one limiter from limitkit, keyed on the proxy's hop

Two hand-rolled limiters lived side by side — lib/rate-limit.ts and
lib/middleware/rate-limit.ts — each with its own window maths, its own
header names and its own idea of who the caller is. Both are gone; the
decision now comes from limitkit (fleet/SHARED.md), and what stays here
is the one table of app budgets in lib/rate-limit.ts. A route names a
bucket; it does not get to invent a number.

The reason this matters beyond tidiness: both copies keyed the limit on
the FIRST hop of X-Forwarded-For. That hop is written by the client, so
any caller could mint a fresh budget per request by adding a header —
the limiter looked like it worked and enforced nothing. limitkit counts
from the right, i.e. the hop our own proxy wrote. A test now pins it:
a forged first hop must not mint a fresh bucket.

Also removed the Supabase check_rate_limit RPC path, which failed OPEN
on every error — the limiter switched itself off whenever the database
hiccupped. And 429s now carry Retry-After and X-RateLimit-* headers plus
a retryAfter field, which is what the auth forms count down.

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

* refactor(icons): each icon body written once

Icons.tsx repeated the same 24-box outline SVG wrapper for every icon —
a 121-line self-clone. One `Outline` frame and one `icon(paths, ...)`
builder replace it; an icon is now its path data and nothing else.

Every export and every path string is byte-identical to before, so the
rendered output does not move.

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

* refactor(create): one QuickCreateFlow behind /create and /personal

The two pages held the same three-step flow twice — 192 cloned lines of
state machine, header, progress indicator and step switch. They differ
only in the copy around the template picker, so that is what the pages
now pass in: /personal supplies its title block and its link out to the
professionals, /create supplies neither.

Both renders are unchanged, including that /personal's intro and outro
only appear on the picker step.

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

* refactor(auth): one shell, one field, one submit button for the auth screens

signup, signin, forgot-password and verify-email each carried their own
copy of the page frame, the error line, the labelled input and the
submit button — six clone pairs with signup in every one. They now share
AuthShell / AuthAlert / AuthField / AuthSubmitButton, and the per-form
error-plus-countdown state lives once in useAuthError.

One real fix falls out of it: isRateLimitError compared the error code
against 'RATE_LIMITED', but the API has always sent 'RATE_LIMIT'. The
rate-limit countdown therefore never showed. It does now.

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

* chore(lint): console.info is not logging, and every disable says why

`no-console` allowed `info`, so debug lines shipped as operator output:
the blog route narrated every render to the server log at info level.
Those lines now go through lib/logger (the single logger) at the level
they actually are, and the allowance is gone — warn and error only. The
21 remaining console.log calls are all in scripts/test-db-connection.ts,
where printing to the terminal is the point.

The eslint-disable count drops 16 -> 13. Comments.tsx no longer needs one
(useSyncExternalStore is the supported way to ask "are we on the client"),
and lib/supabase.ts no longer needs its `any` — the SSG mock casts once at
the return instead. The 13 that remain each name their reason: external
avatar URLs that next/image would need a host allowlist for, and effects
that seed state from an external store.

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

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-15 01:24:12 -07:00
9c8957b5fe chore(deps): ai-kit ^0.15.0 -> ^1.4.0 (#196)
This repo was pinned to an old ai-kit not through neglect but by semver: a
caret range on a pre-1.0 version cannot cross a minor, so `^0.15.0` resolved
below the next minor and every release since was unreachable. Dependabot ran
weekly the whole time and was correct to route each 0.x minor to its own PR —
right policy, wrong outcome, for a package whose minors were additive.

ai-kit is now 1.x, so this is the last manual bump here: `^1.x` admits every
later minor and they arrive grouped with the routine updates.

Verified: install resolves 1.4.0 and `tsc --noEmit` is clean with no code
changes. Every ai-kit symbol this repo imports was checked against the 1.4.0
export surface beforehand.

1.4.0 also closes a fabrication path worth knowing about if this repo ever
passes `tools` to `complete()`: three of the seven models in the default
chain can only emit a tool call as text, and a native-only read handed their
narration back as a finished answer. Both protocols are read now.

Co-authored-by: Cato <georgy.butaev@revamp-it.ch>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-12 02:33:31 -07:00
CatoandClaude Fable 5.1 47416f2689 chore(deps): bip-kit 0.2.7 — copy button in normal flow, not over the code (#194)
Mechanical fleet bump 0.2.6 -> ^0.2.7. bip-kit 0.2.7 moves the code-copy
button into normal flow (a toolbar row above the <pre>) instead of
absolute-positioning it over the code, deleting the fixed clearance that
let a consumer's 44px touch-target rule push the button onto the first
code line. This site has no such rule and showed no overlap; the bump is
for fleet uniformity and to remove the fragility, not to fix a visible
defect.


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

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-10 18:19:28 -07:00
dependabot[bot] 655a4f43a9 chore(deps): bump next from 16.2.12 to 16.3.3 (#193)
Bumps [next](https://github.com/vercel/next.js) from 16.2.12 to 16.3.3.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Commits](https://github.com/vercel/next.js/compare/v16.2.12...v16.3.3)

---
updated-dependencies:
- dependency-name: next
  dependency-version: 16.3.3
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-09-08 23:45:31 -07:00
CatoandClaude Opus 5 3389da38a3 fix(deps): bip-kit 0.2.6 — the copy button was covering the code it copies (#190)
A visual QA pass over the guides at 390×844 found `.bp-copy` sitting on top of
the opening line of the code blocks it belongs to. Hovering each block in turn
on the live site: the first line was covered in 9 of 23 blocks on
/knowledge/guides/self-hosting and 1 of 24 at 1440px on sovereign-ai — e.g.
`curl http://localhost:11434/ap`, truncated mid-URL by the button.

The defect is bip-kit's, not this repo's: the button and the <pre> are siblings,
so nothing in the DOM says they overlap and all 301 tests here pass either way.
bip-kit 0.2.5/0.2.6 fix it upstream by reserving the space vertically
(--bp-copy-clearance) rather than beside the button, and 0.2.6 additionally
makes the button visible on touch devices, which never enter :hover.

This is the version bump that carries those fixes to the live guides; no code
here changes. Full verify is green (301 tests, build included).


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

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-08 12:30:40 -07:00
CatoandClaude Opus 5 a8d585e3f7 fix(deps): bip-kit 0.2.3, and delete the local list-marker patch (#189)
longform.css carried two rules (`.bp-article .bp-ul/.bp-ol { list-style-type }`)
added in #187 to put back the bullets and numbers Tailwind's preflight
erased — bip-kit coloured `::marker` but never declared a list type, so the
marker being coloured did not exist. Its own comment said to drop the rules
once a bip-kit release declared the types itself. 0.2.3 does, on the bare
`.bp-ul`/`.bp-ol`/`.bp-footnotes-list` selectors and the nested levels, with
a package test guarding it — so the patch and its note go, and the
declarations now arrive from the package.


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

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-08 03:33:35 +00:00
CatoandClaude Opus 5 d050d1589c feat(health): /api/health/ai — make the 2026-08-28 outage observable BEFORE a user hits it (#184)
On 2026-08-28 /api/health reported "healthy" while every AI feature on
this site was failing on an invalid Groq key. Carrying `llm` in that body
fixed the REPORTING. It did not make the state observable before a user
hit it, because nothing calls a provider until somebody uses the bot — so
straight after a deploy the field reads "unknown", and unknown is what it
stays.

  GET /api/health/ai            free. What the last real call did.
  GET /api/health/ai?probe=1    a real call. 200 or 503. Needs the secret.

Opposite contract to /api/health on purpose: that route is LIVENESS and
must stay 200 while the LLM is down, because restarting does not fix an
expired key and failing on it would get a healthy process killed. This
one is the inverse, so an uptime monitor can page on a real AI outage
without paging on every deploy.

It probes THIS app's chain: `ask` (ai-kit 0.15.0) calls
generateWithBestProvider, the same function the chat routes use. A probe
built from its own provider list would test a path nothing else takes and
would drift from this one the first time the chain changed.

The secret is a GETTER — the handler is built once and reused, so a
captured string would be whatever the environment held on the first
request: un-rotatable without a restart, and untestable.

TWO THINGS THE TESTS TAUGHT ME, both about this app rather than the
probe:

  - generateWithBestProvider goes through getServerEnv(), which validates
    the WHOLE server env and throws on the first missing var. A probe
    test that sets only the AI keys fails on SUPABASE_SERVICE_ROLE_KEY,
    nowhere near the chain.
  - Ollama is tried first and its availability is a LIVE PING, so a fetch
    mock that answers every URL makes a local runtime appear to exist and
    win the chain. The mock now refuses :11434, which is prod's real
    shape — and the "which vendor served it" assertion looks at every
    call rather than calls[0], because calls[0] is that ping.

verify green — 301 tests.


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

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-07 14:56:46 +00:00
CatoandClaude Opus 5 a6906851d5 refactor(content): one markdown pipeline — bip-kit typed blocks replace MDX and two GitHub content repos (#183)
The blog and the Knowledge Center each fetched their markdown from a
SEPARATE GitHub repository at request time (g-but/botsmann-blog-content,
g-but/botsmann-knowledge-content) and rendered it through next-mdx-remote
with a hand-rolled component map per surface. Two maps for one markdown
vocabulary, already drifted: the blog slugged headings with rehype-slug, the
guides with a different inline regex; the guides highlighted code, the blog
did not; each had its own Callout. The content itself lived where nobody
reviewed it, behind a GitHub handle rename that now answers only via a 301.

Both surfaces now read content/*.md from this repo and render through
bip-kit's typed-block parser and reference renderer:

- content/blog/*.md (5 posts) and content/knowledge/**/*.md (10 guides) are
  vendered verbatim from the two content repos — word-level parity verified
  across all 15 files, zero words lost. Post images moved to public/blog/.
- The three app/blog/<slug>/page.mdx files came along as drafts. They were
  never routes: `page.mdx` only serves as a page when pageExtensions includes
  mdx, and this app never configured that, so all three were dead files. They
  are committed with `published: false` rather than deleted.
- lib/longform/ is the one pipeline both routes call: a fence-aware
  normalizer (`# ` → `## `, `*`/`+` bullets → `-`, nested items flattened —
  the guides carry 74 indented items and ~130 shell-comment `#` lines inside
  fences that a naive normalizer would have corrupted), then parse → blocks +
  TOC + reading time.
- setHighlighterLoader(() => import('shiki')) is registered at module scope.
  This app builds `output: standalone`, where bip-kit's zero-config shiki
  import is invisible to Next's file tracer — without the explicit literal,
  production ships unhighlighted while dev looks right.
- The TOC is derived from the same parse that renders the page, so a TOC
  anchor can no longer point at a heading id built by a different slug rule.
  types/knowledge.ts loses TableOfContentsItem accordingly.

Retired: next-mdx-remote, remark-gfm, rehype-slug, rehype-autolink-headings,
gray-matter (deps), components/blog/{Server,Client}MDXContent + MDXComponents,
components/knowledge/{Callout,CodeBlock,TableOfContents}. next.config drops
the raw.githubusercontent image pattern and the GitHub hosts from CSP
connect-src, and points frame-src at the privacy video players bip-kit uses.

Article typography now flows from the token SSOT: lib/longform/longform.css
maps globals.css onto bip-kit's --bp-* contract, replacing ~40 hardcoded
Tailwind greys. The mapping covers every --bp-* colour and pins the article
light, because Botsmann has no dark theme anywhere (zero `dark:` utilities,
no theme provider, light-only chrome) — letting bip-kit's dark defaults
through would put a dark article inside a white page. When the site grows a
dark tier, this file follows it by changing values in globals.css only.

tests/__tests__/lib/longform-content.test.ts walks every content file through
the real pipeline: committed content is bip-kit's trust boundary and a
malformed chart/stats fence throws at parse time, which without a test would
surface as a 500 on the live page.


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

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-07 14:24:40 +00:00
CatoandClaude Opus 5 b51a7635f7 refactor(llm): complete() owns the request — and a test asserted the bug (#181)
This file already walked ai-kit's chain but kept its own fetch, so the
CHAIN came from the package and the REQUEST did not. That is where the
remaining defects lived, and they are the fleet's most common ones
(census 2026-09-06: 9 of 12 hand-rolled clients share them):

  - `data.choices[0]?.message?.content || ''` handed an EMPTY 200 to the
    user as the bot's reply, and the chain stopped there, satisfied. A
    reasoning model that spends its budget thinking returns exactly that.
  - a 429 became `throw new Error('Groq API error: ' + status)`: the body
    was read, logged and discarded. Capacity, request-too-large and daily
    quota share that status code and want opposite responses — retry
    shortly, send less, or come back tomorrow.
  - neither call had a DEADLINE. A vendor that accepted the connection
    and never answered held the chat open indefinitely, and the fallback
    beneath it was never reached.

Also removes the last decision this file was still making: the `attempt`
callback branched on `provider.id` to choose a key. Keys now resolve
through a synthetic env, which is the seam complete() reads, so a BYOK
caller's key and the server's own take one path instead of two. The two
per-vendor call functions and both model loops are gone (-134 lines).

Attribution is preserved deliberately. The OpenRouter call sends
HTTP-Referer and X-Title, which OpenRouter ranks apps by; complete() had
no way to send them, so ai-kit grew `extraHeaders` (0.10.0) rather than
this adoption quietly dropping Botsmann off that list. Now tested.

THREE TEST DEFECTS, all found by the conversion:

  - one test asserted THE BUG: "returns empty string when no content in
    response" expected `result.content === ''`. It is replaced by two
    tests — an empty 200 demotes to the next link, and an empty 200 at
    every link throws rather than answering with nothing.
  - the fetch mocks were `{ ok, json }` literals with no `text()`. That
    encoded an assumption about HOW the client reads a body and broke the
    moment it read the text first (to keep the vendor's body in the
    error). Real Response objects now.
  - `mockResolvedValue(new Response(...))` handed every link the SAME
    object, and a Response body can only be read once — so link two
    always failed with "Body has already been read", a fake failure
    standing in front of the real behaviour. Anything walking a chain
    needs a factory, not a value.

The `vi.mock('@/lib/constants')` for the endpoint URLs is removed: the
client takes them from the same ai-kit provider record that supplies the
model list, so mocking them asserted a copy nothing reads. Verified the
resulting URLs are byte-identical to the constants they replace.

verify green: format, lint, typecheck, selfhost check, 277 tests, build.


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

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-06 23:01:43 +00:00
a04d484451 refactor(email): SES -> @bitbaum/mail-kit; drop @aws-sdk/client-ses (#178)
The playbook expected no SES call sites, but lib/email/service.ts is live
(consultations route sends welcome + admin mails through it), so a bare dep
removal would have broken the build. Instead the transport is swapped to the
fleet's mail layer:

- EmailService now sends via @bitbaum/mail-kit sendMail; the throw-on-failure
  contract is preserved for the catching caller
- Sender comes from RESEND_FROM (fleet SSOT) with conventionalFrom('Botsmann')
  fallback; FROM_EMAIL and NEXT_AWS_* reads deleted from email config paths
- @aws-sdk/client-ses removed; tests mock @bitbaum/mail-kit instead of SES,
  with a new failed-send assertion


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-05 10:14:55 +00:00
ee5ffa1c97 chore: pnpm — the fleet has one package manager (#176)
- packageManager pnpm@11.25.0; lockfile via pnpm import, package-lock.json
  removed
- npm "overrides" moved to pnpm-workspace.yaml overrides (pnpm ignores the
  npm-only package.json field); $postcss reference spelled out (pnpm 11
  deprecates $ syntax)
- allowBuilds for native/postinstall deps; temporary minimumReleaseAgeExclude
  for our own @bitbaum/ai-kit@0.6.2 (published <24h ago — pnpm 11's
  supply-chain window would refuse it)
- CI: pnpm/action-setup@v6, store-dir pinned outside the action's bin dir,
  cache: pnpm, frozen-lockfile install, pnpm run verify
- phantom deps declared: dotenv + tsx (used by scripts/test-db-connection.ts
  and the test:db script, previously resolved via npm hoisting only)
- verify/build:ci scripts and husky pre-commit converted to pnpm


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 01:23:53 +00:00
7f6c8db4f6 refactor(deps): ai-kit comes from npm — @bitbaum/ai-kit ^0.6.2 (#174)
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-03 14:54:30 +00:00
3e77deeef6 chore(deps): typescript 6 (#170)
TypeScript ^5.7.3 -> ^6.0.3 (fleet TypeScript-6 sweep). TS 7.0.2 is
blocked fleet-wide: typescript-eslint hard-errors "does not support
TS 7.0" (canaried 2026-08-31). 6.0.3 is the blessed major, proven
in-fleet with Next 16.

One TS-6 fix: drop the deprecated "baseUrl" from tsconfig.json
(TS5101 hard-errors on it under 6.0). The "@/*" paths mapping
resolves relative to the tsconfig dir without it. Full verify
(format, lint, typecheck, selfhost check, tests, build) green.


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-08-31 14:10:50 +00:00
8582b92f90 refactor(deps): Tailwind 4 (CSS-first) + Zod 4 + ESLint 10 + types/node 26 + ai-kit 0.6.2 (#168)
Tailwind 3.4 -> 4.3:
- tailwind.config.js DELETED; tokens now live in an @theme inline block in
  app/globals.css (semantic names unchanged: action, paper, edge, ink...)
- postcss.config.js -> @tailwindcss/postcss; autoprefixer dropped (built in)
- @tailwind directives -> @import 'tailwindcss'; forms/typography via @plugin
- daisyui removed (no daisyui class used anywhere)
- next/font vars renamed --font-inter/--font-fraunces to break the circular
  var() the old --font-sans binding would create inside @theme
- v4 deleted *-opacity-* utilities: every bg/text/ring-opacity-N rewritten to
  slash syntax (bg-action/90, ring-black/5, ...); dynamic accent tint gets a
  literal class map in lib/config/colors.ts so the scanner sees each class
- dead v3-era aspect-w/h custom utilities removed (unused; v4 has aspect-*)

Zod 3.24 -> 4.5:
- .errors -> .issues everywhere
- z.string().uuid( -> .guid( (v4 uuid() is RFC-variant-strict; DB ids aren't)
- z.record(z.unknown()) -> z.record(z.string(), z.unknown())
- object .default({}) -> .prefault({}) (v4 default takes the full output value)

ESLint 9 -> 10: eslint-plugin-react's version:'detect' calls the removed
context.getFilename; pin settings.react.version='19' AFTER the next configs.

Verify (format+lint+typecheck+selfhost+test+build) green: 272 tests pass.


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-08-31 12:45:49 +00:00
GandClaude Opus 5 9cf91812aa refactor(test): jest -> vitest (#165)
Jest is CJS-rooted, needs transform configuration for ESM and TypeScript, and
every shared CI template has to accommodate its dialect. vitest is ESM/TS
native and jest-compatible at the API level.

`globals: true` keeps describe/it/expect/beforeEach/vi available without
imports, so the diff is the jest.* API names and nothing else. Only TYPES had
to be imported, because a type cannot come from a global.

next/jest supplied the path alias, the next/server mock and the jsdom
environment implicitly; vitest.config.ts states them, so they are visible
rather than inherited. The transformIgnorePatterns override for ESM-only
packages (ai-kit) is DELETED rather than translated — jest ran CJS and died on
`Unexpected token export`, which is the entire reason that workaround existed.
vitest loads ESM natively.

Three things only running the suite could have found:

  * __mocks__/next/server.ts was outside the first rewrite pass, so every test
    importing it died with `jest is not defined`.
  * vitest builds a mocked constructor with Reflect.construct, and an ARROW
    function is not constructible — `vi.fn().mockImplementation(() => ({...}))`
    threw "is not a constructor" the moment the code did `new SESClient()`.
    jest tolerated it. Two mocks needed function expressions.
  * removing @types/jest took the global describe/it/expect declarations with
    it; tsconfig now carries "types": ["vitest/globals"].

Verified locally before pushing: 272 passed, 2 skipped, 23 files.


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

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-29 09:15:12 +00:00
a95373b3a5 refactor: adopt ai-kit's tryChain + createHealthTracker (#164)
botsmann's own generateWithBestProvider/getProviderChain and llm-health.ts
were the source this session extracted ai-kit v0.5.0's tryChain and
createHealthTracker from. This adopts that package for real, closing the
gap flagged by a fleet-wide audit: botsmann had ai-kit installed for model
lists only, while the actual retry/health logic stayed hand-rolled here.

- generateWithBestProvider now builds one flat provider+model chain via
  ai-kit's usableChain/freeChain and walks it with tryChain, instead of
  two separate hand-rolled loops (provider here, model inside
  generateWithGroq/generateWithOpenRouter). Ollama stays a special-cased
  first check -- its availability is a live ping, not an API key, so it
  does not fit ai-kit's Provider shape.
- generateWithGroq/generateWithOpenRouter are unchanged in behavior,
  refactored into thin loops over new callGroqModel/callOpenRouterModel
  single-shot primitives -- the same primitives generateWithBestProvider's
  chain walk now calls directly, so there is exactly one fetch
  implementation per vendor, not two.
- llm-health.ts keeps its exact five-function API (every route and test
  still imports recordLLMSuccess/recordLLMFailure/getLLMHealth/
  resetLLMHealth unchanged) but now wraps ai-kit's createHealthTracker
  instead of hand-rolled module state.

One test's assertion on the aggregate-failure error wording updated
("provider(s)" -> "link(s)") to match ai-kit's more precise per-link
failure report; no other test needed changes. Full verify green: format,
lint, typecheck, 272 tests, production build.

Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-29 10:05:34 +02:00
dependabot[bot] b0dc7bdea0 chore(deps-dev): bump lint-staged from 15.5.2 to 17.3.0 (#162)
Bumps [lint-staged](https://github.com/lint-staged/lint-staged) from 15.5.2 to 17.3.0.
- [Release notes](https://github.com/lint-staged/lint-staged/releases)
- [Changelog](https://github.com/lint-staged/lint-staged/blob/main/CHANGELOG.md)
- [Commits](https://github.com/lint-staged/lint-staged/compare/v15.5.2...v17.3.0)

---
updated-dependencies:
- dependency-name: lint-staged
  dependency-version: 17.3.0
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-29 07:09:27 +00:00
GandClaude Opus 5 a533c2e342 chore: declare node >=20, the version the box actually runs (#158)
Was: undeclared.

Eighteen of thirty repos declared no Node version at all, and the twelve
that did used five spellings of the same intent - >=18, >=20, >=20.0.0,
>=22, >=22.19.0. The box runs 20.20.2, so >=22 was a claim nothing could
satisfy and nothing would have caught.

One spelling, matching the machine that runs it, turns an invisible
mismatch into a loud one.


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

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-29 09:04:45 +02:00
107e8c5c08 docs(db): point this repo at its own database, and gate the way back (#143)
The schema fix landed in #138, but the repo still told you to operate a
Supabase we do not have. docs/SUPABASE_SETUP.md opened with "Completed Setup"
for a hosted project jkjmhtirxwhljpkcfxqe.supabase.co and said to apply
migrations by pasting SQL into a supabase.com dashboard. Two unreferenced
scripts printed the same instruction, one handing out a psql string against
pooler.supabase.com, and the CLI's .temp cache with the old project ref was
committed — twice, once nested under supabase/migrations/.

That is not stale clutter, it is the outage. A wrong pointer to a real-looking
place is worse than no pointer: no pointer makes someone ask, a plausible one
makes them assume it was handled. Nobody pasted anything, the eleven migrations
were never applied, and /api/health served PGRST205 for months while every
deploy went green.

So the doc now describes what is actually true — self-hosted on bitbaum at
supabase.orangecat.ch, our tables in the `botsmann` schema because one database
backs several apps and `public` is orangecat's, and migrations applied
automatically on deploy by fleetcrown's apply-schema.sh against the
botsmann._deploy_schema_history ledger. Nothing is pasted anywhere. 280 lines
became 100.

Fixing today's copies only clears today's copies, so check:selfhost joins
verify: it fails on supabase.com/dashboard, app.supabase.com, pooler URLs and
real project refs, allows supabase.com/docs because the product documentation
is still correct for us, and exempts docs/archive/ so history can stay honest.
Proven to fail before shipping — it catches an injected dashboard link and a
project ref, and leaves the your-project.supabase.co placeholder alone.


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

Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-28 08:08:06 +00:00
GandMao Nakamoto f70fc612d9 chore(ci): GitHub owner catomean -> bitbaum (#141)
Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
2026-08-28 08:13:14 +02:00
Mao Nakamoto 49826f348e chore(ci): GitHub owner maonakamoto -> catomean 2026-08-27 19:18:26 +02:00
GandClaude Opus 5 198e54d38d fix(llm): take model ids from ai-kit, and try more than one (#137)
Both ids in `API_CONFIG` have been retired by their vendors:
`llama-3.1-8b-instant` at Groq and `openai/gpt-oss-20b:free` at OpenRouter. With
a valid key, this app's chatbot was answering 404.

Nothing was neglected here. The constant carried the correct instruction —
"free catalogues rot; when it does, replace it with another `:free` id" — and
that is precisely the maintenance that did not happen, because nothing tells a
constant when it has stopped being true. So the ids leave this repo. `ai-kit`
holds one list for the fleet, re-probes it against the live catalogues, and
dotfiles' daily audit asks both vendors whether those ids still exist.

One id was also not enough on its own. `generateWithBestProvider` picks ONE
provider and calls it exactly once, so a retirement had nothing between it and
a dead chatbot. Each vendor's call now walks that vendor's list: a 404 (retired)
or a 429 (busy or spent) steps to the next model instead of surfacing.

This is model-level fallback, not vendor-level — provider selection is untouched.
That is the smaller half of the protection, since a spent daily budget is
org-wide and kills every model at a vendor together. It is also the half that
covers rot, which is what actually happened here, twice.

An explicit caller override is still honoured as-is and alone. If someone names
a model, quietly answering from a different one is worse than failing.

The cost rule that lived in the deleted comment survives, and got stronger.
`free-fallback.test.ts` used to regex ONE constant; it now runs `modelCost` over
every OpenRouter id this app could send, using the same function the rest of the
fleet prices models with. OpenRouter is only reached when Groq's free tier is
spent — when nobody is watching — so a paid id there turns an outage into a bill.

The old tests deserve a note, because they passed throughout the outage: they
mocked `llama-3.1-8b-instant` and asserted it back, agreeing with production
about an id production was refusing. Worse, the OpenRouter test asserted
`anthropic/claude-sonnet-5` — a paid model on the free-tier fallback path, the
exact thing the fleet rule forbids, green the whole time. They now assert
against the chain, plus two new cases: a retired first model falls through to a
different one, and exhausting the list names the whole list.

`jest.config.js` transforms `ai-kit`, which is ESM-only. The comment there says
what does NOT belong in that list, since a transitive entry would mean a package
leaking a dependency through a re-export — a bug to fix at the source.

verify: format, lint, typecheck, 232 tests, build.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-26 22:07:23 +00:00
GandClaude Opus 5 8fde6923a7 ci: make the verify job actually run verify (#133)
The CI job here is named "verify" and did not call `npm run verify`. It
re-inlined the chain by hand, and the hand-written copy had drifted:

  package.json verify:  format:check → lint → test → build
  ci.yml:               format:check → lint → test → build   (--if-present ×3)

Neither ran a typecheck. `tsc --noEmit` existed nowhere in this repo, so type
errors were caught only as a side effect of `next build` — late, slow, and one
`typescript.ignoreBuildErrors` away from not being caught at all.

Two fixes, both the same principle:

1. Add a real `typecheck` script and put it in `verify`, before test/build so
   it fails in seconds rather than after a full Next build. Verified: `tsc
   --noEmit` is already clean (exit 0), so this gate goes green on arrival —
   it is closing a hole, not papering over a backlog.

2. CI now calls `npm run verify` verbatim, and the `--if-present` flags are
   gone. Those flags made three gates unable to fail: rename or delete the
   `lint` script and the step passes green instead of erroring. A gate that
   cannot go red is not a gate. That is exactly the defect that let evig
   report "Run Tests ✓" on every PR for three weeks while 25 assertions were
   failing (fixed in evig#306), and the same reason dotfiles#14 now sweeps the
   fleet for discarded gates.

Full `npm run verify` passes locally: format, lint, typecheck, test, build,
exit 0. Green verify locally now genuinely means green CI, because they are
the same command.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-16 10:50:00 +00:00
GandClaude Opus 4.8 7bf59b27dc ci: strict verify gate + verify SSOT script (#121)
* ci: strict verify gate + verify SSOT script

Reconciles PR #109's intent onto post-#120 main (self-hosted, no Vercel):
- add "verify" script (format:check && lint && test && build) — one
  definition of "green", run identically locally and in CI
- ci.yml runs `npm ci` then a single `npm run verify` step (no --if-present:
  a missing/renamed gate script fails loudly) instead of the old split steps
- add AGENTS.md, corrected to the real stack (Next.js 16 / React 19) and
  self-hosted Hetzner deploy referencing ci.yml — NOT the stale Vercel/Next14
  draft from #109 that would have re-added Vercel

Supersedes #109 (which conflicted on the workflow #120 renamed).

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

* style: prettier --write repo to make the verify gate green

The strict verify gate surfaced pre-existing format debt that main's long-red
CI (blocked-Vercel deploy step) had masked. prettier --write is mechanical and
content-preserving — the executive-docs keep their text (incl. the separate
Vercel-in-financials follow-up), only whitespace is normalised. Also excludes
the auto-generated next-env.d.ts from prettier. Build/lint/test already pass;
this clears format:check so verify is truly green (and un-reds main on merge).

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

* style: reformat with the repo-pinned prettier config (printWidth 100)

Prior format commit used a prettier invocation that didn't resolve .prettierrc
(fell back to printWidth 80); the pinned config (printWidth 100) rejected it.
Re-run with the repo's own prettier so format:check matches CI exactly.

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

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-28 10:10:11 +02:00
Mao NakamotoandClaude Opus 4.8 ed0447628c fix(deps): security overrides rebased onto Next 16 (sharp + transitive)
Re-applies the #112/#113 override set against the Next 16 / React 19 tree and
adds the coverage the framework upgrade newly required. Clears every
production-relevant Dependabot alert.

- postcss 8.4.35 → 8.5.10 (+ "postcss": "$postcss" self-override)
- overrides: protobufjs ^7.6.5, ws ^8.21.1, handlebars ^4.7.9, flatted ^3.4.2,
  fast-xml-parser ^5.7.0, @babel/core ^7.29.6, yaml ^2.8.3, and version-scoped
  picomatch/minimatch/js-yaml keys
- NEW: sharp ^0.35.3 — Next 16 + @xenova/transformers pulled sharp <0.35
  (libvips CVE-2026-33327/33328/35590/35591); the botsmann overrides never
  covered it. Clears the sharp/transformers/next cascade.

npm audit: 46 → 28, and the 28 are a SINGLE advisory (brace-expansion
GHSA-mh99-v99m-4gvg, "unbounded expansion length" DoS) cascading only through
DEV tooling (jest, eslint, eslint-config-next's plugins). It is NOT fixable
here: the only patched version (5.0.8) breaks eslint 9's @eslint/config-array,
and eslint 10 (which would fix it) breaks eslint-config-next 16's bundled
eslint-plugin-react. Zero runtime/shipped exposure; input is our own file
globs, not attacker-controlled. Unblocks when eslint-config-next supports
eslint 10 or the jest/eslint 9 lines adopt patched brace-expansion.

Verified: eslint ., tsc --noEmit, next build (Turbopack), jest 227 pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-26 15:39:21 +02:00
Mao NakamotoandClaude Opus 4.8 122f4b6779 chore(deps): upgrade Next.js 15 → 16 + React 18 → 19
Framework major upgrade, stacked on #111 (Next 14 → 15).

Dependencies:
- next 15.5.21 → 16.2.12
- react / react-dom 18 → 19.2.8, @types/react(-dom) → 19
- eslint 8 → 9 (flat config), eslint-config-next → 16, @typescript-eslint 6 → 8
  (also clears the lingering ts-eslint Dependabot alert)

Config migrations required by Next 16:
- `next lint` removed → lint scripts use `eslint .`; migrated .eslintrc.json to
  eslint.config.mjs (flat) composing eslint-config-next 16's native flat configs
  (FlatCompat crashes on the react plugin's circular flat object)
- typedRoutes graduated from `experimental` to a stable top-level option
- tsconfig target es5 → ES2017 (Next 16 drops es5; noEmit, so type-check only)

React 19 type-tightening fixes (behaviour unchanged):
- ImgHTMLAttributes['src'] widened to string | Blob → narrow before string ops
  (MDXComponents, ServerMDXContent)
- ReactElement['props'] is now unknown → annotate read shape (guides pre block)
- useRef<T>(null) returns RefObject<T | null> → widen ChatMessageList prop

Deferred (out of scope for a framework upgrade, tracked as follow-up):
eslint-plugin-react-hooks v6 (bundled with Next 16) adds React-Compiler-era
rules (set-state-in-effect, error-boundaries, immutability) that flag 30
pre-existing intentional patterns; disabled here. no-unused-vars caughtErrors
pinned to 'none' to preserve the pre-upgrade contract (v8 flipped the default).

Verified: tsc --noEmit, next build (Turbopack, all pages), eslint ., jest 227 pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-26 11:45:50 +02:00
Mao NakamotoandClaude Opus 4.8 354b432326 chore(deps): upgrade Next.js 14 → 15.5.21 (clears 15 Dependabot alerts)
Bumps next + eslint-config-next 14.2.35 → 15.5.21. React stays on 18
(Next 15 supports React ^18.2.0), so no forced React 19 migration.

Clears all 15 open next-related Dependabot alerts (4 high) — the highest
patched version required is 15.5.16, so jumping to Next 16 would add
breakage (React 19, Turbopack default) for zero additional security gain.

Next 15 breaking-change migration:
- Async request APIs: params/searchParams awaited in the 6 dynamic pages
  that consume them as props; cookies() is now async, so
  createRouteHandlerClient() became async (9 call sites awaited).
- next.config: serverComponentsExternalPackages → top-level
  serverExternalPackages (renamed/destabilized in Next 15).
- typedRoutes tightening: object href {pathname, hash} is no longer
  accepted → string href "/path#hash" (4 governance pages).
- eslint: ignore the Next-generated next-env.d.ts (Next 15 adds a
  triple-slash routes.d.ts reference that trips no-triple-slash-reference).

Verified: `next build` green — compiles, type-checks, lints, and
prerenders all 81 pages. Client components using the useParams()
hook are unaffected and left untouched.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-24 00:25:12 +02:00
Mao NakamotoandClaude Opus 4.8 2f0e0c9931 chore: drop @vercel/analytics (no-op off Vercel, self-hosted on Hetzner)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-11 07:27:19 +02:00
dependabot[bot] 6cead360b7 chore(deps): bump @tootallnate/once and jest-environment-jsdom (#93)
Removes [@tootallnate/once](https://github.com/TooTallNate/once). It's no longer used after updating ancestor dependency [jest-environment-jsdom](https://github.com/jestjs/jest/tree/HEAD/packages/jest-environment-jsdom). These dependencies need to be updated together.


Removes `@tootallnate/once`

Updates `jest-environment-jsdom` from 29.7.0 to 30.2.0
- [Release notes](https://github.com/jestjs/jest/releases)
- [Changelog](https://github.com/jestjs/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jestjs/jest/commits/v30.2.0/packages/jest-environment-jsdom)

---
updated-dependencies:
- dependency-name: "@tootallnate/once"
  dependency-version: 
  dependency-type: indirect
- dependency-name: jest-environment-jsdom
  dependency-version: 30.2.0
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-05 11:04:37 +01:00
g-butandClaude Opus 4.6 a5ce9cdf41 fix(deps): update next-mdx-remote 5.0.0→6.0.0
Vercel blocks builds with CVE-2026-0969 (next-mdx-remote <6.0.0).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 10:56:13 +01:00
g-butandClaude Opus 4.6 82e4623105 feat(rate-limit): replace in-memory rate limiting with Supabase-based
In-memory rate limiting (LRU cache + Map) doesn't work correctly in
serverless — each function instance has its own memory. Replace with
a Supabase PostgreSQL function that atomically checks and increments
per key, shared across all instances.

- Add rate_limits table + check_rate_limit SQL function (migration 010)
- Rewrite lib/rate-limit.ts to call Supabase RPC instead of LRU cache
- Simplify lib/middleware/rate-limit.ts to wrap the new checkRateLimit
- Update all 7 routes using the old LRU-based limiter
- Remove lru-cache and @types/lru-cache dependencies
- Auth routes (5) unchanged — they already use the middleware wrapper

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 17:23:15 +01:00
g-butandClaude Opus 4.6 26f48352da refactor(deps): remove deprecated @supabase/auth-helpers-nextjs
Replaced imports in lib/api-utils.ts (-> ./supabase-server) and
app/auth/callback/page.tsx (-> @/lib/supabase) with existing local
wrappers. Removed the deprecated package from dependencies.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 17:23:14 +01:00
g-butandClaude Opus 4.5 59f1f0512e fix(deps): patch fast-xml-parser vulnerability and improve Link usage
Security fixes:
- Add npm override for fast-xml-parser@^5.3.4 to fix RangeError DoS
- Update @aws-sdk/client-ses to 3.980.0
- Reduces vulnerabilities from 25 to 8 (fixed 17 high severity)

Code improvements (prep for future Next.js 15):
- Replace <a> tags with <Link> components for internal navigation
- Create ConsultationFormLoader client wrapper for dynamic imports
- Use direct Analytics import instead of dynamic with ssr:false
- Add eslint-disable for global-error.tsx (intentional <a> usage)

Remaining vulnerabilities (require breaking changes):
- 7 moderate: eslint circular reference stack overflow
- 1 high: Next.js DoS (specific conditions, low practical risk)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 12:53:40 +01:00
g-butandClaude Opus 4.5 f62f965066 chore: remove unused dependencies
Remove packages that were installed but never imported:
- @heroicons/react (using custom Icons instead)
- framer-motion (no animations used)
- nodemailer (email handled differently)
- @mdx-js/loader, @mdx-js/react, @next/mdx (using next-mdx-remote)
- @eslint/eslintrc, @eslint/js (using old .eslintrc.json format)
- @testing-library/react (tests use Jest only)

Reduces bundle size and maintenance surface.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 15:51:05 +01:00
g-butandClaude Opus 4.5 a54f6c2034 fix: add missing @supabase/ssr dependency
The migration commit referenced @supabase/ssr but didn't include it
in package.json.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 15:29:38 +01:00
g-butandClaude Opus 4.5 1c7abeebac docs(claude): add global standards reference and update date
- Add @~/.claude/CLAUDE.md import for global engineering standards
- Update Last Updated date to 2026-01-23

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 15:22:36 +01:00
g-butandClaude Opus 4.5 842673d2ba fix: migrate from deprecated @supabase/auth-helpers-nextjs to @supabase/ssr
- Replace deprecated auth helpers with @supabase/ssr package
- Split supabase utilities into client (supabase.ts) and server (supabase-server.ts) files
- Add SSG-safe mock client to prevent build errors during static generation
- Wrap auth callback page in Suspense boundary for Next.js 14 compatibility
- Add missing route constants (PROFESSIONALS, MY_DATA, ENTERPRISE)
- Fix email config to use fallback defaults during build
- Update waitlist model to use lazy-loaded service client
- Add explicit type annotations to auth context hooks
- Install pdf-parse dependency for document processing

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 09:52:46 +01:00
g-butandClaude Opus 4.5 403c9bf5a7 Add Phase 3: Document upload and RAG chat
- Add Transformers.js for local embeddings generation
- Create document upload API with Supabase Storage
- Create document processing pipeline (parse, chunk, embed)
- Create semantic search API using pgvector
- Create RAG chat API combining search + LLM
- Add documents page UI with upload, process, and chat
- Add database migration for document status columns
- Configure Next.js to externalize ONNX packages

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 12:39:43 +01:00
g-butandClaude Opus 4.5 e06e68f5fe Migrate database from MongoDB to Supabase
- Replace MongoDB/Mongoose with Supabase (free tier)
- Add lib/supabase.ts client with lazy loading
- Update consultations API to use Supabase
- Update health endpoint for Supabase
- Add SQL migration for consultations table
- Remove MongoDB dependencies from package.json
- Update .env.example with Supabase variables

Cost: $0/month (Supabase free tier)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 11:55:15 +01:00
g-butandClaude Opus 4.5 ddec243147 feat: add Swiss German RAG demo with keyword-based search
- Add RAG search module with TF-IDF-like scoring (lib/rag/)
- Create Swiss German knowledge base with 10+ chunks
- Build demo chat UI with suggested questions and source citations
- Add /api/demo/chat endpoint with Zod validation
- Update homepage with "Try the Demo" CTA and honest messaging
- Add /api/contact endpoint for consultation form
- Fix ConsultationForm to use real API endpoint
- Update bot cards to show accurate live/coming-soon status
- Remove legacy api/consultations.js (caused Vercel conflicts)
- Add nodemailer dependency for email functionality

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 08:38:43 +01:00
g-butandClaude Opus 4.5 d97fcf74e2 fix(security): patch glob CLI command injection vulnerability
Add npm override to force glob@10.5.0+ to fix CVE-2025-64756
(GHSA-5j98-mcp5-4vw2) - command injection in glob CLI -c/--cmd option.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 19:56:52 +01:00
g-butandClaude Opus 4.5 da5e38e209 fix: improve test suite reliability and configuration
- Add TextEncoder/TextDecoder polyfills for MongoDB/Mongoose tests
- Mock AWS SES client in email service tests
- Fix platform tests to properly handle missing credentials
- Skip MongoDB integration tests when MONGODB_URI not available
- Restore env vars between tests to prevent test pollution
- Install node-mocks-http for API route testing

Test suite: 11 passed, 1 skipped (integration test)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 17:18:52 +01:00
g-butandClaude Opus 4.5 2e39380356 feat: add strict ESLint config and fix all lint issues
- Add .eslintrc.json with strict TypeScript and React rules
- Fix all unused imports and variables (prefix with _ or remove)
- Replace all `any` types with `unknown` or specific types
- Fix React hooks rule violations (conditional hooks, deps)
- Change console.log to console.info per project standards
- Add eslint-disable comments for legitimate img element uses
- Fix anonymous default exports
- Update package.json with ESLint 8 and proper lint scripts

Lint: 0 warnings, 0 errors
Build: passes successfully

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 16:47:56 +01:00
g-butandClaude Opus 4.5 532457299e refactor: major codebase cleanup and consolidation
## Dead Code Removed
- lib/nlp.ts (418 lines - unused duplicate)
- DemoSection.old.tsx (obsolete file)
- src/components/bots/BotPage.tsx (never imported)
- TextGenerator.tsx & EmailGenerator.tsx duplicates

## Unused Packages Removed
- @sendgrid/mail (not used - only AWS SES active)
- mailgun.js (not used)
- form-data (not used)

## Structure Consolidated
- Moved all src/lib/* to lib/ (SSOT)
- Moved src/components/navigation/* to components/
- Removed empty src/ directory
- Updated all imports to use @/lib/

## Type Fixes
- Fixed implicit any types in WorkspaceDashboard.tsx
- Fixed type union in AICaseAnalysis.tsx
- Fixed typed routes issue in page.tsx
- Fixed MongoDB module load-time error

## Build
- npm run build passes successfully

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 00:01:42 +01:00
Your Name 8a55e4fb9e feat: Complete deployment automation and modern design overhaul
- Fix header layout to prevent movement when megamenu opens
- Redesign homepage with modern, futuristic aesthetic
- Implement automated deployment with GitHub Actions
- Optimize build process for production deployment
- Add deployment monitoring and verification scripts
- Update README with comprehensive deployment documentation

Breaking changes:
- Header now uses fixed positioning with backdrop blur
- Homepage features gradient backgrounds and glassmorphism effects
- Automated CI/CD pipeline with comprehensive testing and monitoring
2025-10-02 23:46:03 +02:00
G f4d6470f90 refactor: remove legacy navigation and cleanup 2025-07-02 15:10:32 +02:00
G c69dc09d70 Fix build issues and navigation paths 2025-06-13 17:25:03 +02:00
cato d0ae27b3eb Update bot pages and add product manager bot 2025-03-19 09:35:51 +01:00
cato 33036ac649 Fix: Update build script to ensure dependencies are installed 2025-03-17 14:14:33 +01:00