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
@@ -5,6 +5,37 @@ The current typed Registry/PBX v0 contract is normative in
Its complete typed function records, mandatory sections and verification rules
replace the earlier slot-only artifact baseline.
## Structured Compiler Diagnostic Qualification
These rows qualify Compiler 15 §7.1 and Compiler 19 §§12–13. They preserve the
original verifier rules and codes. Controlled RET/join failures qualify attribution,
not reproduction or correction of the historical Zelda reports. Local compiler
qualification does not release the separate Studio/MCP integration gate.
| Obligation | Required behavior | Tests | Status |
| --- | --- | --- | --- |
| G19-12.1-RET | Exact checked-program attribution, qualified function-relative byte PC and structured expected/actual heights. | `IRVMAttributionTest#retMustRetainOriginCoordinatesAndStructuredHeights` | pass |
| G19-12.1-JOIN | Join destination and conflicting heights; detection does not claim cause. | `IRVMAttributionTest#joinMustPointAtDestinationAndRetainConflictingHeights` | pass |
| G19-12.1-LOWERING | Preserve context when lowering fails before assigning IRVM. | `LowerToIRVMPipelineStageTest#validationMustPreserveOriginBeforeIrvmIsAssigned` | pass |
| G19-12.1-PASS | Input and pass-output validation identify their actual programs and shifted PCs. | `IRVMAttributionTest#optimizationInputMustHaveItsOwnValidationPoint`; `IRVMAttributionTest#failingPassMustUseShiftedOutputAndSurvivingOrigin` | pass |
| G19-12.2-PROVENANCE | Generated anchors, generated absence and unknown origin remain distinguishable. | `IRVMAttributionTest#generatedAndMissingOriginsMustBeExplicit`; `StructuredDiagnosticTest#provenanceMustRemainIndependentFromAvailability` | pass |
| G19-12.2-CONTEXT | Function context does not replace missing primary source; real zero offsets survive. | `IRVMAttributionTest#functionContextMustNotReplaceMissingInstructionSpan`; `IRVMAttributionTest#retMustRetainOriginCoordinatesAndStructuredHeights` | pass |
| G19-12.2-NOPLAN | Module-only and no-plan failures retain known coordinates and explicit absence. | `IRVMAttributionTest#moduleOnlyValidationMustPreserveFailureWithoutInventingSource` | pass |
| G15-7.1-REMAP | Rewrites/removals preserve operation provenance and function context. | `IRVMAttributionTest#jumpRemappingMustRetainGeneratedOriginAndFunctionContext`; existing G21-7.5 preservation tests | pass |
| G19-12.4-PROJECTION | Preserve message/phase, related relationships, template parameters and classification without transport dependencies. | `StructuredDiagnosticTest#projectionMustPreservePhaseParametersRelatedAndLongSpan`; `FrontendDiagnosticProjectionTest#frontendProjectionMustRetainMessageRelatedAndParameters` | pass |
| G19-12.4-PHASE | Preserve a reported backend phase through the semantic diagnostic model without inventing an enum classification. | `StructuredDiagnosticTest#backendPhaseMustRoundTripWithoutInventingASemanticPhase` | pass |
| G19-12.4-LIMIT | Existing verifier guards supply typed limit category and structured values through the stage adapter. | `BytecodePreloadVerifierServiceTest#resourceGuardsMustKeepLimitCategoryAndValuesWithoutMessageParsing`; `VerifyBytecodePipelineStageTest#stageMustPreserveTypedVerificationLimit` | pass |
| G19-12.4-IO | An observed artifact-write I/O failure retains infrastructure category and output identity. | `WriteBytecodeArtifactPipelineStageTest#ioFailureMustBeInfrastructureWithStructuredOutputPath` | pass |
| G19-13-ANALYSIS | Rejected analysis returns issues, stops later stages and makes no false success claim. | `CompilerFailurePayloadTest#rejectedAnalysisMustReturnIssuesWithoutSuccessOrLaterStages` | pass |
| G19-13-FACADE | Compile/build fail-fast retains earlier warnings and technical failures are not empty analysis. | `CompilerFailurePayloadTest#failFastCompileAndBuildMustPreserveEarlierWarnings`; `CompilerFailurePayloadTest#technicalFailureMustNotBecomeAnEmptyAnalysis` | pass |
| G19-13-FILES | Immutable source snapshots remain distinct when FileIds are reused and contexts end; legacy payload absence is explicit. | `CompilerFailurePayloadTest#compileMustPreserveAnalysisDiagnosticsAndIndependentSourceIdentities`; `StructuredDiagnosticTest#failuresMustKeepIndependentFileIdsAfterTablesAreCleared` | pass |
| G19-13-SYNTH | Common invalid IR reaches the public facade with origin without PBS sources. | `SyntheticFrontendPipelineTest#invalidCommonIrMustReachFacadeWithSourceWithoutPbs` | pass |
| G19-13-PBS | Original reduced PBS rejection has structured source and truthful logs; its materialized control still compiles. | `PbsFacadeDiagnosticTest#realPbsRejectionMustKeepStructuredSourceAndNoFalseSuccess`; `PbsFacadeDiagnosticTest#materializedControlMustStillCompileThroughPublicFacade` | pass |
Existing positive lowering, optimizer equivalence, emitter determinism and verifier
tests remain required controls. No new PBX format or runtime behavior is asserted
by these rows.
Status: Draft v1 (Traceability Baseline)
Applies to: compiler/backend conformance traceability for canonical stage order and entrypoint-specific contracts
@@ -161,3 +192,18 @@ frontend syntax and lowering remain consumer-owned.
| Structured initialization and binding diagnostics | HeadlessProcessSessionTest; observed runtime JSON fixtures | pass | Preserves full payload through MCP, including null outer PC |
| Published schema covers current runtime reasons | Actual LifecycleRole/NonFiniteValue payloads against runtime schema | partial | Runtime enum/schema mismatch recorded in AGD75; no payload rewriting |
| PBS migration and integrated delivery | AGD75 and consumer tickets | partial | Existing PBS suite passing is not complete executable lowering evidence |
## Explained diagnostic propagation qualification
| Contract | Required executable proof |
| --- | --- |
| Backend check identity/explanation/qualified coordinates | IRVMAttributionTest; controlledInvalidCommonIrRetAndJoinSurviveTheRealBuildGatewayAndAuthenticatedMcp in McpTaskToolsTest. |
| Real resource guard, unchanged code/budget | BytecodePreloadVerifierServiceTest.resourceGuardsMustKeepLimitCategoryAndValuesWithoutMessageParsing. |
| Eight unchanged PBS production sources, successful/negative controls, actual revisions, UI/MCP parity | StructuredDiagnosticsIntegrationTest with frozen corpus SHA-256 0ad291942af21e990f5cae3348a5be368dee865aa2843ba0d0effd1a9136cb87; authenticated MCP + production LSP/compiler/packer. |
| Retained analysis, version/digest mismatch and unavailable result | DiagnosticAnalysisProtocolTest; AutomationLspQueriesTest. |
| Failure codes and actual child termination/admission | LanguageFailureContractTest; TaskLanguageQueriesTest; existing task/revocation regressions. |
| Packer failed status/empty assets, payload preservation and cancellation | StructuredShipperTest. |
| Immutable values, known null, whole-issue count/UTF-8 detail budgets | DiagnosticPayloadTest. |
| Navigation revision and Unicode selection | DiagnosticNavigationTest; desktop evidence is recorded separately from projection tests. |
Controlled invalid common IR and protocol faults are labelled fixtures. They do not reproduce historical Zelda failures or claim guest/runtime qualification.