feat(studio): deliver asset authoring and automation workflows
Add shared human/task asset batches with reviewed atomic publication, explicit reference rebinds, ownership inspection and qualified glyph/scene budgets. Expose the same authoring and capacity results through Assets and MCP. Deliver isolated guest test targets, retained visual evidence and immutable runtime lifecycle/control observations. Preserve provider qualification and installed authoring examples alongside the completed discussion lessons. Close AGD-106 coordination and the delivered discussion workflows through housekeeping, updating lesson references and preserving qualification limits. Sound remains outside the asset delivery wave. Validation: 579 module tests and 31 additional desktop, process and installed checks passed; native glyph/scene 16/17 boundaries qualified. Discussion validation passed after housekeeping.
This commit is contained in:
@@ -21,9 +21,27 @@ public final class InstalledKnowledgeProbe {
|
||||
check(!Files.exists(Path.of("settings.gradle.kts")) && !Files.exists(Path.of("docs")), "No repository in working directory");
|
||||
verifyRuntimeCatalogs(provider.getClass().getClassLoader());
|
||||
if (arguments.length == 1 && arguments[0].equals("--catalog-only")) return;
|
||||
var guideType = Class.forName("p.studio.app.mcp.McpConnectionGuide");
|
||||
check(guideType.getProtectionDomain().getCodeSource().getLocation().getPath().endsWith(".jar"), "Lifecycle guide must come from installed JAR");
|
||||
var guide = (String)guideType.getField("INSTRUCTIONS").get(null);
|
||||
for (var requirement : java.util.List.of("studio_tests_start", "studio_tests_transcript", "disposable_reopen", "studio_evidence_persist", "studio_evidence_compare", "explicit alpha", "human manual-control", "studio_headless_reset", "same buildId", "Unknown completedFrames is null",
|
||||
"memcardChoice", "details.control", "clientRequestId", "studio_assets_preview", "studio_assets_commit", "studio_assets_result", "Sound is deferred"))
|
||||
check(guide.contains(requirement), "Missing installed recovery guidance: " + requirement);
|
||||
System.out.println("Installed lifecycle and recovery guide verified");
|
||||
Path root = Files.createDirectory(Path.of("example")).toRealPath();
|
||||
var docs = provider.documentation().orElseThrow().references(1, p.studio.AppMode.Game);
|
||||
verifySpecificationAliases(provider.getClass().getClassLoader(), docs);
|
||||
var assetGuide=docs.stream().filter(r->r.id().equals("pbs:example:game:1:asset-authoring/GUIDE.md")).findFirst().orElseThrow();
|
||||
for(var term:java.util.List.of("compose_palettes","SCENE_TILED_V1","affectedReferences","cartridge","Sound"))check(assetGuide.text().contains(term),"Missing installed asset guidance: "+term);
|
||||
try(var input=guideType.getClassLoader().getResourceAsStream("asset-capacity/catalog.json")) {
|
||||
check(input!=null,"Missing installed capacity catalog");var profile=new ObjectMapper().readTree(input).path("profiles").get(0).path("profile");
|
||||
check(!profile.path("limits").has("sound"),"Sound is outside this qualification");
|
||||
for(var boundary:profile.path("evidence"))try(var evidence=guideType.getClassLoader().getResourceAsStream(boundary.path("evidencePath").asText())) {
|
||||
check(evidence!=null,"Missing installed boundary evidence");check(java.util.HexFormat.of().formatHex(java.security.MessageDigest.getInstance("SHA-256").digest(evidence.readAllBytes())).equals(boundary.path("evidenceSha256").asText()),"Installed capacity evidence changed");
|
||||
}
|
||||
}
|
||||
System.out.println("Installed shared asset authoring and capacity evidence verified");
|
||||
|
||||
check(docs.stream().anyMatch(r -> r.id().equals("pbs:spec:generic-contracts.md")), "Missing installed generic-contract specification");
|
||||
check(docs.stream().anyMatch(r -> r.id().equals("pbs:example:game:1:src/contracts.pbs")), "Missing installed generic-contract example");
|
||||
check(docs.stream().anyMatch(r -> r.id().equals("pbs:spec:generic-structs-and-free-functions.md")), "Missing installed generic struct/function specification");
|
||||
@@ -78,6 +96,7 @@ public final class InstalledKnowledgeProbe {
|
||||
check(result.bytecodeModule().functions().stream().filter(f -> f.metadata().role() == role).count() == 1,
|
||||
"Installed example must preserve exactly one " + role);
|
||||
}
|
||||
verifyIsolatedTargets(root.resolve("isolated-tests"));
|
||||
Path listRoot=Files.createDirectory(Path.of("list-example")).toRealPath();
|
||||
Files.createDirectories(listRoot.resolve("src"));
|
||||
Files.copy(root.resolve("prometeu.json"),listRoot.resolve("prometeu.json"));
|
||||
@@ -143,6 +162,28 @@ public final class InstalledKnowledgeProbe {
|
||||
if (!condition) throw new AssertionError(message);
|
||||
}
|
||||
|
||||
private static void verifyIsolatedTargets(Path root) throws Exception {
|
||||
var originals = new java.util.HashMap<Path, byte[]>();
|
||||
try (var files = Files.walk(root.resolve("src"))) {
|
||||
for (var file : files.filter(Files::isRegularFile).toList()) originals.put(file, Files.readAllBytes(file));
|
||||
}
|
||||
for (var target : java.util.List.of("life", "life-fail", "production")) {
|
||||
Path output = target.equals("production") ? null : root.resolve(".studio/test-builds/" + target + "/installed");
|
||||
var config = target.equals("production") ? new BuilderPipelineConfig(false, root.toString())
|
||||
: new BuilderPipelineConfig(false, root.toString(), null, null, target, output);
|
||||
var result = BuilderPipelineService.INSTANCE.compile(BuilderPipelineContext.fromConfig(config), LogAggregator.stdout());
|
||||
check(result.diagnostics().stream().noneMatch(issue -> issue.isError()),
|
||||
"Installed isolated target must compile: " + target + " " + result.diagnostics());
|
||||
check(result.bytecodeBytes().length > 0, "Installed isolated target must produce bytecode: " + target);
|
||||
boolean logs = result.bytecodeModule().syscalls().stream().anyMatch(call -> call.module().equals("log"));
|
||||
check(logs == !target.equals("production"), "Test log support must remain outside production: " + target);
|
||||
for (var original : originals.entrySet())
|
||||
check(java.util.Arrays.equals(original.getValue(), Files.readAllBytes(original.getKey())),
|
||||
"Installed target must preserve production source/barrel: " + original.getKey());
|
||||
}
|
||||
System.out.println("Installed isolated targets verified: life, life-fail and default production");
|
||||
}
|
||||
|
||||
private static void verifySpecificationAliases(ClassLoader loader,
|
||||
java.util.List<p.studio.compiler.services.FrontendReferenceProvider.Reference> docs) throws Exception {
|
||||
var resource = loader.getResource("pbs-knowledge/index.json");
|
||||
|
||||
Reference in New Issue
Block a user