Context
The real #19569 restored-stack return logged DragZone: proxy removal delta failed with PortDisconnectedError just after its popup closed. A zero-file-change probe at f502257a3a independently dispatched a real WorkerBase.promiseMessage(), retired its target port and observed the same classification failure. Grace independently verified the emitter and found no open owner.
The Problem
removePort() records the window departure before rejecting pending requests, but the emitted error has only name: 'PortDisconnectedError'. Its code and windowId are absent. The existing shared isDeparture() therefore returns false even though the actual target departure is recorded. The unhandled boundary mirrored this rejection once instead of settling it as expected teardown.
A request sent after departure already carries the typed dead-port metadata and classifies correctly. The missing case is a request that was dispatched before the port retired.
The Architectural Reality
Design authority: src/worker/Base.mjs#isDeparture states “Both halves, always”: NEO_DEAD_PORT plus recorded target departure. #19071 established that predicate; its completed scope did not cover this emitter. The merged #19536 / closed #19535 repair handles a specific Workstation repaint consumer by error name, leaving the shared emitter unchanged.
removePort owns the pending-request rejection. DragZone, Viewport, grid/table bodies and other shared-predicate consumers should receive the same existing departure contract. Name-based handlers in Neo.mjs, VdomLifecycle and worker/App.mjs still need the existing error name.
Prescription checked: src/worker/Base.mjs#removePort owns the concern. No new consumer predicate or teardown wait is needed.
The Fix
Add code: 'NEO_DEAD_PORT' and the retired port's windowId to its in-flight rejection, retaining PortDisconnectedError and the existing message. Keep pending-map deletion, exact port-generation ownership and the recorded-departure predicate unchanged.
Contract Ledger
| Surface |
Authority |
Behavior / fallback |
Docs |
Evidence |
WorkerBase.removePort rejection |
Existing typed departure contract / #19071 |
In-flight retired-window requests expose code and target identity; error name/message remain compatible. Non-window ports acquire no departure evidence. |
Owning JSDoc |
Real dispatched window and channel requests, then exact port retirement. |
WorkerBase.isDeparture and unhandled settlement |
Existing two-halves JSDoc |
Recorded target departure settles silently; ordinary, unknown or foreign-window failures remain visible. Predicate unchanged. |
Existing JSDoc |
Actual emitted reason plus negative controls and unhandled-boundary observation. |
| Generation fencing |
Existing ReplyLoss contract |
A retired/foreign port does not reject a successor request or admit its stale reply. |
Existing source |
Existing successor tests and focused regression. |
Decision Record impact: none — restores the existing transport terminal; no new architecture or configuration.
Acceptance Criteria
Out of Scope
No broad suppression by error name, new waits, changed departure retention, consumer predicate proliferation, or retirement-policy change. The film choreography and headed placement remain #19569. No hosted quarantine is retired under this ticket.
Related
#19071 · #18741 · #19535 · #19569 · #19655
MC sweep: pending render / popup closure / in-flight departure queries surfaced the prior #19536 review and the current #19569 diagnosis; live #19536 is merged and consumer-specific. Own-assignment sweep: four open; #19569 and #17844 bodies read, neither owns this shared emitter repair. Live latest-open sweep: checked20 newest open issues at 2026-10-13 19:48:32 UTC; no equivalent. Fresh open PR search found none. In-flight mailbox sweep: latest30 messages in all read states, no competing claim; Grace explicitly declined implementation.
Origin Session ID: c8bb5531-a290-4eb2-af1a-6623deffda27
Retrieval Hint: “removePort in-flight PortDisconnectedError missing departure identity isDeparture”
Context
The real #19569 restored-stack return logged
DragZone: proxy removal delta failedwithPortDisconnectedErrorjust after its popup closed. A zero-file-change probe atf502257a3aindependently dispatched a realWorkerBase.promiseMessage(), retired its target port and observed the same classification failure. Grace independently verified the emitter and found no open owner.The Problem
removePort()records the window departure before rejecting pending requests, but the emitted error has onlyname: 'PortDisconnectedError'. ItscodeandwindowIdare absent. The existing sharedisDeparture()therefore returns false even though the actual target departure is recorded. The unhandled boundary mirrored this rejection once instead of settling it as expected teardown.A request sent after departure already carries the typed dead-port metadata and classifies correctly. The missing case is a request that was dispatched before the port retired.
The Architectural Reality
Design authority:
src/worker/Base.mjs#isDeparturestates “Both halves, always”:NEO_DEAD_PORTplus recorded target departure. #19071 established that predicate; its completed scope did not cover this emitter. The merged #19536 / closed #19535 repair handles a specific Workstation repaint consumer by error name, leaving the shared emitter unchanged.removePortowns the pending-request rejection.DragZone,Viewport, grid/table bodies and other shared-predicate consumers should receive the same existing departure contract. Name-based handlers inNeo.mjs,VdomLifecycleandworker/App.mjsstill need the existing error name.Prescription checked:
src/worker/Base.mjs#removePortowns the concern. No new consumer predicate or teardown wait is needed.The Fix
Add
code: 'NEO_DEAD_PORT'and the retired port'swindowIdto its in-flight rejection, retainingPortDisconnectedErrorand the existing message. Keep pending-map deletion, exact port-generation ownership and the recorded-departure predicate unchanged.Contract Ledger
WorkerBase.removePortrejectionWorkerBase.isDepartureand unhandled settlementReplyLosscontractDecision Record impact: none — restores the existing transport terminal; no new architecture or configuration.
Acceptance Criteria
removePortcarries the existing error name/message,NEO_DEAD_PORT, and exact target window ID; its pending entry is deleted.DragZonecleanup consumer control cover the repair.Out of Scope
No broad suppression by error name, new waits, changed departure retention, consumer predicate proliferation, or retirement-policy change. The film choreography and headed placement remain #19569. No hosted quarantine is retired under this ticket.
Related
#19071 · #18741 · #19535 · #19569 · #19655
MC sweep: pending render / popup closure / in-flight departure queries surfaced the prior #19536 review and the current #19569 diagnosis; live #19536 is merged and consumer-specific. Own-assignment sweep: four open; #19569 and #17844 bodies read, neither owns this shared emitter repair. Live latest-open sweep: checked20 newest open issues at 2026-10-13 19:48:32 UTC; no equivalent. Fresh open PR search found none. In-flight mailbox sweep: latest30 messages in all read states, no competing claim; Grace explicitly declined implementation.
Origin Session ID: c8bb5531-a290-4eb2-af1a-6623deffda27 Retrieval Hint: “removePort in-flight PortDisconnectedError missing departure identity isDeparture”