feat(studio): improve compiler reliability and AI diagnostics
Test / Tests and coverage occurred while executing withChecks step.
Intrepid/Prometeu/Studio/pipeline/pr-master There was a failure building this commit

Preserve structured diagnostics, source attribution, phase outcomes and revision context through compiler, Studio, LSP, MCP and JavaFX. Add project service discovery and resilient VS Code reconnection.

Correct all eight reproduced PBS production failures in expression context, sibling executable bindings and nominal owner identity. Consolidate specs, lessons, immutable baseline evidence and the maintained source-to-guest qualification runner.

Validation: required Gradle gate recorded 724 tests, with 711 passed and 13 skipped. Full corpus passed 168 compilation observations and 108 guest runs (104 successes and four deliberate faults); supplemental controls passed 42 compilations and 16 guest runs. TypeScript compilation, two Node discovery tests and discussion validation passed.
This commit is contained in:
2026-11-10 12:36:25 +00:00
parent 38f201a9c9
commit ea1cc26fe3
1216 changed files with 168017 additions and 354 deletions
@@ -199,3 +199,25 @@ Filesystem publication MUST NOT run under a long-held authority monitor.
Glyph-bank animation authoring, generated-source navigation, strict task-scoped MCP tools and preview use the shared animation service and validation contract. UI/MCP preserve project authority, expected revisions, conflict/cancellation/revocation and document handoff. Persist only the canonical animation sidecar; keep generated PBS read-only and neutral services independent of JavaFX/transports.
See the [complete animation contract](12.%20Animation%20Authoring%20Specification.md).
## Explained diagnostic values and producer boundaries
StudioDiagnostic MUST carry the canonical logical issue through immutable JSON-compatible values. Studio API/Core MUST NOT depend on compiler AST/IR classes, PBS, LSP4j, transport objects or Throwable serialization. Existing code/severity/message constructors remain compatible.
| Field group | Contract |
| --- | --- |
| Identity | issueId identifies one producer event within analysisId. The same event keeps its ID in standard LSP data, complementary analysis, MCP and UI. Repeated events remain distinct. |
| Producer and rule | producer has component, owner and languageId; code is the original producer code. codeOrigin marks producer versus studio-adapter. templateId/templateParameters remain separate from message. checkId identifies the detector independently of a shared code. |
| Classification | severity, phase, stageId and failureKind preserve the producer's classification. Detection phase MUST NOT become an inferred cause. |
| Explanation | explanation has id, summary, rule and availability. Text is deterministic and owner-maintained, never generated by an LLM at query time. Unknown checks report unavailable explanation. |
| Evidence | facts, semanticContext, origin, related, suggestedChecks and limitations retain observed values and their availability. Suggested checks are investigations, not automatic source edits. |
semanticContext contains availability (available/partial/unavailable/not-applicable) and facts. Each fact is {value,availability,reason}, where availability is available/not-recorded/unavailable/not-applicable. An observed null is available; missing observations MUST NOT be represented as an observed null. Declared types, expression types and actual resolution constraints are separate concepts.
Origins keep UTF-8 byte spans, UTF-16 ranges and qualified IRVM coordinates separate. Convert a span only using matching captured source bytes. Missing origins, generated code, mixed input revisions and unavailable source text MUST NOT produce a fabricated zero range. Function context belongs in related context when no instruction source is recorded. Detection and context are not causal attribution.
The app compiler gateway translates complete warnings and BuildException payloads into neutral output or CompilerBuildFailure. Core MUST NOT catch compiler-domain exceptions directly. Packer adaptation preserves severity/category/blocking/evidencePath and asset identity; PACKER_<CATEGORY> is explicitly an adapter code. Asset ID MUST NOT be interpreted as a bank ID.
A shared public view contains issues, summary and context. Detail projection is limited to 1024 whole issues and 1 MiB of UTF-8 JSON issues. At a boundary, include a whole prefix, report partial detail coverage and LIMIT_EXCEEDED with budgets/total count, and retain full authoritative counts/evaluation separately. No issue field may be silently cut. UI and MCP consume this same view; underlying producer results remain complete.
Conformance: DiagnosticPayloadTest, StructuredShipperTest, StructuredDiagnosticsIntegrationTest and the compiler attribution/conversion regressions.