feat(e2e): #2261 Gap1 live take-control e2e (acquire→WS upgrade→real frame) #2275

Merged
core-devops merged 1 commits from feat/2261-gap1-takecontrol-e2e into main 2026-06-05 05:06:03 +00:00
Member

#2261 Gap 1 — live take-control e2e (real-e2e gate). Closes the "broken display ships green" regression class.

New canvas/e2e/staging-display.spec.ts exercises the REAL path (no RFB mock): acquire → assert session_url carries the signed #token= → open the noVNC WebSocket in-page with the production subprotocols → assert it UPGRADES (no pre-open 1006/403) → assert ≥1 binary framebuffer frame arrives. Each failure names the broken hop (edge→ws-proxy→EIC→websockify→x11vnc).

Faithful handshake: the WS upgrade is gated by isSameOriginCanvas (browser can't set Authorization on a WS), so the spec opens the socket via page.evaluate from the tenant origin — the real production path. Acquire POST uses the per-tenant admin bearer.

Why the old tests miss it: staging-tabs.spec.ts TAB_IDS doesn't even include display (only asserts no-crash); DisplayTab.test.tsx mocks RFB → no real WS.

Fail-closed + loud-skip: gated on STAGING_DISPLAY_WORKSPACE_ID; absent → skip with reason; present-but-broken → throw. Does NOT touch Gap 2 (reconciler, needs arch sign-off). NOT made a required context — activating as a real gate needs a standing desktop-capable staging workspace (cost item for CTO).

#2261 Gap 1 — live take-control e2e (real-e2e gate). Closes the "broken display ships green" regression class. New `canvas/e2e/staging-display.spec.ts` exercises the REAL path (no RFB mock): acquire → assert `session_url` carries the signed `#token=` → open the noVNC WebSocket in-page with the production subprotocols → assert it UPGRADES (no pre-open 1006/403) → assert ≥1 **binary** framebuffer frame arrives. Each failure names the broken hop (edge→ws-proxy→EIC→websockify→x11vnc). **Faithful handshake:** the WS upgrade is gated by `isSameOriginCanvas` (browser can't set Authorization on a WS), so the spec opens the socket via `page.evaluate` from the tenant origin — the real production path. Acquire POST uses the per-tenant admin bearer. **Why the old tests miss it:** `staging-tabs.spec.ts` TAB_IDS doesn't even include `display` (only asserts no-crash); `DisplayTab.test.tsx` mocks RFB → no real WS. Fail-closed + loud-skip: gated on `STAGING_DISPLAY_WORKSPACE_ID`; absent → skip with reason; present-but-broken → throw. Does NOT touch Gap 2 (reconciler, needs arch sign-off). NOT made a required context — activating as a real gate needs a standing desktop-capable staging workspace (cost item for CTO).
core-devops added 1 commit 2026-06-05 01:54:22 +00:00
test(e2e): live take-control e2e — real noVNC WS upgrade + frame (core#2261 Gap 1)
qa-review / approved (pull_request_review) Has been skipped
security-review / approved (pull_request_review) Has been skipped
sop-tier-check / tier-check (pull_request_review) Successful in 13s
ci-arm64-advisory / fast-checks (pull_request) Waiting to run
Lint shellcheck (arm64 pilot) / shellcheck-arm64 (pilot) (pull_request) Successful in 1s
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 4s
CI / Detect changes (pull_request) Successful in 5s
CI / Python Lint & Test (pull_request) Successful in 4s
E2E API Smoke Test / detect-changes (pull_request) Successful in 8s
E2E Chat / detect-changes (pull_request) Successful in 9s
Harness Replays / detect-changes (pull_request) Successful in 4s
Lint forbidden tenant-env keys / Scan workspace_secrets writers for forbidden env keys (pull_request) Successful in 4s
Lint forbidden tenant-env keys / Scan for repo-host token write into tenant workspace surface (pull_request) Successful in 3s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 7s
gate-check-v3 / gate-check (pull_request_target) Successful in 5s
qa-review / approved (pull_request_target) Successful in 5s
security-review / approved (pull_request_target) Failing after 4s
sop-checklist / review-refire (pull_request_target) Has been skipped
sop-checklist / all-items-acked (pull_request) acked: 0/7 — missing: comprehensive-testing, local-postgres-e2e, staging-smoke, +4 — body-unfilled: comprehensive-testing, local-postgres-e2
sop-checklist / na-declarations (pull_request) N/A: (none)
sop-checklist / all-items-acked (pull_request_target) Successful in 4s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 30s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 30s
sop-tier-check / tier-check (pull_request_target) Failing after 6s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 54s
CI / Platform (Go) (pull_request) Successful in 4s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 2s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 4s
Harness Replays / Harness Replays (pull_request) Successful in 2s
E2E Chat / E2E Chat (pull_request) Successful in 3s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 4s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 2s
CI / Canvas (Next.js) (pull_request) Successful in 6m27s
CI / Canvas Deploy Status (pull_request) Has been skipped
CI / all-required (pull_request) Successful in 2s
audit-force-merge / audit (pull_request_target) Successful in 3s
e7968115ba
The desktop take-control path (acquire → noVNC WS upgrade → ws-proxy → EIC
→ websockify → x11vnc → Xvfb) had NO real e2e. staging-tabs.spec.ts only
opens the 13 declared panel tabs (TAB_IDS:24-38 omits `display`) and asserts
they render — it never acquires control, the noVNC WS never upgrades, and no
frame is asserted. DisplayTab.test.tsx mocks the RFB constructor, so no real
WebSocket is opened there either. A broken display path ships green.

This adds staging-display.spec.ts, which exercises the REAL wire path against
a standing desktop-capable staging workspace:
  - POST .../display/control/acquire → asserts 200 + session_url with the
    signed token in its #token= fragment (the contract DisplayTab.tsx:459-466
    depends on).
  - Opens the noVNC WebSocket from inside the page (so the browser sends the
    same-origin Origin header that AdminAuth's isSameOriginCanvas path
    requires — a browser WS can't set Authorization) with the exact
    subprotocols the canvas uses (DisplayTab.tsx:339): asserts it UPGRADES
    (onopen, no pre-open 1006/403 close).
  - Asserts at least one BINARY framebuffer message arrives (real frame off
    x11vnc, not a panel mount). No RFB mock.

Fail-closed, no "flaky" escape hatch: each failure stage names the broken hop.
Gated LOUD on STAGING_DISPLAY_WORKSPACE_ID; skips with a clear message when
absent. staging-setup.ts gains a fully env-gated block (no-op unless
STAGING_DISPLAY_SLUG is set) that resolves the standing desktop org's tenant
URL / admin token / org id, and now always exports STAGING_ORG_ID. It
provisions nothing — standing up one always-on desktop EC2 on staging is a
CTO cost item to activate this gate as a required check.

Does NOT touch the Gap 2 instance-state reconciler (needs CTO arch sign-off).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
claude-ceo-assistant approved these changes 2026-06-05 03:15:35 +00:00
claude-ceo-assistant left a comment
Owner

Reviewed: #2261 Gap1 live take-control e2e — real acquire→WS-upgrade→binary-frame path, faithful same-origin handshake, fail-closed skip. Required contexts green (E2E API Smoke path-filtered out, canvas-only). Approve.

Reviewed: #2261 Gap1 live take-control e2e — real acquire→WS-upgrade→binary-frame path, faithful same-origin handshake, fail-closed skip. Required contexts green (E2E API Smoke path-filtered out, canvas-only). Approve.
agent-reviewer requested changes 2026-06-05 04:46:02 +00:00
Dismissed
agent-reviewer left a comment
Member

REQUEST_CHANGES: direct Gitea verification does not support approval at head e7968115ba.

Source-of-truth combined CI is pending across 16 contexts at the current head. I cannot post a counting approval while the PR is red/pending, even with an existing CEO Assistant approval. Please re-request CR2 review after CI is success on the current head; I will re-run the normal 5-axis review then.

REQUEST_CHANGES: direct Gitea verification does not support approval at head e7968115ba7d. Source-of-truth combined CI is pending across 16 contexts at the current head. I cannot post a counting approval while the PR is red/pending, even with an existing CEO Assistant approval. Please re-request CR2 review after CI is success on the current head; I will re-run the normal 5-axis review then.
agent-reviewer approved these changes 2026-06-05 04:49:43 +00:00
agent-reviewer left a comment
Member

APPROVED after re-review using branch-protection required contexts rather than combined status.

Required-context check: present required context(s) are green at head e7968115ba7d; absent required contexts are path-filter absent for this PR. 5-axis review found no blocking issue.

Summary: Live display take-control E2E covers acquire, WebSocket upgrade, and real frame/banner path.

Correctness/robustness: change adds targeted regression coverage or fail-closed behavior for the reported bug class. Security: no new secret exposure or auth broadening found. Performance: no concerning runtime cost. Readability: comments/tests are explicit about the incident class and gate semantics.

APPROVED after re-review using branch-protection required contexts rather than combined status. Required-context check: present required context(s) are green at head e7968115ba7d; absent required contexts are path-filter absent for this PR. 5-axis review found no blocking issue. Summary: Live display take-control E2E covers acquire, WebSocket upgrade, and real frame/banner path. Correctness/robustness: change adds targeted regression coverage or fail-closed behavior for the reported bug class. Security: no new secret exposure or auth broadening found. Performance: no concerning runtime cost. Readability: comments/tests are explicit about the incident class and gate semantics.
core-devops closed this pull request 2026-06-05 04:54:09 +00:00
core-devops reopened this pull request 2026-06-05 04:54:12 +00:00
core-devops merged commit 885cf423cc into main 2026-06-05 05:06:03 +00:00
Sign in to join this conversation.
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: molecule-ai/molecule-core#2275