Files
deepseek-harness/packages/boot/plugin-manager/tests/tools.spec.ts
T
涂轶翔 101f26de4e fix(system-prompt): 保留 section API 的增量系统指令 (#6941)
* feat(system-prompt): admit section updates incrementally

* docs(system-prompt): accept retirement restart gap

* test(system-prompt): cover retirement and reentry before admission

* test(system-prompt): align rebase fixtures and persistence history

* fix: align section prompt consumers and CI fixtures

* test: pin credentials for section snapshot fixtures

* test: align remaining snapshots with section admission

* test: preserve section metadata in Web and PowerShell replays

* refactor(system-prompt): retire sections through Cordis cleanup

* chore: refresh section admission history after rebase

* fix(system-prompt): advance admission head after compaction

* fix(system-prompt): trim sections before admission hashing

* docs: move system upgrade guides to current version

* docs: add system message contribution cookbook

* perf(system-prompt): avoid indexing history for admission

* refactor(system-prompt): derive admission from logged sections

* test(system-prompt): update lifecycle and compaction consumers

* test(system-prompt): refresh CLI section event expectations

* test(system-prompt): refresh question composer section metadata

* feat(system-prompt): resolve same-name sections by scope

* refactor(persona): use ordinary section registrations

* refactor(system-prompt): clarify assembly and related control flow

* test(system-prompt): reconcile rebased section snapshots

* test(python): use current system text helper after rebase

* test(system-prompt): refresh CLI expected section blocks

* test(system-prompt): reconcile latest master integration

* test(agent-loop): seed tools before deferred addition assertion

* refactor(compaction): replace system heads when compacting prefixes

* refactor(system-prompt): separate source text and notice attribution

* fix(system-prompt): preserve legacy instructions in compaction snapshots

* refactor(compaction): build system snapshots while reading the summary prefix

* refactor(compaction): rebuild current system instructions

* refactor(system-prompt): defer compaction rebuild to admission

* refactor(system-prompt): remove redundant fixtures and setup

* fix(plan-mode): announce committed user transitions

* docs(system-prompt): reconcile section lifecycle and compaction design

* refactor(system-prompt): consolidate projection version increments

* fix(system-prompt): reconcile master integration and replay fixtures

* docs(system-prompt): align upgrade guide with current release

* refactor(system-prompt): make admission operations explicit

* fix(system-prompt): reconcile master API and release changes

* docs(system-prompt): regenerate catalogs after master refresh

* refactor(llm-pi-ai): delegate text rendering to pi-ai

* fix(llm-pi-ai): preserve blank lines between system text parts

* refactor(system-prompt): remove redundant retirement metadata

* refactor(system-prompt): own admission and use canonical surface targets

* refactor(system-prompt): compare captured sections at commitment

Assembly fixes section text and lifecycle; PromptAssembly.systemUpdates() compares them with the committed projection when the loop commits. This replaces SystemPrompt.admit(), needsRebuild() and isCurrent(), the SystemAdmission export, the loop's reassembly after compaction, and SessionSurface.systemHeadResetSeq. The projection records a pending rebuild as a boolean that an attributed reset clears.

After a compaction inside a step, the rebuilt head uses the sections captured for that step; later source changes arrive as ordinary updates at the next step.

* test: await the session read fixture and type a matcher for lint

* test(tool-executor-ptc): describe same-name section override on executor replacement

Duplicate section names no longer reject a scoped executor; the earlier registration is overridden and returns as an ordinary update when the executor leaves.

* docs(upgrade-guide): move system-prompt integrations to v0.2.2-rc.3

The root version on master is 0.2.2-rc.3; verify-upgrade-guides rejects a guide added under an earlier version directory.

* refactor(system-prompt): rebuild over system messages without sections

A system message without source.sections now marks rebuilding pending, like a compaction summary. The next model attempt replaces the head with current sections and clears later system messages. This removes the separate legacy flag and its appended whole-prompt replacement and notice.

Sessions written by earlier releases, migrated logs, and imported DeepSeek conversations take the same path, so the importer and its tests return to their master versions.

* test(web): refresh the imported-conversation recording and drop a stray bytecode file

The Web recording for a resumed DeepSeek import was recorded while the prompt was appended after the imported history; the head is replaced again, as on master. The .pyc under the macOS signing skill was staged by accident in an earlier merge.

* refactor(session): scan system nodes on read

surface.systemNodes is read only when a system rebuild is written. Scanning the current surface nodes on each read restores the surface fold's plan types and state to their master definitions, which no longer carry the system message.

* refactor(session): rename SystemSurfaceNode.hasContent to isEmpty

The flag reports that the logged content array has no blocks. isEmpty matches the documented "empty head" wording and covers a head that was written empty without ever being cleared.

* refactor(llm): join system text through extractTextContent

extractTextContent gains a trim option that trims each text block and omits blocks left empty. The DeepSeek serializer, the pi-ai converter, and the prompt inspector use it with a blank-line separator in place of three hand-written joins.

The pi-ai converter now trims system and developer text like the other two, so whitespace-only blocks are omitted there as well.

* test(snapshots): refresh the PowerShell and cordis-inspect recordings

The two PowerShell scenarios still held the initial system message as one unattributed block; replay now writes one block per section with its attribution. The cordis-inspect-jsdoc recording embeds the API catalog, which names SystemSurfaceNode.isEmpty since the rename.

* test(plan-mode,harness-dev-context): cover a rejected pre-step and a repeated legacy prompt

A rejected pre-step must leave a queued plan-mode switch pending and unannounced until the next accepted step. A second unattributed system message with the same legacy paragraphs must keep the admitted paragraphs.

* test(web): refresh Web recordings for section-attributed system messages

Twenty-seven Web recordings still held the initial system message as one unattributed block. Replay now writes one text block per section with its attribution; twenty-six recordings differ only in that line.

plan-review also records the plan-mode switch notice before the first prompt and appends a plan:status update on exit in place of a head replacement and a series header, so its expanded golden gains the notice row.

The Creator persona test joins the system text blocks with blank lines, as the adapters do, before matching the persona line.

* refactor(system-prompt): require the retry argument of systemUpdates

The agent loop passes it on every attempt. A custom loop that omitted it on a retry received a full comparison in place of the pending rebuild, with no diagnostic; the type now makes each caller state which attempt it is.

* docs(upgrade-guide): move the system prompt integrations guide to v0.2.2-rc.5

The root version is 0.2.2-rc.5 after the master merge, and verify-upgrade-guides rejects a guide added under an earlier version directory.

* test(web): refresh the mention path presence recording for section-attributed system messages

* test: align two specs that master left failing

The DeepSeek settings spec waited for a saved notice carrying the provider label from before the rename to DeepSeek API. The Windows packaging workflow spec seeded one of the two helpers that the Stage workflow helpers step copies.

* chore: remove a Python cache file committed by mistake
2026-11-19 21:11:38 +08:00

327 lines
18 KiB
TypeScript

/** Agent controls use the same manager methods as the Web and bound inventory reads. */
import { executeToolFixture } from '@deepseek-ai/dsh-tool-testkit'
import * as NativeToolExecutor from '@deepseek-ai/dsh-tool-executor-native'
import { setSandboxMode } from '@deepseek-ai/dsh-sandbox-policy'
import { Context } from '@deepseek-ai/cordis'
import SystemPrompt from '@deepseek-ai/dsh-system-prompt'
import ToolRuntime, { type ToolExecutionResult } from '@deepseek-ai/dsh-tools'
import { brandString } from '@deepseek-ai/dsh-brand'
import type { ToolCallId } from '@deepseek-ai/dsh-llm/types'
import type { Agent } from '@deepseek-ai/dsh-agent'
import SandboxPolicy from '@deepseek-ai/dsh-sandbox-policy'
import { Session, type SessionId, SESSION_FORMAT_VERSION } from '@deepseek-ai/dsh-session'
import SessionProjections from '@deepseek-ai/dsh-session-projection'
import ApprovalService, { type ApprovalOutcome } from '@deepseek-ai/dsh-user-approval'
import { expect, it, onTestFinished, vi } from 'vitest'
import type PluginManager from '../src/index.ts'
import type { BundleInfo } from '../src/types.ts'
import * as tool from '../src/tools.ts'
import { PluginManagerError } from '../src/error.ts'
import { FileLockError } from '@deepseek-ai/dsh-atomic-write'
function resultText(result: ToolExecutionResult): string {
if (typeof result.value !== 'string') throw new Error('Expected a serialized manager result')
return result.value
}
async function fixture(mode: 'read-only' | 'workspace-write' | 'danger-full-access' = 'danger-full-access', approval?: 'ask' | 'never') {
const ctx = new Context()
onTestFinished(() => ctx.fiber.dispose())
const manager = {
listPlugins: vi.fn(async () => Array.from({ length: 30 }, (_, i) => ({ entryId: `include:${i}`, enabled: true }))),
listBundles: vi.fn(async () => [{ name: 'bundle', enabled: true }]),
setPluginEnabled: vi.fn(async () => ({ changed: true, application: 'applied' })),
setBundleEnabled: vi.fn(async () => ({ changed: true, application: 'applied' })),
installBundle: vi.fn(async () => ({ changed: true, application: 'restart-required' })),
removeBundle: vi.fn(async () => ({ changed: false, application: 'failed' })),
listVersionExemptions: vi.fn(() => ({ exemptions: { '[email protected]': ['0.1.7-alpha.1'] }, warnings: [] })),
setVersionExemption: vi.fn(async () => ({ changed: true, application: 'applied' })),
}
ctx.provide('pluginManager', manager as unknown as PluginManager)
await ctx.plugin(SessionProjections)
await ctx.plugin(SystemPrompt)
await ctx.plugin(ToolRuntime)
await ctx.plugin(NativeToolExecutor)
await ctx.plugin(SandboxPolicy, { mode })
if (approval !== undefined) await ctx.plugin(ApprovalService, { policy: approval })
const fiber = await ctx.plugin(tool)
const call = (args: unknown, agent?: Agent, signal = new AbortController().signal) => executeToolFixture(ctx, { name: 'plugin_manager', arguments: args,
...agent === undefined ? {} : { agent },
callId: brandString<ToolCallId>('manager-call'), signal })
return { ctx, manager, call, fiber }
}
it.each(['read-only', 'workspace-write'] as const)('denies every management action in %s before accessing the manager', async (mode) => {
const { call, manager } = await fixture(mode)
for (const action of ['list_plugins', 'list_bundles', 'set_plugin', 'set_bundle', 'install_bundle', 'remove_bundle', 'list_version_exemptions', 'set_version_exemption']) {
const result = await call({ action, target: 'bundle', enabled: true })
expect(result.isError).toBe(true)
expect(JSON.stringify(result.content)).toContain('requires approval, but no approval service is composed')
}
for (const method of Object.values(manager)) expect(method).not.toHaveBeenCalled()
})
it('preserves selected bundle load errors in the agent list result', async () => {
const { manager, call } = await fixture()
const bundles = [{
name: 'bundle', enabled: true,
error: { code: 'operation-error', diagnostic: 'bundle patch is unreadable' }, rows: [], overrides: [],
}]
manager.listBundles.mockResolvedValue(bundles)
expect(JSON.parse(resultText(await call({ action: 'list_bundles' })))).toMatchInlineSnapshot(`
{
"entries": [
{
"enabled": true,
"error": {
"code": "operation-error",
"diagnostic": "bundle patch is unreadable",
},
"name": "bundle",
"overrides": [],
"rows": [],
},
],
"nextOffset": null,
"total": 1,
}
`)
})
it('exposes an absent Official bundle installation target without display metadata', async () => {
const { manager, call } = await fixture()
const offered: BundleInfo = {
name: '@deepseek-ai/dsh-subagent-codex', official: true, availability: 'missing',
installed: false, enabled: false, optional: false, removable: false, rows: [], overrides: [],
installTarget: { spec: '@deepseek-ai/[email protected]', version: '1.2.3' },
meta: { title: 'Codex subagent' },
}
manager.listBundles.mockResolvedValue([offered])
expect(JSON.parse(resultText(await call({ action: 'list_bundles' })))).toMatchInlineSnapshot(`
{
"entries": [
{
"availability": "missing",
"enabled": false,
"installTarget": {
"spec": "@deepseek-ai/[email protected]",
"version": "1.2.3",
},
"installed": false,
"name": "@deepseek-ai/dsh-subagent-codex",
"official": true,
"optional": false,
"overrides": [],
"removable": false,
"rows": [],
},
],
"nextOffset": null,
"total": 1,
}
`)
})
it('checks the calling session on each execution, including after permission is revoked', async () => {
const { call, manager } = await fixture()
const id = brandString<SessionId>('manager-permissions')
const session = Session.create(id, undefined, { version: SESSION_FORMAT_VERSION, id, createdAt: 0, isSeeded: false })
const agent = { session } as unknown as Agent
setSandboxMode(session, 'workspace-write')
expect((await call({ action: 'list_plugins' }, agent)).isError).toBe(true)
expect(manager.listPlugins).not.toHaveBeenCalled()
setSandboxMode(session, 'danger-full-access')
expect((await call({ action: 'list_plugins' }, agent)).isError).toBe(false)
setSandboxMode(session, 'read-only')
expect((await call({ action: 'list_plugins' }, agent)).isError).toBe(true)
expect(manager.listPlugins).toHaveBeenCalledTimes(1)
})
function activeAgent(): Agent {
const id = brandString<SessionId>('manager-approval')
const session = Session.create(id, undefined, { version: SESSION_FORMAT_VERSION, id, createdAt: 0, isSeeded: false })
session.append('turn/start', { turn: 1 })
return { session } as unknown as Agent
}
it.each(['read-only', 'workspace-write'] as const)('approves each action once in %s without changing session permissions', async (mode) => {
const { ctx, call, manager } = await fixture(mode, 'ask')
const agent = activeAgent()
const prompted = vi.fn(async () => 'allowed-once' as const)
const dispose = ctx.on('approval/request', prompted)
for (const action of ['list_plugins', 'list_bundles', 'set_plugin', 'set_bundle', 'install_bundle', 'remove_bundle', 'list_version_exemptions', 'set_version_exemption']) {
expect((await call({ action, target: '[email protected]', enabled: true, runtimeVersion: '0.1.7-alpha.1', acceptRisk: true }, agent)).isError).toBe(false)
}
expect(prompted).toHaveBeenCalledTimes(8)
for (const method of Object.values(manager)) expect(method).toHaveBeenCalledTimes(1)
expect(ctx.sandboxPolicy.resolve({ session: agent.session }).mode).toBe(mode)
const audit = agent.session.snapshotEvents().filter(event => event.type.startsWith('approval/'))
expect(audit).toHaveLength(16)
expect(audit[0]).toMatchObject({ type: 'approval/asked', data: {
toolName: 'plugin_manager', callId: 'manager-call',
} })
const request = audit[0]
if (request?.type !== 'approval/asked') throw new Error('Expected an approval request')
expect(request.data.reason).toContain('"action":"list_plugins"')
expect(audit[1]).toMatchObject({ type: 'approval/decided', data: { outcome: 'allowed-once' } })
dispose()
expect((await call({ action: 'list_plugins' }, agent)).isError).toBe(true)
expect(manager.listPlugins).toHaveBeenCalledTimes(1)
})
it.each(['rejected', 'cancelled', 'unavailable'] as const)('does not mutate the profile when approval is %s', async (outcome) => {
const { ctx, call, manager } = await fixture('workspace-write', 'ask')
ctx.on('approval/request', async () => outcome)
const agent = activeAgent()
expect((await call({ action: 'install_bundle', target: 'bundle' }, agent)).isError).toBe(true)
expect(manager.installBundle).not.toHaveBeenCalled()
expect(agent.session.snapshotEvents().filter(event => event.type === 'approval/decided')
.map(event => event.data.outcome)).toEqual([outcome])
})
it('rejects never policy without prompting and keeps full-access calls prompt-free', async () => {
const { ctx, call, manager } = await fixture('workspace-write', 'never')
const prompted = vi.fn(async () => 'allowed-once' as const)
ctx.on('approval/request', prompted, { prepend: true })
const agent = activeAgent()
expect((await call({ action: 'set_plugin', target: 'include:demo', enabled: true }, agent)).isError).toBe(true)
expect(manager.setPluginEnabled).not.toHaveBeenCalled()
setSandboxMode(agent.session, 'danger-full-access')
expect((await call({ action: 'set_plugin', target: 'include:demo', enabled: true }, agent)).isError).toBe(false)
expect(manager.setPluginEnabled).toHaveBeenCalledTimes(1)
expect(prompted).not.toHaveBeenCalled()
})
it('cancels an approval wait before any manager operation', async () => {
const { ctx, call, manager } = await fixture('workspace-write', 'ask')
const asked = Promise.withResolvers<undefined>()
const answer = Promise.withResolvers<ApprovalOutcome>()
ctx.on('approval/request', () => { asked.resolve(undefined); return answer.promise })
const controller = new AbortController()
const result = call({ action: 'install_bundle', target: 'bundle' }, activeAgent(), controller.signal)
await asked.promise
expect(manager.installBundle).not.toHaveBeenCalled()
controller.abort()
answer.resolve('allowed-once')
expect((await result).isError).toBe(true)
expect(manager.installBundle).not.toHaveBeenCalled()
})
it('does not apply a grant when the call was cancelled before dispatch', async () => {
const { ctx, call, manager } = await fixture('workspace-write', 'ask')
const controller = new AbortController()
vi.spyOn(ctx.approval, 'request').mockImplementation(async () => {
controller.abort()
return 'allowed-once'
})
expect((await call({ action: 'install_bundle', target: 'bundle' }, activeAgent(), controller.signal)).isError).toBe(true)
expect(manager.installBundle).not.toHaveBeenCalled()
})
it('paginates inventories with an explicit continuation and total', async () => {
const { call } = await fixture()
const first = await call({ action: 'list_plugins' })
expect(first.isError).toBe(false)
expect(JSON.stringify(first.content)).toContain('nextOffset')
expect(JSON.parse(resultText(first))).toMatchObject({ nextOffset: 25, total: 30 })
const last = await call({ action: 'list_plugins', offset: 25, limit: 10 })
expect(JSON.parse(resultText(last))).toMatchObject({ nextOffset: null, total: 30 })
expect(resultText(await call({ action: 'list_bundles' }))).toContain('"name":"bundle"')
})
it('keeps UI translation and listing metadata out of model-facing plugin and bundle lists', async () => {
const { call, manager } = await fixture()
const meta = { title: { en: 'Plugin', zh: '插件' }, error: 'UI-only diagnostic' }
manager.listPlugins.mockImplementationOnce(async () => [{ entryId: 'include:plugin', enabled: true, meta }])
expect(JSON.parse(resultText(await call({ action: 'list_plugins' })))).toEqual({
entries: [{ entryId: 'include:plugin', enabled: true }], total: 1, nextOffset: null,
})
manager.listBundles.mockImplementationOnce(async () => [{
name: 'bundle', source: 'bundle@^1.0.0', enabled: true, listedByDefault: false, meta, rows: [{ rowId: 'plugin', moduleName: 'plugin', meta }],
}])
expect(JSON.parse(resultText(await call({ action: 'list_bundles' })))).toEqual({
entries: [{ name: 'bundle', source: 'bundle@^1.0.0', enabled: true, rows: [{ rowId: 'plugin', moduleName: 'plugin' }] }], total: 1, nextOffset: null,
})
})
it('forwards all mutation actions and renders the returned outcome', async () => {
const { call, manager } = await fixture()
await call({ action: 'set_plugin', target: 'include:1', enabled: false })
expect(manager.setPluginEnabled).toHaveBeenCalledWith('include:1', false)
await call({ action: 'set_bundle', target: 'bundle', enabled: true })
expect(manager.setBundleEnabled).toHaveBeenCalledWith('bundle', true)
await call({ action: 'install_bundle', target: 'bundle' })
expect(manager.installBundle).toHaveBeenLastCalledWith('bundle', {})
await call({ action: 'install_bundle', target: 'bundle', enabled: false })
expect(manager.installBundle).toHaveBeenLastCalledWith('bundle', { enabled: false })
await call({ action: 'install_bundle', target: 'bundle', approvedBuilds: ['native'] })
expect(manager.installBundle).toHaveBeenLastCalledWith('bundle', { approvedBuilds: ['native'] })
await call({ action: 'install_bundle', target: 'bundle', registry: 'https://registry.npmmirror.com/' })
expect(manager.installBundle).toHaveBeenLastCalledWith('bundle', { registry: 'https://registry.npmmirror.com/' })
expect(resultText(await call({ action: 'remove_bundle', target: 'bundle' }))).toContain('"application":"failed"')
expect(manager.removeBundle).toHaveBeenCalledWith('bundle')
})
it.each([
{ action: 'unknown_action' },
{ action: 'list_plugins', offset: -1 },
{ action: 'list_plugins', offset: 0.5 },
{ action: 'list_bundles', limit: 101 },
{ action: 'list_bundles', limit: 0 },
{ action: 'list_bundles', limit: 1.5 },
{ action: 'set_plugin', enabled: true },
{ action: 'set_bundle', target: 'bundle' },
{ action: 'install_bundle' }, { action: 'remove_bundle' },
{ action: 'set_version_exemption', enabled: true, runtimeVersion: '1.0.0' },
{ action: 'set_version_exemption', target: '[email protected]', enabled: true },
{ action: 'set_version_exemption', target: '[email protected]', runtimeVersion: '1.0.0' },
])('rejects incomplete or unbounded tool inputs: %j', async (args) => {
const { call } = await fixture()
const result = await call(args)
expect(result.isError).toBe(true)
expect(result.error?.info).toEqual({ name: 'ToolArgsError', code: 'INVALID_ARGS' })
})
it('reports profile read, lock, and disposal failures with their error codes', async () => {
const { manager, call } = await fixture()
manager.listBundles.mockRejectedValueOnce(new PluginManagerError('plugin-manager: failed to read the profile: bad JSON', 'PLUGIN_MANAGER_PROFILE_READ_FAILED'))
manager.setBundleEnabled.mockRejectedValueOnce(new FileLockError('/profile/package.json.lock'))
manager.removeBundle.mockRejectedValueOnce(new PluginManagerError('plugin-manager: the manager is disposed', 'PLUGIN_MANAGER_UNAVAILABLE'))
expect((await call({ action: 'list_bundles' })).error?.info).toEqual({ name: 'PluginManagerError', code: 'PLUGIN_MANAGER_PROFILE_READ_FAILED' })
expect((await call({ action: 'set_bundle', target: 'bundle', enabled: false })).error?.info).toEqual({ name: 'FileLockError', code: 'FILE_LOCK_TIMEOUT' })
expect((await call({ action: 'remove_bundle', target: 'bundle' })).error?.info).toEqual({ name: 'PluginManagerError', code: 'PLUGIN_MANAGER_UNAVAILABLE' })
})
it('presents reads and changes distinctly and disposes its registration', async () => {
const { ctx, fiber } = await fixture()
const definition = ctx.tools.get('plugin_manager')!
expect(definition.presentCall?.({ action: 'list_plugins' })).toMatchObject({ kind: 'read' })
expect(definition.presentCall?.({ action: 'remove_bundle', target: 'bundle' })).toMatchObject({ kind: 'other' })
await fiber.dispose()
expect(ctx.tools.get('plugin_manager')).toBeUndefined()
})
it('tells the agent the next step for each change outcome it can act on', async () => {
const { manager, call } = await fixture()
const outcome = async (result: object): Promise<unknown> => {
manager.setBundleEnabled.mockResolvedValueOnce(result as never)
return (JSON.parse(resultText(await call({ action: 'set_bundle', target: 'bundle', enabled: true }))) as { nextStep?: string }).nextStep
}
expect(await outcome({ changed: true, application: 'applied' })).toBeUndefined()
expect(await outcome({ changed: false, application: 'cancelled' })).toContain('nothing changed')
expect(await outcome({ changed: true, application: 'overridden' })).toContain('higher-priority layer')
expect(await outcome({ changed: true, application: 'restart-required', restartReason: 'host-module' }))
.toBe('Tell the user to restart DSH to apply this change: the change reaches modules DSH itself loaded.')
expect(await outcome({ changed: true, application: 'restart-required' })).toBe('Tell the user to restart DSH to apply this change.')
expect(await outcome({ changed: false, application: 'failed', packageResult: { kind: 'build-blocked' } })).toContain('approvedBuilds')
// A refusal code is more specific than the package manager's failure kind.
expect(await outcome({ changed: false, application: 'failed', packageResult: { kind: 'network' }, error: { code: 'stale-approval' } }))
.toContain('without approvedBuilds')
// A failure kind without its own step falls back to the refusal code.
expect(await outcome({ changed: false, application: 'failed', packageResult: { kind: 'unknown' }, error: { code: 'operation-error' } }))
.toContain('Report the diagnostic')
expect(await outcome({ changed: false, application: 'failed' })).toContain('Report the diagnostic')
expect(await outcome({ changed: false, application: 'failed', error: { code: 'unsupported-platform' } }))
.toBe('This bundle cannot run on the current Host platform; ask the user to use a supported Host.')
})