Context
defect-note 2026-10-17 17:46Z (fingerprint 7aa4bc2640663fdc). The Neural Link Bridge that the Engine's neuralLink Playwright fixture spawns outlives the run. A Stage e2e run at 17:04Z started its Bridge (npm run ai:server-neural-link from NEO_AGENTOS_RUNTIME_ROOT) on NEO_NL_PORT 18981; 31 minutes later it was still listening, and the next run found the port taken. The same happened after the 17:3xZ run. Both were stopped by exact PID.
With hosted Stage CI off until the Nov 1 reset, authors run the e2e tiers locally on the operator's machine (operator directive, relayed 2026-10-17 16:58Z; local testing is priority zero). Every run leaves a Bridge behind there.
Emmy's source triage (A2A 17:54Z), re-read here:
test/playwright/fixtures.mjs:261 starts the Bridge (manageConnection({action: 'start'})), and the fixture ends at await use(nl) (:861) with no finally and no stop.
- In the Brain,
ConnectionService.manageConnection with action: 'stop' kills only its own bridgeProcess (ai/services/neural-link/ConnectionService.mjs:913–923, bridgeProcess.kill()).
- That process is the
npm parent of a detached spawn (:1037–1039). Whether killing it reaps the node run-bridge.mjs child is not shown.
The Problem
A local e2e run leaves a Bridge process and a bound port per run. A later run on the same port connects to whatever is listening, which can be a Bridge started from another NEO_AGENTOS_RUNTIME_ROOT, so it may run other Brain code than the run requested. No current spec observes any of this.
The Architectural Reality
neuralLink (test/playwright/fixtures.mjs:244) is test-scoped. The first test of a worker spawns the Bridge when none is listening; the later tests connect to it. A per-test stop would respawn a Bridge for every test, so the stop belongs at worker end.
- The fixture is the second Bridge entrypoint, beside the MCP server (
:257). A Bridge the fixture found running belongs to someone else, such as the operator's live :8081 or another seat's, and must not be stopped.
- The fixture ships in the
neo.mjs package. Stage and the Institution import it from node_modules/neo.mjs/test/playwright/fixtures.mjs, so they receive the fix with the Engine version they pin.
The Fix
Move the Bridge lifecycle into a worker-scoped fixture ({scope: 'worker'}) that the test-scoped neuralLink depends on. Once per worker it starts or connects, and records whether this worker spawned the Bridge. After use, it stops only a Bridge it spawned, through the Brain's stop contract, never one it found running. If the witness shows that the Brain's stop leaves the node child alive, the reaping belongs to ConnectionService, which owns the spawn. That gap becomes a Brain leaf with the witness; the fixture does not kill around it.
Acceptance Criteria
Out of Scope
ConnectionService's own stop semantics (a Brain leaf if AC-4 finds a gap).
- Consumers' pin bumps.
- The MCP server's Bridge lifecycle.
Related
neomjs/neo-stage#27 (where the local-testing directive is recorded) · neomjs/neo-stage#145 (the runs that showed it) · neomjs/neo-stage#158 (local test output)
Live latest-open sweep: latest 20 open issues at 2026-10-17T17:56:34Z; no equivalent
A2A claim sweep: last 15 lane-claim messages, all read-states; none on the fixture's Bridge lifecycle
MC sweep / search: gh search issues in neo and neo-agent-brain for "fixture bridge teardown", "spawned bridge outlives", "neuralLink fixture bridge", "orphan bridge port": no results
Own-assignment sweep: #19652, #19765, #19766 (the 13.3 cut), #15000; disjoint
Origin Session ID: caeb11ca-daae-42a2-8924-95229e329df2
Retrieval Hint: "neuralLink Playwright fixture spawned Bridge outlives the run worker-scoped teardown"
Context
defect-note 2026-10-17 17:46Z (fingerprint
7aa4bc2640663fdc). The Neural Link Bridge that the Engine'sneuralLinkPlaywright fixture spawns outlives the run. A Stage e2e run at 17:04Z started its Bridge (npm run ai:server-neural-linkfromNEO_AGENTOS_RUNTIME_ROOT) onNEO_NL_PORT18981; 31 minutes later it was still listening, and the next run found the port taken. The same happened after the 17:3xZ run. Both were stopped by exact PID.With hosted Stage CI off until the Nov 1 reset, authors run the e2e tiers locally on the operator's machine (operator directive, relayed 2026-10-17 16:58Z; local testing is priority zero). Every run leaves a Bridge behind there.
Emmy's source triage (A2A 17:54Z), re-read here:
test/playwright/fixtures.mjs:261starts the Bridge (manageConnection({action: 'start'})), and the fixture ends atawait use(nl)(:861) with nofinallyand no stop.ConnectionService.manageConnectionwithaction: 'stop'kills only its ownbridgeProcess(ai/services/neural-link/ConnectionService.mjs:913–923,bridgeProcess.kill()).npmparent of adetachedspawn (:1037–1039). Whether killing it reaps thenode run-bridge.mjschild is not shown.The Problem
A local e2e run leaves a Bridge process and a bound port per run. A later run on the same port connects to whatever is listening, which can be a Bridge started from another
NEO_AGENTOS_RUNTIME_ROOT, so it may run other Brain code than the run requested. No current spec observes any of this.The Architectural Reality
neuralLink(test/playwright/fixtures.mjs:244) is test-scoped. The first test of a worker spawns the Bridge when none is listening; the later tests connect to it. A per-test stop would respawn a Bridge for every test, so the stop belongs at worker end.:257). A Bridge the fixture found running belongs to someone else, such as the operator's live:8081or another seat's, and must not be stopped.neo.mjspackage. Stage and the Institution import it fromnode_modules/neo.mjs/test/playwright/fixtures.mjs, so they receive the fix with the Engine version they pin.The Fix
Move the Bridge lifecycle into a worker-scoped fixture (
{scope: 'worker'}) that the test-scopedneuralLinkdepends on. Once per worker it starts or connects, and records whether this worker spawned the Bridge. Afteruse, it stops only a Bridge it spawned, through the Brain's stop contract, never one it found running. If the witness shows that the Brain's stop leaves thenodechild alive, the reaping belongs toConnectionService, which owns the spawn. That gap becomes a Brain leaf with the witness; the fixture does not kill around it.Acceptance Criteria
Out of Scope
ConnectionService's own stop semantics (a Brain leaf if AC-4 finds a gap).Related
neomjs/neo-stage#27 (where the local-testing directive is recorded) · neomjs/neo-stage#145 (the runs that showed it) · neomjs/neo-stage#158 (local test output)
Live latest-open sweep: latest 20 open issues at 2026-10-17T17:56:34Z; no equivalent A2A claim sweep: last 15 lane-claim messages, all read-states; none on the fixture's Bridge lifecycle MC sweep / search:
gh search issuesin neo and neo-agent-brain for "fixture bridge teardown", "spawned bridge outlives", "neuralLink fixture bridge", "orphan bridge port": no results Own-assignment sweep: #19652, #19765, #19766 (the 13.3 cut), #15000; disjointOrigin Session ID: caeb11ca-daae-42a2-8924-95229e329df2
Retrieval Hint: "neuralLink Playwright fixture spawned Bridge outlives the run worker-scoped teardown"