kb://architecture/game-engine-impl-plan-2026-06-17active2026-06-17

Game-Engine Re-Architecture — Sequenced Implementation Plan

architectureroadmapimplementationprimitivesvoyager

Game-Engine Re-Architecture — Sequenced Implementation Plan

Date: 2026-06-17 · Author: Norbert Wiener · Source: 8-agent impl-design workflow (wf_d044621f-aee) + the analysis (game-engine-rearchitecture-analysis.md). 7/8 designs returned (seam-extension hit a transient 529 — re-runnable). Status: plan ready; Wave 0 executing; rest gated on NAO decisions + lab-canary.

Corrections the design pass made to the analysis (verify-by-code wins, again)

  • DeepAgentManager already deleted (QW3, commit 2d471e1ac) → Deep-2 "delete DeepAgentManager" is DONE.
  • No legacy linear-scan dispatch arm — dispatch is already single-path (TOOL_REGISTRY.get, mod.rs:319); the analysis's "delete the legacy match arm" was stale.
  • `workspace_patch` must NOT be deleted — reclassify as the apply_patch primitive (AGI-coding needs it); contradicts the analysis's blanket workspace_* merge.
  • The "dual registry" is nuanced: the parallel BuiltinTool map is (a) the schema source-of-truth for 4 consumers (LLM tool array, semantic tool_search HNSW, tool_search handler, agent default toolset) + (b) a stateless-handler store for ~14 tools. The 59 "executed at transport layer" entries are schema-carrier stubs, never invoked.

The program: one backbone, 4 waves

Backbone insight: make the registry/boot/dispatch seams typed + single-source (additive), THEN delete the long-tail, THEN promote the dynamic action space + unify the OODA engine, with autonomous Voyager last. ~80% of the substrate already exists; we commit to it.

WAVE 0 — safe NOW (no NAO decision, no lab-canary, low-risk, additive/mechanical)

  • 0-A kernel.get_driver_as::<T>() + get_driver_as_or_warn typed accessor; mechanically migrate the ~97 Arc<dyn Any> downcast sites → kills the silent-downcast-miss bug class ("three incidents"). Not Cat-A.
  • 0-B ModuleFactory + MODULE_FACTORIES distributed_slice + boot_modules topo-sort in core — isolated new module, unit-tested, no caller wired yet.
  • 0-C extend ToolDescriptor with schema fields (description, parameters: fn()->Value, preloaded/essential/deprecated) + descriptor_schemas() + capture the golden snapshot of resolve_builtin_tool_schemas/essential_tool_schemas_arc (the Cat-A byte-identity oracle for Wave 1). Additive — both registries coexist, no deletion.
  • 0-D Voyager Track-1 safety: extract bash_tool sandbox into shared run_sandboxed, route PerChatSkillManager::run through it + author-time BasicSkillValidator on skill_manage create/edit. Prod-shippable at OPENALICE_VOYAGER=off. The single most important safety change.
  • AGI-0 AliceAgenticPatchSolver + bench CLI verb in the separate openalice-lab repo (mock /v1/chat + FakeSweExecutor) — zero prod-binary impact.
  • QW1-doc docs/design/qw1-crud-deletion-manifest.md — per-tool table (SAFE-TO-DELETE / BLOCKED-on-CLI-verb / KEEP); documentation, unblocks Wave 2a.

WAVE 1 — single registry (critical path, Cat-A via prompt-input)

Struct-1 Steps 4-7: repoint the 4 schema consumers + ~14 dispatch handlers onto TOOL_DESCRIPTORS, then DELETE execute_builtin_tool + builtin_tools_map + builtin_tools + BuiltinTool + the 59 stubs. The Wave-0-C golden snapshot is the byte-identity gate (the LLM tool array is an input to soul/prompt composition). Blocks on NAO Q-A (crate-direction seam) + Q-B (deprecated skill_* aliases). This is the gate both QW1 deletions and Deep-3 depend on.

WAVE 2 (after Wave 1) — long-tail + boot

  • 2a QW1 Class-1 CRUD deletions, one family per commit (task/calendar/worker/sop/router/appstore/mood). Each re-gated independently (the QW3 lesson). Blocks on NAO Q-C (blanket vs per-family).
  • 2a-2 add ONE generic alice-cli store put/del <key> <json> (recommended over ~40 typed verbs) → then delete write-side tools.
  • 2b Struct-3 boot migration onto ModuleFactory (parallel off 0-B).
  • 2c AGI-coding engine: widen bash allowed_roots behind default-off flag; apply_patch reclassification.

WAVE 3 (deep, Cat-A, lab-canary mandatory)

  • Deep-2 Spawner unification (prefab + RoleRegistry + TaskActor/ToollessActor) → mission/worker OODA via run_agentic_loop behind OPENALICE_MISSION_OODA. Parallel off 0-A; doesn't need Wave 1.
  • Deep-3 Promote plugin-host to the ActionSpace registry (Native + MCP + WASM + skills); ALICE_ACTION_SPACE=shadow→on; the agentic loop stays byte-identical (only calls opaque ToolExecFn).

WAVE 4 — autonomous Voyager (tail, Cat-A, NAO multi-stage)

Persistence/lock fix + promoted-skill→prompt-visible library + human-approval-on-first-promotion via #489; off→shadow(lab ≥48h)→on(lab)→SINGLE prod cutover (no A/B on prod chats); NAO personally reviews first promoted skills + approves the autonomous-bash safety boundary.

Critical path

Wave0-C → Wave1 (the Cat-A byte-identity gate) → branches: [Wave2a QW1 deletions] ∥ [Wave3-Deep3 action-space]. Deep-2 runs parallel off Wave0-A (no Wave-1 dep). Voyager is the tail.

NAO decisions needed (unblock the gated waves)

  1. Crate-direction seam (Wave 1): move tool_index up into api-handlers (recommended, smallest blast) vs a ToolCatalog trait vs move TOOL_DESCRIPTORS down.
  2. Deprecated skill_\* aliases: register as deprecated:true descriptors (dispatchable, out of LLM array) or accept "unknown tool"?
  3. CRUD deletion policy: blanket-delete Class-1 read twins in one wave, or per-family ack? + ONE generic alice-cli store verb vs ~40 typed (recommend generic).
  4. kg_\*/rag_\* stubs, tts_\* 6→1, map subsystem fate (delete / CLI / keep reserved).
  5. Voyager rollout (Open-Q2): comfortable off→shadow→on after lab, or hold at shadow until you review first promoted skills? + the autonomous-bash safety boundary (unshare-n + denylist + Critic-veto sufficient, or WASM-only for autonomous promotion?).
  6. SWE-bench live run (token-spend, Docker image disk): Tiny/Small only? clone-into-jail (zero engine change) vs per-agent jail override?

Process (all waves)

Independently re-gate EVERY deletion (build + TEST + drift + symbol-grep — cargo is truth; the QW3 lesson: analysis over-claimed dead-ness on 3/5). Cap -j4 --test-threads=4. Structural+deep on branch + lab BEFORE mvp. cargo clean between heavy waves; keep ≥20G. Cat-A immovables (loop invariants/soul/connector-order/AppState) byte-identical, gated. No push without NAO.

Full per-design specs (impl_steps, test plans, blast radius): workflow wf_d044621f-aee.