# Primate Intelligence API — Changelog

Sorted newest-first. Agent-readable summary of shipped changes, broken by date.
Full field contracts: [openapi.json](./openapi.json) · [agents.md](./agents.md)

---

## 2026-08-14 — Design Partner Agreements admin: status dropdown, delete, signed-PDF link

### Added
- `PATCH /v1/admin/design-partner-agreements/:id` — set `status` to
  `sent`, `paid`, `terminated`, or `completed` from the admin table
  (manual states not produced by the automated click-to-sign/pay flow).
- `DELETE /v1/admin/design-partner-agreements/:id` — deletes the row and
  removes its signed PDF from the private `design-partner-agreements`
  Storage bucket (best-effort on the Storage side; the DB delete is
  authoritative).
- `GET /v1/admin/design-partner-agreements/:id/pdf` — mints a 5-minute
  signed Storage URL for the signed PDF; 404 if the agreement was never
  signed (no `pdf_url`).
- Migration: widened the `design_partner_agreements.status` CHECK
  constraint to include `terminated` and `completed`.
- Admin UI: status pull-down (styled as the existing status badge),
  delete icon with a confirm dialog, and a document icon linking to the
  signed PDF for each agreement row.

## 2026-08-14 — Design Partner Agreement: $500 token default, public-reference opt-out, legal fixes

### Changed
- Default token payment corrected to $500 (was ~$10K) when `priceUsd` is
  omitted on create; admin can still override per-agreement.
- New `public_reference_opt_out` column + end-to-end plumbing: partner can
  decline PUBLIC use of name/logo/quote; PRIVATE investor-facing reference
  is always retained regardless (non-negotiable), asserted unconditionally
  in Section 10.
- Section 10 states the default scope of work explicitly (API access at
  no additional charge beyond the token fee, founder feedback line, case
  study conditioned on not opting out of public reference).

### Fixed
- PDF design-review bugs: mid-sentence page-break split, orphaned section
  heading across pages (keep-with-next), Section 6 survival list missing
  9/10, Section 8 liability floor lower than the $500 fee (now
  greater-of), Section 1 scope-card figures marked non-binding.

## 2026-08-14 — PRI-586: exempt /llms.txt, /llms-full.txt, /docs from dev password gate

### Fixed
- `/llms.txt`, `/llms-full.txt`, and `/docs/*` are now exempt from the dev
  Basic-auth password gate. These are meant to be publicly fetchable
  everywhere per the llmstxt.org convention (PRI-104/PRI-487) — CI (Docs
  code samples / Sample matrix workflows) and external agents/LLMs
  following the documented discovery flow hit them unauthenticated.
  Gating them behind Basic-auth 401'd the served corpus, failing both
  checks on every dev push and blocking Railway's GitHub-integration
  auto-deploy for dev (forcing manual Railway-API deploys as a
  workaround).

## 2026-08-13 — Design Partner Agreement: scope fields + branded PDF + admin dev-gate exemption

### New
- Three new optional agreement fields wired end-to-end: `valueOfSolving`,
  `scopeOfWork`, `estimatedCostToDeliver` — accepted on admin create,
  returned on admin list/detail and the public by-token view, interpolated
  into the canonical terms text (and therefore `doc_content_hash`).
- Agreement PDF redesigned as a branded marketing-style document: Darwin
  logo + wordmark header, signal-blue accent band, "Scope of this Pilot"
  summary card, styled signature block. Terms text remains the verbatim
  hashed string (tamper evidence unchanged).

### Fixed
- Share links now use `APP_BASE_URL` (the React app host) instead of
  `FRONTEND_URL` (the marketing site, which has no /design-partner route —
  404 on prod host, edge password gate on dev). This was the remaining half
  of the blocked click-through flow on dev.
- `/v1/admin/design-partner-agreements` added to `DEV_GATE_EXEMPT_PREFIXES`
  — admin create/list calls from the Admin UI 401'd behind the dev
  Basic-auth gate (they're already Bearer-JWT + ADMIN_EMAILS gated).

## 2026-08-13 — Fix dev password gate 500ing every non-Basic-auth request

- The dev preview gate's `WWW-Authenticate` header value contained an
  em-dash (non-Latin1 byte), which crashes Node's header serialization
  (`ERR_INVALID_CHAR`) on every request that doesn't already carry Basic
  auth — including Bearer-JWT admin API calls. Found testing the Design
  Partner Agreement admin routes; replaced with a plain hyphen.

## 2026-08-13 — Design Partner Agreement public routes exempted from dev password gate

- `/v1/design-partner-agreements` added to `DEV_GATE_EXEMPT_PREFIXES` (dev
  only) — the public by-token get/sign/create-checkout-session routes have
  no auth by design and were 401ing behind the dev Basic-auth gate.

## 2026-08-13 — Design Partner Agreement click-to-sign / click-to-pay

- Replaces the DocuSign-based Design Partner Agreement flow. Admin-only
  `POST/GET /v1/admin/design-partner-agreements` (+`/:id` detail) create and
  list shareable agreement links. Public, token-gated (no auth):
  `GET /v1/design-partner-agreements/by-token/:token`,
  `POST .../sign` (captures signer name/title/IP/UA, hashes the canonical
  terms text, generates + emails a signed PDF), and
  `POST .../create-checkout-session` (Stripe Checkout for priced pilots).
  The Stripe webhook's `checkout.session.completed` handler now marks a
  matching agreement `paid`. New `design_partner_agreements` table +
  private `design-partner-agreements` Storage bucket.

## 2026-08-10 — Changelog reset ahead of launch

- This changelog now tracks **public product releases only** — API, SDK, and web-app changes that affect the published contract. Release notes will appear here as they ship. For the current API contract, see [openapi.json](./openapi.json) and [agents.md](./agents.md).
