Keep checked execution groups and public catalog preparation cooperative

This commit is contained in:
Timothy J. Aveni
2026-10-12 19:21:34 -07:00
parent a4ba6169a6
commit 47b316180d
6 changed files with 243 additions and 228 deletions
+16 -3
View File
@@ -7,6 +7,7 @@ import {
checkExecutionWorld,
checkedWorldDigest,
implementationDigest,
clientContractCatalog,
hexDigest,
parsePackageArtifacts,
artifactPath,
@@ -386,7 +387,13 @@ test("public reflection contains nominal contracts and callable descriptors with
routes: {},
};
const kernel = compileKernelProgram(plan) as import("../src/execution-world/inspection.js").InspectionKernel;
const snapshot = publicDefinitionSnapshot(plan, installation, kernel);
const catalog = await clientContractCatalog(
plan,
installation,
installation.packages.map((pkg) => pkg.revision),
kernel,
);
const snapshot = await publicDefinitionSnapshot(plan, kernel, catalog);
assert.ok(snapshot.rows.interfaces.length);
assert.ok(snapshot.rows.queries.length);
assert.ok(snapshot.rows.conformances.length);
@@ -401,13 +408,19 @@ test("public reflection contains nominal contracts and callable descriptors with
assert.ok(!publicText.includes('"' + privateKey + '"'), privateKey);
assert.ok(publicText.includes('"descriptor"'));
assert.ok(publicText.includes('"scope":"class"'));
assert.equal(snapshot.id, publicDefinitionSnapshot(plan, installation, kernel).id);
assert.equal(snapshot.id, (await publicDefinitionSnapshot(plan, kernel, catalog)).id);
// Historical checked availability must survive a newer host compiler. If
// reflection silently regenerates the Kernel, this evidence disappears.
const historical = structuredClone(kernel);
const installed = historical.operations.find((operation) => !operation.unsupported)!;
assert.ok(installed);
installed.unsupported = "CHECKED_HISTORICAL_UNSUPPORTED";
const historicalSnapshot = publicDefinitionSnapshot(plan, installation, historical);
const historicalCatalog = await clientContractCatalog(
plan,
installation,
installation.packages.map((pkg) => pkg.revision),
historical,
);
const historicalSnapshot = await publicDefinitionSnapshot(plan, historical, historicalCatalog);
assert.match(JSON.stringify(historicalSnapshot.rows.conformances), /CHECKED_HISTORICAL_UNSUPPORTED/);
});