From 42e808ff76ea6c906b0fe304c55114805e9c2e0f Mon Sep 17 00:00:00 2001 From: morluto <76467478+morluto@users.noreply.github.com> Date: Mon, 16 Nov 2026 08:25:18 +0800 Subject: [PATCH] test: expect the unknown Evidence subject for resource-only and objdump command records (#11613) Since #11416 every Evidence record has a subject; one without a file target names identity {kind: unknown, reason: not-observed} with null name and local_path. Four tests that #11416's run did not select still expected subject: null and fail on main: the keyless bundle resource CLI, provider composition and acceptance tests, and the objdump command identity test. --- src/cliBundleResource.test.ts | 7 ++++++- .../applications/bundleResourceRootCliMcp.test.ts | 7 ++++++- tests/boundary/cli/objdumpIdentity.test.ts | 7 ++++++- .../boundary/providers/bundleResourceComposition.test.ts | 9 +++++++-- 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/cliBundleResource.test.ts b/src/cliBundleResource.test.ts index f366a0cb2a..abd3d1e509 100644 --- a/src/cliBundleResource.test.ts +++ b/src/cliBundleResource.test.ts @@ -1,3 +1,4 @@ +import { unknownTarget } from "./domain/targetIdentity.js"; import { mkdtemp, mkdir, rm, writeFile } from "node:fs/promises"; import { tmpdir } from "node:os"; import { join } from "node:path"; @@ -52,7 +53,11 @@ it("inspects a keyless app bundle through the public CLI and preserves resource ); expect(exitCode, stdout).toBe(0); expect(parseEvidence(JSON.parse(stdout))).toMatchObject({ - subject: null, + subject: { + identity: unknownTarget("not-observed"), + name: null, + local_path: null, + }, normalized_result: { archive_path: "Resources/Archive.plist", target_sha256: null, diff --git a/tests/acceptance/applications/bundleResourceRootCliMcp.test.ts b/tests/acceptance/applications/bundleResourceRootCliMcp.test.ts index a0df8e8c2c..8387fbc83c 100644 --- a/tests/acceptance/applications/bundleResourceRootCliMcp.test.ts +++ b/tests/acceptance/applications/bundleResourceRootCliMcp.test.ts @@ -1,3 +1,4 @@ +import { unknownTarget } from "../../../src/domain/targetIdentity.js"; import { evidenceBundleSchema } from "../../../src/domain/evidenceBundle.js"; import { build } from "plist"; import { lstat, mkdir, writeFile } from "node:fs/promises"; @@ -327,7 +328,11 @@ const expectResourceEvidence = ( ); expect(evidence).toMatchObject({ operation, - subject: null, + subject: { + identity: unknownTarget("not-observed"), + name: null, + local_path: null, + }, normalized_result: { resource_root: { caller_path: bundle, diff --git a/tests/boundary/cli/objdumpIdentity.test.ts b/tests/boundary/cli/objdumpIdentity.test.ts index 82a342c3de..a6e265419b 100644 --- a/tests/boundary/cli/objdumpIdentity.test.ts +++ b/tests/boundary/cli/objdumpIdentity.test.ts @@ -1,3 +1,4 @@ +import { unknownTarget } from "../../../src/domain/targetIdentity.js"; import { expect } from "vitest"; import { randomUUID } from "node:crypto"; import { tmpdir } from "node:os"; @@ -45,7 +46,11 @@ cliTest( name: "objdump command", version: null, }, - subject: null, + subject: { + identity: unknownTarget("not-observed"), + name: null, + local_path: null, + }, }); const missing = join(tmpdir(), `missing-objdump-${randomUUID()}`); diff --git a/tests/boundary/providers/bundleResourceComposition.test.ts b/tests/boundary/providers/bundleResourceComposition.test.ts index 521aae94ba..c25c4370b7 100644 --- a/tests/boundary/providers/bundleResourceComposition.test.ts +++ b/tests/boundary/providers/bundleResourceComposition.test.ts @@ -1,3 +1,4 @@ +import { unknownTarget } from "../../../src/domain/targetIdentity.js"; import { projectCliAnalysisResult } from "../../../src/cli/projectCliAnalysisResult.js"; import { mkdtemp, mkdir, rm, writeFile } from "node:fs/promises"; import { tmpdir } from "node:os"; @@ -26,7 +27,7 @@ afterEach(async () => { ); }); -it("routes a CLI app resource path through the resource session and preserves null target identity", async () => { +it("routes a CLI app resource path through the resource session and keeps the target identity unknown", async () => { const bundlePath = await mkdtemp(join(tmpdir(), "rea-cli-resource-root-")); temporaryDirectories.push(bundlePath); await mkdir(join(bundlePath, "Resources")); @@ -63,7 +64,11 @@ it("routes a CLI app resource path through the resource session and preserves nu ).then(projectCliAnalysisResult); expect(result).toMatchObject({ operation: "inspect_keyed_archive", - subject: null, + subject: { + identity: unknownTarget("not-observed"), + name: null, + local_path: null, + }, normalized_result: { target_sha256: null, resource_root: { canonical_path: bundlePath, executable_sha256: null },