e2e: playwright's video/screencast never covers the ELECTRON surface — the config promises a full visual record a drive does not keep (0 videos, 11 trace frames per run) #687

Closed
opened 2026-08-23 03:57:36 +00:00 by ben · 2 comments
Owner

The gap

app/playwright.config.ts:73-81 states the intent plainly:

// The full visual record (trace/video/screenshots) is kept by DEFAULT —
// green drives included: a drive is a proof whose evidence is the run
// itself ... (Ben's 2026-08-09 ruling; the old default kept visuals only on
// failure, so a passing drive left no footage).
trace:      OC_E2E_CAPTURE === '0' ? 'retain-on-failure' : 'on',
video:      OC_E2E_CAPTURE === '0' ? 'retain-on-failure' : 'on',
screenshot: OC_E2E_CAPTURE === '0' ? 'only-on-failure'   : 'on',

It does not hold for the surface that drives almost the whole journey.
Playwright's video/screenshot/screencast machinery only covers
BrowserContexts Playwright itself creates. The rehearsal journeys drive an
Electron application (ElectronApplication.waitForEvent('window'),
app/tests/e2e/fixtures/ceremony.ts:243) plus CDP-attached pages, and neither
is inside that net. The settings are not wrong, they are simply inert here —
and nothing says so.

Measured, two drives, both at the current default (no OC_E2E_CAPTURE)

drive target video files trace screencast frames
20260823T030519Z droplet 0 11
20260822T160431Z selfhosted 0 7

Eleven frames for a nine-minute, 26-leg run. Those eleven belong to the ONE
throwaway Chromium the branded-login leg launches — the only
Playwright-created context in the journey. Every Electron leg contributes
nothing.

So the actual visual record of a drive is exactly the deliberate
page.screenshot() calls someone remembered to write
, plus Playwright's
end-of-test frames. Nothing else. Per-leg coverage on the droplet journey today:

  • legs 1–16 (connect → finish, the wizard + carrier): no frames at
    all
    , bar one incidental end-of-test capture of the hand-off screen.
  • legs 17–24: three deliberate frames — signed-in.png (17),
    login.png (22), branded-chrome.png (24). Legs 18–21 and 23
    (co-host, deploy-files, files-healthy, door, oidc-admin) have none.

Why this is worth fixing rather than documenting

This is the same class of fault as #658, and #658 is the cost estimate.
That leg was red for two months with no frame of the surface it was
complaining about
— the screenshot was the function's last statement, so no
red ever produced one. The config looked like a safety net underneath that
mistake. There was no net. The first branded-chrome.png in this project's
history was produced yesterday, by bb9c700, by hand.

Sibling: #681 (the drive harness doesn't capture the broker's log). Same
shape — evidence we believed we had.

What a fix could look like (open — the ticket does not rule)

  1. CDP screencast on the Electron window. page.context().newCDPSession(page)
    already exists in ceremony.ts for the WebAuthn virtual authenticator;
    Page.startScreencast would give real footage. Cost: frame handling + disk.
  2. Sampled page.screenshot() on a timer for the life of the drive — much
    cheaper, no CDP, gives a flip-book rather than video.
  3. A per-leg frame in runRecordedLeg/driveLegs — one capture per leg,
    automatic, so a new leg cannot be born frameless and the #658 shape cannot
    recur. Probably the highest value per line changed.
  4. Fail loud instead: if the Electron surface genuinely cannot be recorded,
    make the config say so rather than implying a record it does not keep — the
    honest-machinery rule.

(3) and (4) are not exclusive and are the cheap pair.

Acceptance

  • A green drive leaves visual evidence for every leg that drives a UI, not
    only the legs whose authors remembered to ask.
  • Whatever is not captured is stated at the config, not implied away.
  • OC_E2E_CAPTURE=0 still means "don't keep footage".

Found while auditing what the phase-2 proving drive (#683) actually captured,
after #658 closed. Filed by agent under ADR 0174.

## The gap `app/playwright.config.ts:73-81` states the intent plainly: ``` // The full visual record (trace/video/screenshots) is kept by DEFAULT — // green drives included: a drive is a proof whose evidence is the run // itself ... (Ben's 2026-08-09 ruling; the old default kept visuals only on // failure, so a passing drive left no footage). trace: OC_E2E_CAPTURE === '0' ? 'retain-on-failure' : 'on', video: OC_E2E_CAPTURE === '0' ? 'retain-on-failure' : 'on', screenshot: OC_E2E_CAPTURE === '0' ? 'only-on-failure' : 'on', ``` **It does not hold for the surface that drives almost the whole journey.** Playwright's `video`/`screenshot`/screencast machinery only covers `BrowserContext`s **Playwright itself creates**. The rehearsal journeys drive an **Electron application** (`ElectronApplication.waitForEvent('window')`, `app/tests/e2e/fixtures/ceremony.ts:243`) plus CDP-attached pages, and neither is inside that net. The settings are not wrong, they are simply inert here — and nothing says so. ## Measured, two drives, both at the current default (no `OC_E2E_CAPTURE`) | drive | target | video files | trace screencast frames | |---|---|---:|---:| | `20260823T030519Z` | droplet | **0** | **11** | | `20260822T160431Z` | selfhosted | **0** | **7** | Eleven frames for a nine-minute, 26-leg run. Those eleven belong to the ONE throwaway Chromium the `branded-login` leg launches — the only Playwright-created context in the journey. Every Electron leg contributes nothing. So the actual visual record of a drive is **exactly the deliberate `page.screenshot()` calls someone remembered to write**, plus Playwright's end-of-test frames. Nothing else. Per-leg coverage on the droplet journey today: - legs **1–16** (`connect` → `finish`, the wizard + carrier): **no frames at all**, bar one incidental end-of-test capture of the hand-off screen. - legs **17–24**: three deliberate frames — `signed-in.png` (17), `login.png` (22), `branded-chrome.png` (24). Legs 18–21 and 23 (`co-host`, `deploy-files`, `files-healthy`, `door`, `oidc-admin`) have none. ## Why this is worth fixing rather than documenting This is the same class of fault as **#658**, and #658 is the cost estimate. That leg was red for two months with **no frame of the surface it was complaining about** — the screenshot was the function's last statement, so no red ever produced one. The config looked like a safety net underneath that mistake. There was no net. The first `branded-chrome.png` in this project's history was produced yesterday, by `bb9c700`, by hand. Sibling: **#681** (the drive harness doesn't capture the broker's log). Same shape — evidence we believed we had. ## What a fix could look like (open — the ticket does not rule) 1. **CDP screencast on the Electron window.** `page.context().newCDPSession(page)` already exists in `ceremony.ts` for the WebAuthn virtual authenticator; `Page.startScreencast` would give real footage. Cost: frame handling + disk. 2. **Sampled `page.screenshot()`** on a timer for the life of the drive — much cheaper, no CDP, gives a flip-book rather than video. 3. **A per-leg frame in `runRecordedLeg`/`driveLegs`** — one capture per leg, automatic, so a new leg cannot be born frameless and the #658 shape cannot recur. Probably the highest value per line changed. 4. **Fail loud instead:** if the Electron surface genuinely cannot be recorded, make the config say so rather than implying a record it does not keep — the honest-machinery rule. (3) and (4) are not exclusive and are the cheap pair. ## Acceptance - A green drive leaves visual evidence for **every** leg that drives a UI, not only the legs whose authors remembered to ask. - Whatever is not captured is **stated** at the config, not implied away. - `OC_E2E_CAPTURE=0` still means "don't keep footage". Found while auditing what the phase-2 proving drive (#683) actually captured, after #658 closed. Filed by agent under ADR 0174.

swarm-claim host=elitebook-distributed-server-03 run=9104
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=9104 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #687 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 687,
  "status": "success",
  "commits": [
    "e05a562"
  ],
  "changed_files": [
    "STATUS.md",
    "app/playwright.config.ts",
    "app/tests/e2e/fixtures/legs.ts",
    "app/tests/e2e/fixtures/legs.test.ts",
    "app/tests/e2e/fixtures/legframe.ts",
    "app/tests/e2e/fixtures/legframe.test.ts",
    "app/tests/e2e/journey.droplet.spec.ts",
    "app/tests/e2e/journey.selfhosted.spec.ts",
    "app/tests/e2e/journey.rented.spec.ts"
  ],
  "tests": [
    {
      "command": "npx vitest run tests/e2e/fixtures/legs.test.ts tests/e2e/fixtures/legframe.test.ts",
      "exit_code": 0
    },
    {
      "command": "npx vue-tsc --noEmit -p tsconfig.json",
      "exit_code": 0
    }
  ],
  "criteria": {
    "A green drive leaves visual evidence for every leg that drives a UI, not only the legs whose authors remembered to ask": "fixtures/legframe.ts appWindowCapturer screenshots every open Electron window into artifacts/legs/ at each leg settle; wired via legs.ts runRecordedLeg/driveLegs (fired automatically on green AND red) and installLegCapture in all three journey specs — a new leg cannot be born frameless. Seam-proven by legs.test.ts 'per-leg capture (#687)' (fires with the leg name on green and red paths; driveLegs fires per drivable leg, never for a skip).",
    "Whatever is not captured is stated at the config, not implied away": "app/playwright.config.ts comment now states the ELECTRON honesty limit (video/screencast cover only Playwright-created BrowserContexts, not the Electron surface) and points at fixtures/legframe.ts as the record that does cover it.",
    "OC_E2E_CAPTURE=0 still means don't keep footage": "appWindowCapturer returns early when OC_E2E_CAPTURE==='0'; the config's trace/video/screenshot retain-on-failure/only-on-failure branches are unchanged."
  },
  "summary": "Added a per-drive Electron-window capturer that writes a frame per leg (green and red) into artifacts/legs/, and made playwright.config.ts state the Electron surface it never filmed.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #687 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 687, "status": "success", "commits": [ "e05a562" ], "changed_files": [ "STATUS.md", "app/playwright.config.ts", "app/tests/e2e/fixtures/legs.ts", "app/tests/e2e/fixtures/legs.test.ts", "app/tests/e2e/fixtures/legframe.ts", "app/tests/e2e/fixtures/legframe.test.ts", "app/tests/e2e/journey.droplet.spec.ts", "app/tests/e2e/journey.selfhosted.spec.ts", "app/tests/e2e/journey.rented.spec.ts" ], "tests": [ { "command": "npx vitest run tests/e2e/fixtures/legs.test.ts tests/e2e/fixtures/legframe.test.ts", "exit_code": 0 }, { "command": "npx vue-tsc --noEmit -p tsconfig.json", "exit_code": 0 } ], "criteria": { "A green drive leaves visual evidence for every leg that drives a UI, not only the legs whose authors remembered to ask": "fixtures/legframe.ts appWindowCapturer screenshots every open Electron window into artifacts/legs/ at each leg settle; wired via legs.ts runRecordedLeg/driveLegs (fired automatically on green AND red) and installLegCapture in all three journey specs — a new leg cannot be born frameless. Seam-proven by legs.test.ts 'per-leg capture (#687)' (fires with the leg name on green and red paths; driveLegs fires per drivable leg, never for a skip).", "Whatever is not captured is stated at the config, not implied away": "app/playwright.config.ts comment now states the ELECTRON honesty limit (video/screencast cover only Playwright-created BrowserContexts, not the Electron surface) and points at fixtures/legframe.ts as the record that does cover it.", "OC_E2E_CAPTURE=0 still means don't keep footage": "appWindowCapturer returns early when OC_E2E_CAPTURE==='0'; the config's trace/video/screenshot retain-on-failure/only-on-failure branches are unchanged." }, "summary": "Added a per-drive Electron-window capturer that writes a frame per leg (green and red) into artifacts/legs/, and made playwright.config.ts state the Electron surface it never filmed.", "reason": "", "blockers": [], "no_code_change": "" } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/idss#687
No description provided.