# Changelog Changes that matter for projects built on ipal-kit. How to move to a new version: the **ipal-upgrade** skill and [PROGRAMISTA.md §6](./dev/PROGRAMISTA.md). We keep at least the **20 most recent versions** here. When you upgrade a project by several versions at once, go through every "Requires project changes" section in order, starting from the version you have. A new release = a new section at the top; we remove the oldest ones only once there are more than 20. ## 1.13.0 Security and performance fixes from an audit, SEO/GEO and Search Console features, a seed helper, and English docs. Every new default can be turned off or overridden — AGENT.md §7.1 lists each one with its switch. ### Security and access - **Staff features follow roles through one rule, `userMeetsRole(req, minimum)`** (exported). With `access` (a `roles` field), the role decides. **Without `access`, every logged-in account passes** — see "What projects must update". Used by Site Integrations, the settings globals, the test e-mail endpoint, stats, consent records, forms and form submissions. - **Plugin globals:** Site Settings, Cookie Settings and Notifications are written by editor+ only, Site Integrations by admins only. Before, any logged-in account (a plain `user`) could rewrite the brand, homepage or construction mode. Override: `ipalKit({ globalOverrides: { : { access, admin, hooks } } })`, where an object merges key by key and a function `(global) => global` takes over (`applyGlobalOverrides`). - **Forms:** forms are created, edited and deleted by editor+, and the Emails tab (recipients, BCC) is readable by editor+ only, so a plain `user` can no longer BCC every submission to itself. Override: `forms.formOverrides.access` / `.fields` (the protected fields reach your `fields` function, so you can change the rule). - **Injected `users` collection** (with `access`): create, delete and unlock are admin-only; read and update are admin or self. Override: `access.authAccess` (your keys win). Your own auth collection still wins whole. - **First account = admin:** the account made on Payload's "create first user" screen becomes admin; an open sign-up on an empty collection still gets `defaultRole`. Turn off: `access.firstUserAdmin: false`. - **2FA** targets `admin.user`. A `twoFactor.collectionSlug` that is not an auth collection, or differs from `admin.user`, stops startup with a clear error. Override: `twoFactor.allowCollectionMismatch: true`. - **Rate limit:** requests without a client IP share one `unknown-ip` bucket at 20× the limit (before: no limit). `setUnknownIpFactor(n)`, `UNKNOWN_IP_FACTOR`; `setUnknownIpFactor(0)` only with a limiter in front. - **Turnstile hostname check** (opt-in): `createSubmitAction({ turnstileHostnames })`, `verifyTurnstile({ hostnames })`. - **`RenderRichText` neutralises unsafe link URLs** (`javascript:` and similar → `#`). Off: `safeLinks={false}` (fully trusted content only). - **Consent Mode `'basic'`** (opt-in): `` sends nothing to Google until analytics or marketing consent. Default stays `'advanced'`. The rule is exported: `shouldLoadGoogle` (root and `/client`). - **Construction mode** now also hides pages from the Markdown mirror, MCP and search (`isPathVisible`, `isPathVisibleIn`, `pathOf`, type `PathVisibility`). Opt out per route: `markdown: { isPathVisible: () => true }`, `mcp: { isPathVisible: () => true }`. - Old-slug redirects skip never-published drafts (`resolveRedirect({ draft: true })` to include them). MCP rejects non-object messages (-32600). The locale cookie honours consent saved under a bumped policy version (`createProxy(config, { policyVersion })`). - **`enabled: false` keeps the plugin's schema** (collections, globals, fields) and drops only endpoints, `onInit` and admin components. Before, it dropped the collections and globals, so a Postgres `migrate:create` would drop their tables. - **Collection overrides for consent records and stats:** `consentLog.collectionOverrides`, `stats.collectionOverrides` (object merges `access` / `admin` / `hooks`, function takes over; `applyCollectionOverride`, type `CollectionOverride`). The stats view and dashboard chart follow the `stats-visits` read access, so an override narrows the panel too. ### Performance - **`getSettings` / `getSiteShell` read Site Settings at `depth: 1`** (was 2, which pulled every assigned page's blocks and media on every request). The archive page is re-fetched at page depth. Override: `createContentHelpers({ settingsDepth: 2 })`. - Stats and consent-log retention purges run off the request, as one `deleteMany`. - `isPathVisible` reads construction mode once per list. Global saves can revalidate the layout: `ipalKit({ revalidatePath })` (opt-in), `buildGlobalRevalidateHook` for your own globals; skip once with `context: { disableRevalidate: true }`. - Hooks run Local API calls with `req` (same transaction); cross-locale sync restores `req.locale`. - Server entries no longer load `'use client'` modules. ### SEO, GEO and Search Console - **Site Settings → Search & AI tab:** search-engine verification codes (Google, Bing, Yandex → `` via `generatePageMetadata`), AI crawler policy and rules (→ robots.txt via `getRobots`), localized `llmsIntro` (→ top of `/llms.txt`). Empty fields change nothing. Off: top-level `searchSettings: false` (works without `seo`; `seo.searchSettings` still works, the top-level option wins). Your own fields: `searchSettings: (fields) => fields`. Building blocks: `verificationFrom`, `robotsOptionsFrom`, `AI_ASSISTANT_BOTS`, `AI_TRAINING_BOTS`. - **`getRobots`** in `createContentHelpers`: `app/robots.ts` → `export { getRobots as default } from '@/lib/content'`. - **Sitemap index** above 10 000 URLs (`/sitemap.xml?part=N`), CDN cache headers and an in-memory memo, documents read in batches of 500. `sitemapOptions: { maxUrls, cacheControl, memoSeconds }`, `sitemapEntries`, `createSitemapRouteHandler`, `buildSitemapIndexXml`. - **Sitemap errors are errors:** at runtime `sitemapRoute` answers 503 with `Retry-After` and `sitemap()` throws (before: an empty 200 / `[]`, which told Google the site had no pages). The build phase still falls back. - Construction mode filters the sitemap and llms.txt. Off: `underConstructionSeo: false`. - Unknown-route metadata is `noindex`. `collectSiteIndex` no longer caps at 1000 entries (MCP keeps `limit: 1000`). - `seo.uploadsCollection` (default `'media'`) — the upload collection `meta.image` relates to. - DNS verification is the default path for Search Console; `ipal-seo-check` reports a missing verification tag as INFO only, and follows the sitemap index. ### Seeding — `@intecion/ipal-kit/seed` (new entry) - **`createSeeder(payload, options)`** → `upsertBySlug`, `upsertBy`, `fillGlobal`, `summary()`. Dry run, update vs skip of entries edited in the panel, production guard (refuses non-local databases and `NODE_ENV=production` unless allowed), seed context that skips revalidation and IndexNow. Reads the same env vars as the old templates (`SEED_DRY_RUN` / `--dry-run`, `SEED_UPDATE`, `SEED_FORCE`, `IPAL_SEED_ALLOW_PROD_UPDATE`, `SEED_LOCAL_HOSTS`, `SEED_DB_URL_ENV`, `SEED_UNTOUCHED_SECONDS`, `SEED_HASH_FIELD`). `guard: false` turns the guard off. - Building blocks: `isLocalDatabase`, `writeLocales`, `seedHash`, `projectOnto`, `editedSinceSeed`. - The `ipal-site` and `ipal-form` seed templates are now thin scripts over the helper. - IndexNow skips writes with `context.ipalSkipIndexNow`. ### Documentation and agent guide - All docs, the agent guide (`docs/agent/AGENT.md`) and the `ipal-*` skills are in English. - The agent guide covers every export, option, env var, route, middleware, layout component, import-map entry and hook a project wires, with steps to verify. New: §7.1 "Newer defaults — turn off / override", a seeding guide, Coolify deployment (env, migrations, seeding, backups), a DNS records checklist. - `CLAUDE.md` states the plugin's two rules: the plugin helps projects and never limits them; an agent that adds the plugin gets the complete guide. ### Small and gap fixes - `ipalEnvRules({ storage: true })`: `R2_PUBLIC_URL` is optional; `storage: { requirePublicUrl: true }` requires it. - `forms.consentFieldName` now works: `submitForm` reads it from the `ipalKit` options. - Top-level `searchSettings` option, public `shouldLoadGoogle`, collection overrides for `consent-records` and `stats-visits` (see above). ### What projects must update 1. **Behaviour change — projects without `access`:** every logged-in account can now use the plugin's admin and editor features: Site Integrations, the settings globals, the test e-mail endpoint, stats, consent records, forms and form submissions. Before, nobody could through the API. If the project lets untrusted people log in (open sign-up, customer accounts), add `access` (roles), or narrow each feature with `globalOverrides`, `forms.formOverrides` / `forms.formSubmissionOverrides`, `consentLog.collectionOverrides`, `stats.collectionOverrides`. 2. **Projects with `access`:** accounts with the plain `user` role can no longer edit Site Settings, Cookie Settings, Notifications or forms, or create and delete users. Give staff accounts `editor` or `admin`, or loosen with `globalOverrides`, `forms.formOverrides.access`, `access.authAccess`. 3. **Postgres/SQLite: `payload migrate:create` → `migrate`** (Site Settings → Search & AI: `search_verification_*`, `ai_crawlers_policy`, the `ai_crawlers_rules` table, localized `llms_intro`). With `enabled: false`, the migration now keeps (or restores) the plugin's tables. MongoDB: no changes. 4. `pnpm payload generate:importmap`, `pnpm ipal:skills`. 5. Check: - code that reads a relation of a relation from `getSettings` / `getSiteShell` → `settingsDepth: 2`; - a hand-written `sitemap()` caller that relied on `[]` on errors (it throws now); - `twoFactor.collectionSlug` other than `admin.user` (stops startup → `allowCollectionMismatch: true`); - rate limits behind a proxy that hides the client IP (`setUnknownIpFactor`); - rich text with deliberately unusual link schemes (`safeLinks`). 6. Review the new options and defaults: `consentMode` (`'basic'` for "zero tags before consent"), `revalidatePath`, `turnstileHostnames`, the Search & AI tab (fill in verification codes or keep DNS verification), `app/robots.ts` → `getRobots`, `createSearchRoute({ isPathVisible })`, `access.firstUserAdmin`. 7. Remove workarounds: a plugin after `ipalKit` that adds hooks or access to the plugin globals → `globalOverrides` / `revalidatePath`; a hand-written global revalidation hook → `buildGlobalRevalidateHook`; your own seed guard and upsert code → `@intecion/ipal-kit/seed`. ## 1.12.3 ### New - **Large cookie settings window with details** — ``. Each category is a card with a switch (on/off), a description and an expandable list of the cookies it covers (name, provider, purpose, duration) — from **Cookie Settings → Cookies**. The developer picks the mode: `'inline'` (default, unchanged), `'modal'`, `'detailed'`. New group in the **Cookie Settings → Detail labels** global (list labels, per language; empty → English). `ConsentTexts` has optional `cookies` and `details` (filled by `getConsentTexts`). New `classNames` slots: `categoryCard`, `cookies`, `cookiesToggle`, `cookieList`, `cookie`, `cookieName`, `cookieMeta`. consent.md → "Large window with details". ### Documentation - consent.md: comparison of the three `settings` modes, which one to pick (brief says nothing → `detailed` when the Cookies list is filled in), new fields in the table of panel texts, slots and `data-ipal` hooks. - AGENT.md (§0b item 12, §7, compliance), PROGRAMISTA §2.8 / §2.11 / §6 item 46, skills `ipal-setup`, `ipal-site`, `ipal-upgrade`, `ipal-locale-add` (Detail labels and Cookies in every language), `ipal-consent-check` (the import also feeds the `detailed` window — check it after the import). ### Requires project changes 1. Postgres/SQLite: new fields in the Cookie Settings global → `payload migrate:create`. MongoDB: no changes. 2. Optional: ``, fill in Cookie Settings → Cookies (scan: `ipal-consent-check` → cookie-scan) and Detail labels in every language. ## 1.12.2 ### Fixes - **Empty admin panel in production because of the import map from dev.** `buildR2Storage` without `R2_*` returned a no-op, so `pnpm dev` / `generate:importmap` without R2 wrote `importMap.js` without `S3ClientUploadHandler`; the project committed it, and the production panel (with R2) rendered a blank page with no console error. Now the adapter is always registered (without R2 as `enabled: false`, media still on disk) — the import map is identical in every environment. `ipal-audit`: ERROR "import map without the R2 upload handler". - **Cookie Settings — the "Zapisz" text is no longer lost after 1.11.1 (MongoDB).** The first save of the global removed the old `buttons.save` and the button fell back to "Save preferences" in all languages. On startup the plugin copies `buttons.save` → `buttons.savePreferences` (all languages) when the new field is missing. `getConsentTexts` read the old field as text, but Mongo returns it as a `{ pl, en }` map (the field is not in the schema) — the banner could show "[object Object]". - `ipal-audit`: a multi-line `"exclude"` in tsconfig is no longer reported; `a11y`, `i18n`, `l10n` are not "numbered fields"; it catches links `` `${prefix}/${slug}` `` and page paths hard-coded in code (`` `${prefix}/kontakt` ``); message "panel text in Polish — admin labels/descriptions are English" (was the misleading "panel is English"). ### New - **Read-only media:** `R2_PUBLIC_URL` alone (absolute, outside production) → file URLs from the media domain, upload and delete blocked (403). Local dev on the production database without bucket keys. `ipalEnvRules` in dev then does not require the rest of `R2_*`. storage.md → "Behavior". - **`context: { ipalSkipAutoFill: true }`** (`SKIP_AUTO_FILL`) — save without auto-filling meta and `aiSummary`. For data migrations and scripts that must save only what they set. seo.md. - **`createPageRoute` redirects the home page from its slug** (`/pl/home` → 308 `/pl`). Turn off: `homeAlias: false`. Remove your own redirect from `page.tsx`. pages.md. ### Documentation - i18n.md: `fallback: true` persists default-language text into empty fields of other languages on save — the consequences and how to write scripts. - PROGRAMISTA §1: `pnpm up --latest @intecion/ipal-kit` (plain `pnpm up` will not go past the exact version); 401 on the public registry = old token in `~/.npmrc`. ### Requires project changes 1. `pnpm up --latest @intecion/ipal-kit`, then `pnpm payload generate:importmap` and check that `importMap.js` has `@payloadcms/storage-s3/client#S3ClientUploadHandler` (project with `buildR2Storage`). Commit it. 2. Your own redirect of the home page from its slug (e.g. in `render` with `buildLocalizedPath`) — remove it, `createPageRoute` does this now. 3. Optional: local dev on the production database → only `R2_PUBLIC_URL` in `.env` instead of R2 keys. ## 1.12.1 ### New - **A description for every page from its content** — auto-fill fills an empty `meta.description` from the page's blocks (`layout` → paragraphs without headings, whole sentences up to ~155 characters) when `autoFill.description` yields nothing. Before, a page without a description got `siteDescription` — the same on every page, so Google ignored it and quoted the footer. `autoFill: { content: 'blocks' | false, descriptionLength }`. A description typed by hand is never overwritten. - **``** (`/rsc`, `/client`) — `data-nosnippet` on `div`/`section`/`span`. For the footer, contact bar, repeated CTA: Google stops showing the address and opening hours from the footer as the description of subpages. `CookieBanner` and `LanguageSwitcher` have `data-nosnippet` themselves. Details: seo.md → "Descriptions in Google". - **Hint under the description in the SEO tab** (`MetaDescriptionCheck`) — description empty, identical to `siteDescription`, or identical to another document in the collection. Does not block saving. `seo.descriptionCheck: { settingsSlug, siteDescriptionField }` or `false`. - **ipal-seo-check** — warnings: duplicated meta description, footer without `data-nosnippet`. - **Statistics in the panel** — `ipalKit({ stats: true })` + `` (or `` from `/client`). The `/admin/stats` view: daily visits over 30 days, pages, entries, sources, devices; chart on the dashboard. No cookies and no IP stored — **no consent required** (hash with a salt rotated daily). Visitors with *analytics* consent (the same as GA4) get the `ipal_vid` cookie and a multi-day history; the server checks the consent cookie itself. Collection `stats-visits`, 90-day retention. Details + privacy policy text: stats.md. - `@payloadcms/next` in peerDependencies (the `/admin/stats` view uses its `DefaultTemplate`; every Payload+Next project already has it). ### Fixes - **Auto-fill on a partial save** — `payload.update` / REST PATCH without the `meta` group no longer treats the saved title as empty (it reads it from the document). ### Requires project changes 1. `pnpm payload generate:importmap` — new panel component `@intecion/ipal-kit/admin#MetaDescriptionCheck`. 2. Footer: content in `` inside `