fix(artifacts): name only host-available workflows for non-archive plists

inspect_keyed_archive runs on every host, but its remediation for an
ordinary property list pointed to inspect_plist, which only macOS
supports. On Linux that sent callers to a workflow the capability layer
rejects.

The domain error now names what the file is. The artifact reader picks
the remediation from the provider's host: inspect_plist on macOS, and
elsewhere the selection of an NSKeyedArchiver archive, with a note that
inspect_plist requires macOS. decode_interface_builder, which is
portable, stays the NIBArchive remediation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kaoru0822
2026-10-09 08:40:45 +00:00
co-authored by Claude Opus 5.5
parent fef38e4d22
commit 22958558ea
4 changed files with 67 additions and 7 deletions
@@ -4,6 +4,7 @@ import { join } from "node:path";
import { build } from "plist";
import { expect, it } from "vitest";
import { ArtifactProvider } from "../../../src/artifacts/ArtifactProvider.js";
import { ArtifactReaderFailure } from "../../../src/artifacts/ArtifactReader.js";
import { inspectBundleKeyedArchive } from "../../../src/artifacts/apple/KeyedArchiveReader.js";
import { AnalysisError } from "../../../src/domain/analysisErrorBase.js";
@@ -36,6 +37,7 @@ const inspect = (bundlePath: string, parameters: Record<string, unknown>) =>
bundlePath,
targetSha256: "a".repeat(64),
parameters,
platform: "darwin",
});
it.each([
@@ -120,6 +122,35 @@ it.each([
},
);
it.each([
["darwin", "Inspect an ordinary property list with inspect_plist"],
[
"linux",
"inspect_plist, which reads ordinary property lists, requires a macOS host",
],
] as const)(
"names the property-list workflow available on a %s host",
async (platform, action) => {
const root = await createTestTempDirectory("rea-keyed-kind-");
const path = join(root, "Defaults.plist");
await writeFile(path, Buffer.from(build({ plain: true })));
const result = await new ArtifactProvider(platform)
.createClient({
path,
sha256: "0".repeat(64),
kind: "artifact",
format: "plist",
})
.execute("inspect_keyed_archive", {});
if (result.ok) throw new Error("Expected an unsupported target");
expect(projectAnalysisError(result.error)).toMatchObject({
code: "unsupported_target",
remediation: { action: expect.stringContaining(action) },
details: { path },
});
},
);
it("keeps a damaged NSKeyedArchiver archive a format failure", async () => {
const root = await bundle();
await writeFile(