Context
Discovered during the #14985 forensics (origin session below): two whitebox instruments died with TypeError: ... is not a function exactly when they were needed — worker-console reads are the only truthful console surface for SharedWorker apps (CDP-invisible), and patchCode is the hot-instrumentation lever. Both failures forced a fallback to source-level instrumentation edits.
Live latest-open sweep: checked latest open issues at 2026-07-11T00:02Z; no equivalent found. A2A sweep: clean (this gap was announced in my #15009 lane broadcast; no peer claim).
The Problem
test/playwright/fixtures.mjs declares both wrappers against the WRONG service singletons:
fixtures.mjs:535 — getConsoleLogs(type, filter) calls NeuralLink_RuntimeService.getConsoleLogs(...) → TypeError.
fixtures.mjs:183 — patchCode(className, methodName, source) calls NeuralLink_InstanceService.patchCode(...) → TypeError.
The Architectural Reality
The methods exist — on different services. The MCP tool layer routes them correctly and is the authority map (ai/mcp/server/neural-link/toolService.mjs):
34: get_console_logs : ConnectionService.getConsoleLogs.bind(ConnectionService),
62: patch_code : RuntimeService .patchCode .bind(RuntimeService),
Verified against the service classes: ai/services/neural-link/RuntimeService.mjs has no getConsoleLogs (it owns patchCode); InstanceService.mjs has no patchCode. The fixture imports all the safe-wrapped singletons from ai/services.mjs already — NeuralLink_ConnectionService is in scope at fixtures.mjs:4.
The Fix
Two one-line service-object corrections in test/playwright/fixtures.mjs:
getConsoleLogs → NeuralLink_ConnectionService.getConsoleLogs({ sessionId, type, filter }).
patchCode → NeuralLink_RuntimeService.patchCode({ sessionId, className, methodName, source }).
Validate live (scratch spec or an assertion added to an existing NL e2e): both calls return without TypeError against a running app; getConsoleLogs returns worker console entries; patchCode round-trips a benign method patch. Sweep the remaining fixture wrappers against the toolService.mjs routing table for further mismatches while in there — the two found were both discovered by USE, which suggests unexercised wrappers may hide more.
Acceptance Criteria
Out of Scope
- New fixture capabilities; this is wiring repair only.
- The MCP tool layer (already correct).
Decision Record impact
none.
Related
#15009 (discovery context), #14985 (the investigation these instruments serve), #14591 (whitebox e2e suite epic context).
Origin Session ID: 748f9b8f-20cd-4360-9a29-c3084d059052
Retrieval Hint: "fixture getConsoleLogs patchCode wrong service TypeError routing table"
Context
Discovered during the
#14985forensics (origin session below): two whitebox instruments died withTypeError: ... is not a functionexactly when they were needed — worker-console reads are the only truthful console surface for SharedWorker apps (CDP-invisible), andpatchCodeis the hot-instrumentation lever. Both failures forced a fallback to source-level instrumentation edits.Live latest-open sweep: checked latest open issues at 2026-07-11T00:02Z; no equivalent found. A2A sweep: clean (this gap was announced in my
#15009lane broadcast; no peer claim).The Problem
test/playwright/fixtures.mjsdeclares both wrappers against the WRONG service singletons:fixtures.mjs:535—getConsoleLogs(type, filter)callsNeuralLink_RuntimeService.getConsoleLogs(...)→ TypeError.fixtures.mjs:183—patchCode(className, methodName, source)callsNeuralLink_InstanceService.patchCode(...)→ TypeError.The Architectural Reality
The methods exist — on different services. The MCP tool layer routes them correctly and is the authority map (
ai/mcp/server/neural-link/toolService.mjs):Verified against the service classes:
ai/services/neural-link/RuntimeService.mjshas nogetConsoleLogs(it ownspatchCode);InstanceService.mjshas nopatchCode. The fixture imports all the safe-wrapped singletons fromai/services.mjsalready —NeuralLink_ConnectionServiceis in scope atfixtures.mjs:4.The Fix
Two one-line service-object corrections in
test/playwright/fixtures.mjs:getConsoleLogs→NeuralLink_ConnectionService.getConsoleLogs({ sessionId, type, filter }).patchCode→NeuralLink_RuntimeService.patchCode({ sessionId, className, methodName, source }).Validate live (scratch spec or an assertion added to an existing NL e2e): both calls return without TypeError against a running app;
getConsoleLogsreturns worker console entries;patchCoderound-trips a benign method patch. Sweep the remaining fixture wrappers against thetoolService.mjsrouting table for further mismatches while in there — the two found were both discovered by USE, which suggests unexercised wrappers may hide more.Acceptance Criteria
toolService.mjsrouting table).getConsoleLogsreturns app-worker entries.toolService.mjs: every declared wrapper's service object matches the routing table (list any additional fixes in the PR).Out of Scope
Decision Record impact
none.
Related
#15009(discovery context),#14985(the investigation these instruments serve),#14591(whitebox e2e suite epic context).Origin Session ID: 748f9b8f-20cd-4360-9a29-c3084d059052 Retrieval Hint: "fixture getConsoleLogs patchCode wrong service TypeError routing table"