From 67e7acf73b8c869149332ecf96b2ddd4373eb770 Mon Sep 17 00:00:00 2001 From: bQUARKz Date: Sun, 22 Mar 2026 23:52:42 +0000 Subject: [PATCH] implements PR-025 --- .../specs/12-firmware-pos-and-prometeuhub.md | 2 ++ docs/runtime/specs/13-cartridge.md | 16 +++++++++++----- docs/runtime/specs/14-boot-profiles.md | 3 ++- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/docs/runtime/specs/12-firmware-pos-and-prometeuhub.md b/docs/runtime/specs/12-firmware-pos-and-prometeuhub.md index 20a2b0c5..93a832bd 100644 --- a/docs/runtime/specs/12-firmware-pos-and-prometeuhub.md +++ b/docs/runtime/specs/12-firmware-pos-and-prometeuhub.md @@ -91,6 +91,8 @@ Current high-level flow: If VM initialization fails, firmware transitions to the crash path. +POS selects the cartridge and its execution context, but the cartridge's initial callable is not chosen by firmware metadata. Execution starts from the cartridge boot protocol defined in [`13-cartridge.md`](13-cartridge.md), currently `func_id = 0`. + ## 7 Firmware States The current firmware state model includes: diff --git a/docs/runtime/specs/13-cartridge.md b/docs/runtime/specs/13-cartridge.md index 41faa6fc..44c77768 100644 --- a/docs/runtime/specs/13-cartridge.md +++ b/docs/runtime/specs/13-cartridge.md @@ -28,8 +28,7 @@ The runtime currently expects the following manifest fields: "app_id": 1234, "title": "My Game", "app_version": "1.0.0", - "app_mode": "Game", - "entrypoint": "main" + "app_mode": "Game" } ``` @@ -47,7 +46,6 @@ Current required manifest fields: - `title` - `app_version` - `app_mode` -- `entrypoint` Current required file payloads: @@ -70,14 +68,22 @@ The current loader validates: If validation fails, cartridge loading is rejected before execution. -## 5 App Mode and Entrypoint +## 5 App Mode and Boot Protocol `app_mode` controls firmware launch behavior: - `Game` - `System` -`entrypoint` is passed to the VM initialization flow and may be resolved as a symbol or function identifier according to the VM/runtime contract. +Cartridge boot is protocol-driven, not manifest-driven. + +The executable entrypoint of a valid cartridge is always `func_id = 0`. + +This means: + +- `manifest.json` does not select the callable to execute; +- firmware/runtime loads the cartridge and starts execution from `func_id = 0`; +- nominal exports may exist for linking or introspection, but they do not hold boot authority. ## 6 Assets and Preload diff --git a/docs/runtime/specs/14-boot-profiles.md b/docs/runtime/specs/14-boot-profiles.md index 30840fb3..db9229f4 100644 --- a/docs/runtime/specs/14-boot-profiles.md +++ b/docs/runtime/specs/14-boot-profiles.md @@ -33,7 +33,8 @@ When the boot target is `Cartridge`: 1. firmware loads the requested cartridge; 2. cartridge metadata is read; -3. launch behavior follows cartridge `app_mode`. +3. launch behavior follows cartridge `app_mode`; +4. bytecode execution starts through the cartridge boot protocol defined by the cartridge contract, not by textual entry metadata. ## 3 Launch Resolution by App Mode