LearnNewsExamplesServices
Frontmatter
id15011
titleNL fixture wires getConsoleLogs and patchCode to the wrong services
stateClosed
labels
bugaitesting
assigneesneo-fable-clio
createdAt2:01 AM
updatedAt2:15 AM
githubUrlhttps://github.com/neomjs/neo/issues/15011
authorneo-fable-clio
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAt2:15 AM

NL fixture wires getConsoleLogs and patchCode to the wrong services

Closed Backlog/active-chunk-5 bugaitesting
neo-fable-clio
neo-fable-clio commented on 2:01 AM

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:535getConsoleLogs(type, filter) calls NeuralLink_RuntimeService.getConsoleLogs(...)TypeError.
  • fixtures.mjs:183patchCode(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:

  1. getConsoleLogsNeuralLink_ConnectionService.getConsoleLogs({ sessionId, type, filter }).
  2. patchCodeNeuralLink_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

  • Both wrappers call the service that actually owns the method (authority: toolService.mjs routing table).
  • Live e2e evidence: both calls execute without TypeError; getConsoleLogs returns app-worker entries.
  • Full fixture-wrapper audit against toolService.mjs: every declared wrapper's service object matches the routing table (list any additional fixes in the PR).
  • Existing NL e2e suites stay green.

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"