Docs / PR1-5-IMPLEMENTATION-PLAN
PRs 1–5 implementation plan (owner-gated)
Source: docs/PR1-5-IMPLEMENTATION-PLAN.md
Status: planning only. PRs 1–6 are documentation-only RFC/audit PRs and remain merge-gated; this file neither implements nor approves them. No feature completion is claimed. Audited repository HEAD: 161322c7e91c7fd41b6c2f4bdaa0b9d3917ddadf (2026-11-28).
Entry gate: stabilize the core before RFC implementation
Do not begin PR 1–5 implementation until the owner accepts a single recorded MVP run proving, in the same fresh Kiri-backed session: sandbox starts; the emulator process executes inside that sandbox (a browser fetching assets from Kiri is insufficient); a lawful/homebrew game launches and responds to real input with nonblank video; audio is heard; saves persist across down/up; and the session cleans up and repeats. Use two fresh sessions and retain raw reports, versions, screenshots/audio observations, and Kiri identity. The current evidence does not pass this gate: docs/DESKTOP-E2E-EVIDENCE.md records a narrow browser/jsnes NES gameplay PASS, but describes browser-side emulation; no audible-audio or save/reload proof is recorded. Other current reports record Kiri gamecompose up create timeouts without a product-path frame/input run. Do not substitute the older host-local NES pass, simulated pages, HTTP checks, or a sandbox-only start.
The gate is an owner decision: Owner must explicitly accept the MVP evidence bundle and declare the stable core baseline before implementation begins. If the run fails, the immediate next action is to fix the demonstrated core blocker and repeat the same gate; do not move to optional features.
Dependency order and owner decisions
| Order | PR | Purpose | Timing / prerequisites | Owner-gated decision before work starts |
|---|---|---|---|---|
| 1 | #5 Declarative configuration and templates | Define validated, capability-aware manifest/template configuration and deterministic resolution. | First RFC implementation after the MVP gate. Depends on the normative GAMECOMPOSER-SPEC.md contract being reconciled with current schema/runtime and on the real Kiri/emulator baseline to test what a template option actually does. Coordinate controls with #4, storage/saves with #2, and network with #1; no duplicated fields. |
Owner must approve the canonical schema authority, migration/backward-compatibility policy, exact template capability vocabulary, and which existing fields are deprecated. No implementation until runtime owners identify how unsupported options fail clearly. |
| 2 | #4 Declarative input and profiles | Make YAML the source of truth for deterministic keyboard/gamepad mapping and portable, non-executable profiles. | After #5 establishes manifest/profile references, but before multiplayer or state branches consume those contracts. Requires the accepted Kiri/emulator MVP path and actual adapter capability inventory; browser Gamepad API results alone do not establish native/controller support. | Owner must select the initial supported devices and adapters, logical-control names, profile version/precedence rules, and the tested NES/SNES homebrew fixtures. Approval must exclude registry dependence from core input. |
| 3 | #2 Game-state versioning | Add Git-native snapshots, branches, restore and portable state metadata without corrupting saves. | After stable core and #5 storage/config decisions; #4 is needed for reproducible control/session metadata. Requires a real Kiri emulator adapter that serializes and restores actual game state plus persistent saves. Start with one supported NES adapter; SNES follows only after separate capability evidence. | Owner must approve Git layout, supported state adapter, compatibility/hash policy, recovery/rollback semantics, quota/retention defaults, and the rule that unsupported adapters are clearly save-file-only. No exact-resume claim without actual state restoration. |
| 4 | #1 Multiplayer invitations | Share an authorized host session using WebRTC media and guest controller input. | Post-core, after #4 normalized input and #5 networking/security contracts. Depends on real Kiri-backed game execution and evidence that capture/audio/input can be routed reliably; first LAN NES, then Internet/TURN, then SNES. No multiplayer work while core input/audio/video is unstable. | Owner must choose host-authoritative architecture, LAN-only first milestone, invite approval/expiry model, player slots, relay disclosure, and whether any signaling service is in scope. Separate security approval is required before exposing invitations beyond LAN. |
| 5 | #3 Extensions marketplace/hooks/Discord | Provide optional local-first extensions and an isolated, permissioned hook API; marketplace and Discord are later additions. | Last and post-MVP. Depends on stable extension-free gameplay, permission/isolation model, and event contracts from whichever of #1/#2 is actually implemented. Generic local extension API precedes registry UX; Discord is a separate follow-up and must use currently supported provider APIs. | Owner must approve the process/sandbox isolation boundary and enforceable deny-by-default permissions before third-party code work. Also explicitly defer or authorize marketplace/registry and Discord as separate milestones; no feature may block offline core gameplay. |
Why this order: #5 and #4 establish shared manifest and input contracts that the state, invitation, and extension proposals refer to. They still start only after the MVP stability gate. #2 then builds on persistent saves and a proven emulator adapter; #1 adds network, capture, and authorization risk; #3 adds third-party code and provider risk and has the least bearing on proving core playability. Every optional feature stays behind the core gate.
Bounded implementation steps
Each row is a separate work authorization after its prerequisites are met. File sets are exclusive across rows; if discovery requires another path, stop and obtain an owner-approved revised boundary before editing. The author and verifier must be different people. “Real E2E” means a fresh Kiri sandbox and the actual emulator/game path, with input-correlated nonblank frames; where applicable, capture audio and verify save/state behavior, not just process status or HTTP.
| Step | Exclusive bounded file set | Acceptance test (one decisive test) | Independent reviewer boundary |
|---|---|---|---|
| #5a Schema and migration | specs/game-compose.schema.json; gamecomposer/config.py; tests/schema/test_manifest_schema.py |
Validate legacy and new manifests, reject invalid/incompatible fields, and prove a migrated manifest resolves identically in a real Kiri NES session. | Schema/runtime author cannot verify; an independent config/schema reviewer checks migration fixtures and the captured Kiri result. |
| #5b Template capability resolution | gamecomposer/templates.py; templates/; tests/templates/ |
Select a declared option and show it changes the real emulator configuration in a fresh Kiri run; request an unsupported option and verify an actionable preflight error. | Template author cannot verify; independent runtime/emulator reviewer inspects the resolved config and session evidence. |
| #4a Input contract and resolver | gamecomposer/input/; tests/input/ |
On the proven Kiri NES fixture, exercise auto/manual/hybrid resolution and verify trusted input changes the real game frame; invalid mapping is rejected. | Resolver author cannot verify; independent input reviewer compares config, delivered controls, and captured frames. |
| #4b Profiles and UI round-trip | profiles/; desktop/src/input-profile*; desktop/tests/input-profile* |
Import/export a profile offline on a second compatible device and confirm the same logical input changes gameplay in a real Kiri session; YAML round-trip preserves unrelated fields. | Profile/UI author cannot verify; independent desktop/input reviewer runs the hardware and Kiri acceptance. |
| #2a State adapter and metadata | gamecomposer/state/; tests/state/adapter/ |
In a real Kiri NES session capture A, advance to B, restore A, and confirm the game returns to A while persistent saves remain consistent; restart the sandbox and repeat. | Adapter author cannot verify; independent emulator-state reviewer inspects raw state and before/after gameplay evidence. |
| #2b Git history, branches and transfer | gamecomposer/history/; tests/state/history/ |
Run a real Kiri session through A→B, branch from A to C, restore both branches, restart, and verify state/save separation; independently clone using stock Git and restore a compatible checkpoint. | History author cannot verify; independent Git/storage reviewer validates refs, blobs, recovery, and gameplay. |
| #1a LAN invites and input relay | gamecomposer/multiplayer/; tests/multiplayer/lan/ |
Two real browser/device peers join one fresh Kiri NES homebrew session on LAN; guest input changes the host game, both see nonblank live video/hear audio, disconnect releases controls, and host can revoke access. | Multiplayer author cannot verify; independent networking/security reviewer performs the two-peer run and inspects authorization evidence. |
| #1b Internet/TURN and desktop controls | desktop/src/multiplayer/; tests/multiplayer/internet/ |
Two devices on separate networks complete an invite through the approved signaling/relay path against a real Kiri session; record media/input behavior and verify expiry, replay rejection, revoke, and cleanup. | UI/network author cannot verify; independent security reviewer owns the external-network test and invite abuse checks. |
| #3a Local extension API and isolation | gamecomposer/extensions/; tests/extensions/runtime/ |
With a real Kiri game session running, install a local sample extension offline, deliver one typed lifecycle event without changing gameplay timing, and prove a denied filesystem/network action is blocked and revoke/uninstall works. | Extension runtime author cannot verify; independent sandbox/security reviewer validates enforceable isolation and core gameplay. |
| #3b Registry UX | desktop/src/extensions/registry*; tests/extensions/registry/ |
Install a pinned extension from a local cache with network disabled while a real Kiri game remains playable; reject altered content and demonstrate explicit update approval. | Registry/UI author cannot verify; independent supply-chain reviewer verifies pinning/integrity and offline behavior. |
| #3c Discord follow-up (separate authorization) | integrations/discord/; tests/integrations/discord/ |
Only after provider API review: optional Discord action from an isolated extension while a real Kiri game runs, with user consent and no credential exposure; offline play remains intact. | Integration author cannot verify; independent provider/security reviewer validates current supported API behavior and consent boundaries. |
Blockers and immediate next hops
| Blocked / unknown | Current evidence boundary | Immediate next hop and concrete action |
|---|---|---|
| Core Kiri sandbox → in-sandbox emulator → playable game/audio/saves | Current desktop evidence proves a browser-side jsnes game transition, not emulator execution inside Kiri; audio and save persistence are not demonstrated. Current product-path create evidence records timeout. | Runtime owner: resolve the Kiri create/start timeout with a bounded diagnostic that does not restart Kiri; then run the owner-approved MVP gate on a legal homebrew NES fixture, capture emulator process location, input-correlated frames, audible output, and save persistence across two fresh sessions. |
| SMB3 owner ROM | Current desktop E2E report says no owner-supplied *.sfc/*.smc dump was present; commercial ROM was not downloaded. |
Owner: provide a lawful owner-supplied SNES All-Stars ROM for the approved test, or explicitly replace this fixture with a named legal homebrew SNES title; then rerun the actual Kiri/emulator input-video-audio-save scenario. Until then SMB3 remains blocked and no substitute is relabeled as SMB3. |
| PS3 / RPCS3 | No PS3 image/core, adapter, firmware/game assets, or launch/input/display evidence; current runtime admits Linux guest only. | Platform/runtime owner: decide whether PS3 is in scope. If yes, identify a lawful RPCS3/Kiri host adapter and owner-provided firmware/game, then prove launch, input, display, audio and saves on real hardware; otherwise record an explicit out-of-scope decision. |
| Linux host | No real Linux-host run is recorded; Linux is the target host. | Platform owner: on a real Linux host run kiri version, kiri ps, then the exact MVP Kiri/emulator E2E gate; attach versions and raw evidence. Do not infer game support from guest support. |
| OpenCode launchability | No reviewed artifact in the current main evidence establishes OpenCode launchability within a Game Composer Kiri session. | Runtime owner: define the exact OpenCode launch target and required host/guest capabilities, then run it in a fresh real Kiri session and record process location, visible output, input, audio and persistence. If unavailable, record a concrete unsupported capability and owner decision; do not infer from a shell or container existing. |
Evidence sources and limits
- Current main:
docs/GAMECOMPOSER-SPEC.md(contract-ready, many validation/manifest-to-player mappings still UNKNOWN),docs/DESKTOP-E2E-EVIDENCE.md(NES gameplay PASS within browser-side emulator scope; SNES substitute fails after Start; SMB3 blocked),docs/PLATFORM-MATRIX.md(macOS development-host evidence; Linux target host not checked), anddocs/REPORT-INTEGRATION.md/tests/cli-swarm/README.mdfor product-path create timeout and missing Kiri-tied gameplay evidence. - RFC diffs reviewed from PRs #1–#5:
docs/MULTIPLAYER-INVITES.md,docs/GAME-STATE-VERSIONING.md,docs/EXTENSIONS-MARKETPLACE.md,docs/DECLARATIVE-INPUT.md, anddocs/declarative-configuration-rfc.md. They are proposals, not implemented behavior. - PR #6 audit diff reviewed because
docs/MVP-REPOSITORY-AUDIT.mdis not present in audited main.docs/CONFIG-SURFACE-AUDIT.mdis also absent from this worktree. Current main evidence above is used where available; no claims are inferred from the absent paths. - This is a plan, not a test report or implementation approval. No Kiri action, test, code change, merge, push, or deployment was performed for this plan.

