From 24c4208b7e843a20e3b0f511c27259ed25eca3de Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 15 Nov 2026 09:21:33 +0000 Subject: [PATCH 1/2] test(dogfood): time the package-less tool row pin's reads, not its three installs The AI-family pin saved two rows and ran three install-locals inside one `it`, so vitest's default 5 s test clock timed loading: each install re-syncs the whole showcase (~0.9 s idle), and under queue shard load the test crossed 5 s. The saves and installs move to a nested describe's beforeAll with a loading budget; the before/after-hydrator reads become two its with unchanged assertions. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01QsR2jRabTH2KkTRU4d62Uq --- ...-name-one-holder-ai-family.dogfood.test.ts | 37 +++++++++++++------ 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/packages/qa/dogfood/test/bare-name-one-holder-ai-family.dogfood.test.ts b/packages/qa/dogfood/test/bare-name-one-holder-ai-family.dogfood.test.ts index 58e429d92ca..d2f574ee912 100644 --- a/packages/qa/dogfood/test/bare-name-one-holder-ai-family.dogfood.test.ts +++ b/packages/qa/dogfood/test/bare-name-one-holder-ai-family.dogfood.test.ts @@ -377,24 +377,39 @@ describe('agent, skill and tool names held per namespace, on a booted showcase', * other. FROM (this branch before `main`'s #32741 was merged in): the * first-installed holder's exact address served the package-less row as its * own; the second served its own. + * + * The two row saves and the three installs are this pin's SETUP, so they run + * in the `beforeAll` below and the `it`s time only the reads they judge + * (clocked windows measure behaviour, never loading). Measured: each + * install-local re-syncs the whole showcase (123 object schemas, 33 flows), + * ~0.9 s apiece on an idle box; the setup was ~2.8 s of a ~3.1 s test, and + * under merge-queue shard load the single `it` crossed vitest's default 5 s + * test clock (2.2–4.4 s green, 5.0–5.1 s red). The hook's budget is a + * loading budget, like the boot hook's above. */ - it('[#31985] a package-less tool row saved before two namespaces\' packages install the name is declined at each holder\'s exact address, both install orders, before and after the hydrator; the bare read refuses naming both', async () => { + describe('[#31985] a package-less tool row saved before two namespaces\' packages install the name', () => { const UP = 'qa_row_tool_up'; const DOWN = 'qa_row_tool_down'; - for (const name of [UP, DOWN]) { - const saved = await stack.apiAs(admin, 'PUT', `/meta/tool/${name}`, tool('env', name)); - expect(saved.status, await saved.text()).toBeLessThan(300); - } - for (const [p, tools] of [['kappa', [UP]], ['lambda', [UP, DOWN]], ['iota', [DOWN]]] as const) { - const { status, body } = await installLocal(inline(p, { tools: tools.map((n) => tool(p, n)) })); - expect(status, `${p}: ${JSON.stringify(body)}`).toBeLessThan(300); - } + + beforeAll(async () => { + for (const name of [UP, DOWN]) { + const saved = await stack.apiAs(admin, 'PUT', `/meta/tool/${name}`, tool('env', name)); + expect(saved.status, await saved.text()).toBeLessThan(300); + } + for (const [p, tools] of [['kappa', [UP]], ['lambda', [UP, DOWN]], ['iota', [DOWN]]] as const) { + const { status, body } = await installLocal(inline(p, { tools: tools.map((n) => tool(p, n)) })); + expect(status, `${p}: ${JSON.stringify(body)}`).toBeLessThan(300); + } + }, 60_000); + const layeredAt = async (name: string, pkg: string) => { const r = await stack.apiAs(admin, 'GET', `/meta/tool/${name}/layers?package=${pkg}`); const body = (await r.json()) as any; return [r.status, body?.overlay ?? null, body?.effective?.label]; }; - for (const when of ['before the hydrator', 'after the hydrator']) { + + // In declaration order: the second runs the hydrator (`GET /meta/tool`) first. + it.each(['before the hydrator', 'after the hydrator'])('%s: it is declined at each holder\'s exact address, both install orders; the bare read refuses naming both', async (when) => { if (when === 'after the hydrator') expect((await stack.apiAs(admin, 'GET', '/meta/tool')).status).toBe(200); for (const [name, holders] of [[UP, ['kappa', 'lambda']], [DOWN, ['lambda', 'iota']]] as const) { for (const p of holders) { @@ -404,7 +419,7 @@ describe('agent, skill and tool names held per namespace, on a booted showcase', } await expectMetaRefused('tool', name, holders.map((p) => `com.qa.bare.${p}`)); } - } + }); }); }); From 9ebd6e38b47c0e8013de91194f8b5ed3f5352e89 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 15 Nov 2026 10:08:46 +0000 Subject: [PATCH 2/2] test(dogfood): the two sibling install-local cases time their reads, not their installs The CONTROL and third-namespace cases in the AI-family file installed a package inside their `it`, on vitest's default 5 s clock. Each install moves to a nested describe's beforeAll with a loading budget; the reads stay in the `it`, unchanged apart from indentation. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01QsR2jRabTH2KkTRU4d62Uq --- ...-name-one-holder-ai-family.dogfood.test.ts | 69 +++++++++++-------- 1 file changed, 40 insertions(+), 29 deletions(-) diff --git a/packages/qa/dogfood/test/bare-name-one-holder-ai-family.dogfood.test.ts b/packages/qa/dogfood/test/bare-name-one-holder-ai-family.dogfood.test.ts index d2f574ee912..c2c6040d2e7 100644 --- a/packages/qa/dogfood/test/bare-name-one-holder-ai-family.dogfood.test.ts +++ b/packages/qa/dogfood/test/bare-name-one-holder-ai-family.dogfood.test.ts @@ -333,37 +333,48 @@ describe('agent, skill and tool names held per namespace, on a booted showcase', expect(await metaAt('tool', TOOL, 'com.qa.bare.alpha')).toEqual(['com.qa.bare.alpha', 'alpha tool']); }); - it('CONTROL — install-local of a package declaring fresh agent, skill and tool names installs, and every AI door serves it', async () => { - const { status, body } = await installLocal(inline('epsilon', { - agents: [agent('epsilon', 'epsilon_agent')], - skills: [skill('epsilon', 'epsilon_skill')], - tools: [tool('epsilon', 'epsilon_tool')], - })); - expect(status, JSON.stringify(body)).toBeLessThan(300); - expect(await packageIds()).toContain('com.qa.bare.epsilon'); - expect(await metaPackage('agent', 'epsilon_agent')).toBe('com.qa.bare.epsilon'); - expect(await metaPackage('skill', 'epsilon_skill')).toBe('com.qa.bare.epsilon'); - expect(await metaPackage('tool', 'epsilon_tool')).toBe('com.qa.bare.epsilon'); - expect(await promptText('epsilon-epsilon_skill')).toContain('epsilon skill instructions'); - expect(await promptText('epsilon_skill'), 'one holder: the bare name still answers').toContain('epsilon skill instructions'); + // The install is SETUP (loading), so it runs in a hook and the `it` times only the reads it judges. + describe('CONTROL — install-local of a package declaring fresh agent, skill and tool names', () => { + beforeAll(async () => { + const { status, body } = await installLocal(inline('epsilon', { + agents: [agent('epsilon', 'epsilon_agent')], + skills: [skill('epsilon', 'epsilon_skill')], + tools: [tool('epsilon', 'epsilon_tool')], + })); + expect(status, JSON.stringify(body)).toBeLessThan(300); + }, 60_000); + + it('installs, and every AI door serves it', async () => { + expect(await packageIds()).toContain('com.qa.bare.epsilon'); + expect(await metaPackage('agent', 'epsilon_agent')).toBe('com.qa.bare.epsilon'); + expect(await metaPackage('skill', 'epsilon_skill')).toBe('com.qa.bare.epsilon'); + expect(await metaPackage('tool', 'epsilon_tool')).toBe('com.qa.bare.epsilon'); + expect(await promptText('epsilon-epsilon_skill')).toContain('epsilon skill instructions'); + expect(await promptText('epsilon_skill'), 'one holder: the bare name still answers').toContain('epsilon skill instructions'); + }); }); - it('[#31701, #31985] install-local of a package of a THIRD namespace declaring the held agent, skill and tool names installs; the bare read then names all three holders', async () => { - const { status, body } = await installLocal(inline('gamma', { agents: [agent('gamma')], skills: [skill('gamma')], tools: [tool('gamma')] })); - expect(status, JSON.stringify(body)).toBeLessThan(300); - expect(await packageIds()).toContain('com.qa.bare.gamma'); - expect(await metaAt('agent', AGENT, 'com.qa.bare.gamma')).toEqual(['com.qa.bare.gamma', 'gamma agent']); - expect(await metaAt('skill', SKILL, 'com.qa.bare.gamma')).toEqual(['com.qa.bare.gamma', 'gamma skill']); - expect(await metaAt('tool', TOOL, 'com.qa.bare.gamma')).toEqual(['com.qa.bare.gamma', 'gamma tool']); - const all = ['com.qa.bare.alpha', 'com.qa.bare.beta', 'com.qa.bare.gamma']; - await expectMetaRefused('agent', AGENT, all); - await expectMetaRefused('skill', SKILL, all); - await expectMetaRefused('tool', TOOL, all); - expect(await metaAt('tool', TOOL, 'com.qa.bare.alpha')).toEqual(['com.qa.bare.alpha', 'alpha tool']); - // The first packages' items are unchanged. - expect(await metaAt('agent', AGENT, 'com.qa.bare.alpha')).toEqual(['com.qa.bare.alpha', 'alpha agent']); - expect(await promptText(`alpha-${SKILL}`)).toContain('alpha skill instructions'); - expect(await promptText(`gamma-${SKILL}`)).toContain('gamma skill instructions'); + describe('[#31701, #31985] install-local of a package of a THIRD namespace declaring the held agent, skill and tool names', () => { + beforeAll(async () => { + const { status, body } = await installLocal(inline('gamma', { agents: [agent('gamma')], skills: [skill('gamma')], tools: [tool('gamma')] })); + expect(status, JSON.stringify(body)).toBeLessThan(300); + }, 60_000); + + it('installs; the bare read then names all three holders', async () => { + expect(await packageIds()).toContain('com.qa.bare.gamma'); + expect(await metaAt('agent', AGENT, 'com.qa.bare.gamma')).toEqual(['com.qa.bare.gamma', 'gamma agent']); + expect(await metaAt('skill', SKILL, 'com.qa.bare.gamma')).toEqual(['com.qa.bare.gamma', 'gamma skill']); + expect(await metaAt('tool', TOOL, 'com.qa.bare.gamma')).toEqual(['com.qa.bare.gamma', 'gamma tool']); + const all = ['com.qa.bare.alpha', 'com.qa.bare.beta', 'com.qa.bare.gamma']; + await expectMetaRefused('agent', AGENT, all); + await expectMetaRefused('skill', SKILL, all); + await expectMetaRefused('tool', TOOL, all); + expect(await metaAt('tool', TOOL, 'com.qa.bare.alpha')).toEqual(['com.qa.bare.alpha', 'alpha tool']); + // The first packages' items are unchanged. + expect(await metaAt('agent', AGENT, 'com.qa.bare.alpha')).toEqual(['com.qa.bare.alpha', 'alpha agent']); + expect(await promptText(`alpha-${SKILL}`)).toContain('alpha skill instructions'); + expect(await promptText(`gamma-${SKILL}`)).toContain('gamma skill instructions'); + }); }); /**