KBEngine coverage matrix
What the demo actually exercises on the real engine, area by area. Each row has at least one accepted batch and an evidence file behind it (see Acceptance evidence).
Engine faces exercised today
| Engine face | How the demo exercises it | Where proven |
|---|---|---|
| Login chain | loginapp auth → MySQL account row (created on first login) → baseapp redirect → avatar list → select/create avatar → giveClientTo → enterSpace | bots loop, Godot runners (022/023/027) |
| Entity lifecycle | createCellEntity, cell create message carrying hasClient at send time, spawn guard stamped on cell entry, death/respawn | object view (029) |
| AOI / witness | Enter/leave view with alias renumbering, two-phase leave (pending flag → periodic flush), optimized position stream | object view (029): 17 markers, 19 enters, 2 leaves |
| Property sync | Def flags incl. combined aliases (CELL_AND_OTHER_CLIENTS → OTHER_CLIENTS), streamed to clients and to the Godot stats panel | panel (028): exp 0→20 via reqPractice |
| Remote calls | client→cell method pipe (wire id 205: [i32 eid][u16 compUID][u16 utype][args]), base↔cell callbacks, cell→client pushes | object view kill via reqGoto/reqAttack (029) |
| MySQL persistence | Account rows, avatar DBID rebind on re-login, item/sect tables, onWriteToDB signatures, autoload restore on boot (EntityAutoLoader) | DB roundtrip (024), export chain (025) |
| Space management | World space entry, sect instanced maps (spaceIndex = 1000 + sectDbid), respawn position | bots loop (023), sect batch |
| Multi-service-group / cross-server | Two service groups on one host (uid from env UUID, no second machine), all client-facing ports shifted, and one shared MySQL database with <shareDB>true</shareDB> on both sides; entity custody is decided by the engine's kbe_entitylog row (serverGroupID vs the loading group's uid): the home-side custodian one-shot probe is denied while the arena group holds the avatar; shouldAutoLoad=1 write (custody lock) is what registers the lock row | cross-server arena drill (036): 10 PICKUP → 10 custody locks → 10 arbitration denials → 5 boss kills/round closes → 5 homecomings |
| Sect ranks | Five-rank ladder + permission matrix enforced on the base side; every denial logged; roster rank/dept persisted to the tbl_Sect_members sub-table | rank drill via bots (033): unauthorized promote denied, probation→elder ladder and back, dept=combat with hall-head=yes, kick 10→9, invite negative |
| Quest system | Task base entities persisted with autoload restore on boot; one face for normal (main/daily/side) and sect-board quests; kill/realm progress hooks; delivery: exp on the base, gold/item grant forwarded to the cell bag, row removed via destroy(deleteFromDB=True) | quest drill via bots (034): accept→progress→deliver on both classes, board post + member accepts, reward bagGold moves, delivered rows gone from tbl_Task |
| NPCs / exposed interaction | Cell-only static presences spawned from the space timer; interaction rides the own-cell Exposed face (reqTalkNpc/reqTakeNpcOffer with the target id as argument) since a bots client cannot call remote entities directly; replies go cell→cell straight back; NPC offers hand world quests to the normal accept face or post sect bounties to the board (posterDbid=0) | npc drill via bots (035): NPC SEEN relay, talk text push, world offer accept→deliver, hall bounty board post + accept + delivery |
| Mailbox / offline mail | A Mail base-only persistent entity defines the schema; send = createEntityLocally + writeToDB (explicit sender callback, the engine has no default onDBWrite hook) lands one tbl_Mail row plus tbl_Mail_attachments child rows, then destroy() (deleteFromDB defaults False, the row outlives the entity); recipients never load the entity — fetch/claim/delete ride executeRawDatabaseCommand row checks; the claim grant goes through the real cell bag (Inventory.addItem, the monster-drop channel) all-or-nothing (a bag without room for the whole grant refuses it, the row reverts to unread, the client hears no-bag) and onMailItemsGranted(dbid, ok) settles it | mail drill via bots (037): bogus-claim deny → send self-mail with attachment → login-fetch headers → claim (bag addItem + state flip) → delete (main + child rows gone), one plain letter left durable for the next boot's unread replay |
| Container item family | Three Parent=Item tiers — StorageBag (12 slots) / SpatialRing (4) / StorageSpace (40) — each a BASE+Persistent entity with capacity + contents ARRAY<ITEM_INFO> (per-tier table + nested *_contents child table pre-created by dbmgr at boot); the avatar bar (containerBar ARRAY<UINT64> child table) is a summary face while ownership resolves through the ownerDbid+className entity scan; store gates can_store base-side first, then containerTakeFromBag → Inventory.takeItem (take_stacks) → onBagItemsTaken → merge+write; take grants back through Inventory.addItem; partial fits are denied, never truncated | container drill via bots (038): fresh creates ×3 tiers, ring-over-total bad-count deny while the same count passes the bag gate to the honest no-bag deny (caps differ, bag never touched), space+ring store, ring take round-trips empty, session 2 boots with zero re-creates (autoload) and replays session 1's space stack before its own put |
| Skill system | Four-skill table in common/skills.py (active single / active aoe / active self-buff / passive); learning appends one SKILL_SLOT implementedBy instance per skill to the skillSlots ARRAY<SKILL_SLOT> base property (a raw list fails the engine set-gate, a raw dict silently persists the def default — only impl instances round-trip); casting gates the learned side base-side, then relays to the cell where mana (UINT32 OWN_CLIENT, respawn refills) and per-skill cooldowns live; damage rides the five-element affinity table; every settlement relays cell → base via onSkillEvent | skill drill via bots (039): learn ×2, hit dmg=25 with mana 30→20→12, recast cooldown deny, stone guard buff, restart leg restores skillSlots as impl instances (slots=2 ×10, zero re-learns) and re-runs every anchor |
| Bots component | Headless player AI resolving client faces from scripts/bots/ only; full login→fight→loot→sect loop | bots (023) |
| Wire protocol | Packet framing, component handshakes (511/506/518), per-component message tables, baseapp periodic tick (id 11 / id 4) | godot skeleton (027), object view (029) |
| Export chain | Missing-table probe, schema export from live defs | export chain (025) |
Known engine leftovers (documented, riding named follow-ups)
- wire id 4: baseapp periodic client-channel message with a fixed 2-byte payload, paired with the id-11 tick reply. The loginapp-leg message table mislabels it as variable-length, causing occasional frame mis-splits that self-recover. Fix = per-leg message-table dispatch batch.
- optimized position stream: ids 55/60 (packed xyz / xyz+y) are counted but not decoded by the Godot client. Fix = position family decode batch.
- entities.xml divergence: the test fixture keeps a training-corpus variant (
Training*types) by design; templates and fixture diverge there intentionally. - collect-goal quest delivery: tasks with a collect goal are denied at deliver (
collect-goal-not-wired); the pure deliver-check face is pytest-pinned. Fix rides the item-goal batch.
What is not exercised yet
Planned batches (see todo.md) will add real-machine coverage for: mail (done in 037, remaining: bulk/admin faces) and remaining item surfaces. These are not shipped and not counted in the matrix above.