Part of #20370 (linked natively); graduated from D#18775, option G. Blocked by the seam leaf, which provides the test entry.
Context
With the test entry in place, the whitebox fixture still reaches the API only through a Bridge. This leaf gives it a second path: dispatch to the page's own dedicated App Worker, with no Brain checkout and no socket.
The Architectural Reality
test/playwright/fixtures.mjs provides the neuralLink fixture, which throws unless NEO_AGENTOS_RUNTIME_ROOT names a Brain checkout.
test/playwright/e2e/core/AiClientLateBridge.spec.mjs already captures and evaluates the page's App Worker: the precedent for addressing.
- Binding by app name went wrong once:
waitForSession(appName) returned the oldest same-name session (#19713, fixed by #19715 in the fixture). The adapter keeps its own worker handle and never looks an app up by name.
Client#handleAgentDisconnected (src/ai/Client.mjs:272) releases the writer's locks and sweeps its transactions, keyed on the full pair.
The Fix
- A harness-owned adapter in the test tree (never
src/main/addon/): boots the page with the test flag, captures its dedicated App Worker, and calls the test entry.
- Each test gets a fresh fixture-minted
{agentId, sessionId} pair. Fixture teardown ends that pair through handleAgentDisconnected, including when the test throws.
- The fixture picks the adapter when no Brain checkout is configured; with
NEO_AGENTOS_RUNTIME_ROOT set, the Bridge path is unchanged.
Discussion Criteria Mapping & Leaf Slice
Option G (dedicated worker first, no app-name search), OQ6's mechanism (the spec is in the contract-specs leaf), and STEP_BACK point 3. No binding inventory belongs to this leaf.
Acceptance Criteria
Out of Scope
The contract specs, CI selection, SharedWorker apps (residual leaf), and any production main-thread API.
Decision Record
Decision Record: Not needed (D#18775).
unowned-rationale: blocked by the seam leaf; any peer claims it once that lands, and the epic's steward (Vega) reviews.
Origin Session ID: 0c8e30ea-3ef2-41c6-9d56-139ec7d52392
Retrieval Hint: "neuralLink fixture dedicated App Worker adapter off-socket dispatch"
Part of #20370 (linked natively); graduated from D#18775, option G. Blocked by the seam leaf, which provides the test entry.
Context
With the test entry in place, the whitebox fixture still reaches the API only through a Bridge. This leaf gives it a second path: dispatch to the page's own dedicated App Worker, with no Brain checkout and no socket.
The Architectural Reality
test/playwright/fixtures.mjsprovides theneuralLinkfixture, which throws unlessNEO_AGENTOS_RUNTIME_ROOTnames a Brain checkout.test/playwright/e2e/core/AiClientLateBridge.spec.mjsalready captures and evaluates the page's App Worker: the precedent for addressing.waitForSession(appName)returned the oldest same-name session (#19713, fixed by #19715 in the fixture). The adapter keeps its own worker handle and never looks an app up by name.Client#handleAgentDisconnected(src/ai/Client.mjs:272) releases the writer's locks and sweeps its transactions, keyed on the full pair.The Fix
src/main/addon/): boots the page with the test flag, captures its dedicated App Worker, and calls the test entry.{agentId, sessionId}pair. Fixture teardown ends that pair throughhandleAgentDisconnected, including when the test throws.NEO_AGENTOS_RUNTIME_ROOTset, the Bridge path is unchanged.Discussion Criteria Mapping & Leaf Slice
Option G (dedicated worker first, no app-name search), OQ6's mechanism (the spec is in the contract-specs leaf), and STEP_BACK point 3. No binding inventory belongs to this leaf.
Acceptance Criteria
NEO_AGENTOS_RUNTIME_ROOT, a spec against a real source app on a dedicated worker reads and writes through the adapter, and the page opens no WebSocket.handleAgentDisconnectedeven when the test throws.NEO_AGENTOS_RUNTIME_ROOTset behave unchanged.learn/guides/testing/WhiteboxE2E.mdsays which path a run takes and how to choose it.Out of Scope
The contract specs, CI selection, SharedWorker apps (residual leaf), and any production main-thread API.
Decision Record
Decision Record:Not needed (D#18775).unowned-rationale: blocked by the seam leaf; any peer claims it once that lands, and the epic's steward (Vega) reviews.
Origin Session ID: 0c8e30ea-3ef2-41c6-9d56-139ec7d52392
Retrieval Hint: "neuralLink fixture dedicated App Worker adapter off-socket dispatch"