Commit Graph
249 Commits
Author SHA1 Message Date
cato 0fe6d7e567 Report safe sign-in lifecycle metadata when responsive checks fail 2026-11-04 14:57:02 +00:00
cato 8094d1ab06 Wait for authenticated DOM before responsive layout checks 2026-11-04 14:46:35 +00:00
Cato 702d5593de fix(cat): preserve failed turns and expose safe diagnostics (#1543) 2026-11-04 14:52:20 +01:00
CatoandClaude 553d330843 feat(oauth): a client for every fleet sign-in page, given its secret on the box (#1523)
The owner's rule (2026-11-01): every fleet app offers every sign-in method,
"Continue with OrangeCat" included. Ten apps with a sign-in page had no
client: aoz-begleitung, biaslens, botsmann, diplodoctor, hirnli (on both
hosts), keller, kivvi, printcraft, reparaturbonus-zh and vitareba (vita and
vitareba hosts). They are now in client-specs.ts, identity-only.

Creating a client used to mean running register-client.ts on the box and
copying the printed secret by hand. Now the deploy's client SQL also creates a
missing row, switched off and with no secret: inert twice over (getClient
reads only enabled rows; verifyClientSecret rejects a null hash). loki
app-secrets.sh (kind oc-client, bitbaum/loki#1533) then writes the secret
into the app's env and its sha256 into the row, and switches it on, printing
neither. register-client.ts now mints a secret for such a row instead of
re-enabling it secretless.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 21:55:29 +01:00
CatoandClaude Fable 5.1 30ed087aef feat(bots): a bot writes first on the person's own key, and can ask Loki as them (#1503)
* feat(bots): a bot writes first, on the person's own key

A person can tell one of their bots to write first, every day at a time
they pick, with a prompt they wrote. The run happens on the person's own
OpenRouter key only; without a key the routine is kept, shown as waiting,
and skipped with the reason, so no platform key is ever spent by a timer
(fleet standing rule 2026-09-25).

- companion_routines table (one per person per bot, owner-only RLS),
  routines-store (time validation, next run in the person's zone) and the
  runner behind a cron route + 15-minute systemd timer, registered as a
  person-asked timer in the no-background-ai gate with a marker check.
- GET/PUT/DELETE /api/ai-assistants/[id]/routine for the owner.
- RoutineRow in a bot's own chat: "Writes first, every day", time and
  prompt inline, a line to Settings when a key is missing.
- Hands: the proposal line names what will be set up, never only "Sure";
  a created event's outcome carries its link.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmrXvMqAqZtbpQ4x3et

* feat(bots): a bot can ask Loki, as the person — the first connector

ask_loki: a Cat action (communication, low risk, confirmed) in the hands
launch set. The bot relays a question over the signed OrangeCat → Loki rail
to Loki's POST /api/orangecat/ask, which runs a read-only turn as the Loki
user linked to the actor; Loki's own sentence is the outcome the person
reads, and a refusal (no linked account, a spent budget) is relayed as
written. A relayed question can never dispatch, approve or spend: that stays
with send_task_to_loki, and the two verbs name each other so a question is
never dispatched as a task.

ADR-0013: D6 first connector and D7 recorded as shipped.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmrXvMqAqZtbpQ4x3et

* fix(bots): the routine's day-in-zone comes from the timezone helper

check:app-locale (new on main) refuses a literal locale handed to Intl; the
routine's next-run computation now takes the day in the person's zone from
instantToWallTime, the one rendering the app already trusts.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmrXvMqAqZtbpQ4x3et

* fix(bots): the chip knows the verb of ask_loki

The tool-label table of leading verbs gains ask → Asking / Asked, so the
chip for a bot's question to Loki never falls back to the generic label.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmrXvMqAqZtbpQ4x3et

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 07:40:33 +01:00
CatoandClaude e4719fdc80 feat(brand): the cat rotorelief, and Loki's disc, replace the coils (#1476)
The Cat's mark is now a cat's head whose face is one of Duchamp's
rotoreliefs (Anémic Cinéma, 1926): off-centre rings that, turned, read
as a tunnel breathing in and out. Only the rings turn (new motion
'turn', about the face's centre); the head stays still. On its icon tile
the Cat wears Bitcoin orange (new iconInk); elsewhere it is currentColor.

Loki's mark mirrors bitbaum/loki's new rotorelief disc.

The installed OrangeCat icon showed as a blank black tile on an Android
home screen. The manifest was the only one in the fleet listing its SVG
icon first; generate:brand now lists the PNGs first and the SVG last.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-30 09:52:18 +01:00
CatoandClaude fa09bc6a4f docs(agents): fold CLAUDE.md and .claude/CLAUDE.md into AGENTS.md (#1472)
Both CLAUDE.md files now only point at AGENTS.md, the fleet's one
agent-file shape (bitbaum/fleet scripts/ci/agent-rules.mjs). What was
still true moves into AGENTS.md: the principles and the entity test, the
shipping hand-offs (re-arm, post-main), the self-hosted Supabase read and
migration path, the design tiers and the one-orange rule, and the money
surface as the reference for one shape per kind. Every named path,
script, workflow key and component was checked against the tree.

Dropped as stale or copied:
- `.claude/CLAUDE.md` still listed the warm accent as `#ff5c00`; the root
  file and globals.css say it is gone (accent = Bitcoin orange).
- a machine-specific project path, the duplicated stack table and the
  `.claude/rules` restatements (those files remain).

Docs and comments that sent readers to CLAUDE.md for "Shipping" or the
principles now point at the AGENTS.md sections.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-29 10:57:51 +01:00
CatoandClaude Sonnet 5.5 398463e70a feat(cat): the Cat chat is chatkit's ChatApp (#1447)
* feat(cat): the Cat chat is chatkit's ChatApp

The Cat chat now renders @bitbaum/chatkit 0.18's ChatApp: its header, chat
list (drawer on a phone, rail from 64rem) with search and Today/Yesterday/
Earlier, rename and delete, New chat, Temporary chat, reopening the open chat
after a reload, Camera · Photos · Files with thumbnails, the queue, Stop and
Retry. The Cat keeps only its transport and its words.

- useCatTransport: the Cat's stream (and the local-model loop) as ChatApp's
  transport; tool calls stream as steps; a temporary chat runs in an unlisted
  ephemeral row deleted when it is left.
- catConversationStore: chatkit's ConversationStore over API_ROUTES.CAT;
  the chat route still writes every turn (append is a no-op), nothing is
  kept on the device but the open chat's id.
- API: PATCH /api/cat/conversations/[id] renames; GET is a 404 for a chat
  that is not the person's (it returned the default thread); POST takes a title.
- CatAnswerFooter under each answer: tool chips, destinations, actions,
  action results, drafts, provenance, fallback, upgrade nudge, failure fixes.
- Deleted: ConversationRail, useConversations (incl. its temporary chat),
  useChatHistory, useChatMessages, ChatHeader, MessageBubble,
  MessageAttachments, ErrorDisplay; TalkRoom draws chatkit's ChatMessage.

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

* fix(cat): 44px targets in the chat's composer and header

The model picker, Loki and tool chips sat under 44px beside ChatApp's own
controls; the model's name hides on a phone so the composer's tools stay
one row.

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

* feat(cat): PDF reading through ChatApp — chatkit 0.21's attach.readFile

Moving the Cat onto ChatApp dropped the PDF reading main's #1449 added to the
old composer (chatkit's attach refused every PDF). chatkit 0.21.0 adds
attach.readFile; the Cat's reader (readCatFile) calls the same attachPdf as
before: same size limit, same sentences, same pictures-per-message (5, shared
with staged photos), same text-or-sheets result. The live PDF spec now reads
chatkit's staged strip.

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

* ci(cat): browser-smoke.yml — the real-browser check the rollout gate asks of a chat consumer

The fleet's shared-package gate holds a chatkit consumer PR until
browser-smoke.yml has passed on its commit; OrangeCat had no such workflow on
main (only on the unmerged PayKit branch), so every chatkit PR here waited
forever. This one builds the standalone app, signs in as the E2E account and
opens the Cat at 390 and 1280 (composer, Send, Files input, no sideways
scroll), then runs the live PDF-attach spec against it. No model call.

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

* test(cat): the smoke spec says what the page showed when the composer is missing

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-27 23:51:36 +01:00
Cato 741e908057 fix(deploy): stage and verify public package artifact receipts (#1456) 2026-10-27 23:12:21 +01:00
CatoandClaude eb9b3149fc fix(ci): the E2E fixture no longer signs other runs out, and a dropped request is retried (#1454)
ensure-e2e-fixtures rewrote the shared user's password on every run. GoTrue
ends a user's other sessions on a password change, and every CI run (each PR,
each push) uses the same account, so one run's bootstrap signed another run's
browser out partway: check:broken-words opened /dashboard/cat, /receive and
/send@320 and then 'bounced to sign-in' for the rest (PR run 40504618122, 6.5
minutes instead of 1). The password is now written only when the user does not
already sign in with it.

refresh-e2e-reset-tokens failed main's CI (run 40450576245) on one dropped
request (AuthRetryableFetchError, status 0). A request with no answer is now
retried up to three times; a real refusal is not.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-27 22:18:14 +01:00
Cato 658883af58 fix(integrations): restore identity choices and recoverable controls (#1421)
* fix(integrations): restore identities and recoverable permission controls

* fix(integrations): use patched URI validation
2026-10-24 02:12:24 +02:00
CatoandClaude Sonnet 5.5 f2fd9e33f2 chore(chatkit): the broken-word audit runs on the Cat and money surfaces (#1411)
* chore(chatkit): the broken-word audit runs on the Cat and money surfaces

check:broken-words opens the landing page, /pay/<username>, the Cat chat and
the money surface (/receive, /send, /requests) in Chromium at 320/390/1440 and
fails on any word drawn across two lines, measured by findBrokenWords from
@bitbaum/chatkit/audit (chatkit ^0.13 -> ^0.14.2). CI runs it against the
standalone build; signed-in pages open with the E2E credentials and are named
as not opened, never passed, without them.

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

* chore(ci): hand the word audit to Playwright as a function, not source text

CodeQL read page.evaluate on a string as code injection (2 high alerts on
this PR). findBrokenWords is self-contained, so Playwright can serialise it
itself.

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

* chore(ci): the word audit takes no path or URL from the environment unchecked

BASE_URL is parsed to its origin, PAY_USERNAME must look like a handle, and
screenshots are named by page index instead of by the page path. Aimed at the
two CodeQL path/URL alerts on this PR.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-23 18:17:01 +02:00
Cato ee8a955e4f fix(cat): open writing suggestions and keep passive memory useful (#1401) 2026-10-22 21:21:21 +02:00
Cato 372e4ebba8 Repair messaging interactions, mobile submit taps and session hydration (#1389)
* Refactor dashboard and activity layout and correct derived state

* Repair messaging interactions, session hydration and shared form controls

* Preserve mobile submit taps and isolate release login sessions
2026-10-22 18:48:12 +02:00
Cato 9e17bed51e Unify Cat branding, refresh install icons, and restore mobile writing choices (#1384)
* Restore article discovery and refactor the header create menu

* Unify Cat branding and refresh installed icons; restore mobile creation choices

* Use the canonical Cat mark across remaining app and public surfaces

* Load the current app shell on launch and keep cached navigation for offline use
2026-10-22 03:30:58 +02:00
CatoandClaude ed65865a06 feat(money): one payment surface — a scannable code, every way to be paid, one Send field (#1372)
Receive opens on what the bottom bar's QR icon promises: a QR of the pay
link with the owner's name on it, the link under it, Copy link · Share as
two equal cells, and "Add an amount" that the code and the link then
carry. Under it, every way the account is paid, as one list: Bitcoin first
(the Lightning name and the wallet it lands in), then any other app the
owner adds — Twint, PayPal, Revolut, Cash App, Venmo, Wise, a bank, a link.
OrangeCat is currency-agnostic by principle; this is the first surface that
is.

- payment_methods table + registry (src/config/payment-methods.ts) + domain
  service + /api/payment-methods. Handles are normalised per method (an
  IBAN passes mod-97, a pasted paypal.me link becomes the name).
- /pay/<username> shows the other ways under the Bitcoin flow, each with
  the one action its service has: open with the amount filled in when the
  service takes that currency, or copy. A page with no Bitcoin wallet but a
  Twint number is still payable. These settle outside OrangeCat and the
  copy says so.
- Send is one field: username, Lightning address, invoice, or a scanned
  code — someone's Receive QR included, amount prefilled. The person /
  invoice tab row is gone.
- Receive, Send and Request share one frame (MoneyPage lost its icon prop
  on purpose); in-app actions are monochrome primary; the note is a button
  that says "Add a note"; amount suggestions are four equal cells.
- Design discipline written down: CLAUDE.md → "Design discipline: one
  shape per kind" (instances, gates, pre-PR checklist), pointing at the
  fleet-wide rule. New gate check:choice-rows fails a wrapping box of
  choices; it found two (weekday picker, help-wanted tags), both fixed.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-21 06:49:12 +02:00
CatoandClaude Fable 5.1 cbf8296b92 feat(oauth): an app may list a service in your name — the fee of a builder booked through Loki (#1366)
* feat(oauth): an app may list a service in your name; the fee of a builder booked through Loki

Track 3 of Loki's docs/master-plan-2026-10.md, the OrangeCat half: a builder
booked on someone's project is paid through a service in the builder's own
name, listed by Loki with the builder's token, paid to the builder's wallet.

- `service.write` scope, sensitive, on the consent screen like timeline.write.
  Loki's ceiling carries it; every other client stays identity-only.
- CLIENT_SPECS moves to scripts/oauth/client-specs.ts (pure) so two readers
  share it: register-client.ts by hand, and the deploy, which now refreshes the
  scope ceiling of every REGISTERED client right after the migrations
  (client-scopes-sql.ts → box psql). It creates nothing: a missing client is
  still registered by hand, where its secret is printed once. A scope widened
  in the code used to reach the live sign-in only when someone re-ran the
  registration on the box.
- createService honours a validated `active` status (a fee Loki lists has
  nobody to press Publish); paused/unavailable still cannot be created.
- The settled-payment signal to Loki fires for a service bought outright, not
  only for project funding, so the booking is marked paid from the payment.
- product, service, cause and document creates carry the resolved actor
  (withResolvedActor): a type argument on createEntity<Row>( had hidden these
  four from the check that pins the carrier; the check now sees past it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx

* fix(ci): align the playwright CLI with @playwright/test so the browser install matches

#1362 bumped @playwright/test to 1.64.1 and left `playwright` at 1.62.1, so
`pnpm exec playwright install chromium` fetched 1.62.1's browser while the
test runner looked for 1.64.1's headless shell (1248): build-and-smoke has
been red on main since, and on every PR. One package, one version.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-20 13:07:41 +02:00
CatoandClaude Opus 5.5 24c3d140ae docs: archive point-in-time records, fix live docs against the tree (#1349)
* docs: archive point-in-time records, drop broken guide symlinks

Status reports, progress trackers, audits, session summaries, completed
migration plans and the 2025 roadmap move to docs/archive/ (same relative
path), with a README saying they describe the day they were written.
.ai-guides/ held only symlinks into a docs/guides/ai/ that no longer
exists, tests/unit/docs/ held a stray copy of an old getting-started page,
and docs/operations/PORT_MANAGEMENT_README.md duplicated port-management.md;
all three are deleted.

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

* docs: correct drifted paths, links and versions in current docs

Fix in place the reference docs agents use: point paths at where the code
lives now (src/stores/auth.ts, src/lib/supabase/*, scripts/dev/*,
docs/reference/api/CONVENTIONS.md, the squashed baseline migration),
rewrite the development, features, operations and API index pages to list
documents that exist, say plainly where something is gone (/api/metrics,
the CSP report route, .envrc in the repo, Loki's `migrate` script), and
correct the Next.js major. docs-truth findings: 468 -> 2 (both "Next 30/90
Days" headings in the legal overview, a checker false positive).

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-19 14:09:06 +02:00
CatoandClaude Opus 5.5 b774f06de7 docs: correct drift in agent instructions, README and ops docs (#1348)
* docs: correct drift in agent instructions, README and ops docs

- Auto-merge sweep lives in bitbaum/fleet, not bitbaum/dotfiles; cd.yml is
  dispatch-only (handed off by ci.yml post-main), not a workflow_run listener
- Design-system docs match globals.css / tailwind.config.ts: warm accent
  #ff5c00, bg-bitcoinOrange (no bitcoin-orange utility), tiffany/orange are
  legacy; display typography is shipped
- .claude rules: real paths (src/lib/validation/, entityCrudHandler.ts,
  standardResponse.ts, withZod/withRateLimit/withRequestId, services/actors),
  real Button/Alert APIs, real rate limits, search via @bitbaum/searchkit,
  real payment modules, PostgREST instead of the POSTGRES_URL tunnel,
  lint-staged pre-commit, eslint.config.mjs
- README/AGENTS/REVIEW: Next 16 / TS 6 / Tailwind 4, pnpm, messaging is not
  E2E-encrypted yet, beta not Live, CD deploys, migrations apply on deploy
- docs/: deploy process, CI/CD, migrations guide, moved docs/ paths, stale
  CLI-entity and edge-function docs flagged

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

* style(docs): prettier on the docs touched by the drift fix

lint-staged would have run this; the commit was made without hooks.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-19 12:07:09 +02:00
CatoandClaude 86725c1804 refactor(searchkit): install it from bitbaum/searchkit like every other site (#1344)
searchkit now has its own repo, created from this folder by bitbaum/fleet's
package-repos workflow and tagged v0.2.2. OrangeCat installs that tag, the
same way the five other sites do, and the folder goes: one copy of the
package, changed through its own repo's pull requests, with its tests there.
Dependabot moves the tag forward here as everywhere else.

Same code; the search suites (find, palette, Discover) pass against the
tagged package.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-14 01:35:13 -07:00
CatoandClaude dc04de3324 refactor(searchkit): the package carries its own tests, ready for its own repo (#1343)
searchkit's tests lived in orangecat's vitest tree, so the folder could not
stand alone. They now sit in packages/searchkit/test and run with Node's
own test runner against the built package (`npm test`), and orangecat's
verify runs them as `test:packages`. The dist check resolves TypeScript the
normal way instead of through orangecat's node_modules path.

This is what lets bitbaum/fleet's package-repos workflow create
bitbaum/searchkit from this folder with no hand edits.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-14 01:16:56 -07:00
CatoandClaude Opus 5.5 534f7e0085 Discover you can finish, and one search engine behind ⌘K and Discover (#1320)
* design(profile): an unfunded project invites backing instead of saying "No funds yet"

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

* feat(discover,search): one search engine, and a Discover you can finish

Search
- New migration: public_documents() holds the public rules for every type
  once (inlinable, so each predicate reaches each table's GIN index);
  search_public() ranks with prefix matching, indexable typo tolerance (<%)
  and exact/leading-title boosts, or browses newest first; public_counts()
  counts the same rows; global_search() becomes a wrapper. Rows created
  with a test integration key (is_test) are excluded everywhere.
- Fixture patterns are passed as RPC arguments from public-directory.ts.
- ⌘K palette: one instance for both header triggers (one keystroke used to
  open two dialogs), results grouped by kind with matched words marked,
  recent searches, full-screen on phones, "Ask your Cat" when nothing
  public matches.

Discover
- Server-rendered from the URL (?q, ?type, ?page): search field, chips with
  counts, "Just listed", one rail per kind, an end. Equal cards with the one
  fact that matters. Replaces a client app that ran up to 14 browser
  queries per keystroke against three engines and re-sorted by date.
- Removes the old discover hooks/components, the dead search UI, unused
  entity card variants and the old search service.

Also: profile cards invite backing instead of "No funds yet"; cause pages
show their category; broken listing images fall back to the initial.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-12 07:02:28 -07:00
CatoandClaude Opus 5.5 f39bb1beff design: every mark is one file, replaced with one command (#1315)
* design: every mark is one file, replaced with one command

  pnpm run brand:import <slug> <file.svg>

converts any SVG (Figma, Illustrator, Inkscape, an icon set) into
src/config/marks/<slug>.ts, rebuilds the registry, and for this app's own
slug regenerates every static icon. Nothing else changes: the header,
hero, auth page, share cards, studio tiles, pillars and project banners
all render from the registry through one generic <Mark>, and know nothing
about which drawing they show.

- src/config/marks/: one data file per mark (viewBox + stroked/filled
  shapes + motion), a generated index (MARKS, markFor), and generators/
  for the marks drawn by code (OrangeCat's cat coil, Loki's coil). Solon's
  scales were imported through the new command from lucide's SVG.
- <Mark>, <ProjectMark slug> (mark from the registry, else the initial),
  BrandMarkIcon and the share-card mark all render any MarkDefinition.
  PillarMark and sibling-marks.ts are gone.
- Giving any studio project a face is the same command with its fleet
  slug; its tile and banner pick it up.
- The importer keeps geometry and how each shape is painted, drops colours
  and a full-size background, and refuses transforms, clip paths, masks,
  <use>, <text> and <image> with a message saying what to do, rather than
  producing a mark that is quietly wrong.
- The brand test is written against any mark: registry matches the folder,
  every mark is drawable, static icons equal exactly what the generator
  writes. Replacing the drawing never means rewriting the test.
- Brand scripts run with plain node: a dependency-free resolve hook maps @/
  and extensionless imports so they load the app's TypeScript directly.

Verified by swapping in a throwaway SVG end to end (icons regenerated,
background dropped, holes kept, gate green) and restoring the coil.

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

* fix(home): the badge fits a phone, the headline breaks at its tone, Loki's banner opens Loki

Found reviewing the live site after #1314 deployed:
- the three-part hero badge ran off a 390px screen; on phones it now
  carries the lead phrase alone
- the two-tone headline wrapped mid-phrase on desktop, so the dim tone
  started partway through a line; the tail now takes its own line from sm
- StudioProjectBanner reused the tile's link for its door, which for a
  project funded here is the page itself — Loki's banner had no way to
  open Loki. FleetTile now carries liveUrl, tested.

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

* fix(brand): the importer strips to a fixed point and refuses non-path data

CodeQL (3 high, incomplete multi-character sanitization): one pass of the
comment/<style> stripping over '<!<!--x-->-- … -->' leaves a fresh '<!--'
behind, and what it hid was then read as markup. The path is narrow — a
crafted SVG given to brand:import — but a mark's path data is written
verbatim into public files (favicon.svg), so it is closed twice:

- stripping repeats until nothing changes;
- every shape's path data must be pure path syntax (commands, numbers,
  separators), or the import is refused with a message. A quote or angle
  bracket can never reach a file, whatever the input looked like.

Tested both: a hidden shape behind a nested comment is not imported (a
single-pass strip imports it), and markup smuggled through a single-quoted
d is refused.

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

* fix(brand): read SVG comments and ignored blocks in one forward scan

CodeQL still flagged the comment/<style> stripping after a3e2b25: it does
not credit a repeat-until-stable loop, and rightly so in spirit — regex
removal is the wrong tool. withoutIgnoredMarkup() now walks the input once,
skipping comments, CDATA, processing instructions, doctypes and the
never-drawn blocks (defs, title, desc, metadata, style) by position. It
never re-reads what it emitted, so no removal can leave a new opener behind.
The CSS CDATA unwrap is split/join, not a regex replace.

Safety still rests on PATH_DATA: nothing but path syntax reaches a file.
Tests: contents of comments and never-drawn blocks are not imported; tangled
comments yield only path data; the scanner's skips are pinned. Re-importing
Solon's scales gives a byte-identical mark file.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-11 16:42:46 -07:00
CatoandClaude 095b963ccd design: one mark, a cinematic fold, and the studio on every page (#1314)
The mark is now a coil that is a cat: one continuous stroke wound inward
with two ears on its outer turn — Loki's spiral wearing the cat. Its
geometry lives once, in src/config/brand-mark.ts; BrandMarkIcon, the share
cards, favicon.svg, orange-cat-logo.svg, a real favicon.ico (16/32/48
PNG-ICO), apple-icon.png and the PWA icons are all rendered or generated
from it (pnpm run generate:brand), and a unit test fails on any drift.

Why: three different marks were live — a cat face in the header, a
"window with ears" on every share card, and where favicon.ico should
have been, a 155 KB fav.farm HTML page served as image/x-icon, so the tab
icon was broken in every browser that prefers .ico. The 144px PWA icon
was one byte. Nothing generated those files, so nothing could notice.

The home fold is rebuilt to Loki's and Solon's standard: centred,
viewport-relative two-tone display type, the mark drawing itself in above
the headline, a radial-glow + dot-grid backdrop (tokens only, survives
light mode), one warm action, and real numbers underneath (HomePulse: the
same public-only counts /discover uses, plus the studio's live count from
Loki's fleet map). The three-card row that repeated the hero's own actions
is gone, with its FIRST_MOVES config.

The studio is on the front page (StudioSection: the three pillars with
their real marks, then every live studio product as a tile, each a door),
closes /ecosystem grouped by layer, and a studio project's own page wears
its face (StudioProjectBanner: mark, live door, last moved, siblings). The
list is Loki's fleet map, never a copy; when the map is unreachable the
pillars stand and the grids are absent, and no page fails. Selection and
ordering are pure and tested (studio-fleet.ts).


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-11 16:15:02 -07:00
CatoandClaude 53e3eb70de OAuth: register Causius as an identity-only relying party (#1309)
Claude-Session: https://claude.ai/code/session_012EJFFkKhmaVnnH8E3mHnaZ

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-11 12:25:55 -07:00
CatoandClaude Opus 5.5 a6d33c92dd perf(ci): main does not re-verify a tree its pull request already verified (#1298)
CI runs verify on a PR and again on main before deploying. When the base did
not move while the PR was open, the squash commit's tree is byte-for-byte the
tree the PR's CI tested (refs/pull/N/merge) — 18 of 30 recent merges. The PR
job now records the tree it verified as an artifact (verified-tree-<sha>),
for PRs from this repository only; main looks HEAD's tree up and skips the
Verify step on an exact match. Build, smoke tests and the artifact CD ships
still run. Any doubt — no match, an API error, a fork, unreadable output —
means verify runs as before; the script always exits 0.

9 tests run the real script against a fake gh/git, including every
fail-safe path; mutation-proved (dropping the same-repository filter fails).
Fields checked against the live artifacts API.


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

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 09:03:02 -07:00
CatoandClaude Opus 5.5 90689cabca perf(ci): verify runs in parallel lanes; CD's recovery path asks about the tip (#1270)
verify was 24 steps chained with &&, though none reads another's output.
Measured on CI 2026-10-07 it took ~280s (unit 151s, eslint 51s, the two
type-checks 31s + 32s, the rest ~10s), and it runs twice per change — on the
PR and again on main — before anything deploys. scripts/verify.mjs runs the
same steps in three lanes on CI (unit | type-checks | lint + static checks);
locally it stays serial in the old order, since parallel gates were OOM-killed
on a loaded laptop. VERIFY_LANES overrides. A test keeps the lane list and the
serial list identical, so a check cannot run in one mode and not the other.

cd.yml's bare-dispatch path (the fleet reconcilers) asked for "the newest
successful CI run on main" and refused unless it was the tip. Every merge gets
a cancelled duplicate CI run, and the answer depends on list order; it refused
green tips four times on 2026-10-07, leaving a red CD run after each merge.
It now asks for a successful run of the tip itself.


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

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 03:41:03 -07:00
CatoandClaude Opus 5.5 048a6e3eec feat(claims): a place set up for someone can be found, booked and shows its events (#1237)
* feat(claims): a place set up for someone can be found, booked and shows its events

A studio set up for a DJ who is not on OrangeCat yet (ADR-0005) had nowhere
to live: the unclaimed profile page listed projects only, a booking request
for it notified nobody and nobody could answer it, and nothing showed the
events held there.

- Unclaimed profiles list every public listing the placeholder owns, by
  registry type (domain/profileClaims/unclaimedListings), not projects only.
- Booking requests for a placeholder-owned listing reach its steward while the
  claim is pending: notifications fall back to the steward, the provider list
  includes stewarded placeholders, and confirm/reject/complete work for the
  steward. RLS cannot express stewardship, so those reads and writes use the
  admin client, pinned by provider_actor_id to exactly the placeholders the
  user stewards (services/bookings/stewardBookings). Management, never money.
- The asset page lists upcoming public events held there (events.asset_id),
  as "Happening here".
- The Assets badge counts by actor_id like the Assets tab; it counted the
  legacy owner_id, so assets with no actor, or handed to someone else, were
  counted on a tab that never shows them.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore(gates): asset_id now renders — drop it from the dead-fields baseline

The "Happening here" card reads events.asset_id, so the ratchet requires
the baseline to shrink.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-06 07:30:04 -07:00
CatoandClaude 72a107760e feat(reputation): ask people to review their deals (ADR-0010 D9) (#1229)
Most people never review unless asked, and a track record nobody writes
stays empty.

- review-nudges cron (hourly systemd timer, deterministic, no model):
  asks each side that has not reviewed once 3 days after the deal
  settles, and once more in the last 5 days of the window. Sent in-app
  and by email (notification type deal_review).
- deal_review_nudges records each nudge BEFORE sending, so a crash loses
  one and never sends a second.
- When one side reviews, the other is told that it happened, never what
  was said.
- The Cat's dashboard suggestions carry the most urgent unreviewed deal,
  using the same timing rule as the cron (EN + DE copy).


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-05 10:41:55 -07:00
CatoandClaude Opus 5.5 dff47e2143 feat(oauth): evig, petvity, surf-your-life and datacat sign in with OrangeCat (#1211)
George moved every own product to Sign in with OrangeCat. Identity scopes
only; each keys users on sub and links no account by email while GoTrue
auto-confirms sign-ups. policy/tos only where the page exists (curl-checked).

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-02 04:41:19 -07:00
CatoandClaude Opus 5.5 c8bc3d6e15 feat(oauth): consent screen says which account, how long, and what is risky (#1208)
Compared against X's "Authorize app" screen, ours listed scopes more
precisely but left out five things a person needs before clicking Allow:

- Which account: "Signed in as <name> · @user · email" with "Not you?"
  (signs out and returns to this same request via the sign-in hand-off).
- How long + undo: "until you remove it", linked to Settings → Connected
  apps; OrangeCat's Terms and Privacy linked. Links open in a new tab so
  the request is not abandoned.
- Risky permissions first: OAUTH_SCOPES gains `sensitive` (every write/act
  scope plus wallet.read and messages.read), listed under a warning heading.
- The app's own privacy policy / terms: new oauth_clients.policy_uri /
  tos_uri (additive migration). /oauth/register accepts the RFC 7591
  fields, https only; a bad link is dropped, never a refusal. Loki gets
  both, Heidi privacy only (the pages that exist). Without them the screen
  says the app has published neither.
- Redirect host now shown for verified apps too, not only self-registered.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 08:33:52 -07:00
CatoandClaude Opus 5.5 ae714712fa fix(oauth): Substrata in the client SSOT, with both of its origins (#1207)
Substrata was registered by hand and never written into CLIENT_SPECS, so a
re-run had nothing to refresh. It moves to substrata.ch and the
orangecat.ch address keeps working, so both callbacks are allowed. Applied
to the live row the same day (scopes unchanged; trusted like Heidi/Solon).

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-01 05:27:32 -07:00
CatoandCursor 88a5f76aa7 refactor(content): blog and FAQ on bip-kit 0.5 (#1198)
The blog reads content/blog with bip-kit's readCollection instead of its
own gray-matter reader; the FAQ moves from a hand-built client accordion
to content/faq.md, rendered by bip-kit's Faq (native <details>, a link
per question, FAQPage structured data). The long-form normalizer is
bip-kit's normalizeMarkdown, of which ours was the original.

gray-matter and its js-yaml pin go. Drafts are no longer reachable by
URL. The blog guide is rewritten; it still described the MDX system.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-30 09:07:25 -07:00
CatoandClaude Fable 5.1 2077bfc207 feat(auth,docs): developer page for "Sign in with OrangeCat"; passkeys (#1185)
* feat(docs): developer page for "Sign in with OrangeCat" + round-trip script

Step D9 of ADR-0009. OrangeCat has been a real OpenID Connect provider
since June and five relying parties sign people in through it, but a site
that wanted the button had the standard and nothing else.

/docs/sign-in-with-orangecat: what you get (one identity keyed by sub,
passwords optional, people can disconnect you), self-service registration
with its rules, the Auth.js config Solon/Heidi/Loki run and the by-hand
authorize/token/userinfo/refresh calls, button wording (prompt=create,
login_hint), sessions and what invalid_grant means, and every scope with
its consent-screen wording. Every URL, scope and lifetime is derived from
the provider's own config (snippets.ts), and a unit test pins the snippets
to the discovery document, so the page cannot quote an endpoint the server
does not serve.

scripts/oauth/sign-in-roundtrip.mjs registers a client, opens the sign-in,
catches the code on loopback, exchanges it with PKCE, checks iss/aud/nonce,
reads userinfo, refreshes, and proves the spent token is refused — the
same steps any relying party takes, runnable before writing a line.

Linked from /docs. ADR-0009 status updated: D1–D4 shipped, relying parties
now honour revocation (solon#203, heidi#145).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QDMxjTqKNLXETMYYuapMa3

* fix(docs): userinfo snippet uses a shell variable for the token

gitleaks (curl-auth-header) reads 'Bearer THE_ACCESS_TOKEN' as a leaked
token; $ACCESS_TOKEN is what a person would paste anyway.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QDMxjTqKNLXETMYYuapMa3

* chore(security): allowlist the docs bearer-token placeholder for gitleaks

The developer page's userinfo example used 'Bearer THE_ACCESS_TOKEN', which
gitleaks' curl-auth-header rule reads as a leak. The tree now uses a shell
variable; the placeholder in history is allowlisted instead of rewriting it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QDMxjTqKNLXETMYYuapMa3

* feat(auth): passkeys — add/list/remove in settings, sign in with a passkey

Step D5 of ADR-0009. The self-hosted auth server (GoTrue) supports WebAuthn
passkeys and the browser client already carries the ceremony; what was
missing was the UI, the wrapper, and the switch.

- Settings → Security → Passkeys: the person's passkeys with name, date and
  last use; "Add a passkey" (browser prompt, then named); remove.
- /auth: "Sign in with a passkey" beside the emailed code — nothing typed.
- Both are hidden until the auth server reports passkeys_enabled: true
  (lib/auth/passkeys-availability reads GoTrue's public settings, cached
  five minutes, fails closed). A button that cannot work is a dead end.
- docs/operations/passkeys.md is the switch: GOTRUE_PASSKEY_ENABLED and the
  relying-party id/origins, with why the id is orangecat.ch and not the
  API host. scripts/auth/passkeys-e2e.mjs drives add → sign in → remove
  with Chromium's virtual authenticator and exits 2 while the switch is off.

services/supabase/auth/passkeys.ts wraps registerPasskey / passkey.list /
update / delete / signInWithPasskey in the auth service's shape; a passkey
is named in a second call and a failed rename still returns a working key.
Unit tests cover the availability parser and the wrappers.

Also: the two CLI scripts under scripts/ carry the no-console pragma their
siblings use.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QDMxjTqKNLXETMYYuapMa3

* fix(scripts): throwaway inbox password from crypto.randomBytes

CodeQL (js/insecure-randomness) flags Math.random() for a password, even
a disposable one; the real generator costs nothing.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QDMxjTqKNLXETMYYuapMa3

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-29 02:45:52 -07:00
CatoandClaude 675fcfc9cb feat(records): roadmap and changelog come from the fleet's canonical record (#1160)
The public /roadmap and /changelog pages read two local config copies
(src/config/public-content.ts, src/config/changelog.ts) — the second copy
docs/architecture/building-in-public-ssot.md says never to keep. The record
now lives in ROADMAP.md and CHANGELOG.md at the repository root, in the
fleet's file contract; Loki's map ingests them, and both pages render what
the map holds through bip-kit's loadDevelopmentProfile (revalidated every
five minutes, eight-second ceiling). A missing map reads "temporarily
unavailable"; an empty record reads "nothing recorded yet".

- ROADMAP.md: Now/Next/Later/Shipped buckets carrying every item the config
  held, plus the two fleet items that are OrangeCat's — metered Cat Credits
  as the paid token pool for builders, and partner payouts and client
  funding through OrangeCat rails. No dates; nothing unshipped marked done.
- CHANGELOG.md: every entry from the config, newest first, same wording,
  tags as Added/Improved/Fixed/Platform sections; plus today's entry.
- check-changelog-fresh.mjs reads the new file's dated headings.
- src/lib/development/records.ts: fetcher, bucket grouping, line splitting,
  pinned by __tests__/unit/lib/development-records.test.ts on a fixture.
- New essay: content/blog/where-the-wall-is.md, featured; the previous
  featured post is unfeatured.
- .claude/skills/publish-article/SKILL.md: the publishing standard, linked
  from .claude/CLAUDE.md's quick reference.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-28 04:36:53 -07:00
CatoandClaude Opus 5.5 ad37b55679 fix(ops): orangecat-app restarts after a SIGTERM nobody asked for (#1155)
2026-09-26 01:53:42 UTC a SIGTERM hit every *-app unit on the box at once.
About 20 units restarted in 3s; orangecat stayed down for 3h45m (502 on the
whole site) and nothing paged.

Cause: this unit alone sets SuccessExitStatus=143 SIGTERM (so deploys don't
log as crashes). With Restart=on-failure, that makes any SIGTERM a "success",
so there's no restart and no OnFailure alert. Its comment assumed SIGTERM is
always a requested stop; it isn't.

Restart=always keeps the clean deploy journal (systemd never restarts after an
explicit stop/restart) and restarts after anything else. Already applied on
the box and proven: kill -TERM <main pid> → new PID, NRestarts=1, health 200.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-25 23:04:45 -07:00
CatoandClaude Opus 5.5 5f552b5d32 fix(profile): one clean header, Overview first, and public tabs that show only what is true (#1154)
The public profile read as layers of earlier versions stacked on each other.

Header
- Actions (Pay · Message · Follow/Edit · Share) move off the banner photo into
  the identity card: top-right beside the avatar from sm up, a full-width
  labelled row under the bio on a phone (Follow used to be a bare "+").
- Pay appears only when a payment would land: it now asks
  /api/tips/receive-info (useCanReceive), like the Overview card already did.
- Handle · location · website · joined on one line. "Visit Website" and the
  Info-only location are gone from elsewhere.
- Share sheet positioning no longer reads window.innerWidth during render.
- Signed-out Follow sent no request and showed nothing; it now goes to sign-in
  and back.
- "What I can offer" shows 8 skills / 6 assets with "+N more".

Tabs
- Default tab is Overview. Timeline-first (#420) now lands a visitor on a log
  of automated Loki dispatches.
- Overview drops what the header already says (About = bio, a lone project
  count, website, a Contact card holding only the joined date) and the dead
  `context="dashboard"` branches; each section renders only with content.
- No "Sign in to post" box above someone else's timeline for visitors.
- Info tab is owner-only (its visitor view was "Not filled out yet" rows).

Correctness
- Cancelled and archived listings are no longer public (cancelled test loans
  for 2.9M CHF were). One filter, config/profile-listing-visibility, now used by
  the tab listing, the badge counts and the page's project list — three copies
  of `.neq('status','draft')` before.
- Wallets badge counts what the tab renders (it added legacy addresses on top
  of wallet rows: "Wallets 3" over two cards).

Guard: __tests__/unit/profile/profile-public-surface.test.ts (mutation-checked).

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-25 10:03:40 -07:00
CatoandClaude Opus 5.5 5407fc373d fix(sh): grep -q reads a here-string, not a pipe — no SIGPIPE false negatives under pipefail (#1152)
* fix(sh): grep -q reads a here-string, not a pipe — no SIGPIPE false negatives under pipefail

Under pipefail, `producer | grep -q PAT` can report a miss for text that is there: grep -q exits on its first match, the producer dies of SIGPIPE, and pipefail returns 141.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(sh): grep -q reads a here-string, not a pipe — no SIGPIPE false negatives under pipefail

Under pipefail, `producer | grep -q PAT` can report a miss for text that is there: grep -q exits on its first match, the producer dies of SIGPIPE, and pipefail returns 141.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-25 07:16:26 -07:00
CatoandClaude Opus 5.5 da77411696 fix(ai): no timer or page load spends a free-tier AI key (#1146)
* fix(ai): no timer or page load spends a free-tier AI key

Standing rule (2026-09-25): the box's AI keys are free tiers, OpenRouter and
Gemini shared with every app, and may be spent only when a person asks.

- cat-health cron (nightly completion probe of every vendor): route + timer
  removed; the "Check Cat's status" click still runs the probe.
- reindex-embeddings cron (nightly embedding sweep): route + timer removed;
  a save still indexes its own row via the DB trigger -> admin route.
- orangecat-cat-eval.timer (nightly Cat eval + LLM judge on the free pool):
  unit removed; eval-cat.mjs is run by hand.
- cat-watches: topic watches embedded their topic every 15 min. The vector is
  now stored when the user creates the watch (migration adds
  cat_watches.topic_embedding); the timer matches with it via the new
  embed-free discovery-match module.
- GET /api/cat/nudges (dashboard mount + weekly-digest): LLM "smart" nudges
  and the bio embedding removed; rule-based nudges stay.
- GET /api/cat/suggestions (opening the chat): chips were LLM-written on load;
  now deterministic (cat-home-chips.ts deleted).
- deploy-selfhost.sh retires the old units on the box (RETIRED list).

cat-mentions stays: it only answers a message in which a person addressed @cat.

Regression: __tests__/unit/ci/no-background-ai.test.ts walks imports
transitively from every cron route, every page/layout and every GET route to
the model/embedding modules. Proven by mutation: re-importing exploreTopic in
proactive.ts, platform-llm in prompt-suggestions.ts, or platform-search in
nudges.ts each turns it red.

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

* test(ai): read without a stat-then-read race (CodeQL)

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 02:08:25 -07:00
CatoandClaude Opus 5.5 2faf0db7cf feat(oauth): register Skif as an identity-only relying party (#1142)
Skif is bitbaum's safety product (skif.orangecat.ch): bookable Protectors
and safety assessments. Per fleet STACK.md it federates to OrangeCat and
keeps no users table; `sub` is the only identity key it stores.

Same ceiling as Heidi and Solon: `openid profile email`, confidential
(Auth.js v5 server keeps the secret), trusted first-party. Deliberately
nothing wider: Skif holds bookings, incident reports and people's stated
safety limits, so it must not be able to read or act on anything else here.

After merge, run on the box:
  ORANGECAT_OWNER_SEED=1 npx tsx scripts/oauth/register-client.ts --client skif

Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 22:16:26 -07:00
Cato 14fd09774f fix(ci): pass repo to CD live-sha guard (#1123) 2026-09-23 08:45:46 -07:00
Cato baa5af1f4e fix(ci): authenticate CD live-sha guard (#1122) 2026-09-23 15:25:04 +00:00
Cato 2444f16586 fix(ci): route deploys through one verified handoff (#1121) 2026-09-23 08:03:42 -07:00
Cato 137d50ed9a feat(onboarding): ask where money lands, and keep money screens narrow (#1118)
After a new person tells the Cat who they are, the same paste as Receive appears. Not now still continues. The in-person code stacks on a phone, and the money tabs shrink instead of overflowing.
2026-09-23 07:16:37 -07:00
Cato bad5b116e3 refactor(money): one frame for receive, send, and request (#1117)
Receive stacked a second tab bar under the money tabs and called the pay link "send", which collided with Send and Request. The three routes now share one page frame. Receive is the pay link, an in-person code, and a code for one amount.
2026-09-23 05:59:21 -07:00
Cato 10bd7ef099 fix(ci): reuse verified bundle and skip duplicate deploys (#1115) 2026-09-23 02:42:03 -07:00
Cato 2f4caad273 chore(db): drop a committed production data dump from the tree (#1088)
* chore(db): drop a committed production data dump from the tree

* docs(config): point the fixture note at evidence that still exists
2026-09-18 02:48:29 -07:00
CatoandClaude Opus 5 b8597847bc chore(changelog): six weeks of shipped work, and a gate so it cannot rot again (#1066)
Asked for: "we do a pretty poor job at keeping our roadmap, changelog, etc
updated ... i know we can ensure that we do it as we develop."

THE RECORD WAS 48 DAYS BEHIND

The newest entry on the public /changelog was 2026-07-31 while main ran on to
#1063 — roughly a hundred merges during which the page told every visitor that
nothing had happened. A stale changelog is worse than none: it answers "is this
alive?" with a confident no.

Nine entries added, grouped by theme rather than one per pull request, because a
reader wants to know what changed for them and not that ninety PRs merged:
wallet pages and the two-chain fix; balances that say when they were last
checked; Companions and per-person memory; a free AI chain that actually
answers; six public tables that had row-level security off; Cat reading the web
with citations; setting a page up for someone else; on-chain history on the
wallet card; and payments no longer routed to wallets that cannot receive.

A GATE, NOT A RESOLUTION

scripts/check-changelog-fresh.mjs fails verify when the newest entry is more
than 30 days old (CHANGELOG_MAX_AGE_DAYS overrides), and it fails loudly if the
file's shape changes under it — a regex that quietly matches nothing would make
this a green light over an unchecked invariant. Proven both ways: against the
pre-PR state it fails with "changelog is 48 days old"; rename the `date:` key
and it fails with "no dated entries found".

WHY NOT RENDER IT FROM LOKI

Loki already records a changelog as work happens (user_projects.dev_log), and
the fleet map publishes it — so piping that onto /changelog was the obvious
move. It is the wrong one: those entries are written for the agent that picks
the project up next, not for a reader deciding whether to trust a funding
platform ("shared ranked chooser (operator's order, filtered to installed +
not-recently-rate-limited) is now the primary control on Needs-you feedback").
The producer exists; the public page still needs an editor. This gate makes
someone be one.

The roadmap's NOW phase also gains the two things actually being built —
open accounting and a transparency score computed from observable facts.


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

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-17 01:46:10 -07:00
CatoandClaude Opus 5 3e6c202c59 refactor(config): the deploy target is configuration, not a literal (#1061)
Three hardcoded things in a public repo, each of which is someone else's
value baked into the source.

The box address had a literal fallback in five places: the CD workflow and
four operational shell scripts. A fallback literal guarantees the variable
is never exercised — if the variable were missing or wrong, every run would
still succeed against the baked-in address and nobody would find out until
the address changed. So:

  - cd.yml takes the address from vars.OC_BOX, or root@ the HETZNER_IP
    variable, and a new guard step fails the run with ::error:: when the
    result is empty. The ssh-keyscan and ssh-config host now derive from
    the host half of OC_BOX instead of repeating the literal, so the two
    cannot drift apart silently.
  - apply-migrations.sh, db/dump-live-schema.sh, db/gen-types.sh and
    deploy-selfhost.sh use ${OC_BOX:?...}: they stop with one clear line
    instead of reaching for a default. The two of them invoked by the
    deploy script are already passed OC_BOX explicitly, and the workflow
    sets it in the job env, so the configured path is unchanged.

An audit log was committed under logs/ in 2025-10 with 14 absolute paths
from a developer's machine. Nothing in the repo reads it (the only mentions
of the filename are inside the file itself). The `logs/` ignore rule was
added five days after the file, so it never applied to it — removed, and
the rule now says why, because ignoring a directory does not untrack what
is already inside it.

scripts/db/setup-db.ts signed in as a personal email address written into
the source. It now reads USER_EMAIL, matching the USER_PASSWORD it already
read, and exits with a clear message when unset.

Verified: bash -n on all four scripts and each one run with OC_BOX unset
(exit 1, clear message); the workflow parses and the guard step is in
place; pnpm run type-check:scripts green; prettier clean; the two unit
tests that read deploy-selfhost.sh pass.


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

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-17 01:07:48 -07:00
CatoandClaude Fable 5.1 483cb9e0d6 refactor: one definition per concern, and slugs that survive a non-Latin name (#1059)
* refactor(lib): one sanitizeApiKey and one escapeHtml, with tests

Two helpers that touch security-relevant material had drifted into copies:

- sanitizeApiKey existed five times (transcribe route, groq, openai-compat,
  openrouter, health probes). It stands between a pasted credential and an
  Authorization header, so it now has one definition in src/lib/api-key.ts
  and a test. health-probes wanted the "did anything get stripped?" answer,
  which is sanitizeApiKeyChecked over the same regex rather than a sixth one.
- escapeHtml existed four times across the email templates — the injection
  guard between a user-supplied name and an inbox. It is now exported once
  from templates/layout.ts, which all three callers already import.

No behaviour change: the regex and the replacement chain are byte-identical
to what every copy did.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012KAn51JHFcTrPeCjZDGXM8

* refactor(utils): one home for the display formatters that had drifted

Four helper names were declared in three or four files each. Consolidated,
with every call site printing byte-for-byte what it printed before — pinned
by __tests__/unit/lib/display-formatters.test.ts.

- formatDate x4 -> src/utils/dates.ts, which already owned one of them.
  The three copies were three DIFFERENT formats, so the module gained the
  two it was missing rather than flattening them: formatDateLong ("July 22,
  2026") for article datelines, and formatIsoDay for 'YYYY-MM-DD' strings.
  formatIsoDay keeps the changelog's deliberate property of never building a
  Date: a calendar date has no timezone, and `new Date('2026-07-22')` is UTC
  midnight, which renders the day before west of Greenwich and renders it
  differently on the server than in the browser.
- formatTimestamp x3 (identical) -> formatDateTimeOrDash in utils/locale.ts,
  next to the formatDateTime it wrapped. The two row components took it as a
  prop from their parent; they import it instead, so the prop is gone.
- formatCountdown x3 -> src/utils/countdown.ts. These were not one helper
  that drifted but three formats sharing a name — 45 seconds read as "45s",
  "1m" or "0:45" depending on which file you imported from. They keep their
  three behaviours under names that say what they print.
- readJson + errorMessage x3 in the browser payment clients -> the
  unwrapApiResponse that src/lib/api/client-response.ts already exports, and
  whose docblock warns about exactly these hand-rolled copies drifting.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012KAn51JHFcTrPeCjZDGXM8

* fix(slug): slugify transliterates, so a non-ASCII name is not deleted

`slugify()` filtered to ASCII, which does not mean "strip accents" — it means
"delete every letter that is not ASCII". `Café Genève` became `caf-genve`,
`Grüße` became `gre`, and a Cyrillic or Japanese name produced the EMPTY
STRING. Under a unique constraint an empty slug means the second such record
cannot be saved at all, and the first one is addressed by a slug that
identifies nobody — walked live on 2026-09-11, `Марина` became
/profiles/someone and @someone.

That was already known and already fixed, but in domain/profileClaims only:
it kept its own `transliterate` and wrapped the broken slugify with it. Group
creation, the Cat's organization handler and the entity create form all still
went through the unwrapped path. So the transliteration moves into
`slugify()` itself — German digraphs first (ß has no decomposition and would
otherwise vanish), then NFKD plus a combining-mark strip for everything that
decomposes, then a Cyrillic table for the script that does not. claimSlugFor
keeps only what is specific to a claim: the person-<random> fallback.

Also in this commit, same concern:
- groups' `generateSlug` was `(name) => slugify(name)` — an alias, deleted;
  its one caller calls slugify, with a 'group' fallback so an unslugabble
  name cannot become the empty slug that ensureUniqueSlug would then extend.
- slugify with randomSuffix no longer returns a slug starting with a dash
  when the base is empty.
- scripts/cli/create-entity.ts deleted: a dead twin of create-entity.js,
  which is what `pnpm run create-entity` actually runs, carrying a third
  generateSlug. knip already listed it as unused.
- formatAmount: the real implementation inside <CurrencyDisplay> moves to
  services/currency/formatting.ts as formatAmountSuffixed. Output is
  unchanged — it is deliberately not formatCurrency(), which prefixes BTC
  with ₿ where every card in the app suffixes the ticker.

Tests: __tests__/unit/lib/slugify.test.ts covers the accented, German and
Cyrillic cases plus the ASCII behaviour that must not have moved.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012KAn51JHFcTrPeCjZDGXM8

* refactor: say the repeated blocks once — chat types, footer, Esplora readers

Three places where the same thing was written out two to five times.

- The Cat's tool-call vocabulary (ToolCallResultRef, ToolCallEvent,
  PrefillProposal) was defined twice: once by the pipeline that emits it and
  once by the panel that renders it, 55 lines of discriminated union that had
  to agree with nothing making them. The panel now re-exports the service's
  types. Type-only, so nothing enters the bundle. The two copies had already
  drifted: the service carries `handle?` on a result ref (the citation handle
  the UI needs to link the right source) and types `entityType` as the entity
  union rather than `string`.

- <Footer> wrote out the same seventeen-line link column five times, and only
  two of the five carried the external-link branch — so which columns could
  hold an external link was an accident of which had been copied last. One
  <FooterColumn>. Renders identically: only `ecosystem` has external items
  today.

- The Bitcoin service listed mempool.space and blockstream.info with
  byte-identical processBalance and processTransactions, 60 lines each. They
  both serve the Esplora API, so there is one reader for each now — one place
  for the satoshi arithmetic instead of one place to fix it and another to
  leave wrong.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012KAn51JHFcTrPeCjZDGXM8

* refactor(timeline): the feed envelope is written once, not fourteen times

Six feed functions across four files each spelled out the same three things
by hand: the page window, the success envelope, and — twice per function,
once for "no rows" and once for the catch — the empty envelope. Twenty
copies of the same twenty-line object literal, which is why userFeeds.ts was
the most-duplicated file in the repo (9 clones, 184 duplicated lines).

The cost was not the lines. A field added to TimelineFeedResponse had to be
remembered in all twenty places, and the ones that forgot it still compiled;
`hasNext` was computed from `offset + limit` in fourteen separate
expressions, any one of which could be edited alone.

queries/feed-shape.ts now owns pageWindow(), feedResponse() and emptyFeed().
What differs between the feeds — which rows they fetch, and the RPC or view
they fetch them from — stays in each file, which is the part that was ever
worth reading.

Two behaviours that looked accidental were kept deliberately and documented
rather than "tidied":
- emptyFeed echoes the requested limit WITHOUT clamping it to MAX_PAGE_SIZE.
  There are no rows for it to bound, and three call sites did exactly this.
- emptyFeed with no pagination reports page 1: the early returns that never
  read their arguments (no session, follows nobody) did that, and the numbers
  are what the UI paginates on.

userFeeds.ts 407 -> 281 lines, profileFeeds 87 -> 54, projectFeeds 122 -> 89,
communityFeeds 94 -> 61, plus 95 shared. Existing timeline tests pass
unchanged (62 files, 601 tests).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012KAn51JHFcTrPeCjZDGXM8

* refactor: extract the preludes that PUT/DELETE and five seed scripts repeated

Five more places where the same block was written out twice or five times.

- entityCrudHandler's PUT and DELETE each carried the same thirty lines:
  authenticate, load the row, run the ownership check. Now
  authorizeEntityMutation(), taking the verb and the optional per-entity
  access check. A change to the 401, the not-found copy or the ownership rule
  could previously land on update and not on delete — and delete is the half
  where getting it wrong is permanent.

- /api/projects/[id]/favorite: POST and DELETE both throttled the write,
  loaded the project and looked up the existing favourite. One helper in
  lib/api/projectFavorites.ts. It is called rateLimitedFavoriteContext for a
  reason, spelled out in its docblock: api-route-guards.test.ts reads route
  SOURCES for evidence of a write quota, and a helper called loadX would have
  hidden that evidence behind an import — the gate goes quiet while the
  protection is still there, which is the shape of a gate that later goes
  quiet when it is not.

- messaging/api-helpers.server.ts declared ActorRow, GroupMembershipRow and
  GroupActorRow twice, 27 lines apart-but-identical. TypeScript merges
  identical interfaces, so it compiled and nobody noticed.

- The group-activity and re-engagement email templates each wired their
  config into emailLayout + emailPlainText by hand. One renderEmail() in
  layout.ts.

- Five owner-gated operational scripts opened with the same thirty lines:
  load .env.local, read the service-role key, refuse without
  ORANGECAT_OWNER_SEED=1, build an admin client. These run against the LIVE
  database with a key that bypasses RLS, so that gate is the only thing
  between a stray `npx tsx` and production — not a check to keep in five
  versions. scripts/lib/owner-gate.ts owns it; the client it returns carries
  its own supabaseUrl so the two scripts that print which database they are
  about to write to still can.

Also: webhook signature verification stays duplicated between the app and
packages/sdk, because the SDK ships to customers and cannot import from src/,
and the app should not take a build dependency on a customer-facing package.
What is new is that the copy can no longer drift silently:
__tests__/unit/services/webhook-signature-parity.test.ts drives BOTH through
the same vectors — replay, forged body, bumped timestamp, wrong secret,
truncated and non-hex signatures, multi-signature rotation — and fails if
they ever disagree. Both files now say so at the top.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012KAn51JHFcTrPeCjZDGXM8

* test(slug): the assertions that pinned the limitation the fix removes

#1051 landed NFKD for slugify while this branch was in flight, and its tests
pinned what NFKD alone cannot do: `slugify('Марина') === ''`, and an article
titled in Cyrillic slugging to the literal word "article". Both were true,
both were documented as "callers transliterate first" — and this branch moves
that transliteration into slugify, so neither is true any more.

Updated rather than deleted, because the cases are the interesting ones: they
now assert 'marina' and 'shcherbakov', plus the sharp s that NFKD deletes
('Straße' → 'strasse', not 'strae'). The fallback assertion survives where it
still applies — a title with no letters at all.

The two slug test files are merged into the one that came with #1051; keeping
a second file for the same function would have been the thing this branch is
about.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012KAn51JHFcTrPeCjZDGXM8

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-15 13:53:38 -07:00