prometeu-runtime/discussion/workflow/plans/PLN-0098-define-platform-facade-contracts.md

82 lines
2.5 KiB
Markdown

---
id: PLN-0098
ticket: real-render-worker-establishment
title: Define Platform Facade Contracts
status: done
created: 2026-06-06
completed:
ref_decisions: [DEC-0032]
tags: [runtime, platform, hal, facades]
---
## Objective
Define the first `prometeu-hal` platform facade contracts that will replace the monolithic `HardwareBridge` model.
## Background
`DEC-0032` requires Prometeu to move from one runtime-facing `HardwareBridge` to explicit platform services/facades. This first plan creates the stable contract surface without migrating callers yet.
## Scope
### Included
- Add facade modules/types in `crates/console/prometeu-hal`.
- Define names and module ownership for `RuntimePlatform`, `RenderSubmissionSink`, `RenderBackend`, `Game2DFrameComposer`, and `TestPlatform` integration points.
- Add minimal documentation explaining that `HardwareBridge` is legacy migration scaffold.
### Excluded
- Do not remove `HardwareBridge`.
- Do not migrate syscalls, firmware, Hub, host, or tests yet.
- Do not implement the real render worker.
## Execution Steps
### Step 1 - Add platform facade module
**What:** Create a `platform` module in `prometeu-hal`.
**How:** Add facade trait declarations and re-exports without changing existing call sites.
**File(s):** `crates/console/prometeu-hal/src/platform.rs`, `crates/console/prometeu-hal/src/lib.rs`.
### Step 2 - Declare domain facade boundaries
**What:** Define initial placeholder traits for render submission, render backend, Game2D composer, audio, input/touch, assets/storage, clock/pacing, and telemetry.
**How:** Keep non-render traits minimal or marker-like when detailed APIs are not yet migrated.
**File(s):** `crates/console/prometeu-hal/src/platform.rs`.
### Step 3 - Document migration status
**What:** Mark `HardwareBridge` as legacy scaffold.
**How:** Add module-level comments stating it must be removed by later plans.
**File(s):** `crates/console/prometeu-hal/src/hardware_bridge.rs`.
## Test Requirements
### Unit Tests
- Compile-only tests or trait object assertions where useful.
### Integration Tests
- Existing HAL/system/driver tests must continue to pass.
### Manual Verification
- Confirm `HardwareBridge` has no new dependencies on the platform facades.
## Acceptance Criteria
- [ ] Platform facade module exists in `prometeu-hal`.
- [ ] `HardwareBridge` is explicitly documented as migration scaffold.
- [ ] No runtime behavior changes.
- [ ] Existing tests pass.
## Dependencies
- `DEC-0032`.
## Risks
- Introducing too much API too early can freeze poor names. Keep this plan narrow.