This map assigns a disposition to each C source under runtime/src/ and runtime/tools/: what migrates to KEC Lisp, what stays as the FFI layer, what retires, and what has shipped. Each row names the target Lisp module and the raw FFI contract the C keeps.
Survey baseline and delta. The 2026-08-02 survey behind GWP-781 counted 65 C migration sources totaling 28,581 lines. The tree at that date held 95 sources under runtime/src/ (40,732 lines) and holds 95 today (40,913 lines); the survey’s 65-file subset is not reconstructible from either tree state. The disk wins: this map dispositions the full on-disk set, 95 sources under runtime/src/ plus 2 under runtime/tools/, 41,760 lines. Test sources under runtime/tests/ are out of scope; they are thin runners whose cases live in .lsp suites, sanctioned by the policy as-is.
Number-domain constraint carried by each row: KEC numbers are exact through ±2^24, so u32/u64 values, hashes, checksums, binary headers, and persisted timestamps stay behind blob or codec FFI contracts (the mission/pricing.lsp split-pair convention is the worked example). Contexts stay sandboxed; storage and device capability bind per context. Scheduling policy uses run-with-timer and now; no blocking sleeps.
Closed set. Each source gets one.
| Disposition | Meaning |
|---|
| MIGRATE | The file is policy; the behavior moves to KEC Lisp and the file shrinks to nothing or to a thin seam. |
| SPLIT | Part policy, part mechanism. The row names which part moves and which part stays. |
| RETAIN | The file is the FFI layer: a binding seam, a device driver or realtime kernel, interpreter-context lifecycle, a binary codec, or a thin runner. The row justifies it in one line. |
| RETIRE | Dead or superseded. The row cites the successor. |
| DONE | The migration already shipped; the row cites the Lisp module and the PR. What remains in the file is sanctioned FFI. |
Tally over the 97 mapped sources:
| Disposition | Files | Lines |
|---|
| MIGRATE | 9 | 2,729 |
| SPLIT | 10 | 10,169 |
| RETAIN | 68 | 24,044 |
| RETIRE | 1 | 604 |
| DONE | 9 | 4,214 |
| Total | 97 | 41,760 |
Wave column: W0 through W4 order the MIGRATE/SPLIT work (see Migration waves). RETAIN/RETIRE/DONE rows carry no wave.
| Source | Lines | Disposition | Target Lisp module | Retained C surface | Wave | Notes |
|---|
mission_board.c | 395 | DONE | mission/board-gen.lsp (GWP-777) | World Engine seam, bus publishes, board memory, the 32-bit LFSR behind the gen-draw seam, the accept sink, marshalling | - | Migrated. Template pool, eligibility gate, tier and instance-count tables, threat clamp and payout formula moved to board-gen.lsp; the retained C is mechanism only. The tier and broke-bonus math the old board_screen.c row named reached the screen through this file and moved with it. |
board_screen.c | 476 | SPLIT | board/board.lsp (existing) | board_screen_bind set (board/contract-at, board/detail, accept sink) | W0 | The one remaining GWP-777 row, and the sole entry left in the language-policy.md standing-debt table. Countdown, verb policy, and row/detail formatting move; the bind set and the MissionBoard ownership seam stay. |
mission_sweep.c | 231 | DONE | sweep/sweep.lsp (GWP-775, PR #204) | (sweep-arm ms), (sweep-disarm), bus forwarders, policy-context lifecycle | - | Post-GWP-775 residue is the FFI layer by design; the file header documents the split. |
mission_world.c | 90 | RETAIN | - | MISSION_ACCEPTED subscriber calling world_generate | - | One bus forwarder into the World Engine (ADR-0051); pure seam. |
nosh_baseline.c | 258 | DONE | mission/baseline.lsp (GWP-808) | Registry array, tier-slot state, schema lookup, CIPHER tier events, policy-context marshalling | - | The selection-weight policy (the 5% supersession drop, threat-cap inheritance, threat-range clip, single-phase rule) moved; Lisp suite tests/lisp/test-baseline.lsp. |
nosh_baseline_loader.c | 574 | RETAIN | - | Per-baseline Fe VM open, defcontract-schema binding, plist normalization | - | Interpreter lifecycle plus marshalling; the baselines it loads are .lsp already. |
nosh_runtime.c | 1,119 | SPLIT | deck/dispatch.lsp (proposed) | Cell pool, type registry, navigation stack, mission-context lifecycle, pricing/objectives policy-context plumbing | W3 | Pricing and objective policy already left (GWP-747/750); dispatch_default, key-slot mapping, and numpad-digit routing are input policy and move next. |
world_engine.c | 349 | SPLIT | world/engine.lsp (proposed) | Splitmix hash kernel, node-address arithmetic (u32 domain), determinism invariant | W4 | Archetype tables and shaping decisions move; the hash math exceeds ±2^24 and stays a primitive. See open question 2. |
world_heat.c | 111 | RETAIN | - | world_heat_arm/disarm pool bridging sched.c to the engine heat hook | - | Timer-to-engine mechanism; cadence policy already lives in sweep/sweep.lsp. |
deck.c | 639 | DONE | deck/demo-seed.lsp (GWP-808) | Binary deck codec (magic, version, CRC32), atomic save/load, evented wallet setters, seed marshalling | - | The headless demo-deck seed content moved as authored data; the codec and the evented setters stay. |
nosh_stdlib.c | 454 | DONE | cart/stdlib.lsp (GWP-808) | LFSR (u32), deck-seam credit/rep/capability accessors, cell-pool list/navigation helpers | - | The draw helpers landed in a NEW cart-prelude module cart/stdlib.lsp over text-putc (not ui/draw.lsp: that module is the cell-tier drawing layer, and the legacy helpers draw the 80x25 text grid); the unused hline/vline retired outright. The list/navigation dispositions proved wrong on reading: they are pointer walks over the retained cell pool (the nosh_runtime.c row’s mechanism) with no authored policy, and moving them would trade one seam for a per-pointer-hop FFI. They stay as sanctioned FFI. Lisp suite tests/lisp/test-cart-stdlib.lsp. |
| Source | Lines | Disposition | Target Lisp module | Retained C surface | Wave | Notes |
|---|
screen_router.c | 1,020 | SPLIT | deck.lsp registry (existing) | System-tier KEC context lifecycle, arena ownership, render drive, deck/render-screen + deck/dispatch-key calls | W3 | Route and transition policy (which screen, when) joins the *sys-screens* registry in Lisp; the context plumbing stays. |
sys_screen.c | 288 | RETAIN | - | kec_eval_string drivers over the Lisp screen registry | - | Thin C driver; the registry itself is deck.lsp. |
deck_screen.c | 782 | DONE | deck/deck.lsp display-state section (GWP-808) | UDS seam: wallet reads, raw lambda-byte / capability-bit / cipher-seed-byte reads, evented award writers (deck/award-credits! / deck/award-rep! / deck/set-handle!), and the u32 uptime counter behind the tick / parts / mod / split-pair-seed seam (the 2^24 rule: a Lisp float counter freezes at 16,777,216 seconds) | - | The display state (heartbeat sampling and formatting, CIPHER-tab dashboard, SYS settings, LINK content, STATUS label tables and row formatting) moved; the counter arithmetic stayed C per the number-domain constraint. |
deck_aux.c | 1,057 | DONE | deck/aux.lsp game-logic section (GWP-808) | nokia.c machine (raw deck/nokia-*), u32 LFSR sequence draws, the u32 aux screen clock (advance / split-pair seed / mark / bounded since; the OOBE timeout and LINK-PROBE window run against it), action-hook forwarders (deck/hook-*), OOBE commit seam with the host-visible C mirror, factory wipe | - | The bounty and dialog logic (DIAGNOSTIC, LFSR EXERCISE, LINK-PROBE, INSPECT-CELL, NAME-A-LAMBDA, OOBE entry policy, KEY TEST / REBIND, FACTORY confirm gate) moved. |
dev_overlay.c | 561 | MIGRATE | sys/dev-overlay.lsp (proposed) | Diagnostic read accessors stay in their owning modules | W2 | Read-only diagnostic painting is screen behavior; it reads state through accessors that already exist. |
debug.c | 53 | MIGRATE | sys/dev-overlay.lsp (proposed) | - | W2 | FPS counter and toggle; folds into the dev-overlay module. |
keyboard_overlay.c | 604 | RETIRE | - | - | - | Superseded by deck/keyboard.lsp (GWP-517d), the ported widget on the ui/ kit. Still wired in hosts/emulator/src/main.c; unwire rides with W2. |
tutorial.c | 365 | DONE | sys/tutorial.lsp (GWP-808) | Step-table parser and storage, completion flag write through the deck seam, policy-context marshalling | - | First-boot detection, the token match, and the advance/complete sequencing verdict moved; Lisp suite tests/lisp/test-tutorial-policy.lsp. |
tutorial_wiring.c | 262 | DONE | sys/tutorial.lsp (GWP-808) | Commit-hook, CIPHER-push, and toast-prompt plumbing; u32 hold-timer arithmetic | - | The TERM-hold skip threshold moved with the tutorial policy (the tutorial_skip_due seam); the hook forwarders stay. |
attract.c | 486 | SPLIT | attract/attract.lsp (proposed) | Clip load, per-frame decode tick (no-allocation path) | W2 | Rotation order, idle entry, and the 1-second blank pause are policy; the .kn86clip decode stays with the codec. |
aesthetic_mode.c | 266 | RETAIN | - | Mode enum mapping, [aesthetic] TOML codec, rendering-delta accessors | - | Picker policy already lives in sys/aesthetic.lsp (GWP-513); what remains is mechanism plus config codec. |
degradation.c | 220 | RETAIN | - | Degradation-mode state and helpers | - | Resilience path: it must keep working when the interpreter is the failing part. See open question 3. |
panic_screen.c | 132 | RETAIN | - | Fallback fault screen over render.c/font.c/phosphor.c | - | Runs when the normal boot path has failed; depending on the Fe context would defeat it. |
hot_swap.c | 256 | RETAIN | - | Eject/insert simulation driving the cartridge FSM | - | Emulator-side test harness for a physical event; mechanism. |
| Source | Lines | Disposition | Target Lisp module | Retained C surface | Wave | Notes |
|---|
cipher.c | 2,129 | SPLIT | cipher/cipher.lsp (proposed) | Event-ring storage, OLED row writers, seed plumbing | W4 | The voice is policy: decay schedules, coherence stack, mode selector weights, template grammar, beat windows. The largest single migration; the ring buffer and the OLED composition stay. |
oled.c | 286 | RETAIN | - | 256x64 1bpp framebuffer, pixel/text primitives | - | Device driver (ADR-0015); the coproc path presents it. |
oled_row4.c | 226 | MIGRATE | oled/row4.lsp (proposed) | Claim-slot storage | W2 | The claimant-arbitration rule (preemptive beats topmost regular) is routing policy; rides with the oled/ mode manager pattern (GWP-729). |
sys_oled.c | 88 | RETAIN | - | oled-clear, oled-big-text, oled-fill-rect, oled-mode-claim bindings | - | Binding seam over the driver; oled/oled.lsp already builds on it. |
| Source | Lines | Disposition | Target Lisp module | Retained C surface | Wave | Notes |
|---|
input.c | 601 | SPLIT | deck/input.lsp (proposed) | Scancode-to-KN86KeyCode translation, event queue, backend-seam poll | W3 | Hold-detection thresholds and press/hold classification are input policy; the translation table and queue are mechanism. |
keymap.c | 240 | RETAIN | - | INI keymap-file parser, key-name mapping | - | Config codec, no SDL dependency. |
nokia.c | 336 | MIGRATE | deck/multitap.lsp (proposed) | - | W3 | Deterministic multi-tap state machine with host-supplied timestamps; pure input policy, ports as-is. |
t9_rank.c | 485 | MIGRATE | nemacs/t9.lsp (proposed) | Popularity baseline tables may ship as Lisp data | W3 | Deterministic pure-function ranker (ADR-0009); completion policy. The 50 ms event budget covers a tree-walked ranking at this candidate count. |
nosh_input_lisp.c | 110 | RETAIN | - | (read-key), (poll-key) ring over the input pipeline | - | Binding seam (GWP-635). |
| Source | Lines | Disposition | Target Lisp module | Retained C surface | Wave | Notes |
|---|
nemacs.c | 2,389 | SPLIT | kec-lisp editor engine via nemacs_lib.c (GWP-705 route) | Dual Fe context ownership (editor + REPL arenas), marshalling | W4 | The structural editor, cursor walk, and completion glue are policy; the library-backed engine already exists in kec-lisp. See open question 4 on retiring the C editor wholesale. |
nemacs_lib.c | 327 | RETAIN | - | Pending-text primitive, engine-drive bridge | - | Binding seam to the kec-lisp editor engine. |
nemacs_screen.c | 574 | RETAIN | - | nemacs_screen_bind set (nemacs/tree, nemacs/completions, cross-context marshalling) | - | Marshalling seam behind nemacs/nemacs.lsp (GWP-515). |
repl_screen.c | 166 | DONE | repl/repl.lsp (GWP-514, evaluator to Lisp with GWP-573) | Three repl_screen_bind history primitives | - | The evaluator left C once the System tier gained eval; the residue is the history-ring seam. |
repl_lib.c | 232 | RETAIN | - | Pending-line primitive, engine-drive bridge | - | Binding seam (GWP-573/574). |
repl_toast.c | 271 | MIGRATE | repl/toast.lsp (proposed) | Framebuffer save/restore under the band | W2 | Toast chrome, animation envelope, and lifecycle are screen behavior; pairs with the ADR-0053 drop-down work. |
repl_history.c | 128 | RETAIN | - | Tagless-blob ring codec over DeckState | - | Persistence codec; converges on the scoped blob-store contract. |
snippet.c | 338 | RETAIN | - | Fixed-slot pool codec with compaction over DeckState | - | Persistence codec; converges on the scoped blob-store contract. |
snippet_screen.c | 203 | RETAIN | - | snippet_screen_bind set, hydrate/flush | - | Binding seam (GWP-761). |
keystore.c | 195 | RETAIN | - | Tagless byte-blob codec over DeckState | - | Persistence codec (GWP-661); converges on the scoped blob-store contract. |
keystore_screen.c | 281 | RETAIN | - | keystore_screen_bind set, hydrate/flush | - | Binding seam; the ADR-0040 sanctioned-write rationale holds. |
dossier.c | 114 | RETAIN | - | Fixed-capacity intel-store codec | - | Persistence codec (GWP-609); converges on the scoped blob-store contract. |
dossier_screen.c | 80 | RETAIN | - | Read-only enumeration bindings | - | Binding seam (GWP-668, ADR-0040 read-only). |
| Source | Lines | Disposition | Target Lisp module | Retained C surface | Wave | Notes |
|---|
psg.c | 295 | RETAIN | - | YM2149 register-level synthesis at 44.1 kHz | - | Realtime DSP kernel; the audio callback stays C at any migration depth. |
sound.c | 185 | RETAIN | - | Audio callback plumbing, render-pull, coproc routing | - | Kernel glue behind the host seam (GWP-538). |
sfx.c | 167 | MIGRATE | sys/sfx.lsp (proposed) | A raw PSG register-write primitive (proposed) | W2 | Cue tables are audio content; they become Lisp data applied through one register-write primitive. |
music.c | 357 | RETAIN | - | Deterministic pattern player, fade attenuation, register scheduling | - | Runs from the audio callback with caller-supplied elapsed time; realtime kernel. See open question 5 for the sequencing boundary. |
station.c | 474 | RETAIN | - | PCM streaming engine, SPSC ring into the callback, manifest scan | - | Realtime streaming kernel (GWP-599/678); track-advance runs on the audio side of the ring. |
station_bind.c | 121 | RETAIN | - | station-* Fe control surface | - | Binding seam. |
coproc.c | 437 | RETAIN | - | v0.2 wire framing, CRC, command vtable, in-process/UART modes | - | Transport codec plus driver (ADR-0017); conformance target is the Pico 2 firmware. |
| Source | Lines | Disposition | Target Lisp module | Retained C surface | Wave | Notes |
|---|
render.c | 444 | RETAIN | - | 1024x600 RGB565 surface, glyph blit at integer scales | - | The framebuffer blitter (ADR-0036); named by the policy as a retained kernel. |
font.c | 523 | RETAIN | - | Generated 256-glyph 8x8 bitmap data | - | Generated data (tools/gen_font.py); not hand-authored logic. |
phosphor.c | 223 | RETAIN | - | Scheme enum, RGB565 values, TOML persist | - | Render mechanism plus config codec; the picker policy is sys/aesthetic.lsp. |
composite.c | 70 | RETAIN | - | Dither scrim, drop shadow over the surface | - | Pixel kernel (ADR-0036). |
text_view.c | 332 | RETAIN | - | Legacy 80x25 text surface over render.c | - | Mechanism kept for the Legacy Terminal and overlay passengers; the re-flow task tracks its retirement path separate from this map. |
cell_api.c | 368 | RETAIN | - | Cart backbuffer, chrome-row gate, half-block canvas, soft-glyph plane | - | The constrained cart draw tier (ADR-0027/0036); the sandbox boundary itself. |
cell_api_bind.c | 181 | RETAIN | - | cell-* bindings into cart and System contexts | - | Binding seam. |
sys_render.c | 465 | RETAIN | - | Privileged render/* primitive set | - | Binding seam (GWP-509). |
sys_context.c | 217 | RETAIN | - | System-tier context assembly on a caller arena | - | Interpreter-context lifecycle; capability is the binding set. |
reveal.c | 268 | RETAIN | - | Reveal registry, handle lifecycle, per-tick advance | - | Render animation kernel; ADR-0033 pins per-cell state outside the Fe arena. |
reveal_char_flicker.c | 105 | RETAIN | - | Per-cell flicker settle kernel | - | Render kernel (ADR-0033). |
reveal_radial.c | 71 | RETAIN | - | Wavefront reveal kernel | - | Render kernel (ADR-0033). |
clip.c | 270 | RETAIN | - | KC86 binary decode, zero-copy playback | - | Binary codec. |
nosh_clip.c | 169 | RETAIN | - | Cart-facing clip playback API | - | Binding seam over the codec. |
| Source | Lines | Disposition | Target Lisp module | Retained C surface | Wave | Notes |
|---|
cartridge.c | 1,079 | RETAIN | - | .kn86 header validation, per-cart arena open, NoshAPI registration, static-data walk | - | Loader: codec plus context lifecycle. The legacy dlopen path inside it is a retirement candidate once no .so cart remains. |
cartridge_fsm.c | 696 | RETAIN | - | Lifecycle FSM, phase-chain little-endian serialization | - | Hardware-event lifecycle plus codec; illegal-transition handling is defensive mechanism. |
capabilities.c | 293 | RETAIN | - | CART_CAPABILITIES binary parser, firmware-baked allowlist intersection | - | Sandbox-boundary enforcement; the allowlist is deliberate firmware policy changeable by re-flash alone (ADR-0015 3a). |
provenance.c | 477 | RETAIN | - | 32-byte block codec, FNV-1a chaining, append-on-record persistence | - | Codec plus integrity core. |
provenance_wiring.c | 287 | RETAIN | - | Bus subscribers, lifecycle integration | - | Seam glue (GWP-255). |
firmware_validate.c | 271 | RETAIN | - | .kn86fw header validation, inline SHA-256 | - | Integrity codec (GWP-114); layout owned by tools/kn86fw/format/kn86fw.h. |
nosh_save.c | 361 | RETAIN | - | Atomic write (tmp + rename + fsync), strict-size read | - | The blob-store mechanism itself; generalizes into the scoped atomic blob-store contract the persistence constraint names. |
| Source | Lines | Disposition | Target Lisp module | Retained C surface | Wave | Notes |
|---|
nosh_lisp_bridge.c | 4,237 | RETAIN | - | NoshAPI v1: the ~54 cart-facing primitives (ADR-0005), (mission-contract-raw) | - | The binding seam the policy exists to protect; largest file and correct at that size. |
nosh_world_bind.c | 143 | RETAIN | - | Opaque live :world handle accessors | - | Binding seam (GWP-629/631/632). |
nosh_scripted_mission.c | 733 | RETAIN | - | Sandbox runner: arena, tier bindings, deny-stubs, instruction budget | - | Interpreter-context lifecycle (ADR-0007); the missions it runs are Lisp. |
nosh_host.c | 1,219 | SPLIT | sys/dispatch.lsp (proposed) | Boot/shutdown orchestration, frame pump, arena ownership, host-config callbacks | W3 | The key-dispatch policy (which surface consumes a key, modal precedence) moves; process-lifetime orchestration stays. |
nosh.c | 250 | RETAIN | - | Subsystem init wiring | - | Lifecycle glue. |
router_bringup.c | 85 | RETAIN | - | Single screen-router bring-up | - | Lifecycle glue shared by hosts. |
nosh_event_bus.c | 152 | RETAIN | - | Fixed-table pub/sub | - | Mechanism named by the policy (event-bus glue). |
sched.c | 178 | RETAIN | - | Fixed-entry timer table over a virtual clock | - | The mechanism under run-with-timer; scheduling policy stays Lisp-side. |
panic.c | 471 | RETAIN | - | Signal handlers, sigjmp recovery, Fe error trap | - | Crash-recovery lifecycle; async-signal-safe by construction. |
watchdog.c | 84 | RETAIN | - | sd_notify READY/WATCHDOG pings | - | Platform glue (GWP-378). |
nosh_backend_stub.c | 36 | RETAIN | - | Headless host-seam stubs | - | The test backend. |
platform_link_emu.c | 273 | RETAIN | - | In-process ring-buffer link HAL stub | - | Transport driver stub (GWP-254). |
cli.c | 185 | RETAIN | - | kn86emu argument parsing | - | Host tooling. |
| Source | Lines | Disposition | Target Lisp module | Retained C surface | Wave | Notes |
|---|
legacy_terminal/launcher.c | 381 | SPLIT | undecided (see open question 1) | PTY session start/stop via runner.c | W3 | The SYS+INFO gesture detector and launcher menu are input plus screen policy; whether they may live in Lisp depends on the mode-swap isolation question. |
legacy_terminal/runner.c | 380 | RETAIN | - | PTY child process, CSI parse into the text grid | - | OS mechanism plus terminal codec. |
legacy_terminal/manifest.c | 228 | RETAIN | - | INI manifest parser | - | Config codec. |
legacy_terminal/numpad_shim.c | 88 | RETAIN | - | Static digit-key remap table | - | Lookup-table mechanism. |
legacy_terminal/fkey_overlay.c | 235 | MIGRATE | oled/fkeys.lsp (proposed) | OLED row save/restore | W2 | Row 4 F-key labels are OLED content policy; rides with the oled/ module and the row4 claim migration. |
| Source | Lines | Disposition | Target Lisp module | Retained C surface | Wave | Notes |
|---|
recorder.c | 508 | RETAIN | - | Input-script parser, cell-to-RGB565 raster, PNG encoder | - | Demo/QA tooling: codec plus raster, KEC-free by design. |
recorder_drive.c | 994 | RETAIN | - | System-tier context open, cart load, script replay | - | Thin runner; the carts and scripts it drives are .lsp/.rec. |
tools/kn86rec/kn86rec.c | 229 | RETAIN | - | CLI main over recorder | - | Thin runner. |
tools/kn86psg/kn86psg.c | 618 | RETAIN | - | .knm tune compiler/player | - | Offline audio codec tool; tunes are data files. |
Each entry is verified against the module header on disk.
| Lisp module | What moved | Task / PR |
|---|
system-image/lib/sys/aesthetic.lsp | SYS aesthetic picker, the first C-to-KEC screen port | GWP-513 |
system-image/lib/repl/repl.lsp | REPL screen; the evaluator followed once the System tier gained eval | GWP-514, GWP-573/574 |
system-image/lib/nemacs/nemacs.lsp | nEmacs screen render path (replaced the C OLED composition and the termbox2 spike) | GWP-515 |
system-image/lib/board/board.lsp | Mission board VIEW (landing/list/peek states) | GWP-516, GWP-648. Generator shipped under GWP-777 as mission/board-gen.lsp |
system-image/lib/deck/deck.lsp + deck/aux.lsp + deck/keyboard.lsp | Bare-deck home shell, aux surface, keyboard widget | GWP-517a/517d |
system-image/lib/oled/oled.lsp | CIPHER-LINE full-screen mode manager and built-in modes | GWP-729 |
system-image/lib/render.lsp | System-tier render/ wrapper library | GWP-509 |
system-image/lib/mission/pricing.lsp | Mission-end pricing policy (completion clamp, abandon rep cost), split-pair number convention | GWP-747, PR #202 |
system-image/lib/mission/contract.lsp | Cart-facing contract readers over one raw primitive | GWP-773, merged in the PR #204 stack |
system-image/lib/sweep/sweep.lsp | Sweep arming policy, cadence, teardown | GWP-775, PR #204 |
system-image/lib/mission/objectives.lsp | Objective-graph policy (goal declaration, close, resolve) | GWP-750, PR #208 |
system-image/lib/mission/baseline.lsp | Baseline selection-weight policy (supersession drop, threat inheritance and clip, single-phase rule) | GWP-808 |
system-image/lib/sys/tutorial.lsp | First-boot tutorial policy (detection, token match, sequencing, TERM-hold skip threshold) | GWP-808 |
system-image/lib/deck/demo-seed.lsp | Headless demo-deck seed content | GWP-808 |
system-image/lib/cart/stdlib.lsp | Legacy text-grid draw helpers of NoshAPI v1 over text-putc | GWP-808 |
system-image/lib/deck/deck.lsp (display-state section) | Bare-deck shell display state and row formatting | GWP-808 |
system-image/lib/deck/aux.lsp (game-logic section) | Bounty and dialog logic, OOBE entry policy, KEY TEST / REBIND, FACTORY gate | GWP-808 |
Ordered buckets for the MIGRATE/SPLIT rows. Dependency- and risk-driven; no dates.
| Wave | Rows | Rationale |
|---|
| W0 (partly shipped) | board_screen.c (remaining); mission_board.c (shipped) | Owned by GWP-777; this map records, and does not re-plan, that slice. mission_board.c’s generator has landed as mission/board-gen.lsp, leaving board_screen.c as the wave’s only open row. |
| W1 (shipped, GWP-808) | nosh_baseline.c, deck.c, nosh_stdlib.c, deck_screen.c, deck_aux.c, tutorial.c, tutorial_wiring.c | Policy already behind existing seams and existing Lisp modules. All seven rows shipped under GWP-808; each row above carries its module path and retained surface. |
| W2 | dev_overlay.c, debug.c, repl_toast.c, oled_row4.c, legacy_terminal/fkey_overlay.c, attract.c, sfx.c (plus the keyboard_overlay.c unwire) | Screens, overlays, and content tables: self-contained surfaces with small blast radius, each following the established screen-port pattern. |
| W3 | input.c, nokia.c, t9_rank.c, nosh_runtime.c, nosh_host.c, screen_router.c, legacy_terminal/launcher.c | Input and dispatch policy: one coherent pass over classification, routing, and key precedence, done after the screens it routes to are Lisp. |
| W4 | cipher.c, nemacs.c, world_engine.c | Deep cores: the largest files, each with an unresolved boundary question, done last with the seam patterns proven on W1-W3. |
The complete C surface once W0-W4 land. This is the boundary the FFI reference documents. “Proposed” marks contracts that do not exist today.
| Group | Sources | Contract status |
|---|
| Render / framebuffer | render.c, font.c, phosphor.c, composite.c, text_view.c, reveal.c, reveal_char_flicker.c, reveal_radial.c, cell_api.c | Exists: render/* tier, cell-* tier, reveal primitives |
| Input events | input.c (mechanism half), keymap.c, nosh_input_lisp.c, legacy_terminal/numpad_shim.c | Exists: (read-key)/(poll-key), event queue. Proposed: classification-threshold accessors for the Lisp policy |
| Audio kernel | sound.c, music.c, station.c | Exists: cue/tone/silence surface, station-*. Proposed: raw PSG register-write primitive for the sfx.c data migration |
| PSG | psg.c, tools/kn86psg/kn86psg.c | Exists: register model, .knm toolchain |
| OLED driver | oled.c, sys_oled.c | Exists: pixel tier, mode gate |
| Coproc UART | coproc.c, platform_link_emu.c | Exists: v0.2 framing per coprocessor-protocol.md |
| Blob store | nosh_save.c, deck.c (codec half), repl_history.c, snippet.c, keystore.c, dossier.c and their *_screen.c seams | Exists: per-store codecs and hydrate/flush seams. Proposed: one scoped atomic blob-store contract these converge on |
| Codecs / integrity | clip.c, nosh_clip.c, provenance.c, provenance_wiring.c, firmware_validate.c, capabilities.c, cartridge.c, cartridge_fsm.c, legacy_terminal/manifest.c, legacy_terminal/runner.c | Exists |
| KEC lifecycle and bridge | nosh_lisp_bridge.c, cell_api_bind.c, sys_render.c, sys_context.c, sys_screen.c, nosh_world_bind.c, station_bind.c, nosh_scripted_mission.c, nosh_baseline_loader.c, nemacs_lib.c, nemacs_screen.c, repl_lib.c, screen_router.c (lifecycle half), nosh_host.c (lifecycle half), nosh.c, router_bringup.c, nosh_event_bus.c, sched.c, panic.c, panic_screen.c, watchdog.c, degradation.c, mission_world.c, world_heat.c, mission_sweep.c, hot_swap.c, aesthetic_mode.c | Exists: NoshAPI v1 and the seam sets named per row above |
| Test / demo runners | recorder.c, recorder_drive.c, tools/kn86rec/kn86rec.c, cli.c, nosh_backend_stub.c | Exists |
The language-policy.md standing-debt table now lists board_screen.c alone under GWP-777; this map agrees and marks it the wave’s only open row. mission_board.c has left the debt table: its generator migrated to mission/board-gen.lsp (template pool, eligibility gate, tier and instance-count tables, threat clamp, payout formula), the file keeps mechanisms only, and the tier and broke-bonus math moved with it. The policy’s migrated list (pricing, contract readers, sweep, PRs #202 to #204) is confirmed from the module headers; this map refines it with mission/objectives.lsp (GWP-750, PR #208), which shipped after the policy was codified. Rows in this map beyond the debt table (the W1-W4 SPLIT/MIGRATE set) extend the table’s scope rather than contradicting it; the debt table stays the short-form authority for the remaining GWP-777 row until that slice merges.
legacy_terminal/launcher.c: whether the gesture detector and launcher menu may be Lisp when ADR-0021’s mode swap suspends the runtime that would host them.
world_engine.c: whether archetype shaping migrates to Lisp or the engine stays a sealed deterministic kernel read through the :world handle, given the u32 hash domain and the ADR-0049 determinism invariant.
degradation.c: whether degraded-mode selection may live in Lisp when the mode exists to survive interpreter failure.
nemacs.c: whether the C structural editor retires wholesale in favor of the kec-lisp editor engine (GWP-705) or keeps the completion path in C for keypress latency.
music.c: whether pattern sequencing counts as audio policy (Lisp on run-with-timer) or as synthesis (C in the callback), given the caller-supplied elapsed-time design.