implements PR-19.1 normative spec propagation

This commit is contained in:
2026-03-26 19:00:29 +00:00
parent 38d8c25bba
commit 82d2bfafb8
9 changed files with 164 additions and 44 deletions
@@ -63,6 +63,8 @@ This document integrates the following accepted decisions:
- `docs/pbs/decisions/Dynamic Semantics - Effect Surfaces Decision.md`
- `docs/pbs/decisions/Dynamic Semantics - Branch Selection Decision.md`
- `docs/pbs/decisions/Host Memory Boundary Decision.md`
- `docs/compiler/pbs/decisions/Lifecycle Markers, Program Init, and Frame Root Semantics Decision.md`
- `docs/compiler/pbs/decisions/Published Entrypoint, Synthetic Wrapper, and FRAME_RET Ownership Decision.md`
## 5. Already-Settled Inputs
@@ -75,6 +77,8 @@ The following inputs are already fixed elsewhere and must not be contradicted he
- `optional T` function fallthrough yields `none`.
- `result<E>` function fallthrough is a compile-time error.
- `ok(...)` and `err(...)` are special result-flow forms rather than ordinary first-class runtime constructors.
- Lifecycle bootstrap is one-shot and fail-fast.
- `[Frame]` denotes the logical userland frame root, not the physical published entrypoint by itself.
## 6. Execution Baseline
@@ -95,6 +99,35 @@ VM-internal frame layout, temporary storage, and lowering steps are not observab
`FRAME_SYNC` is the only normative safepoint in PBS v1.
## 6.1 Lifecycle bootstrap
Executable PBS programs have a logical bootstrap sequence before ordinary frame execution.
Normative order:
1. materialize globals for each file according to dependency order,
2. execute that file's `[Init]`, if present,
3. compose those steps into one synthetic module init per module,
4. execute project init, if present,
5. then invoke the userland callable marked with `[Frame]`.
Lifecycle bootstrap is one-shot:
- no automatic retry occurs after boot failure,
- failure during module init aborts boot,
- failure during project init aborts boot.
## 6.2 Logical frame root and physical wrapper
PBS distinguishes the logical frame root from the physical published entrypoint:
- the userland callable marked with `[Frame]` is the logical frame root,
- the compiler-published synthetic wrapper is the physical executable root,
- the wrapper owns final `FRAME_RET`,
- and the wrapper invokes the logical frame root after bootstrap is complete.
Nominal manifest metadata does not participate in this runtime boot choice.
## 7. Evaluation Order and Single Evaluation
### 7.1 Default rule