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_patchprimitive (AGI-coding needs it); contradicts the analysis's blanket workspace_* merge. - The "dual registry" is nuanced: the parallel
BuiltinToolmap 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_warntyped accessor; mechanically migrate the ~97Arc<dyn Any>downcast sites → kills the silent-downcast-miss bug class ("three incidents"). Not Cat-A. - 0-B
ModuleFactory+MODULE_FACTORIESdistributed_slice +boot_modulestopo-sort incore— isolated new module, unit-tested, no caller wired yet. - 0-C extend
ToolDescriptorwith schema fields (description,parameters: fn()->Value,preloaded/essential/deprecated) +descriptor_schemas()+ capture the golden snapshot ofresolve_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_toolsandbox into sharedrun_sandboxed, routePerChatSkillManager::runthrough it + author-timeBasicSkillValidatoronskill_managecreate/edit. Prod-shippable atOPENALICE_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_patchreclassification.
WAVE 3 (deep, Cat-A, lab-canary mandatory)
- Deep-2 Spawner unification (prefab + RoleRegistry + TaskActor/ToollessActor) → mission/worker OODA via
run_agentic_loopbehindOPENALICE_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 opaqueToolExecFn).
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)
- Crate-direction seam (Wave 1): move
tool_indexup into api-handlers (recommended, smallest blast) vs aToolCatalogtrait vs moveTOOL_DESCRIPTORSdown. - Deprecated skill_\* aliases: register as
deprecated:truedescriptors (dispatchable, out of LLM array) or accept "unknown tool"? - CRUD deletion policy: blanket-delete Class-1 read twins in one wave, or per-family ack? + ONE generic
alice-cli storeverb vs ~40 typed (recommend generic). - kg_\*/rag_\* stubs, tts_\* 6→1, map subsystem fate (delete / CLI / keep reserved).
- Voyager rollout (Open-Q2): comfortable
off→shadow→onafter 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?). - 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.