Context
Serves: #17844 — surfaced by the first execution of the gated Neural Link battery. This is one of the defects that battery exists to find, filed as its own leaf rather than left in a census comment.
The Problem
apps/workstation/view/Workspace.mjs:3291 calls a symbol the module never imports:
let descriptor = PreviewContract.previewToOperation(finalPreview),
expectedResult = descriptor && Operations.applyOperation(
WorkspaceDocument.clone(documentBefore),
descriptor
);grep -c "import PreviewContract" apps/workstation/view/Workspace.mjs → 0. Every sibling it sits beside is imported explicitly (Operations, WorkspaceDocument, DockPreview, …); this one is not. The class exists and is healthy — src/dashboard/dock/model/PreviewContract.mjs, export default Neo.setupClass(PreviewContract), imported and exercised by src/dashboard/dock/window/Participation.mjs, interaction/DropIndicators.mjs and the passing unit spec test/playwright/unit/dashboard/DockPreview.spec.mjs.
So this is not a rename, a retirement, or a broken module. It is a missing import in the consumer, and it throws a bare ReferenceError the moment that path executes.
The Architectural Reality
The observed failure, from the battery:
cue errors must be empty: {"applied":false,"errors":["PreviewContract is not defined"]}The cue reports applied: false and carries the ReferenceError as a string, so the failure surfaces as a cue contract violation rather than as a crash — which is why it reads like a policy problem at first glance. It is not: the operation descriptor is never produced, so nothing downstream can apply.
Blast radius, measured across the battery run at dev@a57ffbe717: eight spec files reach this line.
DockSplitterZoneIdNL · WorkstationCrossZoneCueNL · WorkstationDockFlipResizeNL · WorkstationDockSplitChromeNL · WorkstationEdgeSplitterNL · WorkstationFiveBeatNL · WorkstationSplitterGridGeometryNL · WorkstationStarvedTourNL
Why nothing reported it. All eight are *NL specs, testIgnored by playwright.config.e2e.mjs whenever NEO_AGENTOS_RUNTIME_ROOT is unset — which it is in CI. Zero matched specs reads as a pass. The flagship application has been carrying a live ReferenceError on a real interaction path with no surface able to report it.
Independent corroboration: @neo-opus-vega hit the identical signature from a different Brain checkout while working #18460, and read it as a missing import before I did. Her diagnosis is the one this ticket adopts.
The Fix
Add the missing import to apps/workstation/view/Workspace.mjs, matching the file's existing alignment:
import PreviewContract from '../../../src/dashboard/dock/model/PreviewContract.mjs';
One line. No engine change, no contract change, no behavioural design decision — the call site already states the intended contract and PreviewContract.previewToOperation already implements it.
Contract Ledger Matrix
| Target Surface |
Source of Authority |
Proposed Behavior |
Fallback |
Docs |
Evidence |
apps/workstation/view/Workspace.mjs import block |
the call site at :3291 |
resolves PreviewContract at module scope |
none — absence is the defect |
none needed |
grep -c "import PreviewContract" → 0 before, 1 after |
PreviewContract.previewToOperation |
src/dashboard/dock/model/PreviewContract.mjs |
unchanged |
unchanged |
unchanged |
imported by Participation.mjs, DropIndicators.mjs, passing unit spec |
Decision Record impact
none.
Acceptance Criteria
Out of Scope
- The other failures the battery found. #17844 owns the census; this ticket owns one defect.
- Making the gate fail loud when
NEO_AGENTOS_RUNTIME_ROOT is unset — that is an AC on #17844.
- Any
apps/workstation decomposition. #18456 and its leaves own that entrypoint's shape; this changes one import line and must not drift into it.
Avoided Traps
- Treating it as an engine defect. The signature reads like a dock-preview contract failure, and
PreviewContract is an engine class — but the engine module is imported and exercised elsewhere and is not at fault. The consumer is.
- Absorbing it into #17844. A census that also carries fixes stops being a census; the count and the repairs need separate authority.
- Reading
applied: false as policy. The cue reports a contract violation because it stringifies the ReferenceError into its errors array. The proximate cause is a missing symbol, not a refused operation.
Related
- #17844 (the battery that surfaced it), #18456 / #18460 (@neo-opus-vega hit the same signature while working the Workstation consumer epic), #18304 (engine-side dock ownership)
Origin Session ID: 0692d99a-6b58-4de2-aa51-e7d10f3f80d4
Retrieval Hint: grep -n 'PreviewContract' apps/workstation/view/Workspace.mjs; query_raw_memories — "PreviewContract is not defined missing import workstation cue".
Context
Serves:#17844 — surfaced by the first execution of the gated Neural Link battery. This is one of the defects that battery exists to find, filed as its own leaf rather than left in a census comment.The Problem
apps/workstation/view/Workspace.mjs:3291calls a symbol the module never imports:let descriptor = PreviewContract.previewToOperation(finalPreview), expectedResult = descriptor && Operations.applyOperation( WorkspaceDocument.clone(documentBefore), descriptor );grep -c "import PreviewContract" apps/workstation/view/Workspace.mjs→ 0. Every sibling it sits beside is imported explicitly (Operations,WorkspaceDocument,DockPreview, …); this one is not. The class exists and is healthy —src/dashboard/dock/model/PreviewContract.mjs,export default Neo.setupClass(PreviewContract), imported and exercised bysrc/dashboard/dock/window/Participation.mjs,interaction/DropIndicators.mjsand the passing unit spectest/playwright/unit/dashboard/DockPreview.spec.mjs.So this is not a rename, a retirement, or a broken module. It is a missing import in the consumer, and it throws a bare
ReferenceErrorthe moment that path executes.The Architectural Reality
The observed failure, from the battery:
cue errors must be empty: {"applied":false,"errors":["PreviewContract is not defined"]}The cue reports
applied: falseand carries the ReferenceError as a string, so the failure surfaces as a cue contract violation rather than as a crash — which is why it reads like a policy problem at first glance. It is not: the operation descriptor is never produced, so nothing downstream can apply.Blast radius, measured across the battery run at
dev@a57ffbe717: eight spec files reach this line.DockSplitterZoneIdNL·WorkstationCrossZoneCueNL·WorkstationDockFlipResizeNL·WorkstationDockSplitChromeNL·WorkstationEdgeSplitterNL·WorkstationFiveBeatNL·WorkstationSplitterGridGeometryNL·WorkstationStarvedTourNLWhy nothing reported it. All eight are
*NLspecs,testIgnored byplaywright.config.e2e.mjswheneverNEO_AGENTOS_RUNTIME_ROOTis unset — which it is in CI. Zero matched specs reads as a pass. The flagship application has been carrying a liveReferenceErroron a real interaction path with no surface able to report it.Independent corroboration: @neo-opus-vega hit the identical signature from a different Brain checkout while working #18460, and read it as a missing import before I did. Her diagnosis is the one this ticket adopts.
The Fix
Add the missing import to
apps/workstation/view/Workspace.mjs, matching the file's existing alignment:import PreviewContract from '../../../src/dashboard/dock/model/PreviewContract.mjs';One line. No engine change, no contract change, no behavioural design decision — the call site already states the intended contract and
PreviewContract.previewToOperationalready implements it.Contract Ledger Matrix
apps/workstation/view/Workspace.mjsimport block:3291PreviewContractat module scopegrep -c "import PreviewContract"→ 0 before, 1 afterPreviewContract.previewToOperationsrc/dashboard/dock/model/PreviewContract.mjsParticipation.mjs,DropIndicators.mjs, passing unit specDecision Record impact
none.Acceptance Criteria
apps/workstation/view/Workspace.mjsimportsPreviewContract;grep -creturns 1.WorkstationCrossZoneCueNLfails witherrors: ["PreviewContract is not defined"]before the change and passes after, both withNEO_AGENTOS_RUNTIME_ROOTset. The red arm is the receipt that the import is load-bearing rather than cosmetic.dist/developmentbuild state. A number without them is not a receipt (see #17844 — the same battery gave 51 and 57 under two configurations).Out of Scope
NEO_AGENTOS_RUNTIME_ROOTis unset — that is an AC on #17844.apps/workstationdecomposition. #18456 and its leaves own that entrypoint's shape; this changes one import line and must not drift into it.Avoided Traps
PreviewContractis an engine class — but the engine module is imported and exercised elsewhere and is not at fault. The consumer is.applied: falseas policy. The cue reports a contract violation because it stringifies the ReferenceError into itserrorsarray. The proximate cause is a missing symbol, not a refused operation.Related
Origin Session ID: 0692d99a-6b58-4de2-aa51-e7d10f3f80d4
Retrieval Hint:
grep -n 'PreviewContract' apps/workstation/view/Workspace.mjs;query_raw_memories— "PreviewContract is not defined missing import workstation cue".