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
@@ -347,3 +347,24 @@ fuel exhaustion across slices and direct/transitive FRAME_SYNC are required;
sync fixtures use synthetic common IR because PBS exposes no sync construct.
Record revisions, platform/configuration, commands, scenarios, oracles and
results. Existing runtime tests alone are not producer integration evidence.
## Deterministic explanations and observed semantic context
PBS diagnostics retain their original code/message/template and add a detector-specific checkId, owner explanation and immutable semanticContext. This instrumentation MUST NOT change resolution, visibility, typing, lowering acceptance or source language rules. An observed resolution constraint is evidence about the implementation's lookup, not a declaration that the language requires that constraint.
| Check | Observed context |
| --- | --- |
| pbs.lowering.call-resolution | Requested call, receiver/type, argument count, declared candidates, enclosing return type and actual expected-type constraint. |
| pbs.lowering.structured-overload | Structured call, actual owner lookup key, parameter/return lookup types and observed lookup result. |
| pbs.flow.call-target | Applied symbol/construction, callable classification, argument/constraint, candidates and scope. |
| pbs.flow.assignment-target | Assignment symbol/construction, binding classification and scope. |
| pbs.lowering.stack-shape | Executable function, declared result slots, instruction count and recorded stack-check condition; known internal failure remains distinct from unsupported source construction. |
Each semantic fact has {value,availability,reason}. Known null differs from not-recorded/unavailable/not-applicable. Keep declaredTypes, expressionTypes and resolutionConstraints distinct. Unknown module/dependency/expression information is marked not-recorded; source identity is available separately in the origin/input map. Related declarations/candidates are included only when actually recorded. Generic-instantiation diagnostic reconstruction MUST preserve the complete context and reported phase.
The unchanged frozen cases F1-direct/F1-two-calls/F1-service-this, F3-function/F3-global/F3-service and F4-same-dependency/F4-same-direct qualify these mechanisms through real LSP analysis and Studio build/MCP. F3-service demonstrates that the shared unsupported-lowering code can represent distinct structured-overload and stack-shape checks. The original rejected observations are retained in the Studio diagnostic lesson. Following the production corrections, those eight valid sources MUST compile without their former false rejection; invalid file-private access remains a source rejection. Existing detector IDs, source attribution and operation-failure semantics remain unchanged.
## Production correction regressions
The compiler must no longer emit the received false call-resolution, peer-binding or nominal-owner rejections for the eight valid production cases. Negative visibility controls still return structured source errors, independently from loader/infrastructure/guest failures. Diagnostics remain producer-owned; a compiler correctness fix does not weaken source attribution or reinterpret callable completion as approval. PbsFacadeDiagnosticTest uses the unchanged F3-file-private negative fixture, and StructuredDiagnosticsIntegrationTest now verifies the corrected positive corpus plus that negative control. The earlier rejection evidence remains immutable.