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
@@ -153,3 +153,18 @@ This document is ready to move beyond temporary status only when:
2. service and module runtime lifecycle assumptions are explicit enough to remove the remaining TODO items,
3. execution lifecycle boundaries are aligned with dynamic semantics and runtime authority,
4. and the document no longer relies on unresolved TODO items for ordinary v1 runtime startup behavior.
## Optional controlled runtime hooks
Producer-selected BeforePause/BeforeResume metadata MUST survive lifecycle
assembly without joining the init sequence or replacing the frame root/entry.
BeforePause runs after the existing gameplay handoff and before suspension;
BeforeResume runs after reactivation and before any normal gameplay instruction.
Missing hooks preserve transitions. Controlled calls preserve PC/stacks/roots,
globals and init guard; outer return restores continuation and yields to the OS
without another gameplay tick/frame or reinitialization. Direct calls remain
ordinary calls. Runtime owns the independent bounded fuel, transitive sync
prohibition, debugger behavior and failure envelope. There is no termination
hook, new syscall or automatic persistence. See the runtime's controlled
lifecycle contract and common typed Registry/PBX specification.