3.0 KiB
3.0 KiB
| id | ticket | title | status | created | ref_decisions | tags | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| PLN-0053 | system-os-service-ownership-and-module-layout | Move Logging Ownership To SystemOS | open | 2026-05-14 |
|
|
Briefing
Move LogService ownership from VirtualMachineRuntime to SystemOS, while
allowing VM execution code to use OS logging through an explicit reference or
handle.
Source Decisions
DEC-0024:LogServiceSHALL move fromVirtualMachineRuntimetoSystemOS; VM execution MAY use an explicit OS logging reference or handle but MUST NOT own logging.
Target
Make logging an OS-owned service and reduce VirtualMachineRuntime to a user of
logging rather than its owner.
Dependencies
- Source decision:
DEC-0024. - Depends on
PLN-0051. - May run after or alongside
PLN-0052, but code integration is simpler afterSystemOSservice ownership is established.
Scope
- Add
LogServiceownership toSystemOS. - Remove
log_service: LogServicefromVirtualMachineRuntime. - Update VM runtime methods that read/write logs to receive logging access from
SystemOSor a narrow explicit handle. - Update construction paths so
LogService::new(4096)is owned bySystemOS. - Update tests that currently inspect runtime-owned logs.
Out of Scope
- Do not change log capacity or log record semantics.
- Do not change VM syscall behavior except for the ownership path.
- Do not introduce compatibility accessors that imply VM ownership.
- Do not move filesystem or memcard ownership in this plan.
Execution Plan
- Add a
LogServicefield toSystemOSand initialize it inSystemOS::new. - Remove
LogServiceinitialization and storage fromVirtualMachineRuntime::new. - Update VM logging call paths in
dispatch,tick, lifecycle, and tests to use OS-owned logging. - If borrow constraints require it, introduce a narrow logging handle/reference parameter at the call boundary instead of giving the VM ownership.
- Update all tests that assert logging behavior.
- Run formatting and tests.
Acceptance Criteria
VirtualMachineRuntimeno longer storesLogService.SystemOSownsLogService.- VM execution can still emit and expose logs through the existing behavior.
- No compatibility API suggests that logging remains VM-owned.
- Existing logging tests pass or are updated to assert OS ownership.
Tests / Validation
- Run
cargo test -p prometeu-system. - Include focused tests covering VM log writes and reads after ownership moves
to
SystemOS.
Risks
- Borrowing constraints around
NativeInterfacemay require a narrow access pattern rather than simply borrowing all ofSystemOS. - Tests that currently construct only
VirtualMachineRuntimemay need to move toSystemOSconstruction to reflect the new owner.
Affected Artifacts
crates/console/prometeu-system/src/os/system_os.rscrates/console/prometeu-system/src/services/vm_runtime/**- Tests under the VM runtime module