prometeu-studio/discussion/workflow/plans/PLN-0116-remove-pbs-imports-from-common-lsp-and-add-boundary-coverage.md
2026-07-15 11:33:43 +01:00

69 lines
3.2 KiB
Markdown

---
id: PLN-0116
ticket: multi-frontend-remove-pbs-branches
title: Remove PBS imports from common LSP and add boundary coverage
status: done
created: 2026-07-15
completed: 2026-07-15
ref_decisions: [DEC-0042]
tags: [compiler, compiler-general, compiler-pbs, studio, frontend, coupling, multi-frontend]
---
## Briefing
After generic editorial DTOs and LSP capabilities are migrated, `DEC-0042` requires the common LSP path to stop importing PBS implementation packages and to propagate enforcement to the architectural-tests track.
## Objective
Remove remaining PBS implementation imports from common LSP code and add regression coverage proving LSP uses frontend/provider contracts instead of PBS internals.
## Dependencies
- Depends on `PLN-0111` through `PLN-0115`.
- Coordinates with `AGD-0067` for broader architectural-test policy.
## Scope
- Remove `p.studio.compiler.pbs.*` imports from the common `CompilerLanguageServiceBridge` path.
- Remove direct use of `PbsAst.File`, `PbsEditorial*`, and `PBSFrontendPhaseService.semanticReadSurface(...)` from common LSP code.
- Add local boundary tests or feed the final rule into the architectural-tests discussion.
- Preserve PBS default/fallback behavior for no explicit language choice.
## Non-Goals
- Removing PBS from composition root, templates, fixtures, VS Code `.pbs` registration, semantic keys, or PBS frontend internals.
- Changing unknown `languageId` failure behavior.
- Introducing ArchUnit unless `AGD-0067` chooses it.
- Implementing new LSP features.
## Execution Method
1. Search `prometeu-lsp/prometeu-lsp-v1/src/main/java` for `p.studio.compiler.pbs`, `PbsAst`, `PbsEditorial`, and `PBSFrontendPhaseService`.
2. Replace remaining common-path dependencies with generic frontend language-service calls.
3. If any PBS adapter remains, move it behind an explicitly local adapter boundary and document why it is temporary.
4. Add or update tests using a compile-only or fake provider to prove semantic tokens, completion, hover, and signature help do not require PBS.
5. Add a simple import-boundary test if one can be implemented without new infrastructure; otherwise update `AGD-0067`/derived plan with the exact rule.
6. Run relevant LSP and PBS regression tests.
## Acceptance Criteria
- Common LSP production code does not import `p.studio.compiler.pbs.*`.
- Common LSP production code does not know `PbsAst.File`, `PbsEditorial*`, or `PBSFrontendPhaseService`.
- Unknown `languageId` still fails explicitly.
- PBS remains product default/fallback when no language is chosen.
- Tests prove missing language-service capabilities produce deterministic fallback responses.
- Architectural-test follow-up is recorded for any repository-wide import rule not implemented locally.
## Tests
- `prometeu-lsp` tests.
- PBS frontend editorial regression tests.
- Provider boundary tests with compile-only/fake providers.
- Import-boundary test for common LSP code if feasible.
## Affected Artifacts
- `prometeu-lsp/prometeu-lsp-v1/src/main/java/p/studio/lsp/services/compiler/CompilerLanguageServiceBridge.java`
- `prometeu-lsp/prometeu-lsp-v1/src/test/java/p/studio/lsp/services/compiler/CompilerLanguageServiceBridgeTest.java`
- Architectural-test discussion or future plan from `AGD-0067`