implements PR021

This commit is contained in:
2026-03-24 13:42:22 +00:00
parent d2287a0a58
commit d7b070ab68
4 changed files with 146 additions and 43 deletions
+1
View File
@@ -29,3 +29,4 @@ Cada documento e auto contido e inclui: `Briefing`, `Target`, `Method`, `Accepta
20. `PR-018-pbs-result-flow-ok-err-handle-rules.md`
21. `PR-019-pbs-non-unit-fallthrough-diagnostics.md`
22. `PR-020-pbs-lowering-admission-gates.md`
23. `PR-021-pbs-handle-aware-fallthrough-completion.md`
@@ -1,43 +0,0 @@
# PR-020 - PBS Lowering Admission Gates
## Briefing
Lowering currently proceeds even when syntax/static/linking diagnostics contain errors. This PR introduces explicit admission gates so invalid programs are rejected before IR lowering.
## Motivation
Lowering must not convert required rejections into accepted lowered artifacts.
## Target
- `PbsFrontendCompiler` and `PBSFrontendPhaseService` lowering flow.
- Frontend-to-IR admission policy.
## Scope
- Block IR emission for source units with fatal diagnostics.
- Preserve deterministic diagnostics already emitted by previous phases.
- Keep successful paths unchanged.
## Method
- Introduce phase gate checks before `lowerFunctions` / file merge.
- Ensure failed units are excluded from emitted IR.
- Keep build issue adaptation behavior stable.
## Acceptance Criteria
- Files/modules with syntax/static/linking errors are not lowered.
- No invalid callable appears in IR output after failed admission.
- Valid files continue lowering unchanged.
## Tests
- Add tests proving failed parse/semantic/linking input does not emit IR functions.
- Add tests proving clean input still emits expected IR.
- Run frontend phase service and compiler suites.
## Non-Goals
- Redefining diagnostics severity policy.
- Introducing partial lowering recovery strategy.