feat(pbs): add Set and reusable identity hashing
This commit is contained in:
@@ -31,6 +31,10 @@ public final class InstalledKnowledgeProbe {
|
||||
check(docs.stream().anyMatch(r -> r.id().equals("pbs:example:game:1:src/collections.pbs")), "Missing installed List/Cursor example");
|
||||
check(docs.stream().anyMatch(r -> r.id().equals("pbs:spec:sdk-linked-and-cursor.md")), "Missing installed Linked specification");
|
||||
check(docs.stream().anyMatch(r -> r.id().equals("pbs:example:game:1:src/linked.pbs")), "Missing installed Linked example");
|
||||
check(docs.stream().anyMatch(r -> r.id().equals("pbs:spec:sdk-set-and-identity.md")), "Missing installed Set/Identity specification");
|
||||
check(docs.stream().anyMatch(r -> r.id().equals("pbs:example:game:1:src/sets.pbs")), "Missing installed Set example");
|
||||
check(docs.stream().anyMatch(r -> r.id().equals("pbs:example:game:1:src/hashing.pbs")), "Missing installed hashing example");
|
||||
check(docs.stream().anyMatch(r -> r.id().equals("pbs:sdk:game:1:sdk/hash/main.pbs")), "Missing installed hash SDK");
|
||||
for (var reference : docs) {
|
||||
if (reference.id().startsWith("pbs:example:game:1:")) {
|
||||
Path file = root.resolve(reference.id().substring("pbs:example:game:1:".length()));
|
||||
@@ -91,6 +95,20 @@ public final class InstalledKnowledgeProbe {
|
||||
check(linkedResult.diagnostics().stream().noneMatch(issue->issue.isError()),"Installed Linked example must compile");
|
||||
Files.write(fixtures.resolve("pbs-linked-installed.pbx"),linkedResult.bytecodeBytes());
|
||||
System.out.println("Installed Linked execution fixture generated");
|
||||
for(var example:java.util.Map.of("set","sets.pbs","hash","hashing.pbs").entrySet()) {
|
||||
Path exampleRoot=Files.createDirectory(Path.of(example.getKey()+"-example")).toRealPath();
|
||||
Files.createDirectories(exampleRoot.resolve("src"));
|
||||
Files.copy(root.resolve("prometeu.json"),exampleRoot.resolve("prometeu.json"));
|
||||
Files.writeString(exampleRoot.resolve("src/mod.barrel"),"pub fn frame() -> void;");
|
||||
String function=example.getKey().equals("set")?"setExample":"hashingExample";
|
||||
Files.writeString(exampleRoot.resolve("src/main.pbs"),Files.readString(root.resolve("src/"+example.getValue()))
|
||||
+"\n[Frame] fn frame()->void {if "+function+"()!=42 {let failure=1/0;}}");
|
||||
var exampleResult=BuilderPipelineService.INSTANCE.compile(
|
||||
BuilderPipelineContext.fromConfig(new BuilderPipelineConfig(false,exampleRoot.toString())),LogAggregator.stdout());
|
||||
check(exampleResult.diagnostics().stream().noneMatch(issue->issue.isError()),"Installed "+example.getKey()+" example must compile: "+exampleResult.diagnostics());
|
||||
Files.write(fixtures.resolve("pbs-"+example.getKey()+"-installed.pbx"),exampleResult.bytecodeBytes());
|
||||
System.out.println("Installed "+example.getKey()+" execution fixture generated");
|
||||
}
|
||||
verifyExternalSources(provider.getClass().getClassLoader());
|
||||
registration.unsubscribe();
|
||||
System.out.println("Installed knowledge verified: " + docs.size() + " references; example compiled");
|
||||
|
||||
Reference in New Issue
Block a user