3.4 KiB
3.4 KiB
| id | ticket | title | status | created | ref_decisions | tags | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| PLN-0054 | system-os-service-ownership-and-module-layout | Move FS And Memcard Ownership To SystemOS | done | 2026-05-14 |
|
|
Briefing
Move VirtualFS and MemcardService ownership from VirtualMachineRuntime to
SystemOS, preserving current VM filesystem and memcard behavior.
Source Decisions
DEC-0024:VirtualFSandMemcardServiceSHALL move fromVirtualMachineRuntimetoSystemOS; VM execution may use them, but OS owns the service state.
Target
Make filesystem and memcard OS-owned services while keeping VM syscalls and tests behaviorally equivalent.
Dependencies
- Source decision:
DEC-0024. - Depends on
PLN-0051. - Should run after
PLN-0053so the pattern for VM access to OS-owned services is already established.
Scope
- Add
VirtualFS,FsState,MemcardService, open file handle state, and related handle allocation state toSystemOSif they are currently VM-owned service state. - Remove direct ownership of
VirtualFSandMemcardServicefromVirtualMachineRuntime. - Update FS and memcard syscall paths so VM execution uses OS-owned services.
- Update tests that currently create a bare
VirtualMachineRuntimewhen they need filesystem or memcard services. - Keep service modules under
services/fsandservices/memcard.
Out of Scope
- Do not redesign filesystem semantics, path normalization, memcard slot semantics, or persistence policy.
- Do not introduce process permissions or mount namespaces.
- Do not change cartridge ABI.
- Do not move unrelated telemetry, certification, asset, or debug state unless required by compilation and explicitly documented in implementation evidence.
Execution Plan
- Identify the complete set of FS/memcard-owned fields currently stored in
VirtualMachineRuntime. - Add the OS-owned fields to
SystemOSand initialize them inSystemOS::new. - Remove those service fields from
VirtualMachineRuntime. - Update VM dispatch/syscall code to operate on OS-owned FS and memcard state through explicit references or narrow access methods.
- Update tests to construct
SystemOSwhen testing FS/memcard behavior through VM execution. - Run formatting and the affected Rust tests.
Acceptance Criteria
VirtualMachineRuntimeno longer ownsVirtualFSorMemcardService.SystemOSowns filesystem and memcard service state needed by VM execution.- Existing FS and memcard behavior is preserved.
- No compatibility path implies VM ownership of FS or memcard services.
- Any remaining VM-owned fields are execution-specific and justified by the implementation evidence.
Tests / Validation
- Run
cargo test -p prometeu-system. - Include focused FS and memcard tests after updating constructors/access paths.
Risks
- FS and memcard syscalls are stateful and may be coupled to open handle fields
in
VirtualMachineRuntime; the implementation must move the whole service state coherently. - Bare VM tests may need broader OS fixtures, which can reveal unrelated setup assumptions.
Affected Artifacts
crates/console/prometeu-system/src/os/system_os.rscrates/console/prometeu-system/src/services/fs/**crates/console/prometeu-system/src/services/memcard.rscrates/console/prometeu-system/src/services/vm_runtime/**- FS/memcard runtime tests