Files
WoW-Hybrid-gateway/docs/NATIVE_ROSTER_HANDOFF.md
praxisandClaude Fable 5.2 60b6d4b7a5 Design records
59 files, from working commit b1a079a.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-19 01:32:48 +02:00

110 lines
6.8 KiB
Markdown

# Native authenticated roster into the engine queue
Actual-client queue delivery is now verified. **Native character selection,
session adoption and world entry remain unimplemented/unverified.**
The verified frame host fromf92b81a now has an opt-in packet variant. Its Linux
worker uses the existing genuine Turtle SRP/M2, realm discovery and world-auth
implementation in `native/bootstrap.cpp`. It reads the actual server roster and
passes that authenticated handle to `gw_native_encode_roster`, which reuses
`src/roster_translation.cpp::forever_roster`. No Forever character database or
frontend session provider is used. The existing codec still supports the tested
Human Warrior roster, at most10 entries; this is not all-class coverage.
The wire realm ID comes from the real realm-list entry. Unavailable modern
virtual-address/super-district namespace values remain0 in this diagnostic
regionwide packet; they are not presented as server-supplied metadata or a
finished realm-adoption mapping. That routing representation needs validation
when the native account/realm context is implemented.
The worker constructs opcode0x470018 plus encoded payload in an owned16KiB PE
mailbox. Only successful authenticated construction reaches publication. Session
keys, credentials and SRP proofs stay inside the native backend; the Windows
module receives only the public roster and a verified-session marker.
Publication/acknowledgement use atomic release/acquire operations. The backend
handle stays alive through the bounded delivery observation and closes afterward;
this diagnostic does not yet adopt a persistent engine world session or send a
Turtle character-login request.
`native/engine_packet_host.c::gw_packet_poll_callback` runs at the genuine frame
boundary. It requires the same owner/thread, proof marker, bounded packet and
matching native queue owner, then calls the source-derived six-argument
`0x141e54190` entry to let the engine allocate/copy/refcount the queued packet.
No queue nodes, refcounts, account flags or connection state are written by the
compatibility code. The original poll method remains tail-forwarded.
The optional second per-object wrapper at virtual slot+0x30 records only opcode,
length-independent receive count and current NetClient state, then tail-forwards
all five real arguments to original receiver0x141e47960. It does not decode or
discard the packet itself. The stock receiver's known state5 requirement remains
intact, so state2 may reject delivery before the character-list parser. This is
the expected question for the real-client test, not a check to disable.
The diagnostic parent performs only fixed code/metadata inspection and reversible
per-object data binding. It carries no gameplay packet payloads. There is no
listening proxy, external translator, DB-provider subprocess or codec subprocess
in this native path. The private Windows DLL and in-process native session
library are distinct reusable components, not an embedded gateway executable.
No Lua namespace registration is used.
## Tests and rollback
The owned Windows fixture loads the real compiled DLL in its own console process.
It checks missing proof, oversized payload, queue-owner and thread mismatches,
then verifies six-argument submission against an owned test stub and five-argument
receive forwarding. It never calls a game function or changes a game process.
Source-level binding tests verify both overridden slots and exact restoration.
Authenticated loopback tests exercise the new roster C ABI's required-size retry,
unchanged undersized destination, invalid namespace bounds and actual encoding.
Ordinary CTest passed21/21 in17.18s before actual activation. Failed initial
compile/type-bound assertions were corrected and the relevant tests rerun.
The21-test ASan/UBSan suite also passed in18.05s. Sanitizers cover the Linux
library/fixtures; the owned Wine fixture separately verifies the Windows ABI.
## Actual-client result
WowB54819 loaded the native session/bootstrap library and the Windows packet
host, with the external gateway stopped. Inside this real process, genuine SRP/M2
verification, genuine realm discovery and Tortoise world authentication returned0.
The server supplied4 characters. The worker encoded a2523-byte opcode+roster
buffer and the real Windows frame host submitted it once to the actual engine
queue. Its queued receive wrapper observed exactly one0x470018 packet, state2,
error0. The original receiver0x141e47960 became executable, and the frame loop
continued for7389 calls with host error0. No new fatal report appeared.
The actual UI remained at login. The original receiver checks NetClient state5
before decoding, while this client remained initialized in state2 with no engine
connection slots. The character-list native method remained unexecuted. Thus the
experiment verifies genuine in-process authentication plus actual main-thread
packet ownership/delivery; it **does not verify engine authentication adoption**
or display of the native roster. No state check was patched to conceal this result.
Both original per-object methods were restored at the verified frame safepoint;
the inspector confirmed the host binding was absent afterward. The native backend
session closed normally after delivery. No Turtle character login, movement,
progression command or database character modification was sent by this test.
Typed evidence: `evidence/gameplay/native-roster-engine-handoff.json`.
After restoration the real client also passed synthetic short/long login-field
cycles in7.9119/10.2934s, plus deliberate mid-typing focus loss/recovery. No frontend
credential was read or submitted. Original/private executable hashes still match,
TracerPid is0, and designated character4509 remains level60, health2609,
money10000 at its unchanged Hall of Arms position.
The precise remaining requirement is a genuine `ClientConnection` transport/
account/realm initialization path that owns the live Turtle session. Sending
another roster or auth-response packet through the same state2 receiver cannot
provide that context. The network adapter must preserve the real connection,
reference/cancellation lifecycle and server proof rather than setting state5.
See the factory trace in `ENGINE_SESSION_BOUNDARY.md`.
For the actual experiment, close the recognized private client normally, prepare
the private dependency with `ops/native_pe_bridge.py prepare`, and launch
`ops/debug_client_owner.py serve-native-roster-host` with its private opt-in
configuration. The Unix request `install-engine-packet-host` binds only at the
verified frame-pump safepoint. `restore-engine-poll-host` restores both original
slots through the original object vtable. After normal client close,
`ops/native_pe_bridge.py restore` returns the private graphics dependency to its
baseline. Original Forever/Turtle installations and original Wine prefix remain
unchanged. Do not enable the older Lua probes for this experiment.