pr 03.02
This commit is contained in:
@@ -6,63 +6,6 @@
|
||||
|
||||
---
|
||||
|
||||
## PR-03.01 — Introduce `frontend-api` crate (canonical models + strict trait)
|
||||
|
||||
### Title
|
||||
|
||||
Create `frontend-api` crate with canonical models and strict `Frontend` trait
|
||||
|
||||
### Briefing / Context
|
||||
|
||||
Right now, compiler layers import PBS-specific symbols/types and depend on “string protocols” (e.g., `"alias/module"`, `"@alias:module"`, `svc:` prefixes). This caused Phase 03 instability and the current golden failure (`E_OVERLOAD_NOT_FOUND` for imported service methods). We need a **single source of truth contract** owned by BE.
|
||||
|
||||
### Target (What “done” means)
|
||||
|
||||
* A new crate (or module) `crates/frontend-api` exporting:
|
||||
|
||||
* **Canonical identifiers and references** used by BE for imports/exports.
|
||||
* A **strict** `Frontend` trait that returns only BE-required artifacts.
|
||||
* No PBS types inside this crate.
|
||||
|
||||
### Scope
|
||||
|
||||
* Add `frontend-api` crate.
|
||||
* Define canonical types:
|
||||
|
||||
* `ProjectRef { alias: String }` (or `ProjectAlias` newtype)
|
||||
* `ModulePath` newtype (normalized `"input/testing"`)
|
||||
* `ItemName` newtype (e.g., `"Test"`, `"Log"`)
|
||||
* `ImportRef { project: ProjectRef, module: ModulePath, item: ItemName }`
|
||||
* `ExportRef` / `ExportItem` (see PR-03.05)
|
||||
* `CanonicalFnKey` (see PR-03.04)
|
||||
* Define **strict** `Frontend` trait (draft; implemented later):
|
||||
|
||||
* `parse_and_analyze(...) -> FrontendUnit`
|
||||
* `FrontendUnit { diagnostics, imports, exports, lowered_ir }`
|
||||
* Include explicit “no strings-as-protocol” policy in doc comments.
|
||||
|
||||
### Out of scope
|
||||
|
||||
* Implementing PBS FE.
|
||||
* Refactoring build pipeline.
|
||||
|
||||
### Checklist
|
||||
|
||||
* [ ] Add crate and wire to workspace.
|
||||
* [ ] Add canonical types with clear invariants.
|
||||
* [ ] Add `Frontend` trait and minimal `FrontendUnit` output.
|
||||
* [ ] Add unit tests for parsing/normalization helpers (module path normalization rules).
|
||||
|
||||
### Tests
|
||||
|
||||
* `cargo test -p frontend-api`
|
||||
|
||||
### Risk
|
||||
|
||||
Low. New crate only; no behavior changes yet.
|
||||
|
||||
---
|
||||
|
||||
## PR-03.02 — Ban PBS leakage at the BE boundary (dependency & import hygiene)
|
||||
|
||||
### Title
|
||||
|
||||
Reference in New Issue
Block a user