[PR #3837] test(browser): cover invalid WebMCP annotation payloads #5936

Open
opened 2026-10-31 01:10:35 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/3837
Author: @aznikline
Created: 10/15/2026
Status: 🔄 Open

Base: main ← Head: test/webmcp-invalid-annotations


📝 Commits (3)

  • ff873c2 test(browser): cover invalid WebMCP annotation payloads
  • 74e2dc3 test(browser): split invalid-annotation cases into their own describe
  • bcb92eb test(browser): preserve explicit null WebMCP annotations

📊 Changes

3 files changed (+50 additions, -6 deletions)

View changed files

📝 tests/boundary/browser/cdpBrowserProvider.document_script.test.ts (+41 -0)
📝 tests/fixtures/fakeCdpBrowserEvents.ts (+8 -6)
📝 tests/fixtures/fakeCdpBrowserTypes.ts (+1 -0)

📄 Description

Summary

Follow-up test coverage from closed #2263: browser-level cases for invalid WebMCP annotation payloads were committed to 092a86cb4d2bb5b0e322391f1d6230673b3b63f3 after that PR closed and were not absorbed by upstream f6905719c3c80d829037e509d6e46129b131d893 or current main.

Problem and expected behavior

A page emitting a non-boolean consequential value, a malformed annotations payload, or annotations: null must keep the tool registration, omit the consequential hint, and mark webmcp_tools coverage incomplete (invalid_protocol_value, unavailable_sections). Existing main coverage exercises only boolean consequential values.

Change and scope

Test-only: adds a fixture override webMcpAnnotations (tests/fixtures) selected by own-property presence (Object.hasOwn) so an explicit null reaches the provider instead of falling back to valid defaults, and an it.each covering all three invalid payloads. No production code changes; does not reimplement #2263's absorbed fixes.

Validation performed

  • npm run test:focused -- tests/boundary/browser/cdpBrowserProvider.document_script.test.ts — 29/29 pass; the null case fails against the pre-fix fixture
  • npm run check:fast — green (typecheck + lint); oxfmt --check clean

Author readiness

Human owner:

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Generated with Devin


🔄 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/3837 **Author:** [@aznikline](https://github.com/aznikline) **Created:** 10/15/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `test/webmcp-invalid-annotations` --- ### 📝 Commits (3) - [`ff873c2`](https://github.com/morluto/rea/commit/ff873c29688929fb6d5644745320976312c4ed06) test(browser): cover invalid WebMCP annotation payloads - [`74e2dc3`](https://github.com/morluto/rea/commit/74e2dc324e7eb9afce514629428dbe7395364707) test(browser): split invalid-annotation cases into their own describe - [`bcb92eb`](https://github.com/morluto/rea/commit/bcb92ebe3a92bd77394c90666746aeadbbaf5e0c) test(browser): preserve explicit null WebMCP annotations ### 📊 Changes **3 files changed** (+50 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `tests/boundary/browser/cdpBrowserProvider.document_script.test.ts` (+41 -0) 📝 `tests/fixtures/fakeCdpBrowserEvents.ts` (+8 -6) 📝 `tests/fixtures/fakeCdpBrowserTypes.ts` (+1 -0) </details> ### 📄 Description ## Summary Follow-up test coverage from closed #2263: browser-level cases for invalid WebMCP annotation payloads were committed to `092a86cb4d2bb5b0e322391f1d6230673b3b63f3` after that PR closed and were not absorbed by upstream `f6905719c3c80d829037e509d6e46129b131d893` or current main. ## Problem and expected behavior A page emitting a non-boolean `consequential` value, a malformed `annotations` payload, or `annotations: null` must keep the tool registration, omit the `consequential` hint, and mark `webmcp_tools` coverage incomplete (`invalid_protocol_value`, `unavailable_sections`). Existing main coverage exercises only boolean `consequential` values. ## Change and scope Test-only: adds a fixture override `webMcpAnnotations` (tests/fixtures) selected by own-property presence (`Object.hasOwn`) so an explicit `null` reaches the provider instead of falling back to valid defaults, and an `it.each` covering all three invalid payloads. No production code changes; does not reimplement #2263's absorbed fixes. ## Validation performed - `npm run test:focused -- tests/boundary/browser/cdpBrowserProvider.document_script.test.ts` — 29/29 pass; the `null` case fails against the pre-fix fixture - `npm run check:fast` — green (typecheck + lint); `oxfmt --check` clean ## Author readiness Human owner: <!-- @GitHub-handle — required, must be filled by the human owner --> - [ ] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [ ] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [ ] I declare this PR ready for initial maintainer review. Generated with [Devin](https://devin.ai) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#5936
No description provided.