Updates

Product updates

A changelog of shipped work.

# Changelog

## Unreleased

### Added

- **Footer marketing pages** (#33): `/privacy`, `/llms`, `/startup-program` with
  `TopNavbar` + prose layout; footer links wired from placeholders; `llms.txt`
  served from `lib/marketing/llms-content.ts` via `app/llms.txt/route.ts`;
  routes added to `proxy.ts` public allowlist and `app/sitemap.ts`.

### Changed

- **shadcn/ui Radix → Base UI migration** (`chore/shadcn-base-ui-migration`): all
  installed primitives now use `@base-ui/react`; `components.json` `base` set to
  `base`; mechanical `asChild` → `render` at call sites. Custom semantic tokens
  (void, carbon, mist, brand, etc.) preserved. Per-component reports in
  `.migration/`.
- Migrated components: `button`, `badge`, `breadcrumb`, `avatar`, `collapsible`,
  `scroll-area`, `tooltip`, `hover-card`, `dialog`, `dropdown-menu`, `select`.
- Removed all `@radix-ui/*` and `radix-ui` packages; added
  `hooks/use-controllable-state.ts` for `reasoning.tsx`.
- **Public-beta dependency sweep** (`chore/latest-deps-beta`): converged on
  registry-latest for the full stack after prior major migrations on main
  (AI SDK 7, Streamdown 2.5, Undici 8, Ultracite/Biome 7.9/2.5, nanoid 6,
  tailwind-merge 3, dotenv 17, shaders 0.0.77).
- **Dev toolchain:** TypeScript 6.0.3 → 7.0.2; `@types/node` ^20 → ^22.20.1
  (Node 22+ runtime per ARCHITECTURE.md, not `@types/node@26`). Restored in
  #42 after an accidental `^5.9.3` downgrade in #34.
- **Next.js:** 16.2.10 → 16.3.0-canary.86 with
  `experimental.useTypeScriptCli: true` so `next build` typechecks via the
  project-local `tsc` (TypeScript 7 has no JS compiler API). #42.
- **AI SDK patches:** `ai` 7.0.27 → 7.0.28; `@ai-sdk/openai` 4.0.14 → 4.0.15
  (#41).
- **Runtime patches:** `@radix-ui/react-slot` 1.3.0,
  `@radix-ui/react-use-controllable-state` 1.2.3, class-variance-authority
  0.7.1, postgres 3.4.9, swr 2.4.2, zod 4.4.3, use-stick-to-bottom 1.1.6,
  tw-animate-css 1.4.0, Tailwind CSS 4.3.2, `@types/react` 19.2.17.
- Normalized caret pins on react/biome/ultracite/shaders for semver-range
  consistency. Kept `react-syntax-highlighter` (CodeBlock in tool UI, not
  covered by Streamdown markdown path). Next is pinned exact on the canary
  that ships `useTypeScriptCli`.

### Validation

- `bun outdated`: clean except intentional pins below.
- Frozen `bun install` lockfile matches `package.json`.
- Project static gate (Biome, TypeScript 7 `tsc --noEmit`, konsistent), 515+
  Bun tests; `next build --turbopack` reports `useTypeScriptCli` (#42).

### Intentional pins

- `@types/node@^22`. Node 22 LTS runtime (ARCHITECTURE + deploy). Do not jump
  to `@types/node@26`.
- `esbuild-wasm@0.25.12` (exact). Browser preview. Stay until a dedicated
  0.28 soak (package + `ESBUILD_WASM_VERSION` unpkg URL must move together).
- `next@16.3.0-canary.86` (exact). Required for TypeScript 7 build typecheck
  via `experimental.useTypeScriptCli`. Revisit when the flag lands on stable.

## [0.4.0] — 2026-07-12

**Brand fidelity engine** — on-brand by construction, verified on every render
through persistent context, locked starter files, and a verification loop.

### Added

- **System-prompt brand constraints**: the compiled brand preamble is the
  chat-level `system` prompt (persists across every follow-up — no drift-by-
  dilution). Pattern spec stays the message. `lib/prompt-compiler.ts` v6 with
  round-1+2 gate learnings encoded (content-sized buttons, no mono numerals,
  no extra sections, approved-copy tone, pinned muted-UI neutrals and
  secondary-action colors, no emoji incl. programmatic construction,
  follow-up scope).
- **Brand starter (locked token files)**: every brand render chat is seeded
  via `chats.init` with locked `brand/tokens.css` (CSS custom properties from
  the derived slots) + `brand/BRAND.md` usage rules — spike-verified to
  survive generation and forks. Silent fallback to plain `createChat` keeps
  renders unbreakable. `lib/brand-starter.ts`.
- **Fidelity verification loop**: `lib/fidelity/` linter (palette, hues,
  gradients, button-scoped rounded-full, fonts, emoji — scaffold/starter
  files excluded) + `POST /api/chats/[chatId]/verify` (idempotent per
  version) + ONE bounded corrective follow-up on hard violations, persisted
  as `renders.fidelity_score`/`fidelity_report`; `autofix` usage events at
  0¢ outside all caps. Visible chat UI: "Checking against your brand…" →
  pass / fixed / violations + "Brand {score}" header badge.
- **Logo extraction**: header/nav wordmark → apple-touch-icon → logo.dev
  fallback (`brand_profiles.logo_url/logo_source`, manual override in
  /brands); the compiler instructs real-logo usage (`<img>`) or text
  wordmark — never placeholders.
- **Weak-extraction review gate**: `<3 colors or no fonts` flags the profile;
  the first render is gated on a review dialog until confirmed
  (`weak_signal`/`reviewed_at`).
- Gate harness: `scripts/gate-round-2.ts` (live 3-pattern gate + drift test,
  budget-guarded) + `scripts/gate-relint.ts` (re-judge live chats free).

### Changed

- Render cache key now hashes compiled content (system + message + starter
  files + versions) — editing a brand's tokens/tone, a pattern template, or
  the starter busts the cache (fixes silently-stale renders).
- Pure-HTML export inlines `brand/tokens.css` (head injection + fallback).
- Fake codegen provider is brand-aware: locked seeds retained across
  versions/forks, `FAKE_DRIFT` marker for the smoke autofix scenario.

### Validation

- Fidelity verification: 3/3 first-shots at linter score 100; the follow-up
  drift test remained at 100 with one autofix exercised; the in-app
  end-to-end render completed with `status: pass`, score 100.
- 203 bun tests (82 added this cycle), smoke 25/25 scenarios + 38/38 routes.

## [0.3.0 and untagged follow-ups]

Public marketing surface expansion (shipped as 0.3.0, followed by the
untagged ideas-library port and PLG content build on `main`).

### Added

- Marketing navigation + content pages: dropdown nav (Product, Solutions,
  Use cases, Growth Ideas, Compare, Resources) plus content routes `/blog`,
  `/customers`, `/help`, `/updates` (renders this file). Driven by
  `lib/public-nav.ts` (`components/shared/top-navbar.tsx` via a shared
  `PublicNavDropdown`, `components/shared/mobile-menu.tsx`). `/blog` and
  `/customers` are placeholders.
- Comparison pages: `/compare/[slug]` + `/compare` hub. Content in
  `lib/compare.ts`.
- Solutions pages (12): `/solutions/[slug]` + hub — curated pattern clusters
  by stage, use case, and job-to-be-done. Content in `lib/solutions.ts`.
- Use-case pages (7): `/use-cases/[slug]` + hub — persona and scenario pages.
  Content in `lib/use-cases.ts`.
- Shared marketing infra: `lib/pattern-cluster.ts` (cluster predicate +
  `selectClusterPatterns`), `components/marketing/cluster-page.tsx` (shared
  renderer for solutions + use-cases), `components/marketing/marketing-cta.tsx`.

### Changed

- `proxy.ts`: `/compare`, `/solutions`, `/use-cases` added to the
  unauthenticated public-route allowlist.
- `components/shared/site-footer.tsx`: data-driven Solutions, Use cases, and
  Compare columns generated from the content files.

### Fixed

- `lib/public-nav.ts`: removed dead `item.href === "/"` comparisons in
  `isPublicFeaturePath`/`isPublicResourcesPath` (no nav item is the home path)
  that made `tsc --noEmit` — and therefore `bun run check` — fail. Gate is
  green again; behavior unchanged.

### Validation

- `bun run check` green — biome (233 files), `tsc --noEmit`, konsistent
  (32 files), `bun test` (86 pass, 21 files).
- Route verification: all 31 detail routes + 3 hubs return 200, unknown slugs
  404, clusters populated, per-page metadata + canonicals set.

## 2026-07-08

### Added

- Evidence source domain badge component backed by Logo.dev (`components/patterns/evidence-source-link.tsx`, `lib/logo-dev.ts`).
- `img.logo.dev` allowed in `next/image` remote patterns (`next.config.ts`).

### Changed

- Simplified `/patterns/[slug]` page layout to remove redundant bordered boxes.
- Tightened ideas gallery filter pill padding and font size.

## 2026-07-07

### Added

- Added render usage accounting and plan-aware gating in `lib/db/schema.ts`:
  - `renders` cache + `render_usage_events` for classification (`included`, `extra`, `cached`).
  - `cost_estimate` and `exported_html` persistence for ledger + export auditability.
- Added `CodegenProvider` abstraction in `lib/codegen/provider.ts` and migrated generation, follow-up, and visibility callsites to it.
- Added pure-HTML export endpoint in `app/api/chats/[chatId]/export/route.ts` with deterministic fallback behavior in `lib/export/pure-html.ts`.
- Added brand slot override editor persistence and render-time wiring:
  - `slot_overrides` storage in `brand_profiles`, compiler wiring in `lib/prompt-compiler.ts`, and brands UI edits in `/brands`.
- Added render cache key hardening in `lib/render-cache.ts`:
  - key now includes sorted slot-overrides fingerprint and `userId`.

### Fixed

- Render cache behavior now avoids stale-equivalent reruns when the same brand/pattern/prompt/slot combination is requested by the same user.
- Export ledger updates now track export source and generation usage cost consistently.

### Changed

- Branch metadata and release-facing docs now reflect completed 0.2 technical milestones.
- Added stronger documentation alignment for current production path in README/TODOS/CLAUDE/ARCHITECTURE.

### Validation

- `bun x ultracite check`
- `bun test`
- Browser smoke verification across public and authenticated app routes (marketing, ideas, canvas, brands, chats).

## 2026-07-03

- Initial application hardening milestones through `app-sidebar`, `patterns`,
  `brand_profiles`, compiler, and canvas flow were completed.