Repository navigation
fix(network): report wire requests and retain response evidence - #758
lanyue-llk wants to merge 1 commit into
Conversation
7bc4a0a to
ef06d30
Compare
1115a24 to
85f37de
Compare
Sequential Navigation Soak A/B✅ HEAD completed the 200-navigation resilience and memory observation. One browser process, one target, and one CDP session navigate CSDN → SegmentFault → Huaban → example.com repeatedly. This run issued 200 Common ancestor Session resilience
A public-page failure is reported separately from an unrecoverable session. The soak requires all navigation attempts, zero failed recovery, zero lifecycle/network ordering violations, and complete resource evidence. Process-tree memory
HEAD memory by 50-navigation quarter
Raw reports and per-navigation boundary samples: workflow run and full Public-site timing and memory are observational. Use the A/B deltas and trend shape as evidence, not as a deterministic performance threshold. |
Spider Bench A/B✅ All benchmark browser service runs completed; results are informational. Public HEAD: 184 / 240 rows; 38 / 48 sites produced rows; 10 unexpected empty sites. ✅ Deterministic fixture contract is clean. Common ancestor Public 48-site run · informational
Public-site content, timing, and memory are noisy. This single A/B run reports evidence only; site outcome counts explain missing rows without treating them as a deterministic regression. CPU and memory timelinesThese are bounded 40-point views of the same complete process-tree samples used by the HTML report. CPU uses 100% per occupied logical core; memory lines are RSS first and PSS second when complete PSS samples are available. Basexychart-beta
title "Base CPU"
x-axis "Elapsed seconds" [1.037, 2.039, 2.539, 3.541, 4.543, 6.043, 7.045, 8.047, 9.047, 10.549, 11.549, 12.551, 14.054, 15.055, 16.055, 17.558, 18.56, 19.56, 21.063, 22.064, 22.565, 23.065, 24.065, 25.567, 26.568, 27.57, 29.071, 30.072, 31.072, 32.575, 33.576, 34.577, 35.578, 37.081, 38.082, 39.084, 40.586, 41.087]
y-axis "CPU percent" 0 --> 500
line [9.98, 121.7, 127.89, 141.77, 127.68, 210.07, 143.6, 157.55, 150.03, 147.62, 128, 153.6, 129.68, 87.98, 149.94, 73.86, 163.7, 88.03, 143.68, 97.92, 109.97, 109.94, 124.08, 13.96, 147.9, 109.86, 103.92, 71.96, 33.99, 161.73, 93.83, 23.96, 4, 131.59, 207.81, 51.9, 127.86, 217.48]
xychart-beta
title "Base memory: RSS then PSS"
x-axis "Elapsed seconds" [0.036, 1.037, 2.039, 2.539, 3.541, 4.543, 6.043, 7.045, 8.047, 9.047, 10.549, 11.549, 12.551, 14.054, 15.055, 16.055, 17.558, 18.56, 19.56, 21.063, 22.064, 22.565, 23.065, 24.065, 25.567, 26.568, 27.57, 29.071, 30.072, 31.072, 32.575, 33.576, 34.577, 35.578, 37.081, 38.082, 39.084, 40.586, 41.087, 41.57]
y-axis "Memory MiB" 0 --> 500
line [12.25, 68.23, 113.84, 123.02, 129.9, 128.27, 179.15, 207.04, 177.24, 181.07, 180.11, 195.54, 187.76, 169.04, 160.26, 167.34, 154.74, 178.45, 195.05, 179.67, 267.89, 269.27, 198.98, 227.23, 161.92, 182.15, 197.78, 178.71, 173.3, 168.82, 207.35, 191.05, 182.57, 169.95, 197.08, 209.98, 170.4, 185.77, 208.18, 0]
line [9.08, 64.71, 109.78, 118.65, 126.62, 124.75, 175.64, 201.63, 173.75, 177.55, 176.6, 192.09, 184.31, 165.53, 156.75, 163.82, 151.25, 175.49, 189.59, 176.19, 264.39, 265.33, 195.45, 223.76, 158.41, 178.64, 194.25, 175.21, 169.72, 165.31, 204.05, 187.6, 179.06, 166.44, 193.59, 206.22, 166.93, 182.38, 204.75, 0]
HEADxychart-beta
title "HEAD CPU"
x-axis "Elapsed seconds" [1.535, 2.537, 4.04, 5.54, 6.541, 8.043, 9.545, 11.047, 12.049, 13.551, 15.052, 16.053, 17.556, 19.057, 20.058, 21.56, 23.06, 23.562, 24.562, 25.564, 27.066, 28.568, 29.068, 29.568, 31.07, 32.572, 33.573, 35.074, 36.576, 37.577, 39.079, 40.581, 42.082, 43.085, 44.586, 46.088, 47.089, 48.09]
y-axis "CPU percent" 0 --> 500
line [123.92, 127.8, 113.76, 179.94, 151.75, 95.97, 181.93, 77.8, 131.83, 139.92, 133.94, 31.94, 15.96, 81.97, 105.74, 6, 6, 0, 73.95, 69.89, 111.94, 99.9, 110.01, 110.01, 125.92, 125.84, 145.88, 158.07, 83.88, 49.94, 115.89, 91.88, 7.99, 7.98, 121.82, 33.96, 131.88, 221.63]
xychart-beta
title "HEAD memory: RSS then PSS"
x-axis "Elapsed seconds" [0.035, 1.535, 2.537, 4.04, 5.54, 6.541, 8.043, 9.545, 11.047, 12.049, 13.551, 15.052, 16.053, 17.556, 19.057, 20.058, 21.56, 23.06, 23.562, 24.562, 25.564, 27.066, 28.568, 29.068, 29.568, 31.07, 32.572, 33.573, 35.074, 36.576, 37.577, 39.079, 40.581, 42.082, 43.085, 44.586, 46.088, 47.089, 48.09, 48.547]
y-axis "Memory MiB" 0 --> 500
line [12.33, 114.1, 137.55, 140.08, 153.63, 173.51, 165.76, 193.36, 163.85, 189.07, 185.14, 161.28, 144.61, 148.8, 143.65, 158.04, 143.72, 145.88, 145.88, 151.84, 172.79, 171.3, 259.63, 289.59, 199.71, 232.47, 172.57, 176.62, 167.59, 168.56, 160.74, 199.84, 180.29, 166.84, 166.02, 179.93, 156.17, 170.86, 194.4, 0]
line [9.47, 110.85, 134.35, 136.93, 150.43, 170.48, 162.51, 190.03, 160.41, 185.66, 182.8, 157.88, 141.17, 145.37, 140.64, 154.57, 140.27, 142.4, 142.4, 148.38, 169.31, 168.53, 256.26, 286.18, 196.82, 229.06, 168.85, 173.4, 164.16, 165.19, 157.3, 196.52, 177.1, 163.41, 162.58, 176.44, 152.53, 167.37, 190.89, 0]
Deterministic fixture · required contractThe fixture exercises 15 routes: 8 are expected to emit rows and 7 intentionally exercise empty, loading, or timeout behavior.
Full HTML, JSON, CSV, logs, and page snapshots: workflow run and full The public-web A/B is informational. The exact HEAD fixture contract runs as a separate required CI check; timing and public-site content deltas remain non-blocking. |
CI Regression ReportSource CI run · source state at render:
Release regression — ✅ HEAD/base failures 0/0; raw binary +0.031838%Package and image size
Startup latency and PSS
Concurrency matrix
Frontend differential — ✅ 1,020/1,020 cases matched; 0 issues
Agent episodes · Moli vs Chromium — ✅ 8/8 Moli episodes passed; 0 failures
Runtime and CDP session contracts — ✅ 26 contract cases; 0 failures
CDP smoke — ✅ 52/52 groups passed; 616 scenariosWorkers: 4 · cumulative group time: 136.01 s · failed groups: 0
WebMainBench · 545 pages — ✅ 545/545 completed; 0 unexpected failures
Frozen HTML · Linux · Diagnostics: All artifact fields are parsed by the trusted default-branch renderer; missing or invalid inputs remain visible as unavailable. |
ef06d30 to
d979e94
Compare
85f37de to
d7c049b
Compare
d979e94 to
f4461d1
Compare
d7c049b to
568b7b1
Compare
568b7b1 to
a32dbf2
Compare
a32dbf2 to
6d7c57c
Compare
请求实际成功时,CDP 仍可能报告错误的逐跳方法、缺失的实际请求头,或在导航后丢失响应体。发送前的请求描述不等于传输最终发送的数据。本 PR 将网络事件与响应证据归属到实际交换,并为跨导航响应体提供显式、有界、按会话隔离的保存机制。
一图看懂
图示说明问题、修复机制与行为边界;点击可查看原图。验收归属不等于当前提交通过结果,版本和测试证据见下文。
场景、根因与预期
机制与代码阅读路线
moli-fetch/src/network_fetch_result.rs和request.rs:wire 请求行及最终头的观察,共享重定向方法与 body-header 规则。先核对 Fetch 的逐跳语义,再看协议投影。moli-renderer-v8/src/network/navigation/loader.rs与 child documents loads:主/子文档都携带实际网络元数据。moli-protocol/src/domains/network/main_document_progress/、redirect_request.rs、events.rs、output_queue.rs:按交换归属日志;保留普通事件与 ExtraInfo 的不同含义,不能用 staged cookie query 覆盖已经观察到的 wire 头。network/agent.rs、settings.rs、connection 的 network owner/runtime slot:有界 body owner 管保存,session claim 管可见性。导航、关闭、撤销、缩小预算必须同步 owner 和索引。moli-bounded-buffer/src/buffer.rs:复用 FIFO、retain、限额收缩等通用原语。runtime/protocol_output/transport_memory.rs计入方法、头、journal 与相关消息的内存;零字节 body 也不能绕过预算。这 28 个文件跨越传输、renderer、协议和公共缓冲区,是同一证据链的不同边界。较大 agent 改动应围绕所有权、会话权限和预算不变量审查;不增加网站特例,也不由 CDP 猜测网络实际上发送了什么。
回归用例与反例
network/tests/redirect_wire.rs::form_post_redirect_chain_cdp_metadata_matches_wire_requests:真实服务端收到的请求与 CDP 方法/头逐跳对照redirect_request.rs:redirect_status_method_matrix_matches_fetch_semantics、redirected_get_does_not_recover_original_post_on_later_307main_document_progress/tests.rs:不能补回删除的头,不能猜截断日志的跳数,升级请求的 wire 头归到正确交换page/producer_tests.rs::child_document_network_reports_actual_redirect_methods_and_request_headersnetwork/tests/response_body.rs:显式启用且正预算才保存;disable/detach/close/其他 target 不泄漏Case 对应与验收版本
本 PR 负责
339,595,676。原第 10 类缺失 Referer 对应339,676;595 原属第 2 类链接几何,最终需要网络证据与 #756 几何组合验收,不能把其成功全部归因于本 PR。6d7c57c395505c84eebedfb51d2ab74d821e8ae4已在 mainb21b4f05615c1b9aa71ea2074084646895d82be7上真正 rebase,保留单提交。CI 37725108193 19/19 成功。a32dbf25671a4ac0cf2a0bff8139a40d13f02912的官方任务339,676评分 1.0;595 的历史组合验收为 16/16 动作、默认 30 秒、评分 1.0,结束恢复订阅状态。这些不是当前 HEAD 的官方任务复跑。15faebd1683b94fb4aa646f3ffe695a2bb45a44b在原冻结合同下 2/3,676 失败;显式就绪 v2 合同下 3/3、零重试。报告保留就绪合同和中间失败,不能把不同合同合并成原合同全部通过。网络历史判定。当前 base 是 main;595 的运行场景仍依赖 #756 的布局行为。来源:原网络 PR #737。
Reviewer 复现:真实请求与 3 个 badcase
先在本 PR 的 Moli checkout 跑真实 HTTP 重定向与响应体测试,不需要 WebArena:
cargo nextest run --no-fail-fast -p moli-protocol \ -E 'test(form_post_redirect_chain_cdp_metadata_matches_wire_requests) | test(durable_response_body_) | test(observed_request_headers_do_not_restore_a_referrer_removed_by_transport_policy)'预期:真实服务端与 CDP 都是 POST → GET → GET;不会恢复已删除的 Referer。跨导航 body 保存需显式开启和正预算,disable/detach/其他 target 不泄漏。
完整复现指南与环境准备 · 下载复现包。包内有按 case 选题的脚本、固定动作和 DOM 采集合同,不含历史答案。代码复用 browser-eval 的执行、HAR 采集与评分器,不是重新实现评分。
首次使用:解压到 Moli 仓库外,将
REPRO_DIR设为解压目录的绝对路径。独立克隆 browser-eval 后,固定版本并安装锁定依赖:将
site-map.json的主机和端口换成自己使用的 WebArena 测试站点。需要 Reddit、GitLab、Shopping、Shopping Admin;不用 Map/Wikipedia。镜像、初始化、测试账号和地址要求见指南。下文命令都在这个 browser-eval 目录执行。脚本自行启动待审二进制,使用新 profile 和可用端口,结束后只停止它启动的进程。先跑 339、676:
595 需同时具备 #756 的布局和 #758 的网络修改,单个 PR 的二进制不能代表组合结果。用包含两项修改的二进制运行:
595 会修改订阅,运行前确认未订阅,结束后取消订阅或重置自己的环境。不能在其他人使用的站点跑写入或重置。676 若网格尚未加载,应先看 trace 判断就绪问题;本包不偷偷增加 readiness v2 或延长超时,也不把历史 v2 的 3/3 当成原合同结果。
保存和判断结果
每轮使用新结果目录。
inputs.json记录二进制、输入哈希及回放/评分器版本;每题保存result.json、trace.json、network.har、实际响应与评分。动作失败时评分文件可能尚未生成,先看failure_stage和 trace;网络问题对照 HAR 的方法、URL、Referer、重定向与状态码。默认每动作 30 秒、每题 300 秒,每题只执行一次。比较历史失败时用 1.1.9 官方二进制和待审 PR,并保持相同站点初始数据。当前 main 已包含其他修复,不应预设所有历史题仍会在 main 上失败。
Reviewer 重点
逐跳方法是否同时对照服务端真实请求?观测不完整时是否明确回退?会话撤销、导航及预算收缩后,可见性、内存计费和索引是否保持一致?main 的 no-cors 非 follow 重定向拒绝语义不能被观测路径改写。
整组验收与证据入口
这组修复来自 #640,对应 1.1.9 的 34 个失败 case,加上 1.1.8 已失败的 386,共 35 个唯一 case。按最终职责分配为:#756 布局 27、#757 输入 4、#758 网络 3、#761 文本 1;#755、#759、#760 以各自独立功能契约验收,不重复认领这 35 个 case。