Commit Graph
143 Commits
Author SHA1 Message Date
Radosław SmolińskiandClaude Opus 5.5 f0127ac1b8 1.18.0 performance items: tests, the reference budget gate tightened (JS 195 kB, 404 without its exception, TTL check), docs (performance.md, AGENT.md, iapl-performance, module pages, api.md), changelog: what changes for an existing site
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 15:54:15 +01:00
Radosław SmolińskiandClaude Opus 5.5 076b3ef707 Merge claude/performance-2026-12-36a376: fewer queries per render, no 'use client' on the /client barrels, budgets, the doctor's performance and growth groups
Conflicts kept both sides: the doctor status (twoFactorConfirm with growth and media), its key test, e2e:built (the 2FA
enrolment spec and the performance budgets), the reference index (regenerated). Reference skill copies synced
(iapl-performance added, iapl-audit and iapl-reference updated).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 14:58:44 +01:00
Radosław SmolińskiandClaude Opus 5.5 8991867e01 What grows: the doctor's growth group (sizes, versions, retention, submissions, KV, unused media, disk) with thresholds, expired mail-service nonces swept, opt-in forms.submissionRetentionDays, docs
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 14:48:35 +01:00
Radosław SmolińskiandClaude Opus 5.5 3b32e659c5 Budget gate: Next's idle link prefetches counted apart, third parties recorded then aborted, spec filter safe for any checkout path; zero counted queries fail
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 14:19:26 +01:00
Radosław SmolińskiandClaude Opus 5.5 c6c5dfbcbf Docs: performance.md, the iapl-performance skill, AGENT.md 6.11b, doctor.md, audit, api.md, the measurements and the audit
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 13:51:43 +01:00
Radosław SmolińskiandClaude Opus 5.5 c9d1f4b340 2FA: the first set-up is confirmed by e-mail (twoFactor.confirmByEmail, 1.18.0)
Security audit 2026-12, F0: inside an account's setup window its password alone
enrolled an authenticator of the caller's choosing; the owner was locked out.

- /setup-totp for an account without a factor: IAPL checks the code, keeps the
  secret pending (payload-kv), mails a single-use 30-min link to the account and
  ties it to the enrolling browser; the package's handler (and its -totp cookie)
  is never used for a first enrolment
- GET /api/iapl/two-factor/confirm = a page with one button; POST confirms
  (own origin, same browser), ends the account's sessions, signs nobody in
- notice mails on every enrolment, change, removal / reset (any path)
- mail not working: link to the server log, admin confirms on the account page
  (POST /api/iapl/two-factor/confirm-pending), doctor rule 2fa-enrolment-mail
- options and opt-out (confirmByEmail: false), building blocks exported
- tests: HTTP suite on SQLite, MongoDB, Postgres; built-site spec in e2e:built;
  closed doors and judged routes; docs, AGENT.md, skills, changelog

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 13:37:39 +01:00
Radosław SmolińskiandClaude Opus 5.5 1bc0ebca63 Merge local main (1.17.2) into security-a-118
Conflicts resolved by keeping both sides: lockedAnswer + sign-in rules in plugin.ts and switches.ts, IPv6 grouping in the
mail service's new per-visitor address count, both built-site specs in e2e:built, docs and skills (reference copies
synced). The lockedAnswer suite and the sign-in-answers spec now reach Payload's lock the 1.18.0 way: a spray from
50 IPs, one failure each (one IP alone gets 429 after five).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 12:57:52 +01:00
Radosław SmolińskiandClaude Opus 5.5 23215d91a8 Merge claude/security-b-118: plugin status written alone, access answers announced (strict in 1.19.0), drafts left out of related documents
Merged onto ee241de (the prepared 1.17.2). Conflicts kept both sides: AGENT.md rows (consent version; drafts, status, access answers), security.md sections (job queue, visitor accounts; access callbacks), src/index.ts (the jobs exports).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 12:53:59 +01:00
Radosław SmolińskiandClaude Opus 5.5 0dffd377a7 Merge claude/cookie-button-bottom: the cookie button never moves; the footer keeps room under its last row (owner's option 3)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 12:08:57 +01:00
Radosław SmolińskiandClaude Fable 5.2 3821174be4 Cookie button never moves; the footer gets room under its last row while the button is shown
Owner, 2026-12-01, after the review of fb92b35: option 3, "miejsce pod stopką" — the button stays in its corner at
all times and covers nothing; the page gets room under its last row.

- Removed: the step up at the end of the page (`clear`, COOKIE_BUTTON_CLEAR, stepAbove; never released).
- New: while the button is shown, the last footer (`reserve`, COOKIE_BUTTON_RESERVE; no footer: <body>) gets bottom
  padding, measured: button height + offset + safe area + 8 px, minus what is already free under the lowest text or
  control in the button's column. The footer's own padding counts (no double space); an empty corner gets nothing.
  Not before a decision, not while the banner is open, gone with the button; `reserve={false}` turns it off,
  `--ipal-cookie-button-space` on the footer sets the amount (0 = none, per breakpoint).
- No layout shift: on a static page <CookieButton> renders an inline script that makes the room before the first
  paint for a visitor who already decided — in a constructed style sheet, so the server's markup is untouched and
  React hydrates without a mismatch; after hydration the same function moves it onto the element.
- consentDecidedScript: the shared start of the banner's and the button's pre-paint scripts.
- avoid={COOKIE_BUTTON_AVOID} is still the placement before 1.17.2 (no room then).

Tests: test/cookieButtonPlacement.test.ts rewritten (24); reference e2e on desktop, 390 px and 360 px phones, light
and dark, five pages: the corner at every scroll position, nothing under the button at the very end, every footer
link clickable, layout shift < 0.001, the room before hydration.
Docs: consent.md, AGENT.md, skills, PROGRAMISTA item 83, changelog draft 1.17.2.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-12-01 12:08:00 +01:00
Radosław SmolińskiandClaude Opus 5.5 66afd5ea43 Merge claude/cookie-button-bottom: the cookie button stays in the bottom corner of the window
Conflicts in the 1.17.2 changelog draft and the upgrade skill: both sides kept (rewritten into one entry at release).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 11:17:59 +01:00
Radosław SmolińskiandClaude Opus 5.5 07ad2bde60 Merge claude/security-b-1172: the consent version only goes up
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 11:17:51 +01:00
Radosław SmolińskiandClaude Opus 5.5 529a766fb1 Merge claude/security-c-1172: form submissions over REST only for staff, the job queue for an admin or Bearer CRON_SECRET, doctor visitor-writes
Conflicts with security-a-1172 kept both sides: imports (adminSameOrigin, jobsAccess), the doctor status (originKnown and visitorWrites), its test, and the e2e:built line (A's sign-in answers spec with C's CRON_SECRET).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 11:17:51 +01:00
Radosław SmolińskiandClaude Opus 5.5 21ef0fdeb0 1.18.0 (owner's decisions Q3, Q4, Q5): writes that keep others' saves, access answers announced, drafts out of related documents
- Q3: the integration status (emailStatus, turnstileStatus) is written alone through the
  database adapter (writeGlobalFields, exported): a visitor's form submit no longer puts back an
  admin's SMTP or Turnstile change saved at the same moment. addToCookieList reads the list again
  right before writing and works the change out again when an editor's save changed it (up to 5
  times). Both races reproduced exactly in test/statusWrites.test.ts, on the three adapters.
- Q4: cookieScanner.access and the doctor's access go through accessAllowed: any truthy answer
  still allows, an answer that is not a boolean is reported once per option; strict (only true)
  is announced for 1.19.0.
- Q5: related documents that are drafts are left out of what the public helpers answer
  (resolveRoute, getSettings, getArchiveEntries, the 404 page, llms-full; Markdown and MCP through
  resolveRoute): null alone, removed from a list, value null in a polymorphic one. A preview keeps
  them; draftRelations: 'keep' keeps the old behaviour. withoutDraftRelations,
  applyDraftRelations exported.
- Docs: content.md, frontend.md, integrations.md, cookie-scanner.md, security.md, AGENT.md;
  iapl-nav and iapl-doctor skills.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 11:15:13 +01:00
Radosław SmolińskiandClaude Opus 5.5 52710021ef Staff sign-in rules: failures per IP and address, own origin, current password for own changes (1.18.0)
Q2 (IAWL idea 16): Payload locks a staff account after 5 wrong passwords
from anybody, so a stranger kept the owner out without a password. Failed
sign-ins are now counted per client IP and typed address (folded: NFKC,
lower case, trim): 5 in 15 min, then 429 for that IP and address only;
only failures count (a place taken before the compare, given back on
success or refusal; "try again in a moment" while others are being
checked). Payload's own lock stays as the net at 50 failures for an hour
where the project set none. The mail service's account-mail limit now
counts per address per visitor (5) with 20 per address in all, so one
stranger no longer blocks the owner's own reset mail.
Q3 (idea 7): staff login, forgot and reset password refuse a request a
browser marks as coming from another origin (403 before anything is
counted or sent); visitor collections untouched.
Q5 (idea 29): an account that changes its own e-mail, username or password
must send its current password (panel field on the account page via the
plugin's MaskedField, no import-map change; REST and GraphQL). Admins
changing others, server code and API keys are not asked; wrong ones count
like failed sign-ins.
Options accounts.signInLimit / signInSameOrigin / confirmOwnChanges, all
validated at start. Tests: 15 HTTP tests (2FA on/off, all off), fail
before on 1.17.1; built-site spec own-account.spec.ts in e2e:built.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 11:12:40 +01:00
Radosław SmolińskiandClaude Opus 5.5 ac6151a0ba Merge claude/security-a-1172: a locked staff account answers like a wrong password, IPv6 counted per /64, panel actions only from the site's own origin
plugin.ts import conflict: withVersionReadRules (readPublished fix) and withLockedAnswer both kept.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 11:06:15 +01:00
Radosław SmolińskiandClaude Opus 5.5 27ddbc3b41 Consent version only goes up (owner's decision Q2, 1.17.2)
A stored consent counts only under the version it was given for, so a lower Cookies →
Consent version made consent given under an older policy valid again. A save through access
control (panel, REST, GraphQL) with a lower number is now refused with a message (English and
Polish); the same or a higher number and saves without it pass; the Local API with
overrideAccess may still lower it. iapl({ cookieSettings: { allowLowerPolicyVersion: true } })
keeps the old behaviour. Building blocks exported: policyVersionNeverDown,
buildCookieSettingsFields, buildCookieSettings. No schema change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 10:55:44 +01:00
Radosław SmolińskiandClaude Fable 5.2 1025446a28 Cookie button stays in the bottom corner of the window; it no longer climbs above the footer
Owner, 2026-12-01: by default the cookie button should go to the bottom of the page, not to the footer.
Until now the button (fixed, a child of <body>) moved up by the visible part of the footer: on a phone with a tall
footer it ended at the top of the screen over the header, on a short page in the middle of it.

- Default: fixed in the bottom corner on every page and scroll position; safe-area inset also on the side.
- Only at the very end of the page it steps just above a link, button or form field it would keep covered
  (`clear`, COOKIE_BUTTON_CLEAR, stepAbove); a transform, no layout shift.
- The placement before: avoid={COOKIE_BUTTON_AVOID}; avoid={false} still means never move; className as before.

Tests: test/cookieButtonPlacement.test.ts; reference e2e on desktop and phone (corner on long and short pages,
no covered control at the page end, no layout shift, keyboard reopen).
Docs: consent.md "Where the cookie button sits", AGENT.md, skills, PROGRAMISTA item 83, changelog draft 1.17.2.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-12-01 10:49:23 +01:00
Radosław SmolińskiandClaude Opus 5.5 03f5cf1a8d Panel actions only from the site's own origin (adminSameOrigin); doctor reads serverURL from the running config
The plugin's panel actions (mail service connect / disconnect, test e-mail,
cookie scan, approval, crawl) act with the panel's login cookie and read a
text/plain body, which another origin sends without a CORS preflight; a
sibling subdomain is same-site and Payload's csrf list is empty without
serverURL. On 1.17.1 such a page reached connect with an admin's cookie
(it called the mail service). Now each refuses a request a browser marks as
coming from elsewhere (403 before anything is read), the rule of the 2FA
endpoints; only endpoints the plugin added; logged once per origin, naming
adminSameOrigin. adminSameOrigin: false / { origins } (owner's Q6).
iapl-doctor csrf-empty: the deep status reports originKnown (serverURL or
csrf in the running config, never the value) and it wins over the file.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 10:46:05 +01:00
Radosław SmolińskiandClaude Opus 5.5 4e68b7e44a 1.17.2 (owner's Q1-Q3): form submissions over REST for staff only; Payload's job queue for an admin or Bearer CRON_SECRET; doctor visitor-writes; explicit write rules on the reference site
- form-submissions create: a staff account with its second factor (formSubmissionOverrides.access.create keeps the way back)
- jobsRunAccess (default on when the project writes no jobs.access.run): admin with the second factor or Bearer CRON_SECRET (16+); start-up note when the secret is missing; jobsRunAccess: false keeps Payload's default
- iapl-doctor deep rule visitor-writes: entities a visitor login account may write, asked by behaviour
- reference: Pages, Posts, CaseStudies, Media, Header, Footer, Company get adminOrEditor write rules
- closed doors: submissions, pages, media, header, company closed for customers; the fixture's job queue refused without the secret, run with it
- route snapshot reasons, docs, AGENT.md, skills, changelog draft 1.17.2

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 10:44:18 +01:00
Radosław SmolińskiandClaude Opus 5.5 97c62f21f0 Every plugin limiter counts IPv6 per /64 (setIpv6Grouping)
clientIp() returns the whole IPv6 address and every limiter keyed on it, so
one host with a /64 had 2^64 budgets: 50 addresses of one /64 against a
limit of 5 all passed (IAWL idea 9, owner's Q4). consumeRateLimit and
checkRateLimit now count an IPv6 key by its /64 (an IPv4-mapped address by
its IPv4); the mail service's per-visitor account-mail key too. A second
counter per /48 at 10x the limit is available and off by default
(setIpv6Grouping({ wide: 48 })); setIpv6Grouping({ prefix: 128 }) counts
per address as before. ipRateKey(ip) is exported for own limiters.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 10:42:02 +01:00
Radosław SmolińskiandClaude Opus 5.5 4b17254135 readPublished on version history: readPublishedVersions, and the documented form works (1.17.2)
readVersions: readPublished(), as access.md showed, answered every version read with 500 on
MongoDB, Postgres and SQLite: the rule returns the document's `_status` path, a version query
runs on the versions collection where the status is `version._status` (SQL: "Cannot find field
for path at _status"; MongoDB: TypeError in sanitizeQueryValue). Reported by a client project
upgrading to 1.17.1.

- readPublishedVersions(minimum): the version form, for readVersions.
- readPublished() carries a symbol mark (READ_PUBLISHED); iapl() swaps it on readVersions of the
  collections and globals it sees (withVersionReadRules, exported for plugins listed after it).
- Tests on the three adapters: the version list (REST, depth 0/2, Local API, GraphQL), one version
  by id, the count, a global, an explicit role; the 1.17.1 HTTP test now checks the status too.
- access.md says where each rule goes; AGENT.md, iapl-collection and iapl-audit skills.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 10:39:41 +01:00
Radosław SmolińskiandClaude Opus 5.5 15b5c6258d A locked staff account answers its login like a wrong password (accounts.lockedAnswer)
Payload checks the lock before the password, so after five wrong passwords
a staff address answered "This user is locked…" to any password while an
address with no account always answered "The email or password provided is
incorrect.": anybody could find out which addresses have a staff account
(IAWL idea 6, owner's Q1). A config-level afterError hook now answers
LockedAuth on a staff collection's login exactly like AuthenticationError:
REST status and body, GraphQL message and extensions.name. The lock is
unchanged; visitor collections keep Payload's answer.
accounts: { lockedAnswer: 'payload' } keeps Payload's message; any other
value stops the start. Building blocks lockedLooksWrong, withLockedAnswer,
graphqlLoginName.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 10:39:40 +01:00
Radosław SmolińskiandClaude Opus 5.5 344b84f9fc Merge claude/mail-transport-choice: "Sending method" is an explicit choice in the panel (IWSN, own SMTP, Graph); nothing changes until another option is picked
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 23:27:36 +01:00
Radosław SmolińskiandClaude Fable 5.2 dc3e594d38 Sending method, the owner's answers: nothing changes until another option is picked; the panel warns before the save
- a save that sends the method already shown, while nothing is stored, stores nothing: the site keeps sending
  exactly as before and keeps following what is filled in, until somebody picks ANOTHER option
- the state block reads the form as it is edited and warns at once when "Own SMTP server" is picked with server,
  user name or password empty, or "Microsoft Graph" on a server without GRAPH_* (graphReady in the panel state);
  it reloads after every save
- texts, doctor's info finding, docs, skills, changelog; reference e2e checks the warning

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-26 10:26:12 +01:00
Radosław SmolińskiandClaude Opus 5.5 634908eb57 Merge claude/postgres-mail-deadlock: Postgres keeps connections free of transactions; form and account mail go out after the commit
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-26 01:38:31 +01:00