Commit Graph
330 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 d949035a65 feat(pwa): a Petvity mark and a manifest so phones offer "Install app" (#146)
The tab icon was the create-next-app default (Vercel triangle) and there was no manifest. app/icon.svg is a paw on the fleet dark tile; app/manifest.ts names 192, 512 and maskable 512 PNGs rasterised from it. The default favicon.ico is removed.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-30 11:31:32 +01:00
CatoandClaude 4a40a03d44 feat(charts): health trends and twin meters on @bitbaum/chartkit 0.7 (#141)
ChartKit 0.7.0 closes both gaps recorded in package-plan.json (#140):
LineChart now labels days on a 30-day span, and Meter takes a tone and
showValue={false}.

- HealthTrendChart renders ChartKit's LineChart on the server: one line
  per metric, the species' normal range as a reference band, the portal
  locale for dates and numbers. A day without a reading is left out of
  that line. The trend charts sit one per row: in the portal's 4xl
  column, three across left each plot about 190px and the day ticks ran
  into each other.
- The twin score and per-metric bars (DigitalTwinCard, public pet page,
  portal dashboard) are ChartKit Meters coloured by the twin state's
  tone, with the figure printed once by the page.
- The twin score block wraps under the state name on a narrow card; at
  390px in German it was clipped ("41 / 1") before this change.
- recharts is removed, with the chart colour config and the tooltip
  shadow that only it used. Both exceptions leave package-plan.json; the
  bindings are recorded instead.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-29 20:02:23 +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
Cato b9c4899ee7 feat(auth): one password rule from accountkit (non-empty, up to 128); no local minimum or hint text (#123) 2026-10-28 03:53:21 +01:00
Cato 6a3044927b feat(auth): password recovery uses the shared accountkit form (#122)
Forgot/reset pages render PasswordRecoveryForm from @bitbaum/accountkit 0.8.1
through a small adapter over Petvity's own routes, so users, bcrypt passwords,
roles and Auth.js sessions are untouched. The hand-written pages could stay
stuck after a network error; the shared form leaves its busy state and says so.
The reset route now answers an invalid link with code INVALID_TOKEN.
2026-10-28 01:29:57 +01:00
CatoandClaude f1e98e2ae6 fix(layout): one <html>, so the fonts and the language survive navigation (#114)
The owner walked the site with Loki on 2026-10-18 and said the design was
inconsistent between the home page and the portal. It was, and not by
design: app/[locale]/layout.tsx rendered a second <html> inside the root
one. React keeps one document element and, when that nested <html>
unmounted on a client navigation from the marketing site into /login or
/portal, cleared what it had set on it — lang, dir and the font classes.
Measured on the live site, /de → /login without a reload: lang null,
class "", body font Roboto instead of Plus Jakarta Sans, headings out of
Jost. Loki's checks also kept reporting "the page does not declare its
language", which was true after every such navigation. German pages
were also served as lang="en" (the browser kept the first <html>'s).

- The root layout renders the only <html>, with the request's locale and
  direction (next-intl getLocale: the URL's on the localized site, the
  default elsewhere).
- Each route group keeps document lang/dir right across client
  navigations with a small client component (DocumentLanguage):
  [locale] with the URL's locale, the portal with the user's, auth and
  admin in English.
- lib/i18n/one-html.test.ts: only the root layout renders <html>, and
  every route group says its language.

Checked on a production build: /de, /login and /ar serve one <html> each
with lang de / en / ar and dir rtl for Arabic; /de → /login → /de/features
by client navigation keeps the font classes and the right lang at every
step.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-18 08:17:21 +02:00
CatoandClaude Opus 5.5 c5abcf1b94 fix(home): hero mock and eyebrow text at 14px, not 10–11px (#113)
The check-in mock's labels and trend lines ("↔ stabil", "✓ normal",
"✓ super") were 10px and the hero eyebrow 11px. All are now 14px. The
mock cells lose their uppercase tracking and get tighter padding below
sm so every label fits on one line at 320px in all nine locales.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 02:59:27 -07:00
CatoandClaude Sonnet 5.5 9450bc14ed feat(forms): dates read in words — all date fields use @bitbaum/whenkit's DateInput (#109)
Twelve raw <input type="date"> fields (pet birth date, health log,
vaccinations, medications, records, availability, provider search) showed the
browser's bare "tt.mm.jjjj" box. They now render whenkit's DateInput, a
drop-in with the same props and onChange(event): the tag changes and
nothing else. The visible box carries the SAME .form-input class, and in
petvity's real CSS build it takes that look exactly (border, 10px radius,
padding, font); the real input stays on top, so the picker, keyboard and
validation are unchanged.

components/ui/date-input.tsx is the one place petvity imports it from (and
where the stylesheet is imported). Migrated with whenkit's
scripts/migrate-date-inputs.mjs (tag + one import per file). Lockfile
written with petvity's pinned pnpm 11.6.0 so only whenkit's 14 lines change.

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-08 07:37:41 -07:00
CatoandClaude Opus 5.5 3209d7d74b refactor(auth): OrangeCat sign-in through @bitbaum/accountkit; no reset link for an OrangeCat-created account (#108)
lib/auth/orangecat.ts (provider, profile without email, placeholder email,
the sub-keyed adapter wrapper) moves to @bitbaum/accountkit/orangecat v0.2.1,
which took it as one of its sources; its tests went with it. The
ADMIN_EMAILS guard is accountkit's emailEarnsPromotion.

Fixes a gap: forgot-password emailed a reset link to an account OrangeCat
had created. That address came from OrangeCat unverified, so the link would
have given whoever owns it a password on the OrangeCat person's account.
It now gets the same generic answer (mayReceivePasswordReset); a person
with a password of their own can still reset it. Two route tests.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 05:19:24 -07:00
CatoandClaude Opus 5.5 2b7a71cb4f feat(auth): sign in with OrangeCat (#104)
"Sign in with OrangeCat" (OIDC) is now the primary action on /login and
/register; email + password stays behind a disclosure so existing accounts
are not locked out. OrangeCat's own page carries Google, GitHub, email and
open registration.

- Provider: client_secret_post + PKCE + state, scope "openid profile email",
  issuer https://orangecat.ch (ORANGECAT_OAUTH_ISSUER overrides). Absent,
  not broken, until ORANGECAT_OAUTH_CLIENT_ID/SECRET are set.
- Users are keyed ONLY on the new users.orangecat_sub (additive migration
  0007). The provider profile carries no email, so Auth.js never looks a
  user up by email; a new sub always creates a new user. A taken email gets
  an undeliverable @users.invalid placeholder.
- An OrangeCat login never earns ADMIN_EMAILS promotion (email unverified).
- Identity only: no OrangeCat token refresh, tokens not stored.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-02 05:01:17 -07:00
CatoandClaude cf6912e957 feat(records): public roadmap and changelog, from the repo through the fleet map (#103)
The fleet's building-in-public contract puts each product's record in its
own repository as two markdown files and renders it through Loki's fleet map
via bip-kit. Petvity had neither the files nor the pages.

- ROADMAP.md: Now / Next / Later / Shipped, derived from the phases in
  AGENTS.md and the merged history. Planned work is written as plans.
- CHANGELOG.md: Keep-a-Changelog dialect, user-facing, newest first, from
  merged PRs; today's homepage rewrite is the top entry.
- /[locale]/roadmap and /[locale]/changelog render bip-kit's DevelopmentPage
  inside the marketing nav/footer; the records are English by contract, the
  chrome and metadata stay localized (keys in all 9 locales, footer links).
- lib/config/development.ts is the SSOT for the map URL, slug and profile;
  lib/development/records.ts fetches with revalidate 300 and an 8s ceiling.
- The --bp-* theme scope already mapped for the blog (.pv-longform) covers
  the records; the page title and record name take the editorial faces.
- Vitest covers the data path with a fleet-map fixture, no network.
- Sitemap lists both pages.

Verified at 390px in de/en/ar: no horizontal overflow.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-28 04:09:11 -07:00
CatoandClaude b1fedec17b feat(home): mobile-first homepage — one line, one CTA (#102)
Owner feedback: far too much text; visitors should look and act.
- Hero: short headline + one sub-line + HeroCTA (sign up / demo), CTA above
  the fold at 320-390px
- Three one-line benefit tiles, one compact check-in mock
- 'Free, forever' with three checks and a final CTA
- Removed species strip, feature essays, digital-twin and signal sections,
  ecosystem cards, live proof, how-it-works and the 9-item pricing list
- New keys in all 9 locales; unused home keys dropped
- .btn-editorial-wrap lets long localized CTAs wrap on 320px


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-28 01:46:58 -07:00
CatoandClaude Opus 5.5 24a39c01f4 fix(nav): every header control is a 44px target; one header for the public detail pages (#100)
The fleet render sweep (nav contract rule 3) counted sub-44px nav controls
in two places:

- MarketingNav: px-3 py-2 links and the Platform button were 36px; the
  Sign-in link 20px. They now carry min-h-11 and trade vertical padding for
  it, so the h-16 header is unchanged. The Platform and mobile-menu toggles
  also gain aria-expanded (rule 2), and the species-guide chips inside the
  Platform menu get the same floor so opening it does not add new ones.
- adopt, adopt/[listingId], find, pets/[handle] and pros/[userId] each
  hand-rolled the same slim header (logo 28px, Sign in 20px, CTA 38px). It is
  now PublicPageNav, once, with every control at 44px; .btn-editorial-sm
  (the nav CTA pill) gets min-height: 44px.

Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 00:07:44 -07:00
CatoandClaude Fable 5.1 18776a4251 refactor: one definition per concern — shared forms, one directory handler, limitkit, zero lint noise (#95)
* fix(lint): anchor the ignore patterns so eslint stops linting build output

`eslint` reported 18 unparseable files and 2 `no-explicit-any` errors that
exist in no source file. They came from `.claude/worktrees/*/.next/**` —
generated, minified code inside the repo. The default ignores of
eslint-config-next are unanchored (`.next/**`), which only matches at the
config root, so nested build output was walked.

Every pattern is now `**/`-prefixed, and `.claude/**` is ignored outright:
a worktree's files are linted on its own branch, never as a copy of this one.

Before: 2 errors, 36 warnings. After: 0 errors, 16 warnings — and the same
result whether you run it from the checkout or from a worktree.

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

* refactor(pets): one set of pet fields for both add and edit

"Add a pet" and "edit a pet" rendered the same ~120 lines twice — name,
species, breed, birth date, sex, bio, public toggle — so a new field or a
fixed label had to be applied in two places, and the two only stayed
identical by luck.

The fields now live in `components/portal/PetFormFields.tsx`. Each takes the
whole form plus a patch callback rather than a value and a setter, because
the pages hold one `useState` object (the edit page's also carries `handle`)
and a patch is what they can actually apply. The pages keep what genuinely
differs: one creates and can send you on to the first health log, the other
uploads an avatar, owns a handle and a delete zone.

Two primitives came out with it: `ToggleSwitch` (the peer-checkbox switch is
easy to get subtly wrong in a copy — the knob detaches from the track and
nobody sees it until they toggle) and `UploadedImage` (the plain `<img>` for
user-uploaded files, with the reason `next/image` is wrong for them written
down once instead of thirteen bare `eslint-disable` lines).

Render output is unchanged.

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

* refactor(api): one handler behind /api/vets, /api/sitters and /api/groomers

The three directory routes differed in a role string, a table and a list of
columns — and agreed, character for character, on everything that decides
what a caller sees: the session guard, the completeness rule, the city
filter, the 50-row page, the review aggregate and the response envelope.
Three copies of a paging rule is three chances for one directory to quietly
start answering a different question from its siblings.

`createProfessionalDirectoryRoute` in `lib/api/professional-directory.ts`
now owns that shared half. Each route file declares only what it publishes:
its role, its table, the extra columns a profile must have filled to be
listed at all, and its SELECT list — because that list IS the contract the
directory offers (a sitter has a day rate, a vet has a clinic).

Responses are byte-identical: 106 + 103 + 106 lines became three ~35-line
declarations over one handler.

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

* refactor(products): the add/edit-a-product state machine, once

`/admin/products` and `/portal/my-products` look nothing alike — a table with
an inline panel versus a grid with a modal, and only one of them is
translated — but underneath they ran the same 55 lines: the same form shape,
the same "blank stock means unlimited", the same dollars-to-cents rounding,
the same POST-or-PATCH decision, the same optimistic list update.

The arithmetic is the part worth having in one place. `parseFloat * 100` is
where a product silently goes on sale for the wrong money, and it was
written twice.

`useProductEditor` takes the create URL (the admin page appends
`?platform=true` — the one behavioural difference), the two messages it may
need to show, and a callback for the saved row. The pages keep their markup,
their copy, and ownership of their list.

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

* refactor(portal): one labelled input and one contact block for the profile forms

`ProfessionalProfileForm` carried the same four-field grid twice — once for a
vet's practice, once for a sitter's or groomer's services — which jscpd
reported as a 40-line clone of the file against itself. Two copies inside ONE
file is the worst kind: a reviewer reads the first, recognises it, and skims
the second, which is exactly where "city" kept its label and lost its
placeholder.

`ProfileTextField` is that labelled input; `ContactFields` is the
city/country/phone trio as a fragment, so the caller still owns the grid the
cells sit in. `country` is passed through as typed — the route takes the
first two characters and upper-cases them on submit, and normalising here
would be a second opinion about the same value. `SellerProfileForm` uses
both, and its on/off row is now the shared `ToggleSwitch`.

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

* fix(security): key the guest rate limits on the hop Caddy wrote, via limitkit

The hand-rolled limiter in `lib/utils/rate-limit.ts` keyed on the FIRST entry
of `X-Forwarded-For`, with a comment asserting that was the original client
and a test pinning it. Both were wrong in the same direction: a reverse proxy
APPENDS to that header, so the first entry is a string the caller typed. Any
client could send a different `X-Forwarded-For` with each request, mint a
fresh bucket every time and never trip the limit at all — the guest checkout,
which reserves stock without a session, was effectively unlimited. A limiter
that cannot be tripped is not a limiter.

The same bug was found in three sibling repos during this migration, and in
limitkit itself before v0.2.0 (bitbaum/orangecat#563, finding 2). It is
exactly the kind of thing one shared implementation exists to fix once.

So the mechanism is now `limitkit` (fleet/SHARED.md; it replaces 12 copies of
this across 9 repos) and the local copy is deleted: window arithmetic, the
bounded store, the refusal shape and the client-IP dance all come from the
package. What stays local is what is genuinely ours — the limit VALUES, still
declared at each route next to the reason for them, and the proxy depth,
stated once in `rate-limit.ts` because it is a fact about our deployment
(Caddy on the box is the single proxy, so `trustedProxies: 1`).

Behaviour otherwise unchanged: same 429s, same copy, same `Retry-After`, same
per-key allowances. `slidingWindow` (not `fixedWindow`) because the local
implementation started its window at the first hit, which is what sliding
means — the old test expecting 45s of wait after 15s still describes it.

The window-arithmetic tests moved with the code they tested; what this repo
keeps is a test of the part that was broken, including one that a caller
cannot split its bucket by varying the hops it sends.

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

* fix(portal): give the page loaders a stable identity instead of muting the rule

Eight portal pages declared a `loadX()` that fetches the page's list, then ran
it from a `useEffect` with an empty dependency array and an
`eslint-disable-next-line react-hooks/exhaustive-deps` above the `useEffect(`
line. The directive did nothing: the rule reports on the dependency array two
lines down, so every one of these files produced BOTH an "unused
eslint-disable" warning and the exhaustive-deps warning it was meant to
silence. Sixteen warnings from eight disables that never applied.

The cause is that `loadX` was redefined on every render, so listing it as a
dependency would have refetched forever. `useCallback` fixes that at the
source: each loader is now stable over the translation function (plus the
route param where there is one), the effect depends on the loader like the
rule asks, and the disables are gone. The retry buttons already called these
same loaders and keep working.

Lint: 16 warnings → 0. `pnpm run lint` now passes with nothing to say, so the
next real warning will be visible instead of arriving in a crowd.

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

* refactor(ui): one uploaded-image component, and a no-console rule so it stays that way

Thirteen components carried their own `<img>` for user-uploaded files, each
with its own `// eslint-disable-next-line @next/next/no-img-element` above it
and none with the reason written down. Thirteen places for that reasoning to
rot and thirteen exemptions a reviewer has to re-audit independently.

They now all render `<UploadedImage>`, which holds the exemption once and
explains it: these URLs are written by the upload routes at request time
(`/uploads/…` on the box, or an `object:` URL while a preview is in flight),
so `next/image` would need the path known at build time or matched by a
configured pattern — and a missing pattern fails the whole render, not just
the picture. The optimizer has nothing to add either; the upload route already
resized the file.

The last `any` went with them: `TSignal` in `lib/i18n/signal-reason.ts` now
says `Record<string, string | number>`, which is what a reason actually
interpolates — counts, days, formatted measurements, nested translations. The
loose shape is still structural rather than next-intl's own type, because the
key is composed at runtime (`metric_${id}`) and the real literal-keyed type
rejects that by design; that reason is now in the file.

eslint-disable directives: 25 → 1 (the one inside `UploadedImage`).

And `no-console` is on, allowing `warn` and `error`. There were no stray
`console.log`s to remove — `error` is how these routes report a failure they
swallowed, and it is what `journalctl -u petvity-app` shows at 2am — so this
is the ratchet rather than a cleanup: a forgotten debug line on a server
writes a stranger's data into the journal forever. `scripts/**` is exempt,
where stdout IS the output. Verified by mutation: a planted `console.log`
fails the lint.

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

* style: wrap the two UploadedImage calls prettier wanted on four lines

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

* fix(deps): install limitkit from npm, not from git

CI refused the git-hosted form: a package fetched from a tarball has no
`dist/`, so pnpm must run its `prepare` build, and pnpm 11 will not run a
git dependency's build scripts unless the exact resolved URL is listed in
`allowBuilds`. The local install had it cached from before that rule, which is
why this was green on the laptop and red the moment CI installed from scratch.

limitkit has been published to npm since, so the fix is the npm form rather
than an allowlist entry pinned to a commit sha that has to be re-edited every
time the version moves. fleet/SHARED.md still shows the github install line;
the published tarball ships `dist/` and needs no build here.

Same version, same resolution: 0.2.0.

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 02:09:23 -07: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
CatoandClaude Fable 5 daa029e81f refactor(blog): replace the homegrown three-block parser with bip-kit (#79)
The DB blog rendered through lib/domain/blog-markup.ts — a deliberately tiny
p|h2|ul parser whose no-raw-HTML security rationale is exactly bip-kit's
typed-block model, making this a pure upgrade: parse + ArticleBody from
bip-kit v0.2.1 now render the public post page and the admin editor's live
preview (parse + readingTime), and authors instantly gain the full long-form
vocabulary (h3/h4, ol, quotes, callouts, images, tables, code, math,
footnotes, charts, embeds).

- app/longform.css maps the editorial-luxury tokens onto the --bp-* theming
  contract, class-scoped (.pv-longform dark public reader, .pv-preview light
  admin) so nothing leaks into the rest of the app
- parseLongform() degrades malformed chart/stats fences to code blocks —
  bodies are DB-authored, so a half-typed fence must never 500 a page or
  crash the editor (bip-kit's throw-on-parse targets committed content)
- JSON-LD, i18n alternates and reading time preserved; blog-markup.ts and
  its test deleted, the legacy-subset assertions ported to longform.test.ts
- word-level parity verified old-vs-new across all published post bodies


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

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-09-07 12:14:50 +00:00
f094747822 fix(nav): the sidebar highlighted the current page and never announced it (#74)
Both the desktop sidebar loop and the mobile bottom tab bar called isActive()
to paint nav-link-active / mobile-tab-item-active, and the desktop Settings
link compared pathname directly — none of the three set aria-current, so the
current page existed only for people who can see it. Zero occurrences of
aria-current anywhere in the repo.

.nav-link also came out near 41px (10px vertical padding around 14px text),
just under the 44px touch floor this repo already states explicitly on
.browse-chip. Says the floor now instead of leaving it to arithmetic.
.mobile-tab-item was already comfortably above it.

No visual change beyond the min-height.

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


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

Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-31 12:32:47 +00:00
GandClaude Opus 5 c65ac4b7d7 chore: add a formatter (#71)
* chore: add a formatter, matching the style this repo already writes

singleQuote=false was chosen by counting this repo's own
imports, not by fleet decree. The fleet is genuinely split and the two repos
that already had a .prettierrc disagreed with each other, so there was no
standard to restore. Quote style does not cross repo boundaries; having a
gate does.

Markdown is ignored for now — prettier rewraps prose, which would bury the
real diff.

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

* style: format with prettier (252 files)

Mechanical. No behaviour change. This SHA is listed in
.git-blame-ignore-revs so `git blame` skips it.

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

* chore: teach git blame to skip the reformat

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

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-29 10:05:01 +00:00
3022997214 feat(feedback): wire up the FleetCrown feedback widget (#61)
Env-gated (NEXT_PUBLIC_FC_WIDGET_TOKEN) script tag added to the root layout,
matching the pattern every new site gets from scripts/site-template. This
site predates the template and never got it. The widget is how the owner
reports what they want changed without emailing anyone — see
bitbaum/fleetcrown docs/architecture/feedback-widget.md.


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

Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-28 16:57:05 +00:00
GandClaude Opus 5 3d6ac9bed3 fix: prices were 100x wrong for zero-decimal currencies (#58)
Two real defects in the repo I can actually reach, found by auditing my own
work rather than someone else's.

formatPrice divided by 100 unconditionally. That assumes every currency has two
decimals, and several have none: with NEXT_PUBLIC_APP_CURRENCY=JPY a 2999-unit
product rendered as ¥30 instead of ¥2,999 — a hundredfold error, silently, on
every price in the shop. KRW, VND and ISK behave the same way, and KWD errs in
the other direction with three decimals. APP_CURRENCY is an environment
variable, so this was one deployment away from being real.

It now delegates to commercekit's money module, which takes the exponent from
the currency. That also removes a second money formatter from a repo that had
just adopted the first — exactly the duplication this whole exercise is about,
introduced by me.

TEMPLATE_MAP typed its payload as `any`, so the cron dispatching welcome emails
could hand a template the wrong shape and the compiler would agree — on mail
that goes to real users, built from a jsonb column nothing else validates. All
four templates take the same WelcomePayload, so the `any` bought nothing.

Typing it immediately produced an error, which turned out to be a typing gap
rather than a live bug: the cron spread `item.payload as object`, erasing the
shape, while enqueueWelcomeSequence does write { name, email }. So the emails
were correct and the types were lying about why. The cast now narrows to
WelcomePayload and the compiler can see it.

Verification: lint, tsc, css-vars, 901 tests / 87 files (8 new, including the
JPY case that would have caught the price bug).

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-16 16:07:54 +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 02d847a016 feat(commerce): extract commercekit, and adopt it here (#53)
* feat(health): track what actually matters, per species

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>

* feat(commerce): extract commercekit, and adopt it here

Three shops in the fleet: evig, petvity and fitfoot. Before proposing anything
shared I checked what is actually duplicated rather than assuming — revampit
turned out to be a second clone of evig, so it is three codebases, not four,
which is exactly the rule of three.

They have three incompatible foundations, so a single shared "webshop" adopted
by all of them would be a rewrite of two. What IS shared is narrower and is the
part every shop rewrites and gets subtly wrong. That is what this extracts.

packages/commercekit — zero runtime dependencies, framework-free core, React
bindings behind a separate entry point.

  money      Integer minor units. `12.55 * 100` is 1254.9999999999998, so
             fromDecimal works on digits. The currency carries its own exponent,
             so JPY has no decimals and KWD has three without a special case.
             allocate() is largest-remainder: splitting 100 three ways gives
             [34,33,33] and never loses or invents a unit — asserted across 200
             amounts x 5 weight patterns. percent() takes an explicit rounding
             mode, because a marketplace computing its own commission should
             round down rather than over-charge a seller.

  cart       A line is an id and a quantity. Never a price — a cart open for a
             week would otherwise show one number and charge another. Cross-tab
             sync, clamping, and corrupt storage yielding an empty cart rather
             than a crashed shop. Stable snapshot reference, which is what
             useSyncExternalStore needs to avoid an infinite render loop.

  inventory  Conditional decrement, all-or-nothing, with compensation on partial
             failure and sorted lock order so opposite carts cannot deadlock.
             Duplicate lines are merged, or the availability check for the
             second is made against stock the first already took. The test
             suite demonstrates the bug it prevents: a read-then-write adapter
             tells 50 buyers "yes" against 10 units while recorded stock falls
             by one.

  buyer      Account XOR guest as a discriminated union rather than two nullable
             columns, so an order belonging to nobody cannot be represented. A
             type is a claim, so the matching Postgres CHECK ships beside it.
             Receipt tokens use the platform CSPRNG and refuse to run without
             one.

  address    ISO-3166 codes with names from Intl.DisplayNames — every locale the
             runtime supports, no translation files, no way for the German list
             to drift from the English one.

Petvity adopts all of it, which is the proof: lib/shop/cart.ts and
lib/config/countries.ts become thin bindings, and placeOrder's hand-rolled
reservation is replaced by reserveAll over a Drizzle adapter that is the only
Petvity-specific part. Cancellation goes through releaseAll, so there is now one
implementation of giving stock back instead of two.

One behaviour change worth naming: the old code skipped the UPDATE entirely for
unlimited-stock products, so the shared db mock's default empty return was never
exercised on that path. The new adapter always issues the conditional update
(`stock IS NULL OR stock >= n`, and NULL - n stays NULL), which is correct
against a real database but made the mock read as "sold out". The mock was
modelling an UPDATE that matches nothing; two tests now say what a matching
UPDATE returns.

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

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-16 13:24:41 +00:00
GandClaude Opus 5 d5a8e13bda fix(design): one filter control, and auth screens that fit a phone (#51)
Found by rendering every public and portal page at 390px and 1440px as each
role against a local instance, rather than by reading CSS. Two of the three
findings are invisible to lint, tsc and the existing tests.

The auth layout scrolled sideways on every phone. The form column is a flex
child, so it defaults to `min-width: auto` and refuses to shrink below its
content — the 380px card plus 48px of column padding, 428px against 375px of
usable width. That is /login, /register, /forgot-password, /reset-password and
/demo: the first screen anyone ever sees. `.auth-panel` sets `min-width: 0`,
which is the whole fix.

The browse filter had drifted into three implementations of one control:
shop categories, professional types and adoption species used text-xs vs
text-sm, px-3 vs px-4, py-1.5 vs py-2, and two different idle fills
(transparent vs white) for a button a visitor reads as the same thing. They
are now one `.browse-chip` in globals.css. The type pills on /find also
overflowed a 375px viewport outright; `.browse-chip-row` scrolls instead.

Every chip was 30px tall against a 44px touch-target floor. They are 44px now,
which is the point of the shared definition — the floor is enforced in one
place instead of remembered in three.

Not changed, having checked: the "Care team" sidebar entry points at
/portal/find and is fine; /portal/pets/[id]/health rendering as HTTP -1 in the
sweep was the dev server compiling a route for the first time, not a defect.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-16 10:58:12 +00:00
GandClaude Opus 5 37b1f59ed7 feat(shop): sell to visitors who don't have an account (#50)
The public storefront was a brochure. It shipped a Product/Offer JSON-LD so
search engines treat it as purchasable, then the only buy path was
"Sign up to buy" -> /register?returnTo=/portal/shop, which both forced
registration before a first purchase and dropped the product the visitor came
for. Cold traffic could not buy anything.

A visitor can now add to cart on the catalogue and the product page, check out
in one page with an email and an address, and read their order back from a
receipt link. No account anywhere in that path.

orders.userId becomes nullable, alongside guestEmail and an unguessable
publicToken. A CHECK constraint enforces exactly one of userId / guestEmail,
because an order with no reachable buyer cannot be repaired after the fact.
The token is the guest's only handle on their order: it is emailed, never
listed, and authorises resuming payment and cancelling while pending.

Order placement moves to placeOrder() in lib/domain/orders.ts so the authed
cart and the guest checkout share one implementation -- the stock reservation
and its compensation must not exist twice. setOrderStatus() joins it for the
same reason: a cancellation that forgot to restore stock destroys inventory,
and that happens when one route remembers and another does not.

Two joins were fixed before any UI existed. app/api/orders/seller and
app/api/admin/orders inner-joined users on orders.userId; with a nullable
column that drops every guest order from the views of the people who have to
ship them -- real revenue, invisible, nothing appearing broken. Both are now
leftJoin + COALESCE onto the address the buyer typed.

Also fixed while reviewing:
- toLocale() used `value in LOCALE_CONFIG`, true for inherited keys like
  "constructor", and the result goes straight into a URL path.
- orderShippingSchema accepted any two letters as a country, so "XX" could be
  stored and printed on an undeliverable label. Checked against a new ISO-3166
  SSOT whose names come from Intl.DisplayNames, so all nine locales are
  translated with no message files to maintain.
- Guest input (shippingName, notes) reaches a seller's inbox unauthenticated;
  email templates now escape it.

Guards, not just fixes: locale parity across all nine message files is now a
test rather than a convention, and the prod walkthrough places a real guest
order and asserts the seller can see the buyer's email -- the check that goes
red if anyone reintroduces an inner join there.

The public endpoints are deliberately outside PRIVATE_API_PREFIXES; a session
guard there would silently delete the feature. They are rate limited per
client, and the payment and cancel routes require the order token.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-16 08:56:48 +00:00
GandClaude Opus 5 c2b5f392c1 fix(blog): a taken URL is a 409 the author can fix, not a 500 (#49)
Caught by exercising the live endpoint as an admin rather than trusting the
unit test: creating a second post with an existing slug answered 500.

Drizzle wraps driver errors, so the pg error carrying `code: 23505` is the
`cause` of what the route catches, not the error itself. Reading only the
top-level `code` looks correct in a test — where the error is hand-built with
the code right on it — and is wrong against a real database. The test passed
and production returned 500 for a mistake the author can fix in two seconds.

isUniqueViolation now walks the cause chain, bounded, with a guard against a
self-referencing chain hanging the request.

Both tests now use the wrapped shape production actually throws, which is the
point: the old test asserted the shape I assumed, not the shape reality
produces.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-15 13:13:11 +00:00
GandClaude Opus 5 cd591aef27 feat(blog): publish posts from the admin instead of editing code (#48)
Publishing meant editing a TypeScript array in lib/content/blog.ts, opening a
PR, and waiting for a deploy. That is not a blog anyone will actually write in —
and it made every post a developer task. There was exactly one post.

Posts now live in the database, written and published at /admin/blog. A post
goes live the moment it is published; nothing is rebuilt or redeployed.

Authoring markup is a deliberately tiny subset of Markdown:

    ## Subheading
    - bullet
    anything else is a paragraph

No Markdown dependency. A full parser would buy inline HTML we would then have
to sanitise — an XSS surface in exchange for syntax nobody asked for. Parsing
to the closed block set the post page already styles means untrusted text can
never become markup, which a test pins with a <script> tag rendering as literal
text. The editor previews the parsed blocks live, so a mistyped bullet is
visible before publishing rather than after.

Body is stored as written and parsed at render, so the author's source stays
the single truth and the renderer can improve without a data migration.

Publish dates are stamped once, on the first publish, and preserved after that.
Unpublishing to fix a typo and publishing again must not silently re-date the
post and reshuffle the index — tested in both directions.

Drafts 404 publicly rather than merely being unlisted, so guessing a slug does
not reveal unpublished writing.

The migration carries the existing post across. Its URL
(/[locale]/blog/a-platform-for-both-sides-of-pet-care) is already public, so
losing the row would 404 an indexed page; the insert is dollar-quoted for the
apostrophes and ON CONFLICT DO NOTHING so it is safe to re-run.

Deleting is a two-step inline confirm rather than a confirm() dialog: deleting a
published post breaks its URL, and a browser dialog is both easy to click
through and impossible to drive from a test.

Both public pages are force-dynamic — content that an editor changes must not be
frozen into the build.

The walkthrough now fetches a real post and asserts its prose, which exercises
the table, the content migration and the renderer together. It fetches the body
itself rather than reading $LAST_BODY, which page() never sets — asserting on it
would have grepped whatever the previous request happened to leave behind.

27 new tests; pnpm verify green (678 tests / 75 files).

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-15 14:59:57 +02:00
GandClaude Opus 5 c63436c995 feat(shop): search and sort the catalogue, on both storefronts (#47)
Browsing offered one control — a category pill. Any shopper who knew what they
wanted had to eyeball the grid for it, and there was no way to see the cheapest
option first. That is fine for six products and useless at sixty.

Public storefront (/[locale]/shop) does it server-side, as a plain GET form with
sort as links. Results are therefore a shareable, indexable URL and work with
JavaScript disabled — a storefront that only works with JS is a storefront
Google browses badly. Search matches name OR description, so someone searching
"harness" finds one whose name is a brand they don't know.

Portal shop filters in memory: the whole catalogue is already loaded there, so
round-tripping to the API to filter it would be slower and no more correct.
Results narrow as you type.

Filters compose rather than clobber. Searching and then picking a category
keeps the search — each control rewrites only its own parameter, so no
combination silently discards another. A search that finds nothing offers a way
back to the full catalogue instead of the sign-up prompt, which is the wrong
answer to "no results".

Sort ids are SSOT in lib/config/products.ts. They appear in the URL, so they
are part of the page's public contract — shared links and search engines keep
them; add ids, don't rename them. `?sort=` is attacker-controlled and indexes
an ORDER BY map, so it is narrowed to a known value before use, covered by
tests including __proto__ and constructor.

`newest` is the default and is omitted from the URL, so the canonical
/en/shop stays a clean URL rather than gaining a redundant query string.

13 tests on the config; pnpm verify green (638 tests / 72 files).

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-15 12:35:17 +00:00
GandClaude Opus 5 abb693b7f3 fix(uploads): store images with an extension so they are served with a type (#46)
Found by probing the live endpoint rather than trusting the green deploy: the
upload succeeded, the file came back at HTTP 200 with the right byte count —
and an empty Content-Type.

Caddy serves the uploads directory with `file_server`, which derives
Content-Type from the file extension. Both uploaders stored a bare UUID, so
there was nothing to derive from. Chrome sniffs the bytes and renders the image
anyway, which is exactly why this would have shipped unnoticed; sniffing is a
browser courtesy, not a guarantee, and it defeats correct caching.

Both routes now append the extension for the (already validated) image type.
The mapping is SSOT in lib/config/uploads.ts next to the type allowlist it
mirrors — the two must agree, so they live together.

Pinned with a test per accepted type, since the symptom is invisible from
inside the app: every assertion about the response passes while the header the
browser needs is missing.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-15 12:13:27 +00:00
GandClaude Opus 5 12438d36e3 feat(shop): list a product with a photo from your phone, not a URL (#45)
Listing a product required pasting an image URL, which quietly assumed the
seller already hosted the picture somewhere. Everyone who sells has photos on
their phone; nobody has a CDN. That single field is why a real listing could
not be created without leaving the product first — and prod currently has zero
products.

Both product forms (seller's /portal/my-products and /admin/products) now take
a file: pick, preview, replace, remove.

The upload endpoint is deliberately not scoped to a product id. The seller
chooses the photo while filling in the "new product" form, before a row exists;
scoping it would force create-then-upload and leave a product visibly imageless
whenever the second call failed. It returns a URL the form submits as imageUrl,
so create and edit take the identical path.

Files land in UPLOADS_DIR (/opt/petvity/uploads on the box, outside the app
directory so they survive deploys) and Caddy serves them from /uploads/*.

Also fixes a drift this would have made worse: the upload limits lived inline
in the avatar route, and its file picker offered JPEG/PNG/WebP while the API
also accepted GIF — so a GIF was rejectable by the UI and acceptable to the
API. Limits are now SSOT in lib/config/uploads.ts, used by both routes, both
pickers and the hint text, so they cannot disagree again.

/api/uploads is added to PRIVATE_API_PREFIXES — it writes files to disk and
must never be reachable without a session.

8 tests cover the endpoint: stores and returns the URL, keys uploads by
uploader, refuses anonymous callers, no file, over-cap, exactly-at-cap,
non-image type, and a storage failure reported instead of a fake success. The
size gate needed real bytes — FormData rebuilds the File from its content, so a
patched `size` property is discarded in transit and the gate would never fire.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-15 14:03:18 +02:00
GandClaude Opus 5 e409d111f5 fix(portal): the heading paints before the fetch, not after it (#41)
Found by the render checks added in #40, on their first run against prod:
/portal/pets/[id]/edit answered 200 and painted no heading at all — just a
centred "Loading…" line, no title, no way back, no indication of which pet was
about to be edited.

Same shape as the blank /portal/settings in #37, and it is the third time this
class has shipped, so this fixes the rest of it rather than the one instance.
A client page server-renders with its data still empty; a header placed inside
the loaded branch is therefore absent from the first paint entirely. Vaccinations,
medications and records all stood their heading in with grey blocks for the same
reason.

The heading on these pages does not depend on the fetch, so it now renders
immediately and only the data below it waits. Where the header's action needs
the rows (the search box and add button), that part still appears with the data
- it is the title, the purpose line and the way back that had no reason to wait.

Deliberately not changed: /portal/adopt/[id] and
/portal/pets/[id]/list-for-adoption title themselves with the fetched pet's
name. There is no honest heading to show before the fetch, so a skeleton is
correct there, and the walkthrough comment records why they are excluded rather
than leaving them looking overlooked.

The walkthrough now covers all eight statically-titled pages for both a title
and a purpose line.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-14 16:22:24 +00:00
GandClaude Opus 5 57ccd09d16 fix(portal): the last five pages open like the rest, and stop saying "All 1 pets" (#40)
The header sweep missed the nested pages. Check-in, add-pet, edit-pet, health
and health-log still hand-rolled their own <h1>, and had drifted apart exactly
the way the sweep was meant to stop: font-bold vs font-semibold, mb-1 vs mb-2
vs mb-6, three spellings of the same back link. Two of them never said what
they were for at all.

All five now use PageHeader. Add-pet and health-log already had a subtitle, so
those are structural only; check-in, edit-pet and health needed a purpose line,
added in all nine locales.

The dashboard read "All 1 pets checked in today" for anyone with one pet — the
common case for a new owner, and the first sentence the demo shows. The string
had no plural form. Now pluralised via ICU for the six languages with
grammatical number; ja/zh/ko keep a single form, which is how every other count
string in those files is already written.

While fixing it, the same sentence turned out to exist twice — checkinAllDone /
checkinProgress on the check-in page and allCheckedIn / partialCheckedIn on the
dashboard, identical in meaning and already drifted in wording ("{done} /
{total}" vs "{done} of {total}"). Fixing the plural in one would have left the
other wrong, so the pair is consolidated onto the better-worded one and the
duplicates are deleted from all nine locales.

Verified the ICU by parsing every message in every locale (13914 messages, 0
malformed) and by formatting allCheckedIn at n=1 and n=3 in all six pluralised
languages. The walkthrough now covers all five pages for both a title and a
purpose line, so "every page opens the same way" is checked rather than assumed.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-14 16:04:57 +00:00
GandClaude Opus 5 c2f86a0377 fix(demo): the shared demo keeps its identity across the reset (#38)
The demo account is the no-account way into the product. Its reset deletes
the user row so the FK graph cascades away whatever a visitor touched, then
inserts it again — but the insert let the id be generated, so every run minted
a NEW identity.

Sessions last 30 days. The reset runs every 2 hours. So within at most two
hours of signing in, a demo visitor was holding a session for a user that no
longer existed: every owner-scoped query returned nothing and the demo read as
an empty product, while writes failed the owner FK outright. Observed live —
two consecutive resets produced 8ffb17c5... then dab16518..., and a session
minted one minute before a reset was already dead.

Pinning the id keeps the cascade (still a real wipe) while letting the identity
survive it, so any session ever issued stays valid.

The demo had no test coverage at all, which is how this went unnoticed:
- a route test asserts the reseed carries the pinned id (it fails if the id
  goes back to being generated - verified by reverting the fix)
- the prod walkthrough gains a demo section: the session id is the pinned one
  (the mechanism), and the demo actually has its seeded pet (the symptom).
  The symptom check alone is timing-dependent - it passes right after a reset
  either way - so both are needed.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-14 16:43:30 +02:00
G c218456aeb fix(portal): settings paints its header instead of a blank page (#37)
/portal/settings is a client component that read the session with
useSession() and returned null for the entire page until it arrived. Server
rendering therefore produced an empty page: a person clicking Settings saw
nothing at all, with no title, no explanation, and no sign anything was
loading. It is the only portal page that did this — the others resolve the
session on the server.

The header is static, so it now renders immediately and only the account
cards wait, as two skeleton cards marked aria-busy.

A status code cannot see this failure — the page answered 200 the whole
time — so the walkthrough gains a section that asserts the header vocabulary
is actually present in the HTML of eleven portal pages, not merely that they
respond.

Also fixes the test suite double-counting itself. `next build` copies the
whole project into .next/standalone/, test files included, and vitest's
default excludes do not cover .next — so running the suite after a build
collected every test twice and the totals depended on whether you had built
first. That is where the "1220 tests / 137 files" figure in the last two PR
descriptions came from; the real suite is 614 tests across 69 files, and it
was passing under both readings. CI runs verify before build on a fresh
checkout, so it always saw the true number.

Verified: lint clean · tsc --noEmit exit 0 · 614/614 tests across 69 files.
2026-08-14 13:16:07 +02:00
G 69adbcb805 feat(portal): every page opens the same way and says what it is for (#36)
PR #34 introduced PageHeader but only nine pages used it. The other
eighteen hand-rolled their own heading markup, and the copies had drifted:
mb-8 vs mb-6, items-center vs items-start, and five variants of the same
back link (gap-1 vs gap-1.5, mb-1 vs mb-5 vs none) that all meant "go up
one level". Two admin pages skipped the heading classes entirely.

All of them now render <PageHeader>, which gains two things it needed to
absorb the stragglers:

- `back` — the "← Pet name" link above a title, now one .back-link class
  instead of eighteen lines of duplicated utilities per page.
- `flush` — drops the bottom margin where the parent already spaces its
  children. An `mb-0` utility from outside would not reliably win, because
  Tailwind resolves same-property utilities by stylesheet order rather than
  attribute order, so the choice is made inside the component.

Copy: two pages had no purpose line at all. /portal/pets showed a pet count
where a purpose belongs, and /portal/seller-profile explained itself only
while the store was new — an existing seller landed on an unexplained form.
Both now state what the page is for, in all nine locales. The dead petsCount
key is removed. Four admin pages traded vague labels ("Platform at a glance")
for sentences that say what you can do there.

Also splits .stat-value / .stat-label / .stat-caption out of .page-title.
Admin was styling numbers with the page-heading class, so restyling a page
title would have silently restyled every stat card. Tints are modifier
classes, not utilities — .stat-value is unlayered, so a text-[var(--teal)]
beside it would have been silently dead.

Verified: lint clean · tsc --noEmit exit 0 · css-vars ✓ · 1220/1220 tests
across 137 files · pnpm build succeeds.
2026-08-14 10:59:10 +00:00
GandClaude Opus 5 b8595fd86e feat(portal): the dashboard covers the whole platform, and every page says what it is for (#34)
The dashboard answered one question — how are my pets? — and left everything
else the platform does undiscovered behind the sidebar. It now also shows what
is already in motion (the next three appointments, the three most recent
orders) and a role-aware "what would you like to do?" grid: find care, shop,
adopt, and either offer your services or manage your bookings, either set up a
store or manage the one you have.

The greeting was computed from new Date().getHours() during a server render,
which is the box's UTC rather than the reader's clock — an evening visitor in
Zurich could be wished good afternoon. It is now clock-free, and the space it
occupied says what the page is for instead.

Page purpose lines, all nine locales. The worst of them was Find a Pro:
"Connect with verified veterinarians and trusted pet sitters" claimed a
verification most professionals do not have, and omitted groomers entirely
even though grooming has been a first-class vertical since #27. Six others
described what the page contained rather than what you could do on it.

PageHeader replaces the hand-rolled title/subtitle/action markup on bookings,
find, settings, shop and orders — one header instead of five near-copies.
Status badges now resolve to the semantic badge-* tones from globals.css
through a `badge` field on the status config, rather than a parallel set of
arbitrary-value Tailwind strings that happened to render the same colours.

Documented that the liveness probe is /api/healthz: /api/health is the private
prefix for health metrics and records, so it always redirects to /login and can
never report healthy — the runbook pointed at a path that could not work.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-14 01:49:49 +00:00
GandClaude Opus 5 42bcc47ff4 feat(marketplace): real onboarding replaces fake profiles; orders become shippable (#33)
Three things made the marketplace a demo rather than a business.

1. Orders had no delivery address. A seller could receive an order and have
   nowhere to send it. Orders now carry a required address (migration 0004,
   additive); the API rejects an order without one, and both the seller and
   admin order views expose it so fulfilment is actually possible.

2. The directory was populated by five invented businesses. Dr. Brunner,
   Sam Keller, Nadia Roth, Pfoten & Co. and Tierheim Sonnenhof do not exist —
   a customer in Zurich searching for a groomer would have found a fiction.
   They are removed from lib/config/resident-pet.ts, and ensureCommunity is
   gone from the resident-checkin cron so nothing recreates them.

3. Nothing replaced them. lib/domain/profile-readiness.ts is now the single
   rule for when a professional or seller is real enough to be listed:
   identity, services, price, location, a 40-character intro, contact, and
   the pro's own "accepting clients" switch. The same predicate drives the
   ProfileReadiness checklist the pro sees and the SQL conditions the public
   directory queries use — so the listing is earned, never hand-curated.

Selling was already open to any account (products.sellerId = userId) but was
undiscoverable; /portal/become-a-pro now says so and links to the store setup,
which shows the seller's own readiness checklist including "list your first
product".

Also: deleting a pet was reachable only by guessing it lived inside the edit
form — the pet profile now links straight to the danger zone. Professionals
could not accept a booking from /portal/bookings, and groomers were missing
from the booking role union entirely.

E2E gains two checks: an order without an address must be rejected, and the
seller must be able to see where to ship.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-14 01:10:42 +00:00
GandClaude Fable 5 4883c8eae2 feat(platform): public directory, blog, 6-item sidebar, portal design vocabulary (#32)
The two-sided answer. 'How do I find a groomer in Zürich?' had no
logged-out answer — the directory lived behind auth. Now /find is a
public, SEO-indexed directory (vets/sitters/groomers tabs, city filter,
ItemList schema, review aggregates, links to public profiles) with a
provider CTA; the megamenu pros pillar and footer point at it.

'If I'm a groomer, how do I find customers?' — your profile IS your
storefront, and the new blog post documents the whole two-sided
proposition honestly (/blog, content SSOT in lib/content/blog.ts,
BlogPosting schema; no invented claims, resident accounts disclosed).

Portal navigation: six entries, no section labels needed — Care, Shop,
and Adopt are hubs whose sibling pages became segmented tabs (HubTabs;
same URLs). Seller/pro upsells moved out of daily nav into a Grow card
in Settings; active sellers get one 'My Store' entry.

Portal design vocabulary (the missing discipline): .page-title/.page-sub,
.badge + tones, .icon-tile(-lg), .modal-overlay/.modal-panel, .hub-tabs —
71 hand-built repetitions of these patterns replaced across portal+admin.

verify + build green; /find (incl. groomers/Zürich), blog, and post pages
render-verified locally.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 21:37:58 +00:00
GandClaude Fable 5 2a46bced71 fix(orders): cancelled orders restore stock; sellers can delete their account (#29)
Found by an exhaustive 129-check production walkthrough of every user path:

1. Cancelling an order never released the stock it reserved at creation —
   every cancellation permanently destroyed inventory. Cancellation (user
   or admin) now restores stock for finite-stock items, guarded against
   double-restore.

2. A seller who had ever sold anything could not delete their account
   (GDPR erasure 500'd): order_items.product_id was ON DELETE RESTRICT.
   Order items now snapshot the product NAME at purchase time (they
   already snapshot price), product_id is nullable ON DELETE SET NULL,
   and all order reads use the snapshot — the buyer's order history
   survives the seller's erasure intact. Migration backfills existing
   rows from the products table.

verify + build green.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 17:37:14 +00:00
GandClaude Fable 5 8a4b4fe58b fix(honesty): remove every fabricated trust signal — nothing on the site lies (#28)
- Homepage: the invented testimonials ('Sarah M.', 'James T.', 'Amara O.'
  with fake 5-star rows) are gone, replaced by a section that is TRUE and
  verifiable in one click: Milo and Rosie's live public profiles, tracked
  daily in the open
- Seller CTA no longer claims 'thousands of pet owners'
- Resident professionals (Dr. Brunner, Sam Keller, Nadia Roth) keep their
  seeded profiles (per policy: profiles OK for testing) but lose the
  unearned Verified badges and ALL fabricated bookings + 5-star reviews;
  the cron no longer seeds reviews at all — ratings now only ever come
  from real completed bookings
- Prod data surgery accompanies this deploy (fake reviews/bookings deleted,
  residents de-verified)

verify + build green; homepage section browser-verified.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 16:17:34 +00:00
GandClaude Fable 5 300fe1cdc2 feat(groomers): grooming as a first-class professional vertical (#27)
Groomer joins vet and sitter everywhere a professional exists:
- user_role enum + groomer_profiles (salon, services, from-price) + migration
- /api/groomers browse + /api/groomers/me CRUD; role plumbed through
  registration (?role=groomer), become-a-pro, availability, bookings,
  conflict guard, admin verification, dashboards, sidebar
- Find a Pro gains a Groomers tab; booking modal books grooming as a
  one-hour session with the salon's from-price in the header
- Public pro profile renders groomers (salon, services, starting price)
- Resident groomer Nadia Roth / Salon Pfotenschick seeds via the daily
  cron with a completed booking + 5-star review, so the tab ships alive
- 6 grooming services in the professionals SSOT; role badge tokens in
  globals.css; ~25 strings x 9 locales

Verified end-to-end locally: register groomer -> profile -> visible in
browse -> booked 201 -> overlap 409. verify + build green.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 15:36:56 +00:00
GandClaude Fable 5 763d55daea feat(ux): humane booking flow, self-serve pro upgrade, role-aware dashboard (#26)
* chore: nudge CI (pull_request event was never delivered)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat(ux): humane booking flow, self-serve pro upgrade, role-aware dashboard

Booking modal rebuilt around how people actually book:
- Sitter: drop-off/pick-up dates (no datetime-local minute-picking), live
  'N nights × rate = total' before any commitment
- Vet: one date + tap-a-time-slot chips (1h appointments)
- Availability surfaced BEFORE submit: busy ranges fetched from the new
  /api/bookings/busy (privacy-safe date ranges), clashing dates disable the
  button with a plain-words warning instead of a post-submit 409
- One pet -> stated, not asked; request-not-final explainer under the CTA

True multi-tenancy path: existing owners can now become professionals —
/portal/become-a-pro (sidebar 'Offer your services') POSTs the new
/api/account/role (pet_owner -> vet/sitter only, trust-first like
registration), session refreshes in place via the update trigger.

Dashboard attention strip now spans every role: pending booking requests
(pros) and open orders (sellers) join adoption applications and vaccines.

24 new strings x 9 locales. verify green (1212 tests), build green,
modal + clash state + sidebar verified in the browser.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 14:49:13 +00:00
GandClaude Fable 5 bb5615c0fa feat(bookings,shop): calendar conflict blocking + Stripe payment integration (#25)
* feat(bookings,shop): calendar conflict blocking + Stripe payment integration

Tier-1 scheduling: the booking API now rejects (409) any request that
overlaps a professional's active bookings or their self-declared blocked
dates; vets/sitters manage blocked ranges at /portal/professional-profile
(new professional_blocked_dates table + /api/availability CRUD).

Payments: full Stripe Checkout flow, env-gated like Resend — without
STRIPE_SECRET_KEY nothing changes; with it, checkout redirects to Stripe,
the signed webhook (/api/payments/webhook) marks orders paid, and unpaid
orders stay payable from /portal/orders (Pay now + paid/awaiting badges).
orders gains paid_at + checkout_session_id.

Critical bug found by the smoke test: the login JWT callback wrote
resolveRole(email) back to the DB, silently DEMOTING every vet/sitter to
pet_owner at their next sign-in (residents were safe only because they
never log in). ADMIN_EMAILS now only promotes; professional roles survive.

Verified end-to-end locally: sitter registers → blocks dates → owner
booking overlap 409, blocked-dates 409, disjoint 201; checkout w/o keys
falls back to recorded orders. verify green (1209 tests incl. 12 new).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* chore: nudge CI (pull_request event was never delivered)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 13:49:47 +00:00
GandClaude Fable 5 d2fcae9824 feat(shop): branded category art — no product ever renders as a placeholder box (#24)
New ProductArt component: uploaded photo when present, otherwise a per-category
line illustration in the brand palette (CSS-var driven, re-themes with
globals.css). Wired into every product surface: portal shop grid + cart drawer,
public shop grid + product detail, buyer/seller/admin order items, seller
product list. Order APIs now expose productCategory for the fallback.

Also: public shop hero title was invisible — .ed-title is platinum-on-dark
marketing typography and PR #22 placed it on the light cream hero; now matches
the adopt page's ink title (surfaces stay unmixed per AGENTS.md).

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 12:27:10 +00:00
GandClaude Fable 5 9beac50989 fix(ui): kill dead ps-* overrides on form inputs; deterministic price/date formatting (#23)
* fix(ui): form-input-icon semantic class ends dead ps-* overrides; deterministic en formatting defaults

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* docs(agents): utilities cannot override unlayered semantic classes — use modifier classes

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* chore: drop stray audit screenshots

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 11:58:14 +00:00
GandClaude Fable 5 68991544ed fix(auth): config-driven auth surface, dead-token repair, css-var CI gate (#22)
PR #20 removed the editorial tokens (--gold*, --cream*, .section-warm-dark,
.section-cream) but only reskinned the marketing pages — all 6 (auth) pages
and 4 (public) pages still referenced them and rendered with unresolved
var() styling. Repaired and hardened:

- (auth) layout: brand panel re-expressed on the obsidian/champagne surface
  (the same language visitors arrive from), form panel on the light product
  surface; all 6 auth pages now use only live tokens
- (public) shop/adopt/pets/pros pages swept to live tokens
- New verify gate scripts/ci/check-css-vars.mjs: any var(--x) referenced in
  app/, components/, lib/ that globals.css doesn't define fails the build —
  this class of regression can't ship again (2nd occurrence; never-twice)
- DRY/SSOT: .form-label replaces 86 identical label-class repeats across 19
  files; .link-accent replaces repeated link styling; register role labels
  derive from USER_ROLE_CONFIG; password hint derives from
  PASSWORD_MIN_LENGTH; POST_LOGIN_PATH centralized in lib/config/auth.ts
  (login, demo, proxy, email templates); Terms/Privacy now link to the
  actual legal pages
- Settings: display-name field no longer renders empty when the session
  loads after mount (profile editing bug found in browser testing)
- Root layout <html> now carries dir="ltr" — fixes the hydration attribute
  mismatch with the [locale] layout's dir
- .gitignore no longer hides scripts/ (verify depends on scripts/ci/)

Browser-verified on desktop (1280px) and mobile (390px): login (credentials
+ demo), registration end-to-end, forgot/reset password, profile edit save,
sign-out, marketing nav megamenu + mobile drawer, footer, portal sidebar +
bottom tabs. verify green: lint + typecheck + css-gate + 1181 tests; build
green.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 13:01:04 +02:00
GandClaude Fable 5 acabbdf4f4 feat(resident): full resident ecosystem — every user type represented with living data (#21)
Rosie the Beagle joins Milo as a second daily-tracked resident pet (28-day
deterministic backfill on bootstrap so charts start alive), and the same
cron now idempotently seeds one of every user type: a verified vet and
sitter (Find-a-Pro), a seller with a stocked 7-product shop, a rescue with
an adoption listing, and completed bookings with 5-star reviews so ratings
render on pro profiles. Check-in generation is parametrized per pet
(CheckinProfile) with Milo's series continuing unchanged (salt 0).

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-11 16:38:06 +00:00
GandClaude Fable 5 0cdd565cd3 feat(design): obsidian luxury marketing surface — platinum/champagne on near-black (#20)
Reskin the entire marketing surface (homepage, features, about, pricing,
pros, species guides, nav, footer, OG image) in a luxury-futurist dark
design language: obsidian ground, onyx cards with hairline borders,
warm platinum text, champagne-gold accent, Jost 200 display face and
IBM Plex Mono instrument labels.

- globals.css: new obsidian token layer + .lux-* / .ed-* / .btn-editorial*
  semantic classes (aurora hero, staggered reduced-motion-safe entrance)
- lib/fonts.ts: new fonts SSOT (Plus Jakarta Sans / Jost / IBM Plex Mono)
  applied to BOTH html-rendering layouts — also fixes the pre-existing
  hydration className mismatch on /[locale] pages
- MarketingNav: always-solid obsidian bar (works over dark marketing and
  light legal pages); LocaleSwitcher gains a tone="dark" variant
- design-tokens.ts synced; OG image redrawn on the obsidian palette
- Portal/admin product UI intentionally untouched (light teal/terracotta);
  AGENTS.md documents the two-surface rule

verify green: lint + typecheck + 1174 tests; build green; visually
verified via headless screenshots (desktop/mobile, home/pricing/legal).

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-11 16:26:43 +00:00
GandClaude Fable 5 226a775196 feat(resident): Milo — a real pet tracked for real, one day at a time (#19)
The demo account is wiped and reseeded daily, so nothing on it ever
truly ages. Milo is the opposite: a persistent resident cat whose
morning check-in is logged by a daily cron exactly the way a real
owner would — one row per day, accumulating genuine history. Charts
lengthen, trends emerge, vaccination due-dates actually approach,
and roughly every eleventh day is an anxious one (vacuum day), so
the wellness signal earns the occasional honest 'watch'.

Values are date-seeded and deterministic (re-running a day yields the
same row; the year-long series stays inside cat normal ranges — tested
across 365 generated days). The route bootstraps the account (no
password: machine-only), pet, vaccinations, and first vet record on
first run, then is a one-row-per-day idempotent logger.

Publicly watchable at /pets/milo.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 22:31:50 +00:00
GandClaude Fable 5 087735c31f design(public): carry the editorial brand across every public product surface (#18)
The marketing pages moved to the petvity.com editorial language
(cream/gold/Cormorant) but every surface a visitor crosses next still
wore teal-SaaS chrome: the auth shell's teal brand panel, the public
pet profile's teal band, the public shop, the pro profile, and the
adopt page's teal filter pills. A visitor walked from an editorial
brand into a different-looking product at the exact moment of signup.

Now editorial end-to-end: warm-dark auth brand panel with gold accents
and serif display copy, serif card headings, gold link accents; pet and
pro profiles with warm-dark bands, gold-light avatars, serif names;
shop and adopt with warm-ink filter pills, ed-icon chips, serif heroes,
warm-dark CTA bands. Semantic colors (health greens, warnings, role
badges, stars, prices) untouched; the portal keeps its teal product
accents by design.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 22:13:35 +00:00