Skip to content

Commit 5d02c02

Browse files
test(artifact): pin that --host-validation never duplicates a failing portable byte lane
Host reports only run over an artifact the ordinary lane accepted, so an AB6035-AB6037 failure is reported once and no portable report is produced.
1 parent 22a388b commit 5d02c02

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎packages/agent-bundle/tests/artifact-validator.test.ts‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { pathToFileURL } from 'node:url';
99
import { expect, it } from '@rstest/core';
1010

1111
import { createDefaultRegistry, TargetRegistry } from '../src/adapters/registry.ts';
12+
import { validate } from '../src/api.ts';
1213
import { readStandardNativeHookCommands, type TargetHookContract } from '../src/adapters/hook-contract.ts';
1314
import {
1415
validateModernMcpDocument,
@@ -887,6 +888,14 @@ it('fails ordinary artifact validation when an emitted portable tree breaks the
887888
]);
888889
expect(normative.every((entry) => entry.severity === 'error' && entry.target === 'portable' && entry.recovery !== undefined)).toBe(true);
889890
expect(diagnostics).not.toEqual(expect.arrayContaining([expect.objectContaining({ code: 'AB6012' })]));
891+
892+
// --host-validation runs host reports only over an artifact the ordinary lane
893+
// accepted, so a failing byte lane is reported exactly once and never as a report.
894+
const hostValidated = await validate({ artifact: root, hostValidation: true, registry, root });
895+
expect(hostValidated.hostValidation).toBeUndefined();
896+
expect(hostValidated.diagnostics.filter((entry) => entry.code === 'AB6036').map((entry) => entry.message))
897+
.toEqual(normative.map((entry) => entry.message));
898+
expect(hostValidated.diagnostics.some((entry) => entry.code === 'AB6038')).toBe(false);
890899
} finally {
891900
await rm(root, { force: true, recursive: true });
892901
}

0 commit comments

Comments
 (0)