Commit Graph
9 Commits
Author SHA1 Message Date
CatoandClaude 2d3609c13e feat(auth): stage AccountKit beside Auth.js, switch off (#156)
Petvity moves from Auth.js to @bitbaum/accountkit one reversible step at a
time, as evig and kivvi do. Nothing changes while AUTH_RUNTIME is unset.

- Migration 0008: AccountKit's tables under an `auth_` prefix, plus the
  users <-> auth_users mirror functions, inert until attached.
- scripts/db/accountkit-import.sql: accounts under their own ids, bcrypt
  hashes byte for byte, verification kept, orangecat_sub as an `orangecat`
  account row; refuses collisions, drift or a live shared runtime, then
  attaches the triggers. The rehearsal CLI always rolls back.
- lib/auth/shared/: the runtime (ids: 'uuid', legacy bcrypt, AccountKit
  0.16.0), a session reader re-read from `users` on every request, a bridge
  that answers next-auth/react including "Sign in with OrangeCat", and a
  Petvity row for a person AccountKit creates itself. AccountKit's own
  credential endpoints stay closed; Petvity's writers stay the only ones.
- lib/auth/claims.ts: the ADMIN_EMAILS promotion rule, written once.
- The proxy has one routing function and two session sources.
- browser-smoke.yml runs the account journey once per runtime; the
  AccountKit leg first runs the rehearsal and the real-database journeys.

docs/ACCOUNTKIT-MIGRATION.md records what is left before switching.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 08:31:55 +01:00
CatoandClaude Opus 5.5 5ea4dab4fa fix(copy): every public claim matches the code — contact, legal, pricing, pros, 9 locales (#106)
* fix(copy): contact mail goes to a mailbox that exists

hello@ and support@petvity.com sat on the footer, every legal page, the
structured data and every email template. petvity.com is not ours (it is a
Netlify site with Zoho MX; lib/config/email.ts already lists it as "not
ours"), so privacy and support mail went to a stranger. APP.email is now
cato@orangecat.ch, the one address on the receiving apex, and supportEmail
is folded into it. lib/config/app.test.ts fails if it leaves the apex.

The pet-edit form also showed "petvity.com/pets/" as the share prefix; it
now derives the host from APP_URL.

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

* fix(copy): privacy and cookie policies describe the running system

Privacy: Neon was decommissioned in 2026-06 (the database is PostgreSQL on
the same Hetzner box, listening on 127.0.0.1 only), Google sign-in is not
configured in production while OrangeCat sign-in is, groomers and guest
checkout were missing, and "database connections use TLS" did not hold for
a localhost connection.

Cookies: Auth.js v5 sets authjs.* cookies, not next-auth.*, plus PKCE/state
cookies during OrangeCat sign-in; NEXT_LOCALE is a session cookie set on any
locale page, not a one-year cookie set only by the switcher.

Effective dates moved to October 2, 2026.

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

* fix(copy): marketing pages say only what the product does, in all 9 languages

- pricing: Pro and Clinic cards cut. Their buttons were href="#", neither
  plan is on ROADMAP.md, yet the FAQ called them "next".
- pros: cut vets reading clients' health history and sitters logging health
  during stays (records are owner-scoped; "Vet-facing records" is 0% on the
  roadmap), the unmeasured "growing community" card, and a sitter card that
  repeated its heading. Reviews tie to completed bookings, not confirmed ones.
- features: no refill tracking exists; charts span 30 days, not months; the
  twin is not built from 30 days on the dashboard (7); unverified pros are
  listed; cross-border adoption and "any language" were not true; handle host
  is the live one; groomers added.
- about: the "Behind the project" section was empty in 4 locales and claimed
  "a team of software engineers" in 5; cut.
- ar/ja/ko/tr/zh: the features, pricing, pros and about pages carried an
  older, differently ordered copy (stats swapped, "data export coming soon",
  "VitaReba"); retranslated from the current English.
- CHANGELOG: removed "health metrics that matter per species" (the
  observations config is not wired into any screen) and the Stripe claim;
  added 2026-10-02. ROADMAP: OrangeCat sign-in shipped, Google item dropped.

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

* fix(copy): close the gaps the verifier found, in all 9 languages

- Cookie policy names both ways NEXT_LOCALE is set: a session cookie per
  page, one year when picked with the language switcher.
- Privacy policy lists the Loki feedback widget as a service provider.
- /pros no longer says owners share pet records or Digital Twin data with
  vets and sitters (a booking shows them only the pet's name): rewrote
  metaDesc, heroDesc, vet/sitter hero copy; cut vb1 ("months of structured
  health history"); dropped 72 unrendered pros keys that still shipped the
  same claims in every page's message payload.
- Cut unmeasured timings: home heroSub ("30-second check-in"),
  benefitTrackDesc ("in 30 seconds"), "set up in minutes", "a few minutes".
- Species guide CTA: a record to show your vet, not one shared with them.
- ROADMAP/CHANGELOG: email+password sign-up still works for new users;
  changelog line lists what was cut instead of claiming all copy is true.

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

* fix(copy): privacy names what an OrangeCat sign-in stores; drop a dead features key

- Privacy, "Data we collect": an OrangeCat sign-in also stores the name and
  profile picture from the OrangeCat account (accountkit's orangecatProfile
  maps name and picture onto users.name and users.image), not only the id.
- features.heroSubtitle is rendered nowhere but still shipped in every page's
  message payload, carrying "cross-border adoption" and "in any language" —
  both cut elsewhere in this PR. Removed from all nine locales.

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

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-29 17:45:53 +01:00
CatoandClaude b664f9d363 docs: archive dated fleet records, point SSOT row at longform.ts (#115)
The three 2026-08-16 fleet measurements/proposals move to docs/archive/ (they named a retired host, a renamed repo and a proposed shop.config.ts). CLAUDE.md's SSOT table named the retired lib/domain/blog-markup.ts; the parser is lib/domain/longform.ts. The investor memo link follows the move.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-19 13:56:43 +02:00
CatoandClaude Fable 5.1 ef4c7c3144 chore: rename FleetCrown to Loki (#93)
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
9 files changed, 15 insertions(+), 15 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:25:03 -07:00
GandClaude Fable 5 d4ffb0e48f docs(investor): investor memo and honest risk register (#59)
The memo is the SSOT for the investor presentation: problem, live product
surface, digital-twin moat and staged roadmap, business model table, market
ranges with named third-party sources, honest traction (pre-revenue,
pre-marketing, no invented numbers), and use of funds. The risk register
states plainly what diligence would find anyway — distribution untested,
two-sided surfaces empty, habit retention unmeasured, memorial ethics,
solo-founder concentration.

A shareable dark-editorial deck built from the memo is published separately
(Claude artifact); the memo remains the source of truth.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-20 13:25:12 +00:00
GandClaude Opus 5 b59101b0e2 fix(security): a missing CRON_SECRET must deny, not accept "Bearer undefined" (#57)
Found while inventorying what repeats across the fleet. Cron auth appears in 43
files across 9 repos, and the copies have diverged into two behaviours:

  petvity      if (auth !== `Bearer ${process.env.CRON_SECRET}`)          OPEN
  evig         if (authHeader !== `Bearer ${cronSecret}`)                 OPEN
  kivvi        if (!cronSecret) { ... }                                   guarded
  aoz-housing  if (!cronSecret || authHeader !== `Bearer ${cronSecret}`)  guarded

With CRON_SECRET unset, the template literal evaluates to the string
"Bearer undefined", so a request carrying exactly that header is authorised.
All 8 cron routes here had the open version.

Behind that gate: /api/cron/reset-demo wipes and reseeds the demo account, and
weekly-digest, health-alerts, vaccination-reminders, medication-reminders and
booking-reminders each email every opted-in owner. So the blast radius of a
missing environment variable was a stranger mass-mailing the userbase and
destroying demo data.

Not exploitable today — CRON_SECRET is set in production. It is a gate that
fails open on an absent secret, which is a normal thing to happen on a new
environment or a typo, and the failure is silent.

requireCronAuth() denies everything when the secret is absent or blank, logs why
so a broken deployment is loud rather than quiet, requires the Bearer scheme,
and compares with timingSafeEqual. The timing part is close to unexploitable
over TLS and is not the point; a helper that is obviously correct removes the
need for anyone to reason about whether it matters.

Two test files, and the second is the one that matters. cron.test.ts pins the
helper's behaviour, including that "Bearer undefined" is refused when
unconfigured. cron-routes.test.ts asserts against the directory that every cron
route calls requireCronAuth and no route mentions process.env.CRON_SECRET —
because fixing eight routes fixes eight routes, while checking the directory
fixes the ninth one nobody has written yet.

Also adds docs/repeatable-across-projects.md: the full measured inventory of
what repeats across 25 repos, and a first-principles rule for what to do with
each. The short version is that copy count is the wrong question — it measures
typing, which is free. The right question is what divergence costs, which sorts
duplication into four classes with four different correct answers, of which
"leave it alone" is one.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-16 15:03:03 +00:00
GandClaude Opus 5 e172d0f63e docs: how to build six shops in a month, an hour each (#56)
Grounded in what the fleet already has rather than proposed from scratch.

Roughly 90% of a shop is identical between shops, and the 10% that differs is
nearly always the same 10%: what a product is, what the brand looks like, and
who ships it. Today a shop is 30-55 hours; almost all of that is the identical
part.

Three layers, and the middle one is the whole job:

  shop.config.ts      per shop   catalogue shape, brand, currency, fulfilment
  storefront kernel   MISSING    schema, routes, admin, checkout UI, emails
  commercekit         EXISTS     money, cart, inventory, buyer, addresses

The decisive rule is that the kernel is a DEPENDENCY, never a template, and
that is settled by measured data rather than preference: SHARED.md records
auto-merge-sweep.sh living in 22 repos in 8 distinct versions, where a fix
reaches at most 9. A starter copied six times becomes six codebases within a
quarter, and the economic case collapses exactly when it should start paying.

The catalogue reconciles into a declarative schema — checked against all three
real shops, which are a common core plus per-shop custom fields (condition and
brand for refurbished hardware, size and colour for footwear).

Infrastructure is already solved and should not be rebuilt: apps.conf plus
sync-infra.sh generate the systemd unit, launch script and Caddy vhost from a
one-line manifest entry, idempotently, for 13 apps today.

Build order is extraction, not anticipation: build shops #1 and #2 normally,
extract the kernel from them, then #3-#6 are config. About a week plus six
hours. And build it on the simple first-party case, NOT on evig — generalising
from a P2P marketplace with escrow, disputes and payouts produces a kernel that
is complicated for everyone and right for one.

Also names the verticals the fleet has already written three times each —
commerce, booking, content, directory — which is what a studio spine would
carry.

Ends with what an hour does not buy, because the promise otherwise breaks on
shop #1: products, brand, tax rules, a payment account, legal review and
fulfilment. Petvity has a working checkout and zero products; evig has 213
listings nobody can buy. The bottleneck is not engineering time.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-16 14:31:59 +00:00
GandClaude Opus 5 6a6a672284 docs: decide what to do with the fleet's shops (#55)
Measured against production rather than inferred from code.

  evig/revampit   213 active listings, 21 users, 0 orders ever, and clicking
                  "Jetzt kaufen" on a live listing sends a stranger to
                  /auth/login. Verified in a browser today.
  petvity         0 products, and the only 4 orders in the database are my own
                  e2e fixtures. Guest checkout works.
  fitfoot         not deployed anywhere, dormant since March, CI deliberately
                  disabled, built on Medusa.

The fleet does not have too many shops or under-built shops. It has two that
fail in exactly complementary ways: the one with real inventory cannot be bought
from, and the one that can be bought from has nothing to sell.

Decisions:

1. evig is the shop. Ship guest checkout there — the highest-value change
   available in the fleet, and a port of something already proven in production
   rather than speculative work. The plan is written file by file, including the
   leftJoin/COALESCE trap that will otherwise hide every guest order from the
   seller who has to ship it.

2. petvity is not a shop. Keep the guest checkout, stop treating "fill the
   catalogue" as a priority. A P2P marketplace needs seller supply it does not
   have; if it ever sells, sell first-party off the back of the health content,
   which is the thing only petvity can do.

3. fitfoot: archive it, or rebuild it on commercekit. Not left dormant on a
   framework the stack has decided against.

4. One engine, several storefronts. commercekit is the core; catalogue, order
   state machine and fulfilment stay per-shop because they genuinely differ.

5. One question for a human: evig.orangecat.ch and revampit.orangecat.ch serve
   the same build off the same database. Two brands on one codebase may be
   deliberate, but it decides whose name is on the invoice.

Does not touch evig — that needs a session in that repo.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-16 13:52:18 +00:00
GandClaude Opus 5 1e82028f27 feat(health): track what actually matters, per species (#52)
The seven metrics in health-metrics.ts are applied uniformly to all ten
species. That is tidy and, for several of them, wrong in ways that matter.

Body temperature is not a property a fish or a reptile has in the sense the
field implies. They are ectotherms: a fish's body temperature IS the water
temperature, and a reptile's depends on where it is sitting in a thermal
gradient. Heart rate is not measurable at home for a bird, a fish or a hamster.
Asking for either produces an empty field, and empty fields teach owners to
skip — a habit that generalises to the field that mattered.

Worse, none of the seven capture what actually kills these animals. A rabbit
that has not eaten and produced no droppings for twelve hours is a medical
emergency; gut stasis is the leading cause of death in pet rabbits. A male cat
straining without producing urine is fatal in 24-48 hours. A horse whose manure
output drops is the earliest practical warning of colic. A UVB bulb keeps
emitting visible light long after its UVB output has decayed, so the enclosure
looks fine while the animal develops metabolic bone disease.

lib/config/observations.ts is the SSOT for what is worth observing and for
which species. Each observation declares its species, cadence, whether an owner
can actually produce the answer, why it earns a tap, and what answer means
"call a vet" — with the reason, because an alert nobody believes is an alert
everybody dismisses. Records (microchip, parasite schedule, diet, farrier,
water changes) are modelled separately, since they are durable facts rather
than things that changed today.

The daily set is capped at five and the cap is a test that FAILS rather than a
slice that truncates. Printing the sets caught three real design faults that
the first round of tests passed: fish had an empty daily check-in because water
temperature is device-sourced and I was filtering device readings out; dogs and
cats had seven candidates silently cut to five by array order; and reptiles were
being asked about mood while the enclosure gradient that actually kills them was
excluded. Priority is now explicit and cadence can be overridden per species —
a snake fed weekly should not be asked daily whether it ate.

Clinical values are typical published ranges compiled for product design, NOT
clinically reviewed. REVIEW_STATUS records that, so it cannot quietly be
presented to an owner as authority.

Also adds docs/pet-health-science.md (the reasoning, species by species),
docs/digital-twin-and-legacy.md (twin staging, memorialisation, gamification
and revenue, including an explicit list of what not to build), and a first blog
draft. Nothing is published — that is a deliberate decision, not a side effect.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-16 11:29:14 +00:00