Expose bounded public reflection and presentation discovery
This commit is contained in:
@@ -308,3 +308,35 @@ test("a count-only local query still requires complete relationship admission",
|
||||
assert.throws(() => compileExecutionPlan(workspace), /REPLICA_TRAVERSAL_MISSING|REPLICA_RELATION_INCOMPLETE/);
|
||||
}
|
||||
});
|
||||
|
||||
test("public reflection contains nominal contracts and callable descriptors without private bindings", async () => {
|
||||
const { publicDefinitionSnapshot } = await import("../src/execution-world/public-reflection.js");
|
||||
const plan = compileExecutionPlan(await loadReaderWorkspace());
|
||||
const installation = {
|
||||
codec: "camino-execution-installation-v1" as const,
|
||||
plan: plan.digest,
|
||||
world: "test",
|
||||
packages: plan.definition.workspace.packageImports.map((pkg) => ({
|
||||
revision: pkg.revisionId,
|
||||
root: "private-installation-root",
|
||||
})),
|
||||
components: [],
|
||||
routes: {},
|
||||
};
|
||||
const snapshot = publicDefinitionSnapshot(plan, installation);
|
||||
assert.ok(snapshot.rows.interfaces.length);
|
||||
assert.ok(snapshot.rows.queries.length);
|
||||
assert.ok(snapshot.rows.conformances.length);
|
||||
const publicText = JSON.stringify(snapshot);
|
||||
for (const privateKey of [
|
||||
"privateAttachments",
|
||||
"operationBindings",
|
||||
"relationshipMaterializations",
|
||||
"storagePolicy",
|
||||
"ports",
|
||||
])
|
||||
assert.ok(!publicText.includes('"' + privateKey + '"'), privateKey);
|
||||
assert.ok(publicText.includes('"descriptor"'));
|
||||
assert.ok(publicText.includes('"scope":"class"'));
|
||||
assert.equal(snapshot.id, publicDefinitionSnapshot(plan, installation).id);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user