Add shared human/task asset batches with reviewed atomic publication, explicit reference rebinds, ownership inspection and qualified glyph/scene budgets. Expose the same authoring and capacity results through Assets and MCP. Deliver isolated guest test targets, retained visual evidence and immutable runtime lifecycle/control observations. Preserve provider qualification and installed authoring examples alongside the completed discussion lessons. Close AGD-106 coordination and the delivered discussion workflows through housekeeping, updating lesson references and preserving qualification limits. Sound remains outside the asset delivery wave. Validation: 579 module tests and 31 additional desktop, process and installed checks passed; native glyph/scene 16/17 boundaries qualified. Discussion validation passed after housekeeping.
103 lines
14 KiB
Markdown
103 lines
14 KiB
Markdown
---
|
|
id: LSN-0105
|
|
ticket: studio-ai-first-build-language-results
|
|
title: Explained Diagnostics from Producers to Studio
|
|
created: 2026-11-10
|
|
tags: [studio, compiler, pbs, diagnostics, lsp, mcp, integration]
|
|
---
|
|
|
|
## Context and ownership
|
|
|
|
**Owner:** studio. Compiler and compiler/pbs own detector facts and explanations; the app translates them, Core aggregates them, and MCP/JavaFX publish the same neutral result. This lesson consolidates accepted DEC-0090 and completed PLN-0168 from DSC-0113 (formerly AGD-0115). The preceding common compiler attribution work is [LSN-0104](../DSC-0112-compiler-verifier-source-diagnostics/LSN-0104-faithful-compiler-attribution-and-structured-failures.md).
|
|
|
|
The original problem was information loss. A producer could retain source and verification context while the Studio gateway exposed only strings, a build operation appeared successful because its callable returned, or a language-query failure looked like an empty diagnostic list. AI consumers needed the observed evidence and the meaning of each result without reconstructing language semantics from logs.
|
|
|
|
The user accepted the decision, requested a plan and authorized implementation. Every requirement was implemented; no PBS product fix was pulled forward. No runtime files were written and no commits were created. The existing dirty worktree and unrelated LSP-discovery/VS Code work were preserved.
|
|
|
|
## Final result and evidence
|
|
|
|
The required compiler/PBS/LSP/API/Core/UI/app regression, installed knowledge and real JavaFX desktop gate passed: **869 recorded tests, 856 passed, 13 skipped, zero failures/errors**. Exact suites/skips, commands, source/report/artifact hashes and evidence limits are in [qualification](evidence/qualification.json), [provenance](evidence/provenance.json) and the [evidence guide](evidence/README.md).
|
|
|
|
[The authenticated MCP/project-LSP report](evidence/frozen-corpus.json) preserves the frozen original corpus SHA-256 `0ad291942af21e990f5cae3348a5be368dee865aa2843ba0d0effd1a9136cb87`. It tests unchanged PBS/barrel sources, actual consumed-source revisions and UI/MCP projection parity. Existing cartridge app_id adoption is identified separately from the frozen sources. F1-local passes compiler-build/pack-validation/pack/manifest and its generated artifacts are hashed. A separate valid empty file returns an evaluated empty analysis through authenticated MCP and the real LSP.
|
|
|
|
| Original case | Observed mechanism retained |
|
|
| --- | --- |
|
|
| F1-direct | Call resolution records data.value, Probe receiver, declared int result and the actual bool resolution constraint. |
|
|
| F1-two-calls | Both failed call events remain separate issues with their recorded constraints. |
|
|
| F1-service-this | The service receiver/owner and declared result remain available separately from the actual lookup constraint. |
|
|
| F3-function | Applied symbol, UNKNOWN callable classification, argument type and empty candidate set. |
|
|
| F3-global | Assignment symbol, unresolved binding and source scope. |
|
|
| F3-service | Structured-overload lookup failure and a separate frontend stack-shape failure; the latter is internal-failure. |
|
|
| F4-same-dependency | RoomData receiver/type and the exact consulted owner/key/signature, with unavailable module/dependency facts explicit. |
|
|
| F4-same-direct | The corresponding direct-call failure retains the same observed lookup evidence and its own source identity. |
|
|
|
|
These observations explain current rejection. In particular, the bool constraint is not a new language rule or proof that the author wrote an invalid comparison. The later PBS correction plan remains separate.
|
|
|
|
## One immutable issue vocabulary
|
|
|
|
The canonical issue contains issueId; producer(component/owner/languageId); original code/codeOrigin/templateId/templateParameters/checkId; severity/phase/stageId/failureKind; message; facts; explanation; semanticContext; origin/related; suggestedChecks; and limitations. Immutable JSON-compatible values cross compiler/app/Core boundaries; Studio API/Core import no compiler AST/PBS/LSP4j objects. Compatibility constructors preserve existing call sites.
|
|
|
|
Explanation is a deterministic owner catalogue with id/summary/rule/availability. Semantic context has overall availability and per-fact {value,availability,reason}. An observed null is available. A fact not captured by the detector is not-recorded, rather than an invented null observation. Declared types, expression types and actual resolution constraints remain distinct.
|
|
|
|
The backend check IDs are compiler.verify.ret-stack-height, compiler.verify.join-stack-height and compiler.verify.resource-limit. Frontend checks are pbs.lowering.call-resolution, pbs.lowering.structured-overload, pbs.flow.call-target, pbs.flow.assignment-target and pbs.lowering.stack-shape. Check identity is selected at the detector without parsing a message. Original codes remain unchanged, including cases where distinct checks share a code.
|
|
|
|
DiagnosticContext updates, BuildingIssue conversions, generic specialization wrappers and IRBackend/function/emission/optimization copies preserve enrichment. Common backend metadata remains language-neutral. Studio does not resolve another symbol to generate an explanation. Suggested checks describe investigations, not source edits or causal claims.
|
|
|
|
## Keep evaluation, execution and coverage independent
|
|
|
|
ShipperPrepareResult preserves its legacy fields and adds issues/summary/context. The app gateway captures successful compiler warnings and structured failures; Core receives a neutral CompilerBuildFailure. Packer adaptation retains category/severity/blocking/evidencePath and asset identity. An adapter fallback is explicitly PACKER_<CATEGORY>; assetId never becomes bankId.
|
|
|
|
OperationState.SUCCEEDED records mechanical completion, while summary.validationStatus determines passed/rejected/failed/incomplete/not-evaluated/cancelled evaluation at document/project/build scope. Approval requires all four build stages passed, including both packer SUCCESS status and canPack(). A failed packer result with empty assets cannot approve a build. Stages not reached remain not-run; a usable buildId requires a successful current task build.
|
|
|
|
Counts come from complete producer data and are nullable when unknown. The shared public detail view admits at most 1024 whole issues and 1 MiB UTF-8 JSON. At a boundary it reports LIMIT_EXCEEDED, partial coverage, budgets and original counts; no field is silently cut. Producer evaluation remains independent of the detail sample. Legacy-only diagnostic data is explicitly limited rather than advertised as a complete zero-issue analysis.
|
|
|
|
Cancellation remains CANCELLED in Shipper and the executor. Known partial diagnostics/stages survive. Final tracked results and the canonical session result publish after actual termination, including a late cooperative return. A cancelled result cannot publish an approved buildId. Results never grant manual control implicitly.
|
|
|
|
## Associate positions with the bytes actually consumed
|
|
|
|
SourceHandle records SHA-256 when its provider returns bytes; diagnostic access does not reread the live file. Snapshots qualify local FileId with project/path/analysis identity and detect mixed reads. Captured text is available only for valid UTF-8. A UTF-16 range is projected only from the matching captured content at valid byte boundaries. Mixed revisions, missing content and missing origins preserve their limitation without a guessed zero range.
|
|
|
|
UTF-8 source spans, UTF-16 ranges and IRVM function-byte PCs are separate coordinates. A function declaration is related context when an instruction has no source attribution. Generated/detection/context roles do not establish a cause. [Controlled backend evidence](evidence/controlled-backend.json) uses a test-only registered frontend and the real backend/gateway/Shipper/authenticated MCP to demonstrate RET, join and missing instruction origin. It does not claim historical Zelda reproduction or run the backend inside a language query.
|
|
|
|
Context retains applicable project/task/operation/client request/query/analysis/build identity, saved primary-document digest and consumed input revisions. Known language/SDK/target/profile values are recorded. Compiler-source coverage is not whole pack/assets coverage; configuration values without manifest-byte identity remain explicitly limited. External sources keep the existing admitted, task-owned read-only snapshot/revision contract.
|
|
|
|
## Retain and query the same LSP analysis
|
|
|
|
The real server negotiates experimental prometeuDiagnosticAnalysis v1 with method prometeu/documentAnalysis and diagnosticDataVersion=1. Standard Diagnostic.data.prometeu carries version, analysisId, issueId and the same canonical issue. Under the detail budget it retains identity plus explicit omission. Standard diagnostics require a real matching range; locationless/project issues remain in the complementary envelope.
|
|
|
|
The request accepts textDocument(uri/version) and contentSha256. The server retains the didOpen/didChange result and returns its analysisId/document/issues/summary/inputs/configuration; requesting details does not trigger a second analysis. URI/version/digest mismatch is -32020/ANALYSIS_REVISION_MISMATCH, unavailable retained analysis is -32021/ANALYSIS_UNAVAILABLE, and analysis exceptions are errors. Connection version=1 is not a global disk revision.
|
|
|
|
studio_language_query keeps operation/result/limitations and adds analysis/context. A server without the extension retains standard behavior but reports ANALYSIS_DETAILS_UNAVAILABLE and not-evaluated rich coverage. An empty standard array cannot establish a valid project or successful evaluation.
|
|
|
|
## Bound the response without releasing live resources
|
|
|
|
Language queries use a 10000 ms admission-relative execution budget and 2000 ms cleanup response window. Pending requests, socket/listening and owned executors are cancellable. shutdownNow only requests termination. When a child ignores interruption, the caller returns the primary failure with workerTerminated=false while the existing managed worker remains alive and admission remains busy until the child actually stops.
|
|
|
|
The seven neutral codes distinguish timeout, cancellation, server unavailable, protocol failure, internal failure, cleanup failure and revision mismatch. details preserve applicable identity, method/component, budgets, actual termination and cleanup. runtimeError remains native-runtime-only. First failure wins; late failures do not replace it. Existing authority/read-only/unsupported/parameter codes remain valid.
|
|
|
|
Task cleanup callbacks remain registered after a failed return, so an explicit retry cannot forget an unreleased resource and restore manual access early. Successful cleanup removes those callbacks. Existing deduplication, revocation and cross-project/task isolation remain in the existing session/task controller.
|
|
|
|
## Human projection and navigation
|
|
|
|
DEV and the existing build surface use the same bounded public view as MCP. The shared pane shows readable summary/counts/stages and expandable check, facts, semantics, origins, related context and suggested checks. It does not classify log text or run another analysis.
|
|
|
|
Navigation reads only an admitted project source, verifies the digest before selecting the recorded range, and opens a read-only viewer. A changed file is labelled stale without presenting the old position as current. Missing/mixed revisions remain explicit. Unadmitted diagnostic origins do not gain filesystem access; existing external/generated source navigation keeps its read-only policy.
|
|
|
|
The [desktop image](evidence/diagnostic-desktop.png) was captured from the actual shared JavaFX component and visually inspected. DevDesktopTest expands facts and verifies the real read-only source window/symbol selection. DiagnosticNavigationTest covers Unicode and changed-revision behavior. This is separate from MCP/model parity and does not claim a whole-product usability review.
|
|
|
|
## Pitfalls
|
|
|
|
- Treating callable completion as product approval, or canPack() alone as packer success.
|
|
- Calling an empty or bounded diagnostic sample a complete valid analysis.
|
|
- Reconstructing a resolution constraint from a message or promoting an observed constraint into a language rule.
|
|
- Losing context while rebuilding a generic diagnostic, reindexing common functions or optimizing emission plans.
|
|
- Reusing a FileId or source range with a different analysis/digest, or rereading live bytes to invent a build revision.
|
|
- Treating cancellation acknowledgement or shutdownNow as worker termination; forgetting failed cleanup on retry.
|
|
- Claiming visual inspection from projection assertions, or historical failure reproduction from controlled invalid IR.
|
|
|
|
## Normative references and next handoff
|
|
|
|
Long-lived operational rules are consolidated in [Studio 9](../../../docs/specs/studio/9.%20Studio%20Core%20and%20Adapter%20Architecture%20Specification.md), [Studio 10](../../../docs/specs/studio/10.%20DEV%20and%20Automation%20Specification.md), [Studio 11](../../../docs/specs/studio/11.%20MCP%20Tools%20and%20Project%20Knowledge%20Contract.md), [Compiler 19](../../../docs/specs/compiler/19.%20Verification%20and%20Safety%20Checks%20Specification.md), [Compiler 22](../../../docs/specs/compiler/22.%20Backend%20Spec-to-Test%20Conformance%20Matrix.md) and [PBS 12](../../../docs/specs/compiler-languages/pbs/12.%20Diagnostics%20Specification.md). The schema/examples remain in [studio-tools-v1.json](../../../prometeu-app/src/main/resources/mcp/studio-tools-v1.json).
|
|
|
|
DEC-0090 and PLN-0168 are completed control artifacts, consolidated here and housekept via the discussion CLI. [AGD-0106](../DSC-0104-compiler-game-production-reliability/LSN-0113-coordinating-compiler-reliability-and-diagnostic-delivery.md) preserves this integrated evidence alongside LSN-0104. The user accepted the submitted integrated evidence on 2026-11-10 and released the PLN-0166 gate. Its complete eight-case correction and final 168/108 matrix are consolidated in [LSN-0106](../DSC-0111-pbs-production-reproductions-and-fixes/LSN-0106-pbs-production-binding-and-lowering-corrections.md). This later result preserves the historical first-delivery reports here unchanged. The historical Zelda BAD_RET/Scene reports remain not reproduced.
|