Implement retained target sessions, runtime sizing and Component navigation

This commit is contained in:
2026-11-12 14:20:26 +01:00
parent e41b276b13
commit 6e25cf3ac6
71 changed files with 2538 additions and 120 deletions
+4
View File
@@ -100,3 +100,7 @@ The standard bootstrap command runs the configuration/schema/context/runtime tes
Verified on 2026-11-12: **33 tests passed** (30 Maven, three IntelliJ), with zero failures, errors or skipped tests. The full clean bootstrap check also passed Java 21 target linkage, bytecode/dependency checks, plugin packaging and documentation validation. No socket/worker or rendered UI qualification is implied.
Scoped Maven build planning and immutable successful-build snapshots are now [implemented](build-and-refresh.md). Real provider discovery, metadata payload schemas, target rendering, socket integration, setup UI, OS qualification and the first connected two-host workflow retain their later gates.
## Stage-3 additive preview capabilities
The [runtime session implementation](target-runtime-sessions.md) adds negotiated `layout-v1` (MEASURE/OCCURRENCES) and `interactive-v1` operations without changing existing operation ordinals. The optional Preview configuration fields `requestTimeoutSeconds` and `readinessTimeoutSeconds` are schema-validated and default to 30 and 20 seconds. Readiness cannot exceed the request deadline. Measurement metadata and images retain full session/build/document/size correlation.
+2
View File
@@ -4,6 +4,8 @@ Bootstrap work package 7 connects the existing build/snapshot services to real t
Later implementation: [source-preserving projection](source-preserving-projection.md) replaces the original serialization and extends anonymous/nested Component and fx:root editing. Historical qualification and initial limitations below describe work package 7.
Later implementation: [target-runtime sessions](target-runtime-sessions.md) retains workers across sizing requests and adds measured layout, independent interactive preview and richer navigation. The per-batch process lifetime described below is the historical bootstrap behavior.
## Flow and ownership
```mermaid
+4
View File
@@ -95,3 +95,7 @@ Do not label these packages as additional unresolved Wayfinder decisions: the ar
## After bootstrap: source-preserving projection
Roadmap stage 2 now has source-range transactions, broader Component projection and shared live checks in both hosts. See [implementation and qualification boundaries](source-preserving-projection.md). The [human standalone and IntelliJ review](manual-input-validation.md) now closes the physical drag/drop and resize gate on the recorded macOS baseline, including the corner-resize correction at `b9d59e1`. Broader platform/input coverage remains separate. Continue with the [stage-3 implementation plan](target-runtime-stage-plan.md): retained target sessions, occurrence identity and sizing, shared canvas refresh, Component/Row navigation, and separate interactive previews.
## Target-runtime sessions, sizing and navigation
Stage 3 now has retained workers, scoped occurrences and target measurements, shared sizing/refresh, independent interactive preview, and Component/Row source navigation. See [implementation and qualification](target-runtime-sessions.md). Keep the new human navigation/interactive review open until its workflows are observed; the completed stage-2 drag/resize review does not automatically qualify these actions.
+1 -1
View File
@@ -69,4 +69,4 @@ The user subsequently passed the physical corner retest for both Components in b
This stage preserves arbitrary source, but does not make arbitrary structure visually editable. Insert/delete/reparent, binding-aware renames and subtree copy/paste require later structural transactions. Application wildcard imports, `fx:include`, scripts and unrepresentable roots retain source fallback. Arbitrary target properties use declared FXML text editing until shared discovery supplies typed metadata. Anonymous identities are local to a projection revision, not the persistent occurrence identities needed for repeated/Table Components. Target node lookup still uses the initial CSS-ID route; separate CSS IDs and repeated/internal scopes need stage 3's occurrence identity work.
Qualification remains scoped to the recorded macOS arm64 / IntelliJ 263.7307.200 / JavaFX and Kit 26 host baseline and Java 21 / JavaFX 21.0.7 application fixtures. Product packaging, a broader platform matrix, lossless structural editing and wider input qualification are not implied. The stage-2 physical input gate is closed on the tested baseline. Next: [target-runtime sessions, sizing and navigation](target-runtime-stage-plan.md).
Qualification remains scoped to the recorded macOS arm64 / IntelliJ 263.7307.200 / JavaFX and Kit 26 host baseline and Java 21 / JavaFX 21.0.7 application fixtures. Product packaging, a broader platform matrix, lossless structural editing and wider input qualification are not implied. The stage-2 physical input gate is closed on the tested baseline. The following [target-runtime stage](target-runtime-sessions.md) implements retained sessions, sizing and navigation; its new actions have a separate human review.
+61
View File
@@ -0,0 +1,61 @@
# Target-runtime sessions, sizing and Component navigation
Stage 3 extends the shared workflow used by standalone and IntelliJ. The [implementation sequence](target-runtime-stage-plan.md) records the accepted scope. Qualification below distinguishes automated checks from the remaining human review of the new actions.
## Session and request ownership
A retained canvas session owns one target JVM, private draft overlay and lease on one successful build. Its key contains build identity, selected example, the exact captured document set (including content/revisions), and explicit retained-build selection. Allocated dimensions are request inputs, not a reason to construct another Model graph. A changed key replaces the worker. A crashed worker is replaced on retry.
`LatestSession` runs one operation at a time and keeps one replaceable pending operation. Superseded futures fail with cancellation; host generation and document checks reject obsolete results. Replacement and cancellation close transport independently of the FX thread. Client continuations run outside the session lock. Idle retained workers have no whole-session deadline; startup, readiness and individual requests remain bounded. A snapshot lease is released only after the process has actually exited, including delayed forced termination.
Configuration 1.0 accepts optional `preview.requestTimeoutSeconds` (default 30) and `preview.readinessTimeoutSeconds` (default 20), each from 1 to 300; readiness cannot exceed the request deadline. These values do not select a different JVM or weaken the owner-lifetime channel. Discovery still reads metadata without constructing application objects.
Interactive preview uses another workflow and another JVM/Model graph. **Interactive preview** captures current drafts and opens the target window; **Stop preview** terminates it. Its title identifies example, build and captured revisions. Closing the target window releases that session and stops automatic reopening. Unsaved document edits mark an interactive preview outdated while preserving its sample state. Explicit rerun or a resource save restarts it with fresh sample data. Canvas previews continue to refresh from drafts. No application class is loaded into either host.
## Identity, measurement and pixels
The optional negotiated `layout-v1` capability adds MEASURE and OCCURRENCES operations; `interactive-v1` adds INTERACTIVE. Existing operation ordinals and raw RGBA rendering remain compatible. Metadata operations carry session/build/document/size correlation without claiming a pixel payload. Required incompatible capabilities fail negotiation.
Private parent overlays attach target-only declaration keys to projected nodes; authoritative FXML and CSS IDs remain unchanged. The worker gives live nodes opaque session-local occurrence IDs and reports their parent scope, declared key, actual type and Component resource origin. Nested and repeated instances have separate identities. Detached nodes are pruned and an instance whose Model changes receives a new identity. Legacy callers may use a CSS ID only when it identifies exactly one node. Treat occurrence IDs together with their worker session, never as durable project IDs.
Measurements return min/pref/max dimensions, baseline and content bias. Width-dependent preferred height and height-dependent preferred width are queried at the requested allocation. Finite `Double.MAX_VALUE` means an unbounded maximum; invalid/non-finite measurements fail validation. SnapshotRegion uses these values only for computed layout, not saved attributes.
The Kit parent and explicit constraints allocate size. Target capture temporarily makes the selected resizable node unmanaged so a parent layout during snapshot cannot overwrite that allocation; it restores managed state afterward and does not resize the entire parent for each child. A bound managed property currently produces an explicit diagnostic instead of silently capturing at the wrong size. Retained images remain visible during asynchronous updates. Target layout passes and host measurement/allocation passes are bounded at eight; failure retains the previous image with a diagnostic. A parent load failure cannot publish a partially successful image batch.
Repeat containers are represented by opaque target-rendered proxies, like Components and Tables; their repeated children are selectable as a whole in the parent. Nested internals are edited in their own Component document. Instance scopes and runtime metadata do not yet supply stage 4's binding authoring UI.
## Draft refresh and navigation
Parent and open FXML drafts are captured together. Canonical path handling covers macOS aliases, and a reactor filter prevents another project's/context's documents from entering the overlay. Read-only dependency cache documents are excluded from overlays. Invalidation is currently conservative within a reactor: it may refresh more open previews than a future exact dependency graph would require.
**Open Component** opens a separate editor, reusing an existing standalone window or IntelliJ designer tab. Repeat-container navigation resolves its declared repeated Component. **Open Row Component** follows the Table's explicit Row declaration without changing its layout. **Open Java** navigates the selected Component's source through the host. The parent keeps its draft and undo history.
Example selection is filtered by the opened View resource. A standalone `fx:root` Component loads through a generated private wrapper, then receives its own example Model through its model property; it does not borrow the parent's default example. Fixtures supply independent Card, AddressForm, NoteForm and VisitRow examples.
Reactor sources are editable. IntelliJ can also find source/resource pairs in open source-owning projects and opens them in that project; each project uses its own launch configuration. Multiple candidates prompt for an origin. JAR-only FXML is copied into a content-addressed read-only source cache with an origin label. It is not a writable application resource or a snapshot lease-dependent temporary editor file. Arbitrary unattached source archives and remote projects are not inferred to be editable projects.
## Regression coverage
- Retained resource reuse/replacement, latest pending request, stale result rejection, bounded measurement metadata, capability negotiation, deadline configuration and read-only JAR navigation.
- Real worker PID reuse for sizing, fresh worker on draft changes, process-crash retry, captured child overlays, cancellation, and owner death.
- Classpath/module-path target fixtures: Person.home → AddressForm → NoteForm, repeated visits, Table row occurrences, shared Models, independent Component examples, empty/missing values, wrapping measurements, actual allocated capture dimensions, Controller actions, conversion failure/recovery, Table selection/sorting/filtering and interactive window creation.
- Existing readiness, cleanup, invalid attributes, module access, immutable builds and source-preservation scenarios remain in the suites.
- Shared live Kit scenarios render AddressForm, Repeat and Table proxies in standalone and the registered IntelliJ designer while asserting that runtime sizing does not alter source.
The qualification runs passed 64 Maven tests and 7 IntelliJ adapter tests; 32 target processes executed 402 fixture checks. Connected workflow checks cover both hosts with classpath and module-path applications (100 assertions), including native shared Kit rendering and interactive draft/save lifecycle. Registered IntelliJ checks additionally verify the actual designer extension and exclusive JavaFX 26 native libraries.
Run the bootstrap and registered IDE commands in [README](../README.md). A successful automated run does not close the human navigation/interactive review: verify parent → Component → nested Component, repeated open/reuse, independent examples, interactive editing, save-triggered restart, and closing/reopening preview in both hosts. The completed stage-2 mouse review remains valid for its artifact; input changes should receive focused retesting.
## Next human review (both hosts)
1. Open `Full.fxml`, Build and Refresh, and select its `full` example. Select AddressForm and use Open Component. Confirm a separate editor opens and repeated opening reuses it, with the parent draft intact.
2. Build and Refresh the child; verify its independent example, then open nested NoteForm. Return to the parent and check selection/editability and Undo/Redo.
3. Open the repeated visit Component, then explicitly Open Row Component on the Table. Confirm AddressForm for repeated visits and VisitRow for Table rows, with no parent layout changes.
4. Start Interactive preview. Edit the street and exercise the action button and Table. Make an unsaved designer edit: the running sample state should remain and show outdated status. Save: preview should restart with fresh sample data and the saved change.
5. Close the interactive window, rerun it, stop it, and close the owning editor. Check that windows close and can be opened again. Repeat with the module-path fixture and IntelliJ host.
These checks are pending; automated window/control checks do not count as human acceptance.
## Boundaries
Qualification remains the recorded macOS arm64 / OpenJDK 25 / JavaFX and Kit 26 / IntelliJ 263.7307.200 host baseline and Java 21 / JavaFX 21.0.7 target fixtures. New protocol fields and preview behavior are development contracts, not a frozen public release. Structural authoring, binding/generation panels, production host handoff, broader platform coverage and packaging retain their later gates. VoiceOver remains outside scope.
+2 -2
View File
@@ -1,8 +1,8 @@
# Target-runtime sessions, sizing and Component navigation
Status: implementation plan for roadmap stage 3; **not implemented or qualified by this document**. Stage 2's [manual input gate](manual-input-validation.md) is closed on its recorded baseline. This work implements the accepted preview and host contracts; it does not reopen them as Wayfinder decisions.
Status: stage-3 implementation and automated qualification are described in the [runtime implementation report](target-runtime-sessions.md). The new navigation/interactive human review remains a separate gate. This document retains the implementation sequence and acceptance criteria. Stage 2's [manual input gate](manual-input-validation.md) is closed on its recorded baseline. This work implements the accepted preview and host contracts; it does not reopen them as Wayfinder decisions.
## Current implementation and gaps
## Starting implementation and gaps (before this stage)
| Area | Existing code | Work required |
| --- | --- | --- |