From b785a27b7d3eb548c7a41aca7f5568f2800ce17e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Smoli=C5=84ski?= Date: Wed, 25 Nov 2026 13:09:57 +0100 Subject: [PATCH] Plan: rename ipal-kit to IAPL in 1.17.0 (inventory, sorting, shape, order, questions) Co-Authored-By: Claude Fable 5.2 --- docs/dev/rename-iapl-plan.md | 410 +++++++++++++++++++++++++++++++++++ 1 file changed, 410 insertions(+) create mode 100644 docs/dev/rename-iapl-plan.md diff --git a/docs/dev/rename-iapl-plan.md b/docs/dev/rename-iapl-plan.md new file mode 100644 index 0000000..61a39a6 --- /dev/null +++ b/docs/dev/rename-iapl-plan.md @@ -0,0 +1,410 @@ +# Rename ipal-kit to IAPL — plan for 1.17.0 + +Status: **plan only**, written 2026-11-25 on top of main `619a4e0`. Nothing is renamed by this document. +Owner's words (2026-11-25): the name changes from ipal-kit to IAPL now, and 1.17.0 is released after it. + +Constraints this plan works inside: + +- 1.17.0 is a minor. A site on 1.16.x upgrades with no change to its code, its deploy or its data. +- 2.0 is reserved for the Payload 4 upgrade. Anything that needs a site to be touched waits for 2.0. +- No client site is touched and no client is notified. No SQL schema change. +- `CLAUDE.md`: every default stays overridable, and the agent guide stays complete in the same change. + +## 0. Recommendation in short + +1. **Brand** becomes IAPL everywhere a person reads it (docs, guide, skills, panel texts, log prefix). +2. **Package name stays `@intecion/ipal-kit` through 1.x**; it becomes `@intecion/iapl` in 2.0, when every + site is opened anyway for Payload 4. One package, one publish, no second copy of the code (§3.1). +3. **New name added, old name keeps working, no runtime notice** where the name is looked up inside the + site's own process: exported names, `bin` commands, env variables, project files (`ipal-doctor.json`, + markers, skip comments), skills. +4. **Unchanged in 1.x** where a third party or stored state holds the name: package and import paths, routes + `/api/ipal/*`, cookie `ipal_vid`, `payload-kv` keys, CSS tokens `--ipal-*`, `data-ipal` hooks, the `ipal` + translation namespace, `custom.ipal`, `req.context` flags. +5. **New things are born with the new name**: everything the mail relay adds (§4.4). + +The rule behind points 3 and 4: an alias is added only where it is a lookup inside one process and nobody +outside has to learn it. Where a browser, a proxy, a database or another service holds the old name, the +name stays until 2.0. + +## 1. Inventory + +Counted with a case-insensitive search for `ipal` over tracked files at `619a4e0`: +**8 090 occurrences in 530 of 1 006 files.** + +| Area | Files | Occurrences | +| --- | ---: | ---: | +| `docs/` (of which `docs/agent/skills` 1 531 in 37 files, `CHANGELOG.md` 324, `AGENT.md` 265, `PROGRAMISTA.md` 144, `docs/dev` 674) | 98 | 3 728 | +| `reference/` (of which `.agents` skill copies 1 531, `src` 157 in 39 files) | 91 | 1 773 | +| `src/` | 235 | 1 579 | +| `test/` | 73 | 753 | +| `bin/` | 5 | 81 | +| `dev/` | 10 | 62 | +| `scripts/` | 4 | 51 | +| `services/cookie-crawler` | 8 | 19 | +| `README.md`, `CLAUDE.md`, `package.json`, `.gitea/`, `frontend/`, lockfile | 6 | 44 | + +The commonest forms: `@intecion/ipal-kit` 1 076, `ipalKit` 603, `ipal-kit` 484, `ipal-doctor` 300, +`@intecion/ipal-kit/admin` 262, `@intecion/ipal-kit/client` 258. + +### 1.1 Package, registry, repository + +| What | Where | Value | +| --- | --- | --- | +| Package name and scope | `package.json` | `@intecion/ipal-kit` | +| Description | `package.json` | "Intecion Payload Advanced Library — …" (the old expansion of the acronym) | +| Registry | `package.json` `publishConfig`, `reference/.npmrc`, starter output | `https://git.intecion.net/api/packages/IntecionSoftware/npm/`; `.npmrc` maps the scope `@intecion:`, not the package | +| Repository | `package.json` `repository`, git remote | `https://git.intecion.net/IntecionSoftware/ipal-kit` | +| Paths into the installed package | docs, skills, `AGENTS.md` pointer block | `node_modules/@intecion/ipal-kit/docs/agent/AGENT.md` (30), `…/docs/.md`, `…/dist/` | +| Files shipped | `package.json` `files` | `dist`, `docs`, `bin`, `src/modules/block-library` | + +### 1.2 Commands (`bin`) + +`ipal-kit` (the starter: `pnpm dlx @intecion/ipal-kit create`), `ipal-skills`, `ipal-blocks`, `ipal-tokens`, +`ipal-doctor`. Five files in `bin/`, 331 lines. Sites call them from `package.json` scripts +(`"tokens": "ipal-tokens"`, `"ipal:skills": "ipal-skills"`), from CI and possibly from Coolify build commands. + +### 1.3 Export paths and exported names + +- 19 export paths: `.`, `./client`, `./rsc`, `./server`, `./seed`, `./starter`, `./templates`, + `./next/middleware`, `./admin`, `./blocks`, `./blocks/rsc`, `./env`, `./doctor`, `./tokens`, and five CSS + files (`fluid.css`, `fluid-wide.css`, `tokens.css`, `tailwind.css`, `a11y.css`). None has the name in the + sub-path; all hang off the package name. +- Exported names that carry the name (10): `ipalKit`, `IpalOptions`, `ipalEnvRules`, `IpalEnvFeatures`, + `ipalT`, `ipalVar`, `IPAL_TOKENS`, `IPAL_BREAKPOINTS`, `IpalTokenName`, `IpalGlobalSlug`. + Every other export (several hundred) has no brand in it. + +### 1.4 Keys in the Payload config and in requests + +| Kind | Names | +| --- | --- | +| `config.custom.ipal.*` (written by the plugin, read by it and documented for projects) | `twoFactor`, `secondFactor`, `accountRules`, `staffCollections`, `staffToken`, `themeStorageKey`, `formAttachments`, `consentFieldName` | +| `custom` on a collection, field, endpoint or block | `ipalAccounts`, `ipalAccountRules`, `ipalWriteOnly`, `ipalFirstUser`, `ipalLibrary` | +| `req.context` flags (projects' hooks read and set them) | `ipalSeed`, `ipalSkipIndexNow`, `ipalSkipAutoFill`, `ipalCookieScan`, `ipalFillLocales`, `ipalIntegrationStatus`, `ipalFirstRegister`, `ipalFormFiles` | +| Server props of the 2FA view | `ipalTotpView`, `ipalTotpClientProps`, `ipalSafeBack` | +| Admin view and field keys | views `ipalStats`, `ipalCookieApproval`; UI fields `ipalCookieReview`, `ipalCookieSiteCheck` (type `ui`: no column, nothing stored) | +| Translation namespace | `ipal:`; a project overrides texts under `i18n.translations..ipal` | +| Cross-copy markers | `Symbol.for('ipal.staffRule')`, `ipal.passwordRule`, `ipal.secondFactorGuard`, `ipal.adminMeta` | +| Mail adapter names (logs only) | `ipal-mail-dispatcher`, `ipal-graph`, `ipal-panel-smtp` | + +### 1.5 Routes + +Twelve, all under Payload's API route as `/api/ipal/…`: `admin-icon`, `admin-og`, `consent`, +`cookie-approval`, `cookie-crawl`, `cookie-crawl/results`, `cookie-scan`, `doctor`, `forms/submit`, `hit`, +`test-email`, `two-factor/reset`. Called by the plugin's own client components, by the cookie-crawler service +(`cookie-crawl/results`), by `ipal-doctor --sites` (`doctor`), and named in docs for WAF and proxy rules. + +### 1.6 Admin import map + +34 component paths in 22 distinct entries, all `@intecion/ipal-kit/admin#`. Each site has them in +its committed `importMap.js`, as keys and as an `import … from '@intecion/ipal-kit/admin'` line. + +### 1.7 Stored data + +| Where | Name | Note | +| --- | --- | --- | +| Collection slugs | `stats-visits`, `consent-records`, `cookie-review`, `cookie-crawl` | **no `ipal`** | +| Global slugs | `site-settings`, `site-integrations`, `cookie-settings`, `notifications` | **no `ipal`** | +| Field names, `dbName`, enum names | none contain `ipal` (the two `ipal…` fields are `ui`) | so SQL tables and columns do not carry the name | +| `payload-kv` | `ipal:2fa-verify::` | 2FA attempt counters, short-lived | +| Visitor's browser | cookie `ipal_vid` (set after analytics consent) | also **stored as a row** in each site's cookie list (`cookie-settings`) and named in the scanner's built-in list | +| Visitor's browser | `localStorage` `ipal-theme` | already a legacy key; 1.x moves it to `theme` | +| Consent cookie | `cookie-consent` | no `ipal` | +| Database name | `_prod` / `_dev` | no `ipal` | + +### 1.8 Files and marks inside a site's repository + +`ipal-doctor.json` (99 mentions; read and written by the doctor), `.ipal/starter.json` (written by the +starter, compared by the release gate), `` / `` in `AGENTS.md` +and `CLAUDE.md` with the heading `## ipal-kit — agent guide` (read by the doctor rule `agents-md`), +`ipal-audit-skip` comments (59 mentions), `.agents/skills/ipal-*` folders, generated `src/design/tokens.css` +full of `--ipal-*`, `package.json` scripts. + +### 1.9 Headers and user agents + +`X-Ipal-Cookie-Crawler: 1` (sent by the crawler service; documented for a WAF rule), +`ipal-doctor (+https://intecion.com; read-only)` (live checks), `ipal-kit cookie-db refresh` (a repo script). + +### 1.10 Env variables + +Runtime, read on a site: `IPAL_IP_HEADER` (64 mentions), `IPAL_NOINDEX` (47), `IPAL_COOKIE_SCAN_TOKEN` (47), +`IPAL_COOKIE_SCAN_URL` (39), `IPAL_SEED_ALLOW_FULL` (39), `IPAL_SEED_ALLOW_PROD_UPDATE` (33), +`IPAL_DOCTOR_TOKEN` (35), `IPAL_DOCTOR_IMPORT_MAP` (7), `IPAL_DOCTOR_STATUS` (4). +Crawler service: `IPAL_CRAWLER_SITES` (21). Repo-only (tests, dev): `IPAL_TEST_MONGO_URI`, +`IPAL_TEST_POSTGRES_URI`, `IPAL_TEST_SHAPE`, `IPAL_COPY_BASELINE`, `IPAL_DEV_2FA`. +(`IPAL_TOKENS` and `IPAL_BREAKPOINTS` are exported constants, not env.) + +### 1.11 CSS + +- 99 design tokens `--ipal-*` (`src/styles/tokens.css` 132 mentions, `tailwind.css` 99, `fluid.css` 36, + `fluid-wide.css` 28, `a11y.css` 10). Sites have them in generated `tokens.css`, in their own CSS and through + the Tailwind preset. +- Styling hooks `data-ipal="…"` (43 in `src`), `data-ipal-block`, `data-ipal-theme-icon`, + `data-ipal-file-notice`, `data-ipal-langswitcher`: documented for sites' CSS and tests. +- Panel classes `.ipal-stats-*`, `.ipal-badge*`, `.ipal-cookie-approval`, `.ipal-row`, `.ipal-label`, + `.ipal-value`, `.ipal-bar`, `.ipal-pad`; element ids `ipal-consent-*`, `nav-ipal-stats`, `ipal-f-…`, + `ipal-cs-…`, `ipal-linkedin-insight`, `ipal-totp-view`, `ipal-two-factor-*`. + +### 1.12 Logs, doctor + +- Log prefix `[ipal]`: 124 places. +- Doctor: 46 rule ids, **none contains `ipal`**. `docs:` links are paths inside the package + (`docs/env.md`, `docs/agent/AGENT.md#…`), so they move only if the docs move. + +### 1.13 Skills, guide, starter, reference site, docs, tests + +- Skills: 16 folders `docs/agent/skills/ipal-*` (`audit`, `block`, `collection`, `consent-check`, `debug`, + `doctor`, `form`, `locale-add`, `migrate-fields`, `nav`, `plugin-gap`, `reference`, `seo-check`, `setup`, + `site`, `upgrade`), plus five vendored `ext-*` carrying "Vendored by @intecion/ipal-kit" in `SOURCE.md`. + `ipal-skills` manages every folder whose name starts with `ipal-` and removes those no longer shipped. +- Starter: `src/modules/starter` (7 files, about 50 mentions); it writes `package.json`, `.npmrc`, + `.ipal/starter.json`, scripts and the next-steps text. +- Reference site: `reference/` (91 files); `ipal-doctor.json`, a full copy of the skills in `.agents`, 39 + source files importing the package; `docs/agent/reference-site/INDEX.md` is generated from it. +- Docs: 41 module pages in `docs/*.md` (1 136), `AGENT.md`, `PROGRAMISTA.md`, `CHANGELOG.md`, `docs/dev` + proposals, `README.md`. +- Tests: 73 files, 753 mentions. `test/docsConsistency.test.ts` checks import lines from + `@intecion/ipal-kit[/entry]` and the skill names `ipal-setup`, `ipal-site`, `ipal-block`, `ipal-collection`, + `ipal-form`, `ipal-plugin-gap`. +- CI: `.gitea` workflow runs `ipal-tokens --check` and `node bin/ipal-doctor.mjs reference`. + +## 2. Sorting + +### A. Brand text only — safe to change + +Prose in docs, guide, skills and `README`; `package.json` description; JSDoc; panel texts shown to people; +CLI help and messages; the log prefix `[ipal]`; mail adapter `name` values; user-agent strings; repo-only env +(`IPAL_TEST_*`, `IPAL_DEV_2FA`, `IPAL_COPY_BASELINE`, `IPAL_TEST_SHAPE`); internal identifiers and file names +in `src` (`ipalEnvRules.ts`); panel-only CSS classes and element ids. + +Two cautions. A site may filter logs on `[ipal]` (cannot be seen from here; named in the changelog). Element +ids and panel classes are checked by this repo's own e2e tests; leave them in 1.17.0 unless a test needs the +change, because they buy nothing. + +### B. Public surface a site's code or deploy depends on — old name must keep working + +Package name and every import path; the import-map paths; `bin` names; the 10 exported names; env variables; +routes; `custom.ipal.*` and the other `custom` keys; `req.context` flags; 2FA view server props; the `ipal` +translation namespace; `--ipal-*` tokens; `data-ipal*` hooks; `Symbol.for('ipal.*')` (two copies of the +package in one process must still recognise each other's marks); `X-Ipal-Cookie-Crawler`; skill names +(agents and `AGENTS.md` "Project decisions" refer to them); project files and marks of §1.8. + +### C. Stored data — no change without a migration + +`ipal_vid` (browsers, and a row in every site's cookie list and approved policy), `payload-kv` keys +`ipal:2fa-verify:*`, legacy `ipal-theme`. No collection, global, field, table, column or enum carries the +name, so **a rename needs no database migration and gives SQL sites no schema change**, provided nobody +renames a slug or field for tidiness. The gate proves it (§4.3). + +### D. Outside the repository + +Gitea repository `IntecionSoftware/ipal-kit` and its CI; the registry package; each site's `package.json`, +lockfile, `.npmrc`, committed `importMap.js`, `AGENTS.md`, skills, `ipal-doctor.json`, scripts; Coolify env +(`IPAL_*`) and build commands; WAF, proxy or CDN rules on `/api/ipal/*` or on the crawler header; the deployed +cookie-crawler; the planned mail service; the planned docs on intecion.com; IAWL's references to ipal-kit; the +local folder `/Users/rasm/Projects/Payload/ipal-kit` with its Claude memory folder and worktrees. + +## 3. The 1.17.0 shape + +### 3.1 The package name: three ways + +| | A. Keep `@intecion/ipal-kit` in 1.x, rename in 2.0 | B. `@intecion/iapl` is the code; `@intecion/ipal-kit` becomes a thin re-export | C. Same build published under both names | +| --- | --- | --- | --- | +| Existing site on upgrade | nothing changes | must keep working through a second package hop | nothing changes | +| Import map | unchanged | the plugin would emit `@intecion/iapl/admin#…`, which a site that depends only on the old name cannot resolve under pnpm's strict layout; the plugin has to learn under which name it was imported | paths must be rewritten per name at build time | +| Extra surface to get right | none | 14 JS entries re-exported across `'use client'` boundaries, 5 CSS files, 5 bins, the `docs/` folder (paths in `AGENTS.md`), `src/modules/block-library` (copied by `ipal-blocks`), peer dependencies declared twice, two publishes locked to one version | two tarballs, a name-substitution build step, the whole gate twice | +| Worst failure | none | a built site fails on one bundler only | both names installed in one site: two copies of module state, contexts and marks | +| New sites before 2.0 | old package name in imports | new name | new name | +| Work | none | 2 to 3 sessions plus built-site checks on both bundlers and both package managers | 2 sessions plus a doubled gate for every later release | + +**Recommendation: A.** 1.17.0 already carries security fixes and the mail relay; B and C add a way for a +built site to break that only shows on one bundler, for a name a visitor never sees. In 2.0 every site is +opened for Payload 4, so the import lines, the import map and `package.json` change there once, done by the +upgrade skill. The cost of A is honest and visible: through 1.x the install line and the import paths still +say `ipal-kit`. If the owner wants new sites on the new package name before 2.0, the second choice is C, +released for new sites only and guarded by a doctor error when both names are installed; not B. + +### 3.2 Changes now + +- All class A text: the product is "IAPL"; first mention in each top document says + "IAPL (package `@intecion/ipal-kit`; called ipal-kit before 1.17.0)". +- `package.json` description. The `repository` URL only when the Gitea repository is renamed (§5 Q4). +- Log prefix `[iapl]`, user agents `iapl-doctor`, mail adapter names. +- Panel texts that show the name to a client's editor. +- Not rewritten: past `CHANGELOG.md` entries, past `PROGRAMISTA.md` rows and `docs/dev` proposals. They + describe releases under the name those releases had. `CHANGELOG.md` gets one line at the top saying so. + +### 3.3 New name added, old name keeps working (no runtime notice) + +| Thing | New | Old in 1.x | How | +| --- | --- | --- | --- | +| Plugin function | `iapl()` | `ipalKit()` is the same function | second export, `@deprecated` in JSDoc only | +| Types and helpers | `IaplOptions`, `iaplEnvRules`, `IaplEnvFeatures`, `iaplT`, `iaplVar`, `IAPL_TOKENS`, `IAPL_BREAKPOINTS`, `IaplTokenName`, `IaplGlobalSlug` | the 9 old names | same values, re-exported | +| Commands | `iapl` (starter), `iapl-doctor`, `iapl-skills`, `iapl-blocks`, `iapl-tokens` | the 5 old names | ten `bin` entries on the same five files | +| Env | `IAPL_` for the 9 runtime variables and `IAPL_CRAWLER_SITES` | `IPAL_` | one helper: new name first, old as fallback; both set and different → the new one wins and the doctor reports it | +| Doctor config | `iapl-doctor.json` | `ipal-doctor.json` | read whichever exists and write back to the same file; both present → a finding | +| Skip comment | `iapl-audit-skip` | `ipal-audit-skip` | both accepted | +| Starter record | `.iapl/starter.json` (new sites) | `.ipal/starter.json` | readers accept both | +| Pointer block | `` … ``, heading `## IAPL — agent guide` | old markers | `iapl-skills` finds the old block and rewrites it in place; the doctor rule accepts both | +| Skills | `iapl-*` (16) | `ipal-*` | §3.6 | + +No warning at start and none in the panel: nobody notifies clients, and a line per process on eight sites is +noise. The only notice is one doctor rule, `legacy-names`, severity **info**, listing old names found in the +project with the new ones; a project silences it like any rule. It becomes a warning in the last 1.x minor +before 2.0. + +A side effect worth having: `ipal` and `iapl` differ by two swapped letters, so a typed `IPAL_…` for +`IAPL_…` is likely. With the fallback, either spelling works for every name that exists in both. + +### 3.4 Stays as it is until 2.0 + +| Thing | Why not now | +| --- | --- | +| Package name, import paths, import-map paths | §3.1 | +| Routes `/api/ipal/*` | old paths must be served anyway (cached pages and bundles, the crawler's call-back, `--sites` checks). A second set doubles twelve endpoints, some security-sensitive, with shared rate limits to prove; and if the client components moved to the new paths, any proxy, WAF or CDN rule keyed on `/api/ipal/` would silently stop matching. Those rules are outside the repository. | +| `--ipal-*` tokens | 99 variables in sites' own CSS. Declaring both names doubles the CSS, and a scope that re-maps only the old name (dark theme, inverse surface) would stop reaching components that read the new one. | +| `data-ipal*` hooks | sites' CSS selectors and tests | +| `custom.ipal.*`, `custom.ipal…` keys, `req.context` flags, 2FA view props | read by projects' hooks and by other plugins; a second key in each place is surface without benefit | +| Translation namespace `ipal` | projects' overrides live under it | +| `Symbol.for('ipal.*')` | must match an older copy of the package in the same process | +| `X-Ipal-Cookie-Crawler` | sites' WAF rules; the crawler is deployed separately | + +### 3.5 Stays for good, or needs its own decision + +- **Cookie `ipal_vid`: keep, also in 2.0.** Renaming it changes every site's cookie list and approved policy + (re-approval and, with a policy version bump, a new consent prompt for every visitor) and resets visitor + counts. It is an opaque technical name; the cookie table explains its purpose. +- **`ipal:2fa-verify:*` in `payload-kv`: keep.** Renaming resets every running attempt counter at deploy, + which hands an attacker one fresh window. +- **`ipal-theme`**: already only a legacy key that 1.x migrates away from; no action. + +### 3.6 What an agent sees, and how skills on existing projects are updated + +In the guide and skills of 1.17.0: + +- One section near the top of `AGENT.md`, "Names: IAPL and ipal-kit", with a single table: old name, new + name, state in 1.17.0 (renamed with alias / unchanged until 2.0 / unchanged). It is the only place old + aliases are listed. +- Everywhere else the guide uses **the name that is preferred on 1.17.0**: `iapl()`, `iapl-doctor`, + `IAPL_IP_HEADER`, `iapl-doctor.json`, and still `@intecion/ipal-kit/...`, `/api/ipal/...`, `--ipal-*`, + `data-ipal`. The guide never shows a name that does not work on the installed version. +- A rule for existing projects: **do not rename on your own.** Old names work; a project moves to the new + ones only when its owner asks, with the `iapl-upgrade` skill's "→ 1.17.0" section, which lists the optional + steps (run `iapl-skills`, rename `ipal-doctor.json`, scripts, Coolify env names) and says each can be + skipped. +- `test/docsConsistency.test.ts` keeps proving that every name the docs import exists; it gains a check that + the names table lists every alias the code exports and nothing else. + +Installed skills on an existing project: + +- Nothing changes by upgrading the package alone. The project keeps its 1.16 `ipal-*` folders and old pointer + block, exactly as after any upgrade today; the doctor rule `agents-md` already reports a pointer block older + than the installed version. +- Running `iapl-skills` (or `ipal-skills`, the same file) installs the 16 `iapl-*` folders, removes the 16 + old folders **by exact name from a fixed list** (not by the `ipal-` prefix, so a project's own + `ipal-something` skill is left alone), rewrites the pointer block in place, and keeps the `--dest`, + `--dry-run`, `--no-pointer` and `--external` behaviour. A second run changes nothing. +- Vendored `ext-*` skills: the installer recognises both "Vendored by @intecion/ipal-kit" and the new mark as + its own, so existing copies are still updated. +- Old skill names written into a project's `AGENTS.md` by hand are not touched; the `legacy-names` rule lists + them. + +## 4. Order of work and size + +Total: about five working sessions plus the integration gate. All on top of `619a4e0`. + +### 4.1 Steps + +| # | Step | Kind | Size | +| --- | --- | --- | --- | +| 1 | Owner answers §5 (spelling, package choice) | decision | — | +| 2 | Aliases in code: 10 exports, env helper, doctor config and marker readers, skip comment, `legacy-names` rule; tests for old and new names | by hand, small diff, full review | 1 session | +| 3 | Ten `bin` entries; `iapl-skills` (fixed retired list, both markers, both vendor marks); skill folders moved with `git mv` | by hand for the installer, mechanical for the move | 1 session | +| 4 | Brand text in `src` messages, docs, guide, skills: a scripted replace from an explicit list of forms, in its own commits, never touching class B and C strings | mechanical, reviewed by reading the list of remaining `ipal` forms | 1 session | +| 5 | Reference site and starter moved to the preferred names; skill copies and `INDEX.md` regenerated (`iapl-skills`, `pnpm reference:index`); starter bundle rebuilt | mechanical + generated | 0.5 session | +| 6 | Names table in `AGENT.md`, `iapl-upgrade` "→ 1.17.0", `PROGRAMISTA.md` row, changelog entry (merged with the prepared 1.16.8 entry), `CLAUDE.md` and `.gitea` workflow | by hand | 0.5 session | +| 7 | Gate additions (§4.3) | by hand | 1 session | + +Tests are **not** bulk-renamed. A test that uses an old name is the proof that the old name works; tests for +the new names are added beside them (parametrised where the body is the same). + +### 4.2 What needs a look on a built site, both bundlers + +- The plugin loaded as `iapl()` and as `ipalKit()`: panel opens, 2FA view, cookie tabs, stats view. +- The import map unchanged against 1.16.7 (`generate:importmap` gives no diff). +- CSS: nothing in `tokens.css`, `tailwind.css`, `fluid*.css`, `a11y.css` changed except comments. +- `iapl-tokens --check`, `iapl-doctor` and the old commands, run through `pnpm exec` and `npm exec`. +- Steps 4 and 5 are text and need no built site beyond the normal gate. + +### 4.3 What the integration gate adds + +1. **Old site, new plugin.** `reference/` as it was at tag `v1.16.7`, installed against the 1.17.0 build with + no edit: build with webpack and Turbopack, doctor without new errors, e2e. This is the "no break" proof. +2. **Alias identity.** Every old export is the same value as the new one; each env variable is read under + both names; both config file names; both markers; both skip comments. +3. **No schema change.** On Postgres and SQLite, a migration created against a 1.16.7 database is empty. +4. **Skills upgrade.** A folder holding the 1.16 skills, an own `ipal-custom` skill and an old pointer block: + after `iapl-skills` the 16 old folders are gone, 16 new ones present, `ipal-custom` untouched, the block + rewritten once, the second run a no-op. +5. **Leftover list.** A test that searches the tree for `ipal` and compares the distinct forms with an + allow-list (class B and C names, history files). A new old-name form fails the build; this also keeps later + branches from adding `ipal` names. +6. **Pack check.** The tarball has ten `bin` entries, the `iapl-*` skills and no `ipal-*` skill folder. + +### 4.4 Fit with the mail relay + +Order: the rename lands **before** the relay adapter is built. The relay branch +(`claude/mail-relay-design-059bb2`) is design only, so nothing has to be rebased except the proposal text. A +rename across 530 files conflicts with any code branch open at the same time; steps 3 to 5 run while no other +branch is in work. + +Born with the new name in the relay: + +| In the proposal | In 1.17.0 | +| --- | --- | +| Header `X-Ipal-Site` | `X-Iapl-Site` | +| "one plugin key" in `payload-kv` | `iapl:mail-relay` | +| Adapter name, log lines, user agent | `iapl-relay`, `[iapl]`, `iapl/` | +| Option `ipalKit({ mail: { relay } })` | documented as `iapl({ mail: { relay } })`; the option path has no brand in it | +| New exports | no brand prefix at all (`relayAdapter`, not `iaplRelayAdapter`); the fewer branded names, the less to rename ever again | +| Any env | none planned; if one appears, `IAPL_…` only, no old alias | +| Route `POST /api/ipal/mail-relay/confirm` | `POST /api/iapl/mail-relay/confirm`, if the site sends its call-back address in the enrolment request so the service hard-codes no path; the relay design should say so. It is then the one route under the new prefix until 2.0. If the service must know the path in advance, keep `/api/ipal/…` and move it with the others. | + +The shared service is also meant for IAWL, so its own names (`/v1/send`, `/v1/enrol`) should stay free of +either library's name; they already are. + +## 5. Questions for the owner + +| # | Question | Recommendation | +| --- | --- | --- | +| Q1 | Spelling and casing | Prose **IAPL**; code, package, commands, routes, files `iapl`; types `Iapl…`; env and constants `IAPL_…`. The plugin function is `iapl()`. | +| Q2 | What the letters stand for (the package description says "Intecion Payload Advanced Library", which spells IPAL) | "Intecion Advanced Payload Library", matching IAWL; to confirm | +| Q3 | Package name in 1.17.0 | Keep `@intecion/ipal-kit` through 1.x; `@intecion/iapl` in 2.0 (§3.1 A). If new sites must carry the new name sooner: dual publish for new sites only (C). | +| Q4 | New package name | `@intecion/iapl` (no `-kit`) | +| Q5 | Gitea repository and local folder | Rename the repository to `IntecionSoftware/iapl` **after** 1.17.0 is published, in a quiet moment; the registry address is per organisation and does not change. Rename the local folder last, with no session running, and move the Claude memory folder with it. | +| Q6 | Routes in 1.x | Unchanged; only the new relay route is born under `/api/iapl/` (§4.4). | +| Q7 | `legacy-names` doctor rule | Info in 1.17.0, warning in the last 1.x minor, no runtime warning at any point. | +| Q8 | Rewrite history files | No; old changelog entries keep the old name, with one line at the top. | +| Q9 | What 2.0 finally removes | Removed: the old package name (a last 1.x release stays installable; optionally a stub that fails with a pointer), `ipalKit` and the 9 old exports, the 5 old commands, `IPAL_*` env fallback, `ipal-doctor.json`, old markers and skip comment, `/api/ipal/*` as the primary prefix (kept as an alias for one more major, because of proxies and the crawler), `custom.ipal` and the context flags (2.0 reads both for one major), the `ipal` translation namespace (both read for one major). `--ipal-*` and `data-ipal*`: renamed in 2.0 by a codemod in the upgrade skill, or kept permanently as a plain prefix; decide in the 2.0 plan. **Never renamed:** `ipal_vid`, `ipal:2fa-verify:*`. | +| Q10 | Env aliases at all, given that settings are moving to the panel | Yes: one helper, cheap, and it makes the swapped-letter typo harmless. No new env is added for the rename. | + +## 6. What I could not determine + +- **The eight sites themselves.** Not opened, by instruction. Unknown: whether any filters logs on `[ipal]`, + has proxy, WAF or CDN rules on `/api/ipal/*` or on `X-Ipal-Cookie-Crawler`, calls the commands from Coolify + build settings, names the package in `next.config` (`transpilePackages` and the like), has its own + `ipal-…` skill, or runs `ipal-skills` after upgrades. +- **Coolify.** Which `IPAL_*` variables are set where. +- **Gitea.** That a renamed repository keeps redirecting the old git address, and that a package published + under a new name needs no registry setting: both expected from how Gitea works, neither checked on this + server. Whether CI runners or deploy keys refer to the repository by name. +- **Option B on a real build.** The risks in §3.1 are reasoned from the package layout, not measured; nothing + was built. +- **IAWL's naming** (package, commands, env prefix): not read, so "matching IAWL" in Q1, Q2 and Q4 is to be + confirmed against it. +- **The docs address scheme on intecion.com**: not fixed yet; it should use `iapl` from the start. +- **The relay's call-back address**: whether the site sends it or the service builds it (§4.4) is not settled + in the proposal as read. +- **Panel texts that show the name to clients**: the translation files themselves contain no `ipal`; the + name appears in component messages, not counted separately from other `src` text. +- **The date of 2.0**, which decides how long the old names live.