Separate graph execution identity from installation provenance
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { specializePackageExport } from "../src/capability-model/generic-packages.js";
|
||||
import assert from "node:assert/strict";
|
||||
import test from "node:test";
|
||||
import fs from "node:fs/promises";
|
||||
@@ -297,3 +298,25 @@ test("typed presentation and factory consumers preserve distinct closed applicat
|
||||
await fs.rm(directory, { recursive: true, force: true });
|
||||
}
|
||||
});
|
||||
|
||||
test("specialized dispatch keys retain nominal arguments, not build provenance", () => {
|
||||
const pkg = definition();
|
||||
const generic = pkg.genericExports![0]!;
|
||||
const environment = {
|
||||
arguments: new Map(),
|
||||
applyInterface: () => {
|
||||
throw Error("unused");
|
||||
},
|
||||
implementsInterface: () => false,
|
||||
};
|
||||
const arguments_ = [{ kind: "value" as const, type: { kind: "scalar" as const, name: "string" as const } }];
|
||||
const original = specializePackageExport(pkg, generic, arguments_, environment);
|
||||
const rebuilt = structuredClone(pkg);
|
||||
rebuilt.source.commit = "f".repeat(40);
|
||||
assert.deepEqual(specializePackageExport(rebuilt, generic, arguments_, environment), original);
|
||||
assert.notEqual(
|
||||
specializePackageExport(rebuilt, generic, [{ kind: "value", type: { kind: "scalar", name: "bool" } }], environment)
|
||||
.id,
|
||||
original.id,
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user