Skip to content

feat(fetch): allow explicit interaction before page dump - #1305

Merged
ldm0 merged 3 commits into
mainfrom
codex/fetch-eval-before-dump
Oct 10, 2026
Merged

ldm0 merged 3 commits into
mainfrom
codex/fetch-eval-before-dump

Conversation

@lanyue-llk

@lanyue-llk lanyue-llk commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

问题

fetch --eval 能执行页面交互,却只能输出表达式的值;fetch --dump 能输出页面,但两者互斥。调用者无法直接组合一次脚本执行与标准 Markdown、HTML 或 JSON 导出,例如通过按钮创建正文、等待异步交互完成,或者导航至目标页面后导出。

这是通用 CLI 组合能力,与 #919 的内容转换、CSS 和 parser 修复独立。--wait-script 可以执行副作用,但它是可能重复执行的就绪判定;明确的一次性操作应使用 --eval。本 PR 基于 main 的默认 Markdown 导出已经保留 WebMainBench 8798f93a… 的 91 组明细,展开前后输出相同,因此该案例不能证明本分支默认采集缺失正文,也不是此 PR 修复成绩的依据。

方案

允许组合已有的 --eval / --eval-file 与 --dump,复用现有等待 Promise、跟随导航的执行接口和标准导出路径。初始加载与交互后的导航续跑共享同一规则:即使达到 load,若该事件已排队后续导航,仍先完成下一跳,再导出最终文档:

交互后导出:原实现的两类错误及修复路径

查看完整机制图

moli fetch --eval 'document.querySelector("button.show-details").click()' \
  --dump markdown https://example.com
  • 操作由调用者明确指定,不自动发现或点击按钮,不静态解析 handler。
  • 准备执行忽略返回值,不按值序列化,循环对象和对象 getter 不会阻止导出或引入序列化副作用。
  • 同步异常和 Promise 拒绝使命令失败;交互触发的导航先完成,再导出目标页面。
  • 没有 --dump 时,表达式值的原有输出契约保留;此时拒绝正文专用参数,避免静默忽略。
  • 直接基于 main b21b4f05615c1b9aa71ea2074084646895d82be7,没有搬入 fix(fetch): preserve rendered document content #919 的 renderer / html2md 修改,也没有新增底层执行接口。

验收

公开 CLI 测试覆盖:

  • 两种表达式来源 × HTML / Markdown / JSON 参数组合。
  • 命名按钮函数、异步事件监听器创建正文后,使用标准 Markdown 导出;未指定的按钮不执行,表达式返回文字不混入正文。
  • DOM、循环对象、带副作用或抛错 getter、Promise 返回对象均可忽略并导出 HTML。
  • 链接点击、location 赋值、Promise 中导航后,HTML 和 Markdown 均导出目标正文而非原页;目标页 load 触发一次或连续两次跳转时,两种表达式来源 × HTML / Markdown / JSON 均与直接 fetch 的最终正文一致,并检查 JSON 最终 URL。
  • 同步抛错、异步拒绝均失败且 stdout 为空。
  • 仅输出表达式值时拒绝无效正文参数;保留原有表达式值、stdin、原始文档拒绝和互斥来源测试。

组合能力的旧二进制复现为参数冲突。原提交 cc89392 的仓库 CI 全部通过,包括 Format、Clippy 和 Nextest。两条 review 问题在原实现上分别复现了返回值序列化失败/副作用和导航后仍导出原页;复用现有接口后,独立构建二进制的 20 个 eval 测试以及 11 个新增回归场景通过。修复提交 cfd1087 的仓库 CI 已全部通过,包括 Format、Clippy、Nextest、545 页 WebMainBench、协议冒烟及导航检查。

导航续跑修复 b682173 复用既有生命周期判断,没有引入延时或新导航 API。同一修复的独立构建已通过 249 项 CLI 回归及六种连续导航组合;提交 b682173 的 19 项 CI 检查已全部通过,包括 Nextest 和 545 页 WebMainBench。

评测边界

此 PR 不改变已发布的 545 页成绩。若比较交互采集,应预先固定同一操作和任务范围,对所有支持交互的方法执行一致流程,单独认证并展示;不能仅给 Moli 添加交互后替换正式报告结果。已有七方法报告继续绑定其原始调用、二进制和参考。

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

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 7d7189c8977f → HEAD 1fa7cb1aaddf; benchmark order: head-first; workflow: success.

Public 48-site run · informational

Metric Base HEAD Δ
Run status success success —
Extracted rows / contract 184 / 240 184 / 240 0 (0.00%)
Contract fill 76.67% 76.67% 0.00 pp (0.00%)
Sites with rows 38 / 48 38 / 48 0 (0.00%)
Sites meeting row contract 36 / 48 36 / 48 0 (0.00%)
Unexpected empty sites 10 10 0 (0.00%)
Partial-row sites 2 2 0 (0.00%)
Site outcomes extracted: 37; HTTP error + rows: 1; empty: 7; HTTP error + empty: 1; snapshot error + empty: 2 extracted: 36; HTTP error + rows: 2; empty: 7; HTTP error + empty: 1; snapshot error + empty: 2 —
Observed duration 67.71 s 76.21 s +8.50 s (+12.55%)
Estimated CPU 48.44 s 50.66 s +2.22 s (+4.58%)
Peak PSS 294.85 MiB 277.35 MiB -17.51 MiB (-5.94%)
Peak RSS 297.35 MiB 280.44 MiB -16.91 MiB (-5.69%)
Peak threads 27 26 -1 (-3.70%)
Mismatched sites 0 0 0
Timeout with items 0 0 0
Category rows Base HEAD Δ
news 35 / 40 35 / 40 0
stocks 20 / 40 20 / 40 0
tech 35 / 40 35 / 40 0
sports 27 / 40 27 / 40 0
games 37 / 40 37 / 40 0
life 30 / 40 30 / 40 0

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 timelines

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

Base

xychart-beta
    title "Base CPU"
    x-axis "Elapsed seconds" [2.039, 4.043, 5.544, 7.546, 9.547, 11.55, 12.051, 13.051, 15.054, 17.056, 19.058, 21.061, 22.562, 24.564, 26.565, 28.566, 30.068, 32.072, 34.076, 36.078, 38.08, 39.582, 41.583, 43.584, 45.587, 47.091, 47.591, 49.094, 51.097, 53.099, 55.102, 56.604, 58.605, 60.608, 62.609, 64.11, 64.611, 66.111]
    y-axis "CPU percent" 0 --> 500
    line [129.76, 119.77, 151.92, 149.88, 93.89, 143.76, 0, 0, 0, 0, 0, 0, 127.86, 125.96, 13.99, 21.96, 73.89, 9.99, 139.6, 95.9, 4, 0, 0, 0, 0, 105.82, 105.82, 101.79, 49.94, 114, 103.7, 51.93, 147.85, 23.96, 49.99, 99.81, 197.74, 138.01]
Loading
xychart-beta
    title "Base memory: RSS then PSS"
    x-axis "Elapsed seconds" [0.036, 2.039, 4.043, 5.544, 7.546, 9.547, 11.55, 12.051, 13.051, 15.054, 17.056, 19.058, 21.061, 22.562, 24.564, 26.565, 28.566, 30.068, 32.072, 34.076, 36.078, 38.08, 39.582, 41.583, 43.584, 45.587, 47.091, 47.591, 49.094, 51.097, 53.099, 55.102, 56.604, 58.605, 60.608, 62.609, 64.11, 64.611, 66.111, 67.709]
    y-axis "Memory MiB" 0 --> 500
    line [12.07, 113.9, 138.68, 155.94, 164.48, 167.07, 155.63, 155.63, 141.7, 140.69, 140.61, 140.61, 140.58, 159.79, 144.34, 149.83, 166.02, 150.57, 142.55, 173.54, 157.57, 139.01, 139.01, 139.01, 139.01, 139.01, 232.84, 297.35, 210.36, 159.2, 173.37, 156.15, 152.5, 214.1, 174.65, 178.13, 189.9, 182.23, 184.96, 0]
    line [8.73, 110.22, 135.08, 152.24, 160.81, 163.1, 151.95, 151.95, 138.02, 137, 136.93, 136.93, 136.9, 155.83, 140.65, 146.12, 162.31, 146.87, 138.84, 169.95, 153.87, 135.3, 135.3, 135.3, 135.3, 135.3, 229.18, 294.85, 206.66, 155.44, 169.59, 152.52, 148.77, 207.89, 170.97, 174.41, 187.65, 175.54, 181.23, 0]
Loading

HEAD

xychart-beta
    title "HEAD CPU"
    x-axis "Elapsed seconds" [2.039, 4.542, 5.042, 6.544, 8.547, 10.55, 13.052, 15.055, 17.056, 19.058, 21.562, 23.566, 25.568, 27.57, 30.074, 32.076, 34.078, 36.078, 38.582, 40.582, 42.586, 44.589, 47.093, 49.095, 51.098, 53.099, 53.6, 55.601, 57.604, 59.607, 61.61, 64.113, 66.115, 68.117, 70.121, 72.623, 74.626, 75.628]
    y-axis "CPU percent" 0 --> 200
    line [113.77, 3.99, 0, 2, 115.77, 145.95, 89.89, 151.76, 4, 2, 0, 0, 57.99, 151.72, 7.98, 165.78, 4, 39.99, 0, 58.05, 0, 0, 2, 2, 2, 103.91, 105.82, 131.96, 139.82, 141.8, 147.79, 101.94, 49.93, 69.95, 17.97, 165.64, 143.75, 189.64]
Loading
xychart-beta
    title "HEAD memory: RSS then PSS"
    x-axis "Elapsed seconds" [0.036, 2.039, 4.542, 5.042, 6.544, 8.547, 10.55, 13.052, 15.055, 17.056, 19.058, 21.562, 23.566, 25.568, 27.57, 30.074, 32.076, 34.078, 36.078, 38.582, 40.582, 42.586, 44.589, 47.093, 49.095, 51.098, 53.099, 53.6, 55.601, 57.604, 59.607, 61.61, 64.113, 66.115, 68.117, 70.121, 72.623, 74.626, 75.628, 76.207]
    y-axis "Memory MiB" 0 --> 500
    line [12.13, 137.28, 111.86, 111.86, 111.86, 127.24, 162.18, 167.32, 165.79, 144.66, 144.56, 144.48, 144.39, 159.57, 181.92, 138.26, 154.69, 138.41, 140.74, 137.72, 173.77, 145.25, 144.26, 144.26, 144.26, 144.26, 218.88, 280.44, 204.88, 184.61, 184.53, 168.12, 152.25, 158.2, 196.2, 166.09, 188.55, 172.41, 191.6, 0]
    line [8.79, 133.71, 108.16, 108.16, 108.16, 123.59, 158.49, 163.77, 161.94, 140.98, 140.88, 140.8, 140.71, 155.93, 178.86, 134.76, 152.19, 134.71, 137.03, 134.01, 170.06, 141.52, 140.54, 140.54, 140.54, 140.54, 215.2, 277.35, 201.24, 180.22, 180.94, 164.4, 148.52, 154.49, 190.81, 162.36, 185.93, 168.7, 187.98, 0]
Loading

Deterministic fixture · required contract

The fixture exercises 15 routes: 8 are expected to emit rows and 7 intentionally exercise empty, loading, or timeout behavior.

Metric Base HEAD Δ
Run status success success —
Extracted rows / contract 40 / 40 40 / 40 0 (0.00%)
Contract fill 100.00% 100.00% 0.00 pp (0.00%)
Sites with rows 8 / 15 8 / 15 0 (0.00%)
Sites meeting row contract 15 / 15 15 / 15 0 (0.00%)
Unexpected empty sites 0 0 0
Partial-row sites 0 0 0
Site outcomes extracted: 7; HTTP error + rows: 1; empty: 3; timeout + empty: 4 extracted: 7; HTTP error + rows: 1; empty: 3; timeout + empty: 4 —
Observed duration 19.87 s 19.86 s -0.01 s (-0.03%)
Estimated CPU 0.41 s 0.42 s +0.01 s (+2.18%)
Peak PSS 65.67 MiB 65.66 MiB -0.01 MiB (-0.01%)
Peak RSS 69.25 MiB 69.32 MiB +0.07 MiB (+0.11%)
Peak threads 18 18 0 (0.00%)
Mismatched sites 0 0 0
Timeout with items 0 0 0

Full HTML, JSON, CSV, logs, and page snapshots: workflow run and full spider-bench-results artifact.

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.

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

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 Page.navigate commands per binary.

Common ancestor 7d7189c897 → HEAD 1fa7cb1aad; benchmark order: head-first; workflow: success.

Session resilience

Metric Base HEAD
Attempted / planned 200 / 200 200 / 200
Direct observable pass 199 / 200 199 / 200
Failures / recovered 1 / 1 1 / 1
Recovery failures 0 0
Lifecycle order violations 0 0
Network order violations 0 0
Wall time 347.2 s 339.0 s

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

Metric Base HEAD Δ
Boundary samples 200 200 0
Boundary RSS samples 200 200 0
Boundary PSS samples 200 200 0
Periodic peak RSS 263.1 MiB 267.3 MiB +4.2 MiB
Periodic peak PSS 259.8 MiB 263.4 MiB +3.6 MiB
RSS · first 10 avg 149.6 MiB 175.2 MiB +25.5 MiB
RSS · last 10 avg 187.4 MiB 187.6 MiB +0.3 MiB
RSS · last − first window +37.8 MiB +12.5 MiB -25.3 MiB
RSS · warm slope / 100 nav +3.8 MiB +2.8 MiB -1.1 MiB
PSS · first 10 avg 146.5 MiB 171.4 MiB +24.9 MiB
PSS · last 10 avg 184.0 MiB 184.5 MiB +0.5 MiB
PSS · last − first window +37.5 MiB +13.1 MiB -24.4 MiB
PSS · warm slope / 100 nav +3.2 MiB +2.8 MiB -0.4 MiB
Peak file descriptors 60 57 -3
Peak threads 29 29 0

HEAD memory by 50-navigation quarter

HEAD range Avg RSS Final RSS Peak RSS Avg PSS Final PSS Peak FD
1–50 179.7 MiB 164.5 MiB 212.0 MiB 176.1 MiB 161.0 MiB 53
51–100 182.3 MiB 187.9 MiB 207.8 MiB 179.2 MiB 184.3 MiB 53
101–150 183.5 MiB 165.7 MiB 210.7 MiB 180.0 MiB 162.1 MiB 52
151–200 185.3 MiB 178.5 MiB 211.7 MiB 182.0 MiB 175.3 MiB 53

Raw reports and per-navigation boundary samples: workflow run and full sequential-navigation-soak-results artifact.

Public-site timing and memory are observational. Use the A/B deltas and trend shape as evidence, not as a deterministic performance threshold.

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

CI Regression Report

Source CI run · source state at render: in_progress · artifacts: 6/6

Check Status Signal
Release regression ✅ HEAD/base failures 0/0; raw binary +0.000283%
Frontend differential ✅ 1,020/1,020 cases matched; 0 issues
Agent episodes ✅ 8/8 Moli episodes passed; 0 failures
Runtime/CDP contracts ✅ 26 contract cases; 0 failures
CDP smoke ✅ 52/52 groups passed; 619 scenarios
WebMainBench ✅ 545/545 completed; 0 unexpected failures
Release regression — ✅ HEAD/base failures 0/0; raw binary +0.000283%

Package and image size

Metric Base HEAD Delta Delta %
Raw binary 148.49 MiB 148.49 MiB +440 B +0.000283%
Stripped binary 102.17 MiB 102.17 MiB 0 B 0.00%
gzip binary 50.93 MiB 50.93 MiB +760 B +0.001423%
Rootfs 155.39 MiB 155.39 MiB 0 B 0.00%
gzip rootfs 59.80 MiB 59.80 MiB +1.54 KiB +0.002512%

Startup latency and PSS

Case Base p50 HEAD p50 Delta Base PSS HEAD PSS Delta
Serve ready 27.45 ms 27.19 ms −0.26 ms 3.63 MiB 4.24 MiB +622.50 KiB
CDP first page 50.12 ms 50.62 ms +0.50 ms 3.90 MiB 3.75 MiB −157.00 KiB
CDP warm page 12.59 ms 12.81 ms +0.22 ms 49.06 MiB 49.13 MiB +70.00 KiB
CLI about:blank 15.34 ms 15.51 ms +0.17 ms 3.63 MiB 3.43 MiB −214.50 KiB
CLI local JS 19.79 ms 19.36 ms −0.43 ms 1.63 MiB 3.48 MiB +1.85 MiB

Concurrency matrix

Concurrency Base p50 HEAD p50 Delta Base PSS HEAD PSS Delta HEAD failures Unstable B/H
1 18.90 ms 18.48 ms −0.42 ms 630.00 KiB 653.00 KiB +23.00 KiB 0 0/0
5 20.72 ms 21.75 ms +1.03 ms 26.95 MiB 26.99 MiB +37.50 KiB 0 0/0
10 20.23 ms 20.18 ms −0.05 ms 18.02 MiB 12.50 MiB −5.51 MiB 0 0/0
25 20.48 ms 21.10 ms +0.62 ms 26.11 MiB 13.23 MiB −12.88 MiB 0 0/0
100 20.00 ms 20.73 ms +0.73 ms 27.15 MiB 13.34 MiB −13.81 MiB 0 0/0
Frontend differential — ✅ 1,020/1,020 cases matched; 0 issues
Match DOM mismatch Diagnostic mismatch Moli error Reference error Infrastructure error Mismatched frames Duration
1,020 0 0 0 0 0 0 6m 40.32s
Agent episodes · Moli vs Chromium — ✅ 8/8 Moli episodes passed; 0 failures
Fast contract Episodes Passed Assertions Ready p50 Episode p50
Moli 8 8 47/47 3.44 ms 26.05 ms
Chromium 8 8 47/47 253.86 ms 91.33 ms
Operation p50 Chromium Moli Delta Delta %
navigate 49.75 ms 5.75 ms −44.00 ms −88.44%
observe 0.84 ms 0.89 ms +0.05 ms +6.39%
fill 3.87 ms 3.48 ms −0.39 ms −10.08%
click 6.13 ms 4.25 ms −1.88 ms −30.64%
Idle-resource episode Peak RSS Peak PSS Average CPU Peak CPU Peak processes Sampler
Moli 65.16 MiB 61.75 MiB 0.77% 10.01% 1 ✅
Chromium 1286.68 MiB 409.51 MiB 1.97% 95.70% 13 ⚠️ PSS partial
Runtime and CDP session contracts — ✅ 26 contract cases; 0 failures
Suite Cases Failures Median case p50 Median case p95 Median peak PSS p50
Synthetic fetch 13 0 18.72 ms 19.76 ms 826.00 KiB
Long-lived CDP session 13 0 18.16 ms 19.12 ms —
CDP smoke — ✅ 52/52 groups passed; 619 scenarios

Workers: 4 · cumulative group time: 188.33 s · failed groups: 0

Slowest group Scenarios Duration Status
scrollbar-visibility 22 28.05 s ✅
target-lifecycle 24 16.82 s ✅
dom-input 27 12.61 s ✅
multi-page 45 11.18 s ✅
chromium-cdp 56 11.14 s ✅
WebMainBench · 545 pages — ✅ 545/545 completed; 0 unexpected failures
Completed Successful Expected DNS failure Unexpected failures Panics Crashes Timeouts Empty output
545/545 544 1 0 0 0 0 0

Frozen HTML · Linux · --wait done · 45 seconds per page · no retries. Content quality is evaluated separately.

Diagnostics: webmainbench-results — every page's Markdown, stderr, and exit status. Source run and artifacts

All artifact fields are parsed by the trusted default-branch renderer; missing or invalid inputs remain visible as unavailable.

@lanyue-llk lanyue-llk left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

审查版本:cc89392f56f7549041c9efff71055f190fb4a5db。结论:建议修改后再合入。确认两项功能缺陷,已分别留下行内评论。

需求是否真实、是否应改 moli

  • --eval 与 --dump 互斥是真实的 CLI 限制;允许明确交互后复用标准导出器,符合 moli 的浏览器自动化定位。无需增加网站特例、猜测 handler 或自动点击所有按钮,这个组合方案总体够小、通用。
  • 但 WebMainBench 8798f93a-240c-46d7-a8d1-a5fb011279fc(mcubed 的 Mets 连胜/连败页)不证明 Markdown 缺少这项能力。冻结 HTML 确有 91 个 listN,页面脚本用 hideallids() 隐藏它们;详情已经在 DOM 中。准确 PR 二进制对同一冻结 HTML 默认导出、显式点击 91 个展开链接后导出,均为 53,412 字节、91 个 WINNER,逐字节相同,SHA256 均为 f807ca1ab1dbfa0ce99dbbcb93528eaa22a377014484f2f90901f1911eb6f76d。这与 moli-html2md/src/visibility.rs 保留折叠详情的设计及现有测试一致。
  • 因而不需要为“导出这页已有的比赛明细”修改 moli;这个 PR 应定位为通用 CLI 组合改进。现有 --wait-script 也可以显式操作再导出,不过把一次准备动作放在 eval 中,比把副作用塞进 readiness predicate 更清楚。请更正描述中该案例与能力缺口的因果关系;如要以真实网站证明新增价值,应补充交互后才创建/加载正文的案例及完整复现条件。不能将这项功能当作已有只读成绩的修复。

仓库要求、实现与回归

  • 标题、使用说明和 7 个文件的范围清楚;仓库未提供额外 PR 模板。Promise、异常、返回值和评测边界写明了,但正文对“返回值被丢弃”的承诺与实现不符,导航行为也缺少说明。
  • 参数来源互斥、纯 eval 的无效正文选项拒绝、raw 文档拒绝、标准导出器复用均合理,未发现网站耦合或为该数据集定制的代码。原有值输出路径保留。
  • 新增 DOM 返回值测试不足以证明任意返回值被忽略;同页 DOM 修改测试不足以覆盖点击链接、表单或 location 导航。需要按这些用户场景补回归测试。

验证证据

当前提交的 CI Format、Clippy、Nextest 全部成功;Nextest 日志为 19,701 passed、16 skipped。本机准确 PR 版本格式和 diff 检查通过,20 个 eval 相关测试、82 个 CLI 测试通过;额外实际 CLI 测试覆盖两种脚本来源 × HTML/Markdown/JSON、同步抛错/Promise 拒绝、循环返回对象、getter、同源导航和冻结比赛页。

最小修正是在 execute 中复用已有 evaluate_runtime_expression_with_await_async(expression, true),保留纯值输出的 ByValue 路径。我在隔离副本验证了这个单行替换:循环对象不再失败、返回对象 getter 不执行、导航导出目标页面,原有 20 个 eval 测试和异常零 stdout 契约继续通过。无需新建底层 API。

Comment thread moli/src/eval_output.rs Outdated
Comment thread moli/src/app.rs Outdated
@ldm0
ldm0 self-requested a review October 8, 2026 11:36
@lanyue-llk
lanyue-llk marked this pull request as ready for review October 8, 2026 12:42

@lanyue-llk lanyue-llk left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

复审版本:cfd1087dbe47b90f8d692c17ac0acf23f750eafe。本轮扩大检查后,确认剩余 1 项 P2:交互进入目标页后,load handler 发起的下一次导航会被遗漏,详见行内评论。建议修正此项后再合入。

上轮两项问题已修复:准备执行不再按值序列化普通返回对象;首次交互导航可导出目标页。循环对象、普通 getter、Promise 返回对象及链接/location 导航已有对应回归测试。PR 描述也已正确区分 CLI 组合能力与比赛页已有内容,不再将那 91 组明细当作默认采集缺陷的依据。

本轮没有只重跑新增测试,另外检查和实测了:

  • --eval、--eval-file、stdin;HTML、Markdown、JSON、两种 semantic tree、截图、全页截图、PDF。
  • 表单 requestSubmit、导航前 await 定时器、history.pushState、HTTP 302 跳转、目标页 load 再跳转及连续两次 load 跳转。
  • JSON 最终 URL、状态、标题和正文;交互/导航后截图的实际颜色像素,确认导出的是更新后的页面。
  • --with-base、--with-frames、strip、network trace、disable-js 组合。
  • 同步异常、Promise 拒绝、异常同时请求导航;204/205、下载响应、404 和 JSON 目标。204/205/下载保留原文档是既有正确语义;失败路径均不输出 dump。

准确提交的仓库 CI 全部成功,本机 Format/diff 检查通过。使用仓库要求的 Nextest 对全部 fetch CLI/参数测试运行,249/249 通过。普通 cargo test 的共享进程方式会因全局日志订阅及并发时序使其他用例互相干扰,独立进程 Nextest 排除了这项干扰;它不是此 PR 的回退。

新发现已做根因与修正验证:直接 fetch 中间页会继续到最终页,但通过 eval 进入同一页时停在中间页,且 HTML 中已出现 load handler 写入的标记,证明 handler 执行过、只是导航观察器提前返回。在隔离副本给 Follow 续跑路径复用现有生命周期/待导航 reconciliation 后,两种表达式来源 × HTML/Markdown/JSON,以及连续两次 load 跳转均正确输出最终正文,249 项回归测试继续全部通过。无需定时等待、按钮特例或新导航 API。验证改动已撤回,没有提交或推送代码。

Comment thread moli/src/eval_output.rs
@ldm0
ldm0 force-pushed the codex/fetch-eval-before-dump branch from b682173 to 1fa7cb1 Compare October 10, 2026 08:05
@ldm0
ldm0 merged commit 7e87eef into main Oct 10, 2026
19 checks passed
@ldm0
ldm0 deleted the codex/fetch-eval-before-dump branch October 10, 2026 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants