feat(studio): ship JavaFX 2 Play and delegate integration tooling
Test / Tests and coverage occurred while executing withChecks step.
Intrepid/Prometeu/Studio/pipeline/head There was a failure building this commit

Launch the JavaFX 2 project shell on Java 25 with an interactive viewport,
managed Play lifecycle and project mutation guards. Preserve headless/MCP and
save compatibility, and qualify exact runtime executable bundles.
Separate unit JaCoCo gates from opt-in integration suites and use the internal
Pong fixture for the headless visual pilot.
Move maintenance and native conformance tools into tooling; retain the VS Code
extension and update current navigation links.

Validation: tooling make verify passed, including 1064 Studio unit tests,
JaCoCo thresholds and 22 headless integration tests.
This commit is contained in:
2026-11-19 17:32:03 +00:00
parent 1e17fc4d67
commit 71fb80efc3
163 changed files with 5929 additions and 4950 deletions
@@ -0,0 +1,12 @@
package p.studio.api.automation;
import java.util.concurrent.Callable;
import java.util.function.Supplier;
/** Internal project admission port; not an agent capability or generic tool endpoint. */
public interface ExecutionAuthority {
ManualLease enterExecution();
boolean preparingExecution();
<T> T prepareExecution(Supplier<T> work);
<T> T callExecutionPreparation(Callable<T> work) throws Exception;
}
@@ -6,6 +6,9 @@ public interface ProjectAccess {
/** Execution owns the manual lane until its runtime has stopped. */
default ManualLease enterExecution(Path path) { return enterManual(path); }
/** Preparation is admitted by the existing execution owner, never by arbitrary UI writers. */
default <T> T prepareExecution(Path path, java.util.function.Supplier<T> preparation) {return preparation.get();}
default <R> p.studio.api.operation.OperationHandle<R> submitManual(Path path,
p.studio.api.operation.OperationExecutor executor, String summary, java.util.concurrent.Callable<R> work) {
ManualLease lease = enterManual(path);
@@ -7,6 +7,16 @@ public interface ExecutionController extends AutoCloseable {
void stop();
default OperationHandle<ExecutionSnapshot> pause() { throw new UnsupportedOperationException("Pause unavailable"); }
default OperationHandle<ExecutionSnapshot> resume() { throw new UnsupportedOperationException("Resume unavailable"); }
default java.util.concurrent.CompletionStage<Void> stopAsync() {
stop(); return java.util.concurrent.CompletableFuture.completedFuture(null);
}
default ExecutionFrame acquireLatestFrame() { return null; }
default void input(ExecutionInput input) { }
/** True until preparation, process and cleanup have actually relinquished ownership. */
default boolean ownsExecution() { return false; }
default void shutdown() {
close();
}
@@ -5,4 +5,9 @@ import p.studio.api.project.ProjectReference;
public interface ExecutionControllerFactory {
ExecutionController create(ProjectReference project, ProjectLocalStudioSetup setup, ExecutionSession session);
default ExecutionController create(ProjectReference project, ProjectLocalStudioSetup setup, ExecutionSession session, PlayOptions options) {
if (options.disposableSave()) throw new UnsupportedOperationException("Disposable Play unavailable");
return create(project,setup,session);
}
}
@@ -0,0 +1,30 @@
package p.studio.api.execution;
import java.nio.ByteBuffer;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicBoolean;
/** Exclusive lease of stable BGRA_PRE pixels. Copy before close; never retain pixels after close. */
public final class ExecutionFrame implements AutoCloseable {
private final int width,height;
private final long id,epoch;
private final long receivedAtNanos;
private final ByteBuffer pixels;
private final Runnable release;
private final AtomicBoolean closed = new AtomicBoolean();
public ExecutionFrame(int width,int height,long id,long epoch,byte[] pixels,Runnable release) {
this(width,height,id,epoch,pixels,System.nanoTime(),release);
}
public ExecutionFrame(int width,int height,long id,long epoch,byte[] pixels,long receivedAtNanos,Runnable release) {
if (width<=0 || height<=0 || pixels.length%4!=0 || (long)width*height!=pixels.length/4L)
throw new IllegalArgumentException("Invalid frame dimensions");
this.width=width;this.height=height;this.id=id;this.epoch=epoch;
this.receivedAtNanos=receivedAtNanos;
this.pixels=ByteBuffer.wrap(pixels).asReadOnlyBuffer();this.release=Objects.requireNonNull(release);
}
public int width(){return width;} public int height(){return height;}
public long frameId(){return id;} public long epoch(){return epoch;}
public long receivedAtNanos(){return receivedAtNanos;}
public ByteBuffer pixels(){if(closed.get())throw new IllegalStateException("Frame released");return pixels.duplicate();}
@Override public void close(){if(closed.compareAndSet(false,true))release.run();}
}
@@ -0,0 +1,9 @@
package p.studio.api.execution;
/** Canonical pad/touch snapshot. Bits 0..11 are pad, bit 12 is touch. */
public record ExecutionInput(int buttons, int touchX, int touchY) {
public static final ExecutionInput NEUTRAL = new ExecutionInput(0,0,0);
public ExecutionInput {
if ((buttons & ~0x1fff) != 0) throw new IllegalArgumentException("Unknown input bits");
}
}
@@ -19,6 +19,11 @@ public interface ExecutionSession extends AutoCloseable {
void transitionToRunning();
default void transitionToPausing() { throw new UnsupportedOperationException(); }
default void transitionToPaused() { throw new UnsupportedOperationException(); }
default void transitionToResuming() { throw new UnsupportedOperationException(); }
default void transitionToStopping() { throw new UnsupportedOperationException(); }
void transitionToRuntimeFailed();
void transitionToStopped();
@@ -6,6 +6,10 @@ public enum ExecutionState {
PREPARE_FAILED,
CONNECTING,
RUNNING,
PAUSING,
PAUSED,
RESUMING,
STOPPING,
RUNTIME_FAILED,
STOPPED
}
@@ -0,0 +1,6 @@
package p.studio.api.execution;
/** Explicit per-session save policy; persistent media is never implicitly discarded. */
public record PlayOptions(boolean disposableSave) {
public static final PlayOptions PERSISTENT = new PlayOptions(false);
}
@@ -3,5 +3,7 @@ package p.studio.api.session;
import p.studio.api.project.ProjectReference;
public interface ProjectSessionFactory {
/** Interactive product slice; implementations may defer agent and editor infrastructure. */
default ProjectSession openForPlay(p.studio.api.project.ProjectReference project){return open(project);}
ProjectSession open(ProjectReference projectReference);
}