implements PLN-0046 profile separation spec

This commit is contained in:
2026-05-14 13:24:09 +01:00
parent e3ac3dfd06
commit da908ffcb4
5 changed files with 61 additions and 4 deletions
+34
View File
@@ -75,6 +75,9 @@ If validation fails, cartridge loading is rejected before execution.
- `Game`
- `System`
`app_mode` is the runtime profile discriminator. No separate manifest `target`
field participates in profile selection.
Cartridge boot is protocol-driven, not manifest-driven.
The executable entrypoint of a valid cartridge is always `func_id = 0`.
@@ -85,6 +88,37 @@ This means:
- 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.
## 5.1 Runtime Profiles
`Game` and `System` are distinct runtime profiles.
`Game` cartridges use the game pipeline. The game profile owns the public game
surfaces for frame composition, GFX, game input, banks, sprites, and
memory-card-style persistence.
`System` cartridges use a Runtime/Hub pipeline dedicated to system UI and app
hosting. The system profile must not inherit the game stdlib or game ABI as its
public authoring surface. In particular, `System` must not expose
`FrameComposer`, `Gfx`, game `Input`, banks, sprites, or game memory cards as
public profile APIs.
Future `System` APIs may be transported through syscalls, but syscall transport
does not define the conceptual ABI boundary. The author-facing contract for
system apps is a dedicated `System` profile ABI and stdlib/framework.
The following contracts are intentionally deferred from this cartridge chapter:
- complete WindowManager design;
- component tree and lifecycle semantics;
- rich invalidation and transitions;
- public PBS `System` ABI;
- multitasking and scheduler semantics;
- detailed `System` filesystem semantics.
The positive filesystem contract for `System` remains owned by the dedicated
filesystem discussion/spec work. The only profile rule fixed here is negative:
`System` does not use game memory cards as its public storage model.
## 6 Assets and Preload
`assets.pa` is the runtime-facing asset artifact consumed by the current runtime.
+13 -2
View File
@@ -40,11 +40,18 @@ When the boot target is `Cartridge`:
For a cartridge boot target:
- `Game` cartridges transition into game-running flow;
- `System` cartridges are initialized and integrated into the Hub/window path.
- `Game` cartridges transition into the game-running pipeline;
- `System` cartridges transition into a Runtime/Hub pipeline dedicated to
system UI and app hosting.
This preserves the distinction between machine firmware state and app execution mode.
The `System` route must not be treated as the game pipeline running inside a
window. It is a separate runtime profile path oriented around Hub ownership and
WindowManager integration. The initial implementation may be minimal, but the
routing boundary is normative: `System` does not enter `GameRunning` as its
profile pipeline.
## 4 Host CLI Relationship
Typical host-facing boot intents are:
@@ -67,6 +74,10 @@ Boot target selection feeds into firmware states such as:
- `GameRunning`
- `AppCrashes`
Additional firmware states may represent dedicated `System` profile execution.
Such states are part of the Runtime/Hub route and do not change the `Game`
pipeline contract.
Boot target is not itself a firmware state. It is an input to the firmware state machine.
## 6 Debug Boot
@@ -52,6 +52,12 @@ This identity is:
Input queries are VM-owned intrinsic calls in v1 and are outside the syscall identity space.
Syscall identity is transport, not the conceptual boundary for runtime
profiles. `Game` and `System` may both use syscall transport internally or at
their ABI edge, but that does not make their public authoring surfaces the same
ABI. `System` APIs, when exposed to PBS or other guest languages, belong to a
dedicated `System` profile ABI and stdlib/framework.
## 3 Syscall Resolution
The host maintains a registry:
@@ -173,6 +179,9 @@ Return shape must also follow the transversal status-first policy in [`16a-sysca
The game memcard profile uses module `mem` with status-first return shapes.
`mem` is a domain layer backed by runtime `fs` (it is not a separate storage backend).
The `mem` module is a game profile surface. It is not the public storage model
for `System` profile apps.
Canonical operations in v1 are:
- `mem.slot_count() -> (status, count)`
@@ -215,6 +224,9 @@ For `asset.load`:
The canonical frame-orchestration public ABI uses module `composer`.
The `composer` module is a game profile surface. It is not inherited by
`System` profile apps as their public UI/composition API.
Canonical operations in v1 are:
- `composer.bind_scene(bank_id) -> (status)`