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:
+52
@@ -0,0 +1,52 @@
|
||||
package p.studio.app.runtime;
|
||||
|
||||
import org.junit.jupiter.api.*;
|
||||
import org.junit.jupiter.api.io.TempDir;
|
||||
import p.studio.api.automation.*;
|
||||
import p.studio.app.assets.SmallAssetProject;
|
||||
import java.nio.file.*;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
/** Provider qualification precedes publication of a consumer capacity profile. No managed-guard bypass in production. */
|
||||
class AssetCapacityInstalledRuntimeTest {
|
||||
@TempDir Path root;
|
||||
@Test void actualInstalledPoolsAcceptSixteenAndRejectSeventeenGlyphAndScenePreloads()throws Exception {
|
||||
Path installation=Path.of(System.getProperty("studio.test.runtimeInstall","")).toRealPath();
|
||||
assertTrue(Files.isExecutable(installation.resolve("prometeu-headless")));
|
||||
var json=new com.fasterxml.jackson.databind.ObjectMapper();var observations=new ArrayList<Map<String,Object>>();
|
||||
for(String type:List.of("glyph","scene"))for(int count:List.of(16,17)) {
|
||||
try(var fixture=new SmallAssetProject(root.resolve(type+count))) {
|
||||
var source=type.equals("scene")?fixture.glyph("source",false):null;
|
||||
for(int i=0;i<count;i++)if(type.equals("glyph"))fixture.glyph("bank"+i,true);else fixture.scene("bank"+i,source,true);
|
||||
var build=fixture.build();assertTrue(build.success(),build.diagnostics().toString());
|
||||
var plan=fixture.packer.workspaceService().planPackWorkspace(new p.packer.messages.PackerProjectContext(fixture.project.name(),fixture.root));
|
||||
assertEquals(count,plan.preload().stream().filter(p->p.bankType().equals(type.toUpperCase(Locale.ROOT))).count());
|
||||
var process=new ProcessBuilder(installation.resolve("prometeu").toString(),"headless","--stdio").directory(fixture.root.toFile()).start();
|
||||
var session=new HeadlessProcessSession(process,json,HeadlessLimits.defaults(),"qualify-"+type+count);
|
||||
var record=new LinkedHashMap<String,Object>();record.put("bankType",type);record.put("preloads",count);record.put("plan",plan);
|
||||
try {
|
||||
session.initializeAndBoot(build.manifestPath().getParent(),fixture.root,false,Map.of());
|
||||
var result=session.advance(1,progress->{});record.put("observation",result.observation());record.put("outcome",result.kind().name());
|
||||
if(count==16){assertEquals(AutomationOutcome.Kind.SUCCEEDED,result.kind(),result.toString());assertEquals(1,result.completedFrames());}
|
||||
else assertNotEquals(AutomationOutcome.Kind.SUCCEEDED,result.kind(),"Seventeenth preload must be rejected by the native pool");
|
||||
}catch(AutomationException failure) {
|
||||
record.put("failure",failure.failure());assertEquals(17,count,"Sixteen native preloads must boot and execute");
|
||||
var nativeFacts=json.valueToTree(failure.failure().runtimeError());
|
||||
assertEquals("boot_failed",nativeFacts.path("code").asText(),nativeFacts.toString());
|
||||
assertEquals("vm_panic",nativeFacts.path("details").path("fault").path("kind").asText(),nativeFacts.toString());
|
||||
assertEquals("Cartridge preload failed: BackendError",nativeFacts.path("details").path("fault").path("message").asText(),nativeFacts.toString());
|
||||
}finally {
|
||||
record.put("nativeObservation",session.observation());
|
||||
try{session.shutdown().toCompletableFuture().get(7,TimeUnit.SECONDS);}finally{if(session.alive())session.abort("Capacity qualification cleanup");}
|
||||
}
|
||||
record.put("expected",count==16?"accepted":"rejected");observations.add(record);
|
||||
}
|
||||
}
|
||||
Path output=Path.of("build/asset-authoring-qualification");Files.createDirectories(output);
|
||||
var executables=new TreeMap<String,String>();for(String file:List.of("prometeu","prometeu-headless","prometeu-runtime"))executables.put(file,HexFormat.of().formatHex(java.security.MessageDigest.getInstance("SHA-256").digest(Files.readAllBytes(installation.resolve(file)))));
|
||||
var nativeObservation=(RuntimeObservation)observations.getFirst().get("nativeObservation");
|
||||
json.writerWithDefaultPrettyPrinter().writeValue(output.resolve("native-capacity-boundaries.json").toFile(),Map.of("installation",installation.toString(),"runtimeVersion",nativeObservation.nativeDetails().get("runtimeVersion"),"executables",executables,"observations",observations,"scope","Actual packaged native 16/17 qualification, glyph/scene only; no runtime writes/builds or larger guest budgets. Native rejection reports the existing aggregate preload BackendError, not a fabricated slot detail."));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user