Deliver complete Evidence directly through MCP with required nullable analysis profiles and immutable per-server delivery settings. Bind selected environments at construction and require typed cleanup outcomes with retained retry ownership. Remove test-only routing, duplicate session and snapshot metadata, producer-field repairs, and ambiguous provider arguments. Separate artifact byte identity from occurrence classification and retain typed source-map and partial native facts across CLI, MCP, and verifier consumers. BREAKING CHANGE: obsolete Evidence envelopes, session aliases, incomplete snapshots, and missing normalized producer facts are no longer accepted.
37 lines
1.5 KiB
TypeScript
37 lines
1.5 KiB
TypeScript
import { mkdir, writeFile } from "node:fs/promises";
|
|
import { join } from "node:path";
|
|
|
|
import { createPackageWithOptions } from "@electron/asar";
|
|
import { expect, it } from "vitest";
|
|
|
|
import { createTestTempDirectory } from "../../../fixtures/temporaryDirectory.js";
|
|
import { createDirectAnalysis } from "../../../../src/composition/directAnalysis.js";
|
|
import { artifactInspectionResultSchema } from "../../../../src/domain/artifactInspection.js";
|
|
import { parseEvidence } from "../../../../src/domain/evidence.js";
|
|
|
|
const { runProviderAnalysis } = createDirectAnalysis({});
|
|
|
|
it("inspects an artifact through the direct CLI workflow without an REA grant", async () => {
|
|
const root = await createTestTempDirectory("rea-artifact-direct-");
|
|
const source = join(root, "source");
|
|
const archive = join(root, "fixture.asar");
|
|
await mkdir(source);
|
|
await writeFile(join(source, "main.js"), "console.log('ok');\n");
|
|
await createPackageWithOptions(source, archive, {});
|
|
|
|
const evidence = parseEvidence(
|
|
await runProviderAnalysis(archive, "inspect_artifact", {}),
|
|
);
|
|
expect(evidence.operation).toBe("inspect_artifact");
|
|
expect(evidence.provider.id).toBe("rea-artifact-graph");
|
|
const inspection = artifactInspectionResultSchema.parse(
|
|
evidence.normalized_result,
|
|
);
|
|
expect(inspection.subject.root_format).toBe("asar");
|
|
expect(inspection.substeps[0]?.evidence.normalized_result).toMatchObject({
|
|
occurrences: expect.arrayContaining([
|
|
expect.objectContaining({ logical_path: "main.js" }),
|
|
]),
|
|
});
|
|
});
|