feat(studio): show executed source diagnostics in UI2
Capture bounded compiler inputs by revision and PBX identity, consume Play v2 faults and retain static diagnostic excerpts across failed preparation. Integrate the UI2 panel, qualification evidence and regression tests without adding an editor.
This commit is contained in:
@@ -168,6 +168,33 @@ instruction nor a function's first line supplies an exact fallback. The complete
|
||||
diagnostic and public-failure contract is defined in
|
||||
[Compiler 19, sections 12–13](19.%20Verification%20and%20Safety%20Checks%20Specification.md).
|
||||
|
||||
### 7.2 Consumed input for interactive execution diagnostics
|
||||
|
||||
The compiler adapter MUST capture the exact UTF-8 bytes already consumed by the
|
||||
compilation, including project files, dependencies, SDK interfaces and generated
|
||||
PBS/barrels. Synthetic loaders parsing in-memory text MUST also record those same
|
||||
bytes on their registered source handles. Capture MUST NOT reread working files
|
||||
or regenerate text after compilation. Mixed revisions, missing observations and
|
||||
malformed UTF-8 MUST fail capture explicitly.
|
||||
|
||||
The neutral execution capture binds compilation/build ID, emitted PBX SHA-256 and
|
||||
compilation-local file IDs to immutable source text, source SHA-256, project
|
||||
identity, logical origin and source kind. Dependency origins MUST identify their
|
||||
owning project; generated and SDK origins MUST remain recognizable. A path or
|
||||
file ID alone does not establish revision identity. Full text MUST NOT enter
|
||||
generic diagnostic maps, logs or the runtime wire protocol.
|
||||
|
||||
The initial capture policy is 4 MiB UTF-8 per file, 1,024 files and 16 MiB per
|
||||
capture. Accounting includes UTF-8 content, canonical/logical paths and reserved
|
||||
metadata for each source plus capture identity. Exceeding a budget MUST fail
|
||||
preparation explicitly; sources MUST NOT be silently dropped. These are retained
|
||||
capture storage budgets, not a bound on total compiler or JVM heap.
|
||||
|
||||
These values are consumed by the current UI2 diagnostic excerpt. They do not add
|
||||
PBX sections, change guest ABI or establish an editor/full-document API. Admission,
|
||||
retention, source availability and presentation are specified by
|
||||
[Integrated Play](../studio/14.%20Integrated%20Play%20Specification.md#execution-diagnostics).
|
||||
|
||||
## 8. Deterministic Emitter Rejection
|
||||
|
||||
Emitter-side rejection must be deterministic for malformed or inconsistent artifact candidates, including at minimum:
|
||||
|
||||
@@ -26,8 +26,8 @@ close MUST flush pending snapshots. Transient native show/maximization events MU
|
||||
NOT overwrite the saved normal geometry. Legacy geometry remains readable.
|
||||
|
||||
This slice exposes a global Play/Stop button, a separate Pause/Resume toggle, a
|
||||
Gameplay tab with the game viewport, and bounded logs. Execution belongs to the
|
||||
project session, independently of tab selection or lifetime. The global toolbar
|
||||
Gameplay tab with the game viewport, bounded logs and static execution diagnostics.
|
||||
Execution belongs to the project session, independently of tab selection or lifetime. The global toolbar
|
||||
MUST remain above the tabs. Starting Play selects Gameplay. Pause selection,
|
||||
accessible names and command availability MUST follow observed execution state,
|
||||
including automatic pauses and failures. Stop MUST remain Stop until execution
|
||||
@@ -307,6 +307,57 @@ Scale and scroll operate in JavaFX logical coordinates, with scene
|
||||
transforms accounting for host display scaling. These frontend changes apply to
|
||||
the new UI only; the old UI is outside the current graphics migration scope.
|
||||
|
||||
## Execution diagnostics
|
||||
|
||||
UI2 MUST present execution failures in the Gameplay diagnostic panel: category,
|
||||
message, available logical source/line/column, executed revision and a static
|
||||
excerpt. Preparation, connection, loading, host, watchdog and VM failures MUST
|
||||
remain distinguishable. PC, code, opcode, resource and source span are preserved
|
||||
when supplied by the producer; absent facts MUST NOT be invented. The first
|
||||
structured fault remains primary across subsequent EOF/process teardown.
|
||||
|
||||
Play requires a coordinated [protocol v2](../../../../runtime/docs/specs/runtime/11b-studio-play-protocol.md)
|
||||
pair and exact native bundle qualification. Runtime readiness confirms the digest
|
||||
of the PBX actually initialized. Studio MUST compare it with the captured build
|
||||
before START. A mismatch or incompatible protocol fails explicitly. Studio MUST
|
||||
NOT silently launch a lower-capability Play path. Existing asset/qualification
|
||||
guards and save/owned-process teardown contracts remain effective.
|
||||
|
||||
The compilation capture follows
|
||||
[Compiler 15 section 7.2](../compiler/15.%20Bytecode%20and%20PBX%20Mapping%20Specification.md#72-consumed-input-for-interactive-execution-diagnostics).
|
||||
The open project retains the last admitted execution and at most one candidate.
|
||||
The candidate replaces the last capture only after identity confirmation and
|
||||
immediately before execution starts. Failed/cancelled compilation, capture, boot
|
||||
or connection MUST preserve the previous admitted diagnostic. A new failed attempt
|
||||
may be shown alongside it, with its own execution identity. Late callbacks cannot
|
||||
overwrite the current attempt. Successful project close releases both captures
|
||||
after teardown; a refused save/close retains the current session. There is no
|
||||
persistent source history or full-file viewer.
|
||||
|
||||
Retained captures are limited to 16 MiB each, hence 32 MiB per project for last
|
||||
plus candidate, including accounted source metadata. This does not bound total
|
||||
compiler/JVM heap or caller-owned copies. The service resolves a diagnostic once
|
||||
against its immutable capture, off the FX thread, without filesystem reads.
|
||||
Resolution requires a matching PBX digest, captured file ID, valid half-open UTF-8
|
||||
byte boundaries and a range within the captured bytes. Missing identity, source,
|
||||
span or invalid offsets MUST yield an explicit availability explanation instead
|
||||
of a guessed location. Display positions are one-based lines and UTF-16 columns;
|
||||
CRLF and supplementary Unicode characters MUST be handled consistently.
|
||||
|
||||
The displayed excerpt contains at most seven lines and 8 KiB UTF-8, including the
|
||||
fault location when valid; long lines may be shortened at Unicode boundaries.
|
||||
Any shortened source or fault MUST be indicated explicitly. Editing or deleting
|
||||
the working file after compilation MUST NOT change the displayed executed text.
|
||||
Generated sources show the captured PBS and their generated origin. Dependency
|
||||
origins identify their owning project. Hash/build/execution identities remain
|
||||
available for attribution, with concise visual forms permitted.
|
||||
|
||||
The UI uses static presentation controls with existing themes, text scale,
|
||||
English/Portuguese localization and accessible labels. It MUST NOT instantiate
|
||||
an editor, full-document view, edit/save actions, editorial LSP or unused future
|
||||
editor infrastructure. The legacy JavaFX frontend is not modified by this feature;
|
||||
neutral API constructors remain compatible with its compilation.
|
||||
|
||||
## Verification and limits
|
||||
|
||||
The product baseline is Java 25, retaining JavaFX 23.0.2. The bundled image uses an
|
||||
|
||||
Reference in New Issue
Block a user