prometeu-runtime/discussion/workflow/plans/PLN-0130-remove-runtime-run-cart-stub-dispatch.md
2026-07-03 09:58:30 +01:00

2.9 KiB

id ticket title status created ref_decisions tags
PLN-0130 system-run-cart Remove Runtime Run Cart Stub Dispatch done 2026-07-03
DEC-0035

Briefing

DEC-0035 forbids a callable userland system.run_cart stub. This plan covers runtime and VM dispatch cleanup so obsolete calls cannot silently succeed. Public ABI removal is handled by PLN-0129; direct boot preservation is handled by PLN-0131.

Objective

Remove the runtime no-op dispatch path for SystemRunCart and ensure stale or obsolete userland attempts fail explicitly rather than returning success.

Dependencies

  • Source decision: DEC-0035.
  • Depends on the ABI direction in PLN-0129, but can be implemented in the same PR if the public enum/registry removal and dispatch cleanup move together.

Scope

  • Remove the Syscall::SystemRunCart => return Ok(()) path from crates/console/prometeu-system/src/services/vm_runtime/dispatch.rs.
  • Update any match arms made unreachable or obsolete by removing SystemRunCart.
  • Ensure stale numeric syscall ids or stale bytecode declarations fail with the repository's existing unknown/invalid syscall behavior.
  • Add negative coverage for userland attempts to invoke the removed operation, using the closest existing VM runtime syscall tests.

Non-Goals

  • Do not implement a replacement navigation operation.
  • Do not implement the Home -> another Game orchestrator.
  • Do not alter direct host/CLI/debug cartridge boot paths.
  • Do not change system.has_cart behavior unless required by compile fallout.

Execution Method

  1. Inspect dispatch.rs for all SystemRunCart match arms.
  2. Remove the no-op success path and any unreachable arms tied only to SystemRunCart.
  3. If the public enum variant is removed by PLN-0129, update exhaustiveness and registry mapping accordingly.
  4. Add or update VM runtime tests that demonstrate system.run_cart is not callable from guest/userland.
  5. Run targeted runtime tests and compile checks.

Acceptance Criteria

  • There is no runtime path where a guest system.run_cart call returns Ok(()).
  • Stale/obsolete attempts fail explicitly through existing invalid syscall or declaration validation behavior.
  • system.has_cart and unrelated system syscalls keep their current behavior.
  • Runtime dispatch remains exhaustive and clear after removing SystemRunCart.

Tests

  • Add a negative test in crates/console/prometeu-system/src/services/vm_runtime for stale userland run_cart attempts, if the test harness can express it.
  • Run cargo test for prometeu-system and any impacted syscall crates.
  • Run a workspace compile/test command if targeted tests reveal cross-crate enum fallout.

Affected Artifacts

  • crates/console/prometeu-system/src/services/vm_runtime/dispatch.rs
  • crates/console/prometeu-system/src/services/vm_runtime/tests.rs
  • crates/console/prometeu-hal/src/syscalls.rs
  • crates/console/prometeu-hal/src/syscalls/registry.rs