4.5 KiB
4.5 KiB
| id | ticket | title | status | created | ref_decisions | tags | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| PLN-0155 | foreground-stack-game-pause-shell-vm-backed | Retire Legacy Firmware VM Runtime Bridge | open | 2026-07-05 |
|
|
Briefing
DEC-0038 states that Firmware.vm must not remain the canonical owner of VM-backed app context. PLN-0148 through PLN-0152 moved normal cartridge loading and ticking toward VM sessions, but a transitional legacy bridge still initializes and exposes the old global VM/runtime path for compatibility.
Objective
Remove the legacy firmware VM/runtime bridge from normal runtime architecture. After this plan, VM-backed app execution, initialization, active runtime queries, and host-facing inspection must resolve through VM sessions or explicitly global render/runtime services.
Dependencies
- Source decision: DEC-0038.
- Requires PLN-0154 so debugger operations no longer depend on
firmware.vm. - Builds on PLN-0148 through PLN-0153.
Scope
- Remove
Firmware.vmfromcrates/console/prometeu-firmware/src/firmware/firmware.rsif all callsites have migrated. - Remove
PrometeuContext.vmfromcrates/console/prometeu-firmware/src/firmware/prometeu_context.rs. - Remove
legacy_vmfromSessionsFacade::load_vm_cartridge. - Remove
initialize_legacy_active_vm. - Remove or narrow global
VmFacade::initialize,tick,reset, anddebug_step_instructionmethods that operate on caller-suppliedVirtualMachine. - Keep global render ownership, render worker lifecycle, telemetry publication, and log service where they are global SystemOS responsibilities.
- Preserve Hub/Home rendering behavior while avoiding any guest VM state stored in firmware.
- Update direct boot, debug boot, reset, and load-cartridge tests to prove session ownership is the only app VM path.
Non-Goals
- Do not remove
VirtualMachineRuntimeitself. - Do not redesign render worker ownership.
- Do not add background execution.
- Do not change debugger protocol shape beyond the PLN-0154 migration.
Execution Method
- Use
rgto list every remainingfirmware.vm,ctx.vm,legacy_vm, andos.vm().initialize/tick/reset/debug_step_instructioncallsite. - Replace firmware context construction so state steps receive
SystemOS, Hub, signals, platform, and boot target only. - Replace reset behavior with session registry/runtime reset semantics:
- clear VM sessions on firmware reset when booting fresh;
- preserve only explicitly resident sessions during lifecycle flows, not reset.
- Update cartridge loading to initialize only the selected VM session.
- Split
VmFacadeinto:- session-targeted VM execution/inspection methods;
- global render/runtime authority methods.
- Delete compatibility methods that accept
&mut VirtualMachinewhen no remaining production callsite exists. - Add tests or assertions proving no production code path initializes or ticks a global firmware VM.
- Run full affected test suites and clippy.
Acceptance Criteria
Firmwareno longer ownspub vm: VirtualMachine.PrometeuContextno longer carries a VM reference.LoadCartridgeStepinitializes only session-owned VM context.GameRunningStepand VM-backedShellRunningSteptick only sessions.- Debugger, stats, and host runner access active session state or global render services explicitly.
rg "firmware\\.vm|ctx\\.vm|legacy_vm|os\\.vm\\(\\)\\.initialize\\(|os\\.vm\\(\\)\\.tick\\("finds no production runtime dependency on the legacy global VM path.- Tests continue to prove Game resident + VM Shell coexistence.
Tests
cargo test -p prometeu-systemcargo test -p prometeu-firmwarecargo test -p prometeu-host-desktop-winitcargo clippy -p prometeu-system -p prometeu-firmware -p prometeu-host-desktop-winit --all-targets -- -D warnings- Add or update tests for:
- reset clears session-owned VM contexts appropriately;
- direct boot creates session-owned VM context;
- debug boot uses session-owned VM context;
- no global VM tick path remains.
Affected Artifacts
crates/console/prometeu-firmware/src/firmware/firmware.rscrates/console/prometeu-firmware/src/firmware/prometeu_context.rscrates/console/prometeu-firmware/src/firmware/firmware_step_*.rscrates/console/prometeu-system/src/os/facades/sessions.rscrates/console/prometeu-system/src/os/facades/vm.rscrates/host/prometeu-host-desktop-winit/src/debugger.rscrates/host/prometeu-host-desktop-winit/src/runner.rscrates/host/prometeu-host-desktop-winit/src/stats.rs