feat(studio): improve compiler reliability and AI diagnostics
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:
@@ -266,7 +266,7 @@ IDs from another task or project cannot be used. Client sockets/listeners close
|
||||
on success, failure, timeout or cancellation; project-server shutdown closes its
|
||||
accepted sockets and executor. A lost client does not independently grant control.
|
||||
|
||||
The adapter bounds connect time to 2 seconds and the LSP exchange to 10 seconds;
|
||||
The adapter bounds connect time to 2 seconds within the shared 10-second admission-relative execution budget, followed by a 2-second cleanup response window;
|
||||
Core bounds the request worker wait to 12 seconds. Documents are limited to 4 MiB
|
||||
of UTF-8 and task-local hierarchy state to 1024 items. These are adapter resource
|
||||
guards, unrelated to the runtime's deterministic frame/watchdog semantics.
|
||||
@@ -638,3 +638,35 @@ The coding client continues to own its configured stdio process and initial trus
|
||||
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 diagnostics and same-analysis LSP extension
|
||||
|
||||
The existing tools remain the entry points. studio_operation_get adds issues/summary/context to its build result; studio_language_query preserves operation/result/limitations and adds analysis/context. AutomationFailure adds neutral details. runtimeError remains reserved for native runtime data. Result fields and errors are declared in mcp/studio-tools-v1.json.
|
||||
|
||||
Correlation uses the applicable projectRoot/taskId/operationId/clientRequestId/queryId/analysisId/buildId. queryId identifies the admitted synchronous language query; it does not imply a new persisted operation registry. source FileId remains compilation-local and is qualified by analysis/input identity. Context identifies actual observed source inputs with SHA-256, language/SDK/target/profile values and honest partial coverage. A per-connection version=1 is not a global disk revision. Configuration values without a captured manifest-byte revision and pack/assets inputs MUST remain explicitly limited.
|
||||
|
||||
The LSP client advertises experimental.prometeuDiagnosticAnalysis={version:1}. A supporting real compiler-backed project server returns:
|
||||
|
||||
```json
|
||||
{"prometeuDiagnosticAnalysis":{"version":1,"method":"prometeu/documentAnalysis","diagnosticDataVersion":1}}
|
||||
```
|
||||
|
||||
For each didOpen/didChange, the server retains one analysisId and its complete analysis result. Located standard diagnostics contain data.prometeu={version:1,analysisId,issueId,issue}. Under the shared detail budget, identity and an explicit omission limitation replace the omitted issue. Locationless/project issues remain in the complementary analysis envelope and MUST NOT be coerced into standard zero ranges.
|
||||
|
||||
The request prometeu/documentAnalysis accepts {textDocument:{uri,version},contentSha256}. It returns {analysisId,document,issues,summary,inputs,configuration} from that retained analysis, without running a second backend/semantic analysis to produce details. document identifies the exact opened content. Current URI/version/digest mismatch returns JSON-RPC -32020 with reason ANALYSIS_REVISION_MISMATCH; unavailable retained analysis returns -32021 with ANALYSIS_UNAVAILABLE. Closing/disconnecting clears retained data. Analysis execution failure is an error, never successful empty diagnostics.
|
||||
|
||||
When the capability is absent, preserve standard results, report ANALYSIS_DETAILS_UNAVAILABLE, and use limited/unavailable rich coverage with not-evaluated validation. This fallback does not qualify the enriched integration. Empty standard diagnostics alone cannot establish project/build validity.
|
||||
|
||||
| Failure code | Mechanism |
|
||||
| --- | --- |
|
||||
| LANGUAGE_QUERY_TIMEOUT | Admission-relative execution deadline expired. |
|
||||
| LANGUAGE_QUERY_CANCELLED | Query interrupted or cancelled. |
|
||||
| LANGUAGE_SERVER_UNAVAILABLE | Project endpoint absent/unreachable. |
|
||||
| LANGUAGE_QUERY_PROTOCOL_FAILURE | Unexpected JSON-RPC/protocol failure. |
|
||||
| LANGUAGE_QUERY_INTERNAL_FAILURE | Analysis/query execution failed internally or advertised analysis is unavailable. |
|
||||
| LANGUAGE_QUERY_CLEANUP_FAILED | Owned query resource cleanup failed. |
|
||||
| LANGUAGE_QUERY_REVISION_MISMATCH | Analysis document identity differs from requested revision. |
|
||||
|
||||
Details retain component, operation/method, queryId, applicable identity, executionBudgetMs, cleanupBudgetMs, workerTerminated and cleanup. Preserve existing authority, read-only, unsupported and parameter errors. The first failure wins; cleanup status is attached independently. The default budget is 10000+2000 ms as specified by Studio 10. This does not alter runtime deadlines.
|
||||
|
||||
Conformance: StructuredDiagnosticsIntegrationTest exercises all eight unchanged PBS sources (now corrected positives), F1-local and the file-private negative control through authenticated HTTP MCP and the real project LSP; McpTaskToolsTest controlled invalid common IR exercises RET/join through the production backend/gateway/build tool. DiagnosticAnalysisProtocolTest checks retained identity/mismatch/unavailable; LanguageFailureContractTest checks real-socket controlled faults, fallback and delayed child termination. Existing task tests retain deduplication, cross-project isolation and revocation gates.
|
||||
|
||||
Reference in New Issue
Block a user