feat(pbs): add explicit guest lifecycle hooks

This commit is contained in:
2026-10-28 09:12:48 +00:00
parent eb7d6a2398
commit 9504f4694a
41 changed files with 1209 additions and 24 deletions
@@ -265,3 +265,16 @@ BudgetExhausted and debugger pauses can occur between instructions and resume at
the current PC; they neither roll back nor complete a method. No atomic observation
of source operations by host/debugger is promised. SDK methods introduce no user
callbacks or explicit suspension during the updates that complete their invariants.
## Producer-selected guest hook roots
BeforePause/BeforeResume role targets and their transitive dependencies MUST
remain in the executable set even without ordinary callers. Preserve typed
metadata through merge, lifecycle assembly, optimization and linking. Names,
exports and frontend ASTs MUST NOT become a common role-selection mechanism.
Common emission validates unique nonzero roles, empty pause/resume signatures
and capture lists, and final hook FunctionIds other than zero. The ordinary
entry and synthetic Init/Frame assembly keep role None. Calling a hook as an
ordinary function does not request an OS transition. PBS marker syntax belongs
to its frontend; MemcardBoot selection/bootstrap is a separate producer scope.