[PR #2845] test(browser): cover DOM relation whitespace and empty values #5431

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/2845
Author: @zhangguiping-xydt
Created: 10/13/2026
Status: 🔄 Open

Base: main ← Head: fix/dom-rel-ascii-whitespace


📝 Commits (6)

  • 158dc95 fix(browser): avoid false agent hints from non-HTML whitespace
  • 91ecc70 chore(browser): resolve main conflict in relation token handling
  • c64d9a5 fix(browser): retain DOM hints for empty snapshot values
  • 80562f1 fix(browser): preserve empty CDP attribute values across metadata consumers
  • 3224bbd test(browser): retain DOM regressions with upstream snapshot decoder
  • a437d87 chore(ci): integrate upstream EVM and PCAP cleanup repairs

📊 Changes

2 files changed (+165 additions, -60 deletions)

View changed files

📝 src/browser/CdpCaptureDocuments.baseUrl.test.ts (+163 -60)
📝 src/browser/CdpCaptureDocuments.test.ts (+2 -0)

📄 Description

Summary

What Problem This Solves

Refs #2840. Preserve regression coverage for HTML relation-token whitespace and CDP empty-value encoding. Non-HTML whitespace must not invent agent hints; valid empty node/attribute values must not remove links or form destinations.

User Impact

The tests protect the existing browser inspection results exposed through CLI and MCP: valid declarations, empty form destinations, SVG empty-href precedence and XML namespace undeclarations.

Change and scope

Why This Change Was Made

Main now includes both production corrections, most recently through #3080. This PR uses main's canonical CdpSnapshotStrings.ts implementation and removes its superseded duplicate helpers. The final diff against main contains only two test files, preserving distinct relation-token, negative-index, form and SVG/XML coverage.

Merged main through 29d3dcb7ea85b3be37cd81e977ae4e09cebdd2fc, preserving existing PR history. No new runtime behavior, dependencies, permissions, protocol calls or target authority are introduced.

Evidence and regression coverage

Evidence

Current commit: a437d872df3b20b3843682cc3a4fcba35cf033c3. Linux, Node.js 24.18.0/npm 11.16.0, actual Chrome 138.0.7204.157.

  • DOM/base URL source suites: 91 passed.
  • npm run check:fast: passed.
  • Exact-commit built CLI and stdio MCP with an owned localhost page and disposable real Chrome: passed. Both retain all five link URLs, only four valid relation hints, and all four form destinations; outputs match independent Chrome relList and DOM-property oracles. Actual raw CDP snapshots and adapter Evidence retained.
  • Shared upstream EVM/PCAP boundary suites: 48 passed / 2 skipped on companion PR #2884 with identical provider/test sources from the integrated main. The fixes preserve transferred cleanup ownership, assert the public error code, retain the exact stdout newline, and release injected cleanup failures even when assertions fail. This does not claim real EVM/PCAP provider verification.
  • Earlier main #3080 integration also verified the previous JavaScript/IDA failures: 98 passed; that prior-run evidence is retained.

Earlier pre-fix live failures and regression evidence are preserved in the PR history. Main now supplies the runtime correction; these tests add distinct coverage rather than maintaining a second decoder.

CI and limitations

Current-head CI run 38528268551 passed, including Source tests, Static checks, Build package, all five test shards, Portable tests and CI required. Conventional PR title and Greptile Review also passed. The current head is mergeable. Earlier-head failed jobs are historical evidence. Local complete real-browser verification passes DOM/form assertions but still fails later storage seeding on Chrome 138 (expected initial values, observed nulls); this is not claimed as a complete browser pass. Other OSes were not exercised.

Author readiness

Human owner: @zhangguiping-xydt

  • 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.

Before merge

  • Resolved conflicts using the upstream decoder owner.
  • Retained malformed-input and non-HTML whitespace controls.
  • Exact-commit real CLI/MCP observations verified.
  • Final diff contains only the two regression test files.

🔄 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/2845 **Author:** [@zhangguiping-xydt](https://github.com/zhangguiping-xydt) **Created:** 10/13/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/dom-rel-ascii-whitespace` --- ### 📝 Commits (6) - [`158dc95`](https://github.com/morluto/rea/commit/158dc951e51078bfe73a16570f31072b83a2ab80) fix(browser): avoid false agent hints from non-HTML whitespace - [`91ecc70`](https://github.com/morluto/rea/commit/91ecc702f6884ff1ffcaecf44a688573586b86cb) chore(browser): resolve main conflict in relation token handling - [`c64d9a5`](https://github.com/morluto/rea/commit/c64d9a50278f9a945a3b315732d3a686d6f717ee) fix(browser): retain DOM hints for empty snapshot values - [`80562f1`](https://github.com/morluto/rea/commit/80562f156091fc72f21f92e07c3425162cabd955) fix(browser): preserve empty CDP attribute values across metadata consumers - [`3224bbd`](https://github.com/morluto/rea/commit/3224bbd6305f2133d4636410250fa1783747e5fd) test(browser): retain DOM regressions with upstream snapshot decoder - [`a437d87`](https://github.com/morluto/rea/commit/a437d872df3b20b3843682cc3a4fcba35cf033c3) chore(ci): integrate upstream EVM and PCAP cleanup repairs ### 📊 Changes **2 files changed** (+165 additions, -60 deletions) <details> <summary>View changed files</summary> 📝 `src/browser/CdpCaptureDocuments.baseUrl.test.ts` (+163 -60) 📝 `src/browser/CdpCaptureDocuments.test.ts` (+2 -0) </details> ### 📄 Description ## Summary ### What Problem This Solves Refs #2840. Preserve regression coverage for HTML relation-token whitespace and CDP empty-value encoding. Non-HTML whitespace must not invent agent hints; valid empty node/attribute values must not remove links or form destinations. ### User Impact The tests protect the existing browser inspection results exposed through CLI and MCP: valid declarations, empty form destinations, SVG empty-href precedence and XML namespace undeclarations. ## Change and scope ### Why This Change Was Made Main now includes both production corrections, most recently through #3080. This PR uses main's canonical `CdpSnapshotStrings.ts` implementation and removes its superseded duplicate helpers. The final diff against main contains only two test files, preserving distinct relation-token, negative-index, form and SVG/XML coverage. Merged main through `29d3dcb7ea85b3be37cd81e977ae4e09cebdd2fc`, preserving existing PR history. No new runtime behavior, dependencies, permissions, protocol calls or target authority are introduced. ## Evidence and regression coverage ### Evidence Current commit: `a437d872df3b20b3843682cc3a4fcba35cf033c3`. Linux, Node.js 24.18.0/npm 11.16.0, actual Chrome 138.0.7204.157. - DOM/base URL source suites: **91 passed**. - `npm run check:fast`: **passed**. - Exact-commit built CLI and stdio MCP with an owned localhost page and disposable real Chrome: **passed**. Both retain all five link URLs, only four valid relation hints, and all four form destinations; outputs match independent Chrome `relList` and DOM-property oracles. Actual raw CDP snapshots and adapter Evidence retained. - Shared upstream EVM/PCAP boundary suites: **48 passed / 2 skipped** on companion PR #2884 with identical provider/test sources from the integrated main. The fixes preserve transferred cleanup ownership, assert the public error code, retain the exact stdout newline, and release injected cleanup failures even when assertions fail. This does not claim real EVM/PCAP provider verification. - Earlier main #3080 integration also verified the previous JavaScript/IDA failures: **98 passed**; that prior-run evidence is retained. Earlier pre-fix live failures and regression evidence are preserved in the PR history. Main now supplies the runtime correction; these tests add distinct coverage rather than maintaining a second decoder. ## CI and limitations Current-head [CI run 38528268551](https://github.com/morluto/rea/actions/runs/38528268551) **passed**, including Source tests, Static checks, Build package, all five test shards, Portable tests and CI required. Conventional PR title and Greptile Review also passed. The current head is mergeable. Earlier-head failed jobs are historical evidence. Local complete real-browser verification passes DOM/form assertions but still fails later storage seeding on Chrome 138 (expected initial values, observed nulls); this is not claimed as a complete browser pass. Other OSes were not exercised. ## Author readiness Human owner: @zhangguiping-xydt - [x] 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. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. ## Before merge - [x] Resolved conflicts using the upstream decoder owner. - [x] Retained malformed-input and non-HTML whitespace controls. - [x] Exact-commit real CLI/MCP observations verified. - [x] Final diff contains only the two regression test files. --- <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#5431
No description provided.