diff --git a/README.md b/README.md index 339e013f..b592a604 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,14 @@ Run these commands from the Studio repository root: ./gradlew :prometeu-app:run ``` +`./gradlew run` from this repository root also starts only the product. The +standalone foundation shell is an explicit developer command, +`./gradlew :prometeu-studio-ui-javafx-2:run`; it does not open after Studio exits. + +The project chooser contains project commands and inherits your presentation +preferences. Language, theme, typeface and scale controls belong to the project +window. Closing the chooser exits Studio without opening a shell. + Open an existing project from the project chooser and select a qualified runtime installation. Use Play, Pause, Resume and Stop to run the game inside Studio. Games with saves require an existing development save image or an explicitly diff --git a/build.gradle.kts b/build.gradle.kts index e99ce379..9c5f7d53 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -10,6 +10,13 @@ repositories { dependencies { } +// An unqualified `run` must launch the product, not every application subproject. +tasks.register("run") { + group = "application" + description = "Starts Prometeu Studio. Foundation demos have explicit module tasks." + dependsOn(":prometeu-app:run") +} + val jacocoTestReport = tasks.register("jacocoTestReport") { group = "Verification" description = "Generates consolidated unit-test coverage for all subprojects." diff --git a/docs/development.md b/docs/development.md index cbf872c0..8197500f 100644 --- a/docs/development.md +++ b/docs/development.md @@ -169,6 +169,31 @@ environment, scaffolding/preparation and JavaFX startup. ### Integrated Play +The product starts with a separate project launcher. Add selects a `prometeu.json` +and remembers the project without opening it; Forget removes only the reference. +New Project opens a five-step wizard using the language catalogue. Successful +creation opens the project through the same shield as an existing project. The +shield follows actual opening steps and remains visible for at least one second, +counted in parallel with preparation. Opening a project does not compile or start +the game. Closing its window stops execution and returns to the launcher. + +The launcher inherits presentation preferences and has no language, theme, +typeface or scale controls. Closing it exits Studio. `./gradlew run` at the root +launches only the product; the independent shell/gallery require their explicit +module commands and do not run after the product closes. + +Qualify these windows without a native runtime using disposable projects and +isolated presentation storage: + +```bash +./gradlew :prometeu-app:studioProjectsDesktopTest +``` + +Scene captures and environment metadata are written to +`prometeu-app/build/projects-desktop-captures`. This gate covers the catalogue, +wizard, appearance, geometry, failure feedback and late-session cleanup; the +separate Play gates below exercise the native process and game lifecycle. + Requires a desktop environment and an installed native runtime: ```bash diff --git a/docs/specs/studio/14. Integrated Play Specification.md b/docs/specs/studio/14. Integrated Play Specification.md index d30dffcb..0289e16e 100644 --- a/docs/specs/studio/14. Integrated Play Specification.md +++ b/docs/specs/studio/14. Integrated Play Specification.md @@ -9,9 +9,14 @@ The normal `prometeu-app` launcher and managed installation MUST use development entry points. The previous frontend is retained for existing adapter qualification; its workspaces are not mounted in the new product. -Startup MUST show known projects and an action to open an existing project -directory. A project MUST be closed before another can open. Closing returns to -the chooser. Startup MUST NOT automatically restore the previous project. +Startup MUST show a separate compact project launcher with known projects and +actions to add an existing `prometeu.json`, open, forget and create a project. +Opening MUST hide the launcher and present a separate loading shield; the project +window MUST appear only after preparation and the minimum shield duration. +A project MUST be closed before another can open. Closing returns to the +launcher after execution and session cleanup. Startup MUST NOT automatically +restore the previous project. Project-window geometry MUST be restored per +project through the neutral window-state port. This slice exposes Play, Pause, Resume, Stop, a game viewport, and bounded logs. It MUST NOT initialize an AI client or editor/LSP infrastructure when opening for @@ -19,11 +24,70 @@ Play. Existing headless, MCP, evidence, tests and agent contracts remain availab through their existing entry points and services. Their preservation takes precedence over interactive convenience. -Project creation UI, editors, workspaces, AI prompts, tuning during Play, +Editors, workspaces, AI prompts, tuning during Play, breakpoints, hot reload, PMC builds and distribution/export are outside this slice. Future packaging belongs in Studio as a separate action; Play MUST NOT implicitly package a PMC or a distributable runtime. +## Project selection, creation and loading + +The launcher MUST reuse the persisted known-project catalogue, ordered by name, +and display name, version, language, stdlib and path. Open and Forget MUST require +a selection; Open MUST also work by double click or Enter. Adding a manifest MUST +validate, remember and select it without automatically opening. Forget MUST remove +only the catalogue reference, never files. Cancelled file selection MUST leave the +catalogue unchanged. Empty and failed states MUST provide visible feedback. +The launcher MUST contain project selection/management and identity only, without +global language, theme, typeface or scale controls. It MUST inherit the existing +presentation settings; those controls belong to the project window. Closing the +launcher MUST exit Studio without presenting an empty project/foundation shell. +The internal project frame MUST grow and shrink with the available launcher width +and height, allocating additional height to the project list. Smaller viewports or +larger text scales MUST retain scrolling so project commands remain accessible. + +The creation wizard MUST use UI2 components and preserve five steps: name, +language/stdlib/source root, indentation/runtime details, parent location and +confirmation. Options MUST come from `ProjectLanguageCatalog`, with Game as the +target. Back MUST preserve input. Cancel MUST return to selection; creation and +persistence MUST execute off the FX thread. Successful creation MUST remember and +open the project through the common loading flow. A failed opening after creation +MUST explain that the project exists and can be opened again. Partial creation +MUST retain diagnostics and identify its location without deleting files as an +automatic rollback. The catalogue's existing machine-local MCP configuration +preparation remains available; it does not start an AI client or LSP. + +The opening coordinator MUST expose real steps for catalogue validation, +`openForPlay()` session acquisition, known-project persistence and FX view +composition. The sequence MUST accommodate future steps without enabling them in +this slice. It MUST NOT initialize the previous workspace initializer merely to +provide the loading mechanism. Unmeasurable work MUST use indeterminate progress; +time-driven percentages MUST NOT stand in for actual progress. + +The shield MUST identify Studio, its version, the project and current phase. It +MUST remain visible for at least one second, measured with a monotonic clock from +presentation, in parallel with preparation. The project is ready when validation, +session acquisition, required persistence and view composition succeed. If ready +before the minimum, show completion while awaiting the remainder; if slower, +there MUST be no additional full-second delay. This is independent of native +runtime READY and first-frame delivery, which belong to Play. + +Each opening attempt MUST own its pending session, timer and callbacks until +handoff or cleanup. Failures at every step, including executor admission and FX +composition, MUST release acquired resources before enabling another opening and +return to selection with a visible error after the minimum. Cleanup failure MUST +retain recovery feedback and block new openings until explicitly retried cleanup +succeeds. There MUST be no automatic opening retry. Application exit MUST cancel +the cosmetic delay, prevent late presentation and still release late-arriving +sessions; cancelling a future is not proof of resource release. + +IO, session teardown and operation waits MUST stay off the FX thread. Window +transitions MUST NOT accidentally exit JavaFX while all stages are hidden. +Launcher, wizard, shield and project MUST share UI2 theme, locale, typeface and +scale, with scrolling as needed to keep commands accessible. The launcher MUST +request application exit when closed; closing the project window MUST request +project closure and return to selection under the existing Stop/save rules. +Timers, views and appearance subscriptions MUST be disposed with their owners. + ## Preparation, process and authority Play MUST reuse the compiler/Packer/Shipper preparation pipeline to produce the @@ -143,6 +207,12 @@ called end-to-end input latency or physical scanout latency. CPU/heap observatio and hardware/OS/build flavor MUST accompany performance claims. A heap-used sample does not prove retained-memory bounds; ownership and resource tests do. +`studioProjectsDesktopTest` qualifies real launcher/wizard/shield/project window +transitions with isolated projects/preferences and filesystem catalogue services. +It does not require or qualify native execution. Its snapshots include environment +metadata under `prometeu-app/build/projects-desktop-captures`. Unit tests with a +controlled clock cover fast/slow loading, failure, cleanup retry and late results. + Executed functional qualification includes macOS ARM64 with Java 25 and the release umbrella distribution produced by `runtime/scripts/local-dist.sh`, including real Pong Play and the deterministic headless process. Capacity qualification identifies diff --git a/prometeu-app/build.gradle.kts b/prometeu-app/build.gradle.kts index 1dba5470..d861ca78 100644 --- a/prometeu-app/build.gradle.kts +++ b/prometeu-app/build.gradle.kts @@ -167,6 +167,19 @@ tasks.withType().configureEach { tasks.named("test") { exclude("**/StudioPlayProcessTest.class") } tasks.named("test") { exclude("**/StudioPlayDesktopTest.class") } +tasks.named("test") { exclude("**/StudioProjectsDesktopTest.class") } +tasks.register("studioProjectsDesktopTest") { + group = "verification" + description = "Qualifies launcher, new-project wizard, loading shield and window lifecycle on a desktop." + testClassesDirs = sourceSets["test"].output.classesDirs + classpath = sourceSets["test"].runtimeClasspath + useJUnitPlatform() + include("**/StudioProjectsDesktopTest.class") + systemProperty("java.awt.headless", "false") + systemProperty("studio.test.projectsCaptures", layout.buildDirectory.dir("projects-desktop-captures").get().asFile.absolutePath) + outputs.upToDateWhen { false } + testLogging.showStandardStreams = true +} tasks.register("studioPlayDesktopTest") { group = "verification" description = "Qualifies the default Play frontend with an installed native runtime and a desktop." diff --git a/prometeu-app/src/main/java/p/studio/app/StudioUiFactory.java b/prometeu-app/src/main/java/p/studio/app/StudioUiFactory.java index 7516d3b5..763adaab 100644 --- a/prometeu-app/src/main/java/p/studio/app/StudioUiFactory.java +++ b/prometeu-app/src/main/java/p/studio/app/StudioUiFactory.java @@ -42,7 +42,7 @@ public final class StudioUiFactory { public p.studio.ui.javafx2.window.StudioWindowCoordinator2 createInteractive(Stage stage){ if(interactiveResources==null)throw new IllegalStateException("Interactive resources were not initialized"); return new p.studio.ui.javafx2.window.StudioWindowCoordinator2(stage,projectCatalog,knownProjects,projectSessionFactory, - Objects.requireNonNull(interactiveExecutions),setupSaver,executor,interactiveResources); + Objects.requireNonNull(interactiveExecutions),setupSaver,executor,interactiveResources,languageCatalog,windowStateStore); } private final ProjectCatalog projectCatalog; private final KnownProjects knownProjects; diff --git a/prometeu-app/src/main/resources/asset-capacity/catalog.json b/prometeu-app/src/main/resources/asset-capacity/catalog.json index 62ade377..275e132b 100644 --- a/prometeu-app/src/main/resources/asset-capacity/catalog.json +++ b/prometeu-app/src/main/resources/asset-capacity/catalog.json @@ -231,6 +231,39 @@ "prometeu-headless": "16aa375c2f79884f45d4a54f62bcaa25d62949ff96295422bc4a8e41d10e66a0", "prometeu-runtime": "2ba89830c9588e2854ee9feed0dea92506f22b08224523cea66d5701f66e0046" } + }, + { + "profile": { + "contractVersion": 1, + "profileId": "native-bundle-70741fd42462f538ab02c15999e5eed0c9347cb0983848e30202cd71d6434aed", + "runtimeVersion": "0.1.0", + "executableSha256": "a6870f026926d45135e5ee31910fb0291648620bae290a1120d2ca2579ea5f94", + "limits": { + "glyph": 16, + "scene": 16 + }, + "evidence": [ + { + "bankType": "glyph", + "acceptedPreloads": 16, + "rejectedPreloads": 17, + "evidencePath": "asset-capacity/evidence/native-bundle-70741fd42462f538ab02c15999e5eed0c9347cb0983848e30202cd71d6434aed.json", + "evidenceSha256": "09070c30416bcd12e20a18cb23fabe26a720e49b480f8395f873e2111aaf74e5" + }, + { + "bankType": "scene", + "acceptedPreloads": 16, + "rejectedPreloads": 17, + "evidencePath": "asset-capacity/evidence/native-bundle-70741fd42462f538ab02c15999e5eed0c9347cb0983848e30202cd71d6434aed.json", + "evidenceSha256": "09070c30416bcd12e20a18cb23fabe26a720e49b480f8395f873e2111aaf74e5" + } + ] + }, + "executables": { + "prometeu": "a6870f026926d45135e5ee31910fb0291648620bae290a1120d2ca2579ea5f94", + "prometeu-headless": "5107d2d0fc30149cb2ece3124b0622654bd991871d6a3c2b26f22e97dd2645f9", + "prometeu-runtime": "a29e75597ffb7110854452c9ce4802167a78e62f6b19526bc12b83584a52996f" + } } ] } diff --git a/prometeu-app/src/main/resources/asset-capacity/evidence/native-bundle-70741fd42462f538ab02c15999e5eed0c9347cb0983848e30202cd71d6434aed.json b/prometeu-app/src/main/resources/asset-capacity/evidence/native-bundle-70741fd42462f538ab02c15999e5eed0c9347cb0983848e30202cd71d6434aed.json new file mode 100644 index 00000000..06f7294d --- /dev/null +++ b/prometeu-app/src/main/resources/asset-capacity/evidence/native-bundle-70741fd42462f538ab02c15999e5eed0c9347cb0983848e30202cd71d6434aed.json @@ -0,0 +1,1675 @@ +{ + "observations" : [ { + "bankType" : "glyph", + "preloads" : 16, + "plan" : { + "banks" : [ { + "assetId" : 1, + "reference" : "asset:id:1", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/glyph16/assets/bank0/", + "bankType" : "GLYPH", + "buildSelected" : true, + "included" : true, + "contentCount" : 1, + "metadata" : { + "tile_size" : "16x16" + }, + "coldDependencies" : [ ] + }, { + "assetId" : 2, + "reference" : "asset:id:2", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/glyph16/assets/bank1/", + "bankType" : "GLYPH", + "buildSelected" : true, + "included" : true, + "contentCount" : 1, + "metadata" : { + "tile_size" : "16x16" + }, + "coldDependencies" : [ ] + }, { + "assetId" : 11, + "reference" : "asset:id:11", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/glyph16/assets/bank10/", + "bankType" : "GLYPH", + "buildSelected" : true, + "included" : true, + "contentCount" : 1, + "metadata" : { + "tile_size" : "16x16" + }, + "coldDependencies" : [ ] + }, { + "assetId" : 12, + "reference" : "asset:id:12", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/glyph16/assets/bank11/", + "bankType" : "GLYPH", + "buildSelected" : true, + "included" : true, + "contentCount" : 1, + "metadata" : { + "tile_size" : "16x16" + }, + "coldDependencies" : [ ] + }, { + "assetId" : 13, + "reference" : "asset:id:13", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/glyph16/assets/bank12/", + "bankType" : "GLYPH", + "buildSelected" : true, + "included" : true, + "contentCount" : 1, + "metadata" : { + "tile_size" : "16x16" + }, + "coldDependencies" : [ ] + }, { + "assetId" : 14, + "reference" : "asset:id:14", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/glyph16/assets/bank13/", + "bankType" : "GLYPH", + "buildSelected" : true, + "included" : true, + "contentCount" : 1, + "metadata" : { + "tile_size" : "16x16" + }, + "coldDependencies" : [ ] + }, { + "assetId" : 15, + "reference" : "asset:id:15", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/glyph16/assets/bank14/", + "bankType" : "GLYPH", + "buildSelected" : true, + "included" : true, + "contentCount" : 1, + "metadata" : { + "tile_size" : "16x16" + }, + "coldDependencies" : [ ] + }, { + "assetId" : 16, + "reference" : "asset:id:16", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/glyph16/assets/bank15/", + "bankType" : "GLYPH", + "buildSelected" : true, + "included" : true, + "contentCount" : 1, + "metadata" : { + "tile_size" : "16x16" + }, + "coldDependencies" : [ ] + }, { + "assetId" : 3, + "reference" : "asset:id:3", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/glyph16/assets/bank2/", + "bankType" : "GLYPH", + "buildSelected" : true, + "included" : true, + "contentCount" : 1, + "metadata" : { + "tile_size" : "16x16" + }, + "coldDependencies" : [ ] + }, { + "assetId" : 4, + "reference" : "asset:id:4", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/glyph16/assets/bank3/", + "bankType" : "GLYPH", + "buildSelected" : true, + "included" : true, + "contentCount" : 1, + "metadata" : { + "tile_size" : "16x16" + }, + "coldDependencies" : [ ] + }, { + "assetId" : 5, + "reference" : "asset:id:5", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/glyph16/assets/bank4/", + "bankType" : "GLYPH", + "buildSelected" : true, + "included" : true, + "contentCount" : 1, + "metadata" : { + "tile_size" : "16x16" + }, + "coldDependencies" : [ ] + }, { + "assetId" : 6, + "reference" : "asset:id:6", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/glyph16/assets/bank5/", + "bankType" : "GLYPH", + "buildSelected" : true, + "included" : true, + "contentCount" : 1, + "metadata" : { + "tile_size" : "16x16" + }, + "coldDependencies" : [ ] + }, { + "assetId" : 7, + "reference" : "asset:id:7", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/glyph16/assets/bank6/", + "bankType" : "GLYPH", + "buildSelected" : true, + "included" : true, + "contentCount" : 1, + "metadata" : { + "tile_size" : "16x16" + }, + "coldDependencies" : [ ] + }, { + "assetId" : 8, + "reference" : "asset:id:8", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/glyph16/assets/bank7/", + "bankType" : "GLYPH", + "buildSelected" : true, + "included" : true, + "contentCount" : 1, + "metadata" : { + "tile_size" : "16x16" + }, + "coldDependencies" : [ ] + }, { + "assetId" : 9, + "reference" : "asset:id:9", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/glyph16/assets/bank8/", + "bankType" : "GLYPH", + "buildSelected" : true, + "included" : true, + "contentCount" : 1, + "metadata" : { + "tile_size" : "16x16" + }, + "coldDependencies" : [ ] + }, { + "assetId" : 10, + "reference" : "asset:id:10", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/glyph16/assets/bank9/", + "bankType" : "GLYPH", + "buildSelected" : true, + "included" : true, + "contentCount" : 1, + "metadata" : { + "tile_size" : "16x16" + }, + "coldDependencies" : [ ] + } ], + "preload" : [ { + "assetId" : 1, + "slot" : 0, + "bankType" : "GLYPH" + }, { + "assetId" : 2, + "slot" : 1, + "bankType" : "GLYPH" + }, { + "assetId" : 3, + "slot" : 2, + "bankType" : "GLYPH" + }, { + "assetId" : 4, + "slot" : 3, + "bankType" : "GLYPH" + }, { + "assetId" : 5, + "slot" : 4, + "bankType" : "GLYPH" + }, { + "assetId" : 6, + "slot" : 5, + "bankType" : "GLYPH" + }, { + "assetId" : 7, + "slot" : 6, + "bankType" : "GLYPH" + }, { + "assetId" : 8, + "slot" : 7, + "bankType" : "GLYPH" + }, { + "assetId" : 9, + "slot" : 8, + "bankType" : "GLYPH" + }, { + "assetId" : 10, + "slot" : 9, + "bankType" : "GLYPH" + }, { + "assetId" : 11, + "slot" : 10, + "bankType" : "GLYPH" + }, { + "assetId" : 12, + "slot" : 11, + "bankType" : "GLYPH" + }, { + "assetId" : 13, + "slot" : 12, + "bankType" : "GLYPH" + }, { + "assetId" : 14, + "slot" : 13, + "bankType" : "GLYPH" + }, { + "assetId" : 15, + "slot" : 14, + "bankType" : "GLYPH" + }, { + "assetId" : 16, + "slot" : 15, + "bankType" : "GLYPH" + } ], + "diagnostics" : [ ] + }, + "observation" : { + "sessionId" : "7e3ae98e90c1664f8e551f85ef6acb21", + "buildId" : "qualify-glyph16", + "lifecycle" : "GUEST_OBSERVED", + "source" : "get_state", + "observedAt" : "2026-11-20T23:15:52.803688Z", + "progress" : { + "requestedFrames" : 1, + "completedFrames" : 1 + }, + "lastFrame" : { + "logicalFrameIndex" : 1, + "frameId" : 0 + }, + "captureStale" : false, + "nativeDetails" : { + "capabilities" : [ "boot", "reset", "set_input", "clear_input", "advance", "capture", "get_state", "get_fault", "log_read", "cancel", "shutdown", "memcard", "memcard_mount", "memcard_unmount", "get_memcard_state", "memcard_reconcile", "memcard_continue_in_memory" ], + "limits" : { + "callTimeoutMs" : 60000, + "handshakeTimeoutMs" : 5000, + "maxCommandBytes" : 65536, + "maxFrames" : 600, + "maxResponseBytes" : 33554432, + "shutdownTimeoutMs" : 5000 + }, + "runtimeVersion" : "0.1.0", + "capabilitiesObservation" : { + "source" : "initialize", + "observedAt" : "2026-11-20T23:15:52.771857Z" + }, + "limitsObservation" : { + "source" : "initialize", + "observedAt" : "2026-11-20T23:15:52.771857Z" + }, + "runtimeVersionObservation" : { + "source" : "initialize", + "observedAt" : "2026-11-20T23:15:52.771857Z" + }, + "state" : { + "appId" : 27301, + "logicalFrameIndex" : 1, + "pc" : 36, + "stackTop" : [ ], + "status" : "paused", + "tickIndex" : 1 + }, + "stateObservation" : { + "source" : "get_state", + "observedAt" : "2026-11-20T23:15:52.803688Z" + }, + "advance" : { + "completed" : 1, + "requested" : 1, + "stop" : "completed" + }, + "advanceObservation" : { + "source" : "advance", + "observedAt" : "2026-11-20T23:15:52.788871Z" + } + }, + "context" : { + "runtimeCommand" : "get_state", + "runtimeRequestId" : "6af826a7-69d6-48e2-b792-eb27bc2fa5d8", + "advanceRequestId" : "d9535a99-06e3-46c4-b7d2-164a78fca4ea" + }, + "unavailable" : [ ], + "recovery" : [ { + "action" : "inspect_state", + "preconditions" : [ "session process is available and no conflicting operation is active" ], + "automatic" : false + }, { + "action" : "inspect_fault", + "preconditions" : [ "session process is available and no conflicting operation is active" ], + "automatic" : false + } ] + }, + "outcome" : "SUCCEEDED", + "nativeObservation" : { + "sessionId" : "7e3ae98e90c1664f8e551f85ef6acb21", + "buildId" : "qualify-glyph16", + "lifecycle" : "GUEST_OBSERVED", + "source" : "get_state", + "observedAt" : "2026-11-20T23:15:52.803688Z", + "progress" : { + "requestedFrames" : 1, + "completedFrames" : 1 + }, + "lastFrame" : { + "logicalFrameIndex" : 1, + "frameId" : 0 + }, + "captureStale" : false, + "nativeDetails" : { + "capabilities" : [ "boot", "reset", "set_input", "clear_input", "advance", "capture", "get_state", "get_fault", "log_read", "cancel", "shutdown", "memcard", "memcard_mount", "memcard_unmount", "get_memcard_state", "memcard_reconcile", "memcard_continue_in_memory" ], + "limits" : { + "callTimeoutMs" : 60000, + "handshakeTimeoutMs" : 5000, + "maxCommandBytes" : 65536, + "maxFrames" : 600, + "maxResponseBytes" : 33554432, + "shutdownTimeoutMs" : 5000 + }, + "runtimeVersion" : "0.1.0", + "capabilitiesObservation" : { + "source" : "initialize", + "observedAt" : "2026-11-20T23:15:52.771857Z" + }, + "limitsObservation" : { + "source" : "initialize", + "observedAt" : "2026-11-20T23:15:52.771857Z" + }, + "runtimeVersionObservation" : { + "source" : "initialize", + "observedAt" : "2026-11-20T23:15:52.771857Z" + }, + "state" : { + "appId" : 27301, + "logicalFrameIndex" : 1, + "pc" : 36, + "stackTop" : [ ], + "status" : "paused", + "tickIndex" : 1 + }, + "stateObservation" : { + "source" : "get_state", + "observedAt" : "2026-11-20T23:15:52.803688Z" + }, + "advance" : { + "completed" : 1, + "requested" : 1, + "stop" : "completed" + }, + "advanceObservation" : { + "source" : "advance", + "observedAt" : "2026-11-20T23:15:52.788871Z" + } + }, + "context" : { + "runtimeCommand" : "get_state", + "runtimeRequestId" : "6af826a7-69d6-48e2-b792-eb27bc2fa5d8", + "advanceRequestId" : "d9535a99-06e3-46c4-b7d2-164a78fca4ea" + }, + "unavailable" : [ ], + "recovery" : [ { + "action" : "inspect_state", + "preconditions" : [ "session process is available and no conflicting operation is active" ], + "automatic" : false + }, { + "action" : "inspect_fault", + "preconditions" : [ "session process is available and no conflicting operation is active" ], + "automatic" : false + } ] + }, + "expected" : "accepted" + }, { + "bankType" : "glyph", + "preloads" : 17, + "plan" : { + "banks" : [ { + "assetId" : 1, + "reference" : "asset:id:1", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/glyph17/assets/bank0/", + "bankType" : "GLYPH", + "buildSelected" : true, + "included" : true, + "contentCount" : 1, + "metadata" : { + "tile_size" : "16x16" + }, + "coldDependencies" : [ ] + }, { + "assetId" : 2, + "reference" : "asset:id:2", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/glyph17/assets/bank1/", + "bankType" : "GLYPH", + "buildSelected" : true, + "included" : true, + "contentCount" : 1, + "metadata" : { + "tile_size" : "16x16" + }, + "coldDependencies" : [ ] + }, { + "assetId" : 11, + "reference" : "asset:id:11", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/glyph17/assets/bank10/", + "bankType" : "GLYPH", + "buildSelected" : true, + "included" : true, + "contentCount" : 1, + "metadata" : { + "tile_size" : "16x16" + }, + "coldDependencies" : [ ] + }, { + "assetId" : 12, + "reference" : "asset:id:12", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/glyph17/assets/bank11/", + "bankType" : "GLYPH", + "buildSelected" : true, + "included" : true, + "contentCount" : 1, + "metadata" : { + "tile_size" : "16x16" + }, + "coldDependencies" : [ ] + }, { + "assetId" : 13, + "reference" : "asset:id:13", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/glyph17/assets/bank12/", + "bankType" : "GLYPH", + "buildSelected" : true, + "included" : true, + "contentCount" : 1, + "metadata" : { + "tile_size" : "16x16" + }, + "coldDependencies" : [ ] + }, { + "assetId" : 14, + "reference" : "asset:id:14", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/glyph17/assets/bank13/", + "bankType" : "GLYPH", + "buildSelected" : true, + "included" : true, + "contentCount" : 1, + "metadata" : { + "tile_size" : "16x16" + }, + "coldDependencies" : [ ] + }, { + "assetId" : 15, + "reference" : "asset:id:15", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/glyph17/assets/bank14/", + "bankType" : "GLYPH", + "buildSelected" : true, + "included" : true, + "contentCount" : 1, + "metadata" : { + "tile_size" : "16x16" + }, + "coldDependencies" : [ ] + }, { + "assetId" : 16, + "reference" : "asset:id:16", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/glyph17/assets/bank15/", + "bankType" : "GLYPH", + "buildSelected" : true, + "included" : true, + "contentCount" : 1, + "metadata" : { + "tile_size" : "16x16" + }, + "coldDependencies" : [ ] + }, { + "assetId" : 17, + "reference" : "asset:id:17", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/glyph17/assets/bank16/", + "bankType" : "GLYPH", + "buildSelected" : true, + "included" : true, + "contentCount" : 1, + "metadata" : { + "tile_size" : "16x16" + }, + "coldDependencies" : [ ] + }, { + "assetId" : 3, + "reference" : "asset:id:3", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/glyph17/assets/bank2/", + "bankType" : "GLYPH", + "buildSelected" : true, + "included" : true, + "contentCount" : 1, + "metadata" : { + "tile_size" : "16x16" + }, + "coldDependencies" : [ ] + }, { + "assetId" : 4, + "reference" : "asset:id:4", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/glyph17/assets/bank3/", + "bankType" : "GLYPH", + "buildSelected" : true, + "included" : true, + "contentCount" : 1, + "metadata" : { + "tile_size" : "16x16" + }, + "coldDependencies" : [ ] + }, { + "assetId" : 5, + "reference" : "asset:id:5", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/glyph17/assets/bank4/", + "bankType" : "GLYPH", + "buildSelected" : true, + "included" : true, + "contentCount" : 1, + "metadata" : { + "tile_size" : "16x16" + }, + "coldDependencies" : [ ] + }, { + "assetId" : 6, + "reference" : "asset:id:6", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/glyph17/assets/bank5/", + "bankType" : "GLYPH", + "buildSelected" : true, + "included" : true, + "contentCount" : 1, + "metadata" : { + "tile_size" : "16x16" + }, + "coldDependencies" : [ ] + }, { + "assetId" : 7, + "reference" : "asset:id:7", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/glyph17/assets/bank6/", + "bankType" : "GLYPH", + "buildSelected" : true, + "included" : true, + "contentCount" : 1, + "metadata" : { + "tile_size" : "16x16" + }, + "coldDependencies" : [ ] + }, { + "assetId" : 8, + "reference" : "asset:id:8", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/glyph17/assets/bank7/", + "bankType" : "GLYPH", + "buildSelected" : true, + "included" : true, + "contentCount" : 1, + "metadata" : { + "tile_size" : "16x16" + }, + "coldDependencies" : [ ] + }, { + "assetId" : 9, + "reference" : "asset:id:9", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/glyph17/assets/bank8/", + "bankType" : "GLYPH", + "buildSelected" : true, + "included" : true, + "contentCount" : 1, + "metadata" : { + "tile_size" : "16x16" + }, + "coldDependencies" : [ ] + }, { + "assetId" : 10, + "reference" : "asset:id:10", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/glyph17/assets/bank9/", + "bankType" : "GLYPH", + "buildSelected" : true, + "included" : true, + "contentCount" : 1, + "metadata" : { + "tile_size" : "16x16" + }, + "coldDependencies" : [ ] + } ], + "preload" : [ { + "assetId" : 1, + "slot" : 0, + "bankType" : "GLYPH" + }, { + "assetId" : 2, + "slot" : 1, + "bankType" : "GLYPH" + }, { + "assetId" : 3, + "slot" : 2, + "bankType" : "GLYPH" + }, { + "assetId" : 4, + "slot" : 3, + "bankType" : "GLYPH" + }, { + "assetId" : 5, + "slot" : 4, + "bankType" : "GLYPH" + }, { + "assetId" : 6, + "slot" : 5, + "bankType" : "GLYPH" + }, { + "assetId" : 7, + "slot" : 6, + "bankType" : "GLYPH" + }, { + "assetId" : 8, + "slot" : 7, + "bankType" : "GLYPH" + }, { + "assetId" : 9, + "slot" : 8, + "bankType" : "GLYPH" + }, { + "assetId" : 10, + "slot" : 9, + "bankType" : "GLYPH" + }, { + "assetId" : 11, + "slot" : 10, + "bankType" : "GLYPH" + }, { + "assetId" : 12, + "slot" : 11, + "bankType" : "GLYPH" + }, { + "assetId" : 13, + "slot" : 12, + "bankType" : "GLYPH" + }, { + "assetId" : 14, + "slot" : 13, + "bankType" : "GLYPH" + }, { + "assetId" : 15, + "slot" : 14, + "bankType" : "GLYPH" + }, { + "assetId" : 16, + "slot" : 15, + "bankType" : "GLYPH" + }, { + "assetId" : 17, + "slot" : 16, + "bankType" : "GLYPH" + } ], + "diagnostics" : [ ] + }, + "failure" : { + "code" : "INFRASTRUCTURE_FAILURE", + "message" : "Runtime boot_failed: boot failed: PVM Panic: Cartridge preload failed: BackendError", + "runtimeError" : { + "code" : "boot_failed", + "details" : { + "fault" : { + "kind" : "vm_panic", + "message" : "Cartridge preload failed: BackendError", + "pc" : null, + "summary" : "PVM Panic: Cartridge preload failed: BackendError" + }, + "reason" : "PVM Panic: Cartridge preload failed: BackendError" + }, + "message" : "boot failed: PVM Panic: Cartridge preload failed: BackendError" + }, + "details" : { }, + "observation" : { + "sessionId" : "b34f24c913613fba79b6625c52671be6", + "buildId" : "qualify-glyph17", + "lifecycle" : "UNKNOWN", + "source" : "boot", + "observedAt" : "2026-11-20T23:15:53.667386Z", + "progress" : { + "requestedFrames" : null, + "completedFrames" : null + }, + "lastFrame" : null, + "captureStale" : true, + "nativeDetails" : { + "capabilities" : [ "boot", "reset", "set_input", "clear_input", "advance", "capture", "get_state", "get_fault", "log_read", "cancel", "shutdown", "memcard", "memcard_mount", "memcard_unmount", "get_memcard_state", "memcard_reconcile", "memcard_continue_in_memory" ], + "limits" : { + "callTimeoutMs" : 60000, + "handshakeTimeoutMs" : 5000, + "maxCommandBytes" : 65536, + "maxFrames" : 600, + "maxResponseBytes" : 33554432, + "shutdownTimeoutMs" : 5000 + }, + "runtimeVersion" : "0.1.0", + "capabilitiesObservation" : { + "source" : "initialize", + "observedAt" : "2026-11-20T23:15:53.663717Z" + }, + "limitsObservation" : { + "source" : "initialize", + "observedAt" : "2026-11-20T23:15:53.663717Z" + }, + "runtimeVersionObservation" : { + "source" : "initialize", + "observedAt" : "2026-11-20T23:15:53.663717Z" + }, + "error" : { + "code" : "boot_failed", + "details" : { + "fault" : { + "kind" : "vm_panic", + "message" : "Cartridge preload failed: BackendError", + "pc" : null, + "summary" : "PVM Panic: Cartridge preload failed: BackendError" + }, + "reason" : "PVM Panic: Cartridge preload failed: BackendError" + }, + "message" : "boot failed: PVM Panic: Cartridge preload failed: BackendError" + }, + "errorObservation" : { + "source" : "boot", + "observedAt" : "2026-11-20T23:15:53.667386Z" + } + }, + "context" : { + "runtimeCommand" : "boot", + "runtimeRequestId" : "d173e4f5-749f-4e15-a74f-0f55c18c0a07" + }, + "unavailable" : [ ], + "recovery" : [ { + "action" : "inspect_state", + "preconditions" : [ "session process is available and no conflicting operation is active" ], + "automatic" : false + }, { + "action" : "inspect_fault", + "preconditions" : [ "session process is available and no conflicting operation is active" ], + "automatic" : false + } ] + } + }, + "nativeObservation" : { + "sessionId" : "b34f24c913613fba79b6625c52671be6", + "buildId" : "qualify-glyph17", + "lifecycle" : "UNKNOWN", + "source" : "boot", + "observedAt" : "2026-11-20T23:15:53.667386Z", + "progress" : { + "requestedFrames" : null, + "completedFrames" : null + }, + "lastFrame" : null, + "captureStale" : true, + "nativeDetails" : { + "capabilities" : [ "boot", "reset", "set_input", "clear_input", "advance", "capture", "get_state", "get_fault", "log_read", "cancel", "shutdown", "memcard", "memcard_mount", "memcard_unmount", "get_memcard_state", "memcard_reconcile", "memcard_continue_in_memory" ], + "limits" : { + "callTimeoutMs" : 60000, + "handshakeTimeoutMs" : 5000, + "maxCommandBytes" : 65536, + "maxFrames" : 600, + "maxResponseBytes" : 33554432, + "shutdownTimeoutMs" : 5000 + }, + "runtimeVersion" : "0.1.0", + "capabilitiesObservation" : { + "source" : "initialize", + "observedAt" : "2026-11-20T23:15:53.663717Z" + }, + "limitsObservation" : { + "source" : "initialize", + "observedAt" : "2026-11-20T23:15:53.663717Z" + }, + "runtimeVersionObservation" : { + "source" : "initialize", + "observedAt" : "2026-11-20T23:15:53.663717Z" + }, + "error" : { + "code" : "boot_failed", + "details" : { + "fault" : { + "kind" : "vm_panic", + "message" : "Cartridge preload failed: BackendError", + "pc" : null, + "summary" : "PVM Panic: Cartridge preload failed: BackendError" + }, + "reason" : "PVM Panic: Cartridge preload failed: BackendError" + }, + "message" : "boot failed: PVM Panic: Cartridge preload failed: BackendError" + }, + "errorObservation" : { + "source" : "boot", + "observedAt" : "2026-11-20T23:15:53.667386Z" + } + }, + "context" : { + "runtimeCommand" : "boot", + "runtimeRequestId" : "d173e4f5-749f-4e15-a74f-0f55c18c0a07" + }, + "unavailable" : [ ], + "recovery" : [ { + "action" : "inspect_state", + "preconditions" : [ "session process is available and no conflicting operation is active" ], + "automatic" : false + }, { + "action" : "inspect_fault", + "preconditions" : [ "session process is available and no conflicting operation is active" ], + "automatic" : false + } ] + }, + "expected" : "rejected" + }, { + "bankType" : "scene", + "preloads" : 16, + "plan" : { + "banks" : [ { + "assetId" : 2, + "reference" : "asset:id:2", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/scene16/assets/bank0/", + "bankType" : "SCENE", + "buildSelected" : true, + "included" : true, + "contentCount" : 0, + "metadata" : { }, + "coldDependencies" : [ ] + }, { + "assetId" : 3, + "reference" : "asset:id:3", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/scene16/assets/bank1/", + "bankType" : "SCENE", + "buildSelected" : true, + "included" : true, + "contentCount" : 0, + "metadata" : { }, + "coldDependencies" : [ ] + }, { + "assetId" : 12, + "reference" : "asset:id:12", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/scene16/assets/bank10/", + "bankType" : "SCENE", + "buildSelected" : true, + "included" : true, + "contentCount" : 0, + "metadata" : { }, + "coldDependencies" : [ ] + }, { + "assetId" : 13, + "reference" : "asset:id:13", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/scene16/assets/bank11/", + "bankType" : "SCENE", + "buildSelected" : true, + "included" : true, + "contentCount" : 0, + "metadata" : { }, + "coldDependencies" : [ ] + }, { + "assetId" : 14, + "reference" : "asset:id:14", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/scene16/assets/bank12/", + "bankType" : "SCENE", + "buildSelected" : true, + "included" : true, + "contentCount" : 0, + "metadata" : { }, + "coldDependencies" : [ ] + }, { + "assetId" : 15, + "reference" : "asset:id:15", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/scene16/assets/bank13/", + "bankType" : "SCENE", + "buildSelected" : true, + "included" : true, + "contentCount" : 0, + "metadata" : { }, + "coldDependencies" : [ ] + }, { + "assetId" : 16, + "reference" : "asset:id:16", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/scene16/assets/bank14/", + "bankType" : "SCENE", + "buildSelected" : true, + "included" : true, + "contentCount" : 0, + "metadata" : { }, + "coldDependencies" : [ ] + }, { + "assetId" : 17, + "reference" : "asset:id:17", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/scene16/assets/bank15/", + "bankType" : "SCENE", + "buildSelected" : true, + "included" : true, + "contentCount" : 0, + "metadata" : { }, + "coldDependencies" : [ ] + }, { + "assetId" : 4, + "reference" : "asset:id:4", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/scene16/assets/bank2/", + "bankType" : "SCENE", + "buildSelected" : true, + "included" : true, + "contentCount" : 0, + "metadata" : { }, + "coldDependencies" : [ ] + }, { + "assetId" : 5, + "reference" : "asset:id:5", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/scene16/assets/bank3/", + "bankType" : "SCENE", + "buildSelected" : true, + "included" : true, + "contentCount" : 0, + "metadata" : { }, + "coldDependencies" : [ ] + }, { + "assetId" : 6, + "reference" : "asset:id:6", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/scene16/assets/bank4/", + "bankType" : "SCENE", + "buildSelected" : true, + "included" : true, + "contentCount" : 0, + "metadata" : { }, + "coldDependencies" : [ ] + }, { + "assetId" : 7, + "reference" : "asset:id:7", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/scene16/assets/bank5/", + "bankType" : "SCENE", + "buildSelected" : true, + "included" : true, + "contentCount" : 0, + "metadata" : { }, + "coldDependencies" : [ ] + }, { + "assetId" : 8, + "reference" : "asset:id:8", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/scene16/assets/bank6/", + "bankType" : "SCENE", + "buildSelected" : true, + "included" : true, + "contentCount" : 0, + "metadata" : { }, + "coldDependencies" : [ ] + }, { + "assetId" : 9, + "reference" : "asset:id:9", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/scene16/assets/bank7/", + "bankType" : "SCENE", + "buildSelected" : true, + "included" : true, + "contentCount" : 0, + "metadata" : { }, + "coldDependencies" : [ ] + }, { + "assetId" : 10, + "reference" : "asset:id:10", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/scene16/assets/bank8/", + "bankType" : "SCENE", + "buildSelected" : true, + "included" : true, + "contentCount" : 0, + "metadata" : { }, + "coldDependencies" : [ ] + }, { + "assetId" : 11, + "reference" : "asset:id:11", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/scene16/assets/bank9/", + "bankType" : "SCENE", + "buildSelected" : true, + "included" : true, + "contentCount" : 0, + "metadata" : { }, + "coldDependencies" : [ ] + }, { + "assetId" : 1, + "reference" : "asset:id:1", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/scene16/assets/source/", + "bankType" : "GLYPH", + "buildSelected" : true, + "included" : true, + "contentCount" : 1, + "metadata" : { + "tile_size" : "16x16" + }, + "coldDependencies" : [ ] + } ], + "preload" : [ { + "assetId" : 2, + "slot" : 0, + "bankType" : "SCENE" + }, { + "assetId" : 3, + "slot" : 1, + "bankType" : "SCENE" + }, { + "assetId" : 4, + "slot" : 2, + "bankType" : "SCENE" + }, { + "assetId" : 5, + "slot" : 3, + "bankType" : "SCENE" + }, { + "assetId" : 6, + "slot" : 4, + "bankType" : "SCENE" + }, { + "assetId" : 7, + "slot" : 5, + "bankType" : "SCENE" + }, { + "assetId" : 8, + "slot" : 6, + "bankType" : "SCENE" + }, { + "assetId" : 9, + "slot" : 7, + "bankType" : "SCENE" + }, { + "assetId" : 10, + "slot" : 8, + "bankType" : "SCENE" + }, { + "assetId" : 11, + "slot" : 9, + "bankType" : "SCENE" + }, { + "assetId" : 12, + "slot" : 10, + "bankType" : "SCENE" + }, { + "assetId" : 13, + "slot" : 11, + "bankType" : "SCENE" + }, { + "assetId" : 14, + "slot" : 12, + "bankType" : "SCENE" + }, { + "assetId" : 15, + "slot" : 13, + "bankType" : "SCENE" + }, { + "assetId" : 16, + "slot" : 14, + "bankType" : "SCENE" + }, { + "assetId" : 17, + "slot" : 15, + "bankType" : "SCENE" + } ], + "diagnostics" : [ ] + }, + "observation" : { + "sessionId" : "51c7976d5e2fbc8015aba7f62b72fe43", + "buildId" : "qualify-scene16", + "lifecycle" : "GUEST_OBSERVED", + "source" : "get_state", + "observedAt" : "2026-11-20T23:15:55.089035Z", + "progress" : { + "requestedFrames" : 1, + "completedFrames" : 1 + }, + "lastFrame" : { + "logicalFrameIndex" : 1, + "frameId" : 0 + }, + "captureStale" : false, + "nativeDetails" : { + "capabilities" : [ "boot", "reset", "set_input", "clear_input", "advance", "capture", "get_state", "get_fault", "log_read", "cancel", "shutdown", "memcard", "memcard_mount", "memcard_unmount", "get_memcard_state", "memcard_reconcile", "memcard_continue_in_memory" ], + "limits" : { + "callTimeoutMs" : 60000, + "handshakeTimeoutMs" : 5000, + "maxCommandBytes" : 65536, + "maxFrames" : 600, + "maxResponseBytes" : 33554432, + "shutdownTimeoutMs" : 5000 + }, + "runtimeVersion" : "0.1.0", + "capabilitiesObservation" : { + "source" : "initialize", + "observedAt" : "2026-11-20T23:15:55.075689Z" + }, + "limitsObservation" : { + "source" : "initialize", + "observedAt" : "2026-11-20T23:15:55.075689Z" + }, + "runtimeVersionObservation" : { + "source" : "initialize", + "observedAt" : "2026-11-20T23:15:55.075689Z" + }, + "state" : { + "appId" : 27301, + "logicalFrameIndex" : 1, + "pc" : 36, + "stackTop" : [ ], + "status" : "paused", + "tickIndex" : 1 + }, + "stateObservation" : { + "source" : "get_state", + "observedAt" : "2026-11-20T23:15:55.089035Z" + }, + "advance" : { + "completed" : 1, + "requested" : 1, + "stop" : "completed" + }, + "advanceObservation" : { + "source" : "advance", + "observedAt" : "2026-11-20T23:15:55.083639Z" + } + }, + "context" : { + "runtimeCommand" : "get_state", + "runtimeRequestId" : "4922dca1-7a56-467b-9cc0-67f1e2fd0dfa", + "advanceRequestId" : "fc76d02d-b5ab-40c2-9fad-d5fa1cbc5e30" + }, + "unavailable" : [ ], + "recovery" : [ { + "action" : "inspect_state", + "preconditions" : [ "session process is available and no conflicting operation is active" ], + "automatic" : false + }, { + "action" : "inspect_fault", + "preconditions" : [ "session process is available and no conflicting operation is active" ], + "automatic" : false + } ] + }, + "outcome" : "SUCCEEDED", + "nativeObservation" : { + "sessionId" : "51c7976d5e2fbc8015aba7f62b72fe43", + "buildId" : "qualify-scene16", + "lifecycle" : "GUEST_OBSERVED", + "source" : "get_state", + "observedAt" : "2026-11-20T23:15:55.089035Z", + "progress" : { + "requestedFrames" : 1, + "completedFrames" : 1 + }, + "lastFrame" : { + "logicalFrameIndex" : 1, + "frameId" : 0 + }, + "captureStale" : false, + "nativeDetails" : { + "capabilities" : [ "boot", "reset", "set_input", "clear_input", "advance", "capture", "get_state", "get_fault", "log_read", "cancel", "shutdown", "memcard", "memcard_mount", "memcard_unmount", "get_memcard_state", "memcard_reconcile", "memcard_continue_in_memory" ], + "limits" : { + "callTimeoutMs" : 60000, + "handshakeTimeoutMs" : 5000, + "maxCommandBytes" : 65536, + "maxFrames" : 600, + "maxResponseBytes" : 33554432, + "shutdownTimeoutMs" : 5000 + }, + "runtimeVersion" : "0.1.0", + "capabilitiesObservation" : { + "source" : "initialize", + "observedAt" : "2026-11-20T23:15:55.075689Z" + }, + "limitsObservation" : { + "source" : "initialize", + "observedAt" : "2026-11-20T23:15:55.075689Z" + }, + "runtimeVersionObservation" : { + "source" : "initialize", + "observedAt" : "2026-11-20T23:15:55.075689Z" + }, + "state" : { + "appId" : 27301, + "logicalFrameIndex" : 1, + "pc" : 36, + "stackTop" : [ ], + "status" : "paused", + "tickIndex" : 1 + }, + "stateObservation" : { + "source" : "get_state", + "observedAt" : "2026-11-20T23:15:55.089035Z" + }, + "advance" : { + "completed" : 1, + "requested" : 1, + "stop" : "completed" + }, + "advanceObservation" : { + "source" : "advance", + "observedAt" : "2026-11-20T23:15:55.083639Z" + } + }, + "context" : { + "runtimeCommand" : "get_state", + "runtimeRequestId" : "4922dca1-7a56-467b-9cc0-67f1e2fd0dfa", + "advanceRequestId" : "fc76d02d-b5ab-40c2-9fad-d5fa1cbc5e30" + }, + "unavailable" : [ ], + "recovery" : [ { + "action" : "inspect_state", + "preconditions" : [ "session process is available and no conflicting operation is active" ], + "automatic" : false + }, { + "action" : "inspect_fault", + "preconditions" : [ "session process is available and no conflicting operation is active" ], + "automatic" : false + } ] + }, + "expected" : "accepted" + }, { + "bankType" : "scene", + "preloads" : 17, + "plan" : { + "banks" : [ { + "assetId" : 2, + "reference" : "asset:id:2", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/scene17/assets/bank0/", + "bankType" : "SCENE", + "buildSelected" : true, + "included" : true, + "contentCount" : 0, + "metadata" : { }, + "coldDependencies" : [ ] + }, { + "assetId" : 3, + "reference" : "asset:id:3", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/scene17/assets/bank1/", + "bankType" : "SCENE", + "buildSelected" : true, + "included" : true, + "contentCount" : 0, + "metadata" : { }, + "coldDependencies" : [ ] + }, { + "assetId" : 12, + "reference" : "asset:id:12", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/scene17/assets/bank10/", + "bankType" : "SCENE", + "buildSelected" : true, + "included" : true, + "contentCount" : 0, + "metadata" : { }, + "coldDependencies" : [ ] + }, { + "assetId" : 13, + "reference" : "asset:id:13", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/scene17/assets/bank11/", + "bankType" : "SCENE", + "buildSelected" : true, + "included" : true, + "contentCount" : 0, + "metadata" : { }, + "coldDependencies" : [ ] + }, { + "assetId" : 14, + "reference" : "asset:id:14", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/scene17/assets/bank12/", + "bankType" : "SCENE", + "buildSelected" : true, + "included" : true, + "contentCount" : 0, + "metadata" : { }, + "coldDependencies" : [ ] + }, { + "assetId" : 15, + "reference" : "asset:id:15", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/scene17/assets/bank13/", + "bankType" : "SCENE", + "buildSelected" : true, + "included" : true, + "contentCount" : 0, + "metadata" : { }, + "coldDependencies" : [ ] + }, { + "assetId" : 16, + "reference" : "asset:id:16", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/scene17/assets/bank14/", + "bankType" : "SCENE", + "buildSelected" : true, + "included" : true, + "contentCount" : 0, + "metadata" : { }, + "coldDependencies" : [ ] + }, { + "assetId" : 17, + "reference" : "asset:id:17", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/scene17/assets/bank15/", + "bankType" : "SCENE", + "buildSelected" : true, + "included" : true, + "contentCount" : 0, + "metadata" : { }, + "coldDependencies" : [ ] + }, { + "assetId" : 18, + "reference" : "asset:id:18", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/scene17/assets/bank16/", + "bankType" : "SCENE", + "buildSelected" : true, + "included" : true, + "contentCount" : 0, + "metadata" : { }, + "coldDependencies" : [ ] + }, { + "assetId" : 4, + "reference" : "asset:id:4", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/scene17/assets/bank2/", + "bankType" : "SCENE", + "buildSelected" : true, + "included" : true, + "contentCount" : 0, + "metadata" : { }, + "coldDependencies" : [ ] + }, { + "assetId" : 5, + "reference" : "asset:id:5", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/scene17/assets/bank3/", + "bankType" : "SCENE", + "buildSelected" : true, + "included" : true, + "contentCount" : 0, + "metadata" : { }, + "coldDependencies" : [ ] + }, { + "assetId" : 6, + "reference" : "asset:id:6", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/scene17/assets/bank4/", + "bankType" : "SCENE", + "buildSelected" : true, + "included" : true, + "contentCount" : 0, + "metadata" : { }, + "coldDependencies" : [ ] + }, { + "assetId" : 7, + "reference" : "asset:id:7", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/scene17/assets/bank5/", + "bankType" : "SCENE", + "buildSelected" : true, + "included" : true, + "contentCount" : 0, + "metadata" : { }, + "coldDependencies" : [ ] + }, { + "assetId" : 8, + "reference" : "asset:id:8", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/scene17/assets/bank6/", + "bankType" : "SCENE", + "buildSelected" : true, + "included" : true, + "contentCount" : 0, + "metadata" : { }, + "coldDependencies" : [ ] + }, { + "assetId" : 9, + "reference" : "asset:id:9", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/scene17/assets/bank7/", + "bankType" : "SCENE", + "buildSelected" : true, + "included" : true, + "contentCount" : 0, + "metadata" : { }, + "coldDependencies" : [ ] + }, { + "assetId" : 10, + "reference" : "asset:id:10", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/scene17/assets/bank8/", + "bankType" : "SCENE", + "buildSelected" : true, + "included" : true, + "contentCount" : 0, + "metadata" : { }, + "coldDependencies" : [ ] + }, { + "assetId" : 11, + "reference" : "asset:id:11", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/scene17/assets/bank9/", + "bankType" : "SCENE", + "buildSelected" : true, + "included" : true, + "contentCount" : 0, + "metadata" : { }, + "coldDependencies" : [ ] + }, { + "assetId" : 1, + "reference" : "asset:id:1", + "root" : "file:///private/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/junit-10626782816232342828/scene17/assets/source/", + "bankType" : "GLYPH", + "buildSelected" : true, + "included" : true, + "contentCount" : 1, + "metadata" : { + "tile_size" : "16x16" + }, + "coldDependencies" : [ ] + } ], + "preload" : [ { + "assetId" : 2, + "slot" : 0, + "bankType" : "SCENE" + }, { + "assetId" : 3, + "slot" : 1, + "bankType" : "SCENE" + }, { + "assetId" : 4, + "slot" : 2, + "bankType" : "SCENE" + }, { + "assetId" : 5, + "slot" : 3, + "bankType" : "SCENE" + }, { + "assetId" : 6, + "slot" : 4, + "bankType" : "SCENE" + }, { + "assetId" : 7, + "slot" : 5, + "bankType" : "SCENE" + }, { + "assetId" : 8, + "slot" : 6, + "bankType" : "SCENE" + }, { + "assetId" : 9, + "slot" : 7, + "bankType" : "SCENE" + }, { + "assetId" : 10, + "slot" : 8, + "bankType" : "SCENE" + }, { + "assetId" : 11, + "slot" : 9, + "bankType" : "SCENE" + }, { + "assetId" : 12, + "slot" : 10, + "bankType" : "SCENE" + }, { + "assetId" : 13, + "slot" : 11, + "bankType" : "SCENE" + }, { + "assetId" : 14, + "slot" : 12, + "bankType" : "SCENE" + }, { + "assetId" : 15, + "slot" : 13, + "bankType" : "SCENE" + }, { + "assetId" : 16, + "slot" : 14, + "bankType" : "SCENE" + }, { + "assetId" : 17, + "slot" : 15, + "bankType" : "SCENE" + }, { + "assetId" : 18, + "slot" : 16, + "bankType" : "SCENE" + } ], + "diagnostics" : [ ] + }, + "failure" : { + "code" : "INFRASTRUCTURE_FAILURE", + "message" : "Runtime boot_failed: boot failed: PVM Panic: Cartridge preload failed: BackendError", + "runtimeError" : { + "code" : "boot_failed", + "details" : { + "fault" : { + "kind" : "vm_panic", + "message" : "Cartridge preload failed: BackendError", + "pc" : null, + "summary" : "PVM Panic: Cartridge preload failed: BackendError" + }, + "reason" : "PVM Panic: Cartridge preload failed: BackendError" + }, + "message" : "boot failed: PVM Panic: Cartridge preload failed: BackendError" + }, + "details" : { }, + "observation" : { + "sessionId" : "c97130963e6609dd7756afe0699988ff", + "buildId" : "qualify-scene17", + "lifecycle" : "UNKNOWN", + "source" : "boot", + "observedAt" : "2026-11-20T23:15:56.339598Z", + "progress" : { + "requestedFrames" : null, + "completedFrames" : null + }, + "lastFrame" : null, + "captureStale" : true, + "nativeDetails" : { + "capabilities" : [ "boot", "reset", "set_input", "clear_input", "advance", "capture", "get_state", "get_fault", "log_read", "cancel", "shutdown", "memcard", "memcard_mount", "memcard_unmount", "get_memcard_state", "memcard_reconcile", "memcard_continue_in_memory" ], + "limits" : { + "callTimeoutMs" : 60000, + "handshakeTimeoutMs" : 5000, + "maxCommandBytes" : 65536, + "maxFrames" : 600, + "maxResponseBytes" : 33554432, + "shutdownTimeoutMs" : 5000 + }, + "runtimeVersion" : "0.1.0", + "capabilitiesObservation" : { + "source" : "initialize", + "observedAt" : "2026-11-20T23:15:56.336739Z" + }, + "limitsObservation" : { + "source" : "initialize", + "observedAt" : "2026-11-20T23:15:56.336739Z" + }, + "runtimeVersionObservation" : { + "source" : "initialize", + "observedAt" : "2026-11-20T23:15:56.336739Z" + }, + "error" : { + "code" : "boot_failed", + "details" : { + "fault" : { + "kind" : "vm_panic", + "message" : "Cartridge preload failed: BackendError", + "pc" : null, + "summary" : "PVM Panic: Cartridge preload failed: BackendError" + }, + "reason" : "PVM Panic: Cartridge preload failed: BackendError" + }, + "message" : "boot failed: PVM Panic: Cartridge preload failed: BackendError" + }, + "errorObservation" : { + "source" : "boot", + "observedAt" : "2026-11-20T23:15:56.339598Z" + } + }, + "context" : { + "runtimeCommand" : "boot", + "runtimeRequestId" : "262b8743-635d-44d3-aaf7-70068b011c88" + }, + "unavailable" : [ ], + "recovery" : [ { + "action" : "inspect_state", + "preconditions" : [ "session process is available and no conflicting operation is active" ], + "automatic" : false + }, { + "action" : "inspect_fault", + "preconditions" : [ "session process is available and no conflicting operation is active" ], + "automatic" : false + } ] + } + }, + "nativeObservation" : { + "sessionId" : "c97130963e6609dd7756afe0699988ff", + "buildId" : "qualify-scene17", + "lifecycle" : "UNKNOWN", + "source" : "boot", + "observedAt" : "2026-11-20T23:15:56.339598Z", + "progress" : { + "requestedFrames" : null, + "completedFrames" : null + }, + "lastFrame" : null, + "captureStale" : true, + "nativeDetails" : { + "capabilities" : [ "boot", "reset", "set_input", "clear_input", "advance", "capture", "get_state", "get_fault", "log_read", "cancel", "shutdown", "memcard", "memcard_mount", "memcard_unmount", "get_memcard_state", "memcard_reconcile", "memcard_continue_in_memory" ], + "limits" : { + "callTimeoutMs" : 60000, + "handshakeTimeoutMs" : 5000, + "maxCommandBytes" : 65536, + "maxFrames" : 600, + "maxResponseBytes" : 33554432, + "shutdownTimeoutMs" : 5000 + }, + "runtimeVersion" : "0.1.0", + "capabilitiesObservation" : { + "source" : "initialize", + "observedAt" : "2026-11-20T23:15:56.336739Z" + }, + "limitsObservation" : { + "source" : "initialize", + "observedAt" : "2026-11-20T23:15:56.336739Z" + }, + "runtimeVersionObservation" : { + "source" : "initialize", + "observedAt" : "2026-11-20T23:15:56.336739Z" + }, + "error" : { + "code" : "boot_failed", + "details" : { + "fault" : { + "kind" : "vm_panic", + "message" : "Cartridge preload failed: BackendError", + "pc" : null, + "summary" : "PVM Panic: Cartridge preload failed: BackendError" + }, + "reason" : "PVM Panic: Cartridge preload failed: BackendError" + }, + "message" : "boot failed: PVM Panic: Cartridge preload failed: BackendError" + }, + "errorObservation" : { + "source" : "boot", + "observedAt" : "2026-11-20T23:15:56.339598Z" + } + }, + "context" : { + "runtimeCommand" : "boot", + "runtimeRequestId" : "262b8743-635d-44d3-aaf7-70068b011c88" + }, + "unavailable" : [ ], + "recovery" : [ { + "action" : "inspect_state", + "preconditions" : [ "session process is available and no conflicting operation is active" ], + "automatic" : false + }, { + "action" : "inspect_fault", + "preconditions" : [ "session process is available and no conflicting operation is active" ], + "automatic" : false + } ] + }, + "expected" : "rejected" + } ], + "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.", + "runtimeVersion" : "0.1.0", + "installation" : "/Users/niltonconstantino/personal/workspace.personal/intrepid/prometeu/project/runtime/dist-staging/stable/prometeu-cli-aarch64-apple-darwin", + "executables" : { + "prometeu" : "a6870f026926d45135e5ee31910fb0291648620bae290a1120d2ca2579ea5f94", + "prometeu-headless" : "5107d2d0fc30149cb2ece3124b0622654bd991871d6a3c2b26f22e97dd2645f9", + "prometeu-runtime" : "a29e75597ffb7110854452c9ce4802167a78e62f6b19526bc12b83584a52996f" + } +} \ No newline at end of file diff --git a/prometeu-app/src/test/java/p/studio/app/StudioPlayDesktopTest.java b/prometeu-app/src/test/java/p/studio/app/StudioPlayDesktopTest.java index 615da593..aa8f74c5 100644 --- a/prometeu-app/src/test/java/p/studio/app/StudioPlayDesktopTest.java +++ b/prometeu-app/src/test/java/p/studio/app/StudioPlayDesktopTest.java @@ -163,9 +163,9 @@ class StudioPlayDesktopTest { fire(stage,"play");running(window,stage,facts); fx(()->{window.requestCloseProject();return null;}); await(()->{try{return fx(()->window.projectSession()==null);}catch(Exception e){throw new RuntimeException(e);}},facts); - fx(()->{assertNotNull(stage.getScene().lookup("#open-project"));return null;});capture(stage,"projects.png"); + fx(()->{assertTrue(window.launcherStage().isShowing());assertFalse(stage.isShowing());assertNotNull(window.launcherStage().getScene().lookup("#open-project"));return null;});capture(window.launcherStage(),"projects.png"); assertEquals(0,runtimeCount());assertEquals(0,heartbeatThreads()); - }finally{fx(()->{window.close();stage.hide();return null;});} + }finally{fx(window::closeAsync).toCompletableFuture().get(15,TimeUnit.SECONDS);} } } static void fire(Stage stage,String id)throws Exception{fx(()->{Button button=(Button)stage.getScene().lookup("#"+id);assertFalse(button.isDisabled(),id+" disabled");button.fire();return null;});} diff --git a/prometeu-app/src/test/java/p/studio/app/StudioProjectsDesktopTest.java b/prometeu-app/src/test/java/p/studio/app/StudioProjectsDesktopTest.java new file mode 100644 index 00000000..e6371471 --- /dev/null +++ b/prometeu-app/src/test/java/p/studio/app/StudioProjectsDesktopTest.java @@ -0,0 +1,179 @@ +package p.studio.app; + +import com.fasterxml.jackson.databind.ObjectMapper; +import javafx.application.Platform; +import javafx.scene.Node; +import javafx.scene.control.*; +import javafx.scene.input.*; +import javafx.stage.Stage; +import javafx.stage.Window; +import org.junit.jupiter.api.*; +import org.junit.jupiter.api.io.TempDir; +import p.studio.api.execution.*; +import p.studio.api.preferences.*; +import p.studio.api.project.*; +import p.studio.api.session.*; +import p.studio.core.execution.DefaultExecutionSession; +import p.studio.core.project.*; +import p.studio.ui.javafx2.appearance.*; +import p.studio.ui.javafx2.i18n.StudioLanguage; +import p.studio.ui.javafx2.preferences.SettingsStore; +import p.studio.ui.javafx2.window.*; + +import java.lang.reflect.Proxy; +import java.nio.file.*; +import java.util.*; +import java.util.concurrent.*; +import java.util.concurrent.atomic.*; +import java.util.function.*; + +import static org.junit.jupiter.api.Assertions.*; + +/** Real stages and filesystem catalogue, isolated preferences/projects, no native execution. */ +@Tag("integration") +class StudioProjectsDesktopTest { + @TempDir Path temporary; + static T fx(Callable action)throws Exception { + var task=new FutureTask<>(action);Platform.runLater(task);return task.get(15,TimeUnit.SECONDS); + } + static void await(Callable condition)throws Exception { + long end=System.nanoTime()+TimeUnit.SECONDS.toNanos(15); + while(System.nanoTime()();Platform.startup(()->{Platform.setImplicitExit(false);ready.complete(null);});ready.get(15,TimeUnit.SECONDS);} + @AfterAll static void end(){Platform.exit();} + static void fire(Stage stage,String id)throws Exception {fx(()->{var b=(Button)stage.getScene().lookup("#"+id);assertNotNull(b,id);assertFalse(b.isDisabled(),id);b.fire();return null;});} + static Stage wizard()throws Exception {return fx(()->(Stage)Window.getWindows().stream().filter(w->w.isShowing()&&w.getScene().lookup("#wizard-name")!=null).findFirst().orElseThrow());} + static Stage shield()throws Exception {return fx(()->(Stage)Window.getWindows().stream().filter(w->w.isShowing()&&w.getScene().lookup("#loading-phase")!=null).findFirst().orElseThrow());} + + @Test void completeProjectFlowWindowsAppearanceWizardAndRecovery()throws Exception { + var mapper=new ObjectMapper();Path projects=Files.createDirectories(temporary.resolve("projects")); + var setups=new ProjectLocalStudioSetupStore(mapper);var catalog=new ProjectCatalogService(projects,mapper,setups); + var known=new KnownProjectsService(temporary.resolve("known-projects.txt"),catalog); + var template=new ProjectLanguageTemplate("pbs",List.of(new ProjectLanguageTemplate.StdlibOption(1,ProjectLanguageTemplate.Stability.DEFAULT)), + new ProjectLanguageTemplate.StdlibOption(1,ProjectLanguageTemplate.Stability.DEFAULT),List.of("src"),"src"); + var seed=catalog.createProject(new ProjectCreationRequest("Existing Game",projects,"pbs",1,ProjectTarget.Game,"src",4,null)); + var initial=PresentationSettings.defaults(Locale.ENGLISH); + var resources=new WindowResources(initial,new SettingsStore(){public PresentationSettings load(){return initial;}public void save(PresentationSettings value){assertFalse(Platform.isFxApplicationThread());}}); + var worker=Executors.newFixedThreadPool(3);var sessionsOpened=new AtomicInteger();var sessionsClosed=new AtomicInteger(); + var failOpen=new AtomicBoolean();var hold=new AtomicReference(); + ProjectSessionFactory sessions=new ProjectSessionFactory(){ + public ProjectSession open(ProjectReference ref){throw new AssertionError("editor session must not start");} + public ProjectSession openForPlay(ProjectReference ref){ + assertFalse(Platform.isFxApplicationThread());var latch=hold.getAndSet(null); + if(latch!=null)try{assertTrue(latch.await(10,TimeUnit.SECONDS));}catch(InterruptedException e){throw new RuntimeException(e);} + if(failOpen.get())throw new IllegalStateException("session-fixture-failure"); + sessionsOpened.incrementAndGet();var execution=new DefaultExecutionSession();var setup=setups.load(ref); + return (ProjectSession)Proxy.newProxyInstance(getClass().getClassLoader(),new Class[]{ProjectSession.class},(proxy,method,args)->switch(method.getName()){ + case "projectReference"->ref; + case "projectLocalStudioSetup"->setup; + case "executionSession"->execution; + case "close"->{assertFalse(Platform.isFxApplicationThread());execution.close();sessionsClosed.incrementAndGet();yield null;} + default->throw new AssertionError(method.getName()); + }); + } + }; + var geometries=new ConcurrentHashMap(); + WindowStateStore windows=new WindowStateStore(){ + public Optional load(ProjectReference ref){assertFalse(Platform.isFxApplicationThread());return Optional.ofNullable(geometries.get(ref.rootPath()));} + public void save(ProjectReference ref,WindowGeometry geometry){assertFalse(Platform.isFxApplicationThread());geometries.put(ref.rootPath(),geometry);} + }; + Stage stage=fx(Stage::new); + var window=fx(()->new StudioWindowCoordinator2(stage,catalog,known,sessions,null,(p,s)->{},worker,resources,()->List.of(template),windows)); + try { + fx(()->{window.showLauncher();return null;});Stage launcher=fx(window::launcherStage); + fx(()->{for(String id:List.of("studio-shell","theme-select","language-select","typeface-select","scale-select")) + assertNull(launcher.getScene().lookup("#"+id),"Project selection must not contain "+id);return null;}); + await(()->fx(()->!launcher.getScene().lookup("#open-project").isDisabled())); + assertFalse(fx(stage::isShowing));capture(launcher,"launcher-dark"); + double[] before=launcherLayout(launcher); + assertTrue(before[0]>=900,"The default chooser should provide a wider project list"); + fx(()->{launcher.setWidth(launcher.getWidth()+140);launcher.setHeight(launcher.getHeight()+80);return null;}); + capture(launcher,"launcher-expanded");double[] expanded=launcherLayout(launcher); + assertEquals(expanded[0]-before[0],expanded[2]-before[2],3,"Frame must follow viewport width"); + assertEquals(expanded[1]-before[1],expanded[3]-before[3],3,"Frame must follow viewport height"); + assertTrue(expanded[4]>before[4]+40,"Additional window height must reach the project list"); + fx(()->{launcher.setWidth(launcher.getWidth()-140);launcher.setHeight(launcher.getHeight()-80);return null;}); + capture(launcher,"launcher-restored");double[] restored=launcherLayout(launcher); + assertEquals(before[2],restored[2],3,"Frame must shrink with the window"); + assertEquals(before[3],restored[3],3,"Frame must shrink with the window"); + System.out.println("launcher layout [viewportW, viewportH, frameW, frameH, listH]: default="+Arrays.toString(before)+", expanded="+Arrays.toString(expanded)+", restored="+Arrays.toString(restored)); + double[] normalWindow=fx(()->new double[]{launcher.getWidth(),launcher.getHeight()}); + fx(()->{launcher.setWidth(600);launcher.setHeight(440);return null;});capture(launcher,"launcher-minimum"); + fx(()->{((ScrollPane)launcher.getScene().lookup("#launcher-scroll")).setVvalue(1);return null;});capture(launcher,"launcher-minimum-actions"); + fx(()->{ + var page=(ScrollPane)launcher.getScene().lookup("#launcher-scroll");var viewport=page.lookup(".viewport"); + var bounds=viewport.localToScene(viewport.getBoundsInLocal()); + for(String id:List.of("open-project","add-project","new-project","forget-project")){ + var button=launcher.getScene().lookup("#"+id);var area=button.localToScene(button.getBoundsInLocal()); + assertTrue(bounds.contains(area.getCenterX(),area.getCenterY()),id+" must remain reachable in a small window"); + } + launcher.setWidth(normalWindow[0]);launcher.setHeight(normalWindow[1]);page.setVvalue(0);return null; + }); + // Add remembers and selects without opening. Forget removes only the persisted reference. + fx(()->{window.addProjectManifest(seed.rootPath().resolve("prometeu.json"));return null;}); + await(()->fx(()->!launcher.getScene().lookup("#forget-project").isDisabled())); + assertEquals(0,sessionsOpened.get());fire(launcher,"forget-project"); + await(()->fx(()->launcher.getScene().lookup("#open-project").isDisabled()&&!launcher.getScene().lookup("#add-project").isDisabled())); + assertTrue(Files.isRegularFile(seed.rootPath().resolve("prometeu.json")));assertTrue(known.listKnownProjects().isEmpty()); + fx(()->{window.addProjectManifest(seed.rootPath().resolve("prometeu.json"));return null;}); + await(()->fx(()->!launcher.getScene().lookup("#open-project").isDisabled())); + long started=System.nanoTime();fire(launcher,"open-project");capture(shield(),"shield-ready"); + assertFalse(fx(stage::isShowing));assertFalse(fx(launcher::isShowing)); + await(()->fx(()->window.projectSession()!=null));assertTrue(System.nanoTime()-started>=TimeUnit.SECONDS.toNanos(1)); + assertTrue(fx(stage::isShowing));capture(stage,"project-ready"); + fx(()->{stage.setWidth(1040);stage.setHeight(730);window.requestCloseProject();return null;}); + await(()->fx(()->launcher.isShowing()&&!launcher.getScene().lookup("#open-project").isDisabled())); + // Keyboard opening uses the selected project and restores its geometry. + fx(()->{Node list=launcher.getScene().lookup("#known-projects");list.fireEvent(new KeyEvent(KeyEvent.KEY_PRESSED,"","",KeyCode.ENTER,false,false,false,false));return null;}); + await(()->fx(()->window.projectSession()!=null));assertEquals(1040,fx(stage::getWidth),3);assertEquals(730,fx(stage::getHeight),3); + fx(()->{((ComboBox)stage.getScene().lookup("#theme-select")).setValue(Theme.LIGHT); + ((ComboBox)stage.getScene().lookup("#language-select")).setValue(StudioLanguage.PORTUGUESE); + window.requestCloseProject();return null;});await(()->fx(()->launcher.isShowing()&&!launcher.getScene().lookup("#new-project").isDisabled())); + // A wizard cancellation does not leave a stale wizard owner behind. + fire(launcher,"new-project");await(()->fx(()->Window.getWindows().stream().anyMatch(w->w.isShowing()&&w.getScene().lookup("#wizard-name")!=null))); + fire(wizard(),"wizard-cancel");fire(launcher,"new-project"); + await(()->fx(()->Window.getWindows().stream().anyMatch(w->w.isShowing()&&w.getScene().lookup("#wizard-name")!=null))); + Stage wizard=wizard();fire(wizard,"wizard-next"); + assertFalse(fx(()->((Label)wizard.getScene().lookup("#wizard-feedback")).getText().isBlank())); + fx(()->{((TextField)wizard.getScene().lookup("#wizard-name")).setText("New Adventure");return null;}); + fire(wizard,"wizard-next");fire(wizard,"wizard-back"); + assertEquals("New Adventure",fx(()->((TextField)wizard.getScene().lookup("#wizard-name")).getText())); + fire(wizard,"wizard-next");fire(wizard,"wizard-next");fire(wizard,"wizard-next");fire(wizard,"wizard-next"); + // The selector and wizard inherit presentation chosen in the project window. + assertTrue(fx(()->((Label)wizard.getScene().lookup("#wizard-summary")).getText().contains("Nome: New Adventure"))); + capture(wizard,"wizard-confirm-light-pt");fire(wizard,"wizard-create"); + await(()->fx(()->window.projectSession()!=null));assertEquals("New Adventure",fx(()->window.projectSession().projectReference().name())); + Path created=projects.resolve("new-adventure");assertTrue(Files.isRegularFile(created.resolve("prometeu.json")));assertTrue(Files.isDirectory(created.resolve("src"))); + fx(()->{((ComboBox)stage.getScene().lookup("#scale-select")).setValue(1.5);window.requestCloseProject();return null;}); + await(()->fx(()->launcher.isShowing()&&!launcher.getScene().lookup("#open-project").isDisabled()));capture(launcher,"launcher-light-pt-150"); + fx(()->{((ScrollPane)launcher.getScene().lookup("#launcher-scroll")).setVvalue(1);return null;});capture(launcher,"launcher-light-pt-150-actions"); + failOpen.set(true);fire(launcher,"open-project"); + await(()->fx(()->launcher.isShowing()&&((Label)launcher.getScene().lookup("#launcher-notice")).getText().contains("session-fixture-failure"))); + assertNull(fx(window::projectSession));assertTrue(fx(()->!launcher.getScene().lookup("#open-project").isDisabled()));capture(launcher,"open-failure"); + failOpen.set(false);var latch=new CountDownLatch(1);hold.set(latch);fire(launcher,"open-project"); + await(()->hold.get()==null);var stopped=fx(window::closeAsync).toCompletableFuture();assertFalse(stopped.isDone()); + latch.countDown();stopped.get(15,TimeUnit.SECONDS);Thread.sleep(1100); + assertFalse(fx(stage::isShowing));assertFalse(fx(launcher::isShowing));assertEquals(sessionsOpened.get(),sessionsClosed.get()); + assertTrue(fx(()->Window.getWindows().stream().noneMatch(Window::isShowing))); + System.out.println("project desktop: sessions="+sessionsOpened.get()+", closed="+sessionsClosed.get()+", os="+System.getProperty("os.name")+", java="+System.getProperty("java.version")); + } finally {fx(window::closeAsync).toCompletableFuture().get(15,TimeUnit.SECONDS);worker.shutdown();assertTrue(worker.awaitTermination(15,TimeUnit.SECONDS));} + } + static double[] launcherLayout(Stage launcher)throws Exception { + return fx(()->{ + var page=(ScrollPane)launcher.getScene().lookup("#launcher-scroll"); + var frame=(javafx.scene.layout.Region)launcher.getScene().lookup("#projects-frame"); + var list=(ListView)launcher.getScene().lookup("#known-projects"); + return new double[]{page.getViewportBounds().getWidth(),page.getViewportBounds().getHeight(),frame.getWidth(),frame.getHeight(),list.getHeight()}; + }); + } + static void capture(Stage stage,String name)throws Exception { + Thread.sleep(120); + fx(()->{stage.getScene().getRoot().applyCss();stage.getScene().getRoot().layout();var image=stage.getScene().snapshot(null); + var output=new java.awt.image.BufferedImage((int)image.getWidth(),(int)image.getHeight(),java.awt.image.BufferedImage.TYPE_INT_ARGB); + for(int y=0;y