Compare commits

..
574 Commits
Author SHA1 Message Date
Radosław SmolińskiandClaude Opus 5.5 fc70a34f3e 1.17.1 notes: the sending method (PROGRAMISTA 82, the upgrade skill's item number, one stray bold mark)
CI / check (push) Failing after 6m56s
CI / reference (push) Skipped
CI / reference-full (push) Skipped
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 23:27:59 +01:00
Radosław SmolińskiandClaude Opus 5.5 344b84f9fc Merge claude/mail-transport-choice: "Sending method" is an explicit choice in the panel (IWSN, own SMTP, Graph); nothing changes until another option is picked
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 23:27:36 +01:00
Radosław SmolińskiandClaude Fable 5.2 dc3e594d38 Sending method, the owner's answers: nothing changes until another option is picked; the panel warns before the save
- a save that sends the method already shown, while nothing is stored, stores nothing: the site keeps sending
  exactly as before and keeps following what is filled in, until somebody picks ANOTHER option
- the state block reads the form as it is edited and warns at once when "Own SMTP server" is picked with server,
  user name or password empty, or "Microsoft Graph" on a server without GRAPH_* (graphReady in the panel state);
  it reloads after every save
- texts, doctor's info finding, docs, skills, changelog; reference e2e checks the warning

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-26 23:15:42 +01:00
Radosław SmolińskiandClaude Fable 5.2 8c19391590 Sending method, review M-1 and M-2: the plugin's own status write never stores a choice; a non-method is refused
- M-1: the save rule of `emailMethod` ran after the early return for the plugin's status writes, so the first
  failed (or recovered) send stored the method the read showed as if an admin had chosen it. The rule is now a
  hook of its own that runs on every write: a write that does not name the method leaves what is stored, empty
  included.
- M-2: a sent value that is not null or one of the three methods (a number, a list, another word) is refused
  with a ValidationError (400) before it reaches the database.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-26 23:08:34 +01:00
Radosław SmolińskiandClaude Fable 5.2 f2da28e7cb Reference site: generated types with the field emailMethod
Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-26 22:48:42 +01:00
Radosław SmolińskiandClaude Fable 5.2 ee8ea42956 E-mail: "Sending method" is an explicit choice - IWSN (built-in), Own SMTP server, Microsoft Graph (deprecated)
What is chosen is what is used. The choice is the stored field `emailMethod` of Site integrations (empty until
somebody chooses); `emailTransport` of 1.6 - 1.17.0 stays, hidden.

- no silent switch: a chosen method that cannot be used (SMTP incomplete, Graph without GRAPH_*) fails loudly
  - status smtp-incomplete / graph-not-set-up, state block, doctor mail-method - and nothing is sent another way
- upgrade writes nothing and loses no mail: until somebody chooses, the order of 1.17.0 applies and the field
  shows its result as selected; the first save of the panel's form stores the choice
- only the chosen method's fields are shown; the test e-mail names the method (Graph too)
- mail: { relay: false } does not offer "IWSN" (the stored values stay three: one SQL enum for every project)
- Postgres / SQLite: one migration (a column). Before it runs the plugin's readers read the global without the
  field, mail goes the old way, one loud log line and the doctor say what to do
- getMailMethod, setMailMethod, resolveMailMethod, readMailSettings, mailMethodColumnMissing exported
- tests on SQLite, Postgres and MongoDB, with and without the migration; docs, AGENT.md, skills, changelog

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-26 22:39:03 +01:00
Radosław SmolińskiandClaude Fable 5.2 c6841a1674 WIP: sending method as an explicit choice, kept in payload-kv (superseded: the choice moves to a stored field)
Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-26 22:30:03 +01:00
Radosław SmolińskiandClaude Opus 5.5 726f028e9f 1.17.1 notes: the sign-in logo as 1.17.0 shows it (an SVG too, no plate)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 22:27:17 +01:00
Radosław SmolińskiandClaude Opus 5.5 1f65e1c97f Merge claude/login-page-whitelabel-616f3d: the sign-in logo as 1.17.0's login screen shows it (SVG as an image, no plate)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 22:26:57 +01:00
Radosław SmolińskiandClaude Fable 5.2 24ccc5dc8b Sign-in look: the logo is handled as the white label handled it in 1.17.0 (owner, 2026-11-26)
A logo that showed on a site's login screen shows on the new screens: any picture Site settings holds,
an SVG included, as <img>; svgLogo: false refuses SVG (off by default); the list of allowed types is
gone. The look at the file only avoids a broken picture: a file that is gone (404 / 410) or is no picture
gives the name; anything else (no answer, a redirect, another status, over 512 KB) believes the upload.
Redirects are still never followed by the server, and the body is read with the 512 KB cap. A test
checks twelve kinds of logo that 1.17.0 shows. No plate stays the default. Docs, skills, changelog draft.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-26 22:14:50 +01:00
Radosław SmolińskiandClaude Opus 5.5 68a2555277 1.17.1 upgrade notes
PROGRAMISTA §6 rows 79 (security: strict switches, write-only secrets out of queries), 80 (the sign-in look),
81 (the proxy matcher); iapl-upgrade "→ 1.17.1, security" and item numbers; reference skills, AGENTS.md and the
reference index on 1.17.1.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 22:05:42 +01:00
Radosław SmolińskiandClaude Opus 5.5 38f1c012c4 1.17.1
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 22:05:42 +01:00
Radosław SmolińskiandClaude Opus 5.5 99073e24e9 routes.snapshot.json: admin-language in sorted place
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 22:04:35 +01:00
Radosław SmolińskiandClaude Opus 5.5 7159ec25de Merge claude/login-page-whitelabel-616f3d: the panel's sign-in look (whiteLabel.signIn), the client's logo, hardened brand image fetch
Conflicts kept both sides: the 2FA texts (twoFactorBusy from A, twoFactorCodeDigit here), the reference index rows,
and the e2e:built line (closed doors from C and the sign-in look here). routes.snapshot.json judges the new public
GET /api/ipal/admin-language.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 22:04:30 +01:00
Radosław SmolińskiandClaude Fable 5.2 aef1efac73 Public brand image fetch: the site's configured origin only, no redirect followed, a time and a byte limit
/api/ipal/admin-og resolved a relative logo address against the request's own host and fetched it with
Node's defaults (redirects followed, no timeout, no size cap); /api/ipal/admin-icon resolved the same way.
Both now resolve against serverURL / NEXT_PUBLIC_SERVER_URL (never the request) and fetch through
fetchPublicImage, which asks one address with redirect: 'manual' (a 3xx is no image), within
PUBLIC_IMAGE_TIMEOUT_MS, reading at most 512 KB. The renderer still draws PNG, JPEG, GIF (by their bytes)
and SVG (by its type, as before). Tests against local servers: hostile Host / X-Forwarded-Host, a 302 to an
internal host, an endless body, a hanging server, the normal logo. Docs say 1.17.1 instead of 1.18.0.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-26 22:03:52 +01:00
Radosław SmolińskiandClaude Fable 5.2 562bf5388d Sign-in look: the logo check never follows a redirect; the review pictures stay out of the package
checkLogoFile asks only the address the upload has (redirect: 'manual'); a redirecting logo counts as
unknown, so the server fetches nothing at an internal address. docs/dev/login-page/*.png is excluded
in package.json files (npm pack --dry-run: none of them packed).

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-26 21:44:39 +01:00
Radosław SmolińskiandClaude Opus 5.5 7026254c25 Reference skills: copies synced after the security B merge
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 21:43:05 +01:00
Radosław SmolińskiandClaude Opus 5.5 df9f2f3de3 Merge claude/security-b-content-state-cc308e: sizes before work, one link rule, no stand-in locale, strict switches, write-only secrets cannot be queried
AGENT.md conflict: the 2FA rows from A, the stored-secrets row from B (its check answers 400 QueryError, not 403).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 21:43:03 +01:00
Radosław SmolińskiandClaude Opus 5.5 12bb6be76e Reference skills: copies synced after the security A and C merges
Branch A changed docs/agent/skills without its reference copies; iapl-doctor's skills-current warned on the reference
site.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 21:20:35 +01:00
Radosław SmolińskiandClaude Opus 5.5 eb2ad27787 Write-only secrets cannot be queried (review B-R1)
A where or sort on a write-only field answered by the stored value: as an admin,
where[version.smtpPassword][like]=Zq on Site integrations' versions gave a count, so the
secret could be read back one character at a time. writeOnlySecret now gives the field a
read rule, secretReadAccess (exported), that denies when Payload checks a query's fields
(no document) and allows a document read (masked as before). The panel's edit and create
views pass the document, so the field stays visible and editable there.

Covered: the global, its versions, a collection with and without versions, REST and
GraphQL, like / equals / exists / or / sort / count; reads still masked; panel
permissions; a save still stores the new value.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 21:10:45 +01:00
Radosław SmolińskiandClaude Opus 5.5 dd8cc5ecbd Merge claude/security-c-files-jobs-tests-cfba70: resolved paths in the bins and starter, proxy matcher ends at /, closed doors on the built site, every public route judged
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 20:57:50 +01:00
Radosław SmolińskiandClaude Opus 5.5 675d0c1997 Merge claude/security-a-signin-limits-80f95e: 2FA verify limit counts wrong codes only, exempt by an admin-only field, 2FA reset only from the site's own origin
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 20:57:45 +01:00
Radosław SmolińskiandClaude Fable 5.2 939ab679c7 Sign-in look: the logo follows IAWL's rules; no plate by default; the brand fields are admin-only
Bitmaps only (JPEG, PNG, WebP, AVIF, GIF; SVG with svgLogo: true), the file fetched and checked by its
bytes before it is printed (checkLogo; 512 KB; ten-minute memory; an unreachable address is believed),
served from a generated size at least twice the shown width. logoPlate replaces logoMadeFor: no plate
unless asked. With the look on, the name, logo and icon of Site settings are changed by admins only
(brandAccess: 'editor' gives them back). Docs, skills, changelog draft, tests and pictures follow.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-26 20:52:41 +01:00
Radosław SmolińskiandClaude Fable 5.2 3ceeab8469 Sign-in look: screenshots (before, after, an unedited 1.16.7 site, IAWL for comparison) and the capture script
Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-26 20:39:27 +01:00
Radosław SmolińskiandClaude Fable 5.2 b6c91a3a11 Sign-in look: the client's logo or the site's name on a dark panel beside the form (whiteLabel.signIn)
On by default with whiteLabel. The login screen and the 2FA screens get the look through AdminLogo and
SafeTotpView, which every site already has in its import map: an upgrade needs no edit. allScreens adds one
provider (SignInLook) for forgot / reset password, first user and logout; a production start leaves it out
when the import map on disk lacks it. Logo and name come from Site settings: no new field, no migration.
Language links through GET /api/ipal/admin-language (Payload's own cookie, back to an admin path only).
Options: accent, logoMadeFor, languages, svgLogo; whiteLabel.brandAccess 'admin'. The 2FA code boxes get
names for screen readers. Reference site and starter: allScreens on. Docs, agent guide, skills, tests.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-26 20:35:33 +01:00
Radosław SmolińskiandClaude Opus 5.5 8f443c9214 Lint: the new route inventory, its tests and the touched tests
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 20:33:04 +01:00
Radosław SmolińskiandClaude Opus 5.5 d4fe3bf4ba Agent reference: the route-check exports; reference index: the closed-doors and route-check files
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 20:29:47 +01:00
Radosław SmolińskiandClaude Opus 5.5 2468390538 Outside-in tests (IAWL ideas 33, 34): closed doors on the built site as anonymous, customer and editor; every public route judged
- reference/e2e/closed-doors.ts + closed-doors.spec.ts: one table of doors, asked by pnpm e2e:built in both bundlers;
  doors still open while the owner decides are asserted open (test.fail) with their question
- listPublicRoutes / listNextRouteFiles / compareRouteSnapshot / updateRouteSnapshot (main entry), runRouteCheck (/doctor)
- reference/e2e/routes.ts + routes.snapshot.json (395 routes, one reason each); pnpm routes:check [--update], first step of e2e:built
- create-test-admin.ts makes an editor test account
- docs: security.md sections, AGENT.md 8a, iapl-audit templates, iapl-upgrade 1.17.1, changelog draft

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 20:26:30 +01:00
Radosław SmolińskiandClaude Opus 5.5 ecf03c8dc0 IAWL ideas, group B: sizes before work, one link rule, no stand-in locale, strict switches
- Request bodies from strangers are read only up to a cap, declared length or not:
  mail-service confirm, CSP reports, page views, MCP (maxBytes, 413). readCappedBody moves
  to shared/ (the consent log keeps exporting it).
- searchContent / createSearchRoute / MCP search: queryLimit (default 200 characters,
  10 words) before the database; an unknown ?locale is the default locale throughout.
- Rich text: autolinks and links marked internal pass safeHref too; lexicalToMarkdown
  drops unsafe link targets.
- truncate() never returns more than its limit (summary / meta autofill after validation).
- resolveRoute answers null for a locale the site does not have (xx, all, *): no
  default-locale page under another code (page route past the proxy, /md/xx, MCP).
- A 404 page that is a draft is not shown (resolveNotFoundPage, getNotFoundPage).
- readPublished() access rule (exported); Site integrations readVersions: admin.
- Plugin switches, buildCsp, buildSecurityHeaders and the seed guard refuse nonsense
  values at start; an unknown role name is met by nobody, requireRole throws on one.
- Docs, AGENT.md, iapl-collection and iapl-audit skills.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 20:25:26 +01:00
Radosław SmolińskiandClaude Opus 5.5 b2fed3bf90 Turnstile docs: limit before asking Cloudflare; test and lint fixes
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 20:22:21 +01:00
Radosław SmolińskiandClaude Opus 5.5 6ca0730c08 2FA reset endpoint: only from the site's own origin (twoFactor.sameOrigin)
POST /api/ipal/two-factor/reset reads a text/plain body, which another
origin can send without a CORS preflight; a sibling subdomain is same-site,
so the browser sends the admin's SameSite=Lax cookie, and Payload's csrf
list is empty without serverURL. Such a page could reset any account's
TOTP and end its sessions (reproduced on SQLite, Postgres, MongoDB). Now the
endpoint takes the same origin rule as verify and setup, before it reads
or changes anything; twoFactor.sameOrigin: false leaves it out, and
buildTwoFactorResetEndpoint takes ownOrigin for own wiring.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 20:18:57 +01:00
Radosław SmolińskiandClaude Opus 5.5 91770ec17f 2FA verify limit: a right code gives its place back; exempt by an admin-only field, not e-mail (docs)
The verify limit took a place for every attempt and kept it, so the sixth
correct login of one account within 10 minutes was refused (IAWL idea 27).
Now an attempt takes its place before the compare (a parallel burst still
cannot slip under the limit), a right code gives it back, an attempt refused
without a compare gives it back at once, and a new attempt held out only by
attempts still being checked gets 429 + Retry-After: 2 "try again in a
moment". buildVerifyLimit returns limit.settle(req, correct); the plugin's
guard calls it with the package's answer. No schema change: payload-kv keeps
{ count, resetAt }.

Docs: the exempt example keyed on e-mail, which every account may change
itself (shown over REST and GraphQL): now an admin-only checkbox, with a test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 20:15:51 +01:00
Radosław SmolińskiandClaude Opus 5.5 498b3dbf38 Files and paths (IAWL ideas 12, 13, 36): resolved --dest, starter refuses links and escaping paths, Office ZIP entries with trailing dots, proxy matcher ends api/admin/_next at /
- iapl-skills: --dest is compared with the project root after resolving links; a folder that is the root or holds it (.., /) is refused
- starter: collectBundle refuses symbolic links (their target would ship in the published bundle); writeFiles refuses absolute or escaping paths
- form files: a program inside a DOCX/XLSX is found with trailing dots or spaces (Windows drops them)
- proxy matcher: (?!(?:api|admin|_next)(?:/|$)|...) so /administracja, /apis get the proxy; doctor rule proxy-matcher reports the old literal
- pnpm: @swc/core in ignoredBuiltDependencies (its postinstall only checks the native binary, already installed)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 20:14:59 +01:00
Radosław SmolińskiandClaude Opus 5.5 e821d52d19 CLAUDE.md: the plugin is called IAPL (iapl-* skills, iapl-skills)
CI / check (push) Failing after 7m26s
CI / reference (push) Skipped
CI / reference-full (push) Skipped
Both rules keep their meaning word for word; only the names change. Not part of the npm package.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 14:45:26 +01:00
Radosław SmolińskiandClaude Opus 5.5 d97d571de7 1.17.0 release notes: consent
The box says "a doctor warning" for consent-log-migration (decided after the review); the reference copies of the
iapl-upgrade and iapl-reference skills re-synced from docs/agent/skills.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 14:19:50 +01:00
Radosław SmolińskiandClaude Opus 5.5 9fa886ce62 Merge claude/consent-compliance-build: Global Privacy Control honoured, equal choice by default, withdrawal that stops running tools, consent log on by default
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 14:19:35 +01:00
Radosław SmolińskiandClaude Opus 5.5 963464d6cb Consent log endpoint: body capped at 4 KiB (413), version bounded by the policy version; consent-log-migration a warning
Review C-1: the endpoint, on on every site, parsed a 20 MB body. It now refuses a content-length over
CONSENT_LOG_MAX_BYTES (4096) before reading and reads the stream only up to the cap (readCappedBody), so a missing or
false length cannot make it hold more. A version above Cookie settings' policy version is 400 (the cached version is
read again once, for an editor's fresh raise); versions from 1 up are accepted (pages rendered before a raise).
Review C-2: consent-log-migration is a warning, like every consent check of 1.17.0 (the owner's decision).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 14:10:44 +01:00
Radosław SmolińskiandClaude Opus 5.5 9a448ba5df Consent log upgrade test: key order (lint)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 14:00:35 +01:00
Radosław SmolińskiandClaude Opus 5.5 c6a276823c Consent log: missing-table line once per Payload instance; SQL upgrade proof on Postgres and SQLite
test/consentLogUpgrade.test.ts: a site without the log (migrations applied) upgraded to 1.17.0 — without a migration
the site works and a consent write answers 503 with one log line; migrate:create adds only consent_records (and the
lock-relation column) and writes succeed. SQLite always; Postgres with IAPL_TEST_PG_URL. Docs say exactly what the
migration creates.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 13:51:52 +01:00
Radosław SmolińskiandClaude Opus 5.5 f5c53e4523 Consent compliance: docs, agent guide, skills, changelog, shared behaviour spec, browser check, reference e2e
- docs/consent.md: compliance defaults, Global Privacy Control, withdrawal, consent log on by default and the SQL
  migration; no more "UODO requirement" or "GPC not needed". docs/analytics.md: what Consent Mode advanced sends.
- docs/consent-behaviour-spec.md: the behaviour IAPL and IAWL share, with the 13-item test list.
- CHANGELOG 1.17.0: the SQL migration first, a before → after table for an existing site.
- AGENT.md, iapl-setup / iapl-upgrade / iapl-reference / iapl-consent-check, PROGRAMISTA item 78; reference skills copy.
- iapl-consent-check: Global Privacy Control, equal prominence and withdrawal runs; Google asset warnings.
- Reference site uses the new defaults; e2e for GPC, a stale grant, equal prominence, withdrawal; e2e:built runs every
  consent test in both bundlers. YouTubeEmbed warns in development without a poster.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 13:48:19 +01:00
Radosław SmolińskiandClaude Opus 5.5 99036eb70c Consent compliance: Global Privacy Control honoured, equal choice by default, withdrawal that stops running tools, consent log on by default
- GPC (gpc.ts): read in the browser before the first paint (consentBannerScript) and in the consent store; pages stay
  static. 'honour' (default): no banner, analytics and marketing off, no request to Google or a pixel; an explicit
  choice on the site wins; a grant made without the signal gives way when it appears. 'ask' and false as opt-outs.
- equalChoice defaults to true; a development warning when the banner has no 'reject'.
- Withdrawal: Meta / TikTok / Clarity told at once, listed localStorage / sessionStorage keys removed.
- Clarity gets consentv2 when it loads; ads_data_redaction with the Consent Mode default.
- consentLog on by default (consentLog: false turns it off); SiteProviders posts to it by itself; a missing SQL table
  answers 503 with one log line.
- Default banner text: one sentence on changing the choice and browser settings; the GPC line (PL / EN).
- Doctor: consent-log-migration, consent-banner rules.
- Stats: Sec-GPC over a choice made without it keeps the visitor id out.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 13:38:39 +01:00
Radosław SmolińskiandClaude Fable 5.2 41771fd51a Consent compliance proposal: the banner against the rules, Global Privacy Control, defaults the plugin enforces, the spec shared with IAWL
Design only, no code. First cut for 1.17.0 needs no schema change; eight yes-or-no decisions for the owner.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-26 13:25:34 +01:00
Radosław SmolińskiandClaude Opus 5.5 9520e61b15 1.17.0 release notes: the speed of public pages
The "Read before upgrading" box names the two changes merged after 2f6a81a: the cookie banner painted with the
page (nothing to do) and Payload's colour-scheme client hints for the admin only (one line in next.config.ts).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 12:56:42 +01:00
Radosław SmolińskiandClaude Opus 5.5 80e202111c Merge claude/consent-banner-first-paint-154f9f: the cookie banner is part of the first render
Conflicts in the docs only, both sides kept: changelog lines, AGENT.md checklist rows 12 (banner) and 13 (wrapper order),
the two iapl-upgrade blocks, PROGRAMISTA rows 76 (client hints) and 77 (banner, renumbered from 76).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 12:56:20 +01:00
Radosław SmolińskiandClaude Opus 5.5 6dd552f721 Merge claude/admin-only-theme-headers-f19f9f: Payload's colour-scheme client hints go to the admin only
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 12:45:22 +01:00
Radosław SmolińskiandClaude Fable 5.2 177620da57 Cookie banner is part of the first render: in the server HTML, decided before the first paint; pages stay static
Until now CookieBanner rendered nothing until the page had hydrated and an effect had read the cookie, so on a first
visit it appeared late and became the LCP element on text pages (request from a client project, 2026-11-26).

- The banner is rendered on the server with `hidden`, followed by one inline script (consentBannerScript) that,
  before the browser paints, shows it (no current decision) or keeps it hidden (current decision). It decides as
  readConsentRecord does. A click on a banner button before hydration is kept and carried out once the page is live.
- The decision is read through a store (useSyncExternalStore): no hydration mismatch, the browser's value before
  the next paint. One decision per document.
- Optional server read (ConsentProvider cookieValue, SiteProviders consentCookie): exact HTML, dynamic pages.
- CookieBanner firstPaint={false} keeps the old behaviour; nonce from SiteProviders / ConsentProvider / the prop.
- Nothing about consent changes: no tag earlier, Consent Mode default first, cookie, consent log, withdrawal.

Tests: test/consentFirstPaint.test.ts (server render, script against readConsentRecord, hydration with no warning,
decisions, tags), reference e2e (static HTML, painted before hydration, returning visitor, early click).
Docs: consent.md "First paint", frontend.md, security.md, AGENT.md, skills, changelog draft under 1.17.0.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-26 12:08:59 +01:00
Radosław SmolińskiandClaude Fable 5.2 9143c132a3 Payload's colour-scheme client hints go to the admin only: withSecurityConfig outside withPayload
withPayload adds Accept-CH, Critical-CH and Vary: Sec-CH-Prefers-Color-Scheme for /:path*; Critical-CH makes
Chrome repeat the first document request of a visit to a public page. As the outer wrapper, withSecurityConfig
moves the three headers to /admin/:path* (adminClientHints: { route, sources } | false). Inside withPayload
nothing changes, so an unedited site behaves as before. Exports scopeColorSchemeClientHints,
adminClientHintSources, COLOR_SCHEME_CLIENT_HINT; doctor rule client-hints (info); reference site and starter
use the new order; e2e:built and the starter gate check it.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-26 11:55:26 +01:00
Radosław SmolińskiandClaude Opus 5.5 2f6a81acbf 1.17.0 upgrade notes
Changelog: one 1.17.0 entry, the security follow-ups prepared as 1.16.8 first, then e-mail, the name, Postgres;
the mail service is live with enrolment "pending". PROGRAMISTA §6 rows 71 (renamed), 74 and 75; iapl-upgrade
"→ 1.17.0, security"; iapl-setup, iapl-debug, email.md, deployment.md: a new site waits for approval while the
service runs with "pending". Reference skills, AGENTS.md and the reference index on 1.17.0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 11:09:53 +01:00
Radosław SmolińskiandClaude Opus 5.5 3bfe377f1b 1.17.0
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 11:09:00 +01:00
Radosław SmolińskiandClaude Opus 5.5 536e219f57 Merge claude/mail-relay-dev-hosts: development hosts by pattern with no env, built in *.dev.netscale.pl
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 11:08:15 +01:00
Radosław SmolińskiandClaude Fable 5.2 6c4e244094 Development hosts, review V-1 to V-3: a malformed list stops the start, a trailing dot and Unicode patterns match, every send reads the store
- V-1: assertDevelopmentHosts - iapl({ developmentHosts }), mail.relay.developmentHosts and
  mailAdapter({ relay }) refuse anything but an array of non-empty host patterns, and a pattern of `*` alone
  (it would make the public site a development address). Nothing is ignored silently any more.
- V-2: one trailing dot of the host is stripped before matching; patterns are punycoded, so one written in
  Unicode matches; a `*` inside a non-ASCII label is refused.
- V-3: the 30-second memory of other hosts is gone. A dump restored into a running development site stops
  its very next e-mail.
- docs, AGENT.md, changelog draft, skills

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-26 10:57:32 +01:00
Radosław SmolińskiandClaude Fable 5.2 99c73ed0ff Development hosts are about mail only: one sentence on robots; the reference index after the fixture
Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-26 10:40:33 +01:00
Radosław Smoliński 5df5358768 Revert "A development host is kept out of search engines without IAPL_NOINDEX (developmentNoindex, default on)"
This reverts commit bc3aac249f.
2026-11-26 10:38:29 +01:00
Radosław SmolińskiandClaude Fable 5.2 463b966365 Reference site: a test fixture for development hosts (E2E_DEVELOPMENT_HOSTS), for the built-site run of the launch cases
Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-26 10:36:59 +01:00
Radosław SmolińskiandClaude Fable 5.2 bc3aac249f A development host is kept out of search engines without IAPL_NOINDEX (developmentNoindex, default on)
Separate from the mail rule so that it can be taken or left. A site whose address matches
iapl({ developmentHosts }) - built in: *.dev.netscale.pl - is noindex with no env: robots.txt disallows
everything, pages carry noindex, IndexNow sends nothing, buildSecurityHeaders() adds X-Robots-Tag. Nothing
kept a development copy out of search engines until now unless somebody set the variable.

- iapl({ developmentNoindex: false }) switches it off for the project, IAPL_NOINDEX=0 for one environment
- buildSecurityHeaders({ developmentHosts, serverUrl }): next.config runs before the plugin
- the mail rule keeps its own two signals: the development pattern, and the variable itself
- changelog "what changes on upgrade", deployment.md, security.md, AGENT.md, skills

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-26 10:31:03 +01:00
Radosław SmolińskiandClaude Fable 5.2 14abf369da Mail relay: development hosts are known by pattern, with no env - built in: *.dev.netscale.pl
The launch rule called a site non-public only when IAPL_NOINDEX was set (or the project named its hosts).
The owner's development sites set nothing, so production's database copied onto a development address
counted as a launch and would have mailed real people.

- iapl({ developmentHosts }): host patterns of development addresses. Default DEFAULT_DEVELOPMENT_HOSTS =
  ['*.dev.netscale.pl'], Intecion's own development domain; a project replaces the list or empties it.
  mail.relay.developmentHosts overrides it for the mail service.
- a site whose host matches is non-public exactly as with IAPL_NOINDEX=1; either signal is enough
- siteNonPublicSignal, matchDevelopmentHost, isDevelopmentHost, pluginDevelopmentHosts exported
- panel state: nonPublicBy, nonPublicPattern; doctor: mail-non-public (info) names the signal
- every case of the launch table runs with no env on the built-in pattern
- docs, AGENT.md, skills, changelog draft

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-26 10:26:12 +01:00
Radosław SmolińskiandClaude Opus 5.5 634908eb57 Merge claude/postgres-mail-deadlock: Postgres keeps connections free of transactions; form and account mail go out after the commit
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 01:38:31 +01:00
Radosław SmolińskiandClaude Opus 5.5 074353bf5f Merge claude/mail-relay-launch: launch and a domain move need no click; a non-public copy neither enrols nor sends by itself
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 01:38:26 +01:00
Radosław SmolińskiandClaude Opus 5.5 919953e65e Account mail after commit: matched by its token, not by the address (P-4)
holdAccountMailFor bound the next message to an address to whichever
request held it: two resets for one account at once could lose the first
one's mail on the second's rollback, and a form's mail to that address was
deferred to the reset's transaction.

Payload calls generateEmailSubject({ req, token, user }) right before it
sends the reset or verify mail, and the mail carries that token. The plugin
now wraps that function on every auth collection (a project's own one is
kept, Payload's subject otherwise) and holds the token for the request's
transaction; mailAdapter defers only a message to that account alone whose
body contains a held token. An AsyncLocalStorage mark set in a
beforeOperation hook was not used: Payload awaits the hook, and a mark set
inside it does not reach the send (relay/kinds.ts says the same).

Building blocks renamed with it: holdAccountMail(token, address, req),
releaseAccountMail(token). Both review rows are tests.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 01:36:17 +01:00
Radosław SmolińskiandClaude Opus 5.5 4efadb21d5 Postgres pool, review round 1: nested transactions, account mail after commit
P-1: a transaction begun inside another one (a hook calling the Local API
without req) no longer queues behind its caller. An AsyncLocalStorage mark set
when a transaction begins lets the inner one through at once, without a
place, but never into the last connection (a second level may take that
one). If the mark is lost, a queue that has not moved for a second admits
its newest waiter. connectionReserve: false now admits everything, as
before. Measured on Postgres 17: 9, 12 and 30 such submissions finish
(before: stuck from 9).

P-2: Payload's "forgot password" and "verify your e-mail" through
mailAdapter() go out right after their transaction commits
(mail.accountMailAfterCommit, default on). With the relay hanging,
30 resets + 30 submissions finish in about 11 s instead of 43.5 s.

P-3: Postgres tests for the "not confirmed" file result after commit, a
caller's outer transaction rolled back or committed, the relay hanging,
and the nested rows; deployment.md has the measured table.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 01:19:27 +01:00
Radosław SmolińskiandClaude Fable 5.2 49927205bb Mail relay: launch and a domain move need no click; a non-public copy neither enrols nor sends by itself
The copy rule now goes by direction. A public site that finds another host's connection in its database
(its development address after launch, its old domain after a move) enrols by itself. A site that says it
is not public - IAPL_NOINDEX=1, or a host in the new mail.relay.developmentHosts - and holds another host's
connection is a copy of that site's data: it neither enrols nor sends until "Connect again", also when it
has a token of its own (production's database copied back onto the development address). The consent is
stored with the copy (acceptedHosts), so the next fresh copy waits again.

- mail.relay.otherHosts: 'auto' (default) | 'wait' | 'enrol' | list of the site's own hosts
- mail.relay.developmentHosts, siteIsNonPublic() exported
- the copy refusal ends when its reason does (no cool-down; the panel recomputes it on every read)
- doctor: info for a public site whose database knows another host (the launched site, or a copy that
  forgot IAPL_NOINDEX)
- contract copy 1.7.1 (wording only)
- docs, AGENT.md, skills, changelog draft

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-26 00:46:16 +01:00
Radosław SmolińskiandClaude Opus 5.5 32bb542e8e Postgres: many requests at once no longer stop the site
Each Payload transaction holds a pool connection; code inside it that runs
without its req needs a second one (Payload's own forgotPassword, the mail
adapter's settings read and status write, payload.kv). With the default pool
of 10, ten form submissions or ten "forgot password" requests at once held
every connection and waited for good.

- connectionReserve (default on): at most pool size − reserve transactions
  open at once; a waiter older than a second may use all but the last
  connection. Building blocks in modules/database/transactions.ts.
- Form e-mails go out right after the submission's transaction commits, in
  the same request (forms.emailsInTransaction: true = the old way).
- recordIntegrationStatus merges identical writes and does not hold its
  caller while the pool is busy.
- SMTP time-outs: 10 s connect, 30 s greeting, 60 s silence (smtp.timeouts).

Tests on Postgres 17: 30 submissions, 30 forgot-password, and both against
an SMTP server that never answers, finish while a page answers.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 00:33:07 +01:00
Radosław SmolińskiandClaude Opus 5.5 acfcf72c03 Merge claude/mail-relay-adapter: mail through IWSN by default, SMTP on request, Graph deprecated
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 23:59:55 +01:00
Radosław SmolińskiandClaude Fable 5.2 85ed92bb89 Mail relay: review round 2 — the store is keyed by host, a copied database does not enrol by itself
- Q-1 one entry per host (iapl:mail-relay:site:<host>); a read never deletes or writes; another host's
  entry is neither used nor touched (a developer's process on the live database, www and apex, a copy)
- a database that holds another host's connection and none of this site's does not enrol by itself:
  "Connect again" does, once; mail.relay.otherHosts ('wait' | 'enrol' | the site's own other hosts);
  panel text and doctor finding; a site with an empty store enrols by itself as before
- Q-2 the file limit answers from what is stored and never asks the service
- Q-3 a file whose mail was not confirmed is not reported as a wrong file, and no notice mail follows
- Q-4 its own text when the access-key field is off
- D-1 docs for open enrolment; staging, copies and several hosts

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 23:14:11 +01:00
Radosław SmolińskiandClaude Fable 5.2 edee3a321f Mail relay: the access-key field is off by default (mail.relay.accessKeyField)
A token issued by hand is set by a developer: setRelayToken() from a script, or mail.relay.token.
The panel field and its route take a token only when the project switches the field on. Docs and
AGENT.md say when such a token is needed and how to set it; a token of another host is refused on
every way in.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 22:25:34 +01:00
Radosław SmolińskiandClaude Fable 5.2 1a11cefffa Mail relay: the 1.7.0 test allows the status read that follows a new enrolment
Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 22:14:09 +01:00
Radosław SmolińskiandClaude Fable 5.2 fef2c51bae Mail relay: contract 1.7.0 — X-Intecion-Site on every request with a token, host-mismatch
contracts/mail-relay refreshed from IWDL 6cd99f7 (64 files). A token the service knows as another
site's is forgotten without revoking and the site enrols as itself; a hand-issued one is refused.
The fake requires the header and answers host-mismatch.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 22:13:58 +01:00
Radosław SmolińskiandClaude Fable 5.2 a2b07b1dc1 Mail relay: review of 7d766b6 — R-1 to R-12, four mutations, two sentences
- R-1 a delivered token becomes the one in use only on 200 or a refusal given after authentication
- R-2 a token of another site is refused by what /v1/status says (access-key field, scripts); docs for staging
- R-3 the confirm route looks the nonce up first and counts only refused calls
- R-4 one budget of time per message (10 s, 30 s with files), enrolment and retries included
- R-5 'Disconnect' without the service's answer is not confirmed and keeps the token to try again
- R-6 no enrolment without the confirm route in the config
- R-7 half an SMTP set-up: one log line and a hint in the panel
- R-8 to R-10, R-12 docs; R-11 the last failure stays in the state block
- tests for redirect: manual, the candidate's nonce, the expectation taken back, one recipient only

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 22:07:10 +01:00
Radosław SmolińskiandClaude Fable 5.2 0ee74ab2a4 Mail relay: contract 1.6.0, the token tied to its host, IWSN in the panel
- contracts/mail-relay refreshed from IWDL 83af8c6 (1.6.0)
- an answer that is not the service's JSON is 'not confirmed' unless its status is 400 to 499
- a site with a token issued by hand does not enrol to heal: it stops and says what to ask Intecion for
- a store made on another host (a database copied to staging) is not used: the copy enrols as itself, nothing is revoked
- the panel calls the service IWSN (RELAY_SHORT_NAME); docs, logs and the doctor keep the full name

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 21:51:47 +01:00
Radosław SmolińskiandClaude Fable 5.2 7d766b6d58 Mail relay: the reference site's generated types without the e2e fixture's collections; doctor command in the guide
Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 21:24:24 +01:00
Radosław SmolińskiandClaude Fable 5.2 ebfedb03d9 Mail relay: tests count the account rules' own hooks, reference index, doctor fixture
Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 21:18:09 +01:00
Radosław SmolińskiandClaude Fable 5.2 2cceceffd0 Mail relay: state block without an import-map entry, e2e on the reference site, sharper failure reports
- the state block is rendered by IntegrationStatusBanner (no new admin component: generate:importmap gives no diff)
- reference site: e2e/mail-relay.spec.ts with a fixture and setup script; e2e:built runs it with both bundlers
- a failed enrolment is reported as what it was; the service's own refusal after a fresh enrolment
- a message keeps its key after any failure that is not final
- a local site is shown as refused in the panel before any e-mail

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 21:14:47 +01:00
Radosław SmolińskiandClaude Fable 5.2 dd3792cbc7 Mail relay: docs, agent guide, skills, changelog draft; test against the real service code; starter offers the mail service
Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 20:53:38 +01:00
Radosław SmolińskiandClaude Fable 5.2 533f571d4d Mail relay: HTTP tests on a running Payload, account mail marked by recipient, panel wording, doctor rules tested
Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 20:40:17 +01:00
Radosław SmolińskiandClaude Fable 5.2 ea9703f8e3 Mail relay: the built-in client for the Intecion Notifications Webservice
Transport, enrolment with the confirm route, token and state in payload-kv, rotation,
the panel's state block, doctor rules, the fake service and the copied contract 1.5.0.
Tests against the contract's runner and the fake. Docs and HTTP tests follow.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 20:29:46 +01:00
Radosław SmolińskiandClaude Opus 5.5 9efd86a06f Merge claude/iapl-rename-1170: the plugin is called IAPL, every name from before keeps working
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 19:26:36 +01:00
Radosław SmolińskiandClaude Fable 5.2 38b903fcfa IAPL rename, review fixes I-1 to I-11
I-1  ipalEnvRules() keeps the IPAL_ rule names (IAPL_ as aliases); iaplEnvRules() the other way round; the IAPL_ value
     is the one checked when both are set
I-2  COOKIE_SCAN_URL_ENV / COOKIE_SCAN_TOKEN_ENV (and the internal SITE_NOINDEX_ENV) keep their old values;
     IAPL_COOKIE_SCAN_URL_ENV / IAPL_COOKIE_SCAN_TOKEN_ENV added
I-3  bin/ipal-*.mjs: five files that run the new ones (1.16's audit skill and CI call them by path); legacy:site checks it
I-4  storage-names sees <SiteProviders … stats> when a JSX prop comes first (the reference layout's shape)
I-5  AGENT.md: a text naming an ipal-<name> skill means iapl-<name> (the vendored ext-* skills)
I-6  leftover text in the skills-current message
I-7  iapl-skills removes the old pointer block when both are in AGENTS.md
I-8, I-11  changelog: the doctor's summary line, IAPL_DOCTOR_STATUS, --strict in CI until the skills are refreshed
I-9  env.md: an empty IAPL_ variable does not switch the IPAL_ one off
I-10 verifyLimit.keyPrefix undefined or empty is 'not given'

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 18:45:36 +01:00
Radosław SmolińskiandClaude Fable 5.2 03452376f9 IAPL rename: three places where the brand rule had replaced a path segment or a test's needle
scripts/starter-gate.mjs (node_modules/@intecion/ipal-kit), dev/tsconfig.json (the 'ipal-kit' path alias),
test/starter.test.ts (the lockfile must not contain 'ipal-kit'); two JSDoc import lines.
Found by pnpm starter:gate.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 18:04:26 +01:00
Radosław SmolińskiandClaude Fable 5.2 5a0ea924ff Reference e2e setup clears the 2FA counter under the site's own key prefix (iapl)
The reference site has storageNames: 'iapl'; the setup cleared only ipal:2fa-verify:*, so attempts of one
e2e run counted against the next (found by the Turbopack run after the webpack run).

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 17:59:00 +01:00
Radosław SmolińskiandClaude Fable 5.2 e0f7fa1add legacyNameForms: the MCP server name and a pattern fragment in the list
Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 17:53:52 +01:00
Radosław SmolińskiandClaude Fable 5.2 0e54789abd Rename plan: what was carried out and where it differs
Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 17:48:00 +01:00
Radosław SmolińskiandClaude Fable 5.2 630b736344 IAPL rename: instructions say 'pnpm exec iapl-skills', which works whatever the project's script is called
Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 17:47:39 +01:00
Radosław SmolińskiandClaude Fable 5.2 3d5106bc4a IAPL rename: readEnv exported, the MCP server name left as it was, legacy:site needs a database
- readEnv / legacyEnvName exported from the root and /env (a project's own code reads IAPL_* with the IPAL_* fallback);
  the name constants hold the IAPL_ spelling — changelog and env.md say so
- createMcpRoute: the default serverName stays 'ipal-site' (clients see it); the scripted step had changed it
- legacy:site: the builds read the database; the script and PROGRAMISTA say which

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 17:47:11 +01:00
Radosław SmolińskiandClaude Fable 5.2 926ba4a67e IAPL rename: gate checks, and two breaks they found on an unedited 1.16.7 site
- pnpm legacy:site (scripts/legacy-site-check.mjs): the reference site of v1.16.7, unedited, installed against
  this build — old commands, doctor without errors, import map unchanged, tsc, builds with webpack and Turbopack
- test/legacyNameForms.test.ts: the remaining spellings with 'ipal' as a closed list; a new one fails
- found by legacy:site and fixed: 'ipal-tokens --check' called a tokens.css written before 1.17.0 out of date
  (its header names the command); the doctor's env-example rule did not accept IPAL_* in .env.example
- the doctor's seed rules catch IPAL_SEED_ALLOW_FULL=1 as before
- PROGRAMISTA: the new release check

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 17:41:26 +01:00
Radosław SmolińskiandClaude Fable 5.2 b91984fbcd IAPL rename: docs, agent guide, skills, reference site and starter on the new names; changelog draft
- docs, AGENT.md, the 16 skills, PROGRAMISTA and README use the preferred names (scripted, same list of forms);
  past CHANGELOG entries and the proposals in docs/dev are not rewritten
- AGENT.md: 'Names: IAPL and ipal-kit' — old name, new name, state in 1.x; what is not renamed; storageNames
- iapl-upgrade '→ 1.17.0', PROGRAMISTA §6 item 72, CHANGELOG 1.17.0 (draft): nothing required
- env.md, doctor.md (legacy-names, storage-names), stats.md, security.md, project-starter.md, iapl-reference, iapl-setup
- skill scripts read ipal-audit-skip and IPAL_IP_HEADER too; audit rule ids stay what they were
- reference site: iapl(), iapl-doctor.json, iapl-* skills, storageNames: 'iapl'; INDEX.md regenerated

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 17:36:09 +01:00
Radosław SmolińskiandClaude Fable 5.2 425fac14fb IAPL rename: the old names keep working, and a second cookie name and counter key for new sites
- exports: ipalKit, IpalOptions, ipalEnvRules, IpalEnvFeatures, ipalT, ipalVar, IPAL_TOKENS,
  IPAL_BREAKPOINTS, IpalTokenName, IpalGlobalSlug are aliases of the iapl names
- env: IAPL_* is read first, IPAL_* as fallback (readEnv; EnvRule.aliases for assertEnv);
  the crawler service reads IPAL_CRAWLER_SITES too
- doctor: reads ipal-doctor.json when it is the only one, the old pointer block, ipal-audit-skip
  and old skill folders; new rule legacy-names (info) and storage-names (warning)
- iapl-skills: installs iapl-*, removes the 16 old folders by exact name, rewrites the old
  pointer block in place; a project's own ipal-* skill stays
- storageNames: 'ipal' (default) | 'iapl': the cookie the scanner declares and the 2FA counter's
  kv prefix; <PageStats visitorCookie>, IAPL_VISITOR_COOKIE, verifyLimit.keyPrefix
- test/legacyNames.test.ts: 24 tests for all of the above

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 17:31:13 +01:00
Radosław SmolińskiandClaude Fable 5.2 0a4f001797 IAPL rename, scripted: preferred names in src, bin, scripts, services, tests; bin files and skill folders moved
Replaced by an explicit list of forms only (ten exported names, runtime env names, project file
names and marks, commands, skill names, the log prefix, the brand in prose). Package name, import
paths, routes, CSS tokens, data attributes, custom keys, context flags, the cookie and kv keys are
not touched. package.json keeps the five old bin names beside the five new ones.
The old names stop working in this commit and come back as aliases in the next; docs follow.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 17:24:21 +01:00
Radosław SmolińskiandClaude Fable 5.2 414a4702df Rename plan: the owner's answers, and the second cookie name and kv prefix for new sites
Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 17:21:53 +01:00
Radosław SmolińskiandClaude Fable 5.2 b785a27b7d Plan: rename ipal-kit to IAPL in 1.17.0 (inventory, sorting, shape, order, questions)
Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 13:09:57 +01:00
Radosław SmolińskiandClaude Opus 5.5 619a4e06ca 1.16.8 upgrade notes
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 10:26:51 +01:00
Radosław SmolińskiandClaude Opus 5.5 dfec3fca46 1.16.8
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 10:26:33 +01:00
Radosław SmolińskiandClaude Opus 5.5 e29ceeffb0 Merge claude/security-copy-rules: copied staff collections, a rule that cannot widen
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 10:26:04 +01:00
Radosław SmolińskiandClaude Opus 5.5 1316509565 Merge claude/security-1168: account rules where an account can hold editor or admin, no package.json among public files, pnpm e2e:built
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 10:26:04 +01:00
Radosław SmolińskiandClaude Fable 5.2 a19fa0d17b L-1 and one changelog entry for the release: what gets narrower on a copy, the collection that becomes staff later
Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 10:03:31 +01:00
Radosław SmolińskiandClaude Fable 5.2 20809ba933 L-2: a config collection that becomes staff later keeps the rules it had at config time
A collection of the config that is not named as staff and that a plugin listed after
ipalKit makes the panel's (admin.user) was adopted as a late collection: the plugin's
rule went in front of every rule, also the ones the project wrote. The marker now
holds the operations that had a rule at config time (own); those are left as written
when the collection is handled again, and an operation without one gets the plugin's.
The start log tells this case from a collection a later plugin added.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 10:03:31 +01:00
Radosław SmolińskiandClaude Fable 5.2 a743479276 Copied staff collections: the unit fixture's roles field holds a list (after the rebase on K-1)
Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 03:52:56 +01:00
Radosław SmolińskiandClaude Fable 5.2 c9540d291a Copied staff collections: access guide, API table, changelog, reference index
Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 03:48:21 +01:00
Radosław SmolińskiandClaude Fable 5.2 8dcc123b99 Copied staff collections: the plugin's rule goes in front, nothing is replaced (a rule that cannot widen)
A plugin listed after ipalKit that copies a staff collection under a new slug, or reuses its access object, brings
rules the plugin wrote for the ORIGINAL. On 1.16.7 the copy also carried the boolean 'seen' marker and was left
alone: 'the account itself' then meant an account of the original — with numeric ids the original's account with
the same id changed the copy's account (17 of 40 measured shapes).
Design: the plugin never replaces and never rewrites a rule on such a collection. It puts its rule for the copy's
own slug in front, and both must allow: on a copy named as staff in front of every rule; on a copy that is not
staff or keeps its own rules (custom.ipal.accountRules: false) in front of the rules marked as the plugin's for
another collection. The roles field of every copy is guarded. The mark on the plugin's functions says only
{ slug, self }; custom.ipalAccounts says { slug, staff } (a collection named as staff during next dev is handled
on the reload). The plugin's rules are marked before its 2FA guard, which carries the mark.
Accepted cost: a copy's own account cannot edit itself through a copied rule (as on 1.16.7); the copy writes
access.update — one documented line.
Proof: test/accountCopyTableSuite.ts — 40 shapes x accounts x operations, each row not wider than the measurement
taken on 1.16.7 (test/fixtures/copyRulesBaseline.json) and not wider than the plugin's rule; 2FA off and on.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 03:48:09 +01:00
Radosław SmolińskiandClaude Fable 5.2 4c7b722aed K-3: docs — fields that hold a list, a relationship counts, a rule of your own replaces the protection, known limitations
Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 03:44:25 +01:00
Radosław SmolińskiandClaude Fable 5.2 c3d95988e1 K-1, K-2: only a roles field that holds a LIST counts; the start-up check asks each collection its own way
K-1 the plugin counts roles only from an array (getRoles). A single-valued roles field — a select, text or
    relationship without hasMany, a radio — never makes a plugin admin, yet canHoldStaffRole said true: on a
    project's own login collection with a single role select nobody could create, change, delete or unlock accounts,
    the account holding admin included. rolesAreAList(collection) is now a precondition of the admin rules. The same
    for hasPluginRoles: a single select whose values are all the plugin's had the admin rules already in 1.16.7 and
    gets 'an account of this collection' now — its accounts manage each other again; the value still grants nothing.
    A relationship with hasMany counts (ids that are text).
K-2 staffCollectionsNobodyManages returns { stuck, unchecked } and checks collection by collection: no query where
    the field cannot hold admin; a count for a select with hasMany; for text / json / relationship the accounts are
    read and the plugin's own test is applied. Where it cannot check it says so and claims nothing.
Tests: the reviewer's shapes over HTTP and the warning's table against a running Payload, 2FA off and on.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 03:44:25 +01:00
Radosław SmolińskiandClaude Fable 5.2 ccc6f85924 Security follow-ups to 1.16.7: changelog, access guide, skills, API table, release gate, reference index
Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 02:59:44 +01:00
Radosław SmolińskiandClaude Fable 5.2 be2e6d52d9 A staff collection whose accounts can hold editor or admin gets the admin rules (H-2, J-3)
In the released 1.16.7. The plugin's checks go by the value on the account, but a project's own staff collection
without rules got the admin rules only when ALL its role values were the plugin's; otherwise 'an account of this
collection' could create, change and delete accounts. Measured on bc0fa65 (SQLite; the first shape also on Postgres
and MongoDB, 2FA off and on): with roles user/editor/admin/boss, with a text and with a json roles field, config-time
and added by a later plugin, an account with the role user creates an admin (201) who reads Site integrations, changes
another staff collection's roles and lists the panel's accounts (200 / 200 / 200), takes the admin over and deletes it;
with viewer/editor a viewer creates an editor who gets past the access rule of Site settings.
canHoldStaffRole(collection): a roles select with editor or admin among its values, or a roles field whose values
cannot be listed. Then: create / delete / unlock an admin, update an admin or the account itself, roles only by an
admin. A project's own rules win. A warning at start when no staff account is an admin and such a collection exists.
The built-site fixture gets a config-time and a late collection of that kind; nothing here touches copied collections.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 02:59:44 +01:00
Radosław SmolińskiandClaude Fable 5.2 01219b69d3 F-3: pnpm e2e:built puts the reference site's generated files back, also on failure
Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 02:53:41 +01:00
Radosław SmolińskiandClaude Fable 5.2 e77c607bca R4-3: pnpm e2e:built (webpack and Turbopack); Playwright runs reset the test admins first
The command builds the reference site with both bundlers, checks the public files for a package manifest and runs
the late-staff spec and the published-files check against each built site. A global setup resets the test admins
and their stored 2FA attempt counts before every run, so a spec no longer depends on what ran before it.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 02:53:41 +01:00
Radosław SmolińskiandClaude Fable 5.2 9a648b0498 The plugin's version is a constant: no package.json among a site's public assets
pluginVersion() named package.json relative to its own module. A bundler takes such a file for an asset:
a Turbopack build of a site copied the plugin's whole package.json (dependency lists, scripts, the registry
and repository addresses; no secret) to /_next/static/media/package.<hash>.json, served to anyone. Webpack kept
it on the server side. The version now comes from src/version.ts (scripts/write-version.mjs, run by the
`version` script; a test fails when it differs from package.json). A smoke test of the built site: nothing
under .next/static is a package manifest.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 02:53:41 +01:00
Radosław SmolińskiandClaude Opus 5.5 bc0fa65fd7 1.16.7 upgrade notes
CI / check (push) Failing after 5m54s
CI / reference (push) Skipped
CI / reference-full (push) Skipped
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 00:40:20 +01:00
Radosław SmolińskiandClaude Opus 5.5 14c44d082d 1.16.7
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 00:40:07 +01:00
Radosław SmolińskiandClaude Opus 5.5 7b2a2759ab Merge claude/security-m1-hardening (rebased): write-only secrets, account rules, password rule, 2FA attempts
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 00:39:30 +01:00
Radosław SmolińskiandClaude Fable 5.2 8a01c72c2a M1 review round 3: a built-site e2e for a late staff collection (both bundlers); docs follow
Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 00:39:24 +01:00
Radosław SmolińskiandClaude Fable 5.2 6e0ad26b2c M1 review round 3: late staff collections without guessing Payload's default; rules survive a dev reload
R3-1 nothing is decided by a function's name any more (a production build renames it): on a collection that
     arrives after ipalKit the plugin's rule is put in FRONT of the rule that is there and both must allow
     (bothAllow). unlock follows the same table. The log says exactly what was put.
R3-2 the adoption walks the live config (payload.config), which Payload swaps first on a dev reload.
R3-3 readVersions gets the read rule on staff collections.
R3-5 a secret that is not text is refused.
Also: the async check of requireSetup.exempt compares the constructor, not its name.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 00:39:24 +01:00
Radosław SmolińskiandClaude Fable 5.2 3e44863c98 M1 review round 2: docs, agent guide, skills, changelog; the reference types without the removed field
Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 00:39:24 +01:00
Radosław SmolińskiandClaude Fable 5.2 7002ebbfa6 M1 review round 2: the transport is no way round, nobody raises its own role, late staff collections
R2-1 the SMTP password is bound to server, port and user whatever the transport says; the transport alone is not bound.
R2-2 where the plugin's update rule is in force the roles field is closed for the account itself
     (the plugin's roles: only an admin; roles of the project's own: never one's own).
R2-3 auth collections a later plugin adds get the account rules, the password rule and the first-user endpoint when
     the config goes live; a staff slug that is not an auth collection stops the start.
R2-4 smtpRequireTls is taken out: the branch adds no field, column or collection.
Also: read (a staff account) and unlock (an admin) defaults on staff collections (accounts.staffOnlyRead);
doctor staff-own-roles and read / unlock in staff-accounts-open; r1 NULL against the default, also inside a row;
r2 bound values compared exactly.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 00:39:24 +01:00
Radosław SmolińskiandClaude Fable 5.2 a32329fbb4 M1 review: reference site types and an e2e check of the bound SMTP password
Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 00:39:23 +01:00
Radosław SmolińskiandClaude Fable 5.2 fd203de326 M1 review: docs, agent guide, skills and changelog follow the fixes
Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 00:39:23 +01:00
Radosław SmolińskiandClaude Fable 5.2 1141c749de M1 review: account rules before 2FA, the SMTP password stays with its server, the rest of the findings
M1-1 the first-user route is the plugin's own endpoint in front of Payload's; nothing is read from the path.
M1-2 the account rules are put on the collections before the 2FA package wraps them.
M1-6 the admin rule only where the roles are the plugin's; other staff collections: an account of that collection.
     update / delete get the matching defaults (accounts.adminOnlyWrite); doctor rule staff-accounts-open.
M1-5 access.firstUserAdmin: false with a role below the panel role: the default panel role steps aside, an explicit one is refused.
M1-3 a save that changes the SMTP server, port, user or encryption must send the password again (secrets.reenterOnChange);
     new panel field smtpRequireTls.
M1-4 a restore of a version masks the secrets (maskSecretsOnRestore).
M1-7 a refused origin is logged once with the ways to allow it; default ports are normalised.
Minors: m1 day boundary, m3 e-mail check on reset and bulk update, m4 text of 'all', m5 the mask is never kept.
The account suite runs with 2FA off and on.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 00:39:23 +01:00
Radosław SmolińskiandClaude Fable 5.2 81cee02e78 M1: the reference e2e suite follows the stored 2FA verify count
The verify count now survives a restart of the site, so the specs can no longer
share one test admin across server runs: create-test-admin.ts makes two test
admins and clears their stored counts; the setup spec signs in as the second.
The whole suite passes in one run (20 passed, 1 skipped).

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 00:39:23 +01:00
Radosław SmolińskiandClaude Fable 5.2 83356ab4ed M1: docs, agent guide, skills and changelog for the hardening items
security.md (stored secrets, own-origin 2FA attempts, stored verify count,
dashboard alerts by role), access.md (account rules: panel role, no
self-registration, passwords), turnstile.md (the deprecated env secret,
forms.turnstileOnConfigError), doctor.md (five new rules, the deep status),
AGENT.md, ipal-setup, ipal-upgrade, ipal-debug, ipal-reference (+ api.md),
ipal-doctor and their mirrors, PROGRAMISTA row 69, CHANGELOG under an unreleased
heading with "Requires project changes".

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 00:39:23 +01:00
Radosław SmolińskiandClaude Opus 5.5 cff355a541 Merge claude/docs-isadmin-client-import: role checks importable in client components
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 00:39:12 +01:00
Radosław SmolińskiandClaude Fable 5.2 f7296edc71 M1 (8): 2FA attempts only from the own origin; the verify count is stored
R3-2. (b) POST /api/verify-totp and /api/setup-totp refuse a request that a
browser marks as coming from another origin (Origin, Sec-Fetch-Site) — before it
is counted, so another page (a sibling subdomain included) cannot burn an
account's attempts and lock its owner out. Own origins: the request's host,
serverURL, Payload's csrf / cors lists, twoFactor.sameOrigin.origins; requests
without those headers pass. twoFactor.sameOrigin: false turns it off.
(a) The verify count is kept in memory (exact for parallel bursts) and in
Payload's key-value store (payload.kv, no new collection), so a restart or a
second instance does not reset it; the higher count decides, and a failing store
never opens the gate. verifyLimit.store: 'memory' = this instance only.
Doctor: csrf-empty (static, warning) when neither serverURL nor csrf is set.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 00:39:12 +01:00
Radosław SmolińskiandClaude Fable 5.2 0b4c4e8295 M1 (9): dashboard alerts by role
IntegrationAlerts reads the admin-only Site integrations global with access
control off and showed its error texts to everyone who opened the dashboard.
Now: an admin sees what is failing and the link, an editor a neutral "an
integration needs attention — ask an administrator", anyone else nothing.
CookieCrawlAlert is shown to editors and above (the role that may read the crawl
result). Both use userMeetsRole, so a session that still owes its second factor
sees neither. dashboardAlerts: { integrations: 'admin' | 'editor' | 'all',
cookies: 'editor' | 'all' } loosens it.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 00:39:12 +01:00
Radosław SmolińskiandClaude Fable 5.2 5d35b2c3f4 M1 (7): a password rule for staff accounts (accounts.password)
When a password is set on a staff collection — a new account, the first-user
screen, a change, a reset by e-mail; panel, API and Local API alike — it must
have at least 12 characters and not be the account's own e-mail address.
Existing passwords are never checked: a shorter one keeps logging in and meets
the rule when it is next changed. accounts.password: { minLength } | false.
No breached-password lookup; checkPassword and the hook are exported.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 00:39:12 +01:00
Radosław SmolińskiandClaude Fable 5.2 c6fc0d21fe M1 (6): nobody creates an account for themselves
accounts.adminOnlyCreate (on): a staff collection without a create rule gets
"an admin, fully signed in" instead of Payload's "any logged-in user" — also the
project's own collection; a rule the project wrote stays.
accounts.firstUserRoute ('panel'): Payload's first-user route answers only for
the collection the panel logs in with. For any other empty auth collection it is
refused, unless that collection's own create rule lets an anonymous request in.
Checked and closed: an empty second staff collection, whose first visitor became
a staff admin (test/accountRulesOff.test.ts records the old behaviour, which
accounts: false / firstUserRoute: 'all' still give).
Doctor: open-signup (deep, info) names auth collections with open sign-up.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 00:39:12 +01:00
Radosław SmolińskiandClaude Fable 5.2 cd60b73685 M1 (5): the lowest role stays out of the admin panel (accounts.panelRole)
The panel opens for editor and above by default: Payload's access.admin on the
collection that carries the roles. An account that holds only `user` sees
"Unauthorized" there; the API is not touched. The rule looks at the role, not
at the second factor, so the 2FA screens stay reachable. accounts.panelRole:
'user' | false (everyone, as before) | 'admin'; accounts: false turns the account
rules off; the project's own access.admin wins. At start the log says how many
accounts the rule keeps out, and is an error when it keeps everyone out.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 00:39:12 +01:00
Radosław SmolińskiandClaude Fable 5.2 463fd5d664 M1 (4): forms.turnstileOnConfigError — a form with files is refused while Turnstile cannot check
While Turnstile is degraded (wrong or missing secret, Cloudflare down) a text
form is still accepted, as before; a submission to the file endpoint is refused
by default. forms.turnstileOnConfigError sets it for every form or per kind
('allow' | 'reject' | { text, files }); a value at a call site still wins.
Nothing changes when Turnstile is off. The gates and the resolver are exported
from the server entry.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 00:39:12 +01:00
Radosław SmolińskiandClaude Fable 5.2 42fdad8c2d M1 (2, 3): the Turnstile env secret is deprecated; doctor rules access-missing, turnstile-degraded, turnstile-env-key
(2) Stage one of the deprecation: TURNSTILE_SECRET_KEY from the environment still
works when the panel field is empty, logs once that it is deprecated, and the
doctor's deep status reports it (rule turnstile-env-key, warning). Nothing is
removed.
(3) access-missing (static, warning): ipalKit without `access` means every panel
account is an admin. turnstile-degraded (deep): Turnstile is not checking forms —
warning, error after a day. The deep status carries the recorded state and where
the secret comes from, never a key.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 00:39:12 +01:00
Radosław SmolińskiandClaude Fable 5.2 8fa71238ce M1 (1): stored secrets are write-only
smtpPassword and turnstileSecretKey in the Site integrations global are returned
as '********' to every read that goes through access control (REST, GraphQL, the
panel's form state); the Local API with access control off still gets the value.
A save that sends nothing, an empty value or the mask keeps the stored one;
'[[clear]]' removes it. MaskedField says that a value is set and offers to
remove it. Off: secrets: { writeOnly: false }. writeOnlySecret(s) and the hooks
are exported for a project's own fields.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-25 00:39:12 +01:00
Radosław SmolińskiandClaude Opus 5.5 de414a81a8 Role checks in client components: export them from /client, fix the docs
access.md and the 1.16.4 upgrade notes led projects to import isAdmin from
'@intecion/ipal-kit' in a client component; with `next build --webpack` that
fails ('server-only' cannot be imported from a Client Component module).
No existing entry had a client-safe one, so '@intecion/ipal-kit/client' now
exports hasMinimumRole, isAdmin, isEditor and the type Role; the main entry
keeps them for server code.

Docs: access.md (snippet with imports, server vs client, useConfig() carries
admin.user only), AGENT.md, ipal-debug, ipal-reference, ipal-upgrade, the
1.16.4 note, an Unreleased changelog entry. Tests: /client reaches no
server-only module, the predicates' answers with a client config, no
client-component example in the docs imports the main entry.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 22:00:27 +01:00
Radosław SmolińskiandClaude Opus 5.5 1270ebc3d1 1.16.6 upgrade notes
CI / check (push) Failing after 5m28s
CI / reference (push) Skipped
CI / reference-full (push) Skipped
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 20:38:42 +01:00
Radosław SmolińskiandClaude Opus 5.5 0356a329ca 1.16.6
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 20:38:42 +01:00
Radosław SmolińskiandClaude Opus 5.5 b3a5ea1323 Merge claude/2fa-setup-required: an account without 2FA can only set it up (twoFactor.requireSetup)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 20:38:00 +01:00
Radosław SmolińskiandClaude Fable 5.2 b52193ae47 2FA setup required: the missing-column log reads the error's cause chain
R3-1: the SQL adapters throw "Failed query: …" and put the database's own words
("column … does not exist", "no such column") in the error's cause, so the loud
start-up line never appeared on a real Postgres or SQLite. The reason is now
built from the whole cause chain; other failures (ECONNREFUSED, a locked
database) still only warn. Tested with wrapped errors and against the real
adapter with the column dropped.

Docs and the doctor's fix text name how the migration is applied
(deployment.md 4.3) wherever they said only "before the site serves".

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-24 20:31:44 +01:00
Radosław SmolińskiandClaude Fable 5.2 01e3813723 2FA setup required: review round 2 — no SVG from the icon endpoint, migrations at container start
R2-1: /api/ipal/admin-icon answers with bytes only for a bitmap recognised by its
first bytes (PNG, JPEG, GIF, WebP, ICO, AVIF). An SVG favicon keeps the redirect
to the media file: a site-wide CSP rule overrides a route's own sandbox header,
so the header alone protected nothing in a built site. buildUploadSecurityHeaders
also returns a rule for the icon path, as a second layer.
R2-2: the SQL migration runs when the new container starts (prodMigrations, or
the start command), never in Coolify's pre-deployment command; docs and the log
line say so and point to deployment.md 4.3.
R2-3: requireSetup: null is the default. R2-4: the missing-column log line only
for a column error. R2-5, R2-6: the resetAccess example keeps the code check;
with guard: false the reset endpoint does not exist.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-24 20:18:47 +01:00
Radosław SmolińskiandClaude Fable 5.2 75a6f5209e 2FA setup required: review fixes (SR-1 to SR-9)
SR-1: /api/ipal/admin-icon sends the upload security headers (sandbox policy,
nosniff) with the bytes: an SVG is shown, never run. fetchPublicImage stops
reading at the size limit.
SR-2: requireSetup.exempt exempts only on exactly true; an async function, and a
windowHours that is not a number or false, stop the start.
SR-3: on Postgres / SQLite the missing column makes every login fail: the log
says so, the docs call the migration a required step of the same deploy, and
ipal-doctor reports a SQL project without it.
SR-4: an admin's reset also ends the account's sessions.
SR-5: the reset needs a session that entered its own TOTP code by default.
SR-6: the doctor's import-map rule covers TwoFactorStatusField and TwoFactorAlert.
SR-7: building blocks exported; dashboard notice, status field, setup notice and
the server-side image fetch can be switched off one by one.
SR-8: totpSetupFrom is on the 2FA collection whenever 2FA is on.
SR-9: both ways out of "every administrator is blocked" in security.md.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-24 19:32:34 +01:00
Radosław SmolińskiandClaude Fable 5.2 9d2ab43438 2FA setup required: the window of existing accounts starts once, at the first start after the upgrade
Owner's decision: for accounts that exist before the upgrade the 72 hours
count from the first start after it. The code already stamped them then; this
adds the tests that the moment is written once per account (a restart, two
instances starting at once, edits and logins do not move it; 71 h after it setup
is open, 73 h after it the account is blocked) and says so in the docs.

After the rebase on 1.16.5: tests that the setup-required notice and the stale
import-map notice both stand above the screen and never replace the code form,
and that requireSetup, safeBack and guard switch independently.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-24 18:56:07 +01:00
Radosław SmolińskiandClaude Fable 5.2 5d44ac3135 2FA screens: the brand image loads for a session that still owes its code; browser spec checks it
The tab icon endpoint answers with the image itself instead of a redirect
to the media file, and the logo components hand a session that owes its
2FA code (or has not set 2FA up) the picture fetched without credentials,
as an anonymous visitor gets it. Who can read media is unchanged; when the
file is not public or is larger than 512 KB the site name is used.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-24 18:46:32 +01:00
Radosław SmolińskiandClaude Fable 5.2 2aaaaa115a 2FA setup required: an account without TOTP reaches only setup, within a 72 h window
twoFactor.requireSetup (on by default with 2FA): an account of the 2FA
collection that has not set TOTP up is refused by ipal-kit's second-factor
check on every collection, global and plugin endpoint; the setup screen and
/api/setup-totp are all it reaches. It has 72 hours from its creation or
from an admin's reset (field totpSetupFrom, stamped by a hook); after that
setup is refused too until an admin reopens it.

Accounts that existed before get their window at the first start after the
upgrade (backfill in onInit), so nobody is blocked when a site upgrades.

Admin side: status and reset / 'Reopen setup' button on the account page
(TwoFactorStatusField), POST /api/ipal/two-factor/reset, a dashboard notice
(TwoFactorAlert), a notice on the setup screen; texts in English and Polish.
ipal-doctor reports blocked accounts and a switched-off mode.

Overridable: requireSetup false, windowHours (false / 0 = none), exempt for
a service account, resetAccess; the per-entity second-factor opt-out applies.
API keys, seeds, bearer-token routes and sites with twoFactor false are not
affected.

HTTP tests (REST, GraphQL, first admin on an empty database) run on SQLite,
Postgres and MongoDB; a browser test on the reference site covers the first
admin, a new editor and the admin's reset. Docs, guide, skills, changelog.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-24 18:46:32 +01:00
Radosław SmolińskiandClaude Opus 5.5 45d52c4690 1.16.5 upgrade notes
CI / check (push) Failing after 5m27s
CI / reference (push) Skipped
CI / reference-full (push) Skipped
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 17:50:25 +01:00
Radosław SmolińskiandClaude Opus 5.5 bef3a682b8 1.16.5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 17:50:25 +01:00
Radosław SmolińskiandClaude Opus 5.5 f96b5c15d0 Merge claude/2fa-safe-back: the back link of the 2FA screens is checked on the server (twoFactor.safeBack)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 17:49:47 +01:00
Radosław SmolińskiandClaude Fable 5.2 3eee841dd0 ipal-doctor: the raw 2FA view warning only for a view component
R3-1: the warning fired on any mention of the 2FA package's setup / verify view
in the config, so it stayed after the fix its own text suggests (SafeTotpView
with the path as ipalTotpView, plus the path in admin.dependencies). It now
warns only when the path is a view's Component.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-24 17:49:06 +01:00
Radosław SmolińskiandClaude Fable 5.2 b2c1dca5da 2FA back link: the stale import-map notice never replaces the screen
R2-1: the notice was rendered instead of the 2FA screen, and its flag is a text
search of the importMap.js on disk — not the map in the build. A false alarm
(map generated in the build with the repository's file in the running image, a
re-exporting map) hid a working code form and locked everyone out. The notice
is now rendered above the screen, the log line says "may be", and the flag goes
to ipal-kit's own provider only.

R2-2: views are compared against copies, so a factory that reuses its view
objects is guarded too; copyViews, changedViewKeys, SAFE_TOTP_VIEW,
totpViewImportKey, findImportMapFile and missingImportMapEntries are exported;
ipal-doctor warns when the config registers the 2FA package's own view; docs
wording and a misplaced comment fixed.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-24 16:35:16 +01:00
Radosław SmolińskiandClaude Fable 5.2 ad51456eaa 2FA back link: review fixes — views guarded by object, client views, a loud stale import map
SB-1: the 2FA package replaces a view that already stands under its keys, so a
key that existed before the factory ran was wrongly treated as the project's own
and left unguarded (also with a double registration, or ipalKit over its own
output). Views are now compared by object, right after the factory.

SB-2: SafeTotpView renders through Payload's RenderServerComponent: a client
component set as a 2FA view gets only client props plus the checked back.

SB-3: a production build with the previous import map shows an empty 2FA screen.
twoFactor.importMapCheck (on, production only) reads the committed map at start:
an error in the log and a message on the 2FA screens. Docs name the real symptom.

SB-4: enabled: false restores admin.dependencies; wrapTotpViews keeps exportName.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-24 16:16:39 +01:00
Radosław SmolińskiandClaude Fable 5.2 93e75426ab 2FA screens: the back link is checked on the server (twoFactor.safeBack)
@clocklimited/payload-2fa sends the browser to the `back` query value after a
valid code without checking it (GHSA-rffw-fq79-g3ch upstream, not fixed in the
fork): a prepared link ran script in the panel or left the site.

SafeTotpView now stands in front of the package's setup and verify views and
passes on a checked value: a path on the site's origin inside the admin route,
else the admin root. The package's views stay in the import map through
admin.dependencies, so ipal-kit still never imports the package.

twoFactor.safeBack: false turns it off, a function replaces the rule;
safeAdminBack, wrapTotpViews and SafeTotpView are exported. Projects with 2FA
must regenerate the admin import map.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-24 15:29:06 +01:00
Radosław SmolińskiandClaude Opus 5.5 39309c5c1c CHANGELOG 1.16.4: the verify limit counts every try; lockout from a sibling subdomain
CI / check (push) Failing after 5m29s
CI / reference (push) Skipped
CI / reference-full (push) Skipped
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 09:36:54 +01:00
Radosław SmolińskiandClaude Opus 5.5 d722157e20 1.16.4 upgrade notes
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 09:35:08 +01:00
Radosław SmolińskiandClaude Opus 5.5 03443fd7ee 1.16.4
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 09:35:08 +01:00
Radosław SmolińskiandClaude Opus 5.5 f0f26393a3 Merge claude/security-fix-staff-check-2fa: staff checks only for staff collections; 2FA covers everything
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 02:26:56 +01:00
Radosław SmolińskiandClaude Fable 5.2 dc5326ea1c Review round 3: job-queue rules keep Payload's own defaults; a failed 2FA lookup fails closed
Job queue (R3-1): only a rule that exists is wrapped. At config time that
is what the project wrote; Payload fills in the rest when it builds the
config (3.94.1: run, queue and cancel are all defaultAccess, a logged-in
user) and the sweep of the running config wraps those. No default is
invented, so a request without a user gets what Payload itself answers.

hasTotp false while the account's record carries a TOTP secret (the 2FA
package's own lookup failed, R3-4): the account owes its code, not
'not set up yet'.

Docs: the two-configs-in-one-process case for calls without a source, and
that a half-logged-in editor's browser is refused media files.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-24 02:22:04 +01:00
Radosław SmolińskiandClaude Fable 5.2 c56f0d41b8 Security review round 2: no exception by name, staff list fails closed, verify limit
R2-1: the sweep skipped every collection whose slug starts with payload-,
so a plugin's payload-... collection added after ipalKit was never guarded.
There is no exception by name or prefix now: every collection and global
is guarded, Payload's own included, and the job queue's run / queue /
cancel rules too.

R2-2: role predicates called without a source fail closed where the staff
collections are not known (browser bundle, middleware, edge): nobody is
staff. They accept req.payload, a config (also the client config) or
{ staffCollections } as the source.

R2-3: the staff list is filed per config / Payload instance; a call without
a source gets only what every config in the process calls staff.

R2-4: payload.config is watched on the instance, so a config swapped in by
a dev reload is guarded before any request or Local API call.

R2-5: verify attempts are limited per account (default 5 in 10 minutes,
twoFactor.verifyLimit), counted in memory, never skipped.

R2-6: a user object without collection owes the second factor; endpoints
the 2FA package may add on collections or globals are guarded too; a
warning names staff collections that 2FA does not cover; docs state what
is not covered, fix the one-argument examples and the doctor example.

HTTP tests for each on payload-2fa beta.7, run on SQLite, Postgres and
MongoDB (test adapter added).

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-24 01:46:25 +01:00
Radosław SmolińskiandClaude Fable 5.2 32faaa5e30 Security review fixes: staff collection first everywhere, 2FA package endpoints guarded, per-entity opt-out, hot reload
F1: roles count only for accounts of a staff collection, in every exported
predicate and access builder (isAdmin, isEditor, hasMinimumRole, adminOnly,
adminOrEditor, requireRole, adminOrSelf, adminOrSelfIn, the Field variants,
the roles field) and first in userMeetsRole. An account of another auth
collection with its own roles: ['admin'] gets nothing. Staff collections:
admin.user, access.authCollection, access.staffCollections. Predicates take
req.payload as an optional last argument and otherwise use the staff
collections of the config ipalKit built in this process.

F2: every endpoint @clocklimited/payload-2fa registers answers accounts of
the 2FA collection only (setup-totp wrote the secret into the 2FA collection
under the caller's id, whatever collection the caller came from); remove and
the admin reset/remove endpoints also need the second factor.

F3: per-entity opt-out honoured, operation by operation: the package's
custom.totp.disableAccessWrapper and ipal-kit's custom.ipal.secondFactor
(passed on to the package); the package's global disableAccessWrapper too.

F4: a no-user auth strategy on the 2FA collection guards the live config at
the start of each request, so entities from plugins listed after ipalKit
stay guarded after a dev hot reload and with disableOnInit.

Tests through HTTP for all four; the 2FA tests now run on payload-2fa
3.0.0-beta.7 (what client sites use), a second file on beta.1 (alias), and
the HTTP files can run against Postgres (IPAL_TEST_POSTGRES_URI). Docs,
agent guide, skills and changelog updated; the not-yet-enrolled limitation
is stated plainly.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-24 01:02:34 +01:00
Radosław SmolińskiandClaude Fable 5.2 97ee1289aa Reference smoke test: send the site origin so the login cookie counts; test typing
Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-24 00:38:01 +01:00
Radosław SmolińskiandClaude Fable 5.2 0c61ac231b Security: staff checks only for staff collections; 2FA covers what the plugin adds
Staff check (userMeetsRole): the 'no roles field = every account passes'
rule applied to the account's own collection, so an account of a second
auth collection (customers) passed every staff check. It now applies only
to staff collections: the panel's login collection plus the new
access.staffCollections. The injected auth collection uses the new
adminOrSelfIn(slug), so an account of another collection with the same
numeric id is not 'self'.

2FA: @clocklimited/payload-2fa wraps the collections and globals present
when it runs; ipalKit's own globals and collections were added later and
stayed unwrapped, so a password without the TOTP code opened them over
REST and GraphQL. ipal-kit now has its own second-factor check
(secondFactorPassed / requireSecondFactor): applied to every collection
and global at the end of ipalKit, again in onInit for entities added by
plugins listed after it, and inside userMeetsRole and the endpoints that
take a project access function. It fails closed: an unrecognised user
shape is refused, and startup stops when the injected 2FA plugin lacks
the parts the check reads (twoFactor.guard: false opts out).

Tests through real HTTP requests (REST and GraphQL) against Payload's
route handlers, plus the reference smoke test. Docs, agent guide, skills
and the reference skills copy updated; changelog entry without a version.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-24 00:31:55 +01:00
Radosław SmolińskiandClaude Opus 5.5 bc1045a5b7 Merge claude/drift-decisions-1163: PAYLOAD_SECRET minimum in production, doctor seen in CI, create --external
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 00:09:26 +01:00
Radosław SmolińskiandClaude Opus 5.5 71fea221f1 Merge claude/docs-drift-1163: docs brought in line with the 1.16.3 code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 00:09:26 +01:00
Radosław SmolińskiandClaude Opus 5.5 0d8d906653 Comments: tab name Search engines, credit text, generateStaticParams scope
Comments and the ipal-kit usage line only (adds ipal-doctor); no behaviour.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 00:01:19 +01:00
Radosław SmolińskiandClaude Opus 5.5 b5df59691c ipal-kit create: a bare --external installs every external skill
Matches the help text and docs/project-starter.md; a list stays as given,
no flag leaves it to the answers. resolveExternal() + test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 00:01:19 +01:00
Radosław SmolińskiandClaude Opus 5.5 5cd0224ebd ipal-doctor: never write first-seen dates when CI is set
The CLI ignored CI (writeSeen was only !sites && !json); docs and comments
already said "not in CI". shouldWriteSeen() + test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 00:01:18 +01:00
Radosław SmolińskiandClaude Opus 5.5 36f8f69f82 ipalEnvRules: PAYLOAD_SECRET at least 32 characters in production
New option secretMinLength (default 32, 0 turns it off); checked only with
NODE_ENV=production. Docs: env table, deployment (what changing the secret
does, checked in Payload 3.94.1 and payload-2fa), AGENT.md, ipal-reference,
ipal-setup. Tests: short secret fails in production, passes in dev, 0 and a
custom minimum.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 00:01:18 +01:00
Radosław SmolińskiandClaude Opus 5.5 40fed78da2 Docs: forms reject text over 5000 characters; Site settings update is editor+
(a) The code rejects an over-long value (kind 'too_long', validation text at
the field, answers kept); the limit is fixed. (c) Site settings update needs
the editor role; overridable with globalOverrides.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 00:01:18 +01:00
Radosław SmolińskiandClaude Opus 5.5 37592764b5 Docs: fix doc/code drift found against 1.16.3 (docs only)
Verified the IAWL summary's "Doc/code" notes against the code and swept
CLI flags, option names/defaults and env vars. Fixed in the docs:
admin groups (consent-records, cookie-review → Privacy; Form messages
global → Forms), tab labels (More, Spam protection, E-mail sending,
Search engines; Sending method), construction field labels, {field} =
label, globalOverrides instead of "a plugin after ipalKit", enabled:false
keeps globals, pages role labels en+pl, switchLocalePath prefix,
accessibility cookie (necessary), seeding summary() shape, prepublishOnly
chain, doctor --strict --offline in the starter, package files list,
ipal-skills --external in PROGRAMISTA, DATABASE_URI (not _URL),
uploadsCollection exists, SiteProviders nonce, buildLinksField labels,
MCP list_pages limit wording, IPAL_DOCTOR_TOKEN in the env table; shipped
seo-check message "Search engines". Reference skills copy refreshed.

Open questions (not changed): forms over-long text, PAYLOAD_SECRET
length, Site settings update access, doctor seen in CI, bare
`ipal-kit create --external`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-23 23:47:35 +01:00
Radosław SmolińskiandClaude Opus 5.5 e603561de4 1.16.3: renumber the prepared release (was 1.17.0)
CI / check (push) Failing after 6m22s
CI / reference (push) Skipped
CI / reference-full (push) Skipped
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-23 17:53:57 +01:00
Radosław SmolińskiandClaude Opus 5.5 e29f882aa6 1.17.0 upgrade notes
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-23 17:46:47 +01:00
Radosław SmolińskiandClaude Opus 5.5 195ca3ab11 1.17.0
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-23 17:46:40 +01:00
Radosław SmolińskiandClaude Opus 5.5 b9df570e84 Merge claude/deps-payload-3-94: Payload 3.94.1, dependency updates, overrides re-checked
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-23 17:43:23 +01:00
Radosław SmolińskiandClaude Opus 5.5 a0c576e54c Dev audit: @swc/cli 0.8.2, vite 7.3.8; Node 22.23.5 check in Coolify
@swc/cli 0.8.0 still resolved piscina 4.9.3 and @xhmikosr/decompress 10.2.1
(the two criticals). 0.8.2 with refreshed transitive deps and vite 7.3.8 as a
direct dev dependency take the dev-tree audit from 31 to 4 (0 high, 0 critical).
Docs: Payload 3.94 needs Node 22.23.5+ also in Coolify; how to check it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-23 17:43:18 +01:00
Radosław SmolińskiandClaude Opus 5.5 ab51027617 Payload 3.94.1, dependency updates, overrides re-checked
- payload and every @payloadcms/* 3.94.1 in the plugin's dev dependencies, the
  reference site and the starter (peer range unchanged: ^3.90.2); react/react-dom
  19.3.1; reference engines node >=22.23.5 <23 (Payload 3.94's minimum).
- Overrides re-checked: dompurify and happy-dom still needed; mongoose (3.90–3.93)
  and undici (3.90–3.91) only on an older Payload; graphql-scalars no longer needed
  (GHSA-x8rm-f576-gq67 covers 1.24.1–2.0.0; Payload pins 1.22.2). Reference keeps
  dompurify + happy-dom; plugin root drops graphql-scalars.
- ipal-doctor transitive-min: the mongoose fix names the Payload upgrade first.
- nodemailer 10.6.1; dev: playwright 1.65.1, vitest 5.1.1, prettier 3.10.1,
  @swc/cli 0.8, rimraf 6 (clean uses --glob), cross-env 10, open 11,
  sort-package-json 4, @swc-node/register 1.12.1, vite-tsconfig-paths 6.1.1;
  reference tailwind 4.3.5, postcss 8.5.33.
- Kept back: typescript 7, eslint 10, graphql 17, @types/node 26, lucide-react 1.x.
- AGENT.md §4 item 12, ipal-setup, ipal-upgrade, README, PROGRAMISTA §1, forms.md,
  doctor.md; reference skills copy; CHANGELOG Unreleased.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-23 15:18:58 +01:00
Radosław SmolińskiandClaude Opus 5.5 13b66413f8 1.16.2 upgrade notes
CI / check (push) Canceled after 0s
CI / reference (push) Canceled after 0s
CI / reference-full (push) Canceled after 0s
ipal-upgrade: "→ 1.16.2" section. PROGRAMISTA §6: item 63. Reference site: skills
and the AGENTS.md pointer on 1.16.2; INDEX.md regenerated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-17 00:19:11 +01:00
Radosław SmolińskiandClaude Opus 5.5 5d9bc10cfd 1.16.2
Version bump; the Unreleased section becomes 1.16.2: pnpm.overrides for Payload's
mongoose (8.24.1 → ~8.24.10; GHSA-pcrw-h46h-c93h critical and four more) and
happy-dom (20.x → ^21.0.4; two highs) in the reference site and the starter; new
ipal-doctor rule transitive-min and DoctorContext.installedAll(name). What projects
must update: every MongoDB site adds the two override lines (Postgres/SQLite: the
happy-dom one), reinstalls, rebuilds and redeploys.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-17 00:19:11 +01:00
Radosław SmolińskiandClaude Opus 5.5 1917686b52 Merge claude/inspiring-goldstine-66f9c2: mongoose and happy-dom overrides, doctor rule transitive-min
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-17 00:18:49 +01:00
Radosław SmolińskiandClaude Fable 5.2 de8362820f Overrides for Payload's mongoose and happy-dom advisories; doctor rule transitive-min
@payloadcms/db-mongodb pins mongoose 8.24.1 (one critical, two high, two moderate
advisories, fixed by 8.24.7) and @lexical/headless 0.50 brings happy-dom 20.x (two
high, fixed by 21.0.4). Payload 3.93.0 fixes neither.

- reference/package.json (and so the starter): pnpm.overrides for mongoose
  (~8.24.10) and happy-dom (^21.0.4); pnpm audit --prod on the reference is clean
- root package.json: the happy-dom override for the plugin's own dev tree
- ipal-doctor: transitive-min reports mongoose 8.x < 8.24.7 (error) and
  happy-dom < 21.0.4 (warning) from the lockfile and prints the override line;
  DoctorContext.installedAll(name)
- AGENT.md §4 item 12, ipal-setup, ipal-upgrade, doctor.md, README, CHANGELOG

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-17 00:01:58 +01:00
Radosław SmolińskiandClaude Opus 5.5 7c034a07ef 1.16.1 upgrade notes
CI / check (push) Canceled after 0s
CI / reference (push) Canceled after 0s
CI / reference-full (push) Canceled after 0s
ipal-upgrade: "→ 1.16.1" section. PROGRAMISTA §6: item 62. Reference site: skills
and the AGENTS.md pointer on 1.16.1; INDEX.md regenerated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-16 23:49:14 +01:00
Radosław SmolińskiandClaude Opus 5.5 5c9eeaf330 1.16.1
Version bump; the Unreleased section becomes 1.16.1: Next.js 16.4.6 in the plugin,
the reference site and the starter; minimum safe version 16.4.5 because of
GHSA-mfr8-8qww-v76h (16.3.0–16.4.4); ipal-doctor next-min raised. What projects
must update: every site below 16.4.5 runs
`pnpm add [email protected] [email protected]` and redeploys.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-16 23:49:10 +01:00
Radosław SmolińskiandClaude Opus 5.5 ad6011b66a Merge claude/next-16-4-6: Next.js 16.4.6, minimum safe 16.4.5 (GHSA-mfr8-8qww-v76h)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-16 23:49:02 +01:00
Radosław SmolińskiandClaude Opus 5.5 9b03c94979 Next.js 16.4.6; minimum safe version 16.4.5 (GHSA-mfr8-8qww-v76h)
Next.js 16.3.0–16.4.4 is affected by GHSA-mfr8-8qww-v76h (CVE-2026-119790, moderate:
information disclosure across root params when a 'use cache' function is called
through unstable_cache()), first patched in 16.4.5.

- next and eslint-config-next 16.4.6 in the plugin's dev dependencies and the
  reference site (the starter is generated from it); lockfiles refreshed.
- ipal-doctor next-min: error below 16.4.5, naming the advisory; fix
  `pnpm add [email protected] [email protected]`; still silenceable. Tests.
- AGENT.md §4 item 11, ipal-setup, ipal-upgrade, doctor.md: minimum 16.4.5;
  reference skills copy refreshed. CHANGELOG Unreleased.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-16 23:45:17 +01:00
Radosław SmolińskiandClaude Opus 5.5 ba3d57a77a 1.16.0 upgrade notes
CI / check (push) Canceled after 0s
CI / reference (push) Canceled after 0s
CI / reference-full (push) Canceled after 0s
ipal-upgrade: "→ 1.16.0" section. PROGRAMISTA §6: item 61. Reference site: skills
and the AGENTS.md pointer on 1.16.0; INDEX.md regenerated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-13 17:19:03 +01:00
Radosław SmolińskiandClaude Opus 5.5 7f0c2f9d72 1.16.0
Version bump; the Unreleased section becomes 1.16.0: files on panel forms, checked,
e-mailed to the company and never stored (forms.attachments, File field, streamed
endpoint with the security wall and abort/timeout handling); attachments over SMTP
and Microsoft Graph (upload session, mailbox copy deleted); test e-mail with a
10 MB file; Turnstile reset and BuilderForm honeypot fixes; Graph token cache.
What projects must update: nothing required; to use files — option, File field,
migration on Postgres/SQLite, formClasses keys, proxy body limit, Graph
Mail.ReadWrite or SMTP. Verify on real systems: Graph 10 MB send and cleanup,
Traefik timeout on a slow upload, SMTP size limit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-13 17:18:50 +01:00
Radosław SmolińskiandClaude Opus 5.5 3cde9974d0 Merge claude/form-attachments-9694cb: files on forms, e-mailed and never stored
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-13 17:13:55 +01:00
Radosław SmolińskiandClaude Fable 5.2 6f006825a4 Form files: an upload aborted while the gates are pending no longer leaves its attempt key registered
Re-review of 1.16.0: beforeFiles could resume after the request was answered and
register the attempt key with nobody left to release it. It now stops after every
await once the request is over; the registration has no await before it.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-13 17:09:14 +01:00
Radosław SmolińskiandClaude Fable 5.2 7ecfb26eb1 Reference: refreshed skills copy (upload timeouts)
Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-13 17:04:03 +01:00
Radosław SmolińskiandClaude Fable 5.2 e24c918d4b Form files: a dropped, stalled or endless upload is aborted and frees its slot, attempt key and buffers
Security review of 1.16.0 (blocking): a request body that errored mid-file never
resolved, leaking the concurrency slot and the attempt key. Also: idle and request
timeouts (submit.idleTimeoutMs / timeoutMs), ImmutableId preference on every Graph
draft call, the remaining total in the too-large message, files sent to a form
without a File field are refused and logged.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-13 17:02:10 +01:00
Radosław SmolińskiandClaude Fable 5.2 cd74d7decb Reference: refreshed skills copy and generated types for the file messages
Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-13 16:52:18 +01:00
Radosław SmolińskiandClaude Fable 5.2 97202ee03e Form files: the visitor is told when the problem is the file — why and what to do; UTF-8 file names
Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-13 16:51:05 +01:00
Radosław SmolińskiandClaude Fable 5.2 b6f9f34705 Form attachments: tests for project options and the concurrency guard
Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-13 16:44:41 +01:00
Radosław SmolińskiandClaude Fable 5.2 ea43d94dd2 Reference index: describe the mail sink
Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-13 16:43:41 +01:00
Radosław SmolińskiandClaude Fable 5.2 fdb6140c09 Form attachments: reference smoke test with a mail sink, Turnstile reset fix, docs
Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-13 16:42:39 +01:00
Radosław SmolińskiandClaude Fable 5.2 387debc88c WIP: reference site — File field on the quote form, mail sink smoke test
Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-13 16:34:34 +01:00
Radosław SmolińskiandClaude Fable 5.2 b7fb1b0e31 WIP: form attachments — agent guide, skills, seed template, changelog
Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-13 16:32:45 +01:00
Radosław SmolińskiandClaude Fable 5.2 344574d6bd WIP: form attachments docs (forms, email, security, storage, deployment, notifications), honeypot value sent
Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-13 16:30:44 +01:00
Radosław SmolińskiandClaude Fable 5.2 701bb420c1 WIP: form attachments — unit tests, test e-mail with attachment, lint
Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-13 16:28:22 +01:00
Radosław SmolińskiandClaude Fable 5.2 02b1e96d3d WIP: form attachments tests
Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-13 16:24:27 +01:00
Radosław SmolińskiandClaude Fable 5.2 6003b3d7d7 WIP: form attachments (e-mail only) — core, endpoint, Graph large upload
Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-13 16:20:02 +01:00
Radosław SmolińskiandClaude Fable 5.2 0ba0014ed5 Form attachments proposal: Graph upload session recommended (Mail.ReadWrite already granted)
Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-13 16:04:07 +01:00
Radosław SmolińskiandClaude Fable 5.2 62bed415ed Form attachments proposal: e-mail only, no storage (revision 2)
Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-13 16:01:18 +01:00
Radosław SmolińskiandClaude Fable 5.2 d2caf8c2ae Form attachments: design proposal
Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-13 15:55:45 +01:00
Radosław SmolińskiandClaude Opus 5.5 755f510c9f 1.15.5 upgrade notes
CI / check (push) Canceled after 0s
CI / reference (push) Canceled after 0s
CI / reference-full (push) Canceled after 0s
ipal-upgrade: "→ 1.15.5" section. PROGRAMISTA §6: item 60. Reference site: skills
and the AGENTS.md pointer on 1.15.5; INDEX.md regenerated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-13 14:35:22 +01:00
Radosław SmolińskiandClaude Opus 5.5 970307f3ab 1.15.5
Version bump; the Unreleased section becomes 1.15.5: required fields with
references are seeded complete; a stricter dry run (missing $form / $page is an
error there too). What projects must update: nothing required; a required reference
cycle now fails clearly.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-13 14:35:22 +01:00
Radosław Smoliński c7e198fd92 Merge claude/seeder-required-refs: required fields with references are created complete
createSeeder's first pass resolves { $page } / { $form } references to existing
records, so a required layout is created complete; a forward $page is filled in
pass 2 and a record whose required field needs it waits for that page. Required
cycles and never-appearing targets are an error with nothing written; the dry run
reports the same, including a missing $form. Guards, create-only, the edit check
and SEED_ONLY are unchanged. Reported from vanstevpl-web.
2026-11-13 14:31:52 +01:00
Radosław SmolińskiandClaude Opus 5.5 748ef9286f Seeder: required fields with references are created complete (1.15.5)
A page whose required layout holds a { $page } / { $form } reference could not be
created: pass 1 left the whole field out, validation rejected the record, and the
dry run reported a create (vanstevpl-web, 1.15.4).

- pass 1 resolves references to records that exist (or were created earlier in
  the run), so the field is written complete
- a { $page } to a page later in the same call is null in pass 1 and filled in
  pass 2; a record whose required field needs it is retried once that page exists
- required links in a cycle and references to pages or forms that never appear
  are an error with nothing written; unknown page targets are found while
  planning, so the dry run reports them too
- dry run: a missing form is an error (was a placeholder); a form planned earlier
  in the same dry run counts as existing
- real-Payload tests (pl, en, de): the report's careers page, an existing form
  target, optional and required forward links, a cycle, missing page and form,
  create-only second runs, dry-run parity
- CHANGELOG Unreleased, seeding.md, api.md; reference skills refreshed

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-13 14:29:41 +01:00
Radosław SmolińskiandClaude Opus 5.5 179d5b0d79 1.15.4 upgrade notes
CI / check (push) Canceled after 0s
CI / reference (push) Canceled after 0s
CI / reference-full (push) Canceled after 0s
ipal-upgrade: "→ 1.15.4" section (repair with SEED_UPDATE, live site with SEED_ONLY,
edited records and global arrays by hand). PROGRAMISTA §6: item 59. Reference site:
skills and the AGENTS.md pointer on 1.15.4; INDEX.md regenerated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-12 15:39:27 +01:00
Radosław SmolińskiandClaude Opus 5.5 2f00fe3ad6 1.15.4
Version bump; the Unreleased section becomes 1.15.4: seeding whole localized arrays
keeps every language. What projects must update: nothing required; repairing records
an earlier seed wrote needs SEED_UPDATE=1 (locally first; on production with SEED_ONLY
and IPAL_SEED_ALLOW_PROD_UPDATE=1 after a backup), edited records and global arrays
by hand.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-12 15:39:26 +01:00
Radosław Smoliński a79740cd44 Merge claude/seeder-localized-arrays: whole localized arrays keep every language
createSeeder / writeLocales: a value seeded per language as a whole (form fields,
nested select options, page layouts, global arrays) keeps the stored row ids in
every locale instead of only the last language surviving; localized: true fields
keep rows per locale. Seed guards, the edit check and SEED_ONLY are unchanged.
Reported from vanstevpl-web.
2026-11-12 15:35:38 +01:00
Radosław SmolińskiandClaude Opus 5.5 00e814e3ca Seeder: whole localized arrays keep every language (1.15.4)
createSeeder / writeLocales: a value written per locale as a whole —
fields: { pl: [...], en: [...], de: [...] }, a page layout, a global array —
returned the picked locale without walking into it, so each locale write made new
shared rows and only the last language survived (vanstevpl-web, 1.15.3).

- localize() localizes the picked value again with the stored rows, so row ids
  are shared across locales (arrays, blocks, nested arrays in blocks, groups)
- writeLocales passes the target's fields: a field that is itself localized
  (localized: true layout) never reuses another locale's row ids
- real-Payload regression test (pl, en, de): form with blocks and nested select
  options, shared and localized page layouts, global array via fillGlobal; a later
  PL save validates
- CHANGELOG Unreleased, seeding.md, api.md; reference skills refreshed

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-12 15:33:35 +01:00
Radosław SmolińskiandClaude Opus 5.5 4d1de4c66a 1.15.3 upgrade notes
CI / check (push) Canceled after 0s
CI / reference (push) Canceled after 0s
CI / reference-full (push) Canceled after 0s
ipal-upgrade: "→ 1.15.3" section. PROGRAMISTA §6: item 58. Reference site: skills
and the AGENTS.md pointer on 1.15.3; INDEX.md regenerated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-05 13:03:14 +01:00
Radosław SmolińskiandClaude Opus 5.5 3edf8865ed 1.15.3
Version bump; the Unreleased section becomes 1.15.3: ipal-audit and ipal-doctor no
longer report the panel's bilingual labels (adminText(), { en, pl }) as hardcoded
text; public text is still reported. What projects must update: nothing required;
pnpm ipal:skills for the updated audit scripts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-05 13:03:14 +01:00
Radosław Smoliński 594b958bb2 Merge claude/audit-admin-labels: the panel's bilingual labels are not hardcoded text
ipal-audit and the doctor's i18n-literals read the syntax tree (polish-literals.mjs,
a plain grep without TypeScript): adminText(), { en, pl } as label, singular, plural,
description, placeholder or group, a rowLabel() fallback and const x: AdminText in a
schema file are accepted. Still reported: every .tsx file, Polish-only labels, other
keys, anything under defaultValue. Reported from the Niezly Dandys project.
2026-11-05 12:59:28 +01:00
Radosław SmolińskiandClaude Opus 5.5 f73465c3bb ipal-audit, ipal-doctor: the panel's bilingual labels are not hardcoded text
"Hardcoded Polish text in code" (i18n-literals) grepped every string, so adminText() and { en, pl }
labels in schema files were reported, though AGENT.md 6.5a asks for them. polish-literals.mjs reads
the syntax tree with the project's TypeScript (a plain grep without it) and spares those forms in
schema files only; every .tsx file, Polish-only labels, other keys and defaultValue still fail.
Reported by Niezly Dandys (1.15.2).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-05 12:55:44 +01:00
Radosław SmolińskiandClaude Opus 5.5 36b27ed323 1.15.2 upgrade notes
CI / check (push) Canceled after 0s
CI / reference (push) Canceled after 0s
CI / reference-full (push) Canceled after 0s
ipal-upgrade: "→ 1.15.2" section. PROGRAMISTA §6: item 57. Reference site: skills
and the AGENTS.md pointer on 1.15.2; INDEX.md regenerated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-03 15:08:08 +01:00
Radosław SmolińskiandClaude Opus 5.5 627cad792a 1.15.2
Version bump; the Unreleased section becomes 1.15.2: ipal-doctor finds the frontend
route group by structure (any app/(<group>) with the catch-all page, layout.frontend
override, findFrontend), accepts notFoundView.ts/.tsx. What projects must update:
nothing required; remove a temporary layout-required silence.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-03 15:08:08 +01:00
Radosław Smoliński c33b264306 Merge claude/doctor-route-groups: ipal-doctor finds the frontend by structure
layout-required takes any app/(<group>) (or app) that holds the catch-all page, a
localized one first, instead of the literal (frontend); two candidates warn.
notFoundView may be .ts or .tsx; required files accept their usual extensions.
ipal-doctor.json layout.frontend wins; new export findFrontend. Reported from the
Say Diamonds project.
2026-11-03 15:04:22 +01:00
Radosław SmolińskiandClaude Opus 5.5 b80770bc2e ipal-doctor: find the frontend route group by structure, accept notFoundView.tsx
layout-required no longer assumes src/app/(frontend): any app/(<group>) (or app itself) holding the
catch-all page is the frontend, a localized one first; two candidates give a warning naming both.
notFoundView.ts or .tsx, and the usual extensions for the other required files. New
ipal-doctor.json layout.frontend override and export findFrontend. Reported by Say Diamonds
(1.15.1, route group (site)).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-03 15:00:05 +01:00
Radosław SmolińskiandClaude Opus 5.5 a515bd6851 1.15.1 upgrade notes
CI / check (push) Canceled after 0s
CI / reference (push) Canceled after 0s
CI / reference-full (push) Canceled after 0s
ipal-upgrade: "→ 1.15.1" section. PROGRAMISTA §6: item 56. Reference site: skills
and the AGENTS.md pointer on 1.15.1; INDEX.md regenerated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 19:27:46 +01:00
Radosław SmolińskiandClaude Opus 5.5 09bff6a683 1.15.1
Version bump; the Unreleased section becomes 1.15.1: guardSeedExit() (a seed that
ends early exits 1 with the reason), wired into the seed templates and the
reference site; reference smoke tests start their own server. What projects must
update: nothing required; add guardSeedExit(), check echo $? after a seed in Coolify.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 19:27:46 +01:00
Radosław SmolińskiandClaude Opus 5.5 e715b5720d Reference smoke tests never test another project's server; skills refreshed
- reference/playwright.config.ts: reuseExistingServer only with E2E_REUSE_SERVER=1.
  Playwright starts the built site itself on E2E_BASE_URL's port (default 3100) and
  fails when the port is taken — before, a dev server of another project on 3100
  (intecion.com's) was tested instead. CI is unchanged: it starts nothing before
  test:e2e. README's production check follows.
- reference/.agents/skills refreshed after the seed-exit-guard merge (ipal-form and
  ipal-site seed templates, ipal-reference); INDEX.md regenerated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 19:24:05 +01:00
Radosław Smoliński 03515c66c4 Merge claude/seed-exit-guard: guardSeedExit() — a seed that ends early exits 1, never a silent 0
guardSeedExit() (@intecion/ipal-kit/seed, opt-in): a beforeExit guard exits 1 with
the reason when a seed run ends before Payload initializes or before summary();
createSeeder and summary() mark the stages. Wired into the reference seed and the
ipal-site / ipal-form seed templates. Normal exit codes are unchanged.
2026-10-29 19:23:18 +01:00
Radosław SmolińskiandClaude Opus 5.5 f789e36636 Seeds: guardSeedExit() — a run that ends early exits 1 with the reason, never a silent 0
payload run starts the CLI with `void start()` and imports the script; when the script's top-level await
is left without live handles, Node exits with code 0 and no output — a success in Coolify's Terminal.
guardSeedExit() (@intecion/ipal-kit/seed, dependency-free) listens for beforeExit: until summary() runs it
prints "[seed] ended before Payload initialized" / "… before the seed finished" and exits 1. createSeeder
marks the run initialized, summary() finished; process.exit paths (normal, errors, the production
refusals) are untouched. Wired into the ipal-site and ipal-form seed templates and the reference seed, so
ipal-kit create sites get it. Tests include a real child process started like payload run.
Docs: seeding.md, deployment.md §4.7, AGENT.md, ipal-reference (+ api.md), CHANGELOG Unreleased.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 19:19:14 +01:00
Radosław Smoliński 55dc69b69f Merge claude/starter-gate-refusal: the production full-seed check needs the guard's message
CI / check (push) Canceled after 0s
CI / reference (push) Canceled after 0s
CI / reference-full (push) Canceled after 0s
starter:gate passes the production full-seed check only when the output says
"full seed refused" and the exit is non-zero; a payload run that ends before
Payload initializes (exit 0, no output) is inconclusive and retried, up to 3 times.
Fixes the flaky check found in the 1.15.0 gate.
2026-10-29 17:03:28 +01:00
Radosław SmolińskiandClaude Opus 5.5 7e1f09c95a starter:gate: the production full-seed check needs the guard's message; an early exit is retried
payload run can end with exit 0 and no output before Payload initializes (its bin does `void start()`;
when the script's top-level await is left without live handles, Node exits). Such a run proved nothing
but passed or failed the `refused !== 0` check at random. Now only "full seed refused" with a non-zero
exit counts; a run without "[ipal] Plugin initialized" is inconclusive and retried up to 3 times; all
three inconclusive fails the gate with that reason.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 17:01:43 +01:00
Radosław Smoliński 27a6e78ea3 Merge claude/reference-e2e-entrylist: blog-archive smoke test expects h2 or h3 card titles
After the entry-list heading fix (37131e9/6f56ef4) card titles are h2 when the list
has no section heading; the reference smoke test selector is now :is(h2, h3) a.
Without it CI's reference-full job fails. One file: reference/e2e/smoke.spec.ts.
2026-10-29 17:01:40 +01:00
Radosław SmolińskiandClaude Opus 5.5 ec649acb36 Reference smoke test: entry card titles are h2 or h3
The entry-list SEO fix (37131e9) renders card titles as h2 when the list has no
section heading; the blog-archive test looked for h3 only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 17:00:34 +01:00
Radosław SmolińskiandClaude Opus 5.5 d944217e3a 1.15.0 upgrade notes
ipal-upgrade: "→ 1.15.0" section with the 10 steps and a check. PROGRAMISTA §6:
item 55. Reference site: skills refreshed (ipal-upgrade) and the AGENTS.md pointer
on 1.15.0; INDEX.md regenerated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 16:56:18 +01:00
Radosław SmolińskiandClaude Opus 5.5 a5802f591f 1.15.0
Version bump; the Unreleased section becomes 1.15.0: ipal-kit create (starter),
ipal-doctor, design tokens, block library and page templates, reference site
(INDEX.md shipped), database names and seeding after launch, reference-site plugin
fixes, 2FA texts, CookieButton, SEO fixes, exact dependency pins; What projects must
update (10 steps).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 16:56:18 +01:00
Radosław SmolińskiandClaude Opus 5.5 40925f9331 Reference index regenerated after the merges
The merge-time regeneration ran while reference/ipal-doctor.json was still
unmerged, and git ls-files lists an unmerged path once per stage, so its section
was written three times. Regenerated with the merges complete.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 16:48:42 +01:00
Radosław Smoliński 6ffcfaf461 Merge claude/starter-gate-fresh: starter:gate packs a fresh tarball every run
starter:gate gives every run a fresh tarball (no stale pnpm dlx cache) and proves
which plugin code generated the site (bundle/cli stamp). No conflicts; the
until-silence filter in generate.ts (aa88e4e) is kept.
2026-10-29 16:47:00 +01:00
Radosław Smoliński ba73e82e6f Merge claude/reference-seo-content: own meta descriptions, fuller demo content
Reference site: every page has its own meta description, demo archive and service
pages have real-length content; blocksToMarkdown reads section headers.

Conflicts resolved: reference/ipal-doctor.json — both branches removed their own
two live-seo silences, so the merged file keeps only the two permanent rules
(audit:collections-present, i18n-literals); docs/agent/reference-site/INDEX.md
regenerated with pnpm reference:index.
2026-10-29 16:46:53 +01:00
Radosław Smoliński 7432ee751f Merge claude/entrylist-seo: item headings follow the section, LCP image, fillGlobal skip
Block library: item headings sit one level below their section (itemHeadingLevel),
the leading block's first image is the LCP image (blockPosition, leadsWithImage,
blockHasImage); fillGlobal skips a field that already holds the seeded value.
Removes the two block-library live-seo silences from reference/ipal-doctor.json.
2026-10-29 16:46:31 +01:00
Radosław SmolińskiandClaude Opus 5.5 37131e9930 fillGlobal: a field already holding the seeded value is skipped, not rewritten
Seeding exactly the default (allowThemeToggle: true) used to count as unset,
rewrite it and report create on every run. Now: skip (exists), no write. A choice
at its default is still replaced by a different seeded value; editor changes stay.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 16:39:55 +01:00
Radosław SmolińskiandClaude Opus 5.5 64ee581098 Reference site SEO: own meta descriptions, fuller demo content; blocksToMarkdown reads section headers
- blocksToMarkdown: the library's section header (heading → ##, then intro; eyebrow
  skipped), intro, quote and bio are content. Pages whose text sat only in a hero
  (archive pages, quote, 404) auto-filled no meta description and fell back to the
  site description; /md and llms-full.txt also missed every section heading.
- legal() template: the placeholder names its page, so unfilled privacy/terms pages
  don't share a description.
- reference: every demo page has its own meta description (pl/en), posts and case
  studies use their excerpt; fuller made-up text on services, contact, quote and
  the archives (all pages >= 150 words); no seeding of allowThemeToggle (its default,
  fillGlobal rewrote it on every run). The two content silences are gone.

ipal-doctor --strict --offline --deep --url: 0/0/0 (4 silenced: 2 permanent,
2 entryList follow-ups of the block-library track). Smoke tests 15/15.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 16:38:09 +01:00
Radosław SmolińskiandClaude Opus 5.5 6f56ef4205 Block library: item headings follow the section; the leading block's first image is the LCP image
Found by ipal-doctor live-seo on the reference archive pages (entry list under a
page header without a picture): cards jumped h1 → h3, and the first card image
was lazy.

- itemHeadingLevel: items one below the section heading (h3 under h2, h2 under the
  page h1, h2 when the block shows no heading); createBlockRegistry({ itemHeadings })
  fixes a level per block. featureGrid, entryList, pricing, steps, team.
- blockPosition / blockHasImage (root): createPageRoute and the 404 view pass
  firstImage next to isFirst; leadsWithImage marks the first image of the leading
  block eager + fetchPriority high (hero, textMedia, featureGrid, gallery, team,
  entryList); priorityImage: false turns it off.
- reference/ipal-doctor.json: the two live-seo silences removed; reference skills
  and docs/agent/reference-site/INDEX.md refreshed.
- bin/ipal-blocks.mjs executable like the other bins.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 16:38:04 +01:00
Radosław SmolińskiandClaude Opus 5.5 e7e756a0d7 starter:gate: a fresh tarball every run and proof of which code made the site
pnpm's dlx cache is keyed by the spec, so the gate reused the previous run's plugin when the
tarball path stayed the same. Each run now packs to a new file name and calls dlx with
--config.dlx-cache-max-age=0. build:starter records the plugin commit in the bundle; ipal-kit
create records the bundle's sha256 and that commit in .ipal/starter.json; the gate checks both,
and the installed plugin, against the packed tarball.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 16:30:24 +01:00
Radosław SmolińskiandClaude Opus 5.5 dd11bc8146 ipal-audit: skip the starter's //: alternative lines; reference skills refreshed
CI / check (push) Canceled after 0s
CI / reference (push) Canceled after 0s
CI / reference-full (push) Canceled after 0s
- audit.sh g(): matches on a starter alternative line (`//: …` after file:line:,
  the commented-out variants inside @starter:if markers) are dropped. The reference
  site's `//: robots: { aiBots: 'block-training' }` / 'disallow' alternatives made
  `audit:robots-blocks-ai-bots` fire although the site blocks no AI bots. The doctor
  runs audit.sh, so it follows. Tests: a //: line is not a finding, a real
  robots: { aiBots: 'block-training' } line still is.
- reference/.agents/skills refreshed with ipal-skills (ipal-reference, ipal-setup,
  ipal-site and ipal-audit were behind the plugin's after the doctor/starter merges).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 16:27:49 +01:00
Radosław SmolińskiandClaude Opus 5.5 aa88e4ea39 Starter: new sites don't inherit the reference site's temporary silences
Merge follow-up for doctor + starter (both fine alone; three tests failed
together):
- generate.ts: an inherited ipal-doctor.json rule with `until` is a temporary
  follow-up of the reference site itself (the four live-seo silences until
  2026-11-30); a new site starts with those checks on. Permanent, reasoned
  exceptions (i18n-literals, audit:collections-present) are still inherited.
- reference/src/instrumentation.ts: the doctor's cookieCrawl header comment is
  wrapped in @starter:if crawl, so a site without crawl doesn't mention it.
- docs/agent/reference-site/INDEX.md regenerated (the merge-time copy repeated
  the ipal-doctor.json section).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 16:20:36 +01:00
Radosław Smoliński 6d7d39bc95 Merge claude/project-starter-build: ipal-kit create (project starter)
ipal-kit create <domain> generates a new site from the reference site (bin
ipal-kit, /starter entry, gzipped template bundle built at prepublishOnly,
starter:gate); exact pins of the plugin's own four dependencies (D15, nodemailer
10.3.1); the single-language / non-pl-default refusal; reference/ @starter:if
markers, packageManager, cookieCrawl.

Conflicts resolved:
- reference/src/instrumentation.ts: the starter's multi-line ipalEnvRules with
  the @starter:if markers (the doctor's cookieCrawl comment line merged above
  assertEnv already).
- reference/ipal-doctor.json: the doctor's version, keeping the four live-seo
  silences (until 2026-11-30) — the starter's side was the pre-silence copy.
- docs/agent/skills/ipal-reference/resources/api.md: both /starter and /doctor.
- docs/CHANGELOG.md: both sides in both hunks; one Unreleased section.
- docs/agent/reference-site/INDEX.md: regenerated with pnpm reference:index.
2026-10-29 16:16:49 +01:00
Radosław Smoliński 704f3104df Merge claude/ipal-doctor-build: ipal-doctor (one command that checks a site against the team rules)
The ipal-doctor bin and /doctor entry: static and deep checks (blockLibraryManifest,
old-style block maps, 2FA behind a switch, folder name as database base), per-site
ipal-doctor.json with per-rule off/files/reason/until, and the reference CI doctor
steps turned on. The reference site runs at zero findings with four live-seo
follow-ups silenced with reasons until 2026-11-30.
2026-10-29 16:15:52 +01:00
Radosław SmolińskiandClaude Opus 5.5 4c97bc1a81 Reference site: deep + live ipal-doctor run at zero; four seo-check follow-ups silenced with reasons until 2026-11-30
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 16:11:58 +01:00
Radosław SmolińskiandClaude Opus 5.5 01afa6fab8 Starter: inherit the reference doctor silences and packageManager; cookieCrawl active in the reference
Same reference/package.json, reference/ipal-doctor.json and ci.yml env lines as claude/ipal-doctor-build,
so the two branches merge cleanly there. ipal-doctor.json of a new site keeps i18n-literals (the /design
styleguide) and audit:collections-present only while posts/caseStudies are in.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 16:11:33 +01:00
Radosław Smoliński 04ae19e489 Merge commit '977872b' into claude/ipal-doctor-build
# Conflicts:
#	src/modules/seo/buildSitemapEntries.ts
2026-10-29 16:08:40 +01:00
Radosław SmolińskiandClaude Opus 5.5 e97cf6d7d9 ipal-doctor: old-style block maps, 2FA behind a switch, folder name as database base; first sweep table
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 16:06:46 +01:00
Radosław SmolińskiandClaude Opus 5.5 a4e8cfeae8 ipal-doctor: one command that checks a site against the team rules
bin ipal-doctor + @intecion/ipal-kit/doctor: static rules (versions, Node 22, AGENT.md §3
layout and naming, database names, env rules, headers, X-Powered-By, CSP, 2FA, cookie
scanner, adminMeta, AGENTS.md, skills, seeds, block library via blockLibraryManifest,
ipal-audit --quick), registry rules (latest plugin, pnpm audit --prod), live rules (--url,
ipal-seo-check), deep rules (--deep via payload run; GET /api/ipal/doctor, off until
IPAL_DOCTOR_TOKEN). Human / JSON output, --strict, exit codes 0/1/2/3, --sites drift table,
ipal-doctor.json with reasons, until, files, seen.

Fixes found on the way: sitemap leaves out the System pages 404 page; ipal-audit finds
array labels after fields, any form seed, runs grep in UTF-8; ipal-seo-check counts
duplicate titles per language. Reference site at zero findings (static), CI steps on.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 16:03:00 +01:00
Radosław SmolińskiandClaude Opus 5.5 0dffb85ec1 Starter: refuse single-language and non-pl-default sites explicitly (later); docs and tests
ipal-kit create stops before writing anything and points to the manual ipal-setup path;
project-starter.md, AGENT.md, ipal-setup, ipal-site and the CHANGELOG say the same.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 15:56:19 +01:00
Radosław Smoliński 0170419473 Merge commit '977872b' into claude/project-starter-build 2026-10-29 15:51:32 +01:00
Radosław SmolińskiandClaude Opus 5.5 804a09efed Project starter: ipal-kit create <domain> generates a new site from the reference site
- bin `ipal-kit` (subcommand `create`): the architecture questions (or --answers JSON),
  rendering from reference/ through starter.manifest.json (placeholders, @starter:if variants,
  //: alternatives, demo dropped), answers into AGENTS.md "Project decisions" and ipal-doctor.json,
  local .env with a fresh PAYLOAD_SECRET, install from the shipped lockfile, ipal-skills,
  ipal-tokens, generate:types/importmap, typecheck, ipal-doctor when shipped, secret check,
  first commit
- @intecion/ipal-kit/starter: the building blocks (renderSite, validateAnswers, applyVariants,
  collectBundle, lockfileWithoutPlugin, secretFindings …)
- build:starter packs reference/ into dist/starter/template.json.gz (90 KB);
  starter:gate in prepublishOnly: site from the packed tarball, frozen install, seed, build,
  targeted SEED_ONLY seed in production mode, full seed refused, pnpm start checks
- D15: plugin dependencies pinned exactly (nodemailer 10.3.1)
- reference/: @starter:if markers (runs as before), manifest generate/variants/rewrite
- docs: project-starter.md, AGENT.md, ipal-setup, ipal-site, ipal-reference (+ api.md),
  README, PROGRAMISTA §2, CHANGELOG, docs/README, reference index

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 15:50:44 +01:00
Radosław SmolińskiandClaude Opus 5.5 977872b0ad Reference smoke test: drop the KNOWN 404 sitemap filter
ipal-kit now leaves the page assigned as 404 out of the sitemap (unlistedPageIds,
merged in 30c1015), so the smoke test checks every sitemap URL again. Verified:
seed, build and 15/15 Playwright smoke tests on a throwaway MongoDB.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 15:48:52 +01:00
Radosław Smoliński fd6eb293cb Merge claude/totp-pl-cookie-button: plain en/pl 2FA texts, CookieButton above the footer
TOTP_TEXTS (en, pl) merged over payload-2fa's, project translations still win,
twoFactor.texts: false keeps the package's; tab titles on the 2FA views
(TOTP_VIEW_TITLE). CookieButton lifts above the footer (avoid, default
COOKIE_BUTTON_AVOID; side; bottomOverlap; --ipal-cookie-button-inset). Admin
language keeps following the browser (no fallbackLanguage change).

Merge addition: the branch had no CHANGELOG entry — both items added under New
in the one Unreleased section, plus Requires project changes item 6 (CookieButton).
2026-10-29 15:46:09 +01:00
Radosław Smoliński 30c1015daa Merge claude/reference-site-plugin-fixes: 404 page unlisted, own-origin media, fillGlobal defaults
The page assigned as the 404 page is left out of the sitemap, llms.txt, the site
index, search, the search route and MCP search_content (unlistedPageIds;
createSearchRoute settingsSlug). buildImagesConfig allows the site's own
/api/media/file/** when R2_PUBLIC_URL is empty. fillGlobal treats a choice field
still at its default as empty. i18n.md: renderLabel client wrapper. No conflicts;
one Unreleased CHANGELOG section.
2026-10-29 15:45:49 +01:00
Radosław SmolińskiandClaude Opus 5.5 2886c89d8a 2FA screens: plain en/pl texts and tab title; CookieButton moves up above the footer
- TOTP_TEXTS (admin-ux.md wording) merged over @clocklimited/payload-2fa's
  long, informal texts; the project's i18n.translations still win;
  twoFactor.texts: false keeps the package's. Setup/verify screens titled
  "Two-step verification" / "Weryfikacja dwuetapowa" instead of "Payload".
- CookieButton: position via --ipal-cookie-button-offset / -inset and
  --ipal-z-header; lifts above the footer (avoid, default COOKIE_BUTTON_AVOID)
  while it is on screen; side prop; className still replaces the look.
- dev: a footer in the frontend layout to check the button against.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 15:34:01 +01:00
Radosław SmolińskiandClaude Opus 5.5 0ab133fbd7 ipal-doctor proposal: build order
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 15:33:03 +01:00
Radosław SmolińskiandClaude Opus 5.5 6493b58ccd ipal-doctor proposal: owner's decisions D1-D9 (D5 = createSeeder only/SEED_ONLY, D7 = new sites only, no Dockerfile rules)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 15:33:03 +01:00
Radosław SmolińskiandClaude Opus 5.5 9e583a92c9 ipal-doctor proposal: blockLibraryManifest, slug-based duplicate match
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 15:33:03 +01:00
Radosław SmolińskiandClaude Opus 5.5 8cd9830a22 ipal-doctor proposal: block library rules
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 15:33:03 +01:00
Radosław SmolińskiandClaude Opus 5.5 1a3a52a1be ipal-doctor proposal: starter clashes (src allow list, ui/ with createBlockRegistry, per-rule reasons, plugin-latest warning)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 15:33:03 +01:00
Radosław SmolińskiandClaude Opus 5.5 a1f810e9de ipal-doctor proposal: [dir], --strict, localhost HSTS exemption
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 15:33:03 +01:00
Radosław SmolińskiandClaude Opus 5.5 a65e109894 ipal-doctor proposal with dry-run table
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 15:33:03 +01:00
Radosław SmolińskiandClaude Opus 5.5 6b2c9b3cc6 Search leaves out the 404 page: searchContent, the search route, MCP search_content
searchContent / listContent read Site settings once (depth 0, homepage + notFound)
and skip unlistedPageIds; createSearchRoute and the MCP route pass settingsSlug.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 15:31:43 +01:00
Radosław Smoliński 154049662e Merge claude/reference-site-build: reference site (Example Studio) on ipal-kit
reference/ (not shipped, own lockfile, plugin as file:..) builds a complete site
on the plugin; docs/agent/reference-site/INDEX.md (shipped) maps features to its
files, with a test; AGENT.md and skill pointers, PROGRAMISTA §8.1b, a Gitea CI job
that builds, seeds and smoke-tests it. Checked here: plugin gate green; reference
seed, next build (SSG) and 15/15 Playwright smoke tests on a throwaway MongoDB.

Merge addition: CHANGELOG Unreleased line for the reference site index.
2026-10-29 15:31:20 +01:00
Radosław SmolińskiandClaude Opus 5.5 3645e61f7d Fixes from the reference site: 404 page unlisted, own-origin media, fillGlobal defaults, switcher docs
- sitemap, llms.txt and the site index leave out the page assigned as the 404
  page (unlistedPageIds, exported); it stays when it is also the homepage
- buildImagesConfig: in production with R2_PUBLIC_URL empty, allow the site's
  own /api/media/file/** so next/image no longer answers 400
- fillGlobal: a choice field (select, radio, checkbox, number, date) still at its
  defaultValue counts as empty; text is never overwritten
- docs: LanguageSwitcher renderLabel needs a 'use client' wrapper (i18n.md,
  ipal-site, ipal-setup, api.md)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 15:29:07 +01:00
Radosław SmolińskiandClaude Opus 5.5 e43198b2fe Reference site: follow main's block and token fixes
- entryList entryCollection, post template hero with the title, legal templates noindex
  (drop the reference's own workarounds)
- brand primary-inverse roles: 74/74 contrast pairs
- /design shows Light and Dark panels (tokens switch on any element)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 15:21:55 +01:00
Radosław Smoliński 353e65e7bd Merge branch 'main' into claude/reference-site-build 2026-10-29 15:17:24 +01:00
Radosław SmolińskiandClaude Opus 5.5 8adac41f92 Reference site: Example Studio on ipal-kit (reference/), index for agents, CI job
reference/ is one complete client site on the plugin (made-up company, pl/en,
MongoDB, every library block and template, token standard light/dark, forms,
consent, SEO/GEO, enforced CSP, 2FA, base + demo seeds, Coolify runbook,
smoke tests). It uses the plugin as file:.. (injected) and is not shipped.

- docs/agent/reference-site/INDEX.md (generated by scripts/reference-index.mjs,
  kept current by test/referenceIndex.test.ts)
- AGENT.md section and pointers in ipal-site, ipal-setup, ipal-reference,
  ipal-upgrade, ipal-block; release steps in PROGRAMISTA §8.1b
- CI: reference (fast) on every push, reference-full on main; doctor steps
  wired, commented until ipal-doctor ships

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 15:17:11 +01:00
Radosław Smoliński d992d131a2 Merge claude/block-library-fixes: block fixes from the visual test, tokens on any element
The seven block fixes from the reference site's first visual test (entryList field
entryCollection: Mongoose reserves 'collection'; contact, hero, CMSLink, templates),
plus claude/design-tokens-build d6675d2: data-theme switches tokens on any element
(LIGHT_SELECTOR / DARK_SELECTOR), primary-inverse / primary-inverse-text roles in
the contrast report, theme.md one-icon note, ipal-form formClasses.ts on token
utilities. No conflicts; one Unreleased CHANGELOG section.

Merge addition: AGENT.md names primary-inverse-text next to primary-inverse.
2026-10-29 15:10:34 +01:00
Radosław SmolińskiandClaude Opus 5.5 570a90761b Merge claude/design-tokens-build (d6675d2): theme on any element, primary-inverse roles
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 15:05:14 +01:00
Radosław SmolińskiandClaude Opus 5.5 d6675d2979 Design tokens: themes on any element, primary-inverse, form template
Follow-ups from the reference site's first visual test:
- data-theme="dark"/"light" switches the tokens on any element (LIGHT_SELECTOR,
  DARK_SELECTOR as selector lists); the base layer colours a themed panel's text
- inverted sections re-map primary / primary-hover / primary-text to the new
  primary-inverse / primary-inverse-text roles; the contrast report checks them
  (inherited roles resolved on the ancestor, as the cascade does)
- ipal-form formClasses.ts on token utilities + buttonClass(); theme.md: one-icon
  ThemeSwitcher pattern (the default two-option toggle stays)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 15:04:54 +01:00
Radosław SmolińskiandClaude Opus 5.5 29ede3ad4b Block library: fixes from the first visual test on the reference site
- CMSLink: a link that wraps content (a logo, a card) and leads nowhere keeps the
  content — an empty link group ({ type: 'internal' }) no longer hides logos
- entryList: field `collection` → `entryCollection` (Mongoose reserves
  `collection`; unreleased, snapshot updated) + a test against reserved names
- post template starts with a page hero holding the title (the page's h1)
- legal and cookie policy templates set noindex: true (AGENT.md §0c)
- hero background: a full bg-overlay scrim under the text
- MediaValue accepts any object (generated Media types fit without a cast)
- contact: Turnstile renders dark in an inverted section

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 15:03:39 +01:00
Radosław SmolińskiandClaude Opus 5.5 8bb5ebd394 Reference site proposal (approved design, D1-D10)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 14:32:19 +01:00
Radosław Smoliński 51f80cea13 Merge claude/block-library-build: block library (15 blocks, /blocks, /blocks/rsc, /templates, ipal-blocks)
Fifteen opt-in library blocks (libraryBlocks({ ... }) from /blocks, rendered with
createBlockRegistry from /blocks/rsc), templates (/templates), the ipal-blocks
eject CLI and blockLibraryManifest; block sources ship in src/modules/block-library
for eject. Nothing is on by default; fields, variants, slugs, labels, part
classes, primitives and components are overridable. Seeder { $form } fix. Label
changes "New tab" / "Show contents" (no data change). Contains the design-tokens
branch (already merged). No conflicts; one Unreleased CHANGELOG section.
2026-10-29 14:30:42 +01:00
Radosław Smoliński f5dba85155 Merge claude/design-tokens-build: design tokens (tokens.css, tailwind.css, a11y.css, ipal-tokens)
One design-token standard: tokens.css (neutral defaults, light/dark on
data-theme), tailwind.css preset, a11y.css, fluid variables, the /tokens entry and
the ipal-tokens CLI. CookieBanner and CookieButton read the single token names;
the legacy -dark variables stay as the dark fallback, which now follows the
page's color-scheme (a site without a dark theme no longer gets a dark banner on
a dark-mode device). Font slots --font-family-body / --font-family-heading.
2026-10-29 14:30:26 +01:00
Radosław SmolińskiandClaude Opus 5.5 f338324762 Block library: styles step uses the token styles.css; test that every token utility exists in the preset
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 14:17:00 +01:00
Radosław SmolińskiandClaude Opus 5.5 e686fb2af5 Merge claude/design-tokens-build: design tokens (tokens.css, tailwind.css, ipal-tokens)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 14:14:17 +01:00
Radosław SmolińskiandClaude Opus 5.5 6e6de5d0cc Block library: noSnippet option for sections repeated on every page
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 14:13:37 +01:00
Radosław SmolińskiandClaude Opus 5.5 2a07fb8844 Block library: docs, agent guide, skills; picker order as an explicit list
- docs/block-library.md: setup, every block (fields, variants, accessibility),
  options, registry, primitives, eject, page templates, seeding after launch,
  versioning, manifest, turn off / override / extend
- AGENT.md (compass, how to add, §6, §6.3, module map), ipal-block (library
  block first), ipal-site (phases 2, 4, 6, 8), ipal-reference (wiring rows,
  export index), seed-content template from pageTemplates, seeding.md ($form)
- CHANGELOG Unreleased; proposal marked built with an as-built section

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 14:12:50 +01:00
Radosław SmolińskiandClaude Opus 5.5 2d1cc0e77d Block library: 15 blocks, registry, primitives, templates, manifest, eject
- @intecion/ipal-kit/blocks: libraryBlocks() opt-in, one builder per block, field
  builders, option merging, blockLibraryManifest, faqItemsFromLayout
- @intecion/ipal-kit/blocks/rsc: createBlockRegistry, the block components and UI
  primitives (token utilities only; next/image and next/link passed in)
- @intecion/ipal-kit/templates: 10 page templates as createSeeder data
- createSeeder: { $form: title } references
- ipal-blocks eject <block>
- tests: options, rendering and a11y per block, Payload + seeding, GraphQL, admin
  wording, schema snapshot (versioning), eject imports
- shorter admin labels: link "New tab", table of contents "Show contents"

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 14:05:47 +01:00
Radosław SmolińskiandClaude Opus 5.5 07d54da893 Design tokens: lint fixes (sorted catalogue, linear regexes), tokens.css regenerated
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 14:02:49 +01:00
Radosław SmolińskiandClaude Opus 5.5 cf205c59ef Design tokens: docs, agent guide, skills, audit checks
- docs/design-tokens.md (new module page), README index, CHANGELOG
- AGENT.md §0b row 19, §6.11 rewritten for the standard, §6.11a, §7, §10, §12, §14
- ipal-setup stage 5, ipal-block section-code (Section with data-surface, Button,
  card on token utilities), ipal-site phase 8, ipal-reference (+ api.md /tokens
  section), ipal-upgrade 1.15.0 note, ipal-audit SKILL + audit.sh token checks
- theme.md, consent.md, accessibility.md (a11y.css), lightbox.md, PROGRAMISTA §2.5
- /tokens entry lists its exports explicitly; docs coverage test includes it

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 14:00:31 +01:00
Radosław SmolińskiandClaude Opus 5.5 ca8e93eaf4 Design tokens: ipal-tokens CLI, components on single names, templates, tests
- bin ipal-tokens: src/design/tokens.ts → src/design/tokens.css, --check, WCAG
  contrast report (fails on AA errors; --report, --warn-only)
- CookieBanner / CookieButton read the single --ipal-* roles; the fallback follows
  color-scheme via light-dark() and still honours the legacy -dark variables
- lightbox fade reads --ipal-duration / --ipal-ease-out
- DESIGN.md and tokens.ts templates in ipal-setup/resources

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 13:55:59 +01:00
Radosław SmolińskiandClaude Opus 5.5 9511b12d19 Design tokens: tokens.css, tailwind.css, a11y.css and the TS token module
tokens.css (neutral --ipal-* defaults, light/dark, inverse scope, reduced motion) is
generated from src/modules/tokens/catalog.ts. tailwind.css maps the utilities.
New @intecion/ipal-kit/tokens entry: IPAL_TOKENS, ipalVar, IPAL_BREAKPOINTS,
defineTokens, tokensToCss, contrastReport, fluidClamp. fluid.css / fluid-wide.css
gain fs-xs, fs-h4, space-stack, space-section-sm.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 13:52:37 +01:00
Radosław SmolińskiandClaude Opus 5.5 7918eaf6d4 Block library proposal: blockLibraryManifest export for ipal-doctor
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 13:44:57 +01:00
Radosław SmolińskiandClaude Opus 5.5 48c2a3a5a8 Block library proposal: record the owner's decisions D1–D10
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 13:44:57 +01:00
Radosław SmolińskiandClaude Opus 5.5 0eeb7cd280 Block library proposal: inverse section scope agreed with design tokens
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 13:44:57 +01:00
Radosław SmolińskiandClaude Opus 5.5 c7e2d237e7 Block library proposal: use the agreed design token names
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 13:44:57 +01:00
Radosław SmolińskiandClaude Opus 5.5 4ece5a5823 Block library proposal (design only)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 13:44:57 +01:00
Radosław SmolińskiandClaude Opus 5.5 500c534bc9 Design tokens proposal: fluid-wide in the styles.css example
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 13:44:55 +01:00
Radosław SmolińskiandClaude Opus 5.5 18075bb7df Design tokens proposal: record approved decisions
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 13:44:55 +01:00
Radosław SmolińskiandClaude Opus 5.5 9286468ce9 Design tokens proposal: inverse surface scope
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 13:44:55 +01:00
Radosław SmolińskiandClaude Opus 5.5 655b12a232 Design-token standard proposal (draft for approval)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 13:44:55 +01:00
Radosław Smoliński 0ed3898370 Merge claude/db-names-seed-after-launch: database name rule, seeding after launch
Database name rule <domain without dots>_prod / _dev; ipalEnvRules({ databaseName })
warns only (default off); databaseNamesFor, databaseNameFromUri, checkDatabaseName.
createSeeder only / SEED_ONLY: a run touches named records only; a full seed of
production or a non-local database is refused unless IPAL_SEED_ALLOW_FULL=1 or
guard.allowFull (dry runs never refused, guard: false turns guards off).

Merge additions: CHANGELOG "## Unreleased" with Requires project changes;
guard.allowFull and guard: false in ipal-reference SKILL.md and api.md.
2026-10-29 13:29:57 +01:00
Radosław SmolińskiandClaude Opus 5.5 af7d96f0e3 Database naming rule; seeding after launch touches named records only
- Rule (VERY IMPORTANT): databases are named <domain without dots>_prod /
  _dev (intecion.com → intecioncom_prod / intecioncom_dev) on MongoDB and
  Postgres — AGENT.md top rules, deployment.md §4.2a (Coolify), env.md,
  ipal-setup architecture questions (derive, then confirm), AGENTS.md
  template. ipalEnvRules({ databaseName }) warns (never fails) on a
  mismatch, domain from NEXT_PUBLIC_SERVER_URL or { domain }, { warn }
  overridable; helpers databaseNamesFor, databaseNameFromUri,
  checkDatabaseName from the root and /env.
- Rule (VERY IMPORTANT): after launch never re-seed everything — AGENT.md,
  seeding.md, ipal-site, ipal-form, ipal-reference. createSeeder gains
  `only` / SEED_ONLY (pages:slug, forms:title, global:slug, collection:*;
  the rest → "skip (not listed)") and refuses a run with no record list
  against a production / non-local database unless IPAL_SEED_ALLOW_FULL=1
  (guard.allowFull; dry runs allowed). Seed templates carry an ONLY list;
  the form seed touches only its own form.
- Tests: seed only/full-run guard, database-name helpers and warning.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 13:27:46 +01:00
Radosław SmolińskiandClaude Opus 5.5 9ecab39783 1.14.6 upgrade notes
CI / check (push) Canceled after 0s
ipal-upgrade and PROGRAMISTA §6 item 54 point at 1.14.6 (1.14.5 never
published), with the 1.14.5 steps kept.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 12:21:21 +01:00
Radosław SmolińskiandClaude Opus 5.5 c407ed33fc 1.14.6
Version bump and CHANGELOG entry: the admin link-preview hook fix; 1.14.5 was
tagged but never published, projects go from 1.14.4 to 1.14.6 with the 1.14.5
steps.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 12:21:21 +01:00
Radosław SmolińskiandClaude Opus 5.5 71f7108cb8 Admin link-preview hook never throws without a Payload instance
syncAdminMeta returned to payload.logger in its catch even when payload was
undefined, so the Site settings afterChange hook threw with req: {} (an
unhandled rejection that made vitest, and npm publish for 1.14.5, exit 1).
Return early without payload, log through payload?.logger, skip the call in the
hook without req.payload; the fillEmptyLocales hooks get the same guard. Tests:
sync without payload, and every plugin global afterChange hook with req: {}.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 12:21:21 +01:00
Radosław SmolińskiandClaude Opus 5.5 838a2f70b2 1.14.5 upgrade notes
CI / check (push) Canceled after 0s
ipal-upgrade: one "→ 1.14.5" section with the 7 steps (replaces the two
unversioned notes). PROGRAMISTA §6: item 54. seo.md points at 1.14.5.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 12:13:57 +01:00
Radosław SmolińskiandClaude Opus 5.5 53f9010910 1.14.5
Version bump; the Unreleased section becomes 1.14.5: GraphQL 500 fix (title
separator enum names), theme key 'theme', cookie storage type, admin link
previews (adminMeta, agency), graphql-scalars override, agent rules and
external skills; what projects update (7 steps incl. Postgres titleSeparatorSql).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 12:13:57 +01:00
Radosław Smoliński 8c61951a26 Merge claude/agent-rules-arch: architecture questions first, ipal-kit first, external skills
Agent guide and skills: ask architecture questions before building, use ipal-kit
first (report a gap and wait), code rules. Five vendored third-party skills (text
only, pinned SHAs, licences, sha256 manifest in docs/agent/external), copied only
with ipal-skills --external. scripts/vendor-external-skills.mjs is a maintainer
script and is not shipped.
2026-10-29 12:11:28 +01:00
Radosław Smoliński 0fc9add2b6 Merge claude/graphql-enum-names: fix /api/graphql 500 (title separator enum names)
Site settings -> Title separator values are GraphQL enum names (pipe, endash,
hyphen, middot, slash); legacy stored characters map on read and write, MongoDB
is rewritten on init, Postgres projects add titleSeparatorSql() to the generated
migration. test/graphqlSchema.test.ts builds the full schema.

Merge resolution, docs/CHANGELOG.md (one Unreleased section): both new
"What projects must update" items kept — 5 graphql-scalars override, 6 title
separator SQL, plus a note that code reading settings.titleSeparator gets a name
(titleSeparatorChar).
2026-10-29 12:11:21 +01:00
Radosław Smoliński 6702553e69 Merge claude/deps-graphql-scalars: override graphql-scalars to ^2.0.1
Repo-only pnpm override "graphql-scalars@<2.0.1": "^2.0.1" (GHSA-x8rm-f576-gq67,
high, via @payloadcms/graphql); the docs recommend it to projects on payload
3.90.x-3.92.x. pnpm audit --prod: only the deepmerge low.
2026-10-29 12:11:00 +01:00
Radosław SmolińskiandClaude Opus 5.5 bb10fb10fd Fix /api/graphql 500: Site settings title separator values are GraphQL enum names
The titleSeparator select stored '|', '–', '-', '·', '/'. Select values become
GraphQL enum names; '|', '–', '·' are invalid and '-' and '/' collide on '_', so
every project's /api/graphql answered 500 since 1.0.1 (admin/REST unaffected).

- Values are now pipe/endash/hyphen/middot/slash (same labels); TITLE_SEPARATORS
  and titleSeparatorChar map them to the character; titles accept old characters
  and custom project values literally
- Field afterRead/beforeChange turn an old stored character into its name
- MongoDB: rewritten at start (migrateTitleSeparator); Postgres: titleSeparatorSql()
  for the generated migration (verified up/down/up against Postgres 16)
- Test builds the full plugin GraphQL schema and fails on invalid or duplicate
  enum names; unit tests for the mapping, hooks, SQL and Mongo rewrite
- CHANGELOG Unreleased (Fixed + upgrade step 5), seo.md, ipal-upgrade, api.md

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 12:06:55 +01:00
Radosław SmolińskiandClaude Opus 5.5 e1f82ce387 ipal-skills --external: vendored third-party agent skills, pinned
- docs/agent/external: Vercel react-best-practices and composition-patterns
  (MIT), Addy Osmani accessibility (MIT), Anthropic frontend-design
  (Apache-2.0), official Payload skill at v3.92.1 (MIT) — text only, each
  with its licence, SOURCE.md (repo, commit) and an override note in front
  of the SKILL.md (ipal-kit first, Payload fetching over swr, DESIGN.md
  tokens, Payload 3 not 4); manifest.json with sha256 per file
- scripts/vendor-external-skills.mjs (maintainer, not shipped): fetches by
  full commit SHA only, rejects non-text or executable files, regenerates
  the manifest; --check verifies it
- ipal-skills --external [names]: copies ext-* after checking every file
  against the manifest, downloads nothing, never touches ext-* folders
  without ipal-kit's SOURCE.md, removes only retired ones it installed;
  an unknown name stops the run before anything is copied
- AGENT.md §14, ipal-setup stage 2 (optional step), README: usage,
  overrides, how to update the pins
- test/externalSkills.test.ts: pins are SHAs, no branch fetch, checksums,
  text only, licences, override note, installer leaves other folders alone

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 11:54:35 +01:00
Radosław SmolińskiandClaude Opus 5.5 927798105e Security: override graphql-scalars to ^2.0.1 (GHSA-x8rm-f576-gq67)
@payloadcms/graphql pins graphql-scalars 1.22.2 up to the latest Payload
(3.92.1), so no Payload upgrade fixes the high PhoneNumber ReDoS advisory.
Repo-only pnpm.overrides entry "graphql-scalars@<2.0.1": "^2.0.1" (not passed
to projects). Payload only imports DateTimeResolver and EmailAddressResolver;
checked against the dev app's /api/graphql: login, DateTime and EmailAddress
as input and output, a JSON field, and an invalid e-mail rejected.

pnpm audit --prod: 1 high + 1 low -> 1 low (deepmerge, no fix published).
Docs: AGENT.md §4 item 12, ipal-setup, ipal-upgrade, README, CHANGELOG
Unreleased recommend the same override to projects.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 11:50:51 +01:00
Radosław SmolińskiandClaude Opus 5.5 25719ae7ec Agent guide: ask architecture questions first, ipal-kit first, code rules
- AGENT.md: "Ask before you build" (languages, styling, content, forms,
  analytics/consent, SEO/GEO, database + media, admin, hosting/DNS) —
  answers go to AGENTS.md "Project decisions", never guessed; "ipal-kit
  first" hard rule — a gap is reported to the owner and the agent waits
  for the decision, no hand-built replacements or silent workarounds;
  short "Code rules" (SRP, small files, no duplicates, typed, i18n texts,
  checks) pointing to §8
- ipal-setup stage 0 and ipal-site phase 0: the architecture question
  list, answered before building; content questions keep defaults
- ipal-plugin-gap: report, offer options, wait, record the decision;
  ipal-block/collection/form/debug and vibe aligned; AGENTS.md template
  and the ipal-skills pointer block carry the rules
- docsConsistency: the rules reach every site-building skill

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 11:46:50 +01:00
Radosław Smoliński f57d089f55 Merge claude/admin-white-label-meta: admin link previews, agency option
adminMeta (default on): panel title suffix, description, og:site_name, preview
image (/api/ipal/admin-og) and icon (/api/ipal/admin-icon) from Site settings,
robots noindex,nofollow on /admin; per-piece overrides, adminMeta: false, the
project's admin.meta wins. agency option (default Intecion.com, false = none).

Merge resolution:
- docs/CHANGELOG.md: one Unreleased section covering storage-keys and this
  branch (Changed: credit text; New: adminMeta, agency; upgrade step 4).
- dev importMap.js: regenerated with IPAL_DEV_2FA=1, so it keeps the TOTP
  entries (2FA fix) and adds AdminIcon, AdminLogo, IntecionCredit (whiteLabel).
2026-10-29 11:38:17 +01:00
Radosław Smoliński 3d16db5c22 Merge claude/storage-keys: theme key 'theme', storage types in the cookie list
Theme choice stored under 'theme' (theme.storageKey to change it); a choice under
the old 'ipal-theme' key moves once, before paint, and only into an empty key.
Cookie scanner integration "Theme choice" for the localStorage key. A storage
select on Cookies -> Cookie list rows and in the detail labels, with a Type
column in <CookieTable> (Postgres: enum + cookie_settings_cookies.storage +
detail_labels_storage).
2026-10-29 11:37:15 +01:00
Radosław SmolińskiandClaude Opus 5.5 0629cf7595 Cookie scanner: Polish names of the storage types match the cookie list
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 11:31:58 +01:00
Radosław SmolińskiandClaude Opus 5.5 3c828d963d Admin link previews: site name, description, preview image, noindex; technology support credit
- adminMeta (default on, with or without whiteLabel): robots noindex/nofollow,
  title suffix "— <site> | Panel", og:site_name and en/pl description from
  Site settings, preview image GET /api/ipal/admin-og (next/og, from the logo
  or name, no external service) and icon GET /api/ipal/admin-icon
- the site name sits in a process-wide store read through getters, so link
  previews stay current after a Site settings save and across config loads
- agency option (default Intecion.com) feeds the credit, description and image;
  credit reads "Technology support: Intecion.com" (pl: Wsparcie technologiczne)
- the project's own admin.meta keys always win; adminMeta: false / agency: false
- dev: whiteLabel on; docs: white-label.md, AGENT.md, ipal-reference/setup/upgrade

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 11:31:42 +01:00
Radosław SmolińskiandClaude Opus 5.5 b5368cdc61 Theme key 'theme', storage keys in the cookie scanner, type in the cookie list
- Theme choice in localStorage under 'theme' (next-themes' key and values)
  instead of 'ipal-theme'. ThemeScript moves an old choice before the first
  paint and removes the old key; useTheme / ThemeSwitcher do the same
  without the script. ipalKit({ theme: { storageKey } }) sets an own key,
  which reaches ThemeScript through getSiteShell().theme and <html
  data-theme-storage>.
- The cookie scanner declares the theme key (Theme choice: local storage,
  necessary, until changed or site data is cleared) when the theme switch
  is on, so Scan cookies finds it without a crawl.
- Cookies -> Cookie list rows get a Type (cookie / local storage / session
  storage, default cookie, shared by every language), filled by scan, review
  and approval. The detailed settings window and <CookieTable> show it with
  English and Polish defaults; the approval page marks storage entries.
- Migration: adds cookie_settings_cookies.storage (DEFAULT 'cookie') and
  cookie_settings_locales.detail_labels_storage, nothing else.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 11:29:56 +01:00
Radosław SmolińskiandClaude Opus 5.5 6998b44431 1.14.4 upgrade notes
CI / check (push) Canceled after 0s
ipal-upgrade: "→ 1.14.4" section. PROGRAMISTA §6: item 53.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 23:02:00 +01:00
Radosław SmolińskiandClaude Opus 5.5 e1f42615f3 1.14.4
Version bump and CHANGELOG entry: fillEmptyLocales (empty languages of the
cookie texts filled, own text never overwritten), cookieScanner.adminLayout
'combined' (one Cookies entry with Review and approve / Site check tabs), Cookie
banner renamed Cookies, known issue, what projects update.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 23:02:00 +01:00
Radosław Smoliński eab26c98ca Merge claude/cookie-admin-merge: fill empty languages, one Cookies entry in the admin
fillEmptyLocales (default on): text written in one language fills the empty
languages of cookie-list and cookie-review purpose/duration; a language with its
own text is never overwritten (false or per-slug fields to change it).
cookieScanner.adminLayout (default 'combined'): the Cookie banner global is
"Cookies" with "Review and approve" and "Site check" tabs; cookie-review and
cookie-crawl leave the navigation, their data, API and /admin/cookie-approval
stay ('separate' keeps the old entries). No schema change (Postgres
migrate:create: no schema changes).
2026-10-28 23:00:41 +01:00
Radosław SmolińskiandClaude Opus 5.5 cad299c132 Remove a local dev-server launch file committed by mistake
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 22:57:35 +01:00
Radosław SmolińskiandClaude Opus 5.5 49e27175ae Dev app: import map entries for the Cookies tabs
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 22:57:24 +01:00
Radosław SmolińskiandClaude Opus 5.5 b10c2dc0e3 Cookies: fill empty languages, and one Cookies entry in the admin
Every language filled (fillEmptyLocales, default on): text saved in one
language goes to every language where the same field is still empty, never
over a language's own text. Applies to the cookie list (purpose, duration)
and the cookie review (purpose, duration). Scanner and approval writes give
a language without its own text the default language's text. Building
blocks: buildFillEmptyLocalesGlobalHook / CollectionHook, fillEmptyLocales,
withFillLocales.

One Cookies entry (cookieScanner.adminLayout, default combined): the
Cookie banner global is now labelled Cookies and gets Review and approve
(scan box and approval list inline) and Site check tabs, built from ui
fields. Cookie review and Cookie check leave the navigation
(admin.group false) but keep their pages, data and API. This is
presentation only: no schema change and no migration, only
generate:importmap. adminLayout separate keeps the old layout.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 22:55:11 +01:00
Radosław SmolińskiandClaude Opus 5.5 a9e1adc03b 1.14.3 upgrade notes
CI / check (push) Canceled after 0s
ipal-upgrade: "→ 1.14.3" section for the cookie approval flow. PROGRAMISTA §6:
item 52.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 22:26:53 +01:00
Radosław SmolińskiandClaude Opus 5.5 44598bbef2 1.14.3
Version bump and CHANGELOG entry: Approve cookies page with one Approve and add,
New/Changed/Needs description/No longer found markers, unknownCategory,
dashboard and e-mail reminders, approval: false, new exports, the lookup change
for hand-typed rows, and what projects with cookieScanner update.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 22:26:53 +01:00
Radosław Smoliński 5f4f2a07ab Merge claude/cookie-approve: one approval for everything a cookie scan finds
/admin/cookie-approval (Approve cookies): one "Approve and add" for the ticked
cookies into Cookie banner -> Cookies in every locale; statuses New, Changed,
Needs description, No longer found; never overwrites editor text, never
duplicates or deletes. Unknown cookies -> approval.unknownCategory (default
marketing). Dashboard and e-mail reminders. cookieScanner.approval: false keeps
the per-entry review. New cookie-review fields change and needsDescription
(Postgres: one enum column + index, one boolean).
2026-10-28 22:23:24 +01:00
Radosław SmolińskiandClaude Opus 5.5 9b9c5fc872 Dev app: import map entry for the cookie approval view
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 22:20:51 +01:00
Radosław SmolińskiandClaude Opus 5.5 86ff3f5ff7 Cookie scanner: one approval for everything a scan finds
After "Scan cookies" or a site check, the new Approve cookies view
(/admin/cookie-approval) lists what waits, grouped by consent category, with
provider, purpose and duration and New / Changed / Needs description markers.
One "Approve and add" puts every ticked cookie into Cookie banner -> Cookie
list in every locale. That list feeds the cookie policy table and the
detailed settings window.

- Never overwrites editor text or categories, never adds a second row (a
  pattern and a concrete name are the same cookie), never deletes.
- Unknown cookies are approved into a category that needs consent
  (approval.unknownCategory, default marketing) and flagged Needs
  description; writing a purpose clears the flag.
- Cookies a scan or crawl no longer finds are flagged No longer found, for
  review only.
- The dashboard and the crawl e-mail say how many cookies wait and link to
  the view; nothing is added without approval.
- Optional: cookieScanner.approval false keeps per-entry review.
- Migration: cookie-review gains change and needsDescription.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 22:17:46 +01:00
Radosław SmolińskiandClaude Opus 5.5 0e7966dfbb 1.14.2 upgrade notes
CI / check (push) Canceled after 0s
ipal-upgrade, PROGRAMISTA §6 item 51 and security.md point at 1.14.2 instead of
"after 1.14.1".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 21:34:09 +01:00
Radosław SmolińskiandClaude Opus 5.5 2cadb425d6 1.14.2
Version bump; the Unreleased section becomes 1.14.2: 2FA setup-loop fix
(TotpRedirectProvider), twoFactor.provider, totpRedirectTarget/totpAdminPath,
known issue (low deepmerge advisory via payload), what projects with 2FA update.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 21:34:09 +01:00
Radosław Smoliński 41065940e8 Merge claude/recursing-wright-be31dd: fix the 2FA setup loop
ipal-kit swaps @clocklimited/payload-2fa's TOTPProvider (it read the path from an
x-pathname header nothing sets on /admin, so setup-totp?back=null redirected to
itself) for TotpRedirectProvider (/admin), which reads the path in the browser.
twoFactor.provider: own component, or false to keep the package's. Pure rules:
totpRedirectTarget, totpAdminPath. Server-side TOTP enforcement (the package's
access wrapper) is unchanged. Dev app: IPAL_DEV_2FA=1 turns 2FA on.
2026-10-28 21:30:03 +01:00
Radosław SmolińskiandClaude Opus 5.5 60f744e3ad Fix the 2FA setup loop: setup-totp?back=null redirected to itself
@clocklimited/payload-2fa's admin provider reads the current path from an
x-pathname request header. Nothing sets it on /admin (the createProxy matcher
skips /admin), so the path was null: every admin page, the setup screen too,
redirected to /admin/setup-totp?back=null, forever. Every new admin on a site
with 2FA got stuck.

ipalKit now swaps that provider for its own TotpRedirectProvider
(@intecion/ipal-kit/admin, client-side): it reads the path in the browser,
never redirects away from the setup/verify screens or logout, and renders
nothing while redirecting. twoFactor.provider takes a project component, or
false to keep the package's. totpRedirectTarget / totpAdminPath export the
rules. Projects run generate:importmap.

Test: test/totpRedirect.test.ts (redirect walk, provider swap). Dev app:
IPAL_DEV_2FA=1 turns 2FA on. Docs: security.md, CHANGELOG (Unreleased),
AGENT.md, ipal-setup/-upgrade/-debug/-reference, PROGRAMISTA item 51.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 21:27:19 +01:00
Radosław SmolińskiandClaude Opus 5.5 4e254057f9 1.14.1 upgrade notes
CI / check (push) Canceled after 0s
ipal-upgrade: the X-Powered-By/CSP section is now "→ 1.14.1". PROGRAMISTA §6:
item 50 for 1.14.1.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 21:53:22 +01:00
Radosław SmolińskiandClaude Opus 5.5 cdf80744ea 1.14.1
Version bump and CHANGELOG entry: withSecurityConfig (hide X-Powered-By),
opt-in CSP through buildSecurityHeaders({ csp }) with report-only/enforce and
reports, createCspReportRoute, buildAdminCspHeaders, opt-in nonces, new buildCsp
flags with extra/override, ipal-audit header check; nothing required on upgrade.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 21:53:22 +01:00
Radosław Smoliński 86ff9e3df0 Merge claude/csp-powered-by-ee307c: hide X-Powered-By, opt-in CSP with reports, admin policy, nonces
withSecurityConfig hides X-Powered-By (hidePoweredBy: false to keep it).
buildSecurityHeaders({ csp }) is off unless passed; report-only first, then
enforce, with reportUri / Reporting-Endpoints. buildCsp flags with extra and
override, buildAdminCsp(Headers), createCspReportRoute. Nonces only with
createProxy({ csp }) + SiteProviders nonce, so static and ISR pages stay static.
2026-10-27 21:37:39 +01:00
Radosław SmolińskiandClaude Opus 5.5 ff4c595b91 Security: hide X-Powered-By, CSP report-only with reports, admin policy and nonces
- withSecurityConfig: poweredByHeader false + strips X-Powered-By from headers()
  (Next's and withPayload's), works on either side of withPayload
- buildSecurityHeaders({ csp }): CSP + Reporting-Endpoints; mode switches
  report-only → enforce
- buildCsp: reportUri/reportGroup, nonce + strict-dynamic, dev unsafe-eval,
  metaPixel/linkedIn/tiktok/clarity flags, media-src for R2, override
- buildAdminCsp(Headers): looser policy for Payload admin (Monaco CDN, blob workers)
- createCspReportRoute + parseCspReports: report collector for both formats
- createProxy({ csp }) + createCspNonce: per-request nonce, x-nonce header;
  SiteProviders/ThemeScript/Analytics/ConsentScript accept nonce
- docs: security.md, AGENT.md, ipal-setup/reference/upgrade; ipal-audit checks

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 21:28:11 +01:00
Radosław SmolińskiandClaude Opus 5.5 771dda1c6f 1.14.0 upgrade notes
CI / check (push) Canceled after 0s
ipal-upgrade: the 1.14.0 section walks through the 8 "What projects must
update" items. PROGRAMISTA §6: item 48 marked 1.14.0, new item 49.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 16:52:47 +01:00
Radosław SmolińskiandClaude Opus 5.5 2051a01190 1.14.0
Version bump and CHANGELOG entry: image lightbox, cookie scanner (scan and
browser crawl), admin in English and Polish, admin follow-ups, Next 16.4.3 and
sharp 0.35.5 in dev, nodemailer 10 and Node >=20.9, test/dev generate:types fix,
and what projects must update.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 16:52:47 +01:00
Radosław Smoliński 117d5c642d Merge claude/deps-audit-nodemailer-2fa: dependency advisories
nodemailer ^8 -> ^10.2.1 (ships its own types; @types/nodemailer removed),
engines.node >=20.9.0. Repo-only pnpm.overrides for Payload's transitive
dependencies (undici, dompurify, fast-uri, js-yaml, browserslist, source-map-js,
fast-copy, baseline-browser-mapping); consumers are not bound by them, and the
docs recommend the dompurify/undici overrides for projects on payload 3.90.x.
pnpm audit --prod: no known vulnerabilities. New emailTransports and twoFactor tests.
2026-10-27 16:45:07 +01:00
Radosław SmolińskiandClaude Opus 5.5 007a0a3ae6 Dependency advisories: nodemailer 10, overrides for Payload's pinned deps
- nodemailer ^8.0.1 -> ^10.2.1 (advisories up to 10.1.3); drop @types/nodemailer,
  nodemailer 10 ships its own types. Node engines >=20.9.0 (nodemailer 10 needs 20+).
- pnpm.overrides (repo only, not passed to projects) for packages in payload 3.90.2's
  tree: undici and dompurify are exact-pinned upstream; fast-uri, js-yaml,
  browserslist, source-map-js, fast-copy, baseline-browser-mapping raised to fixed
  minimums. pnpm audit --prod: 19 high / 35 moderate / 11 low -> 0.
- Tests: SMTP over a local SMTP socket with real nodemailer (panelSmtpAdapter,
  sendEmail, unreachable server status), Microsoft Graph and Graph->SMTP fallback
  via mailAdapter; real payloadTotp through ipalKit, plus a check that payload-2fa
  resolves the project's payload.
- Docs: email.md, AGENT.md §4 item 12, ipal-setup, ipal-upgrade, README.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 16:42:05 +01:00
Radosław Smoliński 54fb57b7a9 Merge claude/relaxed-joliot-25dcb3: Next 16.4.3 and admin follow-ups
Dev dependencies: next and eslint-config-next 16.4.3, sharp 0.35.5 (fixes the
Next 16.0.0-16.4.0 advisories: 2 critical RCE, 1 high DoS); minimum safe Next
16.4.1 documented; peer range next >=15 unchanged.
Admin follow-ups: localised stats tab title (DocumentTitle), Polish cookie-scanner
integration names, construction notice close label, FaviconCheck hint under
Site settings -> Site icon (new import-map entry @intecion/ipal-kit/admin#FaviconCheck).
2026-10-27 16:34:01 +01:00
Radosław SmolińskiandClaude Opus 5.5 546806fe39 Admin follow-ups: localised stats tab title, scanner names, close label, favicon hint
- Statistics view: the browser-tab title follows the admin language.
  Payload's custom-view meta.title is one plain string and its custom-view
  metadata ignores i18n, so the view renders <DocumentTitle> (/admin) with the
  translated title; it re-applies the title while the view is open because
  Next streams the English metadata in after hydration. adminDocumentTitle()
  adds admin.meta.titleSuffix the way Payload does.
- Cookie scanner: CookieIntegration.label may be { en, pl, ... }. The built-in
  names without a product name come from the shared admin texts
  (cookieIntegration*, cookieSourceProject); the scan endpoint answers in the
  request's admin language and stored source names use the scanning editor's.
- Maintenance notice: getConstructionMode(locale) returns `locale`; the "x"
  close button gets a screen-reader name "Close" / "Zamknij" (locale and
  closeLabel props; constructionCloseLabel exported).
- Favicon: FaviconCheck (/admin, afterInput on Site settings -> Site icon)
  warns in the admin language when the image is under 48x48 or not square,
  without blocking the save; validateFaviconField shares faviconProblems().
- Docs, AGENT.md and skills: the above, plus Next.js 16.4.1 or later as the
  minimum safe version (AGENT.md 4.11, ipal-setup, ipal-upgrade).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 16:31:46 +01:00
Radosław SmolińskiandClaude Opus 5.5 6f32ea4cdb Dev dependencies: next and eslint-config-next 16.4.3, sharp 0.35.5
Next 16.0.0-16.4.0 is affected by GHSA-2464-fhr4-w9xw (RCE in image
optimization with SVG, fixed with sharp 0.35.5), GHSA-673q-mjm6-r5xr
(RCE in use cache) and GHSA-p3m5-59mp-jv5r (Server Actions DoS); all
fixed in 16.4.1. The peer range stays open.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 16:20:13 +01:00
Radosław Smoliński e475f476d3 Merge claude/admin-ux-wording-9e043e: admin in English and Polish, reworded
Admin languages default to English + Polish unless the project sets
i18n.supportedLanguages; plugin texts under the ipal namespace, project
translations win key by key. All admin wording rewritten and fields regrouped
per docs/dev/admin-ux.md, without changing slugs, field names or the schema
(Postgres migrate:create: no schema changes). Dev app no longer leaks
generate:types; test/adminUx.test.ts.
2026-10-27 16:18:41 +01:00
Radosław SmolińskiandClaude Opus 5.5 2dafcd0852 Tests: fix test-project typecheck (casts, Rule arity) and base-to-string lint warnings
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 16:17:40 +01:00
Radosław SmolińskiandClaude Opus 5.5 a92bc51814 Admin wording follow-ups from the browser check
- stats nav link reads "Statistics overview" (it renders after all nav groups)
- form-builder e-mails array labelled in en + pl
- dev import map: RowLabel (cookie banner rows)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 15:49:37 +01:00
Radosław SmolińskiandClaude Opus 5.5 0a2374db18 Docs: admin languages and texts, wording rule for agents, new screen names
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 15:46:25 +01:00
Radosław SmolińskiandClaude Opus 5.5 6b46bc0c14 Admin panel in English and Polish, reworded per docs/dev/admin-ux.md
- admin-i18n module: AdminText { en, pl }, component texts under the ipal
  namespace (project translations win), en + pl admin languages when the
  project sets none (project's supportedLanguages wins)
- every plugin label, description, option, tab and group as { en, pl };
  explicit labels instead of auto-labels; sentence case; glossary terms
- visible renames (slugs, names, data unchanged): Cookie banner, Form
  messages, Privacy group, Search engines, Maintenance, Spam protection,
  E-mail sending, stats nav link Overview (hidden without access)
- Polish visitor defaults by page locale: cookie banner, form messages,
  validators, lightbox, accessibility widget; {field} uses the label
- fixes: e-mail status banner used Turnstile wording; developer words and
  env var names out of editor messages; stats numbers/dates in the admin
  language; test e-mail no longer says ipal-kit
- test/adminUx.test.ts: length limits, en + pl present, no developer words

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 15:46:25 +01:00
Radosław Smoliński eeac33ed2f Merge commit '77b826e' into claude/admin-ux-wording-9e043e 2026-10-27 15:29:39 +01:00
Radosław SmolińskiandClaude Opus 5.5 839c34ab6f dev: stop Payload spawning generate:types on every dev start (orphan leak)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 15:29:39 +01:00
Radosław Smoliński 77b826e6d8 Merge claude/cookie-scanner-eef8a8: cookie scanner phases 1 and 2
cookieScanner option: cookie-review collection, Scan cookies (declarations +
bundled Open Cookie Database), opt-in browser crawl through
services/cookie-crawler with the cookie-crawl global and dashboard alert.

Overlap with claude/test-no-typegen, resolved here: one test-config fix.
- the six real-Payload tests keep buildTestConfig and drop the branch's
  duplicate typescript: { autoGenerate: false } lines;
- cookieScannerIntegration and cookieCrawlIntegration use buildTestConfig
  instead of buildConfig + their own flag (testConfig.test.ts guard passes).
2026-10-27 15:26:44 +01:00
Radosław Smoliński cb7e21de20 Merge claude/image-lightbox-15eabd: shared image lightbox
LightboxProvider / LightboxTrigger / LightboxDialog and lightboxImage from
/client, RenderRichText lightbox, SiteProviders lightbox, opt-in Notifications
labels (ipalKit lightbox: true), docs/lightbox.md and agent guide.
2026-10-27 15:26:31 +01:00
Radosław Smoliński 5d587760de Merge claude/test-no-typegen: tests boot Payload without type generation
buildTestConfig (test/helpers.ts) turns typescript.autoGenerate off for the six
real-Payload tests; test/testConfig.test.ts fails if a test calls buildConfig
directly.
2026-10-27 15:26:31 +01:00
Radosław SmolińskiandClaude Opus 5.5 433984e1e1 Cookie scanner: fixes from the browser test in the dev app
- The admin box uses Payload's Button (plain <button class="btn"> rendered
  unstyled), shows "Never run" before the first crawl and the note on a
  finished crawl (e.g. "Accept all" not found).
- The dashboard warning puts its link on its own line.
- Dev sandbox: cookieScanner { crawl: true } and the regenerated import map.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 15:21:17 +01:00
Radosław SmolińskiandClaude Opus 5.5 4bb9c663fd Cookie scanner, phase 2: browser crawl through a shared scanner service
cookieScanner.crawl (opt-in) adds "Crawl site" to the Cookie review box. The
site asks the shared scanner service (services/cookie-crawler: Node +
Playwright, Dockerfile, deployed once on Coolify) to crawl its sitemap pages
twice, with no consent and after "Accept all". The service posts cookies,
storage keys and third-party hosts back to POST /api/ipal/cookie-crawl/results
(bearer token, running job only). No browser in the site.

Findings land as drafts through the same merge rules. Anything stored before
consent that is not necessary, and tracker requests before consent, are
violations, flagged on the review entries from the latest crawl only. The
cookie-crawl global keeps the latest result (no history). A dashboard warning
(CookieCrawlAlert) and an opt-in e-mail through the project's mail adapter
follow a crawl with violations or new unknown cookies. Scheduled crawls: a
Coolify scheduled task with the token. ipalEnvRules({ cookieCrawl: true }).

Also: the six older real-Payload tests no longer leave an orphaned
payload generate:types process (typescript.autoGenerate: false).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 15:14:01 +01:00
Radosław SmolińskiandClaude Opus 5.5 c7c8c819ac admin-ux guide: Privacy group, label naming, default admin languages
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 15:13:22 +01:00
Radosław SmolińskiandClaude Opus 5.5 4c55d7aeff Admin wording and layout guide (docs/dev/admin-ux.md); dev editor login
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 15:10:49 +01:00
Radosław SmolińskiandClaude Opus 5.5 53a8920564 Tests: boot Payload without type generation, guard against the leak
Outside production getPayload() spawns a detached generate:types child.
With no PAYLOAD_CONFIG_PATH it never finds a config (tsconfig rootDir
'./' sends Payload's findUpSync into an endless loop), so every full
vitest run left six processes spinning at ~40% CPU.

- test/helpers.ts: buildTestConfig() = buildConfig with
  typescript.autoGenerate false
- the six tests that boot Payload use it
- test/testConfig.test.ts: fails if a test calls buildConfig directly

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 14:59:41 +01:00
Radosław SmolińskiandClaude Opus 5.5 4f69f6ed20 Cookie scanner test: no generate:types child on Payload init
Outside production, getPayload() spawns `payload generate:types` in the
background and that process never exits, leaving one orphan per test file
per run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 14:57:21 +01:00
Radosław SmolińskiandClaude Opus 5.5 a0545b6716 Cookie scanner, phase 1: declarations, database lookup, review list
ipalKit({ cookieScanner }) (opt-in) adds the cookie-review collection, a
"Scan cookies" box above its list and GET/POST /api/ipal/cookie-scan. A scan
lists the cookies of every integration the project switches on (consent,
admin login, locale, stats, GA4, GTM, Meta Pixel, Clarity, LinkedIn, TikTok,
Turnstile), the project's own declarations, and extra names looked up in the
bundled Open Cookie Database, as drafts. Editors accept (→ Cookie Settings →
Cookies, every locale, only empty text filled), edit or reject. A rescan never
deletes, never changes status and never overwrites edited text.

Everything is overridable (access, collectionOverrides, integrations,
declarations, databaseCategories, labels, syncAccepted) and the building
blocks are exported. Admin labels in en + pl. Docs: cookie-scanner.md,
consent.md, AGENT.md, ipal-reference, ipal-consent-check.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 14:55:20 +01:00
Radosław SmolińskiandClaude Opus 5.5 ab45cf48be Bundle the Open Cookie Database (Apache-2.0) with a refresh script
scripts/refresh-cookie-database.mjs (pnpm cookie-db:refresh) downloads the CSV
and license at a pinned commit, refuses a non-Apache license, and writes
src/modules/consent/scanner/data/openCookieDatabase.ts (source commit and
change notice in the header) plus docs/licenses/open-cookie-database-LICENSE.txt.
Nothing is fetched at runtime.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 14:55:19 +01:00
Radosław SmolińskiandClaude Opus 5.5 7eacf1e713 Docs: image lightbox page, agent guide, skills, audit check, upgrade note
- docs/lightbox.md: setup, sizes, styling, overrides, migration from a
  hand-made modal or glightbox
- AGENT.md (§6.9, §7 catalog, §7.1, §12), ipal-reference (option, wiring,
  api.md section), ipal-site and ipal-block steps, PROGRAMISTA §6 row 48
- ipal-audit warns about lightbox libraries
- notifications.md, richtext.md, media.md, frontend.md, README index

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 14:49:38 +01:00
Radosław SmolińskiandClaude Opus 5.5 476c3ac1df Shared image lightbox: LightboxProvider, LightboxTrigger, LightboxDialog, lightboxImage
Opt-in click-to-enlarge for small images (cards, galleries, rich text):
- /client: LightboxProvider (one viewer per site), LightboxTrigger (button
  around any thumbnail, works without a provider), LightboxDialog
  (controlled viewer), useLightbox / useOptionalLightbox
- accessible dialog: aria-modal, focus trap and return, Esc, arrows,
  Home/End, swipe, counter, caption, scroll lock, reduced motion
- lightboxImage builds src + srcSet from Payload image sizes
- labels: ipalKit({ lightbox: true }) adds Notifications -> Lightbox;
  getNotificationTexts().lightbox and getSiteShell().lightboxTexts,
  English fallbacks otherwise
- RenderRichText lightbox / withLightboxUploads wrap image uploads
- SiteProviders lightbox mounts the provider
- styling from --ipal-lightbox-* variables; unstyled + classNames,
  renderImage, renderDialog, icons, loop overrides
- tests with happy-dom (vitest's pinned optional peer)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 14:49:38 +01:00
Radosław SmolińskiandClaude Opus 5.5 e53d09b720 1.13.0 upgrade notes
CI / check (push) Canceled after 0s
ipal-upgrade: the 1.13.0 section walks through the 7 "What projects must
update" items with checks. PROGRAMISTA §6: item 47 for 1.13.0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 19:17:26 +02:00
Radosław SmolińskiandClaude Opus 5.5 72c059515d 1.13.0
Version bump and CHANGELOG entry: security and access, performance, SEO/GEO and
Search Console, @intecion/ipal-kit/seed, English docs and agent guide, small and
gap fixes, and what projects must update (behaviour change without access).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 19:15:35 +02:00
Radosław SmolińskiandClaude Opus 5.5 03fb6602fc ipal-reference: state how searchSettings and seo.searchSettings switch off the Search & AI tab
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 19:01:16 +02:00
Radosław SmolińskiandClaude Opus 5.5 5a07c42f76 Gap fixes: top-level searchSettings, public shouldLoadGoogle, consent/stats collection overrides
- ipalKit({ searchSettings }): switches off / reshapes Site Settings → Search & AI
  without `seo`; read as options.searchSettings ?? options.seo?.searchSettings.
- shouldLoadGoogle moved to a pure module (analytics/shouldLoadGoogle.ts) and
  exported from @intecion/ipal-kit and /client.
- consentLog.collectionOverrides and stats.collectionOverrides (object merges
  access/admin/hooks key by key, function takes over), via the new exported
  applyCollectionOverride / CollectionOverride. The stats view and dashboard
  chart now follow the stats-visits read access, so overrides narrow them too.

All additive; defaults unchanged. Docs: AGENT.md, ipal-reference, consent,
stats, seo, analytics, ipal-setup.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 18:54:08 +02:00
Radosław SmolińskiandClaude Opus 5.5 4911da7112 Small fixes: optional R2_PUBLIC_URL, seo.uploadsCollection, staff features without roles
- ipalEnvRules({ storage: true }): R2_PUBLIC_URL optional (media served by
  the app); storage: { requirePublicUrl: true } requires it again.
- seo.uploadsCollection: upload collection of the meta image (default media).
- userMeetsRole(req, minimum): the plugin's admin/editor features (Site
  Integrations, settings globals, test e-mail, stats, consent records, form
  submissions) stay reachable when `access` is omitted — without a roles
  field every logged-in account passes, as in Payload's default.
- IndexNow skip for seed writes is covered by test/seed.test.ts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 18:33:35 +02:00
Radosław SmolińskiandClaude Opus 5.5 cff76c2a69 Seed helper: @intecion/ipal-kit/seed (createSeeder + building blocks)
createSeeder(payload, { dryRun, update, force, guard, editCheck, context, ... })
returns upsertBySlug, upsertBy, fillGlobal and summary(); building blocks
isLocalDatabase, writeLocales, seedHash, projectOnto, editedSinceSeed.
Behaviour follows docs/seeding.md: create-only by default, natural keys,
never deletes, globals get empty fields only, every locale written with
fallbackLocale: false onto the same row ids, records edited since seeding
skipped, update refused on production / non-local DB unless
IPAL_SEED_ALLOW_PROD_UPDATE=1, context.ipalSkipIndexNow on every write.

Both seed templates now use the helper. Node-only entry (no 'server-only',
which throws under `payload run`). SQLite integration tests cover the
production guard, the edited-record skip, the hash field, row ids and
the IndexNow skip. Agent guide (AGENT.md, ipal-reference, ipal-site,
ipal-form) and seeding.md updated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 18:33:34 +02:00
Radosław SmolińskiandClaude Opus 5.5 b61b753ec2 Merge main (security-perf + SEO) into docs; finish English docs and agent guide
- Resolve conflicts in analytics, consent, content, i18n, mcp and stats,
  keeping the docs fixes and the new code behaviour, verified against src
- Translate the remaining 14 module pages, ipal-seo-check skill and script
- Integrate the security-perf and SEO agent-guide text: getRobots,
  isPathVisible, Search & AI (DNS verification first, meta fields optional),
  sitemap index/cache/503, consentMode basic/advanced, policyVersion,
  globalOverrides, revalidatePath / buildGlobalRevalidateHook, authAccess,
  firstUserAdmin, allowCollectionMismatch, unknown-IP rate limit; stale
  claims fixed across AGENT.md, skills, frontend, developer guide, vibe
- docsConsistency: pending list removed (all docs English); relative links
  now also check #anchors

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 17:59:52 +02:00
Radosław SmolińskiandClaude Opus 5.5 8646585b7e CLAUDE.md: main rule (the plugin helps projects, never limits them) and complete agent guide rule
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 17:48:26 +02:00
Radosław Smoliński 24a98ff836 Merge SEO, GEO and Search Console track
Conflict in createContentHelpers.ts resolved by keeping both: isPathVisible (per-path, security track) and constructionPaths (per-list, SEO track).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

# Conflicts:
#	src/modules/frontend/createContentHelpers.ts
2026-10-22 17:48:22 +02:00
Radosław SmolińskiandClaude Opus 5.5 924d4564e5 Merge security and performance track (audit fixes, secure defaults with overrides)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 17:48:17 +02:00
Radosław SmolińskiandClaude Opus 5.5 54c9d3ec10 isPathVisible shares one construction-mode read per list
MCP and search call it once per result; React cache doesn't dedupe in
route handlers, so a 50-result list read Site Settings 300 times.
Concurrent calls now share one in-flight read per locale (6 reads).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 17:40:02 +02:00
Radosław SmolińskiandClaude Opus 5.5 2d9f3e15d4 Docs in English (part 1), seeding guide, Coolify deployment
- Translate to English every doc the code branches did not touch: AGENT.md,
  developer guide, vibe, CHANGELOG, docs index, module pages, all skills
  except ipal-seo-check (14 pages follow after the security/SEO merge).
  Placeholder marker is now [TO FILL: …]; skill resources renamed to
  section-code.md / nav-code.md. AGENT.md and the ipal-skills pointer
  block say the docs are in English.
- docs/seeding.md: create-only, natural keys, never delete, no users or
  secrets, empty-field globals, fallbackLocale: false, dry run, backup and
  restore, production update guard, seeds vs migrations, Coolify Terminal.
  Seed templates gain --dry-run, the SEED_UPDATE production guard
  (IPAL_SEED_ALLOW_PROD_UPDATE), skip of edited records and a summary.
  "Seeding on production" rule block in AGENT.md.
- Coolify is the single deployment path (deployment, env, developer guide,
  ipal-setup): build vs runtime env, migrations on container start
  (prodMigrations), health check and rolling updates, rollback, backups and
  restore, DNS/Let's Encrypt/CAA. R2: custom domain needs a Cloudflare zone;
  default is media served by the app (R2_PUBLIC_URL empty).
- docsConsistency: no Polish prose outside code/quoted data (pending pages
  listed); IPAL_* names may also be read by shipped skill templates.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 17:39:03 +02:00
Radosław SmolińskiandClaude Opus 5.5 d45175739f Docs: forms, security, access, construction and others match the branch
Applies the docs session's forms.md diff and fixes, corrected for this
branch; adds the override sections and new options.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 17:35:08 +02:00
Radosław SmolińskiandClaude Opus 5.5 7d835bdc49 Locale cookie honours consent saved under a bumped policy version
The proxy parsed the consent cookie as version 1, so after an editor
bumped the policy version NEXT_LOCALE was never saved. It now accepts the
stored record's own version; policyVersion pins one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 17:35:08 +02:00
Radosław SmolińskiandClaude Opus 5.5 0fd57c1d6a Opt-outs for the secure defaults; isPathVisibleIn in construction/logic
- setUnknownIpFactor (0 = old free pass), UNKNOWN_IP_FACTOR exported
- createContentHelpers({ settingsDepth }) and markdown/mcp isPathVisible overrides
- <RenderRichText safeLinks={false}>
- resolveRedirect({ draft: true }) for preview
- isPathVisibleIn(mode, path), pathOf, PathVisibility exported; page route uses it

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 17:35:08 +02:00
Radosław SmolińskiandClaude Opus 5.5 4585e0fc69 submitForm reads forms.consentFieldName from ipalKit options
The option was typed but never read. An explicit argument still wins.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 17:35:08 +02:00
Radosław SmolińskiandClaude Opus 5.5 38c1d9215e enabled: false keeps the plugin's schema, drops only its behaviour
Returning the incoming config dropped the plugin's collections and globals,
so a Postgres migration would drop their tables. Now collections, globals
and fields stay; endpoints, onInit and admin components are left out.
Also: ipalKit({ forms: { consentFieldName } }) is stored in config.custom.ipal.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 17:35:08 +02:00
Radosław SmolińskiandClaude Opus 5.5 f65c6580e1 SEO: sitemap construction filter uses isPathAllowed + pathOf (same rule as isPathVisibleIn)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 17:29:49 +02:00
Radosław SmolińskiandClaude Opus 5.5 a87742621a Access defaults overridable; unlock admin-only; 2FA target validated
- access.authAccess merges over the injected auth collection's access;
  unlock is admin-only by default
- access.firstUserAdmin (default true) makes the first-register promotion optional
- globalOverrides: object merges access/admin/hooks, function takes over
- form Emails protection is applied before formOverrides.fields, so a
  project can change it there
- 2FA defaults to admin.user and fails at init when the target is not an
  auth collection or differs from admin.user (twoFactor.allowCollectionMismatch)
- buildRolesField, injectRoles, applyGlobalOverrides exported

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 17:23:14 +02:00
Radosław SmolińskiandClaude Opus 5.5 6e3979bae6 Docs: DNS records checklist (deployment §6, ipal-setup, ipal-reference)
Site, www, CAA, Search Console TXT, Bing, SPF/DKIM/DMARC for the From
domain (SMTP vs Graph), R2 custom domain; dig checks; plugin automates
nothing in DNS; meta-tag verification fields stay empty.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 17:22:23 +02:00
Radosław SmolińskiandClaude Opus 5.5 da3a0c9a85 SEO docs: DNS verification notes in English
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 17:22:02 +02:00
Radosław SmolińskiandClaude Opus 5.5 b15e82546e SEO: DNS domain verification is the default path; seo-check reports a missing verification tag as INFO only
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 17:21:43 +02:00
Radosław SmolińskiandClaude Opus 5.5 104cdbfd4c SEO: use construction/visibility pathOf (identical to security-perf branch) for the sitemap filter
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 17:20:37 +02:00
Radosław SmolińskiandClaude Opus 5.5 465c5706f8 Agent guide: complete plugin coverage, full ipal-setup, pointer block
- New skill ipal-reference: every ipalKit option (incl. nested keys) with
  default and how to turn it off/override it, what the plugin injects
  (collections, globals, endpoints, import-map components), every file the
  project wires with a minimal example and a check, every env var;
  resources/api.md indexes all 432 exports with import path and purpose
- ipal-setup rewritten as a complete start-to-finish install: steps, code,
  verification and off/override per stage
- ipal-skills writes a marked <!-- ipal-kit:start/end --> pointer block into
  AGENTS.md (creates it if missing) and CLAUDE.md (or creates CLAUDE.md with
  @AGENTS.md); only the marked block is ever rewritten; --no-pointer skips.
  tsconfig exclude check now matches whole entries
- AGENT.md, PROGRAMISTA, README, docs index: point at ipal-reference and run
  `pnpm exec ipal-skills` right after install
- docsConsistency: the agent guide must mention every export (runtime and
  types), every plugin option incl. nested keys, every env var the code
  reads and every @/lib/content helper

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 17:19:50 +02:00
Radosław SmolińskiandClaude Opus 5.5 14fd2c497f Server entries no longer load 'use client' modules
The main entry and next/middleware re-exported module barrels that also
export React client components (LanguageSwitcher, AlternateLinks*,
AccessibilityWidget), so payload.config, the CLI and the proxy bundle
evaluated React UI. They now import concrete files; i18n client
components moved to modules/i18n/client.ts. test/entryGraph guards it.
Also lint fixes in tests added on this branch.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 17:17:42 +02:00
Radosław SmolińskiandClaude Opus 5.5 e5d86b8afe Promote to admin only on the first-register screen, not any first create
An open sign-up on an empty collection would otherwise become admin.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 17:17:42 +02:00
Radosław SmolińskiandClaude Opus 5.5 dc761164d9 SEO: project overrides (sitemapEntries, sitemapOptions, underConstructionSeo, searchSettings fn); seo-check follows sitemap index
- createContentHelpers: sitemapEntries transform has the last word,
  sitemapOptions passes maxUrls/cacheControl/memoSeconds to sitemapRoute,
  underConstructionSeo: false turns the construction filter off
- seo.searchSettings accepts a function over the default fields
- ipal-seo-check: reads sitemap index parts, reports 503 sitemap, warns on
  missing Google/Bing verification (skip key: verification)
- docs/seo.md updated

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 17:13:57 +02:00
Radosław SmolińskiandClaude Opus 5.5 4c199acdfd Old-slug redirects skip never-published drafts
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 17:11:13 +02:00
Radosław SmolińskiandClaude Opus 5.5 67e9655376 Hooks run Local API calls with req; cross-locale sync restores req.locale
buildCrossLocaleFieldSync read other locales outside the save's transaction
and its update(req) left req.locale on the last target locale.
buildPreventDeleteSystemPage now reads Site Settings with req.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 17:10:42 +02:00
Radosław SmolińskiandClaude Opus 5.5 1beb0edb7f RenderRichText neutralises unsafe link URLs (safeHref)
Payload's link converter rendered fields.url as is; javascript:/data: URLs
stored via import or API reached the href. They now become '#'.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 17:09:44 +02:00
Radosław SmolińskiandClaude Opus 5.5 94e563055f SEO/GEO/GSC: sitemap index + caching, Search & AI settings, getRobots
- Sitemap: batched reads (500), published-only where, field select; sitemap
  index over maxUrls (default 10k) with ?part=N; Cache-Control; in-process
  memo; runtime errors → 503 Retry-After (empty urlset only during next build)
- Site Settings → Search & AI tab (seo.searchSettings: false removes it):
  Google/Bing/Yandex verification (paste code or whole meta tag) added to
  page metadata; AI crawler policy + per-bot exceptions; llms.txt note
- buildRobots aiBotRules; getRobots helper reads the panel; more AI agents
- Under construction: sitemap and llms.txt list only open pages
- collectSiteIndex: no silent 1000 cap; llms routes send Cache-Control
- IndexNow: nothing sent with IPAL_NOINDEX
- Unknown route metadata is noindex
- Tests (unit + SQLite integration) and docs/seo.md

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 17:09:01 +02:00
Radosław SmolińskiandClaude Opus 5.5 7967453f57 Revalidate the site layout when a global is saved
buildGlobalRevalidateHook + ipalKit({ revalidatePath }) wires it into the
plugin's globals; menus, consent texts and analytics IDs no longer stay
stale for the whole ISR window.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 17:09:00 +02:00
Radosław SmolińskiandClaude Opus 5.5 d39bbd01a8 docsConsistency: lint fixes
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 17:08:15 +02:00
Radosław SmolińskiandClaude Opus 5.5 7c05a1dba9 Construction mode hides pages from Markdown, MCP and search; MCP rejects non-object messages
createContentHelpers exposes isPathVisible (built from getConstructionMode)
and passes it to markdownRoute and mcpPOST; createSearchRoute,
createMcpRoute and createMarkdownRoute accept it. A null/number/string
JSON-RPC message now gets -32600 instead of crashing the route.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 17:07:45 +02:00
Radosław SmolińskiandClaude Opus 5.5 6e0f59c62b Docs: reconcile agent, developer and module docs with the code
- AGENT.md, skills, PROGRAMISTA, vibe, README and module pages checked
  against src/ and package.json; every mismatch fixed (consent/analytics
  loading, revalidation scope, generateStaticParams, construction gating,
  Turnstile fail modes, email/Graph, MCP, i18n, links, slug, hooks, ...)
- New pages: frontend.md, media.md, integrations.md; docs/README.md now
  indexes every page
- Main rule (plugin helps, never limits) at the top of AGENT.md,
  PROGRAMISTA.md, docs/README.md, README and the setup/plugin-gap skills;
  module pages gain a "Wyłączenie, nadpisanie, rozszerzenie" section
- README/PROGRAMISTA: stop telling projects to install packages ipal-kit
  already depends on; peer table; publish flow matches prepublishOnly
- ipal-skills: refuse --dest without a value or pointing at the project
  root (previously could delete ipal-* folders in cwd)
- docsConsistency: option keys, IPAL_* env names, relative links, README
  index, AGENT.md section refs, skill frontmatter, frontend.md helper keys,
  no `pnpm add` of own dependencies

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 17:06:52 +02:00
Radosław SmolińskiandClaude Opus 5.5 9a72ebfaff Analytics: consentMode 'basic' keeps Google tags out until consent
Opt-in; the default stays 'advanced' (tag loads with denied signals).
shouldLoadGoogle holds the rule so it is testable without a DOM.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 17:05:14 +02:00
Radosław SmolińskiandClaude Opus 5.5 0bfc509102 Run stats and consent-log retention purges off the request
The daily purge was awaited inside the visitor's request via payload.delete,
which loads and deletes expired documents one by one. It now runs as one
db.deleteMany in the background; failures are logged and retried.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 17:04:09 +02:00
Radosław SmolińskiandClaude Opus 5.5 78f4f5c16b First account of the auth collection always becomes admin
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 17:02:25 +02:00
Radosław SmolińskiandClaude Opus 5.5 561a9e2bb7 Site Settings read at depth 1; archive page re-fetched at page depth
getSettings ran findGlobal at depth 2 on every request, pulling the
relations of every page a project field links to (menus). Depth 1 keeps
slug/title. The archive page itself was rendered from the settings copy,
which maxDepth caps at 1, so its media never populated; resolveRoute now
re-fetches it at depth 2 like the homepage.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 17:02:07 +02:00
Radosław SmolińskiandClaude Opus 5.5 8e10232765 Rate limit: no IP shares a capped bucket; optional Turnstile hostname check
A request without a usable client IP used to skip every limiter. It now
counts against one shared 'unknown-ip' bucket at 20x the limit. submitForm,
createSubmitAction and verifyTurnstile accept turnstileHostnames/hostnames
to reject tokens solved on another domain.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 16:59:51 +02:00
Radosław SmolińskiandClaude Opus 5.5 10da62ea4c Lock down injected users, 2FA slug, forms and globals writes
- Injected auth collection with roles: admins manage all accounts, others
  only themselves (Payload's default let any account edit or delete any other)
- 2FA defaults to the resolved auth collection instead of 'users'
- SiteSettings, CookieSettings, Notifications, Forms: write needs editor+;
  form Emails tab readable by editor+ only

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 16:58:00 +02:00
Radosław Smoliński 12fbd424a5 1.12.3
CI / check (push) Canceled after 0s
2026-10-21 18:16:31 +02:00
Radosław SmolińskiandClaude Opus 5.5 6b4336f961 Detailed cookie settings window (CookieBanner settings="detailed")
A third settings mode next to 'inline' and 'modal': a large dialog where every consent
category is a card with its on/off control, description and an expandable list of the
cookies it covers (name, provider, purpose, duration), taken from Cookie Settings → Cookies
— the same rows as <CookieTable>. The developer picks the mode with one prop; the
component default stays 'inline', so existing sites are unchanged.

Cookie Settings gets a localized detailLabels group (list labels, English fallback);
getConsentTexts passes texts.cookies and texts.details, sharing the row mapping with
getCookieTable. New classNames slots and data-ipal handles for the cards and lists.

Docs for devs and agents: consent.md (modes compared, which to pick — new projects default
to 'detailed' when the cookie list is filled), AGENT.md, PROGRAMISTA §2.8/§2.11/§6, skills
ipal-setup, ipal-site, ipal-upgrade, ipal-locale-add, ipal-consent-check. Postgres/SQLite
projects need migrate:create for the new fields.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 18:16:30 +02:00
Radosław Smoliński 1413e96731 1.12.2
CI / check (push) Canceled after 0s
2026-10-21 16:45:03 +02:00
Radosław SmolińskiandClaude Opus 5.5 e1431a7c49 Stable admin import map without R2 env, read-only media, Cookie Settings save-button migration
buildR2Storage registered nothing without R2_* env, so `pnpm dev` / generate:importmap in dev
wrote an importMap.js without S3ClientUploadHandler — committed, the production admin (R2 on)
rendered a blank page with no console error (hit vanstev.pl). The injected s3Storage is now
always registered (enabled: false without R2 → local disk); storage-s3 still adds its client
handler, so the import map is identical in every environment. ipal-audit flags an import map
without the handler.

R2_PUBLIC_URL alone (absolute, outside production) = read-only media: URLs from the media
domain, upload/delete refused with 403 — local dev against a production database without
bucket keys. ipalEnvRules allows it in development.

Cookie Settings (MongoDB): the 1.11.1 rename buttons.save → savePreferences lost the texts on
the first save; onInit copies the old value (all locales) when the new field is missing.
getConsentTexts read the old field as a string, Mongo returns the raw { pl, en } map.

Also: context.ipalSkipAutoFill (SKIP_AUTO_FILL) — save without meta / aiSummary auto-fill;
createPageRoute redirects the homepage under its own slug (homeAlias, default 'redirect');
ipal-audit: multi-line tsconfig exclude, numeronyms (a11y) not "numbered fields",
`${prefix}/${slug}` links and slugs typed into links detected, clearer panel-language message.
Docs: fallback-on-save in i18n.md, `pnpm up --latest` and the stale-token 401 in PROGRAMISTA §1.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 16:45:03 +02:00
Radosław Smoliński 2c3195c4e1 1.12.1
CI / check (push) Canceled after 0s
2026-10-21 15:11:04 +02:00
Radosław SmolińskiandClaude Opus 5.5 4ec27d9ef0 Built-in statistics (cookieless, consent-gated visitor history); per-page meta descriptions, NoSnippet
Stats: ipalKit({ stats: true }) adds the stats-visits collection, POST /api/ipal/hit, the
/admin/stats view (30-day visits chart, top/entry pages, referrers, devices), a dashboard card
and a nav link. <PageStats> (or <SiteProviders stats>) sends one beacon per page view. Without
consent nothing is stored on the device and no IP is kept: page views are joined by a hash with
an in-memory salt replaced daily. With analytics consent an ipal_vid cookie links visits across
days (server re-checks the consent cookie and policy version; withdrawal deletes the cookie).
Bots, logged-in panel users and prefetches aren't counted. Retention 90 days.
@payloadcms/next added to peerDependencies (DefaultTemplate). Docs: stats.md with privacy text.

Also in this release: meta.description auto-filled from page blocks, <NoSnippet>,
MetaDescriptionCheck in the SEO tab, data-nosnippet on banner/language switcher, GA4 CSP
wildcards, consent version passed to Analytics' default consent.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 15:10:55 +02:00
Radosław Smoliński 305c564d13 1.12.0
CI / check (push) Canceled after 0s
2026-10-20 00:46:44 +02:00
Radosław SmolińskiandClaude Opus 5.5 166bf51e53 Lazy 404: createNotFoundPage({ load }) + renderNotFoundView, NotFoundLoader
Next puts a layout's not-found tree into the RSC payload of every page under it. The eager
createNotFoundPage({ blocks }) rendered the panel's 404 page there in every locale, so with
404 = homepage each page shipped the homepage twice (homepage HTML 195 -> 146 KB gzip).
With { load } only <NotFoundLoader> is in the payload; the content comes from the project's
server action (renderNotFoundView, locale checked against configured locales) when a 404 shows.
The eager variant is unchanged. Docs: pages.md, i18n.md, AGENT.md, PROGRAMISTA, ipal-setup, CHANGELOG.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-20 00:46:44 +02:00
Radosław SmolińskiandClaude Opus 5.5 8b35986635 1.11.1
CI / check (push) Canceled after 0s
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 21:32:40 +02:00
Radosław SmolińskiandClaude Opus 5.5 faa4ad679c Theme switcher, table of contents, missing-page redirect, form placeholders and time field; audit and revalidate fixes
- buildRevalidateHook skips outside Next (no NEXT_RUNTIME) and with context.disableRevalidate
- BuilderForm focuses only on a real step change (no scroll to the form on remount)
- mediaImageProps: placeholder colour only for JPEG (placeholderColor); hook stores no colour for transparent images
- buildLinkField: interface name per shape (CmsLink, CmsLinkPlain, CmsLinkNoLabel) + interfaceName option
- Cookie Settings: buttons.save -> buttons.savePreferences (Mongoose reserved name)
- ThemeScript, ThemeSwitcher, useTheme; Site Settings defaultTheme 'system' + themeToggleLabel; Turnstile follows page theme
- extractHeadings, RenderRichText headingIds, TableOfContents, buildTableOfContentsField
- createPageRoute onMissing: 'redirectHome'
- Form builder: localized placeholder on text/email/textarea/number, new time field
- ipal-audit: no false positive for object keys between JSX elements; /md route not reported as dynamic

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 21:32:40 +02:00
Radosław SmolińskiandClaude Opus 5.5 23e033d7d7 1.11.0
CI / check (push) Canceled after 0s
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 19:38:28 +02:00
Radosław SmolińskiandClaude Opus 5.5 f809526f1d Page-filled form fields, links to entries, entry JSON-LD, R2-optional dev
Forms: `values` on RenderForm / BuilderForm / useBuilderForm fills fields the
page knows (chosen product variant, category) — read-only <output>, in the
SSR HTML, sent and validated like any field. prepareBuilderForm (/rsc) is the
server half of RenderForm for client components whose values change in the
browser; publicForm is exported so projects stop copying it.

Links: buildLinkField({ relationTo: ['pages', 'categories', …] }) — a
polymorphic relation; resolveLinkHref builds /{locale}/{archive}/{entry} from
`archives`, which getLinkOptions in createContentHelpers fills from Site
Settings.

SEO: pageJsonLd.entries — the main JSON-LD node per content collection
instead of BlogPosting; buildProductJsonLd emits an Offer only for a real
price from the panel.

Pages: createPageRoute / createNotFoundPage pass isFirst to blocks, so the
first section carries the page's only h1.

Fixes: ipalEnvRules({ storage: true }) requires R2_* in production only
(development: optional, all or none); buildImagesConfig allows the app's own
media on localhost outside production.

Docs, CHANGELOG, PROGRAMISTA §6 (34–37), ipal-form and ipal-upgrade skills.
Tests: builderForm, links, drafts (entries + archives), seo, media, env.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 19:38:28 +02:00
Radosław Smoliński 46d30d4ecd 1.10.1
CI / check (push) Canceled after 0s
2026-10-19 00:07:40 +02:00
Radosław SmolińskiandClaude Opus 5.5 a6eda2e3a3 Pass siteDescription to page metadata; document media cache rule
createPageMetadata read Site Settings → siteDescription but never passed it to
buildMetadata, so pages without their own meta description had no
<meta name="description"> or og:description. Regression test in seo.test.ts.

storage.md: Cloudflare Cache Rule for the media domain (R2 objects carry no
Cache-Control; storage-s3 cannot set it, Cloudflare defaults to 4 h).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 00:07:28 +02:00
radoslaw.smolinski d28cbe2570 1.10.0
CI / check (push) Canceled after 0s
2026-10-17 03:20:12 +02:00
radoslaw.smolinskiandClaude Opus 5.5 2bd9d60822 Cookie banner layout options; keep admin UI out of /client
CookieBanner: order, settings="modal", controls="switch",
settingsActions, icon and a class slot for every element. Cookie
Settings gains eyebrow, title, settingsDescription, alwaysActiveLabel
and buttons.close.

MaskedField, TestEmailButton and IntegrationStatusBanner import
@payloadcms/ui and moved from /client to /admin; with sideEffects in
package.json the site bundle no longer ships ~235 KB gz of admin code.
A test walks the /client import graph to keep it that way.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-17 03:20:11 +02:00
radoslaw.smolinski 0f6a43ad12 1.9.9
CI / check (push) Canceled after 0s
2026-10-17 01:29:01 +02:00
radoslaw.smolinskiandClaude Opus 5.5 14d71bcc3a Readable form emails (forms.emailLayout)
{{*:table}} renders a readable submission summary (questions, option labels,
grouped by step, empty fields skipped) inside an email template with logo,
accent colour and footer from Site Settings → Emails. submitForm stores the
submission in the page language, so emails follow the visitor's locale.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-17 01:29:00 +02:00
radoslaw.smolinski 78e4e0f8e6 1.9.8
CI / check (push) Canceled after 0s
2026-10-16 22:15:57 +02:00
radoslaw.smolinskiandClaude Opus 5.5 8f8b79d003 Under construction mode (developer tool)
Site Settings -> Under construction: a switch, 'Pages still available' and
notice texts. When on, only the homepage and the chosen pages open (every
language); other addresses redirect to the homepage with the notice
(createPageRoute redirect option), and <ConstructionNotice> cancels clicks
on links to blocked pages and shows the notice. getConstructionMode(locale).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 22:15:57 +02:00
radoslaw.smolinski 91d5e986c5 1.9.7
CI / check (push) Canceled after 0s
2026-10-16 20:53:26 +02:00
radoslaw.smolinskiandClaude Opus 5.5 080086adfe Forms: conditional fields and steps (Show only when)
Every form block (built-in, Checkbox group, Step, message) gets a showWhen
group: visible only when another field has one of the given values. A hidden
Step drops out with its fields; browser and server share visibleFields, so a
hidden field is neither required nor stored. GDPR consent is always enforced.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 20:53:25 +02:00
radoslaw.smolinski 8c1a8b0e8e 1.9.6
CI / check (push) Canceled after 0s
2026-10-16 13:51:33 +02:00
radoslaw.smolinskiandClaude Opus 5.5 002eef56d1 Changelog 1.9.6
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 13:51:31 +02:00
radoslaw.smolinskiandClaude Opus 5.5 924b5cf8be Markdown route: type-safe locale code read
CI / check (push) Canceled after 0s
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 13:42:17 +02:00
radoslaw.smolinski 3e17f92af1 1.9.5
CI / check (push) Canceled after 0s
2026-10-16 13:32:34 +02:00
radoslaw.smolinskiandClaude Opus 5.5 c83d2dec0c Merge 1.9.5: single-language Markdown route
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 13:32:31 +02:00
radoslaw.smolinskiandClaude Opus 5.5 df0f5e03c3 Single-language sites: Markdown route without the locale param; i18n docs corrected
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 13:32:31 +02:00
radoslaw.smolinski 67e8da6ec3 1.9.4
CI / check (push) Canceled after 0s
2026-10-16 13:11:10 +02:00
radoslaw.smolinskiandClaude Opus 5.5 191cf44361 Merge 1.9.4: link styles, system links, audit rules
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 13:11:08 +02:00
radoslaw.smolinskiandClaude Opus 5.5 6a0fefdbae Project-defined link styles, legal links from System Pages; audit catches content-keyed logic, Polish text in code, link fields in globals
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 13:11:08 +02:00
radoslaw.smolinski 0069b28941 1.9.3
CI / check (push) Canceled after 0s
2026-10-16 12:56:14 +02:00
radoslaw.smolinskiandClaude Opus 5.5 3da9d6b1d0 Merge 1.9.3: audit catches hand-rolled links
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 12:56:13 +02:00
radoslaw.smolinskiandClaude Opus 5.5 eb52253dc4 Audit: catch hand-rolled link resolution (hardcoded homepage slug, URL built from a slug); comment filter fix
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 12:56:13 +02:00
radoslaw.smolinski f88c342be5 1.9.2
CI / check (push) Canceled after 0s
2026-10-16 11:52:43 +02:00
radoslaw.smolinskiandClaude Opus 5.5 293cd9a541 Merge 1.9.2: import instead of code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 11:52:42 +02:00
radoslaw.smolinskiandClaude Opus 5.5 81e864bde9 Docs for 1.9.2: import instead of code; docs↔code consistency test; audit accepts one-line routes
- AGENT.md: §7 full capability catalog (need → import), §0b/§3/§6 on RenderForm, SiteProviders,
  createPageRoute, re-exported routes, plugin section fields, resolveLink/resolveNav
- PROGRAMISTA §2.4, §2.7–2.8 rewritten; §6 items 28–33 (28: FormRenderer leaked the Emails tab)
- forms, links, blocks, pages, consent, turnstile, notifications, seo, mcp, i18n, deployment docs
- ipal-form: RenderForm block, formClasses, CustomForm example (FormRenderer template removed),
  seed template handles steps and option labels per language
- ipal-nav, ipal-block, ipal-setup, ipal-upgrade, ipal-seo-check, ipal-consent-check, vibe.md
- ipal-audit: re-export routes and SiteProviders satisfy the mandatory set; flags form-engine copies,
  project section fields / navigation, server entries in client components
- test/docsConsistency: docs imports exist in code; every public export is documented
- CHANGELOG 1.9.2

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 11:52:29 +02:00
radoslaw.smolinskiandClaude Opus 5.5 412bf953a8 Import instead of code: panel forms (steps, choice lists, dates), layout, page route, GEO routes, links, section fields
- Forms: step and checkboxGroup field types (radio, date on), server validation for them,
  useBuilderForm (logic) + BuilderForm (unstyled default) + RenderForm (/rsc: rich text,
  bound action, public part of the form only — the Emails tab never reaches the browser)
- Notifications: next / back / stepOf texts
- createContentHelpers: getSiteShell, getFormTexts, getLinkOptions, resolveLink, resolveNav,
  resolvePageRedirect, one-line route handlers (llms, llms-full, md, mcp, health, indexnow, manifest)
- /rsc: SiteProviders, createPageRoute, createNotFoundPage
- resolveLink / resolveNav / homeSlugFrom, buildSectionHeaderField / buildSectionSettingsField
- Dev sandbox frontend built on these imports; tests (unit + real Payload)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 11:32:46 +02:00
radoslaw.smolinskiandClaude Opus 5.5 0cfd846dd1 Changelog: history back to 1.7.4, keep at least 20 versions
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 10:59:38 +02:00
radoslaw.smolinski 800ba30200 1.9.1
CI / check (push) Canceled after 0s
2026-10-16 10:56:18 +02:00
radoslaw.smolinskiandClaude Opus 5.5 0c5c6ac3e3 Merge 1.9.1: SEO/GEO, consent, security, forms seed, media, fluid
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 10:56:17 +02:00
radoslaw.smolinskiandClaude Opus 5.5 e301ff3d00 Release as 1.9.1 instead of 1.10.0
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 10:56:16 +02:00
radoslaw.smolinskiandClaude Opus 5.5 3986e70e5f Dev sandbox: enable consent log
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 03:27:13 +02:00
radoslaw.smolinskiandClaude Opus 5.5 de929422bb Docs for 1.10: mandatory set (18 items), setup skill, reference code, module docs, changelog
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 03:25:58 +02:00
radoslaw.smolinskiandClaude Opus 5.5 f52fbe6b12 Audits: performance, responsive and new mandatory items; seo-check content checks
ipal-audit: <video> outside Media, priority outside the hero, <Media> without
sizes, raw YouTube iframes, 100vh/h-screen, fixed pixel sizes, page JSON-LD,
upload sandbox headers, images preset, missing form seeds; accepts
createMarkdownRoute / createSubmitAction.
ipal-seo-check: exactly one h1, heading jumps, img alt and dimensions, LCP
priority, og:image, thin pages, internal links, X-Robots-Tag noindex left on
in production. Verified on bad and good fixtures.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 03:22:55 +02:00
radoslaw.smolinskiandClaude Opus 5.5 69309b09e3 Fluid scaling to 1920px and height-aware variables; speed and responsive guidelines
- fluid-wide.css: the fluid.css variables stretched over 360→1920px (export
  @intecion/ipal-kit/fluid-wide.css); fluid.css values unchanged.
- New variables in both (unused until a project opts in): --ipal-measure,
  --ipal-container(-wide), --ipal-hero-min-h (svh), --ipal-fs-display-fit,
  --ipal-fs-h1-fit, --ipal-space-section-fit — keep the hero CTA above the fold
  on 1366×768. Verified in Chromium at 360…1920 widths.
- AGENT.md §6.11a (scaling, viewport test list incl. 13–15" laptops and 125/150 %
  zoom) and §6.11b (Core Web Vitals table: LCP image, sizes, placeholders, video
  modes, YouTube facade, images preset, fonts).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 03:21:38 +02:00
radoslaw.smolinskiandClaude Opus 5.5 55fc27a13f Media performance tools: image/video props, upload placeholders, images preset, YouTube facade
Headless helpers for the project's own <Media> (look stays in the project):
- mediaImageProps: dimensions from the doc (no CLS), lazy by default, LCP image
  gets preload + fetchPriority=high + eager (Next 16 replaced 'priority'),
  focal point → object-position, blur placeholder + dominant colour.
- MEDIA_SIZES suggestions for 'sizes' (any string still works).
- videoProps: 'background' (muted loop, respects reduced motion) or 'player'
  (controls, preload=none, poster).
- buildMediaPlaceholderHook/Field: tiny WebP blur + dominant colour at upload
  via the configured sharp (no new dependency).
- buildImagesConfig: AVIF/WebP, R2 remotePatterns, 31-day cache.
- <YouTubeEmbed> (/client): poster + button, youtube-nocookie iframe on click.
- buildCsp youtube allows the i.ytimg.com poster. kod-sekcji Media template
  uses the helpers.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 03:19:38 +02:00
radoslaw.smolinskiandClaude Opus 5.5 f7466cf77f noindex tooling, content/noindex/component/testing guidelines for agents
- IPAL_NOINDEX=1: whole-site noindex for staging (robots Disallow /, robots
  meta noindex,nofollow, X-Robots-Tag via buildSecurityHeaders).
- Markdown mirrors and llms files: X-Robots-Tag noindex; Markdown adds a
  Link rel=canonical to the HTML page.
- buildNoindexField refuses noindex on the homepage and archive pages.
- AGENT.md §0c: writing pages for Google and AI (structure, answer-first,
  facts, E-E-A-T, entity consistency, sameAs, aiSummary, meta) and a
  when-to-noindex table (legal pages stay indexed by default; drafts instead
  of noindexed pages; staging via env).
- AGENT.md §6.0: ten component rules (small, Button styled once, buttons as
  '+ Add Button' array, variants, panel clarity); audit warns on buttons
  styled inside sections.
- AGENT.md §8a + smoke.spec.template.ts: what to test in a client project;
  PROGRAMISTA §8.1a: how the plugin itself is tested.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 03:13:44 +02:00
radoslaw.smolinskiandClaude Opus 5.5 8e2dd28b83 Form seed template: fields, confirmation, company notification and sender confirmation in every language
The ipal-form skill now requires seeding each form (scripts/seed-form-*.ts):
idempotent, reads the notification inbox from the panel and stops without
one, adds both e-mails ({{email}} is safe since submitForm accepts exactly one
address). Verified on the dev sandbox in pl + en. Dev sandbox enables forms.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 03:08:56 +02:00
radoslaw.smolinskiandClaude Opus 5.5 9e49856611 Security review: drafts no longer public, submissions staff-only, safe links, upload sandbox
- Fix: resolveRoute served never-published drafts by URL (Payload's find
  returns them with _status 'draft') — also via Markdown, MCP get_page and
  metadata. Drafts are dropped on every branch; `draft: true` for previews.
- Fix: getArchiveEntries listed drafts in archive pages despite its comment;
  `_status: published` is added automatically when the collection has drafts.
- form-submissions readable only by editor+ (form-builder default: any account
  of the admin collection, incl. plain users from an open sign-up); delete admin.
- Forms stay public for rendering, but the Emails tab (recipients) is hidden
  from anonymous REST reads.
- safeHref: CMS links only http(s), mailto, tel, sms, #, / — javascript:, data:
  and control-character tricks are dropped in resolveLinkHref.
- Analytics IDs validated in the panel and before reaching the browser.
- buildUploadSecurityHeaders: sandbox CSP for /api/<upload>/file/* so an
  uploaded SVG can't run script on the site's origin.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 03:06:26 +02:00
radoslaw.smolinskiandClaude Opus 5.5 ebf70d49bd Consent: withdrawal clears tool cookies, policy version, consent log, cookie scan; form input hardening
Consent (GDPR)
- Withdrawing consent now deletes GA/Meta/Ads/Clarity/LinkedIn/TikTok/Hotjar
  cookies (prefix patterns) on the host AND parent domains — previously only
  the locale cookie was removed and _ga & co. stayed. Projects extend the list
  via <ConsentProvider cookieMap>, merged with the defaults.
- Cookie Settings → Policy version: raising it asks every visitor again.
- <CookieBanner equalChoice>: Reject styled like Accept (UODO/EDPB), opt-in.
- Opt-in consent log (ipalKit({ consentLog: true }) + logEndpoint): random id,
  choices, version, time — no IP/UA; admin-only collection, retention purge.
- Cookie Settings → Cookies + getCookieTable + unstyled <CookieTable> (/rsc).
- Consent cookie gets Secure on HTTPS; consent id stored with the decision.
- ipal-consent-check: cookie-scan.mjs (before/after consent, known-tool
  catalog PL/EN, flags non-necessary cookies set before consent) and
  import-cookies.ts into the panel (idempotent, keeps editor edits).

Forms
- Server-side type checks per field from the panel definition: email = one
  address (blocks "a@x, b@y" recipient injection into {{email}} confirmations
  and CR/LF header injection), select/radio only configured options, numbers,
  booleans; objects/arrays rejected; control and bidi characters stripped.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 02:31:58 +02:00
radoslaw.smolinskiandClaude Opus 5.5 c9a50abc33 SEO/GEO tools and project requests: site index, IndexNow, page JSON-LD, fixes
GEO / SEO
- collectSiteIndex: one list of public docs per locale (pages + archive
  entries) on sitemap rules; llms.txt/llms-full and MCP list_pages now include
  blog/content entries and every language. Fixes hard-coded "## Strony" heading
  and homepage not collapsing to the locale root in llms.txt.
- Markdown frontmatter: canonical url + updated date.
- Metadata: X/Twitter card, OG image width/height/alt, og:type article with
  published/modified times for entries.
- Fix: Site Settings "defaultShareImage" was never used — now the OG fallback.
- getPageJsonLd (createContentHelpers): WebPage/CollectionPage/BlogPosting,
  BreadcrumbList from the real route, FAQPage via a project mapper.
- IndexNow (opt-in ipalKit({ indexNow: true })): submit published URLs in all
  languages, key generated in Site Integrations or INDEXNOW_KEY, key route.
- sameAs profiles in Site Settings + sameAsUrls(); sitemap <image:image>.

From project reports
- Fix: package exports were missing ./env and ./fluid.css although the docs
  import them (TS2307); regression test checks every documented subpath.
- Fix: plugins run before Payload adds its default users collection, so roles
  and 2FA had nothing to attach to — ipalKit injects an auth collection when
  the project has none (project's own one wins). Audit no longer errors on it.
- createMarkdownRoute, createSubmitAction (/server, headers injected).
- formatOpeningHours (PL/EN/DE text → schema.org), used by
  buildLocalBusinessJsonLd, which also takes a schema.org `type`.
- buildNavigationJsonLd straight from the header global.
- buildCsp googleMaps: full Maps JS API domain set; values de-duplicated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 02:19:08 +02:00
radoslaw.smolinskiandClaude Opus 5.5 9e40d74bb3 Normalize bin path (npm pkg fix) to silence publish warning
CI / check (push) Canceled after 0s
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 01:27:21 +02:00
radoslaw.smolinski 050c9edf68 1.9.0 2026-10-16 01:26:27 +02:00
radoslaw.smolinskiandClaude Opus 5.5 d3e5efb9f8 Agent instructions: mandatory feature set (SEO, GEO, R2, Turnstile, forms) enforced by audits
- AGENT.md §0b: one table of everything every site must have (SEO meta/maps,
  JSON-LD, llms.txt + llms-full, Markdown, MCP, AI bots, R2, panel forms,
  Turnstile, consent, security, ops, system pages, zero hardcodes), the
  forbidden replacements (own forms, nodemailer, reCAPTCHA, hand-written
  JSON-LD, static SEO files, raw S3) and an `ipal-audit-skip:` escape hatch that
  needs a recorded client decision.
- ipal-audit: "missing: …" errors for every mandatory item and for plugin
  replacements; ipal-seo-check: runtime GEO checks (llms, Markdown, MCP,
  JSON-LD, AI bots, health). Both verified on bare and complete fixtures.
- Skills (setup, site, form, upgrade, audit, seo-check) and PROGRAMISTA.md
  wire the full set from step one; GEO is no longer "optional".
- Fix: createProxy({ markdown: true }) lets /md/... through — multilingual
  sites redirected /md/pl/x to /pl/md/pl/x, so the documented Markdown route
  never worked — and handles Accept: text/markdown.
- createContentHelpers({ markdownAlternate: true }) adds the text/markdown
  alternate link in generatePageMetadata.
- JSDoc/docs JSON-LD examples use JsonLdGraph; docs/CHANGELOG.md for 1.9.0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 01:26:10 +02:00
radoslaw.smolinskiandClaude Opus 5.5 ab854ef37a MCP site tools, Turnstile key alert, required 2FA injection, a11y, more tests
- MCP: new get_site_info and list_pages tools (public by design, published
  and indexable content only); search results collapse the homepage to root.
  New listContent() helper shared with searchContent.
- Dashboard alert when Turnstile is half-configured (it is silently off then).
- twoFactor.plugin is now required; the dynamic-import fallback (which never
  worked under Next and caused a Turbopack warning) is gone.
- a11y: cookie category checkboxes are labelled, buttons have type, test-email
  input is labelled; tab labels keep localized collection labels.
- IPAL_IP_HEADER: one-time production warning when unset, opt-in
  ipalEnvRules({ ipHeader: true }).
- Tests: SEO/robots/sitemap/hreflang, CSP, Markdown, consent, MCP, and a real
  Payload + SQLite integration test for forms and the roles guard (74 total).
- Drop unused mongodb-memory-server; dev .env.example for SQLite.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 01:15:19 +02:00
radoslaw.smolinskiandClaude Opus 5.5 86e69b0bcf Repo hygiene: stop tracking dist, CI, working dev sandbox
- dist/ no longer committed; prepare builds it for git installs and
  prepublishOnly runs clean + build + unit tests before every publish.
- Gitea Actions CI: typecheck, lint, unit tests, build on push/PR.
- New scripts: typecheck, test:watch; test:int runs once; lint covers src + test.
- dev/: drop the Mongo memory server and template route, opt out of 2FA,
  add the pages collection the SEO config expects, alias @intecion/ipal-kit/*
  to src, fix e2e credentials, regenerate types and import map.
- Remove stray src/index.tsgrep, dedupe .gitignore, README peer versions 3.90.2.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 00:22:04 +02:00
radoslaw.smolinskiandClaude Opus 5.5 4544cac69c Lint: fix all ESLint errors (391 -> 0), lint and typecheck tests
Mostly perfectionist import/key sorting and curly braces from --fix, plus:
- spread instead of .apply() in the Meta Pixel stub
- non-capturing group in the locale-code pattern
- React 19 use(Context) / <Context value> in TurnstileProvider
- email regex rewritten without super-linear backtracking (covered by a test)
- console.warn/error allowed (deliberate server diagnostics)
- test/tsconfig.json so the project service and tsc see test files

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 23:56:18 +02:00
radoslaw.smolinskiandClaude Opus 5.5 ce0a390351 Security: mandatory Turnstile when configured, admin-only test email, roles on create, safer client IP
- Turnstile is on only when both keys are set (panel or env); then submitForm
  requires a valid token, so a bot can no longer skip the check by omitting it.
  Not configured -> no widget, no check. New getTurnstileConfig() for layouts.
- /api/ipal/test-email now requires the admin role (403 for other users).
- roles field: create access is admin-only, so open sign-up can't self-assign admin.
- clientIp reads X-Forwarded-For from the right, accepts Headers, can be pinned
  via option or IPAL_IP_HEADER; exposed on search/MCP routes.
- Pluggable shared rate-limit store (setRateLimitStore) for multi-instance setups.
- Replace the template int.spec with real unit tests in test/ (44 tests).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 23:54:25 +02:00
radoslaw.smolinski aa284736c9 1.8.14 2026-10-15 22:24:35 +02:00
radoslaw.smolinski bd2fbaf8bf 2FA fixed 2026-10-15 22:24:28 +02:00
radoslaw.smolinski eb436528d4 1.8.13 2026-10-15 15:53:39 +02:00
radoslaw.smolinski 70b676660d Fix turnstile 2026-10-15 15:53:32 +02:00
radoslaw.smolinski 7dc93ac5ed 1.8.12 2026-10-15 15:27:48 +02:00
radoslaw.smolinski 3bab8a0697 Fixed turnstile 2026-10-15 15:27:43 +02:00
radoslaw.smolinski 7ef7927e38 1.8.11 2026-10-14 13:28:12 +02:00
radoslaw.smolinski a7846d9770 mcp and content fix 2026-10-14 13:28:04 +02:00
radoslaw.smolinski 015092e773 1.8.10 2026-10-14 11:32:12 +02:00
radoslaw.smolinski f4d969ad29 Sitemap.xml fixed 2026-10-14 11:32:03 +02:00
radoslaw.smolinski fad5d778e8 1.8.9 2026-10-14 11:06:04 +02:00
radoslaw.smolinski 0f073b963e Added fluid skills support 2026-10-14 11:05:57 +02:00
radoslaw.smolinski 54c2d64cce 1.8.8 2026-10-14 10:41:00 +02:00
radoslaw.smolinski e29c919e5e Fix 2026-10-14 10:40:48 +02:00
radoslaw.smolinski 0f6bbd597b 1.8.7 2026-10-13 23:59:56 +02:00
radoslaw.smolinski 65437a144b Fix for routerhandlers.ts 2026-10-13 23:59:51 +02:00
radoslaw.smolinski e7ad64230a 1.8.6 2026-10-13 23:51:17 +02:00
radoslaw.smolinski 5af5033148 import fix in buildLinkField 2026-10-13 23:51:08 +02:00
radoslaw.smolinski 7572ec0c04 1.8.5 2026-10-13 23:41:13 +02:00
radoslaw.smolinski a24777b915 Sitemap.css is now builded in plugin 2026-10-13 23:41:05 +02:00
radoslaw.smolinski 562e7f2244 1.8.4 2026-10-13 19:07:17 +02:00
radoslaw.smolinski 80d8b7102c Added more agent skills 2026-10-13 19:07:03 +02:00
radoslaw.smolinski 0ccc7e5064 1.8.3 2026-10-13 18:04:46 +02:00
radoslaw.smolinski 3d467d7350 Added module Links 2026-10-13 18:04:37 +02:00
radoslaw.smolinski db05fe814b 1.8.2 2026-10-13 16:25:28 +02:00
radoslaw.smolinski 42df05af28 Added missing LocalView export to client.ts 2026-10-13 16:25:22 +02:00
radoslaw.smolinski 089b3a29ba 1.8.1 2026-10-13 15:58:39 +02:00
radoslaw.smolinski ab16d459ed 1.7.14 2026-10-13 15:58:07 +02:00
radoslaw.smolinski 786dd346a9 Fixed notfound headers, r2storage 2026-10-13 15:57:59 +02:00
radoslaw.smolinski 86c873e4e7 1.8.0 2026-10-13 00:46:04 +02:00
radoslaw.smolinski efe8253f64 Added skills for AGENTS 2026-10-13 00:45:52 +02:00
radoslaw.smolinski c0d9911d90 1.7.12 2026-10-13 00:36:25 +02:00
radoslaw.smolinski 103c796e9d Instruction clarification 2026-10-13 00:36:11 +02:00
radoslaw.smolinski c6f177a37d 1.7.10 2026-10-12 22:31:50 +02:00
radoslaw.smolinski 1a9c51a1fd Add fix for branding 2026-10-12 22:31:40 +02:00
radoslaw.smolinski 7f5ed75f9e 1.7.9 2026-10-12 19:47:37 +02:00
radoslaw.smolinski 4eb2b627f0 Analytics fix 2026-10-12 19:47:31 +02:00
radoslaw.smolinski a92fc02cdf 1.7.8 2026-10-12 17:32:41 +02:00
radoslaw.smolinski 7aebe24236 Added not-found support for sitesettings 2026-10-12 17:32:31 +02:00
radoslaw.smolinski c852d7bdae 1.7.7 2026-10-12 14:47:59 +02:00
radoslaw.smolinski 24fa3fdcdf Security fix for MCP 2026-10-12 14:47:50 +02:00
radoslaw.smolinski 73eacb09c2 1.7.6 2026-10-12 14:35:58 +02:00
radoslaw.smolinski 2665cfa7b6 noindex fix 2026-10-12 14:35:51 +02:00
radoslaw.smolinski 5c466b664c 1.7.4 2026-10-12 13:10:39 +02:00
radoslaw.smolinski 78e2f8fc7f Fixed 2fa and white-label 2026-10-12 13:10:34 +02:00
radoslaw.smolinski 13d669b757 fix(2fa): static import for @clocklimited/payload-2fa and @payload-config alias to prevent webpack runtime error 2026-10-12 12:47:28 +02:00
radoslaw.smolinski a3938cacd9 1.7.2 2026-10-12 12:18:01 +02:00
radoslaw.smolinski 2ef602b3ec 1.7.1 2026-10-12 12:17:53 +02:00
radoslaw.smolinski 1f55c2406e Added white-label support 2026-10-12 12:17:45 +02:00
radoslaw.smolinski 10d1806130 1.7.1 2026-10-11 14:46:56 +02:00
radoslaw.smolinski 6be783bc5a Added better support for GTM, improved accesibility 2026-10-11 14:46:47 +02:00
radoslaw.smolinski fd6fb426b3 1.7.0 2026-10-10 16:52:23 +02:00
radoslaw.smolinski 09925e4cfd feat: v1.7.0 — AI-readability suite, form engine & boilerplate helpers
AI / GEO:
- feat(content): lexicalToMarkdown, blocksToMarkdown, createMarkdownRenderer
  (+markdownResponse) — per-page Markdown for AI agents
- feat(content): markdown content negotiation + discovery (prefersMarkdown, markdownHref)
- feat(seo): buildRobots aiBots policy (allow/block-training/disallow)
- feat(seo): llms-full.txt mode in buildLlmsTxt/createLlmsTxtRoute
- feat(mcp): createMcpRoute — read-only MCP server (search_content, get_page)
- feat(content): searchContent + createSearchRoute — shared JSON search
- feat(seo): buildSpeakableJsonLd + buildSummaryField (aiSummary, auto-fill)

Forms:
- feat(forms): useForm/useContactForm + validators (logic-only, no markup)
- feat(forms): honeypot anti-spam (honeypotInputProps, isHoneypotTripped)

Helpers / hardening:
- feat(i18n): resolveLocalized — replaces ad-hoc getSafeString
- feat(hooks): buildCrossLocaleFieldSync — locales from config, no hardcoded list
- feat(seo): buildNoindexField — checkbox → meta.noindex, no
- feat(content): resolveRedirect — 301/308 from slugHistory
- feat(env): assertEnv + ipalEnvRules — fail-fast env validation
- feat(consent): ConsentScript — load third-party only after consent
- feat(health): createHealthRoute — Coolify/Docker DB liveness

Fixes:
- fix(seo): wrap getCachedPayload in try/catch in createManifestHandler
  (Docker/CI build no longer crashes when DB unreachable)

docs: migration.md (20 sections), new env.md/mcp.md, updated agents.md,
AGENTS-TEMPLATE.md, forms/hooks/content/seo/consent/deployment/richtext
2026-10-10 16:52:16 +02:00
radoslaw.smolinski e6eada5d39 1.6.6 2026-10-10 00:17:23 +02:00
radoslaw.smolinski 1b52060dce Added healhtRoute, honeypot, ConsentScript, asserEnv 2026-10-10 00:17:13 +02:00
radoslaw.smolinski 52977e67fc 1.6.5 2026-10-09 20:18:24 +02:00
radoslaw.smolinski b25f221a50 Added support for crossLocaleFieldSync 2026-10-09 20:18:16 +02:00
radoslaw.smolinski f9d3d9ae97 1.6.4 2026-10-09 19:10:25 +02:00
radoslaw.smolinski 962b9cb640 Fixed buildManifest.ts 2026-10-09 19:10:20 +02:00
radoslaw.smolinski 9b9bbc1a9f 1.6.3 2026-10-09 18:23:18 +02:00
radoslaw.smolinski abf2e7d40f Added form validators 2026-10-09 18:23:08 +02:00
radoslaw.smolinski d500d9412f 1.6.2 2026-10-09 18:00:32 +02:00
radoslaw.smolinski d034ddf990 Security patch for contact 2026-10-09 18:00:24 +02:00
radoslaw.smolinski 2dfacb0414 1.6.1 2026-10-09 17:25:28 +02:00
radoslaw.smolinski eb6efa26f6 Added JsonLdGraph.tsx 2026-10-09 17:25:22 +02:00
radoslaw.smolinski f5a4ceb5bf 1.6.0 2026-10-09 17:02:07 +02:00
radoslaw.smolinski d041fd4bc6 Added languageswitcher, alternatelinkscontext components support 2026-10-09 17:01:52 +02:00
radoslaw.smolinski e232e6d2a5 1.5.7 2026-10-09 16:44:39 +02:00
radoslaw.smolinski c738435fe0 Added richtext support, and helpers for proxy, llms route 2026-10-09 16:44:28 +02:00
radoslaw.smolinski cca2b20c3d 1.5.6 2026-09-28 19:44:34 +02:00
radoslaw.smolinski 105c454d73 Added OG support 2026-09-28 19:44:28 +02:00
radoslaw.smolinski cf6feefebc 1.5.5 2026-09-28 16:47:11 +02:00
radoslaw.smolinski 1857c8f771 Sitemap language normalize trough all websites 2026-09-28 16:47:06 +02:00
radoslaw.smolinski 542ad4ab9c 1.5.4 2026-09-28 16:35:00 +02:00
radoslaw.smolinski 9bf8599116 Fix for plugin.ts 2026-09-28 16:34:54 +02:00
radoslaw.smolinski 170c9a53f1 1.5.3 2026-09-28 16:25:36 +02:00
radoslaw.smolinski e0d5095099 Fix for sitemap.css n2 2026-09-28 16:22:49 +02:00
radoslaw.smolinski 08a8a10478 1.5.2 2026-09-28 16:13:46 +02:00
radoslaw.smolinski 7bbaf14d14 Fixed sitemap.css 2026-09-28 16:13:33 +02:00
radoslaw.smolinski b7d0b01122 1.5.1 2026-09-28 16:01:09 +02:00
radoslaw.smolinski 4627266577 2FA Fix 2026-09-28 16:01:03 +02:00
radoslaw.smolinski 471ec4b12a 1.5.0 2026-09-28 15:49:57 +02:00
radoslaw.smolinski 060a61fd41 Added secuirty 2FA for users 2026-09-28 15:49:36 +02:00
radoslaw.smolinski 7cef95225a 1.4.4 2026-09-28 14:57:54 +02:00
radoslaw.smolinski 0ae62226bc Path fix for sitemap css asset 2026-09-28 14:57:49 +02:00
radoslaw.smolinski 610ab6fdf5 1.4.3 2026-09-28 14:54:30 +02:00
radoslaw.smolinski 81275c0395 Added css asset for sitemap 2026-09-28 14:54:21 +02:00
radoslaw.smolinski 4a46651839 1.4.2 2026-09-28 14:47:19 +02:00
radoslaw.smolinski e7f06548fb Added styling for sitemap generator 2026-09-28 14:47:13 +02:00
radoslaw.smolinski e2a703fc72 1.4.1 2026-09-28 14:29:50 +02:00
radoslaw.smolinski de75d8374d Rebuilded sitemap generator 2026-09-28 14:29:42 +02:00
radoslaw.smolinski b807fbe69a 1.4.0 2026-09-26 22:30:13 +02:00
radoslaw.smolinski 827cd9bcbc Added accessibility support 2026-09-26 22:29:53 +02:00
radoslaw.smolinski fa2b607979 1.3.2 2026-09-26 20:07:35 +02:00
radoslaw.smolinski 4fe690e1e2 Added i18n exports 2026-09-26 20:07:29 +02:00
radoslaw.smolinski 3553daa086 1.3.1 2026-09-26 16:20:40 +02:00
radoslaw.smolinski a4c5bcfbdf Fix buildLlmsTxt.ts 2026-09-26 16:20:31 +02:00
radoslaw.smolinski 026c2696b6 1.3.0 2026-09-25 12:50:35 +02:00
radoslaw.smolinski 6cb4168f44 Turnstile improvement 2026-09-25 12:50:15 +02:00
radoslaw.smolinski b82ef82f50 Added protecting hooks 2026-09-25 12:42:38 +02:00
radoslaw.smolinski 9a18434f4a 1.2.13 2026-09-19 22:32:36 +02:00
radoslaw.smolinski f126eacf8c Fixed builCsp.ts 2026-09-19 22:32:29 +02:00
radoslaw.smolinski 848b12ce5d 1.2.12 2026-09-19 22:24:42 +02:00
radoslaw.smolinski 3d350bd9e5 Added styled Xml 2026-09-19 22:24:36 +02:00
radoslaw.smolinski e03dd8c5a6 1.2.11 2026-09-19 22:08:02 +02:00
radoslaw.smolinski 9101a5b48e Added security scripts support 2026-09-19 22:07:57 +02:00
radoslaw.smolinski 1186f4f620 1.2.10 2026-09-15 22:16:04 +02:00
radoslaw.smolinski 988fcaf855 fix createContentHelpers.ts 2026-09-15 22:16:01 +02:00
radoslaw.smolinski b27031f7c4 1.2.9 2026-09-15 21:55:51 +02:00
radoslaw.smolinski 7ee60e7313 SEO: multilingual homepage (homeSlug per locale in path/sitemap), Article + llms.txt generators, siteDescription fallback, composeTitle dedup 2026-09-15 21:55:48 +02:00
radoslaw.smolinski 671090b1b1 1.2.8 2026-09-15 21:16:59 +02:00
radoslaw.smolinski 0f03bb7446 SEO: multilingual homepage (homeSlug per locale in path/sitemap), Article + llms.txt generators, siteDescription fallback, composeTitle dedup 2026-09-15 21:16:53 +02:00
radoslaw.smolinski 55a1e5bf8f 1.2.7 2026-09-15 15:31:12 +02:00
radoslaw.smolinski 33ae035adc SEO: multilingual homepage (homeSlug per locale in path/sitemap), Article + llms.txt generators, siteDescription fallback, composeTitle dedup 2026-09-15 15:31:08 +02:00
radoslaw.smolinski 87d575f335 1.2.6 2026-09-09 22:21:09 +02:00
radoslaw.smolinski e4329f76b1 Fixed buildSitemapEntries.ts 2026-09-09 22:21:04 +02:00
radoslaw.smolinski fa4cf20022 1.2.5 2026-09-09 09:57:00 +02:00
radoslaw.smolinski 2ecfc2e12d Fixed support for multi-langual slugs 2026-09-09 09:56:47 +02:00
radoslaw.smolinski db2ac80a1e 1.2.4 2026-09-09 00:06:27 +02:00
radoslaw.smolinski 99490bfc4d Updated docs 2026-09-09 00:06:18 +02:00
radoslaw.smolinski fce17654f8 1.2.3 2026-09-08 18:13:16 +02:00
radoslaw.smolinski 419207ac12 Added support for single localization 2026-09-08 18:12:58 +02:00
radoslaw.smolinski e30ac71044 1.2.2 2026-09-08 14:25:26 +02:00
radoslaw.smolinski 781e348ded Page title generator on browser tab rebuilded. 2026-09-08 14:25:15 +02:00
radoslaw.smolinski e16a18e488 1.2.1 2026-09-08 13:14:15 +02:00
radoslaw.smolinski 7cd3cbaae5 1.2.0: local SEO structured data (LocalBusiness, Service, FAQPage), noindex per page, exclude 404 from sitemap, robots param docs 2026-09-08 13:14:05 +02:00
1595 changed files with 159747 additions and 14597 deletions
+105
View File
@@ -0,0 +1,105 @@
# Runs on every push and pull request: typecheck, lint, unit tests, build.
# Gitea Actions uses the GitHub Actions syntax; needs a runner with Docker.
name: CI
on:
push:
branches: [main]
pull_request:
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
# --ignore-scripts: skip `prepare` (the build) here; it runs as its own step.
- run: pnpm install --frozen-lockfile --ignore-scripts
- run: pnpm typecheck
- run: pnpm lint
- run: pnpm test:int
- run: pnpm build
# The reference site (reference/, docs/dev/reference-site-proposal.md). Fast part on every push and PR:
# install against the freshly built plugin, committed generated files current, typecheck.
reference:
runs-on: ubuntu-latest
needs: check
env:
PAYLOAD_SECRET: ci-reference-secret-0123456789abcdef
DATABASE_URI: mongodb://127.0.0.1:27017/example-studiopl_dev
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile --ignore-scripts
- run: pnpm build
# file:.. + injected: the site gets a copy of the built plugin with its peers from the site (README.md)
- run: pnpm --dir reference install --frozen-lockfile --ignore-workspace
- run: pnpm --dir reference exec iapl-tokens --check
- run: pnpm --dir reference generate:importmap && git diff --exit-code reference/src/app
- run: pnpm --dir reference generate:types && git diff --exit-code reference/src/payload-types.ts
- run: pnpm --dir reference typecheck
# iapl-doctor (static, docs/doctor.md): the reference site is the zero-findings example — any unsilenced finding fails
- run: node bin/iapl-doctor.mjs reference --strict --offline
# Full run on main (and before a release): MongoDB, seed, production build, smoke tests.
reference-full:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: reference
services:
mongo:
image: mongo:7
ports: ['27017:27017']
env:
CI: '1'
DATABASE_URI: mongodb://127.0.0.1:27017/example-studiopl_dev
PAYLOAD_SECRET: ci-reference-secret-0123456789abcdef
NEXT_PUBLIC_SERVER_URL: http://localhost:3100
IAPL_IP_HEADER: x-forwarded-for
# cookieScanner.crawl → iaplEnvRules({ cookieCrawl }) requires both in production; CI never starts a crawl
IAPL_COOKIE_SCAN_URL: http://127.0.0.1:9/crawl
IAPL_COOKIE_SCAN_TOKEN: ci-cookie-scan-token-0123456789
NEXT_PUBLIC_TURNSTILE_SITE_KEY: 1x00000000000000000000AA
TURNSTILE_SECRET_KEY: 1x0000000000000000000000000000000AA
ALLOW_LOCAL_MEDIA: '1'
E2E_BASE_URL: http://localhost:3100
E2E_ADMIN_EMAIL: [email protected]
E2E_ADMIN_PASSWORD: ci-e2e-password-not-secret
E2E_TOTP_SECRET: JBSWY3DPEHPK3PXPJBSWY3DPEHPK3PXP
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile --ignore-scripts
- run: pnpm build
- run: pnpm --dir reference install --frozen-lockfile --ignore-workspace
- run: pnpm --dir reference seed
# the documented production seed path (Coolify Terminal): one named record, dry run
- run: SEED_ONLY="pages:kontakt" SEED_DRY_RUN=1 pnpm --dir reference seed
- run: pnpm --dir reference payload run e2e/create-test-admin.ts
- run: pnpm --dir reference build
- run: pnpm --dir reference exec playwright install --with-deps chromium
- run: pnpm --dir reference test:e2e
# iapl-doctor (deep + HTTP): read-only database counts, the import map, the env rules, and the running site
- run: |
PORT=3100 pnpm --dir reference start &
for i in $(seq 1 60); do curl -sf http://localhost:3100/api/health >/dev/null && break; sleep 2; done
node bin/iapl-doctor.mjs reference --strict --offline --deep --url http://localhost:3100
+7 -5
View File
@@ -50,9 +50,11 @@ next-env.d.ts
# local db & build artifacts
*.db
*.tgz
0
# local db & build artifacts
*.db
*.tgz
0
# build output — produced by `pnpm build` (prepare/prepublishOnly), not committed
/dist
# pnpm starter:gate work folder
.starter-gate/
.legacy-site-*/
.tmp-consent-upgrade-*
+17
View File
@@ -2,3 +2,20 @@
This project uses the Payload CMS skill at `.claude/skills/payload/`.
Start with `.claude/skills/payload/SKILL.md` for a quick reference, then see `.claude/skills/payload/reference/` for detailed docs.
## Main rule: the plugin helps projects, never limits them
IAPL (Intecion Advanced Payload Library, package `@intecion/ipal-kit`, formerly ipal-kit) is a plugin. Every change must leave the consuming project free to adapt it.
- Every module and feature can be turned off on its own. Turning one off never takes away anything the project still needs.
- Every default can be overridden: access rules, fields, hooks, labels, routes, collections and globals. The project's own config is merged with the plugin's and wins.
- Secure defaults are welcome. They come with an option to loosen or extend them, never as a hard lock.
- Export the building blocks (helpers, builders, hooks), not only finished features.
- Never force a dependency, route, UI or data shape where an option or an exported piece would do.
## Rule: an agent that adds the plugin gets the complete guide
When an agent adds IAPL to a project, `docs/agent/AGENT.md` and the `iapl-*` skills (installed by `iapl-skills`) must tell it how to set up and use every function the plugin supports.
- Every export, option, env var, route, middleware, layout component, admin import-map entry and hook a project must wire is documented, with steps and a way to verify it.
- A change that adds or alters a feature updates the agent guide and the matching skill in the same change.
+92 -20
View File
@@ -1,12 +1,20 @@
# @intecion/ipal-kit
# IAPL (`@intecion/ipal-kit`)
Intecion Payload Advanced Library — a plugin for Payload CMS 3.
IAPL, the Intecion Advanced Payload Library — a plugin for Payload CMS 3. It was called ipal-kit before 1.17.0;
the package name, `@intecion/ipal-kit`, is unchanged, and every older name keeps working
([names table](./docs/agent/AGENT.md#names-iapl-and-ipal-kit)).
Provides internationalization (per-locale routing, hreflang, language switcher),
SEO (metadata, canonical, sitemap, robots), forms (Turnstile, rate limiting,
validation), consent management (consent mode), analytics (GA4/GTM), and a
blog/archive system (collections under an archive page, listing, pagination).
**Principle:** IAPL helps projects, never limits them — every module can be
turned off on its own, every default (access, fields, hooks, labels, routes,
collections, globals) can be overridden and the project's config wins, and the
building blocks are exported, not only the finished features. Where the code
doesn't meet this yet, the module's doc says so.
**Repository:** https://git.intecion.net/IntecionSoftware/ipal-kit
---
@@ -44,7 +52,7 @@ You *can* install straight from the repo
quick throwaway test it works. But prefer the registry for real projects:
- **Client components resolve correctly.** A git install unpacks into a
commit-hashed path (`.pnpm/@intecion+ipal-kit@git+https…#hash/…`) that breaks
commit-hashed path (`.pnpm/@intecion+IAPL@git+https…#hash/…`) that breaks
Next.js's React Client Manifest — the consent banner, analytics, and Turnstile
components fail at runtime with "Could not find the module … in the React
Client Manifest". The registry unpacks to a clean `node_modules/@intecion/…`
@@ -55,23 +63,80 @@ quick throwaway test it works. But prefer the registry for real projects:
Keep the git install only for pulling a specific unreleased commit during
plugin development.
### A new site in one command
```bash
pnpm --config.auto-install-peers=false dlx @intecion/ipal-kit@<version> create intecion.com
```
Asks the architecture questions (or reads `--answers answers.json`), generates the site from the reference
site with every team convention, installs it from a shipped lockfile and makes the first commit. Needs the
`@intecion` registry line in `~/.npmrc`. Details: [docs/project-starter.md](./docs/project-starter.md).
---
## Finish setting up your project
The plugin doesn't pull in the dependencies it shares with Payload — add them
yourself, in a version matching your Payload:
`nodemailer`, `lucide-react`, `slugify` and `server-only` are regular
`dependencies` of the plugin — they install with it; don't add them yourself.
The plugin's `nodemailer` 10 needs **Node.js 20 or later**; Payload 3.94 itself needs **Node.js 22.23.5 or later**
on the 22 line.
What you provide are the **peer dependencies** — packages the plugin shares with
your project — in a version matching your Payload. The plugin accepts Payload `^3.90.2`; the reference site and the starter use
**3.94.1** (with `react` / `react-dom` 19.3.1, which Payload 3.94 requires):
| Peer | Range | Notes |
|---|---|---|
| `payload`, `@payloadcms/next`, `@payloadcms/ui`, `@payloadcms/richtext-lexical` | `^3.90.2` | already in a `create-payload-app` project |
| `next`, `react` | `>=15`, `^19.0.0` | already in a `create-payload-app` project |
| `@payloadcms/plugin-seo`, `@payloadcms/plugin-form-builder` | `^3.90.2` | **add these** |
| `@clocklimited/payload-2fa` | `^3.0.0-0` | optional peer, but **needed by default**: 2FA is enforced and `iapl()` throws at startup unless you pass `twoFactor: { issuer, plugin: payloadTotp }` (or opt out with `twoFactor: false`) |
| `@payloadcms/storage-s3` | `^3.90.2` | optional — only when media go to Cloudflare R2 ([docs/storage.md](./docs/storage.md)) |
```bash
pnpm add @payloadcms/plugin-seo@3.84.1 @payloadcms/plugin-form-builder@3.84.1 \
nodemailer lucide-react slugify server-only
pnpm add @payloadcms/plugin-seo@3.94.1 @payloadcms/plugin-form-builder@3.94.1 \
@clocklimited/payload-2fa
pnpm add @payloadcms/[email protected] # only with R2 media
```
> **Match `lucide-react` to the plugin.** The plugin uses `lucide-react@^0.400.0`.
> If your project pulls a different major (e.g. `1.x`), you end up with two copies
> and confusing type errors. Pin your project to the same range.
Keep every `@payloadcms/*` at exactly the same version as `payload`
(`pnpm.overrides` — see PROGRAMISTA.md §1). Then run `pnpm audit --prod`: even
Payload 3.94.1 brings a vulnerable `happy-dom` (via Lexical) and `dompurify` — add
the two overrides from [AGENT.md §4 item 12](./docs/agent/AGENT.md); an older Payload
also needs the `mongoose` (MongoDB adapter, up to 3.93) and `undici` (up to 3.91)
ones listed there (recommended, not required by the plugin). Upload optimization and image
placeholders also use the `sharp` you pass to `buildConfig({ sharp })`
(standard in a `create-payload-app` project).
From here, the guide takes over: **[docs/getting-started.md](./docs/getting-started.md)** —
> **`lucide-react` comes with the plugin, at `^0.400.0`.** For a `0.x` version
> the caret means **`0.400.x` only** — not "0.400 or newer". If your project also
> uses `lucide-react` at another version (e.g. `0.5xx` or `1.x`), you end up with two
> copies and confusing type errors. Pin your project to `~0.400.0` too.
**Working with an AI agent?** Run this right after installing (and after every upgrade):
```bash
pnpm exec iapl-skills
```
It copies the `iapl-*` agent skills into `.agents/skills/` and adds a marked
`<!-- iapl:start -->` block to `AGENTS.md` (plus a `CLAUDE.md` that imports it, if you
have none) pointing the agent at the full guide: `AGENT.md`, the `iapl-reference` skill
(every option, env var, route and export) and the `iapl-setup` skill. Only the text between
the markers is ever rewritten. `--no-pointer` skips that step. There is no `postinstall` script.
`pnpm exec iapl-skills --external` also adds a few well-known third-party skills as `ext-*` folders — Vercel's
React best practices and composition patterns, Addy Osmani's accessibility skill, Anthropic's frontend-design
skill and the official Payload 3 skill. They are vendored into the package at pinned commits (text only, each
with its licence and source), so nothing is downloaded, and each starts with a note that IAPL's rules win.
Pick some with `--external ext-accessibility,ext-payload`.
*Updating the pins (plugin maintainers):* change the commit in `scripts/vendor-external-skills.mjs`, run
`node scripts/vendor-external-skills.mjs`, review `git diff docs/agent/external`, and run
`pnpm vitest run test/externalSkills.test.ts`.
From here, the guide takes over: **[docs/dev/PROGRAMISTA.md](./docs/dev/PROGRAMISTA.md)** —
from an empty project to a working site.
---
@@ -96,15 +161,20 @@ scope `write:package`. Put it in the `GITEA_TOKEN` env var.
| Linux / Ubuntu | `~/.npmrc` |
| Windows | `%USERPROFILE%\.npmrc` |
Then build and publish:
Then version and publish (commit your changes first — `npm version` needs a
clean working tree):
```bash
pnpm clean && pnpm build
npm version patch # 1.0.0 → 1.0.1
npm publish
npm version patch # 1.0.0 → 1.0.1 (commit + tag)
npm publish # prepublishOnly runs: pnpm clean && pnpm build && pnpm build:starter && pnpm test:int && pnpm starter:gate
git push && git push --tags
```
Full checklist and troubleshooting: **[docs/publishing.md](./docs/publishing.md)**.
`publishConfig.registry` in `package.json` already points at the Gitea registry,
so `npm publish` needs no `--registry` flag. A failing build or test aborts the
publish.
Full checklist and troubleshooting: **[docs/dev/PROGRAMISTA.md §8](./docs/dev/PROGRAMISTA.md)**.
---
@@ -112,9 +182,10 @@ Full checklist and troubleshooting: **[docs/publishing.md](./docs/publishing.md)
Everything lives in the **[docs/](./docs)** directory. To get started:
- **[getting-started.md](./docs/getting-started.md)** — project setup, step by step
- **[publishing.md](./docs/publishing.md)** — releasing new plugin versions
- **[AGENT.md](./docs/agent/AGENT.md)** — rules for AI agents
- **[PROGRAMISTA.md](./docs/dev/PROGRAMISTA.md)** — setup, deployment, upgrades, releasing
- **[README.md](./docs/README.md)** — index of the plugin's modules
- **[CHANGELOG.md](./docs/CHANGELOG.md)** — what changed per version and what projects must update
---
@@ -124,8 +195,9 @@ Everything lives in the **[docs/](./docs)** directory. To get started:
|---|---|
| `404` on `pnpm add @intecion/...` | the `@intecion:registry` line is missing from `.npmrc` — the install went to public npm instead of Gitea |
| `Could not find the module … in the React Client Manifest` | installed from git, not the registry — reinstall from the registry (clean path) |
| two versions of `lucide-react` | your project pins a different major than the plugin's `^0.400.0` — align them |
| two versions of `lucide-react` | your project uses a `lucide-react` outside the plugin's `^0.400.0` (= `0.400.x`) — align them |
| `[iapl] 2FA is enforced but no 2FA plugin was injected` | install `@clocklimited/payload-2fa` and pass `twoFactor: { issuer, plugin: payloadTotp }` |
| `missing secret key … to secure Payload` | `PAYLOAD_SECRET` isn't set in the runtime environment (not a plugin issue) |
If you get stuck, see **[docs/publishing.md](./docs/publishing.md)** or message the
If you get stuck, see **[docs/dev/PROGRAMISTA.md](./docs/dev/PROGRAMISTA.md)** or message the
team that maintains the plugin.
+102
View File
@@ -0,0 +1,102 @@
#!/usr/bin/env node
// iapl-blocks — the block library's command line.
// pnpm exec iapl-blocks list → the library blocks
// pnpm exec iapl-blocks eject faq → src/blocks/Faq/{config.ts,Component.tsx}
// pnpm exec iapl-blocks eject faq --dest src/blocks --dry-run
// Eject copies one block's source into the project, with its imports pointing at the
// package entries, so the project owns it: same slug and data shape, no migration.
// Then: use the ejected builder in Pages.layout instead of the library one, pass the ejected
// component as createBlockRegistry({ components: { faq: FaqBlock } }), record it in AGENTS.md.
import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync } from 'node:fs'
import { dirname, join, relative, resolve } from 'node:path'
import { fileURLToPath } from 'node:url'
const args = process.argv.slice(2)
const [command, slug] = args
const dryRun = args.includes('--dry-run')
const destArg = args.indexOf('--dest')
const dest = resolve(process.cwd(), destArg >= 0 ? args[destArg + 1] : 'src/blocks')
const pkgRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..')
const libRoot = join(pkgRoot, 'src/modules/block-library')
const blocksRoot = join(libRoot, 'blocks')
if (!command || command === '--help' || command === '-h') {
console.log('Usage: iapl-blocks list | iapl-blocks eject <block> [--dest src/blocks] [--dry-run]')
process.exit(0)
}
const slugs = existsSync(blocksRoot) ? readdirSync(blocksRoot).sort() : []
if (command === 'list') {
console.log(slugs.join('\n'))
process.exit(0)
}
if (command !== 'eject' || !slug) {
console.error('Usage: iapl-blocks eject <block>')
process.exit(1)
}
if (!slugs.includes(slug)) {
console.error(`Unknown block "${slug}". Blocks: ${slugs.join(', ')}`)
process.exit(1)
}
/**
* Where an import inside the library goes in a project, by the file it points at.
* Config files (no React) take the Payload-side entries; components take /rsc and /client.
*/
const ROOT = '@intecion/ipal-kit'
const BLOCKS = '@intecion/ipal-kit/blocks'
const RSC = '@intecion/ipal-kit/blocks/rsc'
function target(file, isComponent) {
const rel = relative(join(pkgRoot, 'src/modules'), file).replace(/\\/g, '/').replace(/\.js$/, '')
if (rel.startsWith('block-library/')) {
const inner = rel.slice('block-library/'.length)
if (/^(define|fields|options|shared|types|faq|library|manifest|thumbnails)$/.test(inner)) {return BLOCKS}
return RSC // context, data, texts, ui/*
}
if (rel === 'lightbox/LightboxProvider' || rel === 'richtext/TableOfContents') {return '@intecion/ipal-kit/client'}
if (rel === 'forms/RenderForm' || rel === 'richtext/RenderRichText') {return '@intecion/ipal-kit/rsc'}
if (rel === 'richtext/headings') {return isComponent ? '@intecion/ipal-kit/rsc' : ROOT}
return ROOT
}
/** Rewrites relative imports to package entries and merges imports of the same entry. */
function rewrite(source, file) {
const isComponent = file.endsWith('.tsx')
const merged = new Map()
const body = source.replace(/^import (type )?\{([^}]*)\} from '(\.[^']+)'\n/gm, (_, type, names, spec) => {
const entry = target(resolve(dirname(file), spec), isComponent)
const key = `${type ? 'type ' : ''}${entry}`
const set = merged.get(key) ?? new Set()
for (const n of names.split(',').map((s) => s.trim()).filter(Boolean)) {set.add(n)}
merged.set(key, set)
return ''
})
const lines = [...merged].map(([key, set]) => {
const [type, entry] = key.startsWith('type ') ? ['type ', key.slice(5)] : ['', key]
return `import ${type}{ ${[...set].sort().join(', ')} } from '${entry}'`
})
return body.replace(/^((?:import [^\n]*\n)*)/, (head) => `${head}${lines.join('\n')}\n`).replace(/\n{3,}/g, '\n\n')
}
const folder = slug[0].toUpperCase() + slug.slice(1)
const outDir = join(dest, folder)
const files = readdirSync(join(blocksRoot, slug)).filter((f) => /\.(ts|tsx)$/.test(f))
for (const name of files) {
const from = join(blocksRoot, slug, name)
const to = join(outDir, name)
if (existsSync(to)) {
console.error(`skip ${relative(process.cwd(), to)} (exists — delete it first to eject again)`)
continue
}
const out = `// Ejected from @intecion/ipal-kit (block library: ${slug}). The project owns this file now.\n${rewrite(readFileSync(from, 'utf8'), from)}`
console.log(`${dryRun ? 'would write' : 'write'} ${relative(process.cwd(), to)}`)
if (!dryRun) {
mkdirSync(outDir, { recursive: true })
writeFileSync(to, out)
}
}
console.log(`\nNext: Pages.layout → the ejected build${folder}Block; registry → components: { ${slug}: ${folder}Block }; AGENTS.md → "Project decisions".`)
+17
View File
@@ -0,0 +1,17 @@
#!/usr/bin/env node
// iapl-doctor — checks a site against the IAPL team rules and lists every gap with a fix hint
// (docs/doctor.md). Static by default: reads files, writes nothing (except a first-seen date in
// iapl-doctor.json outside CI).
// pnpm exec iapl-doctor → this project, human-readable
// pnpm exec iapl-doctor --strict --offline → CI on a new site: any finding fails
// pnpm exec iapl-doctor --deep --url http://localhost:3000
// pnpm exec iapl-doctor --json > doctor.json
// pnpm dlx --package=@intecion/ipal-kit@latest iapl-doctor → the newest rules
// Exit: 0 ok · 1 findings · 2 could not run · 3 a rule crashed.
import { dirname, join } from 'node:path'
import { fileURLToPath, pathToFileURL } from 'node:url'
const pkgRoot = join(dirname(fileURLToPath(import.meta.url)), '..')
const { runDoctorCli } = await import(pathToFileURL(join(pkgRoot, 'dist', 'modules', 'doctor', 'cli.js')).href)
process.exit(await runDoctorCli(process.argv.slice(2), { packageRoot: pkgRoot }))
+211
View File
@@ -0,0 +1,211 @@
#!/usr/bin/env node
// iapl-skills — copies the IAPL agent skills into the project.
// pnpm exec iapl-skills → ./.agents/skills/iapl-*
// pnpm exec iapl-skills --dry-run → show what would change
// pnpm exec iapl-skills --dest .claude/skills
// pnpm exec iapl-skills --no-pointer → skills only, leave AGENTS.md / CLAUDE.md alone
// pnpm exec iapl-skills --external → also the vendored third-party skills (ext-*, pinned, text only)
// pnpm exec iapl-skills --external ext-accessibility,ext-payload → only those
// Only folders named iapl-* are touched; the project's own skills stay as they are.
// iapl-* folders that no longer exist in the package are removed (renamed/retired skills).
// Before 1.17.0 the skills were named ipal-*: the 16 folders of that set are removed by their
// exact names (LEGACY_SKILLS) — any other ipal-<something> folder is the project's own and stays.
// `ipal-skills` is the same command under its old name.
// ext-* folders are touched only with --external, and only those carrying IAPL's SOURCE.md.
// AGENTS.md (and CLAUDE.md) get a marked IAPL block pointing at the guide — only the
// text between the markers is ever rewritten; the project's own content stays as it is.
import { createHash } from 'node:crypto'
import { cpSync, existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, rmSync, statSync, writeFileSync } from 'node:fs'
import { basename, dirname, join, relative, resolve, sep } from 'node:path'
import { fileURLToPath } from 'node:url'
const args = process.argv.slice(2)
if (args.includes('--help') || args.includes('-h')) {
console.log('Usage: iapl-skills [--dest <dir>] [--dry-run] [--no-pointer] [--external [ext-a,ext-b]]\nDefault dest: .agents/skills')
process.exit(0)
}
const dryRun = args.includes('--dry-run')
const pointer = !args.includes('--no-pointer')
const externalArg = args.indexOf('--external')
const externalPick = externalArg >= 0 && args[externalArg + 1] && !args[externalArg + 1].startsWith('-')
? args[externalArg + 1].split(',').map((n) => n.trim()).filter(Boolean)
: null
const destArg = args.indexOf('--dest')
const destValue = destArg >= 0 ? args[destArg + 1] : '.agents/skills'
// A missing value would resolve to cwd and remove every iapl-* folder there.
if (!destValue || destValue.startsWith('-')) {
console.error('iapl-skills: --dest needs a directory, e.g. --dest .claude/skills')
process.exit(1)
}
const dest = resolve(process.cwd(), destValue)
// Compared AFTER resolving links: `--dest root-link` (a link to `.`), `..` or `/` would otherwise pass and lose
// the iapl-* folders of the project root, its parent or the filesystem root. A folder that does not exist yet is
// resolved through its nearest existing parent.
const real = (path) => {
const rest = []
let at = path
while (!existsSync(at) && dirname(at) !== at) {
rest.unshift(basename(at))
at = dirname(at)
}
return join(realpathSync(at), ...rest)
}
const realDest = real(dest)
const realRoot = real(resolve(process.cwd()))
if (realDest === realRoot || realRoot.startsWith(realDest.endsWith(sep) ? realDest : `${realDest}${sep}`)) {
console.error(`iapl-skills: --dest must be a folder inside the project or elsewhere, not the project root or a folder that holds it (${destValue} is ${realDest})`)
process.exit(1)
}
const pkgRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..')
const src = join(pkgRoot, 'docs', 'agent', 'skills')
if (!existsSync(src)) {
console.error(`iapl-skills: no skills found in ${src} — is @intecion/ipal-kit installed with docs?`)
process.exit(1)
}
// Validate --external before anything is copied.
const extSrc = join(pkgRoot, 'docs', 'agent', 'external')
const manifest = externalArg >= 0 ? JSON.parse(readFileSync(join(extSrc, 'manifest.json'), 'utf8')) : { skills: [] }
const known = manifest.skills.map((skill) => skill.name)
const unknown = (externalPick ?? []).filter((name) => !known.includes(name))
if (unknown.length) {
console.error(`iapl-skills: unknown external skill(s): ${unknown.join(', ')} — available: ${known.join(', ')}`)
process.exit(1)
}
// The same list as LEGACY_SKILL_NAMES in src/modules/doctor/rules/legacy.ts (test/legacyNames.test.ts compares them).
const LEGACY_SKILLS = [
'audit', 'block', 'collection', 'consent-check', 'debug', 'doctor', 'form', 'locale-add',
'migrate-fields', 'nav', 'plugin-gap', 'reference', 'seo-check', 'setup', 'site', 'upgrade',
].map((name) => `ipal-${name}`)
const isDir = (base, name) => statSync(join(base, name)).isDirectory()
const isSkillDir = (base, name) => name.startsWith('iapl-') && isDir(base, name)
const shipped = readdirSync(src).filter((n) => isSkillDir(src, n))
const existing = existsSync(dest) ? readdirSync(dest).filter((n) => isSkillDir(dest, n)) : []
const retired = [
...existing.filter((n) => !shipped.includes(n)),
...(existsSync(dest) ? readdirSync(dest).filter((n) => LEGACY_SKILLS.includes(n) && isDir(dest, n)) : []),
]
if (!dryRun) mkdirSync(dest, { recursive: true })
for (const name of shipped) {
const action = existing.includes(name) ? 'update' : 'add '
console.log(`${action} ${name}`)
if (!dryRun) {
rmSync(join(dest, name), { recursive: true, force: true }) // drop files removed upstream
cpSync(join(src, name), join(dest, name), { recursive: true })
}
}
for (const name of retired) {
console.log(`remove ${name} (${LEGACY_SKILLS.includes(name) ? `now ${name.replace('ipal-', 'iapl-')}` : 'no longer in IAPL'})`)
if (!dryRun) rmSync(join(dest, name), { recursive: true, force: true })
}
console.log(`${dryRun ? '[dry-run] ' : ''}${shipped.length} skill(s) → ${dest}`)
// Third-party skills, vendored into the package at pinned commits (docs/agent/external,
// scripts/vendor-external-skills.mjs). Nothing is downloaded here: every file is checked
// against manifest.json before it is copied.
if (externalArg >= 0) {
const MARK = 'Vendored by @intecion/ipal-kit'
const ours = (name) => existsSync(join(dest, name, 'SOURCE.md')) && readFileSync(join(dest, name, 'SOURCE.md'), 'utf8').includes(MARK)
const filesOf = (dir) => readdirSync(dir).flatMap((n) => (statSync(join(dir, n)).isDirectory() ? filesOf(join(dir, n)).map((f) => `${n}/${f}`) : [n]))
for (const skill of manifest.skills.filter((s) => !externalPick || externalPick.includes(s.name))) {
const from = join(extSrc, skill.name)
const files = filesOf(from).sort()
const tampered = files.filter((f) => skill.files[f] !== createHash('sha256').update(readFileSync(join(from, f))).digest('hex'))
if (tampered.length || files.length !== Object.keys(skill.files).length) {
console.error(`iapl-skills: ${skill.name} does not match manifest.json (${tampered.join(', ') || 'file list'}) — skipped`)
process.exitCode = 1
continue
}
if (existsSync(join(dest, skill.name)) && !ours(skill.name)) {
console.warn(`skip ${skill.name} (a folder of that name exists and is not from IAPL)`)
continue
}
console.log(`${existsSync(join(dest, skill.name)) ? 'update' : 'add '} ${skill.name} (${skill.publisher}, ${skill.license}, ${skill.commit.slice(0, 12)})`)
if (!dryRun) {
rmSync(join(dest, skill.name), { recursive: true, force: true })
cpSync(from, join(dest, skill.name), { recursive: true })
}
}
const retiredExt = existsSync(dest)
? readdirSync(dest).filter((n) => n.startsWith('ext-') && !known.includes(n) && ours(n))
: []
for (const name of retiredExt) {
console.log(`remove ${name} (no longer in IAPL)`)
if (!dryRun) rmSync(join(dest, name), { recursive: true, force: true })
}
}
// Pointer block: an agent opening the project must find the guide without being told.
// AGENTS.md is read by Codex/Cursor/Antigravity, CLAUDE.md by Claude Code (which also
// follows `@AGENTS.md` imports, so a CLAUDE.md that imports AGENTS.md needs no copy).
if (pointer) {
const START = '<!-- iapl:start -->'
const END = '<!-- iapl:end -->'
const OLD_START = '<!-- ipal-kit:start -->'
const OLD_END = '<!-- ipal-kit:end -->'
const version = JSON.parse(readFileSync(join(pkgRoot, 'package.json'), 'utf8')).version
const skillsDir = relative(process.cwd(), dest).split('\\').join('/')
const block = [
START,
`## IAPL ${version} — agent guide`,
'',
'<!-- Managed by `pnpm exec iapl-skills` — edits between the markers are overwritten. -->',
'This project is built on `@intecion/ipal-kit` (a Payload CMS 3 plugin). Before you write code:',
'',
'1. Rules: `node_modules/@intecion/ipal-kit/docs/agent/AGENT.md`.',
`2. Everything the plugin provides (options, env vars, routes, layout, hooks, collections, globals, every export): the \`iapl-reference\` skill — \`${skillsDir}/iapl-reference/SKILL.md\`.`,
`3. New project or missing foundation: the \`iapl-setup\` skill; a whole site: \`iapl-site\`. All skills: \`${skillsDir}/\`.`,
'4. Module details: `node_modules/@intecion/ipal-kit/docs/<module>.md`.',
'5. IAPL first: if the plugin has it, use it. Broken or not enough → report it with the `iapl-plugin-gap` skill and wait for the owner — no hand-built replacement, never patch `node_modules`.',
'6. Before you set up a site: ask the owner the architecture questions (AGENT.md "Ask before you build") and wait for the answers; record them under "Project decisions".',
'7. IAPL docs, this guide and the skills are in English; write rules, AGENTS.md entries and gap reports in English.',
END,
].join('\n')
const upsert = (file, { create }) => {
const path = join(process.cwd(), file)
const text = existsSync(path) ? readFileSync(path, 'utf8') : null
let next
if (text === null) {
if (!create) return
next = create === 'import' ? '@AGENTS.md\n' : `# ${file.replace('.md', '')}\n\n${block}\n`
} else if (text.includes(START) && text.includes(END)) {
next = text.slice(0, text.indexOf(START)) + block + text.slice(text.indexOf(END) + END.length)
// both blocks (an upgrade, a rollback whose installer added the old block again, an upgrade): the old one goes
if (next.includes(OLD_START) && next.includes(OLD_END)) {
next = (next.slice(0, next.indexOf(OLD_START)).replace(/\s*$/, '') + '\n\n' + next.slice(next.indexOf(OLD_END) + OLD_END.length).replace(/^\s*/, '')).replace(/\s*$/, '\n')
}
} else if (text.includes(OLD_START) && text.includes(OLD_END)) {
// the block written before 1.17.0: replaced where it stands, markers included
next = text.slice(0, text.indexOf(OLD_START)) + block + text.slice(text.indexOf(OLD_END) + OLD_END.length)
} else {
next = `${text.replace(/\s*$/, '')}\n\n${block}\n`
}
if (next === text) return console.log(`ok ${file}`)
console.log(`${text === null ? 'create' : 'update'} ${file}`)
if (!dryRun) writeFileSync(path, next)
}
upsert('AGENTS.md', { create: 'block' })
const claude = join(process.cwd(), 'CLAUDE.md')
const importsAgents = existsSync(claude) && /^@AGENTS\.md\s*$/m.test(readFileSync(claude, 'utf8'))
// CLAUDE.md that imports AGENTS.md already sees the block — don't duplicate it.
if (!importsAgents) upsert('CLAUDE.md', { create: 'import' })
}
// Skills ship .ts/.tsx templates and scripts. A Next tsconfig ("include": ["**/*.tsx"]) would
// type-check them as project code and break `tsc` / `next build` → they must be excluded.
const tsconfig = join(process.cwd(), 'tsconfig.json')
const top = relative(process.cwd(), dest).split(/[\\/]/)[0]
if (existsSync(tsconfig) && top && !top.startsWith('..')) {
const text = readFileSync(tsconfig, 'utf8')
const exclude = text.match(/"exclude"\s*:\s*\[([^\]]*)\]/)?.[1] ?? ''
const entries = [...exclude.matchAll(/"([^"]*)"/g)].map((m) => m[1].replace(/^\.\//, '').replace(/\/(\*\*)?$/, ''))
if (!entries.includes(top)) {
console.warn(`\n⚠ tsconfig.json does not exclude "${top}" — skill templates would be type-checked and break the build.`)
console.warn(` Add it: "exclude": ["node_modules", "${top}"]`)
process.exitCode = 1
}
}
+13
View File
@@ -0,0 +1,13 @@
#!/usr/bin/env node
// iapl-tokens — the brand's design tokens: src/design/tokens.ts → src/design/tokens.css,
// plus a WCAG contrast check (docs/design-tokens.md).
// pnpm exec iapl-tokens → write src/design/tokens.css, print the contrast report
// pnpm exec iapl-tokens --check → fail when the CSS is out of date (CI, iapl-doctor)
// pnpm exec iapl-tokens --in x.ts --out y.css --warn-only
import { dirname, join } from 'node:path'
import { fileURLToPath, pathToFileURL } from 'node:url'
const pkgRoot = join(dirname(fileURLToPath(import.meta.url)), '..')
const { runTokensCli } = await import(pathToFileURL(join(pkgRoot, 'dist', 'modules', 'tokens', 'cli.js')).href)
process.exit(await runTokensCli(process.argv.slice(2)))
Executable
+23
View File
@@ -0,0 +1,23 @@
#!/usr/bin/env node
// iapl — the IAPL command line (also installed as `ipal-kit`, its name before 1.17.0, which `pnpm dlx @intecion/ipal-kit` runs).
// pnpm dlx @intecion/ipal-kit@<version> create intecion.com → a new client site (docs/project-starter.md)
// pnpm exec iapl create intecion.com --dir ../intecioncom-web --answers answers.json
// `pnpm dlx <package>` runs the bin named after the package, so every subcommand lives here.
// The other tools keep their own bins: iapl-skills, iapl-blocks, iapl-tokens, iapl-doctor.
import { dirname, join } from 'node:path'
import { fileURLToPath, pathToFileURL } from 'node:url'
const USAGE = `Usage: iapl <command> [options]
create <domain> a new client site from the reference site (iapl create --help)
Other tools: iapl-skills, iapl-blocks, iapl-tokens, iapl-doctor`
const [command, ...args] = process.argv.slice(2)
if (command !== 'create') {
console.log(USAGE)
process.exit(command === undefined || command === '--help' || command === '-h' ? 0 : 1)
}
const pkgRoot = join(dirname(fileURLToPath(import.meta.url)), '..')
const { runCreateCli } = await import(pathToFileURL(join(pkgRoot, 'dist', 'modules', 'starter', 'cli.js')).href)
process.exit(await runCreateCli(args))
+3
View File
@@ -0,0 +1,3 @@
#!/usr/bin/env node
// The path this command had before 1.17.0 (scripts and skills of older projects call it by path). Removed in 2.0.
import './iapl-blocks.mjs'
+3
View File
@@ -0,0 +1,3 @@
#!/usr/bin/env node
// The path this command had before 1.17.0 (scripts and skills of older projects call it by path). Removed in 2.0.
import './iapl-doctor.mjs'
+3
View File
@@ -0,0 +1,3 @@
#!/usr/bin/env node
// The path this command had before 1.17.0 (scripts and skills of older projects call it by path). Removed in 2.0.
import './iapl.mjs'
+3
View File
@@ -0,0 +1,3 @@
#!/usr/bin/env node
// The path this command had before 1.17.0 (scripts and skills of older projects call it by path). Removed in 2.0.
import './iapl-skills.mjs'
+3
View File
@@ -0,0 +1,3 @@
#!/usr/bin/env node
// The path this command had before 1.17.0 (scripts and skills of older projects call it by path). Removed in 2.0.
import './iapl-tokens.mjs'
+112
View File
@@ -0,0 +1,112 @@
# Changelog of the wire contract
## 1.7.1 — 2026-11-25 (not released; no tag yet)
Wording only; nothing for a client to change, and a copy of 1.7.0 need not be refreshed for it.
- **1.7.0 is required, not optional.** A client of 1.6 or older gets `400 invalid-request` on every request
that carries a token, because it does not send `X-Intecion-Site`. By the rule for development versions (§9)
it was numbered as a minor; read it as a breaking step. No client of 1.6 or older was released.
## 1.7.0 — 2026-11-25 (never released)
From the independent review of the first client. What a client built against 1.6.0 has to change is marked.
- **New, required: the header `X-Intecion-Site: <own host>` on every request that carries a token.** Missing:
`400 invalid-request`. Not the token's host: the new code **`403 host-mismatch`** (forget the token, enrol as
yourself). **Client: send the header; handle the code.** All examples with a token carry it; two new
examples (`send-host-mismatch`, `status-no-site-header`).
- **A client stores the host with the token and compares it with its own before use**, and compares the `host`
of `/v1/status` (§8, checklist 3). **Client: add the check.**
- **The confirm endpoint's limiter counts only refused calls**, after the nonce was looked up; never by the
caller's address first (§2). **Client: check the order.**
## 1.6.0 — 2026-11-25 (never released)
From the first client built against the contract (IAPL's). **The service did not change**; these are the
contract's words. What a client built against 1.5.0 has to change is marked.
- **An answer that is not the service's JSON** is no longer "like `503 unavailable`" for the report: with a
status from 400 to 499 it is *not sent*, with any other status (200 included) *not confirmed*.
**Client: change the report for that case.** Retrying it is as before.
- **A client that cannot keep key and bytes** (§1): no retry by itself after the report; a repeat by a person
is a new message; keys derived from the message's record are described, and for such a key
`idempotency-conflict` means "already handled". **Client: nothing must change; derived keys are an option.**
- **A site with a hand-issued token** does not enrol on `reverify` / `invalid-token`; it reports
`relay-refused` and what to ask Intecion for. **Client: nothing, if it already does this.**
- **`Origin` / `Sec-Fetch-Site`:** a client sends neither; said in §1. **Client: nothing for Node.**
- A stand-in need not reproduce the service's lists; said in §10.
## 1.5.0 — 2026-11-25 (never released)
After the third review.
- `new-recipients`: `account` mail is outside it; a form's confirmations may use four fifths of it.
- Failed sends: those in flight are counted in.
- Wording: `backend-failed`, `internal` and unknown codes mean "probably not sent"; the checklist asks a client
to limit "forgot password" itself.
## 1.4.0 — 2026-11-25 (never released)
After the second review.
- **Limits by kind:** `security-alert` has a budget of its own (`limit: "alerts"`, `limits.securityAlertsPerDay`)
outside hour and day; `account` mail may use the whole hour and day, every other kind four fifths. The
`quota` of a send answer is for that kind. `recipient` counts `form-confirmation` messages only.
- **The idempotency promise is now what the service does:** a key whose message was handed to the mail back end
is never sent again within 24 hours; when the result was not recorded it answers `in-progress` until then.
- **Failed sends** have a limit of their own: `429 rate-limited` after 60 in an hour.
- **Retrying:** three attempts, 30 seconds each, ten seconds of waiting in all; an enrolment on the way does
not count.
- **Subject:** U+200D, U+200C and U+00AD are allowed; everything else as before, with the rule a client strips by.
- Any mail of a site to Intecion's own address gets `[host]` in front of its subject.
- The confirm address: no redirect is followed — the usual causes and what to do; `given.quota` gains
`hour-share-used`.
## 1.3.0 — 2026-11-25 (never released)
- **The confirm path is fixed per product** (owner, 2026-11-25): `iapl` → `/api/iapl/mail-relay/confirm`,
`iawl` → `/?rest_route=/iawl/v1/mail-relay/confirm`. **`callbackPath` is gone from the enrolment request**
(a request that carries it is refused). A site that serves its API elsewhere has its path set by Intecion.
- Suppression is account-wide and stays so (owner, 2026-11-25): said in the code table.
## 1.2.0 — 2026-11-25 (never released)
After the first independent review. The wire format is the same; the text now has one reading where it had two.
- **Retrying:** at most three attempts in ten seconds, and the ten seconds win over `retryAfter`; "no answer"
and `in-progress` are reported as *not confirmed*, never as *not sent*.
- **Idempotency:** "the same body" is the same bytes; a client encodes a message once.
- **The confirm endpoint:** exactly `200` and the JSON object, at most 1024 bytes, within 8 seconds; the site
keeps its earlier token until `/v1/enrol` answers 200.
- **An answer that is not JSON** is `unavailable`, retryable.
- `Authorization: Bearer` in any case.
- **Schema:** `code` and `warnings` are open strings (new ones are minor changes); `to` is required unless the
kind is `security-alert`; recipients' `maxItems` is the service's bound, the site's limit is in `/v1/status`;
base64 is padded to a multiple of four (said in words: a pattern for it overflows on large files); lengths are
in code points.
- **Changed behaviour:** the per-recipient limit refuses `form-confirmation` only; a subject may not start with
the service's name in brackets; a `security-alert` gets the site's host in front of its subject;
`attachment-refused` names the file in `field` (suggested status `relay-attachment-refused`);
invisible characters (all of Unicode category Cf) are refused in subject and file names.
- Added: `limits.serverAddresses` in `/v1/status`; what happens beyond it.
- Before the first release tag, versions are development versions (§9).
## 1.1.0 — 2026-11-25 (never released)
- **The base address is `https://webservices.intecion.net/mail`**: one host for Intecion's web services, this
one under the path `/mail`. Paths in the contract are relative to the base address, as before; a client that
kept the base address as one constant changes that constant and nothing else.
- Added: `service.name` in the answer of `/v1/status` ("Intecion Notifications Webservice").
- The service sends from `[email protected]` (owner, 2026-11-25).
Minor, by the contract's own rule (§9): an answer field was added. No copy of 1.0.0 was released; a client that
copied it during development copies the folder again.
## 1.0.0 — 2026-11-25 (never released)
First version: `/v1/enrol` with the call-back and its confirmation, `/v1/send`, `/v1/status`, `/v1/rotate`,
`/v1/revoke`, `/health`; the error codes; the examples and the runner.
Differs from the design proposal (draft 4) in one visible point: the site's confirm endpoint answers `200` with
a `confirmation` (SHA-256 of nonce and token), not a bare `204`. Reason: `services/mail-relay/DECISIONS.md`, D1.
+64
View File
@@ -0,0 +1,64 @@
3d5c4b7ed53fe6fe2c7c28826c0cf666f9c1d0b79f861b404503e7029728a61f README.md
53da77d5dfff9948d68fca26b828563e21f83418245053d78b03a5aecac6c1d1 CHANGELOG.md
249182a01164b81a5f7af87e5c5cdbd3344a80a7a66dfca624cecfb1501b2420 VERSION
2ff0ad5b6a245365c0fa8733fa17b7bbd3ab91d4825981709d0fd02b762b939f schema.json
9d8381d2e3465e97dc801a61f598fcf822e27e73a2c0729877744ec307097910 runner.mjs
7c46860adee597e570832c72bcdb418752a20b9f7d1b2d7a656ed065f9632b2a checksums.mjs
df6015faf02a7cf7e9b5816b9e22b2e82968678ddd72a61c1f9665a8c0897ddf examples/callback-confirm-wordpress.json
f5018ca4fb7d25794ee92168d715aaf47feeba3d907c0550651b16c10a691ceb examples/callback-confirm.json
27bd95712cc36a71519cddc52c03d857b1009c2c384940dbc052022d86bc4231 examples/callback-unknown-nonce.json
de693b060c10c3d0f88fb8edfcd38c491cf141628d747328beee1b50c700c19b examples/enrol-address-literal.json
7c4cf75eb9ab156a3031336ab2688e7c9dcd4cd266b7b7e5e4592285dcbd25ba examples/enrol-callback-no-content.json
64466afc5bf0fecfa36f986d973cd987bbe1f64867e01cdf35e0de40838eb0d1 examples/enrol-callback-not-found.json
0000bcb2b3b676e4fda6c30b8de6e062c88f98c1fa2cc9f75bcd350d65dc0db4 examples/enrol-callback-path-given.json
8b522f16bc9b9980a5c849e94cea35fb268b0ba664dcd5a2e8e0fedd67c2c034 examples/enrol-callback-redirect.json
1e6483ebd85e3851848357266d8e16628a70420428b30d3ddb15253cdc2d9a0d examples/enrol-callback-wrong-confirmation.json
f64e4c75ced60e70b0f2f8e16adbde151be888fe5ac75813cdbe7eb5ecf8a00b examples/enrol-from-browser.json
218f463c95fd79868916390d4616c796d66154398a9864615f9ad0768f801aff examples/enrol-listed-active.json
b628eb5b30e693767e6830de58e0fd172497336f67b76a49a5fb06bfa626c481 examples/enrol-localhost.json
93304590382de5153a47fa88ee98356d0a5ba8039e195959291acd3c33e4a406 examples/enrol-short-nonce.json
e86e6ab23088c1c985ba18f287f66b49c50f51a584a7ca679b8b768597130efd examples/enrol-suspended.json
fe38f1fd1394a7fd42b1a1b0b74aa604578f17ab52590bf95a462a0c0f7d6087 examples/enrol-unlisted-pending.json
b9f71fe993dc39bdbc07e775e925a37175e18e1682fd8bffcc72b3581919be17 examples/health.json
5dff4194764f6f61b01a3f7f504907e578306a486d214e22d1a70b1a207e5ca3 examples/not-found.json
94943f85503cd891f1fb6f0258ab97b2eb48ec10e5f7ea233d349d4da97b8a1b examples/revoke-ok.json
1b467eac1040d56369276e5b8c12540a84942c8b7e3c2e458fc8da5b4f027c86 examples/rotate-ok.json
348f96a160c168797ab27ff0739b17df1762cc2ffdd72cb0a2b3ec2c695093bc examples/rotate-previous-token.json
39774a2ce0434dc791d79f9efb4b14f23203b7e8d58138acc7654265a875609b examples/send-attachments-too-large.json
75ec4de22780b36b41f198f065e38937beb4a50879fd204e080bdb935c2b5e8f examples/send-backend-failed.json
e3331a33604c2239c91c889d3dd338e473fd9b5d80fccb84a39491810bcceac0 examples/send-bearer-any-case.json
26f4f8a2929d132598bcb87e813616cef7b6277249c657cc618f4ede4cb4d906 examples/send-day-quota.json
660dbe2a747686077788f46fe45f269c3eb57e4579225979f91841e9f00fae7b examples/send-display-name-recipient.json
1c6bd0ed454f51acf545f0213fe6108f3639af975fb0751ef8d23bd92da9d4c7 examples/send-executable-attachment.json
ed6869754e418cc5e2a809e52a0242680d79f1bbc2eedd391de04375f29f7b9a examples/send-from-browser.json
e39d197f857b56103726b0f165c67a3476a06207961a59c6f6a1cf333bc3e7e9 examples/send-from-field.json
5c826cd0c297c773510ce37b66a0f6a6425e6282abc1ad30094fd5b545ae9193 examples/send-headers-field.json
3918635b33b32783db96ae17ebbd4296d2deca05d092b55573c574be172601ec examples/send-host-mismatch.json
a6809a8d475106f8e31ba432e56b46e9bf8683a0eca9d62378b1392cd6c44305 examples/send-hour-quota-account.json
c46852c9d9fc7eb83ac6bc3ca2a7c5b79100d2cae93a5cee6720b702b4c22490 examples/send-hour-quota.json
dc0f9c1c946d256aded0de70588c1d1f95740d333b234127f9bce8a4ed8beefb examples/send-key-reused.json
69edbf23c9723337f6327484e587b8cb7603c23e4b4954ebd275a0a794171325 examples/send-no-sender-name.json
bcbf5adcd0c224edb81c3b4188f261252835f715f541030db10432fa7ebd71a4 examples/send-no-token.json
32125ac9ff5460991633cce55febcb310247ca518eae7c650ef634e3f86376e0 examples/send-ok.json
7d8b14d372730f013ee7192021dda68859f779337b8d535bc564ac955a00e325 examples/send-pending.json
e3bbb041217d0a4f378285c06584a093d5e808d223d564e735c559f461fae8b8 examples/send-previous-token.json
53132e3e2177937dc2a35f7fe87f2f383f45ab001fc0306490941b44bb466e3c examples/send-recipient-quota-other-kinds.json
aff454882faab57d4a697be7250fdbac0272bcc2e0c099a6a27c50e0a980ac70 examples/send-recipient-quota.json
d514bc65a75f522389c90f1239d9afa43d96c7c2e7bd31fe0e85dd4c9d543ebd examples/send-recipient-suppressed.json
eb68d83a8d582a3722bf99330246d3d641e49a53e08bbe48e04e09a970cbb866 examples/send-replay.json
189dbdb3df1f0da0b6a1e8fdd0e90babf9dbfe9cfcaeb423ba24e2d59802b663 examples/send-security-alert.json
f299bc4f5193de0619d78551653a0b133a4ae5774dba93b23812b689a074a87d examples/send-sender-name-replaced.json
39a09b2bd01fc12d0e8cb2f93b71b24f31a4f2d0f639fe93b6bf37a7357be0ae examples/send-subject-direction-mark.json
ce4cbea2306f73bd5905249c10ab451a2599cb779e2386828971f40c97b8c591 examples/send-subject-imitates-service.json
247619f5575e898bd558ff7f7674f241c39f3a1e0ae51f589eb6a6dc2fe21e2b examples/send-subject-line-break.json
59175981e46a6f782ce3b4ed9c885699d7766823d660e5a524e89a4f2c6c459a examples/send-subject-visitor-text.json
987a2b4433161b4f2a6502d0487bf18f512f7a630a930ac66b1038cd6e000dc3 examples/send-suspended.json
91cd894526eef28e4dfb2456e476ba0be381e6d621ea833761cc9c63fe247e03 examples/send-text-plain.json
9c6278fcb13d7e06e0dd38ef34eba1abfbcb9c75100994b93c1c5a5444c35f85 examples/send-to-intecion-marked.json
1a1faf5a451220a35f2f0d66bb906e0d9944ed0a71c8209e07da419734a82567 examples/send-too-many-recipients.json
43d04c99549a4fe3c64af6f68b598299e92486af5a52432a2c93c3f9564f7959 examples/send-unknown-address.json
28e05f3c53cab6433b6af4d425511fa6655d0673df2e840af1fed9d25294a123 examples/send-unknown-token.json
f105c38ab11ab5fc508ba0ed3f23f69108c318765c2670029b230b5b9a83912a examples/status-active.json
89009ee9ab8f38e9ec290fb5412f206e1be28ad10fce6a7071d4406ac52dd4f0 examples/status-no-site-header.json
c9f49fa0dae1f0beacaacfe01660b467d06f990228c35a653307c8793f3c97a5 examples/status-pending.json
afdb07ba8279479b6bbfdc4289efda657d4e5a9eccd94b8de165ec728b4a2386 examples/status-unknown-address.json
+540
View File
@@ -0,0 +1,540 @@
# Intecion Notifications Webservice — wire contract
Version: see [`VERSION`](VERSION) (this text describes **1.7.1**). Path prefix of this major version: `/v1`.
This is the whole agreement between the Intecion Notifications Webservice ("the service" below) and a client (the mail transport built into a
site's plugin). It names no product: nothing here says Payload, WordPress, IAPL or IAWL except the values of
the `product` field. A client written from this document, in any language, works with the service.
| File | What |
|---|---|
| `README.md` | This document. Where it and the schema disagree, the schema wins and that is a bug to report |
| `schema.json` | JSON Schema (2020-12) of every body, under `$defs` |
| `examples/*.json` | One request and its answer per file, with the state it needs. They are the contract tests |
| `runner.mjs` | Runs the examples against anything that speaks the contract. No dependency; works in Node and in the Workers runtime |
| `checksums.mjs`, `CHECKSUMS` | SHA-256 of every file above, to detect a hand-edited copy |
| `VERSION`, `CHANGELOG.md` | Semantic version of the contract and what changed |
## 1. Basics
- **Base address: `https://webservices.intecion.net/mail`** — a client keeps it as one constant, host and path
together. Every path in this document and in the examples is relative to it: `POST /v1/send` is
`POST https://webservices.intecion.net/mail/v1/send`, `GET /health` is `…/mail/health`. A client joins the
base address and the path as text; it never resolves a path against the host alone.
- HTTPS only. Bodies are JSON in UTF-8. A request with a body carries `Content-Type: application/json`.
- **The service is for servers, not browsers.** It sends no CORS header, and it refuses any request that
carries an `Origin` header or a `Sec-Fetch-Site` header other than `none` (`403 browser-not-allowed`).
A client must send neither. A server runtime's `fetch` that adds them by itself has to be told not to, or the
header removed, or the service will take the site for a browser. (`Sec-Fetch-Mode` and `Sec-Fetch-Dest` are
not looked at: Node's `fetch` sends `sec-fetch-mode: cors` and passes.)
- **Requests are closed:** an unknown field is refused with `400 invalid-request` and the field's name. A
client cannot set `From`, `Sender`, `Return-Path` or any free header — there are no such fields.
- **Answers are open:** a client ignores fields it does not know.
- A client identifies itself with `User-Agent: <product>/<version>` (not checked, used for the log).
- **An answer that is not the service's JSON** — an error page of the network in front of the service, an empty
body, a cut-off answer — is no answer of the service. The client may retry it (as if `retryable` were true),
and what it means for a message depends on the status alone:
- status **400 to 499**: the request was turned away before the service handled it — **not sent**;
- **any other status, `200` included**: the service may have handled the request and only its answer was
lost — **not confirmed**, exactly like no answer at all (§1, "Retrying").
### Answers
Success is status `200` and a body with `"ok": true`.
Every refusal has the same body ([`Error`](schema.json)) — with one exception: `/health` answers only
`{ "ok": false }`.
```json
{ "ok": false, "code": "quota-exceeded", "message": "…", "retryable": false, "limit": "hour", "retryAfter": 1260 }
```
- `code` is what a client acts on. `message` is English text for a log or an administrator; never show it to a visitor.
- **`retryable` decides whether to try again, not the status.** `429 quota-exceeded` is not retryable;
`429 rate-limited` is.
- `retryAfter` (seconds) is also sent as the `Retry-After` header.
- The list of codes grows with minor versions. A client that meets a code it does not know acts on `retryable`
and shows the `message` to an administrator.
### All codes
| Status | `code` | Meaning | Retry | What a client does | Suggested site status |
|---|---|---|---|---|---|
| 400 | `invalid-request` | Body, header or field is wrong; `field` names it | no | Report a bug | — |
| 401 | `invalid-token` | No token, or one the service does not know (unknown, expired, revoked) | no | Enrol again, then send once more (§2, "Which token") | — |
| 401 | `reverify` | The token is good but comes from a server address the service has not seen for this site | no | Enrol again (the same call-back), then send once more | — |
| 403 | `site-pending` | Enrolled, waiting for approval by Intecion | no | Keep the token; show "waiting for approval" | `relay-pending` |
| 403 | `site-suspended` | Stopped by Intecion | no | Keep the token; show it; do not enrol again | `relay-suspended` |
| 403 | `host-not-allowed` | Enrolment: the host is not a public DNS name | no | Show it (a local or private site cannot use the service) | `relay-refused` |
| 403 | `enrolment-closed` | Enrolment is closed for this product, or altogether | no | Show it | `relay-refused` |
| 403 | `host-mismatch` | The token is good and comes from a known address, but the request's `X-Intecion-Site` names another site than the token's | no | Forget the token (it is another site's — a copied database, a token pasted into the wrong site), enrol as your own host, then send once more | — |
| 403 | `browser-not-allowed` | The request came from a browser | no | — | — |
| 404 | `not-found` | No such route | no | Report a bug | — |
| 405 | `method-not-allowed` | Wrong method | no | Report a bug | — |
| 409 | `enrolment-in-progress` | Another enrolment for this host is running right now | **yes** | Wait `retryAfter`, read your own store again (another process may have the token by now), enrol only if still without one | — |
| 409 | `in-progress` | A send with this `Idempotency-Key` is running right now — or was handed to the mail back end and its result was never recorded (then `retryAfter` is long, and the message may be out) | **yes** | Retry with the same key within the ten seconds; then report "not confirmed" | — |
| 409 | `idempotency-conflict` | This `Idempotency-Key` was used for a different message | no | Report a bug | — |
| 409 | `already-rotated` | `/v1/rotate` with a token that is no longer the current one | no | Read your own store again; if it has no newer token, enrol again | — |
| 413 | `too-large` | `limit` says what: `request`, `body` or `attachments` | no | Show it | `relay-too-large` |
| 415 | `unsupported-media-type` | Not `application/json` | no | Report a bug | — |
| 422 | `callback-failed` | Enrolment: the site's confirm endpoint did not confirm; `reason` is `unreachable`, `timeout`, `redirect`, `status` or `confirmation` | no | Show it, with the reason: firewall or wrong public host (`unreachable`, `timeout`); the site answers the confirm address with a redirect (`redirect`, §2); the endpoint is missing, blocked, or served at another path than its product's (`status`); something prints around the JSON (`confirmation`) | `relay-refused` |
| 422 | `too-many-recipients` | More than the allowed number in To, CC and BCC together | no | Show it | `relay-quota` |
| 422 | `attachment-refused` | A file type the service never carries, or a bad file name; `field` says which file (`attachments[0]`) | no | Show it; the message can be sent without that file | `relay-attachment-refused` |
| 422 | `recipient-suppressed` | The back end refuses one of the recipients (it bounced or complained before — for any site: **the suppression list is one for the whole service, and there is none per site**; an address that bounced for one client's site is refused for every other site too, until Intecion removes it). **Nothing was sent, to anybody.** The service is not told which address it is | no | Show it. With several recipients a client may send to each alone, each with a new key, to find the one | `relay-recipient-suppressed` |
| 429 | `rate-limited` | Too many requests from this address — or too many of this site's sends were refused or failed at the mail back end within the hour (60; a send that fails costs no quota, so it has a limit of its own; account mail and alerts are counted apart from the rest) | **yes** | Wait `retryAfter`; when that is longer than the ten seconds, report | `relay-unreachable` if it persists |
| 429 | `quota-exceeded` | A limit of the site (`limit`: `hour`, `day`, `recipient`, `new-recipients`, `alerts`) or of the whole service (`service`) | no | Show it; the message is not sent | `relay-quota` |
| 502 | `backend-failed` | The mail back end failed, or refused this message | **as `retryable` says** | Retry with the same key when `retryable` is true | `relay-unreachable` if it persists |
| 503 | `unavailable` | The service cannot work right now | **as `retryable` says** | Retry when `retryable` is true | `relay-unreachable` if it persists |
| 500 | `internal` | A fault in the service | **yes** | Retry | `relay-unreachable` if it persists |
A network error or a time-out is treated like `503`. The "suggested site status" column is advice, in the words
the IAPL design uses; a product may name its own. The warning `sender-name-replaced` (below) maps to
`relay-name-replaced`.
**Retrying — the one rule.** A client makes at most **three attempts** for one message, the same
`Idempotency-Key` and the same bytes each time, and only after an answer with `retryable: true` (or no usable
answer at all). Between the attempts it waits **at most ten seconds in all**. **The ten seconds win over
`retryAfter`:** when `retryAfter` is longer than what is left of them, the client stops at once and reports.
- **One attempt** has a time-out of **30 seconds** from sending the request to the end of the answer (a 10 MB
attachment has to fit). An attempt that times out counts as "no answer".
- **An enrolment made on the way** — because the client had no token, or got `invalid-token` or `reverify` — is
not one of the three attempts and its time (up to 10 seconds: the call-back has 8) is not part of the ten
seconds. A client enrols at most once per message.
What the client reports:
| The last thing that happened | The message | Report |
|---|---|---|
| `200` | was accepted | sent |
| A refusal with `retryable: false` | was not sent | the status of that code |
| `rate-limited`, `unavailable`, `enrolment-in-progress` (as the service's own JSON), or an answer that is not the service's JSON with a status from 400 to 499 | was not sent | `relay-unreachable` |
| `backend-failed`, `internal`, or a code the client does not know | **probably** not sent — the mail back end failed in a way it does not explain, and it does not say whether such a message can still go out | `relay-unreachable`, worded as "probably not sent". Like the next row: the same key and bytes if it is tried again |
| **No answer** (time-out, connection lost), an answer that is not the service's JSON with any status outside 400–499, or `409 in-progress` | **may have been sent** — the service cannot say yet, or will never be able to | `relay-unreachable`, worded as "not confirmed", never as "not sent". If the client tries this message again later it uses the **same key and bytes**: within 24 hours of the first attempt that cannot produce a second mail — once the service has handed a message to the mail back end, its key either answers with the result or goes on answering `in-progress`; it is never sent again. A client never sends the message under a new key by itself |
**"The same key and bytes" — and a client that cannot keep them.** The promise that a message is not sent
twice holds for as long as the client still has the message's key and its encoded bytes. What a client does
depends on what it can keep:
- **Within one attempt to deliver a message** (the three tries above) every client keeps both in memory.
- **A client with storage for unsent mail** keeps key and bytes with the message and may try again later.
- **A client without such storage** does not try again by itself once it has reported. "Not confirmed" is then
final for that message: the report says that the mail may or may not have gone out. If a person causes the
mail again — submits the form again, presses "send again" — that is a **new message with a new key**, and
when the first one did go out, the recipient gets it twice. The service cannot prevent that and a client
need not; it should say "not confirmed" in a way that does not invite an immediate repeat.
- **A key derived from the message's own record** narrows this without storing the mail: when the mail belongs
to something the site stores anyway (a form submission, a password-reset request), the client may build the
key from that record's id and the mail's role in it (for example the SHA-256 of both, in the key's
alphabet). A second attempt for the same record — after a restart, from another process — then arrives under
the same key, and the service answers it with the first result (`replayed`), with `in-progress`, or, when the
bytes differ because the mail was built again, with `409 idempotency-conflict`. For a derived key the client
treats **`idempotency-conflict` as "this record's mail was already handled"**, not as a bug: no second mail
either way. A deliberate "send again" by a person uses a new key (the record's id and a counter).
## 2. Enrolment — `POST /v1/enrol`
A site gets its token by proving that it is served at its host. No authentication, nothing to type.
1. The site makes a random **nonce** (32 to 128 characters of `A–Z a–z 0–9 _ -`; at least 128 bits of
randomness), keeps it for 5 minutes, and sends:
```json
{ "host": "example.com", "nonce": "…", "product": "iapl", "productVersion": "1.17.0" }
```
- `host`: the site's public DNS name, lowercase, punycode. No scheme, port, path, address literal, single
label, or private suffix (`.local`, `.internal`, `.test`, `localhost` …).
- There is **no call-back address in the request.** Where a site is called back is fixed per product
(below); a request that names a path is refused (`400`, field `callbackPath`).
2. Before it answers, the service calls the site: `POST https://<host><confirm path of the product>`, port 443,
no redirect followed, **8 seconds** for the whole exchange, body ([`CallbackRequest`](schema.json)):
```json
{ "nonce": "…", "token": "ims_…", "state": "active" }
```
3. **The site's confirm endpoint** accepts the call only if it holds exactly this nonce (compare in constant
time; single use; not expired). Then it stores the token and answers `200` with
```json
{ "confirmation": "<lowercase hex SHA-256 of nonce + \".\" + token>" }
```
In every other case it answers `404` and changes nothing.
**It is a public route: limit it — but only the calls it refuses.** Look the nonce up **first**. A call that
carries the nonce the site holds is the service's and is always answered; only calls that do **not** match
a held nonce count towards a limit. Do not limit by the caller's address before that look-up: the service's
calls come from addresses that every Worker on Cloudflare shares, so a stranger who sends a few requests
from a Worker of their own would use up "the service's" allowance and block the site's enrolment. (When the
site holds no nonce at all — it started no enrolment in the last five minutes — every call is a refused one
and can be answered `404` without any work.)
**Exactly this answer and nothing else.** Status `200` (not 201, not 204). The body is the JSON object alone,
UTF-8, at most 1024 bytes, the hex in lower case. Anything printed before or after it — a PHP notice, a
debug toolbar, a wrapper of the framework — makes the enrolment fail with `callback-failed`, reason
`confirmation`. The service reads no more than 1024 bytes and waits no longer than the 8 seconds.
**Which token.** The call-back arrives *before* `/v1/enrol` has answered. The site stores the new token
**beside** the one it has, and makes it the token it uses when `/v1/enrol` answers `200`. If that answer
never arrives, the site tries the new token on its next request and goes back to the earlier one on
`401 invalid-token` (the service may have failed after the call-back; the earlier token is then still good).
A site never throws a working token away for one it has not seen accepted.
4. The service checks the confirmation. Only then does the token become valid, the calling server's address
become one of the site's known addresses, and `/v1/enrol` answer `200`:
```json
{ "ok": true, "state": "active" }
```
`state` is `active` (the site may send) or `pending` (waiting for approval; sends answer `403 site-pending`
until Intecion approves, then the same token works). **The answer never carries the token.**
Why the confirmation, and not a bare `204`: plenty of ordinary endpoints answer "no content" to any POST (a
report collector, for one). Only an endpoint that knows the nonce *and* has read the token can compute the
confirmation, so nothing else on the host can be mistaken for the confirm endpoint.
Rules a client must know:
- **Enrolling again is the same call** and is how a site heals: after `401 invalid-token`, after `401 reverify`,
after a lost token. The earlier token stays valid for 24 hours (so other processes of the same site are not
cut off), the state is kept — a suspended site stays suspended (`403 site-suspended`, no call-back is made).
- A failed enrolment changes nothing on the service: tokens and addresses stay as they were.
- `409 enrolment-in-progress`: an enrolment for this host from this server is already running (or the
registry changed while the site was being called). It is retryable and is not counted against the site.
- **The confirm path is fixed per product**; a site cannot choose it:
| `product` | The service calls | Notes |
|---|---|---|
| `iapl` | `POST https://<host>/api/iapl/mail-relay/confirm` | Under Payload's default API route (`/api`) |
| `iawl` | `POST https://<host>/?rest_route=/iawl/v1/mail-relay/confirm` | WordPress's REST API addressed by query: the same address works with and without pretty permalinks. The route is `mail-relay/confirm` in the namespace `iawl/v1` |
The service calls **exactly that address and follows no redirect.** A site that redirects it fails with
reason `redirect` — the usual causes: the site adds or removes a trailing slash (Next.js `trailingSlash`),
sends `example.com` to `www.example.com` (enrol the host the site really answers on), or redirects `/` by
language. On WordPress, a security plugin or a setting that blocks or redirects `?rest_route=` gives
`status`. In each case either the site is changed to answer at the address, or Intecion sets the address it
does answer at (a path ending in `/confirm/`, for a site with trailing slashes).
**A project that serves its API somewhere else** — Payload with another `routes.api`, WordPress installed in a
sub-folder, a path prefix in front of the site — cannot say so in the request. Its path is set for its host
**by Intecion** (`ims callback-path <host> <path>`), before the site enrols; until then the enrolment fails
with `callback-failed`, reason `status`. A client shows that as "ask Intecion to set this site's confirm
address", with the address it serves. When an enrolled host confirms at another path than before, Intecion
is told.
- **Server addresses.** A site may send from a limited number of server addresses at a time
(`limits.serverAddresses` in `/v1/status`, 8 unless Intecion set another number). Each new address enrols by
itself after `401 reverify`; beyond the limit the address used longest ago is dropped and gets `reverify`
again. A site whose requests leave from many changing addresses (serverless hosting, a pool of egress
addresses) must have the limit raised by Intecion, or it will enrol in a loop.
- **A site with a token issued by hand cannot heal by itself.** It holds such a token because it cannot be
called back, so "enrol again" is not open to it. Its client does **not** enrol on `401 reverify` or
`401 invalid-token`; it stops and reports `relay-refused`, with what the administrator has to ask Intecion
for: after `reverify` (the site sends from a server address Intecion does not know yet — after a move, or
from a second server) that the new address be added; after `invalid-token` a new token. A client knows that
its token was issued by hand because it was pasted into it; the service's answer does not say so.
- A site on `localhost` or behind a firewall cannot be called back. Intecion can issue a token by hand; the
site stores it the same way.
- Use the token only from the site's server. Never print it, never send it to a browser.
## 3. Sending — `POST /v1/send`
Headers (`Bearer` in any case; one space; then the token exactly):
```
Authorization: Bearer ims_…
X-Intecion-Site: example.com
Idempotency-Key: <16 to 128 characters of A–Z a–z 0–9 _ ->
Content-Type: application/json
```
Body ([`SendRequest`](schema.json)):
```json
{
"product": "iapl", "productVersion": "1.17.0",
"kind": "form-notification",
"to": ["[email protected]"],
"replyTo": "[email protected]",
"senderName": "Kancelaria Example",
"subject": "New enquiry",
"text": "…", "html": "…",
"attachments": [{ "filename": "cv.pdf", "contentType": "application/pdf", "content": "<base64>" }]
}
```
- **`kind`** (required): `form-notification`, `form-confirmation`, `account`, `security-alert`, `system`, `test`.
Mail whose purpose the client does not know is `system`. **The kind decides which limits apply (§3.3), so a
client must set it truthfully for its own mail:** `account` only for mail to an account holder (password
reset, invitation), `form-confirmation` for mail to an address a visitor typed.
- **`to`, `cc`, `bcc`**: bare addresses (`name@domain`), ASCII, no display names. At least one `to` (for every
kind but `security-alert`). The total over the three lists is limited per site
(`limits.recipientsPerMessage` in `/v1/status`; the schema's 50 is only the service's upper bound).
- **`security-alert` is addressed by the service.** `to`, `cc` and `bcc` may be left out and are ignored;
whoever controls a site cannot redirect its alerts. The service puts the site's host in front of the
subject: `[example.com] …` — as it does for **any** mail of a site that has Intecion's own address among its
recipients.
- **`replyTo`**: one bare address. The sender address has no mailbox, so send one whenever a reply makes sense.
- **`senderName`**: the display name. Optional; without it the mail leaves under the site's host. See §3.1.
- **`subject`**: 1 to 300 characters, **no line breaks, no control characters, no characters that hide or
reorder text** — Unicode categories Cc, Zl, Zp, Co, lone surrogates, and Cf (zero-width space, direction
marks and overrides, word joiner, byte-order mark, tag characters) **except three that are ordinary text**:
the zero-width joiner U+200D (inside emoji), the zero-width non-joiner U+200C (Persian and other scripts) and
the soft hyphen U+00AD. A subject is often a visitor's own words: **the client strips what is not allowed
before sending** (a regular expression for it: `/[\p{Cc}\p{Zl}\p{Zp}\p{Co}\p{Cs}]|(?![\u200C\u200D\u00AD])\p{Cf}/gu`);
the service refuses, it does not repair, and a refused message is a lost one. A subject must not start with the
service's name in brackets (`[Intecion Notifications Webservice] …`): that is how the service's own notices
begin.
- **`text` and/or `html`**: at least one. Together at most `limits.maxBodyBytes` (UTF-8).
- **`senderName`**, **`subject`**: lengths are counted in characters (Unicode code points), not bytes.
- **`attachments`**: `content` is base64 (standard alphabet, padded to a multiple of four, no line breaks).
Decoded, all files together are at most `limits.maxAttachmentBytes`. File names: no path, no quotes, no
control or invisible characters. Programs and scripts are refused by extension
(`422 attachment-refused`, with `field` naming the file).
- The sender address is fixed by the service. It adds `X-Intecion-Site: <host>` and `X-Intecion-Product: <product>`
to the mail.
Answer ([`SendResponse`](schema.json)):
```json
{ "ok": true, "id": "…", "messageId": "…", "replayed": false,
"senderName": "Kancelaria Example", "warnings": [],
"quota": { "hour": { "limit": 30, "remaining": 29 }, "day": { "limit": 200, "remaining": 199 } } }
```
`200` means the back end accepted the message for delivery, not that it arrived.
### 3.1 The sender name
The service cleans the name and may replace it. A name that is not accepted is **not** a failed send: the mail
leaves under the site's host instead, and the answer carries `"warnings": ["sender-name-replaced"]` and the
name used in `senderName`.
Accepted: at most 64 characters; letters, digits, spaces and `. , & ' - ( ) /`; letters of one script only.
The guard errs on the careful side and will now and then replace an honest name (one that contains a word
from the list, or reads like a web address: "Dom.Pl"). **A client shows the warning in its panel, with the name
that was used,** so that the site's owner can choose another.
Not accepted: `@ < > " \`, anything that looks like an e-mail or web address (the site's own host is allowed),
and names on the service's list of names that are never a client's (mailbox providers, banks, "support",
"security", "administrator", "no-reply" …). The list is the service's and can change without a new contract
version.
### 3.2 `Idempotency-Key`
- One key per message; the same key on every retry of that message.
- **"The same body" means the same bytes.** A client encodes a message to JSON **once**, keeps those bytes with
the key, and sends exactly them on every retry. Encoding the same message again is not safe: another order of
the fields, `\/` instead of `/`, or other spacing is another body.
- The same key with the same bytes within 24 hours: no second mail; the first answer comes back with
`"replayed": true`.
- The same key with other bytes: `409 idempotency-conflict`.
- A send that was refused or failed does not use up its key.
### 3.3 Limits
A message that would pass a limit is refused whole with `429 quota-exceeded` and `limit`:
| `limit` | Counted | Applies to |
|---|---|---|
| `hour` | messages in the last 60 minutes | every kind but `security-alert`. **`account` mail may use all of it; every other kind only four fifths** (24 of 30), so that a busy or abused form cannot use up the room for a password reset |
| `day` | messages this UTC day | the same: four fifths (160 of 200) for everything but `account` |
| `alerts` | `security-alert` messages this UTC day | `security-alert` only: a budget of its own (`limits.securityAlertsPerDay`, 20), outside `hour` and `day` in both directions — alerts use up nothing else, and nothing else can use up the alerts |
| `recipient` | `form-confirmation` messages to one address this UTC day | `form-confirmation` only: it is for addresses a visitor typed into a form. Other mail to one address (a form's notification to the client's office) is never refused by it |
| `new-recipients` | addresses this site has not mailed in the last 30 days, this UTC day | every kind but `account` and `security-alert`. **A form's confirmations may use four fifths of it** (40 of 50); the rest is kept for the site's other mail, so that addresses a stranger invents in a form cannot keep a notification from an office the site has not written to for a month. `account` mail is outside it altogether: a password reset goes to whoever asked |
| `service` | all sites together this UTC day | every kind |
The numbers are the service's, per site, and are reported by `/v1/status` (`limits`; its `quota` is the whole
hour and day). The `quota` in the answer to a send is what is left **for a message of that kind**. A refused or
failed send costs no quota (failed ones are limited by themselves: 60 an hour per site, the sends that are
with the mail back end at that moment counted in, then `rate-limited`, §1). With a limit below
five nothing is set apart.
## 4. Status — `GET /v1/status`
`Authorization: Bearer ims_…`. Answers for a pending and a suspended site too, so a panel can say why mail does
not go out ([`StatusResponse`](schema.json)):
```json
{ "ok": true, "state": "active", "host": "example.com", "product": "iapl",
"service": { "name": "Intecion Notifications Webservice", "version": "1.0.0", "contract": "1.7.1" },
"sender": { "address": "[email protected]" },
"limits": { "messagesPerHour": 30, "messagesPerDay": 200, "recipientsPerMessage": 10,
"perRecipientPerDay": 10, "newRecipientsPerDay": 50,
"maxBodyBytes": 512000, "maxAttachmentBytes": 10485760, "maxAttachments": 20 },
"quota": { "hour": { "limit": 30, "remaining": 30 }, "day": { "limit": 200, "remaining": 200 } },
"kinds": ["form-notification", "form-confirmation", "account", "security-alert", "system", "test"],
"token": { "issuedAt": "2026-11-25T10:00:00.000Z", "rotateAfter": "2027-02-23T10:00:00.000Z" } }
```
A client takes its attachment limit from `limits.maxAttachmentBytes`, never from a constant of its own.
## 5. Rotation — `POST /v1/rotate`
`Authorization: Bearer ims_…`, no body. When `token.rotateAfter` has passed (90 days after issue), the client
asks for a new token. The answer carries it ([`RotateResponse`](schema.json)):
```json
{ "ok": true, "token": "ims_…", "previousValidUntil": "2027-02-24T10:00:00.000Z" }
```
- Store the new token at once. The previous one stays valid for 24 hours.
- Only the **current** token can rotate. With several processes on one site, exactly one rotation wins; the
others get `409 already-rotated` and read the shared store again.
- If the answer is lost, the new token is lost: the old one works for 24 hours, then `401 invalid-token` leads
to a new enrolment. A client that gets `already-rotated` and finds no newer token in its store enrols again
at once instead of waiting for that.
## 6. Giving up the token — `POST /v1/revoke`
`Authorization: Bearer ims_…`, no body. Every token of the site stops working at once; `{ "ok": true }`. The
site's state is kept. To send again the site enrols again.
## 7. `GET /health`
No authentication. `200 { "ok": true }` or `503 { "ok": false }`, nothing else. For an uptime check, not for a client.
## 8. Authentication, in one place
- The token is `ims_` and 43 characters. It is opaque; the service keeps only its SHA-256.
- Every route except `/v1/enrol` and `/health` needs it, **and** needs the request to come from a server
address the site enrolled from (IPv6: the same `/64`). A good token from another address gets `401 reverify`
and nothing else — not even the site's state.
- **A token belongs to one host and cannot act for another — and both sides hold it to that.**
- **Every request with a token carries `X-Intecion-Site: <the site's own public host>`** (the host it
enrolled as, lower case). Without the header: `400 invalid-request`. With a host that is not the token's:
`403 host-mismatch` — nothing is sent, read, rotated or revoked.
- **A client stores the host together with the token** (at the confirm endpoint: the host it is enrolling
as) and, before it uses a token, compares that stored host with its own public host of this moment. When
they differ the token is not its own — the database was copied from another site (staging from
production, a restored backup of another project), or somebody pasted a foreign token: the client does not
use it, forgets it, and enrols as itself.
- A client that reads `/v1/status` compares the `host` in the answer with its own the same way.
This is a guard against an honest mistake, not against a thief — whoever steals a token can name its host;
the address binding is what stops them. Without the guard, a copy of a site running on the same server as
the original would send mail as the original, on the original's limits.
## 9. Versions
- `VERSION` is `major.minor.patch`. The major is the path prefix (`/v1`).
- **Minor:** something was added that an older client need not know — a new optional request field, a new
answer field, a new `kind`, a new error `code` (treat an unknown code by its `retryable`), a new warning.
For that reason `code` and `warnings` are open strings in the schema, not closed lists.
- **Before the first release** (the first `mail-relay-contract/v…` tag) these are development versions: any
change of behaviour bumps the minor, and nobody is promised that an older copy still works. From the first
tag on the rules above hold strictly.
- **Patch:** wording, examples.
- **Major:** anything else. The service keeps answering the previous major for as long as any released client
speaks it.
- `/v1/status` reports the contract version the service speaks. A client carries the `VERSION` of its copy.
## 10. The examples and the runner
Each file in `examples/` is one case:
```json
{
"id": "send-hour-quota",
"title": "…",
"given": { "site": "active", "quota": "hour-exhausted" },
"request": { "method": "POST", "path": "/v1/send",
"headers": { "authorization": "Bearer {{token}}", "idempotency-key": "{{idempotencyKey}}", "content-type": "application/json" },
"schema": "SendRequest", "body": { } },
"response": { "status": 429, "schema": "Error", "body": { "ok": false, "code": "quota-exceeded", "limit": "hour" } },
"then": { "mails": 0 },
"client": { "retry": false, "reEnrol": false, "status": "relay-quota" }
}
```
- **`given`** names the state the case needs; whoever runs the examples arranges it (table below).
- **`request`** is sent as written, after `{{name}}` is replaced. `schema` names the `$defs` entry the body
must match (left out when the body is wrong on purpose). `{ "$base64Bytes": n }` stands for the base64 of
`n` bytes.
- **`response.body`** is a subset: every field written must be there with that value; more may be there.
- **`then`** says what must be true afterwards: `mails` (how many messages reached the back end in this case)
and `mail` (fields of the one message).
- **`client`** says what a client does with this answer: `retry`, `reEnrol`, and the suggested site status.
Use it to test a client against a canned answer.
- `"direction": "service-to-site"` marks a case that describes the call-back: the request is what the
service sends, the response what the site's confirm endpoint answers.
### `given`
| Key | Values | Meaning |
|---|---|---|
| `site` | `none`, `pending`, `active`, `suspended` | State of `{{host}}` in the registry. Anything but `none` implies a token in `{{token}}` |
| `listed` | `true`, `false` | Enrolment: whether `{{host}}` is on Intecion's list |
| `callback` | `ok`, `not-found`, `wrong-confirmation`, `redirect`, `no-content` | Enrolment: how the site's confirm endpoint behaves. `no-content` answers a bare `204` |
| `token` | `current`, `unknown`, `previous`, `none` | Which token `{{token}}` is. `previous` is a token replaced less than 24 hours ago. `none`: the header is left out |
| `address` | `known`, `unknown` | Whether the request comes from an address the site enrolled from |
| `quota` | `fresh`, `hour-exhausted`, `day-exhausted`, `recipient-exhausted`, `hour-share-used` | The site's counters. `recipient-exhausted`: `{{recipient}}` got the day's maximum of form confirmations. `hour-share-used`: mail other than `account` has used its four fifths of the hour |
| `idempotency` | `fresh`, `sent-same`, `sent-other` | Whether `{{idempotencyKey}}` was already used: for this very body, or for another |
| `backend` | `ok`, `recipient-suppressed`, `failure` | How the mail back end answers |
Variables: `{{host}}`, `{{token}}`, `{{nonce}}`, `{{idempotencyKey}}`, `{{recipient}}`, and — read from the
service — `{{senderAddress}}`, `{{alertRecipient}}`.
### Running them
```js
import { runExample } from './runner.mjs'
const driver = {
// Arrange `given`; return the variables for {{…}}.
async arrange(given, example) { return { host, token, nonce, idempotencyKey, recipient, senderAddress, alertRecipient } },
// Send one request to the thing under test.
async request({ method, path, headers, body }) { return { status, headers, body } },
// Optional: validate `value` against schema.json#/$defs/<name>; return a list of problems.
validate(name, value) { return [] },
// Optional: the messages that reached the back end since arrange().
async mails() { return [{ from, fromName, to, cc, bcc, replyTo, subject, headers }] },
}
for (const example of examples) await runExample(example, driver) // throws on the first mismatch
```
The service runs every example against the Worker under the local Workers runtime
(`services/mail-relay/test/contract.test.ts`). A client's local stand-in for the service runs the same files.
**A stand-in is not the service.** The examples are chosen so that the rules stated in this document decide
them (a sender name with an address in it; a file called `.exe`). The service's own lists — names that are
never a client's, file types it does not carry — are not part of the contract, can change without a new
version, and need not be reproduced: a stand-in approximates them, and a client must not rely on a name or a
file type passing because its stand-in let it pass.
## 11. Using the contract in a client
Until a client lives in this repository it **copies** this folder (all of it, `CHECKSUMS` included) from a
`mail-relay-contract/v…` tag, and has one test that runs `node checksums.mjs --check` on the copy, so a
hand-edited copy fails. The copy's `VERSION` says which contract the client speaks.
Checklist for a client:
1. Constants: the base address, the contract version. No secret.
2. A confirm endpoint (public; `404` unless it holds the nonce; the nonce looked up before any limiter, and
only refused calls counted by it; constant-time compare, single use, answers the confirmation as the only output, keeps the earlier token until the new one is accepted).
3. A token store that is never readable from outside and never printed — holding the token **and the host it
was issued to**. Before every use: is that host still this site's own public host? If not, do not use the
token; enrol as this site. Send `X-Intecion-Site` with every request that carries a token; on
`403 host-mismatch` forget the token and enrol.
4. Enrol on the first send without a token, after `invalid-token` and after `reverify` — unless the token was
issued by hand: then stop and report (§2). Guard against two processes enrolling at once
(`enrolment-in-progress`).
5. One `Idempotency-Key` per message and one encoding of it, both kept across retries; at most three attempts,
30 seconds each, ten seconds of waiting in all, only when `retryable`; an enrolment on the way does not
count; "no answer", `in-progress` and an answer that is not the service's JSON (unless its status is 400 to
499) are reported as not confirmed, never as not sent. No `Origin` or `Sec-Fetch-Site` header. Without
storage for unsent mail: no retry after the report; consider keys derived from the record (§1).
6. **Limit what a visitor can make the site send as `account` mail.** "Forgot password" for an address somebody
types is a visitor's lever like a form: the service lets `account` mail use the whole hour and day and no
limit per address, so thirty requests use up the site's hour. The client's own limiter (per address and per
visitor) is what decides; the service cannot tell a wanted reset from an unwanted one.
7. Strip from the subject what §3 does not allow (line breaks, control characters, direction marks and other
invisible characters — not only line breaks); bare addresses only; the right `kind` for each mail.
8. Read limits from `/v1/status`; rotate after `token.rotateAfter`.
9. Run the examples: the `client` block of each against canned answers, and the whole set against your local
stand-in.
+1
View File
@@ -0,0 +1 @@
1.7.1
+62
View File
@@ -0,0 +1,62 @@
#!/usr/bin/env node
// SHA-256 of every contract file, so a hand-edited copy is noticed.
// node checksums.mjs --check compare the files with CHECKSUMS (exit 1 on any difference)
// node checksums.mjs --write rewrite CHECKSUMS (only in the IWDL repository, when the contract changes)
// Node only, no dependency. Works on a copy of this folder anywhere.
import { createHash } from 'node:crypto'
import { readFileSync, readdirSync, writeFileSync, existsSync } from 'node:fs'
import { dirname, join } from 'node:path'
import { fileURLToPath } from 'node:url'
const here = dirname(fileURLToPath(import.meta.url))
const FIXED = ['README.md', 'CHANGELOG.md', 'VERSION', 'schema.json', 'runner.mjs', 'checksums.mjs']
function files() {
const examples = readdirSync(join(here, 'examples'))
.filter((f) => f.endsWith('.json'))
.sort()
.map((f) => `examples/${f}`)
return [...FIXED, ...examples]
}
function sums() {
return files()
.map((f) => `${createHash('sha256').update(readFileSync(join(here, f))).digest('hex')} ${f}`)
.join('\n') + '\n'
}
const mode = process.argv[2]
if (mode === '--write') {
writeFileSync(join(here, 'CHECKSUMS'), sums())
console.log(`CHECKSUMS written (${files().length} files)`)
} else if (mode === '--check') {
if (!existsSync(join(here, 'CHECKSUMS'))) {
console.error('CHECKSUMS is missing')
process.exit(1)
}
const want = new Map(
readFileSync(join(here, 'CHECKSUMS'), 'utf8').split('\n').filter(Boolean).map((l) => {
const [sum, name] = l.split(' ')
return [name, sum]
}),
)
const have = new Map(sums().split('\n').filter(Boolean).map((l) => {
const [sum, name] = l.split(' ')
return [name, sum]
}))
const problems = []
for (const [name, sum] of have) {
if (!want.has(name)) problems.push(`not in CHECKSUMS: ${name}`)
else if (want.get(name) !== sum) problems.push(`changed: ${name}`)
}
for (const name of want.keys()) if (!have.has(name)) problems.push(`missing: ${name}`)
if (problems.length) {
console.error(problems.join('\n'))
console.error('\nThe contract files do not match CHECKSUMS. Copy them again from IWDL; do not edit a copy.')
process.exit(1)
}
console.log(`contract ${readFileSync(join(here, 'VERSION'), 'utf8').trim()}: ${have.size} files match CHECKSUMS`)
} else {
console.error('usage: node checksums.mjs --check | --write')
process.exit(2)
}
@@ -0,0 +1,25 @@
{
"id": "callback-confirm-wordpress",
"direction": "service-to-site",
"title": "IAWL (WordPress) sites: the same call at the REST route addressed by query, which works with and without pretty permalinks",
"request": {
"method": "POST",
"path": "/?rest_route=/iawl/v1/mail-relay/confirm",
"headers": {
"content-type": "application/json"
},
"schema": "CallbackRequest",
"body": {
"nonce": "EXAMPLEnonceEXAMPLEnonceEXAMPLEnonce00000000",
"token": "ims_EXAMPLEtokenEXAMPLEtokenEXAMPLEtoken0000000",
"state": "active"
}
},
"response": {
"status": 200,
"schema": "CallbackResponse",
"body": {
"confirmation": "1d5818782053c1f5aae3f9abd898a530cf974c59526d240902c9e19619e0462b"
}
}
}
@@ -0,0 +1,25 @@
{
"id": "callback-confirm",
"direction": "service-to-site",
"title": "IAPL (Payload) sites: the call the service makes, and the only answer that enrols. confirmation = hex SHA-256 of nonce + \".\" + token",
"request": {
"method": "POST",
"path": "/api/iapl/mail-relay/confirm",
"headers": {
"content-type": "application/json"
},
"schema": "CallbackRequest",
"body": {
"nonce": "EXAMPLEnonceEXAMPLEnonceEXAMPLEnonce00000000",
"token": "ims_EXAMPLEtokenEXAMPLEtokenEXAMPLEtoken0000000",
"state": "active"
}
},
"response": {
"status": 200,
"schema": "CallbackResponse",
"body": {
"confirmation": "1d5818782053c1f5aae3f9abd898a530cf974c59526d240902c9e19619e0462b"
}
}
}
@@ -0,0 +1,21 @@
{
"id": "callback-unknown-nonce",
"direction": "service-to-site",
"title": "A call with a nonce the site does not hold: 404, nothing stored",
"request": {
"method": "POST",
"path": "/api/iapl/mail-relay/confirm",
"headers": {
"content-type": "application/json"
},
"schema": "CallbackRequest",
"body": {
"nonce": "UNKNOWNnonceUNKNOWNnonceUNKNOWNnonce00000000",
"token": "ims_EXAMPLEtokenEXAMPLEtokenEXAMPLEtoken0000000",
"state": "active"
}
},
"response": {
"status": 404
}
}
@@ -0,0 +1,33 @@
{
"id": "enrol-address-literal",
"title": "An address literal is not a host",
"given": {
"site": "none"
},
"request": {
"method": "POST",
"path": "/v1/enrol",
"headers": {
"content-type": "application/json"
},
"body": {
"host": "192.0.2.10",
"nonce": "{{nonce}}",
"product": "iapl",
"productVersion": "1.17.0"
}
},
"response": {
"status": 403,
"schema": "Error",
"body": {
"ok": false,
"code": "host-not-allowed"
}
},
"client": {
"retry": false,
"reEnrol": false,
"status": "relay-refused"
}
}
@@ -0,0 +1,37 @@
{
"id": "enrol-callback-no-content",
"title": "An endpoint that answers 204 to anything is not a confirm endpoint",
"given": {
"site": "none",
"listed": true,
"callback": "no-content"
},
"request": {
"method": "POST",
"path": "/v1/enrol",
"headers": {
"content-type": "application/json"
},
"schema": "EnrolRequest",
"body": {
"host": "{{host}}",
"nonce": "{{nonce}}",
"product": "iapl",
"productVersion": "1.17.0"
}
},
"response": {
"status": 422,
"schema": "Error",
"body": {
"ok": false,
"code": "callback-failed",
"reason": "status"
}
},
"client": {
"retry": false,
"reEnrol": false,
"status": "relay-refused"
}
}
@@ -0,0 +1,38 @@
{
"id": "enrol-callback-not-found",
"title": "Enrolment for a host whose confirm endpoint does not hold the nonce (a host the caller does not control) yields nothing",
"given": {
"site": "none",
"listed": true,
"callback": "not-found"
},
"request": {
"method": "POST",
"path": "/v1/enrol",
"headers": {
"content-type": "application/json"
},
"schema": "EnrolRequest",
"body": {
"host": "{{host}}",
"nonce": "{{nonce}}",
"product": "iapl",
"productVersion": "1.17.0"
}
},
"response": {
"status": 422,
"schema": "Error",
"body": {
"ok": false,
"code": "callback-failed",
"reason": "status",
"retryable": false
}
},
"client": {
"retry": false,
"reEnrol": false,
"status": "relay-refused"
}
}
@@ -0,0 +1,37 @@
{
"id": "enrol-callback-path-given",
"title": "A site cannot say where it is to be called back: the path is fixed per product",
"given": {
"site": "none",
"listed": true,
"callback": "ok"
},
"request": {
"method": "POST",
"path": "/v1/enrol",
"headers": {
"content-type": "application/json"
},
"body": {
"host": "{{host}}",
"callbackPath": "/api/iapl/mail-relay/confirm",
"nonce": "{{nonce}}",
"product": "iapl",
"productVersion": "1.17.0"
}
},
"response": {
"status": 400,
"schema": "Error",
"body": {
"ok": false,
"code": "invalid-request",
"field": "callbackPath"
}
},
"client": {
"retry": false,
"reEnrol": false,
"status": null
}
}
@@ -0,0 +1,37 @@
{
"id": "enrol-callback-redirect",
"title": "A redirect is never followed",
"given": {
"site": "none",
"listed": true,
"callback": "redirect"
},
"request": {
"method": "POST",
"path": "/v1/enrol",
"headers": {
"content-type": "application/json"
},
"schema": "EnrolRequest",
"body": {
"host": "{{host}}",
"nonce": "{{nonce}}",
"product": "iapl",
"productVersion": "1.17.0"
}
},
"response": {
"status": 422,
"schema": "Error",
"body": {
"ok": false,
"code": "callback-failed",
"reason": "redirect"
}
},
"client": {
"retry": false,
"reEnrol": false,
"status": "relay-refused"
}
}
@@ -0,0 +1,37 @@
{
"id": "enrol-callback-wrong-confirmation",
"title": "A 200 answer without the right confirmation does not enrol",
"given": {
"site": "none",
"listed": true,
"callback": "wrong-confirmation"
},
"request": {
"method": "POST",
"path": "/v1/enrol",
"headers": {
"content-type": "application/json"
},
"schema": "EnrolRequest",
"body": {
"host": "{{host}}",
"nonce": "{{nonce}}",
"product": "iapl",
"productVersion": "1.17.0"
}
},
"response": {
"status": 422,
"schema": "Error",
"body": {
"ok": false,
"code": "callback-failed",
"reason": "confirmation"
}
},
"client": {
"retry": false,
"reEnrol": false,
"status": "relay-refused"
}
}
@@ -0,0 +1,37 @@
{
"id": "enrol-from-browser",
"title": "A cross-site POST from a browser is refused",
"given": {
"site": "none",
"listed": true,
"callback": "ok"
},
"request": {
"method": "POST",
"path": "/v1/enrol",
"headers": {
"content-type": "application/json",
"origin": "https://evil.example.net"
},
"schema": "EnrolRequest",
"body": {
"host": "{{host}}",
"nonce": "{{nonce}}",
"product": "iapl",
"productVersion": "1.17.0"
}
},
"response": {
"status": 403,
"schema": "Error",
"body": {
"ok": false,
"code": "browser-not-allowed"
}
},
"client": {
"retry": false,
"reEnrol": false,
"status": null
}
}
@@ -0,0 +1,36 @@
{
"id": "enrol-listed-active",
"title": "A host on Intecion's list enrols and is active at once; the answer has no token",
"given": {
"site": "none",
"listed": true,
"callback": "ok"
},
"request": {
"method": "POST",
"path": "/v1/enrol",
"headers": {
"content-type": "application/json"
},
"schema": "EnrolRequest",
"body": {
"host": "{{host}}",
"nonce": "{{nonce}}",
"product": "iapl",
"productVersion": "1.17.0"
}
},
"response": {
"status": 200,
"schema": "EnrolResponse",
"body": {
"ok": true,
"state": "active"
}
},
"client": {
"retry": false,
"reEnrol": false,
"status": null
}
}
@@ -0,0 +1,33 @@
{
"id": "enrol-localhost",
"title": "A local name cannot be enrolled",
"given": {
"site": "none"
},
"request": {
"method": "POST",
"path": "/v1/enrol",
"headers": {
"content-type": "application/json"
},
"body": {
"host": "shop.localhost",
"nonce": "{{nonce}}",
"product": "iapl",
"productVersion": "1.17.0"
}
},
"response": {
"status": 403,
"schema": "Error",
"body": {
"ok": false,
"code": "host-not-allowed"
}
},
"client": {
"retry": false,
"reEnrol": false,
"status": "relay-refused"
}
}
@@ -0,0 +1,36 @@
{
"id": "enrol-short-nonce",
"title": "A short nonce is refused",
"given": {
"site": "none",
"listed": true,
"callback": "ok"
},
"request": {
"method": "POST",
"path": "/v1/enrol",
"headers": {
"content-type": "application/json"
},
"body": {
"host": "{{host}}",
"nonce": "short",
"product": "iapl",
"productVersion": "1.17.0"
}
},
"response": {
"status": 400,
"schema": "Error",
"body": {
"ok": false,
"code": "invalid-request",
"field": "nonce"
}
},
"client": {
"retry": false,
"reEnrol": false,
"status": null
}
}
@@ -0,0 +1,35 @@
{
"id": "enrol-suspended",
"title": "A suspended site cannot enrol its way back",
"given": {
"site": "suspended",
"callback": "ok"
},
"request": {
"method": "POST",
"path": "/v1/enrol",
"headers": {
"content-type": "application/json"
},
"schema": "EnrolRequest",
"body": {
"host": "{{host}}",
"nonce": "{{nonce}}",
"product": "iapl",
"productVersion": "1.17.0"
}
},
"response": {
"status": 403,
"schema": "Error",
"body": {
"ok": false,
"code": "site-suspended"
}
},
"client": {
"retry": false,
"reEnrol": false,
"status": "relay-suspended"
}
}
@@ -0,0 +1,36 @@
{
"id": "enrol-unlisted-pending",
"title": "A host that is not on the list enrols and waits for approval",
"given": {
"site": "none",
"listed": false,
"callback": "ok"
},
"request": {
"method": "POST",
"path": "/v1/enrol",
"headers": {
"content-type": "application/json"
},
"schema": "EnrolRequest",
"body": {
"host": "{{host}}",
"nonce": "{{nonce}}",
"product": "iapl",
"productVersion": "1.17.0"
}
},
"response": {
"status": 200,
"schema": "EnrolResponse",
"body": {
"ok": true,
"state": "pending"
}
},
"client": {
"retry": false,
"reEnrol": false,
"status": "relay-pending"
}
}
+17
View File
@@ -0,0 +1,17 @@
{
"id": "health",
"title": "Health says yes or no and nothing else",
"given": {},
"request": {
"method": "GET",
"path": "/health",
"headers": {}
},
"response": {
"status": 200,
"schema": "HealthResponse",
"body": {
"ok": true
}
}
}
@@ -0,0 +1,18 @@
{
"id": "not-found",
"title": "An unknown route",
"given": {},
"request": {
"method": "GET",
"path": "/v2/send",
"headers": {}
},
"response": {
"status": 404,
"schema": "Error",
"body": {
"ok": false,
"code": "not-found"
}
}
}
@@ -0,0 +1,27 @@
{
"id": "revoke-ok",
"title": "The site gives up its token",
"given": {
"site": "active"
},
"request": {
"method": "POST",
"path": "/v1/revoke",
"headers": {
"authorization": "Bearer {{token}}",
"x-intecion-site": "{{host}}"
}
},
"response": {
"status": 200,
"schema": "RevokeResponse",
"body": {
"ok": true
}
},
"client": {
"retry": false,
"reEnrol": false,
"status": null
}
}
@@ -0,0 +1,27 @@
{
"id": "rotate-ok",
"title": "The current token rotates; the answer carries the new one",
"given": {
"site": "active"
},
"request": {
"method": "POST",
"path": "/v1/rotate",
"headers": {
"authorization": "Bearer {{token}}",
"x-intecion-site": "{{host}}"
}
},
"response": {
"status": 200,
"schema": "RotateResponse",
"body": {
"ok": true
}
},
"client": {
"retry": false,
"reEnrol": false,
"status": null
}
}
@@ -0,0 +1,29 @@
{
"id": "rotate-previous-token",
"title": "A token that was already replaced cannot rotate",
"given": {
"site": "active",
"token": "previous"
},
"request": {
"method": "POST",
"path": "/v1/rotate",
"headers": {
"authorization": "Bearer {{token}}",
"x-intecion-site": "{{host}}"
}
},
"response": {
"status": 409,
"schema": "Error",
"body": {
"ok": false,
"code": "already-rotated"
}
},
"client": {
"retry": false,
"reEnrol": false,
"status": null
}
}
@@ -0,0 +1,56 @@
{
"id": "send-attachments-too-large",
"title": "Attachments over the limit",
"given": {
"site": "active"
},
"request": {
"method": "POST",
"path": "/v1/send",
"headers": {
"authorization": "Bearer {{token}}",
"idempotency-key": "{{idempotencyKey}}",
"content-type": "application/json",
"x-intecion-site": "{{host}}"
},
"schema": "SendRequest",
"body": {
"product": "iapl",
"productVersion": "1.17.0",
"kind": "form-notification",
"to": [
"{{recipient}}"
],
"replyTo": "[email protected]",
"senderName": "Kancelaria Example",
"subject": "New enquiry",
"text": "Hello.",
"attachments": [
{
"filename": "big.pdf",
"contentType": "application/pdf",
"content": {
"$base64Bytes": 10485761
}
}
]
}
},
"response": {
"status": 413,
"schema": "Error",
"body": {
"ok": false,
"code": "too-large",
"limit": "attachments"
}
},
"then": {
"mails": 0
},
"client": {
"retry": false,
"reEnrol": false,
"status": "relay-too-large"
}
}
@@ -0,0 +1,48 @@
{
"id": "send-backend-failed",
"title": "The back end fails; the client may retry with the same key",
"given": {
"site": "active",
"backend": "failure"
},
"request": {
"method": "POST",
"path": "/v1/send",
"headers": {
"authorization": "Bearer {{token}}",
"idempotency-key": "{{idempotencyKey}}",
"content-type": "application/json",
"x-intecion-site": "{{host}}"
},
"schema": "SendRequest",
"body": {
"product": "iapl",
"productVersion": "1.17.0",
"kind": "form-notification",
"to": [
"{{recipient}}"
],
"replyTo": "[email protected]",
"senderName": "Kancelaria Example",
"subject": "New enquiry",
"text": "Hello."
}
},
"response": {
"status": 502,
"schema": "Error",
"body": {
"ok": false,
"code": "backend-failed",
"retryable": true
}
},
"then": {
"mails": 0
},
"client": {
"retry": true,
"reEnrol": false,
"status": "relay-unreachable"
}
}
@@ -0,0 +1,48 @@
{
"id": "send-bearer-any-case",
"title": "The word \"Bearer\" in any case",
"given": {
"site": "active"
},
"request": {
"method": "POST",
"path": "/v1/send",
"headers": {
"authorization": "bearer {{token}}",
"idempotency-key": "{{idempotencyKey}}",
"content-type": "application/json",
"x-intecion-site": "{{host}}"
},
"schema": "SendRequest",
"body": {
"product": "iapl",
"productVersion": "1.17.0",
"kind": "form-notification",
"to": [
"{{recipient}}"
],
"replyTo": "[email protected]",
"senderName": "Kancelaria Example",
"subject": "New enquiry",
"text": "Hello."
}
},
"response": {
"status": 200,
"schema": "SendResponse",
"body": {
"ok": true,
"replayed": false,
"senderName": "Kancelaria Example",
"warnings": []
}
},
"then": {
"mails": 1
},
"client": {
"retry": false,
"reEnrol": false,
"status": null
}
}
@@ -0,0 +1,49 @@
{
"id": "send-day-quota",
"title": "The daily limit refuses the message",
"given": {
"site": "active",
"quota": "day-exhausted"
},
"request": {
"method": "POST",
"path": "/v1/send",
"headers": {
"authorization": "Bearer {{token}}",
"idempotency-key": "{{idempotencyKey}}",
"content-type": "application/json",
"x-intecion-site": "{{host}}"
},
"schema": "SendRequest",
"body": {
"product": "iapl",
"productVersion": "1.17.0",
"kind": "form-notification",
"to": [
"{{recipient}}"
],
"replyTo": "[email protected]",
"senderName": "Kancelaria Example",
"subject": "New enquiry",
"text": "Hello."
}
},
"response": {
"status": 429,
"schema": "Error",
"body": {
"ok": false,
"code": "quota-exceeded",
"limit": "day",
"retryable": false
}
},
"then": {
"mails": 0
},
"client": {
"retry": false,
"reEnrol": false,
"status": "relay-quota"
}
}
@@ -0,0 +1,46 @@
{
"id": "send-display-name-recipient",
"title": "Recipients are bare addresses",
"given": {
"site": "active"
},
"request": {
"method": "POST",
"path": "/v1/send",
"headers": {
"authorization": "Bearer {{token}}",
"idempotency-key": "{{idempotencyKey}}",
"content-type": "application/json",
"x-intecion-site": "{{host}}"
},
"body": {
"product": "iapl",
"productVersion": "1.17.0",
"kind": "form-notification",
"to": [
"Jan <[email protected]>"
],
"replyTo": "[email protected]",
"senderName": "Kancelaria Example",
"subject": "New enquiry",
"text": "Hello."
}
},
"response": {
"status": 400,
"schema": "Error",
"body": {
"ok": false,
"code": "invalid-request",
"field": "to"
}
},
"then": {
"mails": 0
},
"client": {
"retry": false,
"reEnrol": false,
"status": null
}
}
@@ -0,0 +1,54 @@
{
"id": "send-executable-attachment",
"title": "A program is never carried",
"given": {
"site": "active"
},
"request": {
"method": "POST",
"path": "/v1/send",
"headers": {
"authorization": "Bearer {{token}}",
"idempotency-key": "{{idempotencyKey}}",
"content-type": "application/json",
"x-intecion-site": "{{host}}"
},
"schema": "SendRequest",
"body": {
"product": "iapl",
"productVersion": "1.17.0",
"kind": "form-notification",
"to": [
"{{recipient}}"
],
"replyTo": "[email protected]",
"senderName": "Kancelaria Example",
"subject": "New enquiry",
"text": "Hello.",
"attachments": [
{
"filename": "invoice.pdf.exe",
"contentType": "application/pdf",
"content": "TVqQAAMAAAA="
}
]
}
},
"response": {
"status": 422,
"schema": "Error",
"body": {
"ok": false,
"code": "attachment-refused",
"field": "attachments[0]"
}
},
"then": {
"mails": 0
},
"client": {
"retry": false,
"reEnrol": false,
"status": "relay-attachment-refused"
}
}
@@ -0,0 +1,47 @@
{
"id": "send-from-browser",
"title": "A request with an Origin header is refused whatever the token",
"given": {
"site": "active"
},
"request": {
"method": "POST",
"path": "/v1/send",
"headers": {
"authorization": "Bearer {{token}}",
"idempotency-key": "{{idempotencyKey}}",
"content-type": "application/json",
"origin": "https://evil.example.net",
"x-intecion-site": "{{host}}"
},
"schema": "SendRequest",
"body": {
"product": "iapl",
"productVersion": "1.17.0",
"kind": "form-notification",
"to": [
"{{recipient}}"
],
"replyTo": "[email protected]",
"senderName": "Kancelaria Example",
"subject": "New enquiry",
"text": "Hello."
}
},
"response": {
"status": 403,
"schema": "Error",
"body": {
"ok": false,
"code": "browser-not-allowed"
}
},
"then": {
"mails": 0
},
"client": {
"retry": false,
"reEnrol": false,
"status": null
}
}
@@ -0,0 +1,47 @@
{
"id": "send-from-field",
"title": "The sender address cannot be set",
"given": {
"site": "active"
},
"request": {
"method": "POST",
"path": "/v1/send",
"headers": {
"authorization": "Bearer {{token}}",
"idempotency-key": "{{idempotencyKey}}",
"content-type": "application/json",
"x-intecion-site": "{{host}}"
},
"body": {
"product": "iapl",
"productVersion": "1.17.0",
"kind": "form-notification",
"to": [
"{{recipient}}"
],
"replyTo": "[email protected]",
"senderName": "Kancelaria Example",
"subject": "New enquiry",
"text": "Hello.",
"from": "[email protected]"
}
},
"response": {
"status": 400,
"schema": "Error",
"body": {
"ok": false,
"code": "invalid-request",
"field": "from"
}
},
"then": {
"mails": 0
},
"client": {
"retry": false,
"reEnrol": false,
"status": null
}
}
@@ -0,0 +1,49 @@
{
"id": "send-headers-field",
"title": "Free headers cannot be set",
"given": {
"site": "active"
},
"request": {
"method": "POST",
"path": "/v1/send",
"headers": {
"authorization": "Bearer {{token}}",
"idempotency-key": "{{idempotencyKey}}",
"content-type": "application/json",
"x-intecion-site": "{{host}}"
},
"body": {
"product": "iapl",
"productVersion": "1.17.0",
"kind": "form-notification",
"to": [
"{{recipient}}"
],
"replyTo": "[email protected]",
"senderName": "Kancelaria Example",
"subject": "New enquiry",
"text": "Hello.",
"headers": {
"Return-Path": "[email protected]"
}
}
},
"response": {
"status": 400,
"schema": "Error",
"body": {
"ok": false,
"code": "invalid-request",
"field": "headers"
}
},
"then": {
"mails": 0
},
"client": {
"retry": false,
"reEnrol": false,
"status": null
}
}
@@ -0,0 +1,47 @@
{
"id": "send-host-mismatch",
"title": "A token used by a site that names another host (a copy of the site's database, a token pasted into the wrong site) is refused",
"given": {
"site": "active"
},
"request": {
"method": "POST",
"path": "/v1/send",
"headers": {
"authorization": "Bearer {{token}}",
"idempotency-key": "{{idempotencyKey}}",
"content-type": "application/json",
"x-intecion-site": "copy-of-{{host}}"
},
"schema": "SendRequest",
"body": {
"product": "iapl",
"productVersion": "1.17.0",
"kind": "form-notification",
"to": [
"{{recipient}}"
],
"replyTo": "[email protected]",
"senderName": "Kancelaria Example",
"subject": "New enquiry",
"text": "Hello."
}
},
"response": {
"status": 403,
"schema": "Error",
"body": {
"ok": false,
"code": "host-mismatch",
"retryable": false
}
},
"then": {
"mails": 0
},
"client": {
"retry": false,
"reEnrol": true,
"status": null
}
}
@@ -0,0 +1,46 @@
{
"id": "send-hour-quota-account",
"title": "When other mail has used its share of the hour, account mail (a password reset) still goes out",
"given": {
"site": "active",
"quota": "hour-share-used"
},
"request": {
"method": "POST",
"path": "/v1/send",
"headers": {
"authorization": "Bearer {{token}}",
"idempotency-key": "{{idempotencyKey}}",
"content-type": "application/json",
"x-intecion-site": "{{host}}"
},
"schema": "SendRequest",
"body": {
"product": "iapl",
"productVersion": "1.17.0",
"kind": "account",
"to": [
"{{recipient}}"
],
"replyTo": "[email protected]",
"senderName": "Kancelaria Example",
"subject": "New enquiry",
"text": "Hello."
}
},
"response": {
"status": 200,
"schema": "SendResponse",
"body": {
"ok": true
}
},
"then": {
"mails": 1
},
"client": {
"retry": false,
"reEnrol": false,
"status": null
}
}
@@ -0,0 +1,49 @@
{
"id": "send-hour-quota",
"title": "The hourly limit refuses the message and says so",
"given": {
"site": "active",
"quota": "hour-exhausted"
},
"request": {
"method": "POST",
"path": "/v1/send",
"headers": {
"authorization": "Bearer {{token}}",
"idempotency-key": "{{idempotencyKey}}",
"content-type": "application/json",
"x-intecion-site": "{{host}}"
},
"schema": "SendRequest",
"body": {
"product": "iapl",
"productVersion": "1.17.0",
"kind": "form-notification",
"to": [
"{{recipient}}"
],
"replyTo": "[email protected]",
"senderName": "Kancelaria Example",
"subject": "New enquiry",
"text": "Hello."
}
},
"response": {
"status": 429,
"schema": "Error",
"body": {
"ok": false,
"code": "quota-exceeded",
"limit": "hour",
"retryable": false
}
},
"then": {
"mails": 0
},
"client": {
"retry": false,
"reEnrol": false,
"status": "relay-quota"
}
}
@@ -0,0 +1,47 @@
{
"id": "send-key-reused",
"title": "The same Idempotency-Key for another message",
"given": {
"site": "active",
"idempotency": "sent-other"
},
"request": {
"method": "POST",
"path": "/v1/send",
"headers": {
"authorization": "Bearer {{token}}",
"idempotency-key": "{{idempotencyKey}}",
"content-type": "application/json",
"x-intecion-site": "{{host}}"
},
"schema": "SendRequest",
"body": {
"product": "iapl",
"productVersion": "1.17.0",
"kind": "form-notification",
"to": [
"{{recipient}}"
],
"replyTo": "[email protected]",
"senderName": "Kancelaria Example",
"subject": "New enquiry",
"text": "Hello."
}
},
"response": {
"status": 409,
"schema": "Error",
"body": {
"ok": false,
"code": "idempotency-conflict"
}
},
"then": {
"mails": 0
},
"client": {
"retry": false,
"reEnrol": false,
"status": null
}
}
@@ -0,0 +1,49 @@
{
"id": "send-no-sender-name",
"title": "Without a sender name the mail leaves under the host, with no warning",
"given": {
"site": "active"
},
"request": {
"method": "POST",
"path": "/v1/send",
"headers": {
"authorization": "Bearer {{token}}",
"idempotency-key": "{{idempotencyKey}}",
"content-type": "application/json",
"x-intecion-site": "{{host}}"
},
"schema": "SendRequest",
"body": {
"product": "iapl",
"productVersion": "1.17.0",
"kind": "form-notification",
"to": [
"{{recipient}}"
],
"replyTo": "[email protected]",
"subject": "New enquiry",
"text": "Hello."
}
},
"response": {
"status": 200,
"schema": "SendResponse",
"body": {
"ok": true,
"senderName": "{{host}}",
"warnings": []
}
},
"then": {
"mails": 1,
"mail": {
"fromName": "{{host}}"
}
},
"client": {
"retry": false,
"reEnrol": false,
"status": null
}
}
@@ -0,0 +1,47 @@
{
"id": "send-no-token",
"title": "No Authorization header",
"given": {
"site": "active",
"token": "none"
},
"request": {
"method": "POST",
"path": "/v1/send",
"headers": {
"authorization": "Bearer {{token}}",
"idempotency-key": "{{idempotencyKey}}",
"content-type": "application/json",
"x-intecion-site": "{{host}}"
},
"schema": "SendRequest",
"body": {
"product": "iapl",
"productVersion": "1.17.0",
"kind": "form-notification",
"to": [
"{{recipient}}"
],
"replyTo": "[email protected]",
"senderName": "Kancelaria Example",
"subject": "New enquiry",
"text": "Hello."
}
},
"response": {
"status": 401,
"schema": "Error",
"body": {
"ok": false,
"code": "invalid-token"
}
},
"then": {
"mails": 0
},
"client": {
"retry": false,
"reEnrol": true,
"status": null
}
}
@@ -0,0 +1,61 @@
{
"id": "send-ok",
"title": "An active site sends one message",
"given": {
"site": "active"
},
"request": {
"method": "POST",
"path": "/v1/send",
"headers": {
"authorization": "Bearer {{token}}",
"idempotency-key": "{{idempotencyKey}}",
"content-type": "application/json",
"x-intecion-site": "{{host}}"
},
"schema": "SendRequest",
"body": {
"product": "iapl",
"productVersion": "1.17.0",
"kind": "form-notification",
"to": [
"{{recipient}}"
],
"replyTo": "[email protected]",
"senderName": "Kancelaria Example",
"subject": "New enquiry",
"text": "Hello."
}
},
"response": {
"status": 200,
"schema": "SendResponse",
"body": {
"ok": true,
"replayed": false,
"senderName": "Kancelaria Example",
"warnings": []
}
},
"then": {
"mails": 1,
"mail": {
"from": "{{senderAddress}}",
"fromName": "Kancelaria Example",
"to": [
"{{recipient}}"
],
"replyTo": "[email protected]",
"subject": "New enquiry",
"headers": {
"X-Intecion-Site": "{{host}}",
"X-Intecion-Product": "iapl"
}
}
},
"client": {
"retry": false,
"reEnrol": false,
"status": null
}
}
@@ -0,0 +1,46 @@
{
"id": "send-pending",
"title": "A site waiting for approval sends nothing",
"given": {
"site": "pending"
},
"request": {
"method": "POST",
"path": "/v1/send",
"headers": {
"authorization": "Bearer {{token}}",
"idempotency-key": "{{idempotencyKey}}",
"content-type": "application/json",
"x-intecion-site": "{{host}}"
},
"schema": "SendRequest",
"body": {
"product": "iapl",
"productVersion": "1.17.0",
"kind": "form-notification",
"to": [
"{{recipient}}"
],
"replyTo": "[email protected]",
"senderName": "Kancelaria Example",
"subject": "New enquiry",
"text": "Hello."
}
},
"response": {
"status": 403,
"schema": "Error",
"body": {
"ok": false,
"code": "site-pending"
}
},
"then": {
"mails": 0
},
"client": {
"retry": false,
"reEnrol": false,
"status": "relay-pending"
}
}
@@ -0,0 +1,46 @@
{
"id": "send-previous-token",
"title": "A token replaced less than 24 hours ago still sends",
"given": {
"site": "active",
"token": "previous"
},
"request": {
"method": "POST",
"path": "/v1/send",
"headers": {
"authorization": "Bearer {{token}}",
"idempotency-key": "{{idempotencyKey}}",
"content-type": "application/json",
"x-intecion-site": "{{host}}"
},
"schema": "SendRequest",
"body": {
"product": "iapl",
"productVersion": "1.17.0",
"kind": "form-notification",
"to": [
"{{recipient}}"
],
"replyTo": "[email protected]",
"senderName": "Kancelaria Example",
"subject": "New enquiry",
"text": "Hello."
}
},
"response": {
"status": 200,
"schema": "SendResponse",
"body": {
"ok": true
}
},
"then": {
"mails": 1
},
"client": {
"retry": false,
"reEnrol": false,
"status": null
}
}
@@ -0,0 +1,46 @@
{
"id": "send-recipient-quota-other-kinds",
"title": "Other mail to the same address is not refused by that limit (a form's notification to the client's office)",
"given": {
"site": "active",
"quota": "recipient-exhausted"
},
"request": {
"method": "POST",
"path": "/v1/send",
"headers": {
"authorization": "Bearer {{token}}",
"idempotency-key": "{{idempotencyKey}}",
"content-type": "application/json",
"x-intecion-site": "{{host}}"
},
"schema": "SendRequest",
"body": {
"product": "iapl",
"productVersion": "1.17.0",
"kind": "form-notification",
"to": [
"{{recipient}}"
],
"replyTo": "[email protected]",
"senderName": "Kancelaria Example",
"subject": "New enquiry",
"text": "Hello."
}
},
"response": {
"status": 200,
"schema": "SendResponse",
"body": {
"ok": true
}
},
"then": {
"mails": 1
},
"client": {
"retry": false,
"reEnrol": false,
"status": null
}
}
@@ -0,0 +1,48 @@
{
"id": "send-recipient-quota",
"title": "A form's confirmation: one address gets only so many a day",
"given": {
"site": "active",
"quota": "recipient-exhausted"
},
"request": {
"method": "POST",
"path": "/v1/send",
"headers": {
"authorization": "Bearer {{token}}",
"idempotency-key": "{{idempotencyKey}}",
"content-type": "application/json",
"x-intecion-site": "{{host}}"
},
"schema": "SendRequest",
"body": {
"product": "iapl",
"productVersion": "1.17.0",
"kind": "form-confirmation",
"to": [
"{{recipient}}"
],
"replyTo": "[email protected]",
"senderName": "Kancelaria Example",
"subject": "New enquiry",
"text": "Hello."
}
},
"response": {
"status": 429,
"schema": "Error",
"body": {
"ok": false,
"code": "quota-exceeded",
"limit": "recipient"
}
},
"then": {
"mails": 0
},
"client": {
"retry": false,
"reEnrol": false,
"status": "relay-quota"
}
}
@@ -0,0 +1,48 @@
{
"id": "send-recipient-suppressed",
"title": "The back end refuses a suppressed recipient",
"given": {
"site": "active",
"backend": "recipient-suppressed"
},
"request": {
"method": "POST",
"path": "/v1/send",
"headers": {
"authorization": "Bearer {{token}}",
"idempotency-key": "{{idempotencyKey}}",
"content-type": "application/json",
"x-intecion-site": "{{host}}"
},
"schema": "SendRequest",
"body": {
"product": "iapl",
"productVersion": "1.17.0",
"kind": "form-notification",
"to": [
"{{recipient}}"
],
"replyTo": "[email protected]",
"senderName": "Kancelaria Example",
"subject": "New enquiry",
"text": "Hello."
}
},
"response": {
"status": 422,
"schema": "Error",
"body": {
"ok": false,
"code": "recipient-suppressed",
"retryable": false
}
},
"then": {
"mails": 0
},
"client": {
"retry": false,
"reEnrol": false,
"status": "relay-recipient-suppressed"
}
}
@@ -0,0 +1,47 @@
{
"id": "send-replay",
"title": "The same Idempotency-Key and body again: no second mail",
"given": {
"site": "active",
"idempotency": "sent-same"
},
"request": {
"method": "POST",
"path": "/v1/send",
"headers": {
"authorization": "Bearer {{token}}",
"idempotency-key": "{{idempotencyKey}}",
"content-type": "application/json",
"x-intecion-site": "{{host}}"
},
"schema": "SendRequest",
"body": {
"product": "iapl",
"productVersion": "1.17.0",
"kind": "form-notification",
"to": [
"{{recipient}}"
],
"replyTo": "[email protected]",
"senderName": "Kancelaria Example",
"subject": "New enquiry",
"text": "Hello."
}
},
"response": {
"status": 200,
"schema": "SendResponse",
"body": {
"ok": true,
"replayed": true
}
},
"then": {
"mails": 0
},
"client": {
"retry": false,
"reEnrol": false,
"status": null
}
}
@@ -0,0 +1,53 @@
{
"id": "send-security-alert",
"title": "A security alert is addressed by the service and marked with the site's host; the recipients in the request are ignored",
"given": {
"site": "active"
},
"request": {
"method": "POST",
"path": "/v1/send",
"headers": {
"authorization": "Bearer {{token}}",
"idempotency-key": "{{idempotencyKey}}",
"content-type": "application/json",
"x-intecion-site": "{{host}}"
},
"schema": "SendRequest",
"body": {
"product": "iapl",
"productVersion": "1.17.0",
"kind": "security-alert",
"to": [
"[email protected]"
],
"replyTo": "[email protected]",
"senderName": "Kancelaria Example",
"subject": "New enquiry",
"text": "Hello."
}
},
"response": {
"status": 200,
"schema": "SendResponse",
"body": {
"ok": true
}
},
"then": {
"mails": 1,
"mail": {
"to": [
"{{alertRecipient}}"
],
"cc": [],
"bcc": [],
"subject": "[{{host}}] New enquiry"
}
},
"client": {
"retry": false,
"reEnrol": false,
"status": null
}
}
@@ -0,0 +1,52 @@
{
"id": "send-sender-name-replaced",
"title": "A sender name that looks like an address is replaced by the host; the mail still goes out",
"given": {
"site": "active"
},
"request": {
"method": "POST",
"path": "/v1/send",
"headers": {
"authorization": "Bearer {{token}}",
"idempotency-key": "{{idempotencyKey}}",
"content-type": "application/json",
"x-intecion-site": "{{host}}"
},
"schema": "SendRequest",
"body": {
"product": "iapl",
"productVersion": "1.17.0",
"kind": "form-notification",
"to": [
"{{recipient}}"
],
"replyTo": "[email protected]",
"senderName": "PayPal <[email protected]>",
"subject": "New enquiry",
"text": "Hello."
}
},
"response": {
"status": 200,
"schema": "SendResponse",
"body": {
"ok": true,
"senderName": "{{host}}",
"warnings": [
"sender-name-replaced"
]
}
},
"then": {
"mails": 1,
"mail": {
"fromName": "{{host}}"
}
},
"client": {
"retry": false,
"reEnrol": false,
"status": "relay-name-replaced"
}
}
@@ -0,0 +1,47 @@
{
"id": "send-subject-direction-mark",
"title": "A direction override in the subject is refused: the client strips such characters first",
"given": {
"site": "active"
},
"request": {
"method": "POST",
"path": "/v1/send",
"headers": {
"authorization": "Bearer {{token}}",
"idempotency-key": "{{idempotencyKey}}",
"content-type": "application/json",
"x-intecion-site": "{{host}}"
},
"schema": "SendRequest",
"body": {
"product": "iapl",
"productVersion": "1.17.0",
"kind": "form-notification",
"to": [
"{{recipient}}"
],
"replyTo": "[email protected]",
"senderName": "Kancelaria Example",
"subject": "Invoice ‮fdp.exe",
"text": "Hello."
}
},
"response": {
"status": 400,
"schema": "Error",
"body": {
"ok": false,
"code": "invalid-request",
"field": "subject"
}
},
"then": {
"mails": 0
},
"client": {
"retry": false,
"reEnrol": false,
"status": null
}
}
@@ -0,0 +1,47 @@
{
"id": "send-subject-imitates-service",
"title": "A subject that starts like one of the service's own notices is refused",
"given": {
"site": "active"
},
"request": {
"method": "POST",
"path": "/v1/send",
"headers": {
"authorization": "Bearer {{token}}",
"idempotency-key": "{{idempotencyKey}}",
"content-type": "application/json",
"x-intecion-site": "{{host}}"
},
"schema": "SendRequest",
"body": {
"product": "iapl",
"productVersion": "1.17.0",
"kind": "form-notification",
"to": [
"{{recipient}}"
],
"replyTo": "[email protected]",
"senderName": "Kancelaria Example",
"subject": "[Intecion Notifications Webservice] example.com waits for approval",
"text": "Hello."
}
},
"response": {
"status": 400,
"schema": "Error",
"body": {
"ok": false,
"code": "invalid-request",
"field": "subject"
}
},
"then": {
"mails": 0
},
"client": {
"retry": false,
"reEnrol": false,
"status": null
}
}
@@ -0,0 +1,47 @@
{
"id": "send-subject-line-break",
"title": "A line break in the subject (header injection) is refused, not repaired",
"given": {
"site": "active"
},
"request": {
"method": "POST",
"path": "/v1/send",
"headers": {
"authorization": "Bearer {{token}}",
"idempotency-key": "{{idempotencyKey}}",
"content-type": "application/json",
"x-intecion-site": "{{host}}"
},
"schema": "SendRequest",
"body": {
"product": "iapl",
"productVersion": "1.17.0",
"kind": "form-notification",
"to": [
"{{recipient}}"
],
"replyTo": "[email protected]",
"senderName": "Kancelaria Example",
"subject": "Hello\r\nBcc: [email protected]",
"text": "Hello."
}
},
"response": {
"status": 400,
"schema": "Error",
"body": {
"ok": false,
"code": "invalid-request",
"field": "subject"
}
},
"then": {
"mails": 0
},
"client": {
"retry": false,
"reEnrol": false,
"status": null
}
}
@@ -0,0 +1,51 @@
{
"id": "send-subject-visitor-text",
"title": "A subject with what visitors write — an emoji made of several, a soft hyphen — is carried as it is",
"given": {
"site": "active"
},
"request": {
"method": "POST",
"path": "/v1/send",
"headers": {
"authorization": "Bearer {{token}}",
"idempotency-key": "{{idempotencyKey}}",
"content-type": "application/json",
"x-intecion-site": "{{host}}"
},
"schema": "SendRequest",
"body": {
"product": "iapl",
"productVersion": "1.17.0",
"kind": "form-notification",
"to": [
"{{recipient}}"
],
"replyTo": "[email protected]",
"senderName": "Kancelaria Example",
"subject": "👩‍💻 Straßen­bahn",
"text": "Hello."
}
},
"response": {
"status": 200,
"schema": "SendResponse",
"body": {
"ok": true,
"replayed": false,
"senderName": "Kancelaria Example",
"warnings": []
}
},
"then": {
"mails": 1,
"mail": {
"subject": "👩‍💻 Straßen­bahn"
}
},
"client": {
"retry": false,
"reEnrol": false,
"status": null
}
}
@@ -0,0 +1,46 @@
{
"id": "send-suspended",
"title": "A suspended site sends nothing",
"given": {
"site": "suspended"
},
"request": {
"method": "POST",
"path": "/v1/send",
"headers": {
"authorization": "Bearer {{token}}",
"idempotency-key": "{{idempotencyKey}}",
"content-type": "application/json",
"x-intecion-site": "{{host}}"
},
"schema": "SendRequest",
"body": {
"product": "iapl",
"productVersion": "1.17.0",
"kind": "form-notification",
"to": [
"{{recipient}}"
],
"replyTo": "[email protected]",
"senderName": "Kancelaria Example",
"subject": "New enquiry",
"text": "Hello."
}
},
"response": {
"status": 403,
"schema": "Error",
"body": {
"ok": false,
"code": "site-suspended"
}
},
"then": {
"mails": 0
},
"client": {
"retry": false,
"reEnrol": false,
"status": "relay-suspended"
}
}
@@ -0,0 +1,46 @@
{
"id": "send-text-plain",
"title": "A form post (text/plain) is refused",
"given": {
"site": "active"
},
"request": {
"method": "POST",
"path": "/v1/send",
"headers": {
"authorization": "Bearer {{token}}",
"idempotency-key": "{{idempotencyKey}}",
"content-type": "text/plain",
"x-intecion-site": "{{host}}"
},
"schema": "SendRequest",
"body": {
"product": "iapl",
"productVersion": "1.17.0",
"kind": "form-notification",
"to": [
"{{recipient}}"
],
"replyTo": "[email protected]",
"senderName": "Kancelaria Example",
"subject": "New enquiry",
"text": "Hello."
}
},
"response": {
"status": 415,
"schema": "Error",
"body": {
"ok": false,
"code": "unsupported-media-type"
}
},
"then": {
"mails": 0
},
"client": {
"retry": false,
"reEnrol": false,
"status": null
}
}
@@ -0,0 +1,51 @@
{
"id": "send-to-intecion-marked",
"title": "Any mail of a site that reaches Intecion's own address gets the site's host in front of its subject",
"given": {
"site": "active"
},
"request": {
"method": "POST",
"path": "/v1/send",
"headers": {
"authorization": "Bearer {{token}}",
"idempotency-key": "{{idempotencyKey}}",
"content-type": "application/json",
"x-intecion-site": "{{host}}"
},
"schema": "SendRequest",
"body": {
"product": "iapl",
"productVersion": "1.17.0",
"kind": "system",
"to": [
"{{alertRecipient}}"
],
"replyTo": "[email protected]",
"senderName": "Kancelaria Example",
"subject": "New enquiry",
"text": "Hello."
}
},
"response": {
"status": 200,
"schema": "SendResponse",
"body": {
"ok": true
}
},
"then": {
"mails": 1,
"mail": {
"to": [
"{{alertRecipient}}"
],
"subject": "[{{host}}] New enquiry"
}
},
"client": {
"retry": false,
"reEnrol": false,
"status": null
}
}
@@ -0,0 +1,60 @@
{
"id": "send-too-many-recipients",
"title": "More than ten recipients over To, CC and BCC",
"given": {
"site": "active"
},
"request": {
"method": "POST",
"path": "/v1/send",
"headers": {
"authorization": "Bearer {{token}}",
"idempotency-key": "{{idempotencyKey}}",
"content-type": "application/json",
"x-intecion-site": "{{host}}"
},
"schema": "SendRequest",
"body": {
"product": "iapl",
"productVersion": "1.17.0",
"kind": "form-notification",
"to": [
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]"
],
"replyTo": "[email protected]",
"senderName": "Kancelaria Example",
"subject": "New enquiry",
"text": "Hello.",
"cc": [
"[email protected]",
"[email protected]",
"[email protected]"
],
"bcc": [
"[email protected]",
"[email protected]"
]
}
},
"response": {
"status": 422,
"schema": "Error",
"body": {
"ok": false,
"code": "too-many-recipients"
}
},
"then": {
"mails": 0
},
"client": {
"retry": false,
"reEnrol": false,
"status": "relay-quota"
}
}
@@ -0,0 +1,48 @@
{
"id": "send-unknown-address",
"title": "A good token from a server address the site never enrolled from (a stolen token)",
"given": {
"site": "active",
"address": "unknown"
},
"request": {
"method": "POST",
"path": "/v1/send",
"headers": {
"authorization": "Bearer {{token}}",
"idempotency-key": "{{idempotencyKey}}",
"content-type": "application/json",
"x-intecion-site": "{{host}}"
},
"schema": "SendRequest",
"body": {
"product": "iapl",
"productVersion": "1.17.0",
"kind": "form-notification",
"to": [
"{{recipient}}"
],
"replyTo": "[email protected]",
"senderName": "Kancelaria Example",
"subject": "New enquiry",
"text": "Hello."
}
},
"response": {
"status": 401,
"schema": "Error",
"body": {
"ok": false,
"code": "reverify",
"retryable": false
}
},
"then": {
"mails": 0
},
"client": {
"retry": false,
"reEnrol": true,
"status": null
}
}
@@ -0,0 +1,47 @@
{
"id": "send-unknown-token",
"title": "A token the service does not know",
"given": {
"site": "active",
"token": "unknown"
},
"request": {
"method": "POST",
"path": "/v1/send",
"headers": {
"authorization": "Bearer {{token}}",
"idempotency-key": "{{idempotencyKey}}",
"content-type": "application/json",
"x-intecion-site": "{{host}}"
},
"schema": "SendRequest",
"body": {
"product": "iapl",
"productVersion": "1.17.0",
"kind": "form-notification",
"to": [
"{{recipient}}"
],
"replyTo": "[email protected]",
"senderName": "Kancelaria Example",
"subject": "New enquiry",
"text": "Hello."
}
},
"response": {
"status": 401,
"schema": "Error",
"body": {
"ok": false,
"code": "invalid-token"
}
},
"then": {
"mails": 0
},
"client": {
"retry": false,
"reEnrol": true,
"status": null
}
}
@@ -0,0 +1,36 @@
{
"id": "status-active",
"title": "Status of an active site",
"given": {
"site": "active"
},
"request": {
"method": "GET",
"path": "/v1/status",
"headers": {
"authorization": "Bearer {{token}}",
"x-intecion-site": "{{host}}"
}
},
"response": {
"status": 200,
"schema": "StatusResponse",
"body": {
"ok": true,
"state": "active",
"host": "{{host}}",
"product": "iapl",
"service": {
"name": "Intecion Notifications Webservice"
},
"sender": {
"address": "{{senderAddress}}"
}
}
},
"client": {
"retry": false,
"reEnrol": false,
"status": null
}
}
@@ -0,0 +1,28 @@
{
"id": "status-no-site-header",
"title": "Every request with a token names its site",
"given": {
"site": "active"
},
"request": {
"method": "GET",
"path": "/v1/status",
"headers": {
"authorization": "Bearer {{token}}"
}
},
"response": {
"status": 400,
"schema": "Error",
"body": {
"ok": false,
"code": "invalid-request",
"field": "X-Intecion-Site"
}
},
"client": {
"retry": false,
"reEnrol": false,
"status": null
}
}
@@ -0,0 +1,28 @@
{
"id": "status-pending",
"title": "Status answers for a pending site too",
"given": {
"site": "pending"
},
"request": {
"method": "GET",
"path": "/v1/status",
"headers": {
"authorization": "Bearer {{token}}",
"x-intecion-site": "{{host}}"
}
},
"response": {
"status": 200,
"schema": "StatusResponse",
"body": {
"ok": true,
"state": "pending"
}
},
"client": {
"retry": false,
"reEnrol": false,
"status": "relay-pending"
}
}
@@ -0,0 +1,29 @@
{
"id": "status-unknown-address",
"title": "Status gives nothing to a token from an unknown address",
"given": {
"site": "active",
"address": "unknown"
},
"request": {
"method": "GET",
"path": "/v1/status",
"headers": {
"authorization": "Bearer {{token}}",
"x-intecion-site": "{{host}}"
}
},
"response": {
"status": 401,
"schema": "Error",
"body": {
"ok": false,
"code": "reverify"
}
},
"client": {
"retry": false,
"reEnrol": true,
"status": null
}
}
+160
View File
@@ -0,0 +1,160 @@
// Contract test runner for the Intecion Notifications Webservice.
// No dependency. Works in Node 20+ and in the Workers runtime (uses only WebCrypto, btoa and TextEncoder).
// How to use it: README.md, "The examples and the runner".
export const CONTRACT_VERSION = '1.7.1'
export class ContractError extends Error {
constructor(exampleId, message) {
super(`[${exampleId}] ${message}`)
this.name = 'ContractError'
this.exampleId = exampleId
}
}
/** The confirmation a site's confirm endpoint answers with: lowercase hex SHA-256 of nonce + "." + token. */
export async function confirmationFor(nonce, token) {
const bytes = new TextEncoder().encode(`${nonce}.${token}`)
const digest = await crypto.subtle.digest('SHA-256', bytes)
return [...new Uint8Array(digest)].map((b) => b.toString(16).padStart(2, '0')).join('')
}
/** Base64 of `n` zero bytes, built without holding the bytes. */
export function base64OfBytes(n) {
const full = Math.floor(n / 3)
const rest = n % 3
return 'AAAA'.repeat(full) + (rest === 1 ? 'AA==' : rest === 2 ? 'AAA=' : '')
}
/** Replace {{name}} and { "$base64Bytes": n } everywhere in a value. Unknown names are an error. */
export function expand(value, vars, exampleId = '?') {
if (typeof value === 'string') {
return value.replace(/\{\{([A-Za-z]+)\}\}/g, (_, name) => {
if (vars[name] === undefined || vars[name] === null) {
throw new ContractError(exampleId, `the driver's arrange() gave no value for {{${name}}}`)
}
return String(vars[name])
})
}
if (Array.isArray(value)) return value.map((v) => expand(v, vars, exampleId))
if (value && typeof value === 'object') {
if (typeof value.$base64Bytes === 'number') return base64OfBytes(value.$base64Bytes)
const out = {}
for (const [k, v] of Object.entries(value)) out[k] = expand(v, vars, exampleId)
return out
}
return value
}
/** Every field of `expected` must be in `actual` with that value; `actual` may have more. Arrays must be equal. */
export function subsetMismatch(actual, expected, path = '') {
if (expected === null || typeof expected !== 'object') {
return Object.is(actual, expected) ? null : `${path || 'value'}: expected ${JSON.stringify(expected)}, got ${JSON.stringify(actual)}`
}
if (Array.isArray(expected)) {
if (!Array.isArray(actual) || actual.length !== expected.length) {
return `${path || 'value'}: expected ${JSON.stringify(expected)}, got ${JSON.stringify(actual)}`
}
for (let i = 0; i < expected.length; i++) {
const m = subsetMismatch(actual[i], expected[i], `${path}[${i}]`)
if (m) return m
}
return null
}
if (actual === null || typeof actual !== 'object') {
return `${path || 'value'}: expected an object, got ${JSON.stringify(actual)}`
}
for (const [k, v] of Object.entries(expected)) {
const m = subsetMismatch(actual[k], v, path ? `${path}.${k}` : k)
if (m) return m
}
return null
}
function headerLookup(headers) {
const out = {}
for (const [k, v] of Object.entries(headers ?? {})) out[k.toLowerCase()] = v
return out
}
/**
* Run one example (direction site-to-service) against a driver. Throws ContractError on the first mismatch.
* Returns { request, response, vars } for further checks by the caller.
*/
export async function runExample(example, driver) {
const id = example.id
if (example.direction === 'service-to-site') {
throw new ContractError(id, 'this example describes the call-back; use runCallbackExample()')
}
const given = example.given ?? {}
const vars = (await driver.arrange(given, example)) ?? {}
const headers = expand(example.request.headers ?? {}, given.token === 'none' ? { ...vars, token: '' } : vars, id)
if (given.token === 'none') delete headers.authorization
const body = example.request.body === undefined ? undefined : expand(example.request.body, vars, id)
if (example.request.schema && driver.validate) {
const problems = driver.validate(example.request.schema, body)
if (problems.length) throw new ContractError(id, `the example's request does not match ${example.request.schema}: ${problems.join('; ')}`)
}
const request = { method: example.request.method, path: example.request.path, headers, body }
const response = await driver.request(request)
if (response.status !== example.response.status) {
throw new ContractError(id, `status: expected ${example.response.status}, got ${response.status} ${JSON.stringify(response.body)}`)
}
if (example.response.schema && driver.validate) {
const problems = driver.validate(example.response.schema, response.body)
if (problems.length) throw new ContractError(id, `the answer does not match ${example.response.schema}: ${problems.join('; ')}`)
}
if (example.response.body !== undefined) {
const m = subsetMismatch(response.body, expand(example.response.body, vars, id))
if (m) throw new ContractError(id, `body: ${m}`)
}
if (response.body && response.body.ok === false) {
const got = headerLookup(response.headers)
if (typeof response.body.retryAfter === 'number' && got['retry-after'] !== undefined && String(got['retry-after']) !== String(response.body.retryAfter)) {
throw new ContractError(id, `Retry-After header (${got['retry-after']}) differs from retryAfter (${response.body.retryAfter})`)
}
if (example.client && typeof example.client.retry === 'boolean' && response.body.retryable !== example.client.retry) {
throw new ContractError(id, `retryable: expected ${example.client.retry}, got ${response.body.retryable}`)
}
}
const cors = headerLookup(response.headers)['access-control-allow-origin']
if (cors !== undefined) throw new ContractError(id, 'the service must not send CORS headers')
if (example.then && driver.mails) {
const mails = await driver.mails()
if (typeof example.then.mails === 'number' && mails.length !== example.then.mails) {
throw new ContractError(id, `mails handed to the back end: expected ${example.then.mails}, got ${mails.length}`)
}
if (example.then.mail) {
const m = subsetMismatch(mails[0], expand(example.then.mail, vars, id), 'mail')
if (m) throw new ContractError(id, m)
}
}
return { request, response, vars }
}
/**
* Run a call-back example against a site's confirm endpoint.
* `site.prepare(body)` makes the site hold (or not hold) the nonce; `site.confirm(request)` calls the endpoint.
*/
export async function runCallbackExample(example, site) {
const id = example.id
if (example.direction !== 'service-to-site') throw new ContractError(id, 'not a call-back example')
const holds = example.response.status === 200
await site.prepare({ ...example.request.body, held: holds })
const response = await site.confirm({ ...example.request })
if (response.status !== example.response.status) {
throw new ContractError(id, `status: expected ${example.response.status}, got ${response.status}`)
}
if (holds) {
const expected = await confirmationFor(example.request.body.nonce, example.request.body.token)
if (!response.body || response.body.confirmation !== expected) {
throw new ContractError(id, 'the confirmation is not hex SHA-256 of nonce + "." + token')
}
}
return response
}
+624
View File
@@ -0,0 +1,624 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://webservices.intecion.net/mail/contract/v1/schema.json",
"title": "Intecion Notifications Webservice — wire contract v1",
"description": "Bodies of every request and answer. Requests are closed (an unknown field is refused); answers are open (a client ignores fields it does not know).",
"$defs": {
"Host": {
"description": "A public DNS name, lowercase, punycode for international names. No scheme, port, path or address literal.",
"type": "string",
"minLength": 4,
"maxLength": 253,
"pattern": "^(?=.{4,253}$)([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]([a-z0-9-]{0,61}[a-z0-9])$"
},
"Product": {
"description": "The client product. The list is the service's.",
"type": "string",
"enum": [
"iapl",
"iawl"
]
},
"ProductVersion": {
"type": "string",
"minLength": 1,
"maxLength": 32,
"pattern": "^[0-9A-Za-z][0-9A-Za-z.+_-]*$"
},
"Kind": {
"type": "string",
"enum": [
"form-notification",
"form-confirmation",
"account",
"security-alert",
"system",
"test"
]
},
"SiteState": {
"type": "string",
"enum": [
"pending",
"active",
"suspended"
]
},
"Address": {
"description": "A bare e-mail address. No display name, no angle brackets, no comment.",
"type": "string",
"minLength": 6,
"maxLength": 254,
"pattern": "^[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+(\\.[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+)*@([A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?\\.)+[A-Za-z]([A-Za-z0-9-]{0,61}[A-Za-z0-9])$"
},
"Nonce": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]{32,128}$"
},
"Token": {
"description": "Opaque. Never logged, never shown.",
"type": "string",
"pattern": "^ims_[A-Za-z0-9_-]{43}$"
},
"Window": {
"type": "object",
"required": [
"limit",
"remaining"
],
"properties": {
"limit": {
"type": "integer",
"minimum": 0
},
"remaining": {
"type": "integer",
"minimum": 0
}
}
},
"Quota": {
"type": "object",
"required": [
"hour",
"day"
],
"properties": {
"hour": {
"$ref": "#/$defs/Window"
},
"day": {
"$ref": "#/$defs/Window"
}
}
},
"EnrolRequest": {
"type": "object",
"additionalProperties": false,
"required": [
"host",
"nonce",
"product",
"productVersion"
],
"properties": {
"host": {
"$ref": "#/$defs/Host"
},
"nonce": {
"$ref": "#/$defs/Nonce"
},
"product": {
"$ref": "#/$defs/Product"
},
"productVersion": {
"$ref": "#/$defs/ProductVersion"
}
},
"description": "No call-back path: the service calls the path fixed for the product (README §2)."
},
"EnrolResponse": {
"description": "Never carries the token: it went to the site's confirm endpoint.",
"type": "object",
"required": [
"ok",
"state"
],
"properties": {
"ok": {
"const": true
},
"state": {
"$ref": "#/$defs/SiteState"
}
},
"not": {
"required": [
"token"
]
}
},
"CallbackRequest": {
"description": "Sent BY the service TO the site's confirm endpoint: POST https://<host><the product's confirm path>.",
"type": "object",
"additionalProperties": false,
"required": [
"nonce",
"token",
"state"
],
"properties": {
"nonce": {
"$ref": "#/$defs/Nonce"
},
"token": {
"$ref": "#/$defs/Token"
},
"state": {
"$ref": "#/$defs/SiteState"
}
}
},
"CallbackResponse": {
"description": "The site's answer: status 200, a body of at most 1024 bytes that is this JSON object and nothing else, within 8 seconds. confirmation = lowercase hex SHA-256 of the UTF-8 text nonce + \".\" + token.",
"type": "object",
"required": [
"confirmation"
],
"properties": {
"confirmation": {
"type": "string",
"pattern": "^[0-9a-f]{64}$"
}
}
},
"Attachment": {
"type": "object",
"additionalProperties": false,
"required": [
"filename",
"contentType",
"content"
],
"properties": {
"filename": {
"type": "string",
"minLength": 1,
"maxLength": 255
},
"contentType": {
"type": "string",
"maxLength": 127,
"pattern": "^[A-Za-z0-9][A-Za-z0-9!#$&^_.+-]*/[A-Za-z0-9][A-Za-z0-9!#$&^_.+-]*$"
},
"content": {
"description": "Base64, standard alphabet, no line breaks, padded: the length is a multiple of four. The pattern states the alphabet only — a pattern that also stated the length would overflow regular-expression engines on a 10 MB file; the service checks the length.",
"type": "string",
"minLength": 4,
"pattern": "^[A-Za-z0-9+/]+={0,2}$"
}
}
},
"SendRequest": {
"type": "object",
"additionalProperties": false,
"required": [
"product",
"productVersion",
"kind",
"subject"
],
"properties": {
"product": {
"$ref": "#/$defs/Product"
},
"productVersion": {
"$ref": "#/$defs/ProductVersion"
},
"kind": {
"$ref": "#/$defs/Kind"
},
"to": {
"description": "Bare addresses. The number over to, cc and bcc together is limited per site: limits.recipientsPerMessage in /v1/status (the schema only states the service's upper bound).",
"type": "array",
"items": {
"$ref": "#/$defs/Address"
},
"maxItems": 50
},
"cc": {
"description": "Bare addresses. The number over to, cc and bcc together is limited per site: limits.recipientsPerMessage in /v1/status (the schema only states the service's upper bound).",
"type": "array",
"items": {
"$ref": "#/$defs/Address"
},
"maxItems": 50
},
"bcc": {
"description": "Bare addresses. The number over to, cc and bcc together is limited per site: limits.recipientsPerMessage in /v1/status (the schema only states the service's upper bound).",
"type": "array",
"items": {
"$ref": "#/$defs/Address"
},
"maxItems": 50
},
"replyTo": {
"$ref": "#/$defs/Address"
},
"senderName": {
"description": "At most 256 characters (Unicode code points).",
"type": "string",
"maxLength": 256
},
"subject": {
"description": "1 to 300 characters (code points). No line breaks, control characters or characters that hide or reorder text (README §3 has the exact rule and the three exceptions); must not start with the service's name in brackets.",
"type": "string",
"minLength": 1,
"maxLength": 300
},
"text": {
"type": "string",
"minLength": 1
},
"html": {
"type": "string",
"minLength": 1
},
"attachments": {
"type": "array",
"items": {
"$ref": "#/$defs/Attachment"
},
"maxItems": 20
}
},
"anyOf": [
{
"required": [
"text"
]
},
{
"required": [
"html"
]
}
],
"allOf": [
{
"if": {
"properties": {
"kind": {
"const": "security-alert"
}
},
"required": [
"kind"
]
},
"else": {
"required": [
"to"
],
"properties": {
"to": {
"minItems": 1
}
}
}
}
]
},
"SendResponse": {
"type": "object",
"required": [
"ok",
"id",
"replayed",
"senderName",
"warnings",
"quota"
],
"properties": {
"ok": {
"const": true
},
"id": {
"description": "The service's id of this message in its log.",
"type": "string",
"minLength": 1
},
"messageId": {
"description": "The back end's id, when it gave one.",
"type": "string"
},
"replayed": {
"description": "true when this Idempotency-Key was already sent and no second mail went out.",
"type": "boolean"
},
"senderName": {
"description": "The name the mail left under.",
"type": "string"
},
"warnings": {
"description": "Known today: sender-name-replaced. A client ignores a warning it does not know.",
"type": "array",
"items": {
"type": "string"
}
},
"quota": {
"description": "What is left for a message of the kind just sent.",
"$ref": "#/$defs/Quota"
}
}
},
"StatusResponse": {
"type": "object",
"required": [
"ok",
"state",
"host",
"product",
"service",
"sender",
"limits",
"quota",
"kinds",
"token"
],
"properties": {
"ok": {
"const": true
},
"state": {
"$ref": "#/$defs/SiteState"
},
"host": {
"$ref": "#/$defs/Host"
},
"product": {
"$ref": "#/$defs/Product"
},
"service": {
"type": "object",
"required": [
"version",
"contract"
],
"properties": {
"name": {
"description": "The service's name, for a panel to show.",
"type": "string"
},
"version": {
"type": "string"
},
"contract": {
"type": "string",
"pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$"
}
}
},
"sender": {
"type": "object",
"required": [
"address"
],
"properties": {
"address": {
"$ref": "#/$defs/Address"
}
}
},
"limits": {
"type": "object",
"required": [
"messagesPerHour",
"messagesPerDay",
"recipientsPerMessage",
"perRecipientPerDay",
"newRecipientsPerDay",
"maxBodyBytes",
"maxAttachmentBytes",
"maxAttachments"
],
"properties": {
"messagesPerHour": {
"type": "integer",
"minimum": 0
},
"messagesPerDay": {
"type": "integer",
"minimum": 0
},
"recipientsPerMessage": {
"type": "integer",
"minimum": 1
},
"perRecipientPerDay": {
"type": "integer",
"minimum": 0
},
"newRecipientsPerDay": {
"type": "integer",
"minimum": 0
},
"maxBodyBytes": {
"type": "integer",
"minimum": 0
},
"maxAttachmentBytes": {
"type": "integer",
"minimum": 0
},
"maxAttachments": {
"type": "integer",
"minimum": 0
},
"serverAddresses": {
"description": "Server addresses the site may send from at a time.",
"type": "integer",
"minimum": 1
},
"securityAlertsPerDay": {
"description": "Security alerts a day: a budget of their own, outside the hour and day limits.",
"type": "integer",
"minimum": 0
}
}
},
"quota": {
"$ref": "#/$defs/Quota"
},
"kinds": {
"type": "array",
"items": {
"type": "string"
}
},
"token": {
"type": "object",
"required": [
"issuedAt",
"rotateAfter"
],
"properties": {
"issuedAt": {
"type": "string",
"format": "date-time"
},
"rotateAfter": {
"type": "string",
"format": "date-time"
}
}
},
"senderName": {
"description": "The name the last mail left under, when there was one.",
"type": "string"
}
}
},
"RotateResponse": {
"type": "object",
"required": [
"ok",
"token",
"previousValidUntil"
],
"properties": {
"ok": {
"const": true
},
"token": {
"$ref": "#/$defs/Token"
},
"previousValidUntil": {
"type": "string",
"format": "date-time"
}
}
},
"RevokeResponse": {
"type": "object",
"required": [
"ok"
],
"properties": {
"ok": {
"const": true
}
}
},
"HealthResponse": {
"description": "No detail on purpose — also when it says no: the one answer that is not an Error.",
"type": "object",
"additionalProperties": false,
"required": [
"ok"
],
"properties": {
"ok": {
"type": "boolean"
}
}
},
"ErrorCode": {
"type": "string",
"enum": [
"invalid-request",
"invalid-token",
"reverify",
"site-pending",
"site-suspended",
"host-not-allowed",
"enrolment-closed",
"enrolment-in-progress",
"callback-failed",
"host-mismatch",
"browser-not-allowed",
"not-found",
"method-not-allowed",
"unsupported-media-type",
"idempotency-conflict",
"in-progress",
"already-rotated",
"too-large",
"too-many-recipients",
"attachment-refused",
"recipient-suppressed",
"rate-limited",
"quota-exceeded",
"backend-failed",
"unavailable",
"internal"
],
"description": "The codes the service answers with today. The list grows with minor versions; that is why Error.code is an open string."
},
"Error": {
"type": "object",
"required": [
"ok",
"code",
"message",
"retryable"
],
"properties": {
"ok": {
"const": false
},
"code": {
"description": "One of ErrorCode today. A client that meets a code it does not know acts on `retryable`.",
"type": "string",
"minLength": 1
},
"message": {
"description": "For a log or an administrator. English. Never shown to a visitor.",
"type": "string"
},
"retryable": {
"description": "true: the same request, with the same Idempotency-Key, may be sent again after a short wait.",
"type": "boolean"
},
"retryAfter": {
"description": "Seconds.",
"type": "integer",
"minimum": 0
},
"field": {
"description": "With invalid-request: the field at fault. With attachment-refused: which file, as attachments[n] (n from 0).",
"type": "string"
},
"limit": {
"description": "With quota-exceeded: hour, day, alerts, recipient, new-recipients or service. With too-large: request, body or attachments.",
"type": "string"
},
"reason": {
"description": "With callback-failed: unreachable, timeout, redirect, status or confirmation.",
"type": "string"
}
}
}
}
}
+2 -1
View File
@@ -1,2 +1,3 @@
DATABASE_URL=mongodb://127.0.0.1/payload-plugin-template
# SQLite file for the dev sandbox (default: ./payload.db). Delete the file to start fresh.
DATABASE_URI=file:./payload.db
PAYLOAD_SECRET=YOUR_SECRET_HERE
+9
View File
@@ -0,0 +1,9 @@
<!-- BEGIN:nextjs-agent-rules -->
## This is NOT the Next.js you know
This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` (resolved from this file's directory; in monorepos the `next` package may not be visible from the repo root) before writing any code. Heed deprecation notices.
This block is written and re-added by `next dev` — verify at `node_modules/next/dist/server/lib/generate-agent-files.js`. Removing it from a diff only re-creates the uncommitted change; committing it with your work keeps the tree clean.
<!-- END:nextjs-agent-rules -->
@@ -0,0 +1,18 @@
import { notFound, permanentRedirect } from 'next/navigation.js'
import { createPageRoute } from '@intecion/ipal-kit/rsc'
import { FormBlock } from '../../../../blocks/FormBlock.js'
import * as content from '../../../../lib/content.js'
import { sendForm } from '../actions.js'
export const revalidate = 3600
const route = createPageRoute(content, {
blockProps: async ({ locale }) => ({ formTexts: await content.getFormTexts(locale), sendForm }),
blocks: { formBlock: FormBlock },
notFound,
permanentRedirect,
})
export default route.Page
export const generateMetadata = route.generateMetadata
export const generateStaticParams = route.generateStaticParams
+7
View File
@@ -0,0 +1,7 @@
'use server'
import { headers } from 'next/headers.js'
import { createSubmitAction } from '@intecion/ipal-kit/server'
import { getCachedPayload } from '../../../lib/content.js'
export const sendForm = createSubmitAction({ getCachedPayload, headers })
+28
View File
@@ -0,0 +1,28 @@
import { notFound } from 'next/navigation.js'
import { CookieBanner } from '@intecion/ipal-kit/client'
import { SiteProviders } from '@intecion/ipal-kit/rsc'
import { getConfiguredLocales, getSiteShell } from '../../../lib/content.js'
import './styles.css'
type Props = { children: React.ReactNode; params: Promise<{ locale: string }> }
export default async function LocaleLayout({ children, params }: Props) {
const { locale } = await params
if (!(await getConfiguredLocales()).includes(locale)) notFound()
return (
<html lang={locale}>
<body>
<SiteProviders banner={<CookieBanner controls="switch" equalChoice settings="detailed" />} logEndpoint="/api/ipal/consent" shell={await getSiteShell(locale)} stats={{ locale }}>
<main>{children}</main>
{/* A footer with links in the bottom-left corner: CookieButton must not cover them. */}
<footer style={{ borderTop: '1px solid #e5e5e5', display: 'flex', gap: '1.5rem', marginTop: '60vh', padding: '1.5rem 1rem' }}>
<a href={`/${locale}`}>Home</a>
<a href={`/${locale}/kontakt`}>Kontakt</a>
<a href={`/${locale}/polityka-prywatnosci`}>Polityka prywatności</a>
</footer>
</SiteProviders>
</body>
</html>
)
}
@@ -0,0 +1,6 @@
import { createNotFoundPage } from '@intecion/ipal-kit/rsc'
import { FormBlock } from '../../../blocks/FormBlock.js'
import * as content from '../../../lib/content.js'
export default createNotFoundPage(content, { blocks: { formBlock: FormBlock }, fallback: <h1>404</h1> })
+10
View File
@@ -0,0 +1,10 @@
/* Sandbox look — in a project this is the design system. */
body { font-family: system-ui, sans-serif; margin: 0 auto; max-width: 40rem; padding: 1rem; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(2, 1fr); }
.field { grid-column: span 2; } .half { grid-column: span 1; }
.label, legend { display: block; font-weight: 600; margin-bottom: .25rem; }
.input { border: 1px solid #999; border-radius: 6px; box-sizing: border-box; padding: .5rem; width: 100%; }
.choices { border: 0; display: grid; gap: .25rem; margin: 0; padding: 0; } .choice { display: flex; gap: .5rem; }
.error { color: #b00020; } .progress { color: #555; } .step-title { font-size: 1.25rem; font-weight: 700; }
.actions { display: flex; gap: .5rem; margin-top: 1rem; } .btn { background: #111; border: 0; border-radius: 6px; color: #fff; padding: .6rem 1rem; }
.btn-secondary { background: #ddd; color: #111; } .success { background: #e7f7ec; padding: 1rem; }
+100
View File
@@ -1,6 +1,106 @@
import { TOTPField as TOTPField_3eb2cc20d1a2569c2ccbafcee15bd128 } from '@clocklimited/payload-2fa/rsc'
import { OverviewComponent as OverviewComponent_a8a977ebc872c5d5ea7ee689724c0860 } from '@payloadcms/plugin-seo/client'
import { MetaTitleComponent as MetaTitleComponent_a8a977ebc872c5d5ea7ee689724c0860 } from '@payloadcms/plugin-seo/client'
import { MetaDescriptionComponent as MetaDescriptionComponent_a8a977ebc872c5d5ea7ee689724c0860 } from '@payloadcms/plugin-seo/client'
import { MetaDescriptionCheck as MetaDescriptionCheck_7568fe47d582ff15ce85d2e1873c2c23 } from '@intecion/ipal-kit/admin'
import { MetaImageComponent as MetaImageComponent_a8a977ebc872c5d5ea7ee689724c0860 } from '@payloadcms/plugin-seo/client'
import { PreviewComponent as PreviewComponent_a8a977ebc872c5d5ea7ee689724c0860 } from '@payloadcms/plugin-seo/client'
import { RscEntryLexicalCell as RscEntryLexicalCell_44fe37237e0ebf4470c9990d8cb7b07e } from '@payloadcms/richtext-lexical/rsc'
import { RscEntryLexicalField as RscEntryLexicalField_44fe37237e0ebf4470c9990d8cb7b07e } from '@payloadcms/richtext-lexical/rsc'
import { LexicalDiffComponent as LexicalDiffComponent_44fe37237e0ebf4470c9990d8cb7b07e } from '@payloadcms/richtext-lexical/rsc'
import { InlineToolbarFeatureClient as InlineToolbarFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
import { HorizontalRuleFeatureClient as HorizontalRuleFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
import { UploadFeatureClient as UploadFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
import { BlockquoteFeatureClient as BlockquoteFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
import { RelationshipFeatureClient as RelationshipFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
import { LinkFeatureClient as LinkFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
import { ChecklistFeatureClient as ChecklistFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
import { OrderedListFeatureClient as OrderedListFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
import { UnorderedListFeatureClient as UnorderedListFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
import { IndentFeatureClient as IndentFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
import { AlignFeatureClient as AlignFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
import { HeadingFeatureClient as HeadingFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
import { ParagraphFeatureClient as ParagraphFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
import { InlineCodeFeatureClient as InlineCodeFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
import { SuperscriptFeatureClient as SuperscriptFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
import { SubscriptFeatureClient as SubscriptFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
import { StrikethroughFeatureClient as StrikethroughFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
import { UnderlineFeatureClient as UnderlineFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
import { BoldFeatureClient as BoldFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
import { ItalicFeatureClient as ItalicFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
import { CookieScanButton as CookieScanButton_7568fe47d582ff15ce85d2e1873c2c23 } from '@intecion/ipal-kit/admin'
import { FaviconCheck as FaviconCheck_7568fe47d582ff15ce85d2e1873c2c23 } from '@intecion/ipal-kit/admin'
import { IntegrationStatusBanner as IntegrationStatusBanner_7568fe47d582ff15ce85d2e1873c2c23 } from '@intecion/ipal-kit/admin'
import { MaskedField as MaskedField_7568fe47d582ff15ce85d2e1873c2c23 } from '@intecion/ipal-kit/admin'
import { TestEmailButton as TestEmailButton_7568fe47d582ff15ce85d2e1873c2c23 } from '@intecion/ipal-kit/admin'
import { RowLabel as RowLabel_7568fe47d582ff15ce85d2e1873c2c23 } from '@intecion/ipal-kit/admin'
import { CookieReviewTab as CookieReviewTab_7568fe47d582ff15ce85d2e1873c2c23 } from '@intecion/ipal-kit/admin'
import { CookieSiteCheckTab as CookieSiteCheckTab_7568fe47d582ff15ce85d2e1873c2c23 } from '@intecion/ipal-kit/admin'
import { AdminIcon as AdminIcon_7568fe47d582ff15ce85d2e1873c2c23 } from '@intecion/ipal-kit/admin'
import { AdminLogo as AdminLogo_7568fe47d582ff15ce85d2e1873c2c23 } from '@intecion/ipal-kit/admin'
import { IntecionCredit as IntecionCredit_7568fe47d582ff15ce85d2e1873c2c23 } from '@intecion/ipal-kit/admin'
import { StatsNavLink as StatsNavLink_7568fe47d582ff15ce85d2e1873c2c23 } from '@intecion/ipal-kit/admin'
import { CookieCrawlAlert as CookieCrawlAlert_7568fe47d582ff15ce85d2e1873c2c23 } from '@intecion/ipal-kit/admin'
import { StatsWidget as StatsWidget_7568fe47d582ff15ce85d2e1873c2c23 } from '@intecion/ipal-kit/admin'
import { IntegrationAlerts as IntegrationAlerts_7568fe47d582ff15ce85d2e1873c2c23 } from '@intecion/ipal-kit/admin'
import { TotpRedirectProvider as TotpRedirectProvider_7568fe47d582ff15ce85d2e1873c2c23 } from '@intecion/ipal-kit/admin'
import { TOTPSetup as TOTPSetup_3eb2cc20d1a2569c2ccbafcee15bd128 } from '@clocklimited/payload-2fa/rsc'
import { TOTPVerify as TOTPVerify_3eb2cc20d1a2569c2ccbafcee15bd128 } from '@clocklimited/payload-2fa/rsc'
import { CookieApprovalView as CookieApprovalView_7568fe47d582ff15ce85d2e1873c2c23 } from '@intecion/ipal-kit/admin'
import { StatsView as StatsView_7568fe47d582ff15ce85d2e1873c2c23 } from '@intecion/ipal-kit/admin'
import { CollectionCards as CollectionCards_f9c02e79a4aed9a3924487c0cd4cafb1 } from '@payloadcms/next/rsc'
/** @type import('payload').ImportMap */
export const importMap = {
"@clocklimited/payload-2fa/rsc#TOTPField": TOTPField_3eb2cc20d1a2569c2ccbafcee15bd128,
"@payloadcms/plugin-seo/client#OverviewComponent": OverviewComponent_a8a977ebc872c5d5ea7ee689724c0860,
"@payloadcms/plugin-seo/client#MetaTitleComponent": MetaTitleComponent_a8a977ebc872c5d5ea7ee689724c0860,
"@payloadcms/plugin-seo/client#MetaDescriptionComponent": MetaDescriptionComponent_a8a977ebc872c5d5ea7ee689724c0860,
"@intecion/ipal-kit/admin#MetaDescriptionCheck": MetaDescriptionCheck_7568fe47d582ff15ce85d2e1873c2c23,
"@payloadcms/plugin-seo/client#MetaImageComponent": MetaImageComponent_a8a977ebc872c5d5ea7ee689724c0860,
"@payloadcms/plugin-seo/client#PreviewComponent": PreviewComponent_a8a977ebc872c5d5ea7ee689724c0860,
"@payloadcms/richtext-lexical/rsc#RscEntryLexicalCell": RscEntryLexicalCell_44fe37237e0ebf4470c9990d8cb7b07e,
"@payloadcms/richtext-lexical/rsc#RscEntryLexicalField": RscEntryLexicalField_44fe37237e0ebf4470c9990d8cb7b07e,
"@payloadcms/richtext-lexical/rsc#LexicalDiffComponent": LexicalDiffComponent_44fe37237e0ebf4470c9990d8cb7b07e,
"@payloadcms/richtext-lexical/client#InlineToolbarFeatureClient": InlineToolbarFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
"@payloadcms/richtext-lexical/client#HorizontalRuleFeatureClient": HorizontalRuleFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
"@payloadcms/richtext-lexical/client#UploadFeatureClient": UploadFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
"@payloadcms/richtext-lexical/client#BlockquoteFeatureClient": BlockquoteFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
"@payloadcms/richtext-lexical/client#RelationshipFeatureClient": RelationshipFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
"@payloadcms/richtext-lexical/client#LinkFeatureClient": LinkFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
"@payloadcms/richtext-lexical/client#ChecklistFeatureClient": ChecklistFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
"@payloadcms/richtext-lexical/client#OrderedListFeatureClient": OrderedListFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
"@payloadcms/richtext-lexical/client#UnorderedListFeatureClient": UnorderedListFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
"@payloadcms/richtext-lexical/client#IndentFeatureClient": IndentFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
"@payloadcms/richtext-lexical/client#AlignFeatureClient": AlignFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
"@payloadcms/richtext-lexical/client#HeadingFeatureClient": HeadingFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
"@payloadcms/richtext-lexical/client#ParagraphFeatureClient": ParagraphFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
"@payloadcms/richtext-lexical/client#InlineCodeFeatureClient": InlineCodeFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
"@payloadcms/richtext-lexical/client#SuperscriptFeatureClient": SuperscriptFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
"@payloadcms/richtext-lexical/client#SubscriptFeatureClient": SubscriptFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
"@payloadcms/richtext-lexical/client#StrikethroughFeatureClient": StrikethroughFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
"@payloadcms/richtext-lexical/client#UnderlineFeatureClient": UnderlineFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
"@payloadcms/richtext-lexical/client#BoldFeatureClient": BoldFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
"@payloadcms/richtext-lexical/client#ItalicFeatureClient": ItalicFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
"@intecion/ipal-kit/admin#CookieScanButton": CookieScanButton_7568fe47d582ff15ce85d2e1873c2c23,
"@intecion/ipal-kit/admin#FaviconCheck": FaviconCheck_7568fe47d582ff15ce85d2e1873c2c23,
"@intecion/ipal-kit/admin#IntegrationStatusBanner": IntegrationStatusBanner_7568fe47d582ff15ce85d2e1873c2c23,
"@intecion/ipal-kit/admin#MaskedField": MaskedField_7568fe47d582ff15ce85d2e1873c2c23,
"@intecion/ipal-kit/admin#TestEmailButton": TestEmailButton_7568fe47d582ff15ce85d2e1873c2c23,
"@intecion/ipal-kit/admin#RowLabel": RowLabel_7568fe47d582ff15ce85d2e1873c2c23,
"@intecion/ipal-kit/admin#CookieReviewTab": CookieReviewTab_7568fe47d582ff15ce85d2e1873c2c23,
"@intecion/ipal-kit/admin#CookieSiteCheckTab": CookieSiteCheckTab_7568fe47d582ff15ce85d2e1873c2c23,
"@intecion/ipal-kit/admin#AdminIcon": AdminIcon_7568fe47d582ff15ce85d2e1873c2c23,
"@intecion/ipal-kit/admin#AdminLogo": AdminLogo_7568fe47d582ff15ce85d2e1873c2c23,
"@intecion/ipal-kit/admin#IntecionCredit": IntecionCredit_7568fe47d582ff15ce85d2e1873c2c23,
"@intecion/ipal-kit/admin#StatsNavLink": StatsNavLink_7568fe47d582ff15ce85d2e1873c2c23,
"@intecion/ipal-kit/admin#CookieCrawlAlert": CookieCrawlAlert_7568fe47d582ff15ce85d2e1873c2c23,
"@intecion/ipal-kit/admin#StatsWidget": StatsWidget_7568fe47d582ff15ce85d2e1873c2c23,
"@intecion/ipal-kit/admin#IntegrationAlerts": IntegrationAlerts_7568fe47d582ff15ce85d2e1873c2c23,
"@intecion/ipal-kit/admin#TotpRedirectProvider": TotpRedirectProvider_7568fe47d582ff15ce85d2e1873c2c23,
"@clocklimited/payload-2fa/rsc#TOTPSetup": TOTPSetup_3eb2cc20d1a2569c2ccbafcee15bd128,
"@clocklimited/payload-2fa/rsc#TOTPVerify": TOTPVerify_3eb2cc20d1a2569c2ccbafcee15bd128,
"@intecion/ipal-kit/admin#CookieApprovalView": CookieApprovalView_7568fe47d582ff15ce85d2e1873c2c23,
"@intecion/ipal-kit/admin#StatsView": StatsView_7568fe47d582ff15ce85d2e1873c2c23,
"@payloadcms/next/rsc#CollectionCards": CollectionCards_f9c02e79a4aed9a3924487c0cd4cafb1
}
+2
View File
@@ -0,0 +1,2 @@
export { mcpGET as GET, mcpPOST as POST } from '../../../lib/content.js'
export const dynamic = 'force-dynamic'
+2
View File
@@ -0,0 +1,2 @@
export { llmsRoute as GET } from '../../lib/content.js'
export const dynamic = 'force-dynamic'
-12
View File
@@ -1,12 +0,0 @@
import configPromise from '@payload-config'
import { getPayload } from 'payload'
export const GET = async (request: Request) => {
const payload = await getPayload({
config: configPromise,
})
return Response.json({
message: 'This is an example of a custom route.',
})
}
+16
View File
@@ -0,0 +1,16 @@
import type { FormNotificationTexts } from '@intecion/ipal-kit'
import { RenderForm, type SendFormAction } from '@intecion/ipal-kit/rsc'
// Classes set once per project — here plain names the sandbox CSS styles.
const formClasses = {
actions: 'actions', back: 'btn btn-secondary', choice: 'choice', choices: 'choices', error: 'error', field: 'field',
fieldHalf: 'half', fields: 'grid', form: 'form', formError: 'error', input: 'input', label: 'label', progress: 'progress',
select: 'input', stepTitle: 'step-title', submit: 'btn', success: 'success', textarea: 'input',
}
type Props = { form?: unknown; formTexts?: FormNotificationTexts; locale: string; sendForm?: SendFormAction }
export function FormBlock({ form, formTexts, locale, sendForm }: Props) {
if (!formTexts || !sendForm) return null
return <RenderForm action={sendForm} classNames={formClasses} form={form as never} locale={locale} requiredMark=" *" texts={formTexts} />
}
+4 -3
View File
@@ -1,12 +1,13 @@
import { expect, test } from '@playwright/test'
// this is an example Playwright e2e test
import { devUser } from './helpers/credentials.js'
test('should render admin panel logo', async ({ page }) => {
await page.goto('/admin')
// login
await page.fill('#field-email', '[email protected]')
await page.fill('#field-password', 'test')
await page.fill('#field-email', devUser.email)
await page.fill('#field-password', devUser.password)
await page.click('.form-submit button')
// should show dashboard
+6
View File
@@ -2,3 +2,9 @@ export const devUser = {
email: '[email protected]',
password: '[email protected]',
}
/** Second dev login with the editor role — for checking what editors see. */
export const devEditor = {
email: '[email protected]',
password: '[email protected]',
}
+7
View File
@@ -0,0 +1,7 @@
export const i18nConfig = {
defaultLocale: 'pl',
locales: [
{ code: 'pl', label: 'Polski' },
{ code: 'en', label: 'English' },
],
} as const
-52
View File
@@ -1,52 +0,0 @@
import type { Payload } from 'payload'
import config from '@payload-config'
import { createPayloadRequest, getPayload } from 'payload'
import { afterAll, beforeAll, describe, expect, test } from 'vitest'
import { customEndpointHandler } from '../src/endpoints/customEndpointHandler.js'
let payload: Payload
afterAll(async () => {
await payload.destroy()
})
beforeAll(async () => {
payload = await getPayload({ config })
})
describe('Plugin integration tests', () => {
test('should query custom endpoint added by plugin', async () => {
const request = new Request('http://localhost:3000/api/my-plugin-endpoint', {
method: 'GET',
})
const payloadRequest = await createPayloadRequest({ config, request })
const response = await customEndpointHandler(payloadRequest)
expect(response.status).toBe(200)
const data = await response.json()
expect(data).toMatchObject({
message: 'Hello from custom endpoint',
})
})
test('can create post with custom text field added by plugin', async () => {
const post = await payload.create({
collection: 'posts',
data: {
addedByPlugin: 'added by plugin',
},
})
expect(post.addedByPlugin).toBe('added by plugin')
})
test('plugin creates and seeds plugin-collection', async () => {
expect(payload.collections['plugin-collection']).toBeDefined()
const { docs } = await payload.find({ collection: 'plugin-collection' })
expect(docs).toHaveLength(1)
})
})
+11
View File
@@ -0,0 +1,11 @@
// Sandbox data layer — the same one line every project has (PROGRAMISTA §2.7).
import config from '@payload-config'
import { createContentHelpers } from '@intecion/ipal-kit'
import { i18nConfig } from '../i18n.config.js'
export const {
generatePageMetadata, generateStaticParams, getCachedPayload, getConfiguredLocales, getFormTexts, getLinkOptions,
getNotFoundPage, getPageJsonLd, getSettings, getSiteShell, healthRoute, i18n, llmsRoute, mcpGET, mcpPOST,
resolveNav, resolvePageRedirect, resolveRoute,
} = createContentHelpers({ baseUrl: 'http://localhost:3000', config, i18n: i18nConfig, mcp: { serverName: 'ipal-sandbox' } })
-1
View File
@@ -15,7 +15,6 @@ const nextConfig = {
return webpackConfig
},
serverExternalPackages: ['mongodb-memory-server'],
}
export default withPayload(nextConfig, { devBundleServerPackages: false })
+1085 -29
View File
File diff suppressed because it is too large Load Diff
+69 -64
View File
@@ -1,13 +1,14 @@
import { payloadTotp } from '@clocklimited/payload-2fa'
import { sqliteAdapter } from '@payloadcms/db-sqlite'
import { lexicalEditor } from '@payloadcms/richtext-lexical'
import { ipalKit } from 'ipal-kit'
import { MongoMemoryReplSet } from 'mongodb-memory-server'
import { iapl } from '../src/index.js'
import path from 'path'
import { buildConfig } from 'payload'
import sharp from 'sharp'
import { fileURLToPath } from 'url'
import { testEmailAdapter } from './helpers/testEmailAdapter.js'
import { i18nConfig } from './i18n.config.js'
import { seed } from './seed.js'
const filename = fileURLToPath(import.meta.url)
@@ -17,70 +18,74 @@ if (!process.env.ROOT_DIR) {
process.env.ROOT_DIR = dirname
}
const buildConfigWithMemoryDB = async () => {
if (process.env.NODE_ENV === 'test') {
const memoryDB = await MongoMemoryReplSet.create({
replSet: {
count: 3,
dbName: 'payloadmemory',
},
})
process.env.DATABASE_URL = `${memoryDB.getUri()}&retryWrites=true`
}
return buildConfig({
admin: {
importMap: {
baseDir: path.resolve(dirname),
},
export default buildConfig({
admin: {
importMap: {
baseDir: path.resolve(dirname),
},
collections: [
{
slug: 'users',
auth: true,
fields: [],
},
{
slug: 'posts',
fields: [],
},
{
slug: 'media',
fields: [],
upload: { staticDir: path.resolve(dirname, 'media') },
},
],
db: sqliteAdapter({
client: {
url: process.env.DATABASE_URI || 'file:./payload.db',
},
}),
editor: lexicalEditor(),
email: testEmailAdapter,
onInit: async (payload) => {
await seed(payload)
},
collections: [
{
slug: 'users',
auth: true,
fields: [],
},
plugins: [
ipalKit({
access: { authCollection: 'users' },
i18n: {
defaultLocale: 'pl',
locales: [
{ code: 'pl', label: 'Polski' },
{ code: 'en', label: 'English' },
],
{
slug: 'pages',
fields: [
{ name: 'title', type: 'text', localized: true },
{ name: 'slug', type: 'text', index: true, localized: true },
{
name: 'layout',
type: 'blocks',
blocks: [{ slug: 'formBlock', fields: [{ name: 'form', type: 'relationship', relationTo: 'forms' }] }],
},
seo: { collections: ['posts', 'pages'] },
}),
],
secret: process.env.PAYLOAD_SECRET || 'test-secret_key',
sharp,
typescript: {
outputFile: path.resolve(dirname, 'payload-types.ts'),
],
},
})
}
{
slug: 'posts',
fields: [{ name: 'title', type: 'text' }],
},
{
slug: 'media',
fields: [],
upload: { staticDir: path.resolve(dirname, 'media') },
},
],
export default buildConfigWithMemoryDB()
db: sqliteAdapter({
client: {
url: process.env.DATABASE_URI || 'file:./payload.db',
},
}),
editor: lexicalEditor(),
email: testEmailAdapter,
onInit: async (payload) => {
await seed(payload)
},
plugins: [
iapl({
access: { authCollection: 'users' },
i18n: i18nConfig,
consentLog: true,
// Cookie review + "Crawl site" (needs IAPL_COOKIE_SCAN_URL / IAPL_COOKIE_SCAN_TOKEN and a running services/cookie-crawler).
cookieScanner: { crawl: true },
forms: {},
seo: { collections: ['posts', 'pages'] },
stats: true,
// 2FA is enforced by default; the dev sandbox opts out so it boots without an authenticator.
// IPAL_DEV_2FA=1 turns it on (first-login setup and verify screens).
twoFactor: process.env.IPAL_DEV_2FA ? { issuer: 'IAPL dev', plugin: payloadTotp } : false,
// Panel logo/icon from Site settings and the technology support credit.
whiteLabel: true,
}),
],
secret: process.env.PAYLOAD_SECRET || 'test-secret_key',
sharp,
typescript: {
// Payload's dev init spawns `payload generate:types` on every start/recompile and never
// reaps it, so each restart left an orphan. Run `pnpm generate:types` when types change.
autoGenerate: false,
outputFile: path.resolve(dirname, 'payload-types.ts'),
},
})
+52 -1
View File
@@ -1,6 +1,6 @@
import type { Payload } from 'payload'
import { devUser } from './helpers/credentials.js'
import { devEditor, devUser } from './helpers/credentials.js'
export const seed = async (payload: Payload) => {
const { totalDocs } = await payload.count({
@@ -22,4 +22,55 @@ export const seed = async (payload: Payload) => {
},
})
}
const editors = await payload.count({ collection: 'users', where: { email: { equals: devEditor.email } } })
if (!editors.totalDocs) {
await payload.create({ collection: 'users', data: { ...devEditor, roles: ['editor'] } })
}
await seedContactPage(payload)
}
const text = (t: string) => ({
root: {
children: [{ children: [{ detail: 0, format: 0, mode: 'normal', style: '', text: t, type: 'text', version: 1 }], direction: null, format: '', indent: 0, type: 'paragraph', version: 1 }],
direction: null,
format: '',
indent: 0,
type: 'root',
version: 1,
},
})
/** A step-by-step quote form on /pl/kontakt — exercises RenderForm, steps, choice lists, dates. */
async function seedContactPage(payload: Payload) {
const { totalDocs } = await payload.count({ collection: 'pages', where: { slug: { equals: 'kontakt' } } })
if (totalDocs) {return}
const form = await payload.create({
collection: 'forms',
data: {
confirmationMessage: text('Dziękujemy! Odezwiemy się w ciągu 24 godzin.'),
confirmationType: 'message',
fields: [
{ blockType: 'step', title: 'Kontakt' },
{ name: 'name', blockType: 'text', label: 'Imię i nazwisko', required: true, width: 50 },
{ name: 'email', blockType: 'email', label: 'E-mail', required: true, width: 50 },
{ blockType: 'step', description: 'Zaznacz, czego potrzebujesz.', title: 'Projekt' },
{ name: 'services', blockType: 'checkboxGroup', label: 'Usługi', options: [{ label: 'Strona WWW', value: 'www' }, { label: 'SEO', value: 'seo' }, { label: 'Kampanie', value: 'ads' }], required: true },
{ name: 'budget', blockType: 'radio', label: 'Budżet', options: [{ label: 'do 10 tys.', value: 's' }, { label: 'powyżej 10 tys.', value: 'l' }], required: true },
{ name: 'deadline', blockType: 'date', label: 'Termin' },
{ blockType: 'message', message: text('Dane przetwarzamy wyłącznie w celu przygotowania wyceny.') },
{ name: 'consent', blockType: 'checkbox', label: 'Zgadzam się na przetwarzanie danych.', required: true },
],
submitButtonLabel: 'Wyślij zapytanie',
title: 'Wycena',
} as never,
})
const page = await payload.create({
collection: 'pages',
data: { layout: [{ blockType: 'formBlock', form: form.id }], slug: 'kontakt', title: 'Kontakt' } as never,
})
await payload.updateGlobal({ slug: 'site-settings' as never, data: { siteName: 'Sandbox' } as never })
payload.logger.info(`[seed] /pl/kontakt (page ${page.id}, form ${form.id})`)
}

Some files were not shown because too many files have changed in this diff Show More