21 Commits
Author SHA1 Message Date
CatoandClaude Opus 5.5 ebe51fa38e feat(auth): every way in on AccountKit's own screens (#289)
* feat(auth): every way in on AccountKit's own screens

Botsmann signed people in against OrangeCat's GoTrue (auth.users). It now
runs on AccountKit (@bitbaum/accountkit 0.23) with AccountKit's own forms:
/auth/signin offers email and password, an emailed sign-in link, a
passkey, recovery through the mailed link and the second factor;
/auth/signup is sign-up; /account carries the account panel ("Sign-in and
security" in the account menu). "Continue with OrangeCat" and the shared
sign-in show when their clients are set, the link and recovery when mail
is. The GoTrue routes (/api/auth/signin, signup, forgot-password,
resend-verification, profile) and pages (callback, forgot-password,
reset-password, verify-email) and the cookie-session client are gone.

AccountKit's tables live in a host accounts database (drizzle/, loki
accounts-db.conf); the data stays in the botsmann supabase schema, which
every route already read with the service-role client. verifyUser now reads
AccountKit's session; /api/user/profile moves onto it too. New accounts get
uuid ids, and migration 013 drops the person columns' keys to auth.users,
which a new person's id is not in. Nothing is deleted. The profile editor
writes AccountKit's name and image.

Existing people keep their rows: scripts/db/accountkit-people.sql lists
everyone who owns rows with their OrangeCat actor id, and
scripts/db/accountkit-import.sql gives each an account under the same id,
linked to OrangeCat by that actor id, never by address (loki
accountkit-supabase.yml rehearses it rolled back, then imports).

Pages were served with public, max-age=3600 to every browser, account pages
included: after sign-out the browser showed its cached /account. /account
and /auth/* are now private, no-store. The account menu's trigger has a name.

tests/__tests__/accounts runs the ways in and the import on the committed
migration; browser-smoke.yml's account job rehearses the import and runs
the browser journey against the production build with AccountKit's real
mail caught by a sink.

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

* fix(auth): send a signed-out visitor to sign in with the router

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

* ci(auth): the shared sign-in's button is matched by how it starts

AccountKit 0.24 names only the providers Morulia publishes, so the label
changes with Morulia.

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

* ci(auth): expect the shared sign-in only once Morulia publishes a provider

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

* ci: run the checks on the journey change

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-02 23:27:16 +01:00
Cato cd15ab47e9 fix(contact): save real requests and add browser rollout journeys (#239)
* fix(contact): require saved requests and add real browser rollout journeys

* test(browser): preserve project viewport in no-script journey

* test(browser): use published long article for contents navigation

* test(browser): exercise production runtime and retain failure diagnostics

* test(browser): target the contact alert and real standalone entrypoint
2026-10-27 23:26:11 +01:00
CatoandClaude 53cf95dc0b docs: clear docs-truth drift (#230)
- Archive point-in-time records into docs/archive (AUDIT_REPORT,
  README-heidi-implementation, DATA_ROOM_GUIDE — the Lex data room was never
  built and its siblings were already archived); add docs/archive/README.md.
- Delete .claude/.ralph-loop.local.md, a committed agent-loop state file
  whose referenced plans no longer exist.
- Fix stale locations: lib/api (no lib/services), app/globals.css @theme
  (no tailwind.config.js on Tailwind 4), migration filename placeholder.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-19 13:58:16 +02:00
CatoandCursor b168f130fd refactor(content): blog and guides on bip-kit 0.5's collection reader (#214)
lib/blog.ts and lib/knowledge.ts read their folders with readCollection /
readEntry instead of their own readdir + parseFrontmatter loops; the
published: true opt-in stays. lib/longform uses bip-kit's normalizeMarkdown,
which started as a copy of ours. Same posts and guides, same fields; items
with the same date now sort by title instead of by filesystem order.

The blog content doc still described the separate MDX content repo.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-30 10:15:17 -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
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
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
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
Mao NakamotoandCursor 137c827306 fix(feedback): allow FleetCrown widget origin in CSP
The embed tag was in the HTML but script-src blocked widget.js, so the FAB
never booted and coverage stayed waiting for first page load.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-14 12:24:09 +02:00
Mao NakamotoandCursor 58e5202fae docs: add SSOT created and last-modified dates
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-14 12:11:17 +02:00
Mao NakamotoandCursor b0ee824c2f docs: note FleetCrown widget token is a build-time env
Runtime-only .env after deploy does not emit the Script; CD must have the
token when Next builds.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-14 12:10:14 +02: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
GandClaude Opus 4.8 26b042cd86 chore(infra): remove Vercel references — self-hosted now (#120)
Botsmann now runs self-hosted on the Hetzner box "bitbaum" behind Caddy
(botsmann.orangecat.ch); Vercel is fully decommissioned.

- CI: rename the "Deploy to Vercel" workflow to a vendor-neutral CI workflow
  (build/lint/test only). Actual deploy runs from .husky/pre-push → Hetzner
  deploy script. Remove vercel.json and the Vercel-only deploy-monitor.sh.
- Docs: rewrite current-setup deploy/hosting text in .claude/CLAUDE.md,
  README badge, docs/COMMANDS.md and docs/SHARED_CONTEXT.md to the self-hosted
  box. Repoint the dead botsmann.vercel.app URL → botsmann.orangecat.ch.
- Code: neutralize "(Vercel)" route-segment comments; reword the warmup cron
  comment; update the demo page tech-stack line to self-hosted.
- Keep: secret-scan guardrail (VERCEL_OIDC_TOKEN) and `env -u VERCEL` in the
  husky hooks, the educational hosting-comparison page, historical docs/archive,
  and executive-docs business/finance planning material (see PR body).

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-28 09:23:49 +02:00
Mao NakamotoandClaude Opus 4.8 1cdbe7108c docs: reflect Next.js 16 / React 19 stack
The framework upgrade (#114) invalidated the stack claims in the live,
authoritative docs. Update them to Next.js 16 / React 19:
- .claude/CLAUDE.md (Overview + Tech Stack table)
- README.md (Frontend table + tree comment)
- docs/SHARED_CONTEXT.md (App Router heading)

Point-in-time/archival docs (audit reports, whitepaper, investor deck) are
left as-is — they were accurate when written. The Vercel/deployment line is
left to the concurrent chore/remove-vercel work.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-26 15:07:56 +02:00
g-butandClaude Opus 4.6 33c9c835bd fix: apply remaining audit fixes (API standardization, SSOT configs)
Standardize signup route to use jsonSuccess/jsonError helpers, extract
connection status config, clean up StatusBadge/ProviderCard inline maps,
add input validation to knowledge route, fix domain validation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 17:23:17 +01:00
g-butandClaude Opus 4.6 2d5dc85501 refactor: remove dead code, archive historical docs, fix README
- Remove duplicate ApiResponse, apiSuccess, apiError, withErrorHandling,
  requireAuth, ERROR_MESSAGES from lib/api-utils.ts — only verifyUser
  was actually imported anywhere. Response utils SSOT is lib/api/responses.ts
- Archive 14 historical LEX-era design docs to docs/archive/ — docs/
  now has only 9 active reference files (down from 29)
- Remove mock data and placeholder images from Amazon/Ricardo platform
  integrations — functions return [] until real APIs are implemented
- Update platform tests to match actual behavior
- Fix README.md: update backend tech (Groq/OpenRouter), add Supabase
  to prerequisites

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 10:46:04 +01:00
g-butandClaude Opus 4.6 9bf4630fd2 chore: clean up stale docs, fix outdated dates and content
- Archive 10 stale/completed docs to docs/archive/ (MongoDB-era,
  migration plans, stale status snapshots, AGENTS.md.new)
- Rewrite SHARED_CONTEXT.md: remove MongoDB sections, update env vars
  table to Supabase, fix project structure to match reality, fix data
  flow diagrams
- Fix "January 2025" typo → "January 2026" across 6 doc files
- Update governance demo dates from 2023 to 2026
- Fix "launching 2025" → "launching 2026" in techno-capital
- Update bot roadmap timelines and expected launch dates
- Fix demo chat bot status from "coming soon" to "demo available"
- Add missing OPENROUTER_API_KEY to .env.example
- Fix stale path in RALPH.md (src/lib/schemas/ → lib/validations/)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 10:22:39 +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 1291bbbb41 docs: update About page, README, and clean up stale documentation
- Rewrite About page with new "AI Professionals" positioning
- Add embodied AI future vision section
- Explain the problem we solve (accessible expert advice)
- Fix 'Artr' typo to 'Muse' in professionals.ts
- Update README with new positioning and professional table
- Delete stale planning docs:
  - .claude/BILLION_DOLLAR_STRATEGY.md
  - .claude/HONEST_REBUILD_PLAN.md
  - .claude/EXPERTISE_REFRESH_PLAN.md
  - .claude/FULL_SITE_AUDIT.md
  - .claude/THREE_TIER_ECOSYSTEM.md
  - .claude/SUPABASE_SETUP.md (duplicate)
  - @fix_plan.md (completed sprint)
  - docs/NAVIGATION_FIX_PLAN.md (completed)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 12:43:38 +01:00
g-butandClaude Opus 4.5 f01b7856dd docs: add comprehensive agentic development infrastructure
Add AI agent configuration files:
- .claude/CLAUDE.md - Claude Code instructions
- AGENTS.md - OpenAI Codex/universal agent guide

Add development documentation:
- docs/BEST_PRACTICES.md - DRY, SSOT, SoC, YAGNI, KISS principles
- docs/SHARED_CONTEXT.md - Tech stack and architecture
- docs/COMMANDS.md - npm scripts reference

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 23:08:26 +01:00
g-butandClaude Opus 4.5 9da2ba02b7 chore: clean up repo structure
- Delete junk file 'et --hard HEAD~1' (typo artifact)
- Remove .DS_Store from tracking
- Move 22 markdown docs from root to /docs/
- Add logs/ to .gitignore and remove log files
- Remove empty orphan serenade.py

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 22:51:38 +01:00