[PR #614] [MERGED] fix(browser): capture popup network and report early event gaps #2114

Closed
opened 2026-10-16 21:14:26 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/614
Author: @N0zoM1z0
Created: 10/5/2026
Status: ✅ Merged
Merged: 10/5/2026
Merged by: @morluto

Base: main ← Head: fix/browser-popup-event-coverage


📝 Commits (10+)

  • bb6481c fix(browser): capture selected events in popup pages
  • 63cbddb Merge commit 'bb6481c54c' into fix/browser-popup-event-coverage
  • fd5f225 fix(browser): capture popup network and report early event gaps
  • a78749f Merge remote-tracking branch 'origin/main' into fix/browser-popup-event-coverage
  • a5115f4 fix(browser): deduplicate owned popup discovery
  • f992754 Merge remote-tracking branch 'origin/main' into fix/browser-popup-event-coverage
  • b745775 test(browser): group popup selection coverage with the scenario event suite
  • bb8b4c0 test(browser): verify popup evidence through CLI and MCP
  • 11a34eb Merge commit 'b74577555b' into fix/browser-popup-event-coverage
  • 408fbb7 fix(browser): expose shared-context event coverage limits

📊 Changes

8 files changed (+366 additions, -10 deletions)

View changed files

📝 docs/browser-scenario-contract.md (+17 -0)
➕ scripts/lib/browser-popup-e2e.mjs (+252 -0)
📝 scripts/verify-real-browser.mjs (+3 -0)
📝 src/browser/BrowserScenarioSessionPort.ts (+2 -0)
📝 src/browser/PlaywrightBrowserScenarioProvider.test.ts (+23 -0)
📝 src/browser/PlaywrightBrowserScenarioProvider.ts (+2 -0)
📝 src/browser/PlaywrightScenarioEvents.ts (+60 -10)
📝 src/browser/PlaywrightScenarioSession.ts (+7 -0)

📄 Description

Changes

Follow-up to the now-merged #600. Latest main is incorporated, including its popup-selection test organization and subsequent PNG/ZIP fixes. The only merge conflict was the discovery comment; the resolution describes both owned-context and opener discovery accurately.

  • Capture network events at BrowserContext before navigation in a wholly owned launch context. Popup initial document requests, redirects, responses, and nested popup requests are retained exactly once.
  • In a shared connected context, retain only requests whose frames belong to the root or discovered descendant Pages. Initial requests without a frame cannot be safely attributed and are omitted; connect captures remain incomplete.
  • Observe owned context Page discovery and deduplicate it against opener popup discovery. Keep popup lifecycle emission selection-controlled.
  • Report unrecoverable pre-discovery frame/worker/WebSocket/download gaps in limitations, mark events missing, and disable equality eligibility. Do not synthesize navigation history from the current URL.
  • Add actual Chromium regressions to the existing verify:browser lane, covering redirects, nested errors, unselected lifecycle, explicit coverage gaps, and unrelated tabs sharing a context. No schema, permission, dependency, or provider installation changes.

Evidence and verification

  • Actual #600 reproduction: only network/frames selected; initial popup request and main-frame navigation absent while completeness claims complete/equality eligible. Page-errors selected alone works.
  • New real-browser regression against #600's original collector fails: initial request /redirect count 0 instead of 1.
  • Focused tests: 7 affected adapter/domain/SDK MCP files, 22 tests passed. After merging latest main and resolving the comment conflict: 9 files / 33 tests passed (including the upstream PNG/ZIP regressions).
  • npm run check: typecheck, lint, formatting, knip, metadata passed.
  • npm run docs:check: generated contracts/docs passed.
  • npm run verify:browser: actual Headless Chrome143, passive captures/source maps, CLI/stdio MCP with9,331,407-byte PNG, owned launch/external attach cleanup, and all popup checks passed. Final popup tests additionally passed through the actual CLI and stdio MCP, and incomplete captures compare as unknown (network self-comparison remains unchanged).

The pinned Playwright API does not expose complete pre-discovery popup frame/worker/WebSocket/download history. These facets remain explicitly incomplete rather than claiming recovered events. No real Hopper/Ghidra run (their code is unchanged). No process-lineage coverage claim is made when the verifier reports it unavailable.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/614 **Author:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Created:** 10/5/2026 **Status:** ✅ Merged **Merged:** 10/5/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/browser-popup-event-coverage` --- ### 📝 Commits (10+) - [`bb6481c`](https://github.com/morluto/rea/commit/bb6481c54c42eac9ba4fdb3d83a715784ecd4c23) fix(browser): capture selected events in popup pages - [`63cbddb`](https://github.com/morluto/rea/commit/63cbddb175d0d61fd7d7caddb244a2e469174287) Merge commit 'bb6481c54c42eac9ba4fdb3d83a715784ecd4c23' into fix/browser-popup-event-coverage - [`fd5f225`](https://github.com/morluto/rea/commit/fd5f22578733f1b3383793ccdca434145862e99b) fix(browser): capture popup network and report early event gaps - [`a78749f`](https://github.com/morluto/rea/commit/a78749f2ee9a8490a22a4bde5aef1451d2279aef) Merge remote-tracking branch 'origin/main' into fix/browser-popup-event-coverage - [`a5115f4`](https://github.com/morluto/rea/commit/a5115f4cbcd9b6d5dd723a9b9e973080b47b8c01) fix(browser): deduplicate owned popup discovery - [`f992754`](https://github.com/morluto/rea/commit/f992754294b1bfa01193c47061cd104b320f3705) Merge remote-tracking branch 'origin/main' into fix/browser-popup-event-coverage - [`b745775`](https://github.com/morluto/rea/commit/b74577555b8729c78331adb24837518ebbd562d4) test(browser): group popup selection coverage with the scenario event suite - [`bb8b4c0`](https://github.com/morluto/rea/commit/bb8b4c04cc8d254927e3670e2e5631a725a3a282) test(browser): verify popup evidence through CLI and MCP - [`11a34eb`](https://github.com/morluto/rea/commit/11a34ebdf37a64f0b9f03e3e842ad6ca1a2bcbbc) Merge commit 'b74577555b8729c78331adb24837518ebbd562d4' into fix/browser-popup-event-coverage - [`408fbb7`](https://github.com/morluto/rea/commit/408fbb7e7fa0ffa2a77c977f446a6d7068faa9f5) fix(browser): expose shared-context event coverage limits ### 📊 Changes **8 files changed** (+366 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `docs/browser-scenario-contract.md` (+17 -0) ➕ `scripts/lib/browser-popup-e2e.mjs` (+252 -0) 📝 `scripts/verify-real-browser.mjs` (+3 -0) 📝 `src/browser/BrowserScenarioSessionPort.ts` (+2 -0) 📝 `src/browser/PlaywrightBrowserScenarioProvider.test.ts` (+23 -0) 📝 `src/browser/PlaywrightBrowserScenarioProvider.ts` (+2 -0) 📝 `src/browser/PlaywrightScenarioEvents.ts` (+60 -10) 📝 `src/browser/PlaywrightScenarioSession.ts` (+7 -0) </details> ### 📄 Description ## Changes Follow-up to the now-merged #600. Latest main is incorporated, including its popup-selection test organization and subsequent PNG/ZIP fixes. The only merge conflict was the discovery comment; the resolution describes both owned-context and opener discovery accurately. - Capture network events at BrowserContext before navigation in a wholly owned launch context. Popup initial document requests, redirects, responses, and nested popup requests are retained exactly once. - In a shared connected context, retain only requests whose frames belong to the root or discovered descendant Pages. Initial requests without a frame cannot be safely attributed and are omitted; connect captures remain incomplete. - Observe owned context Page discovery and deduplicate it against opener popup discovery. Keep popup lifecycle emission selection-controlled. - Report unrecoverable pre-discovery frame/worker/WebSocket/download gaps in limitations, mark events missing, and disable equality eligibility. Do not synthesize navigation history from the current URL. - Add actual Chromium regressions to the existing `verify:browser` lane, covering redirects, nested errors, unselected lifecycle, explicit coverage gaps, and unrelated tabs sharing a context. No schema, permission, dependency, or provider installation changes. ## Evidence and verification - Actual #600 reproduction: only network/frames selected; initial popup request and main-frame navigation absent while completeness claims complete/equality eligible. Page-errors selected alone works. - New real-browser regression against #600's original collector fails: initial `request /redirect` count 0 instead of 1. - Focused tests: 7 affected adapter/domain/SDK MCP files, **22 tests passed**. After merging latest main and resolving the comment conflict: **9 files / 33 tests passed** (including the upstream PNG/ZIP regressions). - `npm run check`: typecheck, lint, formatting, knip, metadata passed. - `npm run docs:check`: generated contracts/docs passed. - `npm run verify:browser`: actual Headless Chrome143, passive captures/source maps, CLI/stdio MCP with9,331,407-byte PNG, owned launch/external attach cleanup, and all popup checks passed. Final popup tests additionally passed through the actual CLI and stdio MCP, and incomplete captures compare as unknown (network self-comparison remains unchanged). The pinned Playwright API does not expose complete pre-discovery popup frame/worker/WebSocket/download history. These facets remain explicitly incomplete rather than claiming recovered events. No real Hopper/Ghidra run (their code is unchanged). No process-lineage coverage claim is made when the verifier reports it unavailable. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:14:26 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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
morluto/rea#2114
No description provided.