Skip to content

Commit dd966fc

Browse files
fix(metadata)!: MetadataManager.loadMany takes a by-package name's bodies and packages off the loader's keyed entries; loadManyKeyed entries carry their package (#33299)
<!-- claude-projects-attribution: {"github_login":"os-elon-musk"} --> _Requested by **Elon** · [project thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9DDZYUbJbnXUTqZoZ56k4czR)_ Fixes #32680 Clause-②: yes (narrowing) Metadata-protocol: none Skills-docs: none — no skill teaches how `MetadataManager`'s plural reads stamp a loader's bodies or what `loadManyKeyed` entries carry; the moved answers live in the metadata service's internal read path. ## 维护者速读 - 改了什么:`MetadataManager.loadMany` 对按包存放的类型,直接用加载器 keyed 条目里每行自己的 body 和包戳,不再按内容把 `loadMany` 的 body 配回行;`loadManyKeyed` 返回的条目带上 `packageId`。 - 为什么改:两个包同名、另有一行 body 也写着这个名字时,旧的内容配对放弃打戳,启动预载把一个 body 放进裸槽,启动后裸读答出这个 body 而不是 409;加载器两次读序列化不同也会无声不打戳;调用方拿到两个同名条目分不清是哪个包。 - 风险与回滚:只影响接了 `DatabaseLoader` 的宿主(工作区内 0 处);该形状下启动后裸读由答一个 body 改为 409 点名两个包(收窄,已声明);库里的行不动。回滚 = revert 本 PR。 - 先看:`packages/metadata/src/metadata-manager.ts` 的 `keyedEntryBodies`(风险 hunk:剩余 body 的按值比较只决定保留,不决定包);同文件 `keyedEntryOf`;`packages/metadata/src/loaders/database-loader.test.ts` 末尾的 `[#32680]` describe。 - 两分钟验证:`pnpm --filter @objectstack/metadata exec vitest run src/loaders/database-loader.test.ts -t 32680`,预期 54 个用例全绿(本 PR 新增 53 个,加改写的 #32458 用例 1 个)。 - 需要你做的:无,席位落地。#32681(包外绑对象的 action 行该归哪个键)另需你拍板,见下方 Acceptance notes。 ## What changes `MetadataManager.loadMany`, for an unbundled type stored per `(package, name)` (`PACKAGE_SLOTTED_STORE_TYPES`) on a loader that holds items per package (`loadManySlots`: `DatabaseLoader`, the artifact door's `MemoryLoader`), now hands on each keyed entry's own body, stamped (`_packageId`) with the package the loader holds that entry for when the body carries the entry's key as its `name` (`keyedEntryBodies`). It no longer pairs `loader.loadMany`'s bodies to the keyed entries by their `JSON.stringify` (the former `withLoaderEntryPackages`). Bodies the keyed read cannot name (a row whose `name` column is empty) are still handed on after them, unstamped: they are `loadMany`'s bodies less one per keyed entry whose body is the same value (key order aside), so the comparison decides only what is kept, never a package, and it runs only when `loadMany` answers more bodies than the keyed read. `MetadataManager.loadManyKeyed` entries carry `packageId` where the loader's entry carries one (`keyedEntryOf`), for the slotted path and the bundled one (`email_template`). Every moved answer, FROM to TO (the changeset carries the same list): | Shape (host wiring a `DatabaseLoader`) | Read | FROM | TO | |:--|:--|:--|:--| | Name two packages hold, beside another row whose body says the name (F2) | `MetadataManager.loadMany` | one body, unstamped | both holders stamped with their own row's package, the other row's body unstamped | | same | boot pass registry | the one body in the bare slot | each package's slot, the other row's body in the bare slot | | same | bare read after the pass | that body | `409 RESOURCE_CONFLICT` naming both packages (for `action` also `platform`, see notes); the same as without the pass | | Name one package holds, beside another row whose body says the name | `loadMany` / boot pass | unstamped, filed in the bare slot | stamped, filed in the holder's slot | | same | read naming a package that holds no row, after the pass | the holder's body | nothing, as without the pass | | Loader whose two reads serialise a body differently (F3) | `loadMany` | both holders unstamped | both stamped | | Any type stored per `(package, name)` | `MetadataManager.loadManyKeyed` | `{ name, data }` | `{ name, data, packageId }` where the loader holds it for a package | Not changed: a name one package holds with no other row's body saying it (CONTROL pins), a name no package holds, and a loader without `loadManySlots`. The number of entries both plural reads hand on is unchanged for every shape but F2, where the other row's body is now kept beside both holders. ## Tests New top-level describe `[#32680]` in `packages/metadata/src/loaders/database-loader.test.ts` (53 cases): F2 per boot-pass type with the other row stored first and last (bare read 409 naming both after the pass; reads naming ALPHA, BETA, GAMMA equal the cold read); F3 with a key-reordering loader, plus a row whose name column is empty kept once; F4 per slotted type and `email_template`; one holder beside another row's body (every read equals the cold read); CONTROL one holder per type. The #32458 pin "two holders of a name and another row's body that says the same name" moves FROM `[[null, ALPHA]]` TO `[[ALPHA, ALPHA], [BETA, BETA], [null, ALPHA]]`, its title rewritten to say so. BEFORE, on main `d4fbb4db` with the same fixtures: 43 of the 53 new cases red, the 10 CONTROLs green. The F2 bare read after the pass answered `com.alpha.app` with registry keys `['helper']` for every type. Downstream readers (`MetadataManager.loadMany` / `loadManyKeyed` callers), consumer direction: objectql `action-governance`, `metadata-sync-flow-two-holders`, `plugin-governance-scoped-metadata`, `webhook-stored-row-boot-hydration` (59 passed); runtime `action-activation-unpackaged`, `actions-addressed-route`, `mcp-package-object-discovery`, `action-governance-scope-divergence` (218 passed). Ablations (each through `scripts/ablation-replace.mjs`, mutation landed on disk and restored to the HEAD blob with `git diff HEAD` empty; the suite reads `src/` by relative import, so no build leg): 1. the keyed read swapped back for `loader.loadMany` (no stamp at all): 42 red (the CONTROLs among them, since this drops every stamp), the 12 F4 cases green; 2. `keyedEntryOf` without `packageId`: the 12 F4 cases red, nothing else; 3. the remainder compared by `JSON.stringify` instead of by value: the F3 case red (the empty-name row handed on twice); 4. the remainder dropped: F3 and the two #32458 pins that keep an empty-name row red. ## Acceptance notes - **#32681 is not in this PR.** It is returned to the PM for a decision: which key a package-less action row bound to an object takes beside two packages that bind the name to different objects. Re-measured on this branch (the shape does not move here): ALPHA `approve` on `account`, BETA's on `contact`, a package-less one on `account`; the cold read naming ALPHA answers ALPHA's row, after the boot pass it answers the package-less row. The mirror shape moves too: one holder ALPHA on `account` and a package-less row on `contact` hand on one row (the package-less one, folded into ALPHA by the loader's per-name D4 rule), so after the pass a read naming ALPHA answers the `contact` row where the cold read answers ALPHA's `account` row. ADR-0150 D4's action key `(package, objectName, name)` and its R15 row ("two holders → the ambiguous set") read the shape two ways, so it is not settled here. - For `action`, the F2 bare refusal after the pass also names `platform`: the other row (stored under its own key) is registered under its body's name in the bare slot, and an action name's package-less registry slot that no loader stores under that name counts as the platform's (#32560). The boot pass registering a stored row under its body's `name` rather than its row key is unchanged here. - No change in `packages/metadata-protocol/src/**` and none in `packages/metadata/src/loaders/database-loader.ts` (open PR #33193 edits it). - Local gates were narrowed to the package's tests, typecheck, the new pins and the ablations; the derived gate families run in CI. ## Verification <details><summary>metadata suite and typecheck on fad580c</summary> ```text pnpm --filter @objectstack/metadata test && pnpm --filter @objectstack/metadata typecheck Test Files 77 passed (77) Tests 2367 passed (2367) os-verify-lock: VERDICT command-exit 0 ``` </details> <details><summary>Targeted gates run locally</summary> ```text EXIT=0 node scripts/check-adr-0087-registration.mjs --base origin/main EXIT=0 node scripts/check-changeset-no-major.mjs --base origin/main EXIT=0 node scripts/check-empty-changeset.mjs --base origin/main EXIT=0 pnpm check:nul-bytes EXIT=0 pnpm check:durability-log-level EXIT=0 pnpm check:doc-authoring EXIT=0 pnpm check:issue-citations EXIT=0 pnpm check:slot-lookup EXIT=0 pnpm check:test-source-alias EXIT=0 pnpm check:cross-package-test-inputs EXIT=0 node scripts/check-closing-keyword-parity.mjs ``` </details> --- _Generated by [Claude Code](https://claude.ai/code/session_016WV4cyrFFk86Jqf7Mp5Rzw)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent e92487f commit dd966fc

4 files changed

Lines changed: 261 additions & 81 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
'@objectstack/metadata': patch
3+
---
4+
5+
fix(metadata)!: `MetadataManager.loadMany` takes a by-package name's bodies and packages off the loader's keyed entries, so a boot no longer turns a name two packages hold into one body when another row's body says that name; `loadManyKeyed` entries carry their package (#32680)
6+
7+
Clause-②: yes (narrowing) — narrowed: on a host that wires a `DatabaseLoader` (none in the workspace), after the boot priming pass a read naming no package (`MetadataManager.get`, `getDiagnosed`) of an `api`, `agent`, `skill`, `action`, `permission`, `flow`, `picklist`, `mapping`, `dataset` or `tool` name two packages' rows hold, beside another row whose body says that name, is refused `409 RESOURCE_CONFLICT` (`ambiguous-in-environment`, naming both packages), where it served one of those bodies; the same read without the pass already refused. Widened: `MetadataManager.loadManyKeyed` entries carry `packageId` (the package the loader holds the entry for), where they carried the key and the body only.
8+
Metadata-protocol: none
9+
10+
<!-- adr-0087: not-required (no-migration-prescription) No key of any schema is added, removed, renamed or re-shaped, and no stored row changes: what moves is which package a plural read stamps on a body it hands on, which the boot pass then registers, and a field a keyed entry carries beside its body, none of which a stored row records, so there is nothing for `objectstack migrate meta` to rewrite. -->
11+
12+
**BREAKING** for one kind of host: a host that wires a `DatabaseLoader` and, after the boot, reads with no package a name two packages' rows hold while a third row's body also says that name, now gets `409` naming both packages instead of one body. Name the package that holds it, or rename one of the two.
13+
14+
What moves, for every unbundled type in `PACKAGE_SLOTTED_STORE_TYPES`, on a loader that holds items per package (`loadManySlots`: `DatabaseLoader`, the artifact door's `MemoryLoader`):
15+
16+
- `MetadataManager.loadMany` hands on each of the loader's keyed entries' own bodies, stamped (`_packageId`) with the package the loader holds that entry for when the body carries the entry's key as its `name`, FROM `loader.loadMany`'s bodies paired to the keyed entries by their serialisation. A body the keyed read cannot name (a row whose `name` column is empty) is still handed on after them, unstamped.
17+
- A name two packages hold, beside another row whose body says that name: each holder is handed on stamped with its own row's package and the other row's body unstamped, FROM all of them unstamped and the first one alone handed on. The boot pass then fills each package's slot and files the other row's body in the name's bare slot, FROM filing the one body in the bare slot. After the pass a bare read is refused `409` naming both packages, FROM serving that body; for `action` the refusal also names `platform`, as an action name's package-less registry slot no loader stores under that name is counted (the other row is stored under its own key). A read naming either package answers that package's own body, as without the pass.
18+
- A name one package holds, beside another row whose body says that name: the holder is handed on stamped with its row's package, FROM unstamped. The boot pass fills the holder's slot, FROM the bare slot, so after the pass a read naming a package that holds no row of the name answers nothing, as without the pass, FROM the holder's body.
19+
- A loader whose `loadMany` and `loadManyKeyed` serialise a body differently (key order): both holders of a two-holder name are stamped, FROM neither.
20+
- `MetadataManager.loadManyKeyed` entries carry `packageId` where the loader's entry carries one (every type stored per `(package, name)`, `email_template` included), FROM `{ name, data }` alone. objectql's action audit, which reads it, can now tell two packages' entries of one name apart.
21+
22+
Not changed: a name one package holds with no other row's body saying it, a name no package holds, and a loader that does not hold items per package (its bodies are handed on as its `loadMany` answers them). `loadMany` and `loadManyKeyed` hand on as many entries as before for every shape above but the two-holder one, where the other row's body is now kept beside both holders.

‎packages/metadata/src/loaders/database-loader.test.ts‎

Lines changed: 157 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3191,7 +3191,7 @@ describe('[#32521] the boot priming pass primes every holder of a name', () => {
31913191
}
31923192
});
31933193

3194-
it('agent, two holders of a name and another row\'s body that says the same name: no body of the name is stamped, so none takes a package its row is not bound to (contract review F3 of #32458)', async () => {
3194+
it('agent, two holders of a name and another row\'s body that says the same name: each holder is stamped with its own row\'s package and the other row\'s body with none, so none takes a package its row is not bound to (contract review F3 of #32458; #32680, FROM no body of the name stamped)', async () => {
31953195
await seed('agent', ALPHA, 1);
31963196
await seed('agent', BETA, 2);
31973197
// Row keyed `stray` whose body says `name: 'helper'`, byte for byte ALPHA's row's body.
@@ -3201,7 +3201,7 @@ describe('[#32521] the boot priming pass primes every holder of a name', () => {
32013201
});
32023202
const m = cold();
32033203
expect((await m.loadMany('agent') as Array<Record<string, unknown>>).map((item) => [item._packageId ?? null, item.label]))
3204-
.toEqual([[null, ALPHA]]);
3204+
.toEqual([[ALPHA, ALPHA], [BETA, BETA], [null, ALPHA]]);
32053205
});
32063206

32073207
it('CONTROL email_template (bundled): every row was already primed — a bare read is refused naming both, list keeps both', async () => {
@@ -3573,3 +3573,158 @@ describe('[#33003] a write that rewrites an environment row the boot pass stampe
35733573
expect(await state(m)).toEqual(kept());
35743574
});
35753575
});
3576+
3577+
/**
3578+
* [#32680; follow-up of #32521, contract review F2/F3/F4, epic #31527 red line
3579+
* 2, ADR-0150 D3/D4] `MetadataManager.loadMany` reads a by-package type's
3580+
* bodies and packages off the loader's keyed entries (each body its own row's,
3581+
* stamped with that row's package), FROM pairing `loadMany`'s bodies to the
3582+
* keyed entries by content. So no body of a name is left unstamped because
3583+
* another row's body says the same name (F2) or because the loader serialises
3584+
* its two reads differently (F3), and `MetadataManager.loadManyKeyed` carries
3585+
* each entry's package (F4).
3586+
*
3587+
* BEFORE (measured on main d4fbb4db, same fixtures, every type below): in the
3588+
* F2 shape `loadMany` handed on one unstamped body of the name, the pass filed
3589+
* it in the bare slot (registry keys `['helper']`) and a bare read after the
3590+
* pass answered it (`com.alpha.app`); with F3's loader both holders were
3591+
* handed on unstamped; `loadManyKeyed` entries carried no package; one holder
3592+
* beside another row's body of its name was handed on unstamped. The CONTROLs
3593+
* answered as here.
3594+
*/
3595+
describe('[#32680] the plural read takes a by-package name\'s bodies and packages off the keyed entries', () => {
3596+
const ALPHA = 'com.alpha.app';
3597+
const BETA = 'com.beta.app';
3598+
const GAMMA = 'com.gamma.app';
3599+
const UNBUNDLED = [...PACKAGE_SLOTTED_STORE_TYPES].filter((type) => !isBundledStoreType(type));
3600+
const BOOT_PASS_READS = UNBUNDLED.filter((type) => DEFAULT_METADATA_TYPE_REGISTRY.some((entry) => entry.type === type));
3601+
let driver: IDataDriver;
3602+
3603+
const seed = (type: string, packageId: string | null, version: number, name = 'helper', body: Record<string, unknown> = {}) =>
3604+
driver.create('sys_metadata', {
3605+
id: `${type}_${name}_${packageId ?? 'env'}_${version}`, type, name, state: 'active', version, checksum: `${type}_${name}_${version}`,
3606+
source: 'database', package_id: packageId, metadata: JSON.stringify({ name: 'helper', label: packageId ?? 'env', ...body }),
3607+
});
3608+
/** The F2 shape: two holders of `helper`, and a package-less row keyed `stray` whose body says `helper`, byte for byte ALPHA's. */
3609+
const seedF2 = async (type: string, strayFirst = false) => {
3610+
if (strayFirst) await seed(type, null, 3, 'stray', { label: ALPHA });
3611+
await seed(type, ALPHA, 1);
3612+
await seed(type, BETA, 2);
3613+
if (!strayFirst) await seed(type, null, 3, 'stray', { label: ALPHA });
3614+
};
3615+
const cold = (loader: MetadataLoader = new DatabaseLoader({ driver })) => {
3616+
const m = new MetadataManager({ formats: ['json'], loaders: [] });
3617+
m.registerLoader(loader);
3618+
return m;
3619+
};
3620+
const bootPass = async (loader: MetadataLoader = new DatabaseLoader({ driver })) => {
3621+
const plugin = new MetadataPlugin({ watch: false, config: { bootstrap: 'eager' } });
3622+
const m = (plugin as any).manager as MetadataManager;
3623+
(m as any).loaders.clear();
3624+
m.registerLoader(loader);
3625+
await (plugin as any)._loadFromFileSystem({ logger: { info: vi.fn(), warn: vi.fn(), error: vi.fn(), debug: vi.fn() } });
3626+
return m;
3627+
};
3628+
const answer = async (m: MetadataManager, type: string, name: string, packageId?: string) => {
3629+
try {
3630+
const item = (await m.get(type, name, packageId)) as { label?: string } | undefined;
3631+
return item?.label;
3632+
} catch (e: any) {
3633+
return [e?.code, e?.status, e?.refusal?.reason, ...(e?.refusal?.candidates ?? []).map((c: any) => c.packageId ?? c.kind).sort()];
3634+
}
3635+
};
3636+
const REFUSED = ['RESOURCE_CONFLICT', 409, 'ambiguous-in-environment', ALPHA, BETA];
3637+
const stamps = async (m: MetadataManager, type: string) =>
3638+
((await m.loadMany(type)) as Array<Record<string, unknown>>).map((item) => [item._packageId ?? null, item.label]);
3639+
const keyedPackages = async (m: MetadataManager, type: string) =>
3640+
(await m.loadManyKeyed(type)).map((entry) => [entry.name, entry.packageId ?? null, (entry.data as { label?: string }).label]);
3641+
const registryKeys = (m: MetadataManager, type: string) => [...(((m as any).registry.get(type) as Map<string, unknown> | undefined)?.keys() ?? [])];
3642+
3643+
beforeEach(() => {
3644+
driver = createMockDriver();
3645+
});
3646+
3647+
for (const type of BOOT_PASS_READS) {
3648+
for (const strayFirst of [false, true]) {
3649+
it(`${type}, F2 shape (another row's body says the name, ${strayFirst ? 'stored first' : 'stored last'}): both holders are handed on stamped, and after the pass a bare read is refused 409 naming both, as without it`, async () => {
3650+
await seedF2(type, strayFirst);
3651+
expect(await answer(cold(), type, 'helper')).toEqual(REFUSED);
3652+
expect((await stamps(cold(), type)).filter(([packageId]) => packageId !== null)).toEqual([[ALPHA, ALPHA], [BETA, BETA]]);
3653+
const m = await bootPass();
3654+
// The other row's body is filed in the name's bare slot, as the pass files any
3655+
// package-less body beside two holders (by its body's name, as before).
3656+
expect(registryKeys(m, type)).toEqual([`${ALPHA}\u0000helper`, `${BETA}\u0000helper`, 'helper']);
3657+
// An action name's package-less registry slot no loader stores under the name is
3658+
// counted as the platform's (#32560), so its refusal names it too.
3659+
expect(await answer(m, type, 'helper')).toEqual(type === 'action' ? [...REFUSED, 'platform'] : REFUSED);
3660+
for (const packageId of [ALPHA, BETA, GAMMA]) {
3661+
expect([packageId, await answer(m, type, 'helper', packageId)]).toEqual([packageId, await answer(cold(), type, 'helper', packageId)]);
3662+
}
3663+
expect(driver.update).not.toHaveBeenCalled();
3664+
});
3665+
}
3666+
}
3667+
3668+
it('agent, F3: a loader whose two reads serialise a body differently still hands both holders on stamped', async () => {
3669+
await seed('agent', ALPHA, 1);
3670+
await seed('agent', BETA, 2);
3671+
class ReorderingLoader extends DatabaseLoader {
3672+
override async loadMany<T = any>(type: string, options?: any): Promise<T[]> {
3673+
// The same bodies, keys in another order: their serialisations no longer agree.
3674+
return (await super.loadMany<Record<string, unknown>>(type, options))
3675+
.map((body) => Object.fromEntries(Object.entries(body).reverse())) as T[];
3676+
}
3677+
}
3678+
expect(await stamps(cold(new ReorderingLoader({ driver })), 'agent')).toEqual([[ALPHA, ALPHA], [BETA, BETA]]);
3679+
const m = await bootPass(new ReorderingLoader({ driver }));
3680+
expect(await answer(m, 'agent', 'helper')).toEqual(REFUSED);
3681+
// A row the keyed read cannot name (its `name` column empty) is still handed on, once, unstamped.
3682+
await driver.create('sys_metadata', {
3683+
id: 'agent_unnamed', type: 'agent', name: null, state: 'active', version: 3, checksum: 'agent_unnamed',
3684+
source: 'database', package_id: null, metadata: JSON.stringify({ label: 'empty name column' }),
3685+
});
3686+
expect(await stamps(cold(new ReorderingLoader({ driver })), 'agent')).toEqual([[ALPHA, ALPHA], [BETA, BETA], [null, 'empty name column']]);
3687+
});
3688+
3689+
for (const type of UNBUNDLED) {
3690+
it(`${type}, F4: MetadataManager.loadManyKeyed carries each entry's package`, async () => {
3691+
await seed(type, ALPHA, 1);
3692+
await seed(type, BETA, 2);
3693+
await seed(type, null, 3, 'solo', { name: 'solo' });
3694+
expect(await keyedPackages(cold(), type)).toEqual([['helper', ALPHA, ALPHA], ['helper', BETA, BETA], ['solo', null, 'env']]);
3695+
});
3696+
}
3697+
3698+
it('email_template, F4: MetadataManager.loadManyKeyed carries each entry\'s package', async () => {
3699+
for (const [packageId, version] of [[ALPHA, 1], [BETA, 2]] as const) {
3700+
await driver.create('sys_metadata', {
3701+
id: `et_${packageId}`, type: 'email_template', name: 'welcome', state: 'active', version, checksum: `et_${packageId}`,
3702+
source: 'database', package_id: packageId, metadata: JSON.stringify({ name: 'welcome', locale: 'en-US', subject: packageId, bodyHtml: '<p/>', label: packageId }),
3703+
});
3704+
}
3705+
expect(await keyedPackages(cold(), 'email_template')).toEqual([['welcome', ALPHA, ALPHA], ['welcome', BETA, BETA]]);
3706+
});
3707+
3708+
for (const type of BOOT_PASS_READS) {
3709+
it(`${type}, one holder beside another row's body that says its name: handed on stamped, and after the pass every read answers as without it`, async () => {
3710+
await seed(type, ALPHA, 1);
3711+
await seed(type, null, 2, 'stray', { label: 'stray' });
3712+
expect(await stamps(cold(), type)).toEqual([[ALPHA, ALPHA]]);
3713+
const m = await bootPass();
3714+
expect(registryKeys(m, type)).toEqual([`${ALPHA}\u0000helper`]);
3715+
for (const packageId of [undefined, ALPHA, GAMMA]) {
3716+
expect([packageId ?? null, await answer(m, type, 'helper', packageId)]).toEqual([packageId ?? null, await answer(cold(), type, 'helper', packageId)]);
3717+
}
3718+
});
3719+
3720+
it(`CONTROL ${type}, one holder: handed on stamped with its row's package, and after the pass a bare read answers it, as before`, async () => {
3721+
await seed(type, ALPHA, 1);
3722+
expect(await stamps(cold(), type)).toEqual([[ALPHA, ALPHA]]);
3723+
const m = await bootPass();
3724+
expect(registryKeys(m, type)).toEqual([`${ALPHA}\u0000helper`]);
3725+
expect(await answer(m, type, 'helper')).toBe(ALPHA);
3726+
expect(await answer(m, type, 'helper', ALPHA)).toBe(ALPHA);
3727+
expect(await answer(m, type, 'helper', GAMMA)).toBeUndefined();
3728+
});
3729+
}
3730+
});

‎packages/metadata/src/loaders/loader-interface.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ export interface MetadataKeyedItem<T = any> {
4343
* item for; absent for an item it holds for no package. A customization of
4444
* a package's item (D4) is held for that package though its body names
4545
* none, which is why the package travels beside the body rather than being
46-
* read off it.
46+
* read off it. [#32458, #32680] Also on a `loadManyKeyed` entry of a type
47+
* stored per `(package, name)` (a loader's own, and `MetadataManager`'s,
48+
* which hands on its loaders' packages).
4749
*/
4850
readonly packageId?: string;
4951
}

0 commit comments

Comments
 (0)