prometeu-studio/discussion/workflow/plans/PLN-0105-wrap-pbs-frontend-as-explicit-provider.md

74 lines
3.2 KiB
Markdown

---
id: PLN-0105
ticket: multi-frontend-provider-contract
title: Wrap PBS frontend as explicit provider
status: open
created: 2026-07-15
ref_decisions: [DEC-0040]
tags: [compiler, compiler-general, studio, frontend, registry, multi-frontend]
---
## Briefing
DEC-0040 requires PBS to become the only initial real provider behind the new `FrontendProvider` contract. This plan wraps existing PBS frontend behavior without changing PBS product behavior.
Domain owner: `compiler/general`, with implementation in `compiler/pbs` and composition impact in `prometeu-app`.
## Objective
Create and register an explicit PBS provider through the application composition root.
## Dependencies
- `PLN-0104` must introduce `FrontendProvider` and provider lookup first.
- Accepted decision: `DEC-0040`.
- Existing PBS frontend phase/service implementation.
- Application composition root in `prometeu-app`.
## Scope
- Add `PBSFrontendProvider` or equivalent concrete provider object.
- Make the provider return the existing PBS `FrontendSpec`.
- Make the provider return the existing PBS compiler-facing service or phase.
- Return no language service, or the existing PBS language-service adapter only if already present and compatible.
- Register PBS explicitly in `prometeu-app/src/main/java/p/studio/AppContainer.java` or the nearest current application composition point.
- Ensure PBS remains the only initial real provider.
## Non-Goals
- Do not create another real frontend.
- Do not change PBS parsing, semantics, lowering, or runtime output.
- Do not migrate all common consumers in this plan.
- Do not introduce dynamic provider discovery.
## Execution Method
1. Inspect PBS frontend module boundaries and locate the current `FrontendSpec` and `FrontendPhaseService` construction.
2. Add `PBSFrontendProvider` in the PBS frontend module or an existing integration package that can legally depend on PBS.
3. Implement `specification()` and `compiler()` by delegating to the existing PBS objects.
4. Implement `languageService()` as empty unless a current Studio-compatible PBS language service already exists.
5. Update `AppContainer` or the existing composition root to register the PBS provider explicitly with `FrontendRegistryService`.
6. Remove direct PBS registration paths that duplicate the provider registration if they become redundant.
7. Add tests proving only PBS is registered as the real provider in the default composition path.
## Acceptance Criteria
- PBS is represented by a concrete provider object.
- Default application composition registers PBS explicitly as a provider.
- PBS remains functional through existing compile/build flows.
- No additional real frontend is introduced.
- No dynamic discovery mechanism is added.
## Tests
- Provider test: `PBSFrontendProvider.specification()` returns the PBS language id.
- Provider test: `PBSFrontendProvider.compiler()` returns working compiler-facing behavior.
- Composition test: default registry contains PBS as the only real provider.
- Existing PBS compile/build tests continue to pass.
## Affected Artifacts
- PBS frontend module under `prometeu-compiler/frontends/prometeu-frontend-pbs/...`
- `prometeu-app/src/main/java/p/studio/AppContainer.java`
- Registry or application composition tests.