LearnNewsExamplesServices
Frontmatter
id19237
titleADR 0034 §2.3.2: the window policy admits the engine''s about:blank staging realm
stateClosed
labels
bugdocumentationaiarchitecture
assigneesneo-opus-grace
createdAtSep 26, 2026, 9:25 AM
updatedAtSep 26, 2026, 10:44 AM
githubUrlhttps://github.com/neomjs/neo/issues/19237
authorneo-opus-grace
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtSep 26, 2026, 10:44 AM

ADR 0034 §2.3.2: the window policy admits the engine's about:blank staging realm

Closed v13.2.0/archive-v13-2-0-chunk-23 bugdocumentationaiarchitecture
neo-opus-grace
neo-opus-grace commented on Sep 26, 2026, 9:25 AM

Context

@tobiu, 2026-09-26: in the Fleet Manager's Electron shell, neither dragging a tab out of the window nor the tab header's pop-out action opens a window. Both work in apps/workstation in Chrome.

The cause is a gap between two contracts that each look correct on their own:

  • The engine. Neo.Main.windowOpen (src/Main.mjs) opens a same-origin popup at about:blank first. It writes the child's one-time route into the blank realm's sessionStorage, then calls location.replace() onto the real URL. Without this, the child's getWindowData() handshake races the write. The staging landed on 2026-07-19 in #15573.
  • The shell. ADR 0034 §2.3.2 lets setWindowOpenHandler allow "only same-origin harness URLs (an explicit origin/path allowlist)", and neomjs/neo-agent-institution's harness/contentPolicy.mjs#isHarnessDocumentUrl implements exactly that. about:blank is not on the list, so the shell denies it. window.open returns null, and windowOpen resolves false. Every vessel admission then refuses by design, silently.

The ADR's falsifier sends a widened window allowlist here first: "it never … widens the window allowlist … as a leaf-local decision".

The Problem

§2.2 C3 names Neo.Main.windowOpen as the owner of the popup's window.open. §2.3.2 then admits only the popup's final document, not the realm the owner actually opens. The shell's own smoke still passes because its popup probe calls window.open(APP_URL) with the final URL and never takes the staged path. It was proven on 2026-07-10, nine days before the staging existed.

The Architectural Reality

  • learn/agentos/decisions/0034-electron-shell-architecture.md §2.2 C3 (the popup row) and §2.3.2 (the fail-closed window policy).
  • src/Main.mjs#windowOpen: window.open(stagedUrl ? 'about:blank' : url, …), then the sessionStorage route write, then location.replace(stagedUrl).
  • harness/main.mjs#configureWebContents (Institution dev@4ce50eb): setWindowOpenHandler → isHarnessDocumentUrl, and will-navigate → isHarnessDocumentUrl. isTrustedIpcSender also requires a harness document, so the preload's capabilities refuse an about:blank sender.

Measured on Electron 43.1.0 (the shell's pin), with a minimal mirror of the shell's handlers and the real contentPolicy.mjs:

  • With today's policy: open-handler url=about:blank → deny, window.open → null.
  • With about:blank admitted: will-navigate fires for the opener's location.replace and admits the widget document, and the child's sessionStorage holds the staged route.
  • A staged realm replaced onto https://example.com/ is prevented by will-navigate and stays blank.

The Fix

Amend §2.3.2, and point the §2.2 C3 popup row at it:

  • The window policy admits exactly one realm that is not a document: about:blank, the staging realm Neo.Main.windowOpen opens before a same-origin popup's route-bearing navigation.
  • That realm carries no content of its own. The preload's capabilities refuse it, because §2.3.4 validates the sender document.
  • Its only exit is will-navigate onto an allowlisted document, which is unchanged.
  • Name the coupling explicitly: the shell's popup admission follows the engine's staging contract, so a change to either one re-reads the other.

Acceptance Criteria

  • §2.3.2 names the about:blank staging admission and its three bounds: no content, capability-refused, and a will-navigate-only exit.
  • The §2.2 C3 popup row says the realm window.open opens is the staging realm, and points at §2.3.2.
  • An amendment line dates the change and cites this ticket and neomjs/neo-agent-institution#229, the implementation.
  • The ADR's §6 Verification stays true, or names the new admission.

Out of Scope

  • The shell change itself: isHarnessPopupUrl, the handler swap, and the smoke going through Neo.Main.windowOpen. That is neomjs/neo-agent-institution#229.
  • Changing the engine's staging. It fixes a real handshake race, and the shell adapts to the engine contract, not the reverse.

Avoided Traps

  • Skipping the staging for Electron in the engine. That reintroduces the connected-but-authority-less popup (#15573), and it puts shell policy inside the Body.
  • Admitting every about: URL. Only about:blank is the staging realm. about:srcdoc and variants of about:blank with a fragment or query stay denied.

Decision Record impact

amends ADR 0034 §2.3.2, plus the §2.2 C3 popup row.

Related

  • #15573 introduced the staging (feat(dashboard): embody live tear-out vessels).
  • #19228 / #19233 are precedent §2.3 amendments for the same shell.

Sweeps: live latest-open sweep over neo + Institution at 2026-09-26T07:24Z (no equivalent); gh search issues --owner neomjs "about:blank" and "tear-out shell" (closed engine tickets only); the MC rationale sweep found no prior decision on admitting about:blank. The A2A in-flight sweep shows only @neo-fable-clio's lane offer for this defect, accepted by me.

Origin Session ID: 81d1894c-d8fd-4192-8350-42e32eb0101e Retrieval Hint: "shell setWindowOpenHandler denies the engine's about:blank staged popup"

tobiu referenced in commit 9079c29 - "docs(adr): ADR-0034 §2.3.2 admits the engine's about:blank staging realm (#19237) (#19240) on Sep 26, 2026, 10:44 AM
tobiu closed this issue on Sep 26, 2026, 10:44 AM