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:
@@ -73,7 +73,7 @@ class HeadlessMcpDesktopTest {
|
||||
server = app.getBean(LocalMcpServer.class); client = HttpClient.newHttpClient();
|
||||
fx(() -> {
|
||||
locale = new I18nService(); locale.setLocale(Locale.ENGLISH);
|
||||
dev = new DevWorkspace(reference, project.automation(), locale, new StudioEventBus(), app.getBean(AgentConnectionGuide.class));
|
||||
dev = new DevWorkspace(reference, project.automation(), locale, new StudioEventBus(), app.getBean(AgentConnectionGuide.class), project.diagnosticSources());
|
||||
stage = new Stage(); stage.setTitle("Real MCP / headless / DEV conformance");
|
||||
stage.setScene(new Scene((javafx.scene.Parent) dev.rootNode(), 1000, 800)); stage.show(); dev.load();
|
||||
});
|
||||
@@ -144,6 +144,39 @@ class HeadlessMcpDesktopTest {
|
||||
assertArrayEquals(png(call("studio_operation_get", args().put("clientRequestId", "cancel-me"))), project.automation().snapshot().capture().png());
|
||||
}
|
||||
|
||||
@Test void observationInspectorAndHttpDistinguishHistoricalAdvanceCurrentResetAndReturnedControl() throws Exception {
|
||||
acquire(); build("observation-build"); boot();
|
||||
value(call("studio_headless_advance", args().put("clientRequestId", "observed").put("frames", 3)));
|
||||
var finished = value(completed("observed"));
|
||||
assertEquals(3, finished.path("observation").path("progress").path("completedFrames").asInt());
|
||||
assertEquals("observed", finished.path("observation").path("context").path("clientRequestId").asText());
|
||||
var reset = value(call("studio_headless_reset", args()));
|
||||
assertEquals("UNBOOTED", reset.path("observation").path("lifecycle").asText());
|
||||
var queried = value(call("studio_operation_get", args().put("clientRequestId", "observed")));
|
||||
assertEquals(finished.path("observation"), queried.path("observation"));
|
||||
assertEquals("UNBOOTED", queried.path("currentObservation").path("lifecycle").asText());
|
||||
var context = value(call("studio_project_context", mapper.createObjectNode().put("projectRoot", root.toString())));
|
||||
assertEquals("AGENT_WORKING", context.path("control").path("state").asText());
|
||||
assertEquals("UNBOOTED", context.path("runtime").path("lifecycle").asText());
|
||||
fx(() -> {
|
||||
var tree = (TreeView<?>)dev.rootNode().lookup("#dev-runtime-observation");
|
||||
assertNotNull(tree); assertEquals(3, tree.getRoot().getChildren().size());
|
||||
assertTrue(treeContains(tree.getRoot().getChildren().get(1), "lifecycle: UNBOOTED"));
|
||||
assertTrue(treeContains(tree.getRoot().getChildren().get(0), "state: AGENT_WORKING"));
|
||||
});
|
||||
var released = value(call("studio_control_release", args()));
|
||||
assertEquals("MANUAL", released.path("control").path("state").asText());
|
||||
assertEquals("COMPLETED", released.path("control").path("cleanup").asText());
|
||||
assertTrue(released.path("control").path("taskRevoked").asBoolean());
|
||||
fx(() -> {
|
||||
var tree = (TreeView<?>)dev.rootNode().lookup("#dev-runtime-observation");
|
||||
assertTrue(treeContains(tree.getRoot().getChildren().get(0), "cleanup: COMPLETED"));
|
||||
});
|
||||
}
|
||||
private static boolean treeContains(TreeItem<?> item, String expected) {
|
||||
return expected.equals(item.getValue()) || item.getChildren().stream().anyMatch(child -> treeContains(child, expected));
|
||||
}
|
||||
|
||||
@Test void revokeWaitsForRuntimeAndDocumentRefreshAndRejectsLateCalls() throws Exception {
|
||||
prepareLongRun();
|
||||
value(call("studio_headless_advance", args().put("clientRequestId", "before-revoke").put("frames", 1)));
|
||||
@@ -164,7 +197,11 @@ class HeadlessMcpDesktopTest {
|
||||
String edited = Files.readString(source) + "\n// external edit retained on revoke\n"; Files.writeString(source, edited);
|
||||
startRunning("revoked");
|
||||
fx(() -> ((Button) dev.rootNode().lookup("#dev-reclaim")).fire());
|
||||
refreshEntered.get(10, TimeUnit.SECONDS);
|
||||
try { refreshEntered.get(10, TimeUnit.SECONDS); }
|
||||
catch (TimeoutException failure) {
|
||||
throw new AssertionError("Return did not reach document refresh: " + project.automation().snapshot().controlObservation()
|
||||
+ "; runtime=" + project.automation().snapshot().runtimeObservation(), failure);
|
||||
}
|
||||
assertEquals(ControlState.RETURNING_CONTROL, project.automation().snapshot().state());
|
||||
assertFalse(project.automation().snapshot().manualAllowed());
|
||||
assertEquals(401, post(request("ping")).statusCode());
|
||||
@@ -280,7 +317,7 @@ class HeadlessMcpDesktopTest {
|
||||
@Test void fullHttpLoopMatchesRawRuntimePixelsAndDisplayedDevAcrossResetAndRebuild() throws Exception {
|
||||
assertEquals(401, post(request("ping")).statusCode());
|
||||
grant();
|
||||
assertEquals(22, mapper.readTree(post(request("tools/list")).body()).path("result").path("tools").size());
|
||||
assertEquals(48, mapper.readTree(post(request("tools/list")).body()).path("result").path("tools").size());
|
||||
assertTrue(value(call("studio_project_context", args())).path("languages").toString().contains("pbs"));
|
||||
value(call("studio_reference_read", args().put("referenceId", "pbs:quickstart").put("limit", 100)));
|
||||
var sdk = value(call("studio_reference_read", args().put("referenceId", "pbs:sdk:game:1:sdk/input/main.pbs").put("limit", 1000)));
|
||||
@@ -364,7 +401,8 @@ class HeadlessMcpDesktopTest {
|
||||
var raw = oracle.call("capture");
|
||||
var image = call("studio_headless_capture", args());
|
||||
assertArrayEquals(png(result), png(image));
|
||||
assertEquals(value(result).path("capture"), value(image));
|
||||
var imageMetadata = ((ObjectNode)value(image)).deepCopy(); imageMetadata.remove("observation");
|
||||
assertEquals(value(result).path("capture"), imageMetadata);
|
||||
compareCapture(raw, image, logical[i], x[i]);
|
||||
captures.add(raw.deepCopy());
|
||||
var actualState = value(call("studio_headless_state", args())).path("state");
|
||||
|
||||
Reference in New Issue
Block a user