3.2 KiB
3.2 KiB
| id | ticket | title | status | created | ref_decisions | tags | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| PLN-0104 | multi-frontend-provider-contract | Introduce FrontendProvider registry API | done | 2026-07-15 |
|
|
Briefing
DEC-0040 requires common code to resolve frontend behavior through a provider. This plan introduces the API surface in the frontend registry without forcing all consumers to migrate in the same change.
Domain owner: compiler/general.
Objective
Introduce FrontendProvider and provider-based registry lookup while preserving existing PBS behavior during migration.
Dependencies
PLN-0103should define the normative spec first.- Accepted decision:
DEC-0040. - Existing registry module:
prometeu-compiler/prometeu-frontend-registry.
Scope
- Add the
FrontendProvidercontract in the frontend registry module. - Add an optional language-service return shape, using an existing interface if one already exists or a minimal neutral placeholder only if required.
- Add provider registration and provider lookup by
languageId. - Add
require(languageId)or equivalent explicit lookup that fails clearly for unknown languages. - Preserve compatibility methods during migration if existing consumers still call spec or phase lookup.
Non-Goals
- Do not register PBS in this plan unless needed for API tests with a simple fixture.
- Do not migrate build pipeline or Studio consumers in this plan.
- Do not add plugin discovery, reflection, scanning, external JAR loading, or runtime plugin installation.
- Do not define a broad editor API.
Execution Method
- Inspect
FrontendRegistryService,FrontendSpec, andFrontendPhaseServiceto confirm current method names and package ownership. - Add
FrontendProviderto the registry-facing package withspecification(),compiler(), and optionallanguageService(). - Update
FrontendRegistryServiceso its primary storage is provider keyed bylanguageId. - Add
require(languageId)or the nearest local naming equivalent for provider lookup. - Keep old spec/phase accessor methods as provider-derived compatibility wrappers if they are still used.
- Add registry unit tests for provider registration, provider lookup, duplicate language handling if currently supported, and unknown-language errors.
Acceptance Criteria
FrontendProviderexists and exposes all responsibilities required byDEC-0040.FrontendRegistryServicecan resolve a provider bylanguageId.- Unknown
languageIdlookup fails with a clear exception or diagnostic message. - Existing callers can still compile until their migration plan runs.
Tests
- Registry test: registered provider is returned by
languageId. - Registry test: unknown
languageIdfails clearly. - Registry test: provider-derived spec listing remains correct if compatibility methods remain.
- Run the relevant Gradle test task for
prometeu-frontend-registry.
Affected Artifacts
prometeu-compiler/prometeu-frontend-registry/src/main/java/p/studio/compiler/FrontendRegistryService.java- New
FrontendProvidercontract in the same registry API surface. - Registry tests under
prometeu-compiler/prometeu-frontend-registry/src/test/...