- 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]>
- 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]>
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]>
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]>
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]>
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]>
/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]>
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]>
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]>
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]>
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]>
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]>
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]>
- 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]>
- 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]>
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]>
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]>
- 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]>
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]>
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]>
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]>
- 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]>
- 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]>
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]>
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]>
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]>
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]>
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]>
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]>
- 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]>
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]>
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]>
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]>
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]>
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]>
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]>
- 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]>
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]>
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]>
- 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]>
- 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]>
- 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]>
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]>
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]>
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]>
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]>
- 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]>
- 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]>
- 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]>
- 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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
(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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
@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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
(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]>
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]>
@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]>
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]>
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]>
@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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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.
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]>
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]>
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]>
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.
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]>
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]>
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]>
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.
"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]>
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]>
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]>
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.
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]>
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]>
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]>
- 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]>
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.
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]>
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.
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]>
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.
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]>
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]>
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]>
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]>
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.
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.
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.
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]>
- 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]>
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]>
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]>
- 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]>
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]>
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.
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.
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]>
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]>
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]>
- 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]>
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]>
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).
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.
- 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]>
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]>
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.
- 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]>
- 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]>
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]>
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.
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]>
- 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]>
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.
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.
- 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]>
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.
- 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]>
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]>
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]>
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]>
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]>
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.
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).
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.
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]>
- 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]>
@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]>
- 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]>
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).
- 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]>
- 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]>
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]>
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).
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]>
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]>
/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).
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]>
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]>
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.
@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]>
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]>
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.
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]>
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]>
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.
- 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]>
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).
- 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]>
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]>
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.
- 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]>
- 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]>
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).
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.
- 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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
- 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]>
- 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]>
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]>
- 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]>
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
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]>
- 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]>
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]>
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]>
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]>
- 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]>
- 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]>
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]>
- 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]>
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]>
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]>
- 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]>
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]>
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]>
- 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]>
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]>
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]>
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]>
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]>
- 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]>
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]>
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]>
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]>
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]>
- 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]>
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]>
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]>
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]>
{{*: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]>
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]>
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]>
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.
| `@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)) |
- **[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 (Polish)
- **[CHANGELOG.md](./docs/CHANGELOG.md)** — what changed per version and what projects must update
---
@@ -125,7 +195,8 @@ 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/dev/PROGRAMISTA.md](./docs/dev/PROGRAMISTA.md)** or message the
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})`)
'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.',
-`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
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 _ ->
`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
- **`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'
constdriver={
// Arrange `given`; return the variables for {{…}}.
for(constexampleofexamples)awaitrunExample(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
"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.",
"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.",
"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.",
* Intro under the settings heading — what cookies are for and that the choice can be changed later.
*/
settingsDescription?: string|null;
/**
* Badge next to the Necessary category, e.g. "Always active". Empty → a disabled switch/checkbox is shown instead.
*/
alwaysActiveLabel?: string|null;
/**
* Text of the privacy-policy link in the banner, e.g. "Privacy policy". The link target is the page assigned as Privacy Policy in Site Settings → System Pages. Empty → the page title is used.
All IAPL docs, the agent guide and the agent skills are written in English.
**Main rule — the plugin helps, never limits:** IAPL is a plugin — it helps projects and never
limits them. Every module can be turned off on its own, every default can be overridden (the project
config wins), safe defaults have an option to relax them, and the plugin exports building blocks
(helpers, builders, hooks), not only finished features. Every module page has a "Turn off, override,
extend" section that describes the current code.
| Who you are | Read |
|---|---|
| **Agent AI**pracujący w projekcie | [AGENT.md](./agent/AGENT.md) — reguły, struktura, budowa sekcji, kontrole przed „gotowe” |
| **Agent AI — skille** | [agent/skills/](./agent/skills) — 14 skilli`ipal-*`dla Antigravity/Claude Code, w tym`ipal-site` (strona od briefu do raportu) i skrypty kontrolne (kopiowane do projektu: `pnpm ipal:skills`, AGENT.md §14) |
| **Osoba prowadząca agenta AI** | [vibe.md](./dev/vibe.md) — tryb autonomiczny (`/ipal-site`) i gotowe polecenia krok po kroku |
| **AI agent**working in a project | [AGENT.md](./agent/AGENT.md) — rules, structure, building sections, checks before "done" |
| **AI agent — skills** | [agent/skills/](./agent/skills) — 15`iapl-*`skills for Antigravity/Claude Code, including `iapl-reference` (full map of the plugin and every export), `iapl-setup` (complete installation),`iapl-site` (a site from brief to report) and the check scripts (copied into the project: `pnpm exec iapl-skills`, AGENT.md §14) |
| **Developer** | [PROGRAMISTA.md](./dev/PROGRAMISTA.md) — installation, new project, env, deployment, upgrades, releasing the plugin, Gitea; deployment and health check: [deployment.md](./deployment.md) |
| **Person driving an AI agent** | [vibe.md](./dev/vibe.md) — autonomous mode (`/iapl-site`) and ready-made step-by-step prompts |
Szczegóły API — jeden plik na moduł:
API details — one file per module:
| Moduł | Plik |
| Module | File |
|---|---|
| Role i dostęp do panelu | [access.md](./access.md) |
// defaultRole: 'user', // rola nowych użytkowników, domyślnie 'user'
authCollection:'users',// slug of your auth collection (required)
// defaultRole: 'user', // role of new accounts
// firstUserAdmin: true, // the account from "Create first user" → admin
// authAccess: { … }, // access of the injected auth collection (your keys win)
// staffCollections: ['partners'], // more auth collections whose accounts are staff
},
// globalOverrides: { … }, // access / admin / hooks / fields of the plugin's globals
})
```
| Option | Default | What it does |
|---|---|---|
| `access.authCollection` | — (required) | the auth collection that gets the `roles` field |
| `access.defaultRole` | `'user'` | role of a new account when an admin did not set one |
| `access.firstUserAdmin` | `true` | the account from the "Create first user" screen (`…/first-register` on an empty collection) gets `['admin']`, even when the form picked `user`; `false` = it gets what was submitted — then mind the panel role, [Account rules](#account-rules-accounts) |
| `access.authAccess` | see the table below | `access` of the **injected** auth collection, merged over the default (your keys win) |
| `access.staffCollections` | `[]` | more auth collections whose accounts count as **staff**, besides the one the panel logs in with (`admin.user`); see "Who is staff" |
| `globalOverrides` | — | changes to the plugin's globals: an object merges `access` / `admin` key by key (your keys win) and appends `hooks` (yours run after the plugin's), other keys (label, fields, …) replace; a function `(global) => global` takes over the whole global |
The `roles` field (select hasMany, required, `saveToJWT`): readable without limits; only an admin
can set and change it — also on account creation, so an open sign-up cannot
push `roles: ['admin']` through. The first-user screen and the Local API (seed) run with
`overrideAccess`. An account without roles meets no threshold (not even `'user'`); `authenticated`
only checks that someone is logged in.
**Auth collection when the project has none.** The plugin adds a minimal collection (`auth: true`,
`admin.useAsTitle: 'email'`) with the slug `access.authCollection` (or `twoFactor.collectionSlug`,
`admin.user`, `'users'`). The project's own collection with that slug always wins whole.
## What the plugin locks down by itself
| Resource | Read | Write | How to change |
|---|---|---|---|
| auth collection **injected** by the plugin, with roles | admin: everyone; other accounts **of that collection**: only themselves (`adminOrSelfIn`) | `create` / `delete` / `unlock`: admin; `update`: admin or self | `access.authAccess`, or your own collection |
| Site settings, Cookie banner, Notifications | public | `editor+` | `globalOverrides` |
| Site integrations | admin | admin | `globalOverrides` |
| Forms | public (Emails tab only `editor+`) | `editor+` | `forms.formOverrides.access`, the Emails field in `formOverrides.fields` |
They take a loosely typed user (like`req.user`) and read`roles` defensively. The last argument tells them
which collections are staff:
## Gotowe funkcje dostępu
| Where you call it | Pass | Without it |
|---|---|---|
| access functions, hooks, endpoints (server, the config is loaded) | `req.payload` | works: the staff collections of the config `iapl` built in this process. With two different configs in one process, only collections that are staff in **both** count — pass `req.payload` to get that config's own answer |
| client components — import from **`@intecion/ipal-kit/client`** | the config from `useConfig()` (it has `admin.user`, the panel's login collection), or `{ staffCollections: ['users', …] }` | **always `false`** — the browser bundle has no config |
| Next middleware / `proxy.ts`, the edge runtime | `{ staffCollections: ['users'] }` | **always `false`** — the config is not loaded there |
### Collection-level (zwracają boolean | Where)
```tsx
'use client'
import{isAdmin}from'@intecion/ipal-kit/client'// not '@intecion/ipal-kit'
import{useAuth,useConfig}from'@payloadcms/ui'
exportfunctionAdminOnlyHint() {
const{config}=useConfig()
const{user}=useAuth()
// a hint only — the server decides
returnisAdmin(user,config)?<p>…</p>:null
}
```
- **The import in a client component is `/client`** (`hasMinimumRole`, `isAdmin`, `isEditor`, the type `Role`). The main
entry reaches `server-only` modules: with `next build --webpack` it fails with `'server-only' cannot be imported from
a Client Component module` (Turbopack builds it, but the import does not belong there either).
In 1.16.4–1.16.6 `/client` does not have them — upgrade.
- **On the server** (config, hooks, access functions, endpoints, server components, `proxy.ts`) import from
`@intecion/ipal-kit`: `/client` is a `'use client'` entry, a server component that calls a function from it fails.
-`useConfig()` carries `admin.user` only (Payload strips `config.custom` from the client config). Accounts of
`access.staffCollections` need the list: `isAdmin(user, { staffCollections: ['users', 'partners'] })`.
They fail closed: where the staff collections are not known, nobody is staff, and an account without
`collection` is nobody. `isAdmin` and the others do **not** check the second factor; `userMeetsRole` and every
- **Check:** log in to `/admin` as an account with the role `user` → "Unauthorized"; `GET /api/access` for it →
`canAccessAdmin: false`; `GET /api/users/me` still answers.
### Nobody creates an account for themselves, or takes one over (`accounts.adminOnlyCreate`, `accounts.adminOnlyWrite`, `accounts.staffOnlyRead`, `accounts.firstUserRoute`)
By default only the first account of a site can be registered by a visitor, and it becomes admin
(`access.firstUserAdmin`); every other account is made by an admin, and an account is changed by an admin or by
its owner.
Payload's default for a collection without access rules is "any logged-in user" for `create`, `read`, `update`,
`delete` and `unlock` — an account of **any** auth collection. On a project's own staff collection a visitor
account (`customers`) could therefore create a staff account, `PATCH` a staff account's password and roles,
list the staff accounts, and lift the lock after failed logins.
| The first account: `POST /api/users/first-register` on an empty collection | 200, role `admin` | the same |
| A signed-in editor or plain user creates an account in the plugin's injected collection | refused | refused |
| …in **the project's own** staff collection that has no `create` rule | **allowed** (Payload's default) | refused — an admin, fully signed in |
| A visitor account (`customers`) changes or deletes an account of the project's own staff collection that has no `update` / `delete` rule | **allowed** (Payload's default) | refused |
| A visitor account lists the accounts of such a collection, or unlocks one | **allowed** (Payload's default) | refused |
| An account of such a collection changes its **own** `roles` (the field has no access of its own) | **allowed** | refused — with the plugin's roles only an admin changes roles |
| `POST /api/<slug>/first-register` on another empty auth collection (`members`) | **200** | 403 |
| …on an empty **second staff collection** (`access.staffCollections`) | **200, and that account was staff** | 403 — an admin of the panel's collection creates its first account |
| A collection that allows sign-up (`customers` with `create: () => true`) | allowed | allowed, its first-user route too |
**Which rule a staff collection gets** (the panel's login collection, `access.authCollection`,
`access.staffCollections`) — only for an operation it has **no** rule for; a rule you wrote always stays:
| The collection | `create`, `delete`, `unlock` | `update` | the `roles` field (when it has no `access.update`) | `read`, `readVersions` |
|---|---|---|---|---|
| carries **the plugin's roles**: it is `access.authCollection`, or has a `roles` select **with `hasMany`** whose values are all `user` / `editor` / `admin` (`hasPluginRoles`), **or one whose accounts can hold `editor` or `admin`**, whatever else its `roles` field offers (`canHoldStaffRole`, below) | an admin (`staffCreateAccess`) | an admin, or the account itself (`staffUpdateAccess(slug)`) | only an admin changes it (`rolesByAdminOnly`) | a staff account (`staffReadAccess`) |
| has **roles of its own that hold neither `editor` nor `admin`** (`superadmin`, `writer`, …) or no `roles` field — the plugin cannot tell who its admins are | an account of that same collection, or a plugin admin of another staff collection (`sameStaffCollectionAccess(slug)`) | the same | an account never changes its **own** (`rolesNotOwn(slug)`) | a staff account |
Always "fully signed in": a session that still owes its second factor passes none of them.
**A `roles` field that can hold `editor` or `admin`.** The plugin's checks go by the **value on the account**
(`isAdmin`, `isEditor`): an account of a staff collection whose `roles` — an **array** — holds `admin` is a plugin
admin, one that holds `editor` edits the site's settings, whatever else the field offers. So wherever an account
of the collection **can** hold one of the two, the collection gets the admin rules (`canHoldStaffRole`):
| The collection's `roles` field | Rules |
|---|---|
| a select **with `hasMany`** and `editor` or `admin` among its values — `user, editor, admin, boss`; `viewer, editor` | the admin rules (first row above) |
| a field that holds a list whose values cannot be listed — text with `hasMany`, json, a relationship with `hasMany` (to documents whose ids are text, the ids are the roles), a select without options, a type the plugin does not know: anything can be written there | the admin rules |
| a select with `hasMany` whose values are all your own and hold neither — `lead, member` | "an account of that same collection" (second row) |
| a field that holds **one** value — a select, text or relationship without `hasMany`, a radio, a number (`rolesAreAList` is false) | second row. The plugin counts roles only from an array: an account whose `roles` is the single value `admin` is **not** a plugin admin, so there is nothing of the plugin's to protect and the collection's accounts keep managing each other. If your own code gives rights by that value, write the collection's own rules |
| no `roles` field | second row; every account of it is an admin to the plugin (below) |
Otherwise any account of such a collection could hand the value out: create an `admin` and be in Site
integrations and every other staff collection, or create an `editor` and change the site's settings. (Until this
change these collections got the second row, and an account with the lowest role could do exactly that.)
**What it means for your accounts:** a role the plugin does not know (`boss`, `viewer`) carries no rights of the
plugin's — such an account no longer creates, deletes or unlocks accounts there, changes another account or
anybody's roles. Give it what it needs with rules of your own (`access.create` / `update` / `delete`, field
access on `roles`), which win as always. In a collection where nobody can be an `admin` (`viewer, editor`) the
accounts are managed by an admin of another staff collection — the panel's.
**A rule of your own replaces the protection for that operation.** The plugin fills only what you left open: with
your own `create: ({ req }) => Boolean(req.user)` any account still creates an `admin` there; with your own
`access.update: () => true` on the `roles` field an account still raises itself. And the plugin sees the field's
declared values, not your code: a value that a hook of yours puts into `roles` (an `afterRead` that returns
`['admin']` from a checkbox, a virtual field) is not seen — such a collection is judged by its declared field.
**If no staff account holds `admin` at all**, nobody can create, delete or unlock accounts in such a collection.
The start log says so: `[iapl] No staff account holds the role "admin", so NOBODY can create, delete or unlock
accounts in "…"`. Way out: give one account the role with a script (`payload.update`, Local API), or write the
collection's own rules. The check asks each staff collection in the way its field allows (a count for a select,
reading the accounts for text / json / relationship fields, up to 1000 of them); where it cannot check a
collection it says `[iapl] Could not check whether an account of "…" holds the role "admin"` instead and claims
nothing.
**Roles of your own — what the plugin does and does not hold.** It cannot rank `superadmin` against `writer`,
so inside such a collection it enforces one thing only: an account does not change its own roles. Everything
else that was allowed inside the collection stays allowed — **every account of it may still create an account
with any role, and change or delete another account**. That is a hole only you can close: write the
collection's `create` / `update` / `delete` rules and the field access of its `roles` field from your roles.
`iapl-doctor --url` names such a collection (`staff-own-roles`, warning). What the plugin closes for you is the
door for accounts of **other** collections.
**A staff collection without a `roles` field:** every account of it is an admin to the plugin (unchanged), so
it may also manage the accounts of the other staff collections. Give it the plugin's roles
(`buildRolesField`), or write its rules.
**A staff collection that a plugin listed after iapl adds** gets the same rules, the password rule and the
first-user endpoint when the config goes live — at start and on every dev reload. The log says exactly what was
put: `[iapl] "late-staff" was added after iapl: put on it — access rules for create, update, delete, unlock,
read, readVersions, roles; the password rule; the first-user endpoint.` One difference from a collection of your
own config: by then Payload has sanitized the collection and filled every missing rule with its default, and
that default cannot be told from a rule somebody wrote (a production build renames every function). So the
plugin does not guess: **its rule is put in front of whatever rule is there, and both must allow**
(`bothAllow`). With Payload's default behind it the result is the plugin's rule; a rule of the collection's own
is kept and can only narrow it. To keep a late collection's rules exactly as they are — an open `create`, a
wider `read` — say so on the collection: `custom: { ipal: { accountRules: false } }` (the password rule and the
first-user endpoint still apply), or list that plugin before iapl.
**A collection of your own config that becomes staff later** — it is in the config, you did not name it as staff,
and a plugin listed after iapl sets `admin.user` to it — is handled at the same moment, with one difference:
the plugin saw it at config time and wrote down which operations had a rule of yours (the marker's `own`). **Those
rules stay exactly as written; an operation that had no rule gets the plugin's** — the same result as for a
collection named in `access.staffCollections`, and its `roles` field is guarded where the plugin's `update` rule
is the one in force. The log: `[iapl] "people" became a staff collection after iapl ran: put on it — access
rules for update, delete, unlock, read, readVersions, roles; the password rule. Its own rules for create are kept
as written.` Without rules of its own such a collection ran on Payload's defaults before (any signed-in account,
a customer included, created and changed panel accounts). Simpler and clearer: name the collection in
`access.staffCollections`, or list that plugin before iapl. Verify: sign in as an account of a non-staff
collection and `POST /api/<slug>` — 403 unless your own `create` rule lets it through.
**A copy of a staff collection** — a later plugin that spreads one into a new slug (`{ ...staff, slug: 'copy' }`),
or a new collection that reuses a staff collection's `access` object — brings along rules the plugin wrote for
the ORIGINAL: "an account of `staff`", "the account itself" = one of the original's. The plugin sees them by a
mark it puts on its own functions (`staffRuleOf(rule)` → `{ slug, self }`; the mark counts only on the very
function it was made for, so a wrapper of yours around a plugin rule is your rule). What it does is one thing,
in every case:
> **The plugin's rule for THIS collection goes in front of the rule that is there, and both must allow.**
> Nothing is replaced and nothing is rewritten.
| The copy | Where the plugin's rule goes in front |
|---|---|
| named in `access.staffCollections` | of every rule — as on any late staff collection |
| not named as staff, or with `custom: { ipal: { accountRules: false } }` | only of the rules the plugin wrote for the original; your own rules there stay as they are |
| its `roles` field | guarded on every copy (the plugin's roles: only an admin changes them; others: never one's own) unless the field has an `access.update` of its own — then the guard goes in front only of a rule the plugin wrote for the original |
So a copy is never opened wider than its rules were before, and never wider than the plugin's rule — whatever
role values it has, whichever operation it uses a copied rule for, however it wraps it. The original's account
with the same id is not "the account itself" in the copy.
**The cost, and the one line that pays it:** a copied rule that says "an admin, or the account itself" still
means the ORIGINAL's accounts, so in the copy only an admin passes it — the copy's own accounts cannot edit
themselves until the copy says who may:
```ts
import { adminOrSelfIn } from '@intecion/ipal-kit'
description: Audit and improve web accessibility following WCAG 2.2 guidelines. Use when asked to "improve accessibility", "a11y audit", "WCAG compliance", "screen reader support", "keyboard navigation", or "make accessible".
license: MIT
metadata:
author: web-quality-skills
version: "2.0"
---
> **Project rules win.** Vendored by @intecion/ipal-kit as guidance. When this skill conflicts with
> `node_modules/@intecion/ipal-kit/docs/agent/AGENT.md`, the project's `AGENTS.md` or `DESIGN.md`, those win:
> ipal-kit features first (the `ipal-reference` skill), Payload 3 + Next 16 App Router, data from Server Components
> through Payload / `@/lib/content`, every visible text from the CMS, design values from `DESIGN.md` tokens.
> Never add a dependency this skill suggests without the owner's decision.
>
> **Tools:** never run `npx lighthouse` / `npx @axe-core/cli` unpinned — add them as devDependencies at fixed versions
> first. Use the ipal-kit components (CookieBanner, AccessibilityWidget, RenderForm…) and fix their markup through
> their props or a plugin gap report, not by copying them.
# Accessibility (a11y)
Comprehensive accessibility guidelines based on WCAG 2.2 and Lighthouse accessibility audits. Goal: make content usable by everyone, including people with disabilities.
## Evidence-led audit workflow
When a rendered page is available:
1. Run a live Lighthouse Accessibility audit when that capability is available; with Chrome DevTools MCP, use `lighthouse_audit`. Use mobile navigation mode for a general public page or snapshot mode when reloading would lose authenticated or user-created state.
2. Use failed audit nodes to localize the relevant component or template instead of searching the whole repository for generic patterns.
3. Inspect a rendered accessibility-tree snapshot for names, roles, states, landmarks, and heading structure; with Chrome DevTools MCP, use `take_snapshot`. Exercise the affected flow with the keyboard.
4. Fix the source, then re-run the same audit and manual interaction.
If the live tools are unavailable, use Lighthouse CLI or axe for automated coverage and complete the same manual checks. Automated tools detect only a subset of accessibility barriers: a score of 100 is not WCAG conformance, and a low score does not replace issue-level evidence.
## WCAG Principles: POUR
| Principle | Description |
|-----------|-------------|
| **P**erceivable | Content can be perceived through different senses |
| **O**perable | Interface can be operated by all users |
| **U**nderstandable | Content and interface are understandable |
| **R**obust | Content works with assistive technologies |
## Conformance levels
| Level | Requirement | Target |
|-------|-------------|--------|
| **A** | Minimum accessibility | Must pass |
| **AA** | Standard compliance | Should pass (legal requirement in many jurisdictions) |
| **AAA** | Enhanced accessibility | Nice to have |
---
## Perceivable
### Text alternatives (1.1)
**Images require alt text:**
```html
<!-- ❌ Missing alt -->
<img src="chart.png">
<!-- ✅ Descriptive alt -->
<img src="chart.png" alt="Bar chart showing 40% increase in Q3 sales">
**All functionality must be keyboard accessible.** Prefer native interactive elements — `<button>`, `<a href>`, and form controls handle Enter/Space activation, focus, and assistive-tech semantics for free. Only add manual keyboard handling when you cannot use a native element.
```html
<!-- ❌ Non-interactive element with click only: not focusable, no keyboard activation -->
// ✅ When you MUST use a non-interactive element (e.g. div with role="button"),
// make it focusable AND handle keyboard activation. Do NOT add this to a native
// <button> — Enter/Space already fire click, so you'd double-trigger.
element.setAttribute('role', 'button');
element.setAttribute('tabindex', '0');
element.addEventListener('click', handleAction);
element.addEventListener('keydown', (e) => {
if (e.key === 'Enter' || e.key === ' ') {
e.preventDefault();
handleAction();
}
});
```
**No keyboard traps.** Users must be able to Tab into and out of every component. Use the [modal focus trap pattern](references/A11Y-PATTERNS.md#modal-focus-trap) for dialogs—the native `<dialog>` element handles this automatically.
### Focus visible (2.4.7)
```css
/* ❌ Never remove focus outlines */
*:focus { outline: none; }
/* ✅ Use :focus-visible for keyboard-only focus */
:focus {
outline: none;
}
:focus-visible {
outline: 2px solid currentColor; /* inherits text color → already contrast-checked */
outline-offset: 2px;
}
/* ✅ Or pick a brand color and verify ≥3:1 contrast against every background it lands on */
button:focus-visible {
box-shadow: 0 0 0 3px rgba(0, 95, 204, 0.5);
}
```
### Focus not obscured (2.4.11) — new in 2.2
When an element receives keyboard focus, it must not be entirely hidden by other author-created content such as sticky headers, footers, or overlapping panels. At Level AAA (2.4.12), no part of the focused element may be hidden.
```css
/* ✅ Account for sticky headers when scrolling to focused elements */
Provide a skip link so keyboard users can bypass repetitive navigation. See the [skip link pattern](references/A11Y-PATTERNS.md#skip-link) for full markup and styles.
### Target size (2.5.8) — new in 2.2
Interactive targets must be at least **24 × 24 CSS pixels** (AA). Exceptions: inline text links, elements where the browser controls the size, and targets where a 24px circle centered on the bounding box does not overlap another target.
Any action that requires dragging must have a single-pointer alternative (e.g., buttons, inputs). See the [dragging movements pattern](references/A11Y-PATTERNS.md#dragging-movements) for a sortable-list example.
### Timing (2.2)
```javascript
// Allow users to extend time limits
function showSessionWarning() {
const modal = createModal({
title: 'Session Expiring',
content: 'Your session will expire in 2 minutes.',
<p>The French word for hello is <span lang="fr">bonjour</span>.</p>
```
### Consistent navigation (3.2.3)
```html
<!-- Navigation should be consistent across pages -->
<nav aria-label="Main">
<ul>
<li><a href="/" aria-current="page">Home</a></li>
<li><a href="/products">Products</a></li>
<li><a href="/about">About</a></li>
</ul>
</nav>
```
### Consistent help (3.2.6) — new in 2.2
If a help mechanism (contact info, chat widget, FAQ link, self-help option) is repeated across multiple pages, it must appear in the **same relative order** each time. Users who rely on consistent placement shouldn't have to hunt for help on every page.
### Form labels (3.3.2)
Every input needs a programmatically associated label. See the [form labels pattern](references/A11Y-PATTERNS.md#form-labels) for explicit, implicit, and instructional examples.
### Error handling (3.3.1, 3.3.3)
Announce errors to screen readers with `role="alert"` or `aria-live`, set `aria-invalid="true"` on invalid fields, and focus the first error on submit. See the [error handling pattern](references/A11Y-PATTERNS.md#error-handling) for full markup and JS.
### Redundant entry (3.3.7) — new in 2.2
Don't force users to re-enter information they already provided in the same session. Auto-populate from earlier steps, or let users select from previously entered values. Exceptions: security re-confirmation and content that has expired.
```html
<!-- ✅ Auto-fill shipping address from billing -->
**When ARIA is needed,** use the correct roles and states. See the [ARIA tabs pattern](references/A11Y-PATTERNS.md#aria-tabs) for a complete tablist example.
### Live regions (4.1.3)
Use `aria-live` regions to announce dynamic content changes without moving focus. See the [live regions pattern](references/A11Y-PATTERNS.md#live-regions-and-notifications) for markup and a `showNotification()` helper.
---
## Testing checklist
### Automated testing
Prefer a live Lighthouse audit that returns failing rendered nodes directly to the agent. With Chrome DevTools MCP, this is `lighthouse_audit`. Otherwise:
Practical, copy-paste-ready patterns for common accessibility requirements. Each pattern is self-contained and linked from the main [SKILL.md](../SKILL.md).
---
## Modal focus trap
Trap keyboard focus inside a modal dialog so Tab/Shift+Tab cycle through its focusable elements and Escape closes it.
> This document is mainly for agents and LLMs to follow when maintaining,
> generating, or refactoring React codebases using composition. Humans
> may also find it useful, but guidance here is optimized for automation
> and consistency by AI-assisted workflows.
---
## Abstract
Composition patterns for building flexible, maintainable React components. Avoid boolean prop proliferation by using compound components, lifting state, and composing internals. These patterns make codebases easier for both humans and AI agents to work with as they scale.
Consumers explicitly compose exactly what they need. No hidden conditionals. And the state, actions and meta are dependency-injected by a parent provider, allowing multiple usages of the same component structure.
---
## 2. State Management
**Impact: MEDIUM**
Patterns for lifting state and managing shared context across
composed components.
### 2.1 Decouple State Management from UI
**Impact: MEDIUM (enables swapping state implementations without changing UI)**
The provider component should be the only place that knows how state is managed.
UI components consume the context interface—they don't know if state comes from
useState, Zustand, or a server sync.
**Incorrect: UI coupled to state implementation**
```tsx
function ChannelComposer({ channelId }: { channelId: string }) {
// UI component knows about global state implementation
| Licence | MIT (see the LICENSE file in this folder) |
Changes from the upstream text: the `name` in the SKILL.md frontmatter is `ext-composition-patterns`, and an
override note (project rules win) is inserted after the frontmatter. Nothing else is changed.
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.