Commit Graph
636 Commits
Author SHA1 Message Date
CatoandClaude Opus 5.5 cc3b08ec7e fix(deps): raise the sharp override to the patched 0.35.4 (#206)
The last open advisory here was sharp < 0.35.4 (high). It was not an unpatched
dependency: next 16.3.5 already asks for ^0.35.4. The workspace override
`sharp: ^0.35.3` was holding the lockfile BELOW the fix next would have pulled
on its own -- an override floor under the advisory pins the vulnerable
version while reading as handled. Same minor, one patch up.

Verified: 0 advisories left.


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

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-25 01:21:09 -07:00
CatoandClaude Opus 5.5 ce98b0cc24 fix(ai): context extraction only on the user's own key; vendors by id (main green again) (#205)
* fix(ai): pick chain vendors by id, and make main green again

main has been red since #203 bumped @bitbaum/ai-kit to 1.10, which put
Gemini second in freeChain('BOTSMANN'). vendorChain() indexed [1] for
OpenRouter, so a BYOK OpenRouter user's key would have been sent down the
Gemini link. Look vendors up by id instead (code and both tests).

Also clears the rest of the red verify from the same bump: prettier 3.x
reformat of six files and the new next lint rule on relative
window.location.href assignments (sign-out keeps its full reload).

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

* fix(ai): context extraction runs only on the user's own key

Every professional-chat turn fired a second, unasked model call
(extractAndSaveContext, fire-and-forget after the answer) on the shared
free-tier Groq key. Standing rule (2026-09-25): free-tier keys are spent
only when a person deliberately asks. Extraction now requires the user's
own key and uses their provider; without one it returns before any call.

Adds tests/__tests__/no-free-background-ai.test.ts: walks the import graph
from the timer route (/api/rebuild, appcron-botsmann-rebuild), /api/warmup
and /api/health and fails if any reaches a model client. Proven by
mutation: importing lib/nlp into /api/rebuild fails it, and dropping the
own-key guard fails the three new extractor cases.

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 00:44:17 -07:00
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 fca4b30a06 chore(mailmap): converge on the org-wide canonical identity file (#202)
Adds the catch-all rule for any name on the canonical address, plus the
unnumbered form of the current noreply address, so this repo carries the same
.mailmap policy as the rest of the org. Every existing mapping is preserved.

No change to what git renders here: 8 authors before and after, 1288 commits.

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

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-17 06:33:08 -07:00
CatoandClaude Opus 5 d89306b89b fix(husky): resolve the push-deploy path at run time, not one laptop's home (#201)
.husky/pre-push is committed, so every clone of botsmann gets a hook that
hard-codes /home/g/dev/loki for both the CI gate and the deploy script -
one person's home directory, shipped to anyone who checks the repo out. On
any other machine both bash calls simply fail.

Resolve the checkout root at run time instead: DEV_ROOT, the variable
loki's scripts/hetzner/_box-env.sh already treats as the source of truth
for where the repos live, falling back to $HOME/dev. Behaviour on the
machine that generated the block is identical. The generated block and its
"# >>> loki push-deploy >>>" markers are otherwise untouched.

Verified: sh -n and bash -n on .husky/pre-push.


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

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-17 00:51:33 -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
CatoandClaude Fable 5.1 bade0a1b8e chore: rename FleetCrown to Loki (#197)
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
15 files changed, 29 insertions(+), 29 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:23:24 -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 Opus 5 39ee973130 fix(ci): a commit must not cancel another commit's run (#195)
The concurrency group was keyed by branch with cancel-in-progress, so a
newer merge cancels an older commit's CI — and every deploy path keys off
that run. One that waits for CI to pass on the commit finds a cancelled run
and stops. One chained on workflow_run sees conclusion=cancelled and skips.

auto-merge also re-arms CI with a dispatch, and under one group-per-branch
that dispatch cancels the push run for the SAME commit.

Measured across the fleet on 2026-09-11: 28 of 39 ci.yml files had this
shape. It broke two repos that day, in the two ways it can break.
fleetcrown failed silently — Deploy skipped, four merges sat on main with
every check green and nothing red while the box served the previous build,
each needing a hand-dispatched deploy. hirnli failed loudly, erroring at
its wait-for-CI step, which is the better outcome because somebody sees it.

Keying main per commit lets both runs finish, so whatever the deploy path
looks for is there. Branch behaviour is unchanged: the newest push is still
the only one that matters there.

The templates this was copied from are fixed in bitbaum/fleet#53, which
also adds a ci-strands-commits rule to the hygiene audit so the remaining
repos are found by a sweep rather than by an outage.


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

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-11 14:34:40 -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
dependabot[bot] 6cfe33e090 chore(deps): bump actions/cache from 4 to 6 (#192)
Bumps [actions/cache](https://github.com/actions/cache) from 4 to 6.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v4...v6)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-version: '6'
  dependency-type: direct:production
  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-09-08 23:41:50 -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 7dbd13393c ci(auto-merge): correct the reason this repo passes a PAT (#188)
The comment added a few hours ago says GITHUB_TOKEN cannot merge a PR that
touches .github/workflows. That is contradicted by this fleet's own history:
github-actions[bot] merged datacat#253 and ai-kit#42 today, and both change a
workflow file. I asserted it from the reusable workflow's docstring without
checking, then found the counter-evidence while looking for something else.

Two stalled PRs were offered as proof and neither survives either. ai-kit#11
opened 2026-08-29 and this repo's sweep was not added until 2026-09-04, so for
most of that PR's life nothing was sweeping at all. aoz-housing#122 is still
unexplained — I merged it before diagnosing it, which destroyed the evidence.

The THROUGHPUT reason is unaffected and is why the line stays. A dispatch made
with GITHUB_TOKEN triggers no workflows — the same rule the deploy reconciler
exists for — so after a merge the re-armed CI run's completion fires no
workflow_run and nothing wakes the sweep for the next PR. It waits for the
cron, which GitHub throttles: fleetcrown's sweeps land 50-65 minutes apart
against a */10 schedule. A PAT-created dispatch does emit workflow_run.

The wrong claim is recorded in the file rather than quietly deleted, so the
next reader does not re-derive it from the same docstring I did.

No behaviour change: an undefined secret still resolves to empty and the
reusable workflow still falls back to github.token.


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

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-07 15:54:20 +00:00
CatoandClaude Opus 5 4826999c67 fix(article): restore list markers — Tailwind's preflight erased every bullet (#187)
bip-kit's stylesheet styles list markers (`.bp-ul .bp-li::marker`) but never
re-declares a list type, relying on the browser default. Tailwind's preflight
resets `list-style: none` on every ul/ol, so under Tailwind bip-kit colours
markers that do not exist: every bullet and every number in an article
disappeared, leaving indented naked lines.

Caught by screenshotting the live page rather than the HTML — the markup is
identical either way, which is exactly why the structural checks in the
migration PR passed over it.

The durable fix belongs upstream in bip-kit/styles.css, since this hits every
Tailwind consumer of the renderer. These two rules are the local unblock and
carry a note to drop them once a bip-kit release declares the list types.


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

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-07 15:27:00 +00:00
CatoandClaude Opus 5 315bd7f6f9 ci(auto-merge): hand the sweep a PAT so workflow PRs stop stalling (#185)
GITHUB_TOKEN cannot merge a PR that touches .github/workflows. The sweep tries,
the merge API refuses, it logs "leaving for the next sweep", and repeats — while
still exiting 0. So the failure is invisible: every run reports success and the
PR simply never merges.

That is not hypothetical. ai-kit #11 (bump actions/checkout) sat green, CLEAN
and MERGEABLE for nine days; aoz-housing #122 (bump actions/upload-artifact)
for nine more. Both had to be merged by hand today. Every Dependabot
`github_actions` bump in the fleet is in this class, permanently.

A PAT fixes a second thing that costs more: THROUGHPUT. A dispatch made with
GITHUB_TOKEN emits no workflow_run, so after each merge nothing wakes the sweep
to take the next PR — it waits for the cron, and GitHub throttles scheduled
workflows to roughly hourly regardless of what the cron says. Observed in
fleetcrown: sweeps ~50-65 minutes apart against a */10 schedule. A PAT-created
dispatch does emit workflow_run, so the queue drains at CI speed instead.

The reusable workflow has always supported this — GH_TOKEN is
`secrets.token || github.token`. This just passes it.

SAFE BEFORE THE SECRET EXISTS: an undefined secret resolves to empty, and the
fallback picks github.token. So this changes nothing until FLEET_PAT is created
as an organisation secret, and needs no second pass afterwards.


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

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-07 15:07:56 +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 8f57cd9117 ci: cache Next's build output so CI stops recompiling from scratch (#182)
* ci: cache Next's build output so CI stops recompiling from scratch

Next keeps its compiler output in .next/cache and nothing restored it here, so
every CI run recompiled the whole app — and the deploy then compiled it again.

Measured across the fleet on 2026-09-07: of eight repos, exactly one cached
this in CI. 14 repos built cold; ten adopted the step today, and this is one of
the four that a mechanical sweep correctly declined — the install step here is
a bare `- run: pnpm install --frozen-lockfile` with no name, so the anchor missed it.
Read, then patched, rather than widened until it matched something.

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.

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

* style(ci): prettier

This repo's verify starts with `prettier --check .`, which covers
.github/workflows. A formatting-only miss reaches CI as a red build with
nothing else wrong.

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

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-07 14:09:13 +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
CatoandClaude Opus 5 2d327fc237 chore(identity): .mailmap resolves every past commit to Cato (#180)
This repo had no .mailmap, so git log and GitHub showed the raw author of every
commit — and seven variants had accumulated: G, g-but, Mao Nakamoto, three
noreply addresses, a personal gmail, and git's uninitialised default
"Your Name <your.email@example.com>".

A mailmap fixes the displayed author of every existing commit without rewriting
a hash, which is the only proportionate option for history that is already
merged and pushed.

Two kinds of rule are needed. Most variants are matched by commit email alone.
But commits authored as "G" carry the CANONICAL email, so an email-only rule
cannot reach them — mailmap matches on the commit's email, and theirs is
already the target. Those need a name+email rule on both sides.

Verified rather than assumed, over the last 400 commits:

    before:  G, g-but, Mao Nakamoto, Your Name, Devin AI, dependabot
    after:   288 Cato · 108 Devin AI · 4 dependabot

Devin AI and dependabot are genuinely different authors and are left alone.


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

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-05 15:56:22 +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
1632e8ed84 docs: sync docs with actual stack (#177)
Verified against package.json / .nvmrc / workflows / husky hooks on main:

- npm → pnpm everywhere (packageManager pnpm@11.25.0); build:ci described
  as `pnpm install --frozen-lockfile`, package-lock.json reference dropped
- Jest → Vitest (test runner is vitest 4)
- Stack tables: Next 14→16, React 18→19, TS 5→6, Tailwind 3→4, Zod 3→4;
  DaisyUI and Framer Motion rows removed (neither installed nor imported)
- Node.js 18+ → 24 (.nvmrc)
- Clone URLs: your-org / g-but → bitbaum
- SSOT.md pre-commit claim → actual husky hook (pnpm exec lint-staged)
- SHARED_CONTEXT deploy section: GitHub Actions now also deploys
  (deploy.yml → shared fleetcrown selfhost-deploy), not "CI only"
- .claude/CLAUDE.md path /home/g/botsmann → /home/g/dev/botsmann

docs/archive/** left untouched — dated historical reports.


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 14:43:07 +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
dependabot[bot] 4469225f42 chore(deps-dev): bump browserslist from 4.28.1 to 4.28.8 (#175)
Bumps [browserslist](https://github.com/browserslist/browserslist) from 4.28.1 to 4.28.8.
- [Release notes](https://github.com/browserslist/browserslist/releases)
- [Changelog](https://github.com/browserslist/browserslist/blob/main/CHANGELOG.md)
- [Commits](https://github.com/browserslist/browserslist/compare/4.28.1...4.28.8)

---
updated-dependencies:
- dependency-name: browserslist
  dependency-version: 4.28.8
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-09-03 14:57:52 +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
652b14a61f fix(health): stop gating HTTP status on AI vendor health in strict mode (#173)
?strict=1 turned an LLM outage into an HTTP 503 for the health endpoint,
which a monitoring/orchestration system reading that status would treat
as a reason to restart the process -- but a dead API key or exhausted
free-tier budget can't be fixed by a restart, so that's a pointless
restart loop for a problem restarting can't solve. Liveness now always
answers 200 once the database is reachable; LLM state stays in the body
as an informational field, unconditionally. The strict param existed
only to drive this gating, so it's removed rather than left as dead
branching.


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

Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-02 11:24:10 +00:00
GandMao Nakamoto 8ba5b82859 fix(nlp): route product-search query parsing through the multi-vendor LLM chain (#172)
lib/nlp.ts's processQuery() made a hardcoded direct fetch to
api.openai.com with a single model (gpt-3.5-turbo) and no fallback.
OPENAI_API_KEY is not configured in production, so this path always
threw before even reaching the network -- silently dead code on every
call from app/api/products/search/route.ts since deployment, papered
over only by the pre-existing basic-search fallback.

Replace the hardcoded OpenAI call with generateWithBestProvider from
lib/llm-client.ts, the same Ollama -> Groq -> OpenRouter chain every
other AI call path in this repo already uses. Preserves processQuery's
signature and its existing graceful-degradation contract (malformed
JSON or a fully unavailable chain still falls back to a basic keyword
search instead of throwing to the route).

Found by this session's fleet-wide AI-reliability audit, which has
been fixing this exact "single-vendor bypass, no fallback" shape
across the fleet.

Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
2026-09-02 10:36:17 +02:00
5145408c95 chore(ci): CI and .nvmrc follow the box to Node 24 (#171)
The box ran Node 20 four months past EOL; it moved to 24.20.0 today with
every service health-verified. CI validating on 20 now validates against
a runtime nothing uses.


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 16:10:42 +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
096b4c6021 fix(nav): the current page was coloured, never announced (#167)
`isActive` already decided the link's colour and set no aria-current, so the
current page existed only for people who can see it. Zero occurrences of
aria-current anywhere in this codebase.

The megamenu trigger is untouched: it is a disclosure button, not a link to a
page, and Popover.Button already announces aria-expanded/aria-haspopup itself.

No visual change.

Found by the fleet nav-contract audit, which flags a repo whose navigation
computes an active state and never announces it anywhere.


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

Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-31 11:49:34 +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] 8baf6c215f chore(deps): bump actions/setup-node from 4 to 7 (#157)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 4 to 7.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v4...v7)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-version: '7'
  dependency-type: direct:production
  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:18:31 +00: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
dependabot[bot] 9e583e911a chore(deps): bump actions/checkout from 4 to 7 (#156)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 7.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '7'
  dependency-type: direct:production
  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 06:58:34 +00:00
GandClaude Opus 5 ef4fa59217 chore: add a dependency watcher (#155)
* chore: add a dependency watcher

23 of 30 repos in the fleet had none. The symptom looks like neglect and
is not: aoz-housing had 100 commits in August, features landing daily, and
was still on Next 14 / React 18 / Tailwind 3 — because nothing ever OPENED
the upgrade PR. Version drift here is the absence of a mechanism.

npm directory: /. Minor and patch grouped so the sweep spends one
cycle on them; majors stay separate because they deserve reading.

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

* chore: format the watcher config for this repo prettier

botsmann is one of only three repos in the fleet whose verify runs
`prettier --check .`, and prettier checks YAML too — so the new
.github/dependabot.yml failed format:check while the identical file passed in
the other 22 repos.

Worth noting rather than just fixing: the formatter is not the odd one out
here. Three of thirty repos have any formatter at all. This repo caught a real
inconsistency the other twenty-seven could not have.

* chore: format the watcher config to this repo's prettier settings

botsmann is one of three repos in the fleet whose verify runs
`prettier --check .`, and prettier checks YAML — so the same dependabot.yml
that passed in 22 other repos failed here on quote style: .prettierrc sets
singleQuote, the file used double quotes.

The first fix attempt ran prettier WITHOUT the repo's config and reported no
changes, which looked like the file was already clean. A formatter run with
default settings does not answer whether a repo's formatter is satisfied.

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-29 08:42:26 +02:00
a5ca4af8b9 fix(ai): a revoked key on the first provider took the whole chain down (#154)
generateWithBestProvider picked ONE provider and called it once. Being
configured counted as being available, so a present-but-revoked key was
indistinguishable from a working one: botsmann's Groq key started returning
401 and the entire AI layer went down, with no attempt at anything else.

kivvi survives the same dead-Groq situation on this box because it has an
OpenRouter key and reaches it. botsmann would not have, even after adding
one -- Groq is chosen first for merely existing, and its 401 was terminal.

  getProviderChain()          every configured provider, in preference order
                              (Ollama, Groq, OpenRouter) rather than the first
  generateWithBestProvider()  walks that chain, demoting on failure, and only
                              throws once every provider has been tried

generateLLMResponse already walks the model list within a provider (#137), so
this is the layer above: models, then providers. The error now names each
provider that failed and why, instead of surfacing whichever one happened to
be first.

This does NOT restore botsmann's AI. Every working LLM key on the box belongs
to a client -- AOZ's and RevampIT's -- and botsmann is a bitbaum product, so
pointing it at one would bill a client for our usage. It needs its own key.
What this does is make sure that once a second key exists, one dead key can
never take the product down again.

verify: format, lint, typecheck, 272 tests, build -- all green.


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

Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-28 16:09:06 +00:00
222a57c781 fix(health): liveness must not fail on something a restart cannot fix (#153)
#151 made /api/health return 503 whenever the LLM chain was down. That is
right for alerting and wrong for liveness: restarting botsmann does not
repair an expired Groq key, so the only effect of failing there is to get a
healthy process killed, and to fail deploy gates on a problem no deploy
caused. That is the failure class that teaches people to bypass the gate.

  GET /api/health            liveness -- 200 while the process serves and the
                             database answers. The body still carries
                             status: healthy | degraded | down and the full
                             llm block, so the outage stays visible.
  GET /api/health?strict=1   readiness -- 503 once the chain is consistently
                             failing. Point alerting here.

'unknown' (nothing has exercised the chain since this process started) is not
evidence of a problem, so it reports healthy rather than degraded.

The deploy gate was never at risk -- selfhost-deploy.yml curls the homepage,
not this endpoint -- but the shape was wrong regardless, and the guidance in
CLAUDE.md does point a post-deploy check at /api/health.

The guard now asserts the 503-on-LLM path stays behind `strict`, so this
cannot quietly become unconditional again.

verify: format, lint, typecheck, 269 tests, build -- all green.


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

Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-28 12:10:46 +00:00
GandClaude Opus 5 ba5923f0ac docs(ci): the sweep lives in bitbaum/fleet, not dotfiles (#152)
The `uses:` line is already correct. What was stale is the prose next to
it, which told the reader the policy lives in bitbaum/dotfiles and to go
change it THERE. That file no longer exists in dotfiles — the sweep moved
to bitbaum/fleet on 2026-08-28, because a repo holding someone's .bashrc
is not where a fleet's deploy policy belongs.

A comment that misroutes a fix is worse than a missing one: it sends the
next person to edit a repo where the change would reach nobody, which is
the precise failure the shared sweep exists to prevent.

Files: .github/workflows/auto-merge.yml


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

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-28 14:02:35 +02:00
b5b2f967fe fix(ai): a total LLM outage was reporting itself as success (#151)
Found by driving the Lex demo in production: the chat answered "I'm sorry,
I encountered an error processing your request." Behind it, every AI feature
on the site is down and has been invisible.

The box has an invalid Groq key, no other provider key, and no Ollama:

  Groq API error: 401 (model openai/gpt-oss-120b)  {"code":"invalid_api_key"}
  Groq API error: 401 (model openai/gpt-oss-20b)   {"code":"invalid_api_key"}

Every endpoint answered HTTP 200 anyway:

  /api/demo/chat          {"success":true,"data":{"response":""}}
  /api/quick-chat         {"success":true,"data":{"response":"I'm having a moment..."}}
  /api/professional-chat  same
  /api/health             {"success":true,"data":{"status":"healthy"}}

Green everywhere, product dead. demo/chat was the worst of the three: its
catch returns `content: context`, and a bot demo has no context, so a failed
generation became a successful empty string.

  - demo/chat throws LLMUnavailableError when there is nothing to fall back
    on; the knowledge-base demo still serves its retrieved passage
  - quick-chat and professional-chat return 503 LLM_UNAVAILABLE instead of
    apologising with 200
  - lib/llm-health.ts records what generations actually did; /api/health
    reports it and returns 503 once the chain is consistently failing, so
    "healthy" stops meaning "the database answered"

tests/__tests__/api/professional-chat.test.ts asserted the bug -- 200, the
word "moment", provider 'fallback'. It now asserts 503 LLM_UNAVAILABLE. A
test that pins broken behaviour is worse than no test.

Never-twice: tests/__tests__/lib/llm-health.test.ts covers the tracker's
state machine and asserts at source level that no chat route answers an LLM
failure with success, and that health consults the LLM chain.

This makes the outage visible. It does NOT fix it -- that needs a valid
GROQ_API_KEY (or OPENROUTER_API_KEY) in /opt/botsmann/shared/.env on the box.
Until then these endpoints will correctly return 503.

verify: format, lint, typecheck, 268 tests, build -- all green.


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

Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-28 11:57:09 +00:00
346a3ff744 refactor(design): the bot demo was the sixth colour system (#150)
#144 branded the bot page sections. It did not reach the demo underneath
them, so every first-party bot still ran the per-colour palette in its
interactive step -- the buttons, focus rings, progress dots, message bubbles,
dropzone and context panel -- plus the bot switcher in the nav.

The colour came from lib/demo/botDemoConfigs.ts, which carried its own
accentColor per bot (blue, green, red, indigo, amber). That is the sixth
place a colour was chosen, after: globals.css, lib/config/colors.ts,
lib/hooks/navigationConfig.ts, ACCENT_HERO_CLASSES, and data/professionals.ts.

DemoSection and BotSwitcher are used ONLY by the first-party bot pages
(verified: no custom-bot page imports either), so both are now brand:
BRAND_BUTTON, BRAND_FOCUS_RING, BRAND_STARTER, BRAND_CHECKBOX, BRAND_PROGRESS,
BRAND_MESSAGE, BRAND_DROPZONE, BRAND_CONTEXT_PANEL, BRAND_SWITCHER.

accentColor is gone from the demo config, its type, and the whole prop chain.

What still emits raw palette, correctly:
  VISION_STATUS_CONFIG   roadmap status -- completed green, in-progress blue,
                         planned amber, vision purple. Four states that have to
                         stay tellable apart; collapsing them to ochre would
                         destroy the information.
  the /personal templates per-template identity in the memorial/legends
                         product, chosen from an allowlisted surface.

Both live behind lib/config/colors.ts, which the guard already documents as an
exception -- so the guard passing while those classes ship is correct, not a
blind spot. The blind spot was data/professionals.ts, fixed in #149.

verify: format, lint, typecheck, 256 tests, build -- all green. Bot demo
confirmed ochre end to end against a local production build.


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

Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-28 10:21:48 +00:00
393a7e2b02 fix(design): the homepage had a fifth colour system, and the guard missed it (#149)
#148 shipped with the guard passing and the homepage still emitting
bg-blue-100, text-indigo-600, bg-purple-100. Both were true, because the
guard only walked app/ and components/.

The palette was in data/professionals.ts -- its own getAccentColorClasses,
giving each of the six first-party professionals a colour (blue, green,
indigo, red, amber, purple). Same mistake as the bots in #144, in the one
directory the scanner did not read. That is the whole lesson: a source
scanner is blind in exactly the shapes you forget to look at, so its first
clean run proves nothing.

  - the six professionals now use the brand, like the six bots
  - the guard walks data/ and lib/ too
  - data/menuItems.ts lost a blue/purple gradient

Two files are now DOCUMENTED exceptions rather than debt, because their
colour is categorical and has to stay mutually distinguishable:

  lib/constants.ts                    document status -- pending yellow,
                                      processing blue, ready green, error red.
                                      Recolouring "processing" to ochre would
                                      make state read as brand chrome.
  lib/infrastructure/providers.ts     per-provider identity, so Ollama and
                                      OpenAI are tellable apart at a glance.

Both sit alongside Callout.tsx's info/warning/error triad, each with its
reason written next to it.

verify: format, lint, typecheck, 256 tests, build -- all green. Homepage
confirmed to emit no raw palette class at all.


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

Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-28 10:04:44 +00:00
f04d13bf39 refactor(design): finish the colour sweep, and make it enforceable (#148)
#144 put the bot pages on the brand. This does the other 60 files, so the
whole product reads as one thing, and adds the guard that keeps it that way.

~410 raw palette classes became semantic tokens across the public marketing
surface (/try, /enterprise, /about, /knowledge, /personal, /professionals,
/bots, blog, navigation) and the app internals (dashboard, documents, chat,
conversations, onboarding, auth, settings, profile).

Gradient text is gone. Fifteen headings were
`bg-gradient-to-r from-X to-Y bg-clip-text text-transparent`; they are now
solid text-ink or text-action. globals.css says the identity is carried by
typography, and a serif display does not need a gradient to do that.

The 'B' mark was still a blue/purple gradient in BotNavigation's MOBILE menu.
#144 only fixed the desktop header. Both now render the shared <Logo>.

Three defects introduced mid-sweep and corrected, all caught by reading the
diff rather than trusting the regex:
  - degenerate gradients (`from-action-tint to-action-tint`) collapsed to solid
  - dead hovers (tint on tint) rebased to bg-surface + hover:bg-action-tint
  - `to-action\b` matched the prefix of `to-action-hover`, so a collapse left a
    stray `bg-action-hover` as a BASE background in 11 places -- those are the
    primary, not the hover shade

Deliberately NOT changed:
  - components/knowledge/Callout.tsx -- its blue is the `info` half of an
    info/warning/error triad. Semantic status colour is a separate scale from
    the brand accent, and warning is amber, so ochre-ing info would make the
    two nearly indistinguishable.
  - the custom-bot surfaces -- custom_bots.accent_color is a real column with
    a CHECK constraint and the owner picks it. User data, not a design token.

Never-twice: tests/__tests__/lib/design-tokens.test.ts refuses any raw
brand-palette class, and any bg-clip-text, outside those two documented
exceptions. Mutation-verified -- swap one token back to bg-blue-600 and it
fails and names the file. No allowlist debt: every other file was swept rather
than excused.

verify: format, lint, typecheck, 256 tests, build -- all green. Twelve pages
smoke-tested and checked visually against a local production build.


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

Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-28 09:53:41 +00:00
17689c1358 feat(bots): restore the content for the remaining four bots (#147)
Follows #146, which proved the pattern on Imhotep: recover the copy from
the components deleted in 4600019e, express it with existing section types,
add the nav entry, let the nav-integrity guard verify it. No new components.

  research-assistant   5 -> 8 sections   3,062 -> 4,366 chars  (+43%)
    research-system  the six ways Nerd organises an upload
    scraping         the six sources it watches (ArXiv, Scholar, PubMed,
                     Nature, Science Daily, MIT Tech Review)
    drafts           abstract / literature review / methodology / discussion

  product-manager      5 -> 8 sections   2,539 -> 3,752 chars  (+48%)
    benefits         the four Trident actually delivers
    showcase         feature planning, technical debt, cross-team coordination
    integration      GitHub and Jira, with what each one does

  swiss-german-teacher 5 -> 8 sections   2,793 -> 3,900 chars  (+40%)
    language-learning  vocabulary, conversation, grammar
    communication      email and texting, in the right register
    culture            video, podcasts, articles

artistic-advisor keeps 5 sections: it only ever had 217 lines, so unlike the
others it lost almost nothing. It gains two nav entries for the sections it
does have, instead of a two-item menu.

Nav went from a low of two items per bot to five or six, and every entry
points at a section that renders -- enforced by the guard added in #146.

Copy was rewritten rather than pasted. The originals were written for a
different page structure and carried filler; this keeps the substance and
drops the padding.

verify: format, lint, typecheck, 253 tests, build -- all green. Verified
visually against a local production build.


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

Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-28 09:22:50 +00:00
4447a97afb fix(bots): repair 20 dead nav links, restore Imhotep's lost content (#146)
The config-driven refactor (4600019e) deleted ~16,000 lines of bot page
content but left data/bots.ts still advertising it. Every bot's nav kept
linking to sections that no longer existed:

  swiss-german-teacher  communication, culture, waitlist
  research-assistant    scraping, drafts, questions, discovery,
                        integration, roadmap
  medical-expert        harm-reduction
  artistic-advisor      styles, techniques, get-started
  product-manager       workflow, showcase, examples, integration,
                        testimonials, pricing, get-started
  legal-expert          get-started

Twenty menu items that scrolled nowhere, on the live site, for seven months.
Nothing failed because nothing compared data/bots.ts to bot-pages.ts.

Now they do: tests/__tests__/lib/bot-nav-integrity.test.ts asserts every nav
item targets a section the page actually renders, and that ids are unique.
Mutation-verified -- repoint one item at a missing section and it fails and
names it.

legal-expert's 'Get Started' was repointed to the cta section it clearly
meant. The rest are removed, because the sections they named are gone.

Content restored for medical-expert, recovered from the deleted components
and ported as config (no new components needed):
  medbox         MedBox home health lab -- the 6 sensors
  health-topics  the 6 topics Imhotep covers
  regimens       Basic / Advanced, and how they compare to Blueprint

Its page goes from 7 sections to 10, and from 3,833 to 5,380 rendered
characters. The nav gains MedBox and Topics in place of the dead link.

NOT restored: the harm-reduction section, a substance comparison table
covering heroin, methamphetamine, MDMA, LSD and psilocybin. On a site
offering AI health guidance that is a product and possibly a regulatory
decision, not a cleanup one. It stays in git at 4600019e^ pending a call:
  git show 4600019e^:app/bots/medical-expert/components/features/HarmReductionSection.tsx

The other four bots still need their content ported; this is the pattern.

verify: format, lint, typecheck, 253 tests, build -- all green. Verified
visually against a local production build.


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

Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-28 10:42:26 +02:00
GandClaude Opus 5 5ee3080274 chore(ci): call the auto-merge sweep from bitbaum/fleet (#145)
The fleet automation moved out of dotfiles on 2026-08-28; the dotfiles path
is now a forwarding shim. This points the caller at the sweep's real home.
One line; the reusable workflow's interface is unchanged.


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

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-28 08:41:01 +00:00