From d26472ceefcbff70facbca8b50d328f5e3b0ffa8 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 14 Nov 2026 16:26:30 +0000 Subject: [PATCH 1/5] fix(plugin-email): the email template send judges the served holders When a holder of a template name is disabled, the send resolves the name over the served holders, so a disabled package is never the answer and a refusal names only the packages that serve the name. The answer is only ever an address whose list holds no member of a disabled holder's side: the resolved served holder's own address, the environment-wide list for the environment's own item, or no template when the caller's own holding is the disabled one or no served holder answers it. With no holder disabled, every read is the one it was. Claude-Session: https://claude.ai/code/session_016WV4cyrFFk86Jqf7Mp5Rzw Co-authored-by: Claude --- packages/plugins/plugin-email/package.json | 1 + .../plugin-email/src/template-loader.ts | 107 +++++++++++++++--- pnpm-lock.yaml | 3 + 3 files changed, 95 insertions(+), 16 deletions(-) diff --git a/packages/plugins/plugin-email/package.json b/packages/plugins/plugin-email/package.json index eed22ad9dcb..35779f041fc 100644 --- a/packages/plugins/plugin-email/package.json +++ b/packages/plugins/plugin-email/package.json @@ -35,6 +35,7 @@ }, "devDependencies": { "@objectstack/driver-sql": "workspace:*", + "@objectstack/metadata-protocol": "workspace:*", "@objectstack/service-queue": "workspace:*", "@objectstack/service-settings": "workspace:*", "@types/node": "^26.6.5", diff --git a/packages/plugins/plugin-email/src/template-loader.ts b/packages/plugins/plugin-email/src/template-loader.ts index 89aadee3907..8bb781c65c9 100644 --- a/packages/plugins/plugin-email/src/template-loader.ts +++ b/packages/plugins/plugin-email/src/template-loader.ts @@ -143,6 +143,18 @@ function packageScopedRegistryOf(registry: EmailTemplateRegistrySources['registr : undefined; } +/** + * [#32670] The answer that sends no template: the send finds nothing, and no + * list is read. + */ +const NO_BUNDLE = Symbol('no bundle'); + +/** + * Where a bundle is read: a package's own address (the list scoped to it), + * the environment-wide list (`undefined`), or nowhere ({@link NO_BUNDLE}). + */ +type BundleAddress = string | undefined | typeof NO_BUNDLE; + /** * [ADR-0150 D3/D9, #31699] The package whose own address the bundle of `name` * is read at, for a send made from `callerPackageId`; `undefined` to read the @@ -156,36 +168,97 @@ function packageScopedRegistryOf(registry: EmailTemplateRegistrySources['registr * which holds no name for anyone else) meets its base: the name is resolved * again from its closure over the holders every other reader sees. * - * [ADR-0150 D3, #32183] Every read here counts every holder, a disabled - * package's included (`includeDisabledPackages`): the address and the - * refusal never move with a reversible disable. The door reads a flat list - * after the resolve, so judging the served holders here would hand a send - * another package's body; until #32670 lands, a disabled package still - * counts at the send and a refusal still names it, as before. + * [ADR-0150 D3, #32183, #32670] A disabled package holds no name at the send. + * When no holder of the name is disabled, the reads below are the ones they + * were: the served holders ARE every holder. When one is, the name is judged + * over the served holders ({@link servedBundleAddressOf}). */ -function bundleAddressOf(scoped: PackageScopedRegistry, name: string, callerPackageId: string | null): string | undefined { +function bundleAddressOf(scoped: PackageScopedRegistry, name: string, callerPackageId: string | null): BundleAddress { + const holdersOf = (options?: { includeDisabledPackages: true }) => + (scoped.packageScopedHoldersOf(EMAIL_TEMPLATE_TYPE, name, null, options) ?? []) + .filter((id) => id !== BUILTIN_EMAIL_TEMPLATES_PACKAGE_ID); + const holders = holdersOf({ includeDisabledPackages: true }); + const served = holdersOf(); + if (served.length < holders.length) return servedBundleAddressOf(scoped, name, callerPackageId, served, holders); const resolved = resolvePackageScopedName(scoped, { type: EMAIL_TEMPLATE_TYPE, name, callerPackageId, includeDisabledPackages: true, }); if (resolved.status === 'refused') throw new EmailTemplateAmbiguousError(resolved); if (resolved.status !== 'resolved' || resolved.holder.kind !== 'package') return undefined; - const holders = (scoped.packageScopedHoldersOf(EMAIL_TEMPLATE_TYPE, name, null, { includeDisabledPackages: true }) ?? []) - .filter((id) => id !== BUILTIN_EMAIL_TEMPLATES_PACKAGE_ID); if (holders.length < 2) return undefined; const holder = resolved.holder.packageId; if (holders.includes(holder)) return holder; // The caller holds an addition only: resolve from its closure over the // holders every other reader sees (its own addition left out). - const shared: PackageScopedRegistry = { + const base = resolvePackageScopedName(withoutCallerHolding(scoped, { includeDisabledPackages: true }), { + type: EMAIL_TEMPLATE_TYPE, name, callerPackageId, + }); + if (base.status === 'refused') throw new EmailTemplateAmbiguousError(base); + return base.status === 'resolved' && base.holder.kind === 'package' ? base.holder.packageId : undefined; +} + +/** + * [ADR-0150 D3, #32670] The address of a name one of whose holders is + * disabled: judged over the served holders, so a disabled package is never + * the answer, and a refusal names only the packages that serve the name. + * + * The answer is only ever a list that holds no member of a disabled holder's + * side, because the environment-wide list does: a row its customization pair + * stores and a locale a dependent adds to it stay listed there, and their + * envelope (`_packageId`) is the slot they fill, not the package they are + * stored under, so no member can be filtered out after the read. So: + * + * - the name resolves to a served holder: that holder's own address (its + * members, its pair's rows, its environment overlay), the list a name two + * holders hold was already read at; + * - the name resolves to the environment's own item: the environment-wide + * list, as before (the caller has no package, and the bare-name meaning + * is unchanged); + * - the caller's own holding is the disabled one, or no served holder + * answers it: no template. Its own items are withheld, and no other + * holder's are its own; + * - the caller holds an addition only: resolved again from its closure over + * the served holders, so a dependent of a disabled base never gets a + * template from outside its closure. + */ +function servedBundleAddressOf( + scoped: PackageScopedRegistry, + name: string, + callerPackageId: string | null, + served: readonly string[], + holders: readonly string[], +): BundleAddress { + const resolved = resolvePackageScopedName(scoped, { type: EMAIL_TEMPLATE_TYPE, name, callerPackageId }); + if (resolved.status === 'refused') throw new EmailTemplateAmbiguousError(resolved); + if (resolved.status !== 'resolved') return NO_BUNDLE; + if (resolved.holder.kind !== 'package') return undefined; + const holder = resolved.holder.packageId; + if (holder === BUILTIN_EMAIL_TEMPLATES_PACKAGE_ID || served.includes(holder)) return holder; + if (holders.includes(holder)) return NO_BUNDLE; + const base = resolvePackageScopedName(withoutCallerHolding(scoped), { type: EMAIL_TEMPLATE_TYPE, name, callerPackageId }); + if (base.status === 'refused') throw new EmailTemplateAmbiguousError(base); + if (base.status !== 'resolved' || base.holder.kind !== 'package') return NO_BUNDLE; + const baseHolder = base.holder.packageId; + return baseHolder === BUILTIN_EMAIL_TEMPLATES_PACKAGE_ID || served.includes(baseHolder) ? baseHolder : NO_BUNDLE; +} + +/** + * The registry as every reader but the caller sees it: the holders of a name + * with no caller's own holding counted (a dependent's addition holds no name + * for anyone else). `options` reads every holder, a disabled package's + * included; without it, the served holders. + */ +function withoutCallerHolding( + scoped: PackageScopedRegistry, + options?: { includeDisabledPackages: true }, +): PackageScopedRegistry { + return { getPackage: (id) => scoped.getPackage(id), getAllPackages: () => scoped.getAllPackages(), getPackageScopedItem: (type, n, packageId, member) => scoped.getPackageScopedItem(type, n, packageId, member), getEnvironmentScopedItem: (type, n, member) => scoped.getEnvironmentScopedItem(type, n, member), - packageScopedHoldersOf: (type, n) => scoped.packageScopedHoldersOf(type, n, null, { includeDisabledPackages: true }), + packageScopedHoldersOf: (type, n) => scoped.packageScopedHoldersOf(type, n, null, options), } as PackageScopedRegistry; - const base = resolvePackageScopedName(shared, { type: EMAIL_TEMPLATE_TYPE, name, callerPackageId }); - if (base.status === 'refused') throw new EmailTemplateAmbiguousError(base); - return base.status === 'resolved' && base.holder.kind === 'package' ? base.holder.packageId : undefined; } /** An item's locale as the bundle key reads it: the schema default when it declares none. */ @@ -263,10 +336,12 @@ export function createRegistryEmailTemplateLoader( // [ADR-0150 D3] The name first, from the package the send is made from (a // caller with no package when it names none). A refusal fails the send, // naming every candidate; a name two packages hold is read at the - // resolved holder's own address; any other answer leaves the bundle to the - // environment-wide read below, as before. + // resolved holder's own address; a send no served holder answers, beside a + // disabled holder, finds nothing (#32670); any other answer leaves the + // bundle to the environment-wide read below, as before. const scoped = packageScopedRegistryOf(registry); const address = scoped ? bundleAddressOf(scoped, name, options?.callerPackageId ?? null) : undefined; + if (address === NO_BUNDLE) return []; let items: unknown[]; if (typeof protocol?.getMetaItemsForExecution === 'function') { const listed = await protocol.getMetaItemsForExecution( diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index caee2b8d3a8..b0270b6b241 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2080,6 +2080,9 @@ importers: '@objectstack/driver-sql': specifier: workspace:* version: link:../../drivers/driver-sql + '@objectstack/metadata-protocol': + specifier: workspace:* + version: link:../../metadata-protocol '@objectstack/service-queue': specifier: workspace:* version: link:../../services/service-queue From b82d7730356586fe7b3a0006e2d66b96c976b9d2 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 14 Nov 2026 16:29:26 +0000 Subject: [PATCH 2/5] test(plugin-email): pin the send's answers with a disabled holder over a real stored pair row Replaces the parity pin (a disabled holder still counted at the send) with the declared answers: two holders with each set disabled, a dependent's addition enabled and disabled, one holder beside the environment's item (registered first or last) or a package-less stored row, and an auth name one package overrides, every caller class, en-US and fr-FR, both reads and both registration orders, over the protocol's execution list with a real stored customization-pair row. CONTROLs: nothing disabled; one holder. Claude-Session: https://claude.ai/code/session_016WV4cyrFFk86Jqf7Mp5Rzw Co-authored-by: Claude --- .../plugin-email/src/template-loader.test.ts | 431 +++++++++++++----- 1 file changed, 313 insertions(+), 118 deletions(-) diff --git a/packages/plugins/plugin-email/src/template-loader.test.ts b/packages/plugins/plugin-email/src/template-loader.test.ts index 3a19c133ba8..7bc0ff92849 100644 --- a/packages/plugins/plugin-email/src/template-loader.test.ts +++ b/packages/plugins/plugin-email/src/template-loader.test.ts @@ -32,6 +32,7 @@ import { describe, expect, it } from 'vitest'; import { SchemaRegistry } from '@objectstack/objectql'; +import { ObjectStackProtocolImplementation } from '@objectstack/metadata-protocol'; import { BUILTIN_EMAIL_TEMPLATES_PACKAGE_ID, EmailTemplateAmbiguousError, @@ -464,154 +465,348 @@ describe('createRegistryEmailTemplateLoader — the send resolves the name from }); /** - * [ADR-0150 D3, #32183, epic ruling R4-A] The send door counts every holder, a - * disabled package's included, so a reversible disable moves neither the - * address the door asks the list for nor the refusal it throws: the door - * answers as before this change. Judging the served holders here is #32670, - * because the door reads a flat list after the resolve. + * [ADR-0150 D3, #32670] A disabled package holds no name at the send. When a + * holder of the name is disabled, the name is resolved over the served + * holders, so a disabled package is never the answer and a refusal names only + * the packages that serve the name; and the bundle is read only where no + * member of a disabled holder's side is listed: the resolved holder's own + * address, or the environment-wide list for the environment's own item. A + * caller whose own holding is disabled, or that no served holder answers, + * finds no template. With no holder disabled, every answer is the one it was. * - * The parity pin: each state, in both registration orders and on both reads - * the loader takes, with every set of its holders disabled, gives every - * caller the same ask as the same registry with nothing disabled. The ask is - * spied, never the list's answer, so no stored row is needed: on the protocol - * read it is the request's address; on the registry read, a probe list (an - * environment-wide sentinel first, then one item per package) shows which - * address the loader kept. + * The world is real: a `SchemaRegistry`, the protocol's execution list over + * it with stored `sys_metadata` rows (ALPHA's customization pair `.custom` + * stores an fr-FR member), and a dependent (ADDER, depending on ALPHA only) + * adding fr-FR. Every case runs in both registration orders and on both reads + * the loader takes: the protocol's, and the registry's own list (which reads + * no stored row). Each caller is asked for en-US and fr-FR; an answer is the + * sent template's subject (who stores it, and its locale), `no template`, or + * the refusal with its candidates. The rows named per case are the PR's + * declaration table. */ -describe('createRegistryEmailTemplateLoader — a disabled holder still counts at the send (ADR-0150 D3, #32183)', () => { +describe('createRegistryEmailTemplateLoader — a disabled package holds no name at the send (ADR-0150 D3, #32670)', () => { const ALPHA = 'com.example.alpha'; const BETA = 'com.example.beta'; const BOTH = 'com.example.both'; - const VIA_BETA = 'com.example.viabeta'; + const VIA_ALPHA = 'com.example.viaalpha'; const NEITHER = 'com.example.neither'; - const DEPENDENT = 'com.example.dependent'; - const PACKAGES: Array<[string, string[]]> = [ - [ALPHA, []], [BETA, []], [BOTH, [ALPHA, BETA]], [VIA_BETA, [BETA]], [NEITHER, []], [DEPENDENT, [ALPHA]], - ]; - /** None (omitted, null), each holder, a closure holding both, a closure through BETA only, neither, the dependent. */ + const ADDER = 'com.example.adder'; + const PAIR = `${ALPHA}.custom`; + const BUILTIN = BUILTIN_EMAIL_TEMPLATES_PACKAGE_ID; + const AUTH_NAME = 'auth.password_reset'; + const SHORT: Record = { + [ALPHA]: 'ALPHA', [BETA]: 'BETA', [ADDER]: 'ADDER', [BUILTIN]: 'BUILTIN', + }; + /** None (omitted, null), each holder, a closure holding both, a closure through ALPHA only, neither, the dependent, the built-in package. */ const CALLERS: ReadonlyArray<[string, string | null | undefined]> = [ ['omitted', undefined], ['null', null], ['ALPHA', ALPHA], ['BETA', BETA], ['BOTH', BOTH], - ['VIA_BETA', VIA_BETA], ['NEITHER', NEITHER], ['DEPENDENT', DEPENDENT], - ]; - /** The `welcome` members each state ships, as `[package, locale]`; the dependent's is an added locale. */ - const STATES: Array<[string, Array<[string, string]>]> = [ - ['one holder', [[ALPHA, 'en-US']]], - ['one holder and a dependent\'s addition', [[ALPHA, 'en-US'], [DEPENDENT, 'fr-FR']]], - ['two holders', [[ALPHA, 'en-US'], [BETA, 'en-US']]], - ['two holders and a dependent\'s addition', [[ALPHA, 'en-US'], [BETA, 'en-US'], [DEPENDENT, 'fr-FR']]], + ['VIA_ALPHA', VIA_ALPHA], ['NEITHER', NEITHER], ['ADDER', ADDER], ['BUILTIN', BUILTIN], ]; const ORDERS: Array<[string, boolean]> = [['as listed', false], ['reversed', true]]; const READS = ['protocol', 'registry'] as const; - const ENVIRONMENT_WIDE = 'environment-wide'; - /** A real registry: PACKAGES installed and `shipped` registered in order (or reversed), then `disabled` disabled. */ - function registryOf(shipped: Array<[string, string]>, reversed: boolean, disabled: readonly string[]): SchemaRegistry { - const reg = new SchemaRegistry(); + type State = { + holders: string[]; + besideRow: 'none' | 'environment item first' | 'environment item last' | 'stored row'; + adderDisabled: boolean; + auth: boolean; + }; + const STATES: Record = { + 'two holders': { holders: [ALPHA, BETA], besideRow: 'none', adderDisabled: false, auth: false }, + 'two holders, the dependent disabled': { holders: [ALPHA, BETA], besideRow: 'none', adderDisabled: true, auth: false }, + 'one holder beside the environment\'s item, registered first': { holders: [ALPHA], besideRow: 'environment item first', adderDisabled: false, auth: false }, + 'one holder beside the environment\'s item, registered last': { holders: [ALPHA], besideRow: 'environment item last', adderDisabled: false, auth: false }, + 'one holder beside a package-less stored row': { holders: [ALPHA], besideRow: 'stored row', adderDisabled: false, auth: false }, + 'an auth name one package overrides': { holders: [ALPHA], besideRow: 'stored row', adderDisabled: false, auth: true }, + }; + + // The engine double the protocol reads `sys_metadata` through: equality + // and `$in`, and nothing else — any other operator is refused loudly. It + // carries no write verb: the send writes nothing. + const matches = (row: AnyRecord, where: AnyRecord | undefined) => Object.entries(where ?? {}).every(([k, v]) => { + if (k.startsWith('$')) throw new Error(`engine double: logical operator ${k} is not implemented`); + if (v !== null && typeof v === 'object') { + if (Object.keys(v).join() !== '$in' || !Array.isArray(v.$in)) throw new Error(`engine double: operator ${Object.keys(v).join(', ')} is not implemented`); + return (v.$in as unknown[]).includes(row[k]); + } + return (row[k] ?? null) === v; + }); + + /** The registry and the protocol over it, with `disabled` disabled. */ + function worldOf(state: State, disabled: readonly string[], reversed: boolean) { + const name = state.auth ? AUTH_NAME : 'welcome'; + const rows: AnyRecord[] = []; + const reg = new SchemaRegistry({ multiTenant: false } as never); reg.logLevel = 'silent'; - const packages = reversed ? [...PACKAGES].reverse() : PACKAGES; - for (const [id, deps] of packages) { + const packages: Array<[string, string[]]> = [ + [ALPHA, []], [BETA, []], [BOTH, [ALPHA, BETA]], [VIA_ALPHA, [ALPHA]], [NEITHER, []], [ADDER, [ALPHA]], [PAIR, []], [BUILTIN, []], + ]; + for (const [id, deps] of reversed ? [...packages].reverse() : packages) { reg.installPackage({ - id, name: id, version: '1.0.0', type: 'app', namespace: id.split('.').pop(), + id, name: id, version: '1.0.0', type: 'app', namespace: id.split('.').pop()!, ...(deps.length ? { dependencies: Object.fromEntries(deps.map((d) => [d, '^1.0.0'])) } : {}), } as never, 'code'); } - for (const [id, locale] of reversed ? [...shipped].reverse() : shipped) { - reg.registerItem('email_template', { - name: 'welcome', label: 'Welcome', locale, subject: `${id} ${locale}`, bodyHtml: '

hi

', - }, 'name' as never, id); - } + const ship = (packageId: string | undefined, locale: string, subject: string) => () => reg.registerItem('email_template', { + name, label: subject, locale, subject, bodyHtml: '

x

', ...(packageId === undefined ? { _provenance: 'org' } : {}), + }, 'name' as never, packageId as never); + const shipped = [ + ...(state.besideRow === 'environment item first' ? [ship(undefined, 'en-US', 'ENV en-US')] : []), + ...(state.auth ? [ship(BUILTIN, 'en-US', 'BUILTIN en-US'), ship(BUILTIN, 'fr-FR', 'BUILTIN fr-FR')] : []), + ...state.holders.map((id) => ship(id, 'en-US', `${SHORT[id]} en-US`)), + ship(ADDER, 'fr-FR', 'ADDER fr-FR'), + ...(state.besideRow === 'environment item last' ? [ship(undefined, 'en-US', 'ENV en-US')] : []), + ]; + for (const register of reversed ? [...shipped].reverse() : shipped) register(); + const stored = (id: string, packageId: string | null, subject: string) => ({ + id, type: 'email_template', name, state: 'active', package_id: packageId, bundle_member: 'fr-FR', + metadata: JSON.stringify({ name, label: subject, locale: 'fr-FR', subject, bodyHtml: '

s

' }), + }); + rows.push(stored('row_pair', PAIR, 'PAIR fr-FR')); + if (state.besideRow === 'stored row') rows.push(stored('row_env', null, 'STORED fr-FR')); + if (reversed) rows.reverse(); for (const id of disabled) reg.disablePackage(id); - return reg; - } - - /** Every non-empty set of `ids`. */ - function nonEmptySets(ids: readonly string[]): string[][] { - return ids.reduce((sets, id) => [...sets, ...sets.map((s) => [...s, id]), [id]], []) - .sort((a, b) => a.length - b.length); + if (state.adderDisabled) reg.disablePackage(ADDER); + const pick = (opts?: { where?: AnyRecord; limit?: number }) => rows.filter((r) => matches(r, opts?.where)).slice(0, opts?.limit ?? rows.length); + const engine = { + registry: reg, + find: async (_object: string, opts?: { where?: AnyRecord; limit?: number }) => pick(opts), + findOne: async (_object: string, opts?: { where?: AnyRecord }) => pick(opts)[0] ?? null, + count: async () => 0, + aggregate: async () => [], + }; + return { name, reg, protocol: new ObjectStackProtocolImplementation(engine as never) }; } - type Ask = { address: string | null } | { refused: number; candidates: string[]; message: string }; - - /** What the door asks for one caller: the list's address (`null`: the environment-wide list), or its refusal. */ - async function askOf(reg: SchemaRegistry, read: (typeof READS)[number], caller: string | null | undefined): Promise { - const requested: Array = []; - const probe = [ - { name: 'welcome', label: 'Welcome', subject: ENVIRONMENT_WIDE, bodyHtml: '

e

' }, - ...PACKAGES.map(([id]) => ({ name: 'welcome', label: 'Welcome', subject: id, bodyHtml: '

p

', _packageId: id })), - ]; - const scoped = Object.fromEntries((['getPackage', 'getAllPackages', 'packageScopedHoldersOf', 'getPackageScopedItem', 'getEnvironmentScopedItem'] as const) - .map((method) => [method, (reg[method] as (...args: unknown[]) => unknown).bind(reg)])); - const loader = createRegistryEmailTemplateLoader(read === 'protocol' - ? { - registry: reg, - protocol: { - async getMetaItemsForExecution(request: { type: string; packageId?: string }) { - requested.push(request.packageId ?? null); - return { items: [] }; - }, - }, - } - : { registry: { ...scoped, listItems: () => probe.map((i) => ({ ...i })) } as never }); + /** One send's answer: the sent subject, `no template`, or the refusal and its candidates. */ + async function answerOf(loader: ReturnType, name: string, caller: string | null | undefined, locale: string): Promise { try { - const row = await loader.load('welcome', 'en-US', caller === undefined ? undefined : { callerPackageId: caller }); - if (read === 'protocol') { - expect(requested).toHaveLength(1); - return { address: requested[0] }; - } - return { address: row?.subject === ENVIRONMENT_WIDE ? null : (row?.subject ?? 'NO ROW') }; + const row = await loader.load(name, locale, caller === undefined ? undefined : { callerPackageId: caller }); + return row?.subject ?? 'no template'; } catch (e) { if (!(e instanceof EmailTemplateAmbiguousError)) throw e; - expect(requested).toEqual([]); - return { - refused: e.status, - candidates: e.candidates.map((c) => (c.kind === 'package' ? c.packageId : c.kind)), - message: e.message, - }; + expect([e.code, e.status]).toEqual(['RESOURCE_CONFLICT', 409]); + const candidates = e.candidates.map((c) => (c.kind === 'package' ? SHORT[c.packageId] ?? c.packageId : c.kind)).sort(); + return `409 ${e.message.includes('outside') ? 'outside-closure ' : ''}[${candidates.join(',')}]`; } } - const asksOf = async (reg: SchemaRegistry, read: (typeof READS)[number]) => { - const asks: Record = {}; - for (const [label, caller] of CALLERS) asks[label] = await askOf(reg, read, caller); - return asks; - }; - - /** The asks with nothing disabled, as `main` answers them (refusal candidates sorted, message left out). */ - const refused = (...candidates: string[]) => ({ refused: 409, candidates: [...candidates].sort() }); - const at = (address: string | null) => ({ address }); - const ONE_HOLDER = { - omitted: at(null), null: at(null), ALPHA: at(null), BETA: refused(ALPHA), BOTH: at(null), - VIA_BETA: refused(ALPHA), NEITHER: refused(ALPHA), DEPENDENT: at(null), - }; - const TWO_HOLDERS = { - omitted: refused(ALPHA, BETA), null: refused(ALPHA, BETA), ALPHA: at(ALPHA), BETA: at(BETA), - BOTH: refused(ALPHA, BETA), VIA_BETA: at(BETA), NEITHER: refused(ALPHA, BETA), DEPENDENT: at(ALPHA), - }; - /** A dependent's addition holds no name for anyone else, so it moves no ask. */ - const MAIN = (state: string) => (state.startsWith('one holder') ? ONE_HOLDER : TWO_HOLDERS); + type Answers = Record; + /** Per caller, the en-US and the fr-FR answer; `registry` lists only the callers whose registry-read answer differs. */ + const CASES: Array<{ state: string; disabled: string[]; protocol: Answers; registry?: Partial }> = [ + { // CONTROL: nothing disabled + state: 'two holders', disabled: [], + protocol: { + omitted: ['409 [ALPHA,BETA]', '409 [ALPHA,BETA]'], + null: ['409 [ALPHA,BETA]', '409 [ALPHA,BETA]'], + ALPHA: ['ALPHA en-US', 'PAIR fr-FR'], + BETA: ['BETA en-US', 'no template'], + BOTH: ['409 [ALPHA,BETA]', '409 [ALPHA,BETA]'], + VIA_ALPHA: ['ALPHA en-US', 'PAIR fr-FR'], + NEITHER: ['409 outside-closure [ALPHA,BETA]', '409 outside-closure [ALPHA,BETA]'], + ADDER: ['ALPHA en-US', 'PAIR fr-FR'], + BUILTIN: ['409 outside-closure [ALPHA,BETA]', '409 outside-closure [ALPHA,BETA]'], + }, + registry: { + ALPHA: ['ALPHA en-US', 'no template'], + VIA_ALPHA: ['ALPHA en-US', 'no template'], + ADDER: ['ALPHA en-US', 'no template'], + }, + }, + { // rows 27-30 and 36 + state: 'two holders', disabled: [ALPHA], + protocol: { + omitted: ['BETA en-US', 'no template'], + null: ['BETA en-US', 'no template'], + ALPHA: ['no template', 'no template'], + BETA: ['BETA en-US', 'no template'], + BOTH: ['BETA en-US', 'no template'], + VIA_ALPHA: ['409 outside-closure [BETA]', '409 outside-closure [BETA]'], + NEITHER: ['409 outside-closure [BETA]', '409 outside-closure [BETA]'], + ADDER: ['409 outside-closure [BETA]', '409 outside-closure [BETA]'], + BUILTIN: ['409 outside-closure [BETA]', '409 outside-closure [BETA]'], + }, + }, + { // rows 27, 28 and 30, the pair's row the enabled holder's own + state: 'two holders', disabled: [BETA], + protocol: { + omitted: ['ALPHA en-US', 'PAIR fr-FR'], + null: ['ALPHA en-US', 'PAIR fr-FR'], + ALPHA: ['ALPHA en-US', 'PAIR fr-FR'], + BETA: ['no template', 'no template'], + BOTH: ['ALPHA en-US', 'PAIR fr-FR'], + VIA_ALPHA: ['ALPHA en-US', 'PAIR fr-FR'], + NEITHER: ['409 outside-closure [ALPHA]', '409 outside-closure [ALPHA]'], + ADDER: ['ALPHA en-US', 'PAIR fr-FR'], + BUILTIN: ['409 outside-closure [ALPHA]', '409 outside-closure [ALPHA]'], + }, + registry: { + omitted: ['ALPHA en-US', 'no template'], + null: ['ALPHA en-US', 'no template'], + ALPHA: ['ALPHA en-US', 'no template'], + BOTH: ['ALPHA en-US', 'no template'], + VIA_ALPHA: ['ALPHA en-US', 'no template'], + ADDER: ['ALPHA en-US', 'no template'], + }, + }, + { // rows 31 and 36 + state: 'two holders', disabled: [ALPHA, BETA], + protocol: { + omitted: ['no template', 'no template'], + null: ['no template', 'no template'], + ALPHA: ['no template', 'no template'], + BETA: ['no template', 'no template'], + BOTH: ['no template', 'no template'], + VIA_ALPHA: ['no template', 'no template'], + NEITHER: ['no template', 'no template'], + ADDER: ['no template', 'no template'], + BUILTIN: ['no template', 'no template'], + }, + }, + { // rows 27-30 and 36, the addition disabled + state: 'two holders, the dependent disabled', disabled: [ALPHA], + protocol: { + omitted: ['BETA en-US', 'no template'], + null: ['BETA en-US', 'no template'], + ALPHA: ['no template', 'no template'], + BETA: ['BETA en-US', 'no template'], + BOTH: ['BETA en-US', 'no template'], + VIA_ALPHA: ['409 outside-closure [BETA]', '409 outside-closure [BETA]'], + NEITHER: ['409 outside-closure [BETA]', '409 outside-closure [BETA]'], + ADDER: ['409 outside-closure [BETA]', '409 outside-closure [BETA]'], + BUILTIN: ['409 outside-closure [BETA]', '409 outside-closure [BETA]'], + }, + }, + { // row 37 + state: 'one holder beside the environment\'s item, registered first', disabled: [ALPHA], + protocol: { + omitted: ['no template', 'no template'], + null: ['no template', 'no template'], + ALPHA: ['no template', 'no template'], + BETA: ['no template', 'no template'], + BOTH: ['no template', 'no template'], + VIA_ALPHA: ['no template', 'no template'], + NEITHER: ['no template', 'no template'], + ADDER: ['no template', 'no template'], + BUILTIN: ['no template', 'no template'], + }, + }, + { // row 37 + state: 'one holder beside the environment\'s item, registered last', disabled: [ALPHA], + protocol: { + omitted: ['no template', 'no template'], + null: ['no template', 'no template'], + ALPHA: ['no template', 'no template'], + BETA: ['no template', 'no template'], + BOTH: ['no template', 'no template'], + VIA_ALPHA: ['no template', 'no template'], + NEITHER: ['no template', 'no template'], + ADDER: ['no template', 'no template'], + BUILTIN: ['no template', 'no template'], + }, + }, + { // CONTROL: one holder + state: 'one holder beside a package-less stored row', disabled: [], + protocol: { + omitted: ['ALPHA en-US', 'STORED fr-FR'], + null: ['ALPHA en-US', 'STORED fr-FR'], + ALPHA: ['ALPHA en-US', 'STORED fr-FR'], + BETA: ['409 outside-closure [ALPHA]', '409 outside-closure [ALPHA]'], + BOTH: ['ALPHA en-US', 'STORED fr-FR'], + VIA_ALPHA: ['ALPHA en-US', 'STORED fr-FR'], + NEITHER: ['409 outside-closure [ALPHA]', '409 outside-closure [ALPHA]'], + ADDER: ['ALPHA en-US', 'STORED fr-FR'], + BUILTIN: ['409 outside-closure [ALPHA]', '409 outside-closure [ALPHA]'], + }, + registry: { + omitted: ['ALPHA en-US', 'ADDER fr-FR'], + null: ['ALPHA en-US', 'ADDER fr-FR'], + ALPHA: ['ALPHA en-US', 'ADDER fr-FR'], + BOTH: ['ALPHA en-US', 'ADDER fr-FR'], + VIA_ALPHA: ['ALPHA en-US', 'ADDER fr-FR'], + ADDER: ['ALPHA en-US', 'ADDER fr-FR'], + }, + }, + { // row 37 + state: 'one holder beside a package-less stored row', disabled: [ALPHA], + protocol: { + omitted: ['no template', 'no template'], + null: ['no template', 'no template'], + ALPHA: ['no template', 'no template'], + BETA: ['no template', 'no template'], + BOTH: ['no template', 'no template'], + VIA_ALPHA: ['no template', 'no template'], + NEITHER: ['no template', 'no template'], + ADDER: ['no template', 'no template'], + BUILTIN: ['no template', 'no template'], + }, + }, + { // CONTROL: an auth name + state: 'an auth name one package overrides', disabled: [], + protocol: { + omitted: ['ALPHA en-US', 'STORED fr-FR'], + null: ['ALPHA en-US', 'STORED fr-FR'], + ALPHA: ['ALPHA en-US', 'STORED fr-FR'], + BETA: ['ALPHA en-US', 'STORED fr-FR'], + BOTH: ['ALPHA en-US', 'STORED fr-FR'], + VIA_ALPHA: ['ALPHA en-US', 'STORED fr-FR'], + NEITHER: ['ALPHA en-US', 'STORED fr-FR'], + ADDER: ['409 [ADDER,ALPHA]', '409 [ADDER,ALPHA]'], + BUILTIN: ['ALPHA en-US', 'STORED fr-FR'], + }, + registry: { + omitted: ['ALPHA en-US', 'ADDER fr-FR'], + null: ['ALPHA en-US', 'ADDER fr-FR'], + ALPHA: ['ALPHA en-US', 'ADDER fr-FR'], + BETA: ['ALPHA en-US', 'ADDER fr-FR'], + BOTH: ['ALPHA en-US', 'ADDER fr-FR'], + VIA_ALPHA: ['ALPHA en-US', 'ADDER fr-FR'], + NEITHER: ['ALPHA en-US', 'ADDER fr-FR'], + BUILTIN: ['ALPHA en-US', 'ADDER fr-FR'], + }, + }, + { // row 38 + state: 'an auth name one package overrides', disabled: [ALPHA], + protocol: { + omitted: ['BUILTIN en-US', 'STORED fr-FR'], + null: ['BUILTIN en-US', 'STORED fr-FR'], + ALPHA: ['no template', 'no template'], + BETA: ['BUILTIN en-US', 'STORED fr-FR'], + BOTH: ['BUILTIN en-US', 'STORED fr-FR'], + VIA_ALPHA: ['BUILTIN en-US', 'STORED fr-FR'], + NEITHER: ['BUILTIN en-US', 'STORED fr-FR'], + ADDER: ['BUILTIN en-US', 'STORED fr-FR'], + BUILTIN: ['BUILTIN en-US', 'STORED fr-FR'], + }, + registry: { + omitted: ['BUILTIN en-US', 'BUILTIN fr-FR'], + null: ['BUILTIN en-US', 'BUILTIN fr-FR'], + BETA: ['BUILTIN en-US', 'BUILTIN fr-FR'], + BOTH: ['BUILTIN en-US', 'BUILTIN fr-FR'], + VIA_ALPHA: ['BUILTIN en-US', 'BUILTIN fr-FR'], + NEITHER: ['BUILTIN en-US', 'BUILTIN fr-FR'], + ADDER: ['BUILTIN en-US', 'BUILTIN fr-FR'], + BUILTIN: ['BUILTIN en-US', 'BUILTIN fr-FR'], + }, + }, + ]; describe.each(READS)('read: %s', (read) => { - describe.each(STATES)('%s', (state, shipped) => { - describe.each(ORDERS)('registered %s', (_order, reversed) => { - it('CONTROL — nothing disabled: each caller\'s ask is main\'s', async () => { - const asks = await asksOf(registryOf(shipped, reversed, []), read); - const comparable = Object.fromEntries(Object.entries(asks).map(([label, ask]) => [label, - 'refused' in ask ? refused(...ask.candidates) : ask])); - expect(comparable).toEqual(MAIN(state)); - }); - - const holders = [...new Set(shipped.map(([id]) => id))]; - it.each(nonEmptySets(holders).map((set): [string, string[]] => [set.join(' + '), set]))( - '%s disabled: every caller asks the same address, or is refused the same, as with nothing disabled', - async (_label, disabled) => { - const enabled = await asksOf(registryOf(shipped, reversed, []), read); - expect(await asksOf(registryOf(shipped, reversed, disabled), read)).toEqual(enabled); - }, - ); - }); + describe.each(ORDERS)('registered %s', (_order, reversed) => { + it.each(CASES.map((c): [string, typeof c] => [`${c.state}, ${c.disabled.length ? `${c.disabled.map((id) => SHORT[id]).join(' + ')} disabled` : 'nothing disabled'}`, c]))( + '%s: every caller\'s answer', + async (_label, c) => { + const { name, reg, protocol } = worldOf(STATES[c.state], c.disabled, reversed); + const loader = createRegistryEmailTemplateLoader(read === 'protocol' ? { protocol, registry: reg } : { registry: reg }); + const answers: Answers = {}; + for (const [label, caller] of CALLERS) { + answers[label] = [await answerOf(loader, name, caller, 'en-US'), await answerOf(loader, name, caller, 'fr-FR')]; + } + expect(answers).toEqual(read === 'protocol' ? c.protocol : { ...c.protocol, ...c.registry }); + }, + ); }); }); - /** * [epic ruling R4-F] The built-in package as the caller, with nothing * disabled: a name the built-in and one package hold sends the package's From 26768975ca1111975e512d1ce34eadc72475bda3 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 14 Nov 2026 16:32:02 +0000 Subject: [PATCH 3/5] refactor(plugin-email): the built-ins reach their own address through the closure re-resolve The first check repeated what the re-resolve answers: a send resolved to the built-ins is resolved again over the served holders and read at the built-ins' own address. Ablating it moved no answer of the pins or of the probe matrix. Claude-Session: https://claude.ai/code/session_016WV4cyrFFk86Jqf7Mp5Rzw Co-authored-by: Claude --- packages/plugins/plugin-email/src/template-loader.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/plugins/plugin-email/src/template-loader.ts b/packages/plugins/plugin-email/src/template-loader.ts index 8bb781c65c9..bcb30648317 100644 --- a/packages/plugins/plugin-email/src/template-loader.ts +++ b/packages/plugins/plugin-email/src/template-loader.ts @@ -217,9 +217,11 @@ function bundleAddressOf(scoped: PackageScopedRegistry, name: string, callerPack * - the caller's own holding is the disabled one, or no served holder * answers it: no template. Its own items are withheld, and no other * holder's are its own; - * - the caller holds an addition only: resolved again from its closure over - * the served holders, so a dependent of a disabled base never gets a - * template from outside its closure. + * - the caller holds an addition only, or the name resolves to the + * built-ins: resolved again from the caller's closure over the served + * holders, so a dependent of a disabled base never gets a template from + * outside its closure; the built-ins are read at their own address, where + * no disabled package's member is listed either. */ function servedBundleAddressOf( scoped: PackageScopedRegistry, @@ -233,7 +235,7 @@ function servedBundleAddressOf( if (resolved.status !== 'resolved') return NO_BUNDLE; if (resolved.holder.kind !== 'package') return undefined; const holder = resolved.holder.packageId; - if (holder === BUILTIN_EMAIL_TEMPLATES_PACKAGE_ID || served.includes(holder)) return holder; + if (served.includes(holder)) return holder; if (holders.includes(holder)) return NO_BUNDLE; const base = resolvePackageScopedName(withoutCallerHolding(scoped), { type: EMAIL_TEMPLATE_TYPE, name, callerPackageId }); if (base.status === 'refused') throw new EmailTemplateAmbiguousError(base); From 7d1eb06d71a405c47b152ab6129ec2d9e9f74f74 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 14 Nov 2026 16:34:05 +0000 Subject: [PATCH 4/5] docs(changeset): declare the email send's moved answers (rows 27-31, 36-38) Claude-Session: https://claude.ai/code/session_016WV4cyrFFk86Jqf7Mp5Rzw Co-authored-by: Claude --- .changeset/32670-email-send-served-holders.md | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .changeset/32670-email-send-served-holders.md diff --git a/.changeset/32670-email-send-served-holders.md b/.changeset/32670-email-send-served-holders.md new file mode 100644 index 00000000000..51015271f91 --- /dev/null +++ b/.changeset/32670-email-send-served-holders.md @@ -0,0 +1,37 @@ +--- +'@objectstack/plugin-email': patch +--- + +fix(plugin-email)!: the email template send judges the served holders, so a disabled package holds no name at the send (ADR-0150 D3) + +Clause-②: yes (narrowing) — widened: a send of a template name an enabled and a disabled package hold, made with no package or from a caller whose closure holds both, is served the enabled holder's template where it was refused naming both. Narrowed: a send that only a disabled holder's side answered (its customization pair's row, a dependent's added locale, the environment's item or a package-less stored row beside a name only it holds) finds no template; a send of an auth name whose one overriding package is disabled is served the built-in copy. Refusals name only the packages that serve the name. With no holder of the name disabled, every answer is unchanged. +Metadata-protocol: none +Skills-docs: none — no skill under `skills/**` and no page under `content/docs/**` teaches what an email template send answers when a package holding the name is disabled. + +**BREAKING** for a send of an email template (`createRegistryEmailTemplateLoader`: the `sendTemplate` path and a flow's `notify` delivery) of a name a disabled package holds. Before, the send counted every holder, a disabled package's included: a disabled package was still the answer, and a refusal still named it. Now, when a holder of the name is disabled, the name is resolved over the served holders, and the bundle is read only where no member of a disabled holder's side is listed: the resolved holder's own address, or the built-ins' own address. A caller whose own holding is the disabled one, or that no served holder answers, finds no template. With no holder disabled, every read is the one it was. + +Why the read is chosen and never filtered: the environment-wide execution list keeps a disabled holder's customization-pair rows and a dependent's added locales listed, and an item's `_packageId` there is the slot it fills, not the package that stores it (a pair row filling a dependent's locale wears the dependent's id; the environment's item over a disabled holder's slot wears the disabled holder's), so no member can be told apart after the read. + +**Every moved answer, before → after.** Holders ALPHA and BETA; ALPHA's pair `ALPHA.custom` stores a member row; ADDER depends on ALPHA only and adds a locale. Both registration orders, the protocol's read and the registry's own read. First-party count 0: no first-party composition ships an email template name two packages hold, or disables a package that holds one. + +Widening: + +- Row 27. Two holders, one disabled, a send with no package (omitted or `null`): 409 naming both → the enabled holder's address (its template; a locale only the disabled side carries finds no template). +- Row 28. The same, from a caller whose closure holds both: 409 naming both → the enabled holder's address. + +Refused, the disabled package no longer named: + +- Row 29. Two holders, one disabled, a caller whose closure reaches the name only through the disabled holder (a dependent of it included): no template, or the disabled holder's pair row → 409 `outside-closure` naming the enabled holder. +- Row 30. Two holders, one disabled, a caller that reaches neither (the built-in package as caller included): 409 `outside-closure` naming both → naming the enabled holder. + +Served or refused → no template: + +- Row 31. Every holder disabled, every caller: 409 naming them, or the pair's row → no template. +- Row 36. Two holders, the disabled holder's own send: its pair's row → no template. +- Row 37. One holder, disabled, every caller: the environment's item, a package-less stored row, ADDER's locale or the pair's row (the environment-wide list), or 409 `outside-closure` naming it for a caller with no path → no template. + +Re-targeted to the built-in copy: + +- Row 38. An auth name (`auth.*`, platform-requested) whose one overriding package is disabled: every caller but that package → the built-ins' own address (the built-in template, or a package-less stored row there), where the environment-wide list sent the disabled package's side; ADDER's send, refused naming ADDER and the package → the same; the package's own send → no template. + +**Not moved.** A send of a name none of whose holders is disabled; a disabled dependent's addition beside enabled holders (the address it was read at already left it out); the enabled holder's own send beside a disabled holder (read at its address, as before, so its own pair row and a package-less stored row there are still its customization). The metadata reads (`/meta`, `?package=`, `_env`) and the lists are not touched. From 4419624c1a5eab1741ba6f47502180d001bd6b93 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 14 Nov 2026 17:13:34 +0000 Subject: [PATCH 5/5] test(plugin-email): pin the protocol double's findOne, alias the protocol to source, and answer the ADR-0087 question The engine double the send pins read stored rows through opens findOne with assertEngineFindOnePredicate, and the pinned ledger records it. The protocol the pins read through resolves to this checkout's source. The changeset says why no ADR-0087 entry is owed: every moved answer follows a package's enabled state. Claude-Session: https://claude.ai/code/session_016WV4cyrFFk86Jqf7Mp5Rzw Co-authored-by: Claude --- .changeset/32670-email-send-served-holders.md | 2 ++ packages/plugins/plugin-email/src/template-loader.test.ts | 7 +++++-- packages/plugins/plugin-email/vitest.config.ts | 7 +++++++ scripts/engine-double-contract.pinned.json | 5 +++++ 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/.changeset/32670-email-send-served-holders.md b/.changeset/32670-email-send-served-holders.md index 51015271f91..a5eb3b49a0a 100644 --- a/.changeset/32670-email-send-served-holders.md +++ b/.changeset/32670-email-send-served-holders.md @@ -8,6 +8,8 @@ Clause-②: yes (narrowing) — widened: a send of a template name an enabled an Metadata-protocol: none Skills-docs: none — no skill under `skills/**` and no page under `content/docs/**` teaches what an email template send answers when a package holding the name is disabled. + + **BREAKING** for a send of an email template (`createRegistryEmailTemplateLoader`: the `sendTemplate` path and a flow's `notify` delivery) of a name a disabled package holds. Before, the send counted every holder, a disabled package's included: a disabled package was still the answer, and a refusal still named it. Now, when a holder of the name is disabled, the name is resolved over the served holders, and the bundle is read only where no member of a disabled holder's side is listed: the resolved holder's own address, or the built-ins' own address. A caller whose own holding is the disabled one, or that no served holder answers, finds no template. With no holder disabled, every read is the one it was. Why the read is chosen and never filtered: the environment-wide execution list keeps a disabled holder's customization-pair rows and a dependent's added locales listed, and an item's `_packageId` there is the slot it fills, not the package that stores it (a pair row filling a dependent's locale wears the dependent's id; the environment's item over a disabled holder's slot wears the disabled holder's), so no member can be told apart after the read. diff --git a/packages/plugins/plugin-email/src/template-loader.test.ts b/packages/plugins/plugin-email/src/template-loader.test.ts index 7bc0ff92849..2bdfb8d981b 100644 --- a/packages/plugins/plugin-email/src/template-loader.test.ts +++ b/packages/plugins/plugin-email/src/template-loader.test.ts @@ -31,7 +31,7 @@ */ import { describe, expect, it } from 'vitest'; -import { SchemaRegistry } from '@objectstack/objectql'; +import { SchemaRegistry, assertEngineFindOnePredicate } from '@objectstack/objectql'; import { ObjectStackProtocolImplementation } from '@objectstack/metadata-protocol'; import { BUILTIN_EMAIL_TEMPLATES_PACKAGE_ID, @@ -571,7 +571,10 @@ describe('createRegistryEmailTemplateLoader — a disabled package holds no name const engine = { registry: reg, find: async (_object: string, opts?: { where?: AnyRecord; limit?: number }) => pick(opts), - findOne: async (_object: string, opts?: { where?: AnyRecord }) => pick(opts)[0] ?? null, + findOne: async (object: string, opts?: { where?: AnyRecord }) => { + assertEngineFindOnePredicate(object, opts as never); + return pick(opts)[0] ?? null; + }, count: async () => 0, aggregate: async () => [], }; diff --git a/packages/plugins/plugin-email/vitest.config.ts b/packages/plugins/plugin-email/vitest.config.ts index 1ac42902b3a..de82ad15acf 100644 --- a/packages/plugins/plugin-email/vitest.config.ts +++ b/packages/plugins/plugin-email/vitest.config.ts @@ -17,6 +17,13 @@ export default defineConfig({ find: /^@objectstack\/driver-sql$/, replacement: path.resolve(__dirname, '../../drivers/driver-sql/src/index.ts'), }, + // [ADR-0150 D3, #32670] `template-loader.test.ts` sends over the + // protocol's real execution list (stored customization-pair rows), so + // the protocol is this checkout's source too. + { + find: /^@objectstack\/metadata-protocol$/, + replacement: path.resolve(__dirname, '../../metadata-protocol/src/index.ts'), + }, ], }, test: { diff --git a/scripts/engine-double-contract.pinned.json b/scripts/engine-double-contract.pinned.json index 64d134c875a..08828f21f7f 100644 --- a/scripts/engine-double-contract.pinned.json +++ b/scripts/engine-double-contract.pinned.json @@ -4171,6 +4171,11 @@ "verb": "update", "pinned": 1 }, + { + "file": "packages/plugins/plugin-email/src/template-loader.test.ts", + "verb": "findOne", + "pinned": 1 + }, { "file": "packages/plugins/plugin-security/src/authored-row-write-verdict.test.ts", "verb": "delete",