Skip to content

fix(fetch): reject Office documents as raw downloads - #1433

Merged
ldm0 merged 2 commits into
mainfrom
codex/docx-raw-download-classification
Oct 12, 2026
Merged

ldm0 merged 2 commits into
mainfrom
codex/docx-raw-download-classification

Conversation

@lanyue-llk

Copy link
Copy Markdown
Contributor

Moli currently classifies PDF responses as raw downloads, but treats the standard DOCX MIME type as a renderable document. fetch --dump markdown can therefore exit successfully while writing ZIP bytes beginning with PK instead of document text.

This change centralizes the existing Office MIME set and uses it for both raw main-document handling and ORB classification. OOXML, common legacy Office, and macro-enabled Office responses now follow the same raw-download contract as PDF and ZIP. A Markdown request fails clearly with empty stdout; automatic/raw and JSON transfer behavior remain available. HTML and text/plain continue through the normal document renderer.

The behavior tests cover the public CLI outcome for DOCX and negative controls for HTML and plain text. MIME tests cover representative Word, Excel, and PowerPoint types. This does not add PDF/DOCX parsing, benchmark-specific routing, or postprocessing.

This PR targets main directly and is independent of #919 and the #1334–#1432 product stack. Format, Clippy, and the test suite are delegated to repository CI; no local test suite was run.

@ldm0
ldm0 self-requested a review October 12, 2026 09:19
@ldm0 ldm0 added the 1.1.17 label Oct 12, 2026
@github-actions

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 da7a9b254b → HEAD 2101e9101a; benchmark order: base-first; workflow: success.

Session resilience

Metric Base HEAD
Attempted / planned 200 / 200 200 / 200
Direct observable pass 199 / 200 198 / 200
Failures / recovered 1 / 1 2 / 2
Recovery failures 0 0
Lifecycle order violations 0 0
Network order violations 0 0
Wall time 498.0 s 475.6 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 268.6 MiB 266.2 MiB -2.5 MiB
Periodic peak PSS 266.8 MiB 262.5 MiB -4.2 MiB
RSS · first 10 avg 180.2 MiB 183.0 MiB +2.8 MiB
RSS · last 10 avg 195.9 MiB 190.1 MiB -5.8 MiB
RSS · last − first window +15.7 MiB +7.1 MiB -8.6 MiB
RSS · warm slope / 100 nav +4.7 MiB +6.0 MiB +1.3 MiB
PSS · first 10 avg 176.9 MiB 180.1 MiB +3.1 MiB
PSS · last 10 avg 193.5 MiB 186.6 MiB -6.9 MiB
PSS · last − first window +16.6 MiB +6.5 MiB -10.0 MiB
PSS · warm slope / 100 nav +4.7 MiB +5.8 MiB +1.1 MiB
Peak file descriptors 58 58 0
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 181.6 MiB 167.4 MiB 236.1 MiB 178.5 MiB 164.1 MiB 55
51–100 186.9 MiB 181.1 MiB 233.0 MiB 183.5 MiB 177.5 MiB 53
101–150 188.0 MiB 175.6 MiB 230.6 MiB 184.5 MiB 172.2 MiB 54
151–200 191.0 MiB 182.6 MiB 228.1 MiB 187.5 MiB 179.1 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

Copy link
Copy Markdown

Spider Bench A/B

✅ All benchmark browser service runs completed; results are informational.

Public HEAD: 179 / 240 rows; 37 / 48 sites produced rows; 11 unexpected empty sites.

✅ Deterministic fixture contract is clean.

Common ancestor da7a9b254bcf → HEAD 2101e9101a88; benchmark order: base-first; workflow: success.

Public 48-site run · informational

Metric Base HEAD Δ
Run status success success —
Extracted rows / contract 164 / 240 179 / 240 +15 (+9.15%)
Contract fill 68.33% 74.58% +6.25 pp (+9.15%)
Sites with rows 34 / 48 37 / 48 +3 (+8.82%)
Sites meeting row contract 32 / 48 35 / 48 +3 (+9.38%)
Unexpected empty sites 14 11 -3 (-21.43%)
Partial-row sites 2 2 0 (0.00%)
Site outcomes extracted: 32; HTTP error + rows: 2; empty: 8; navigation error + empty: 4; snapshot error + empty: 2 extracted: 36; HTTP error + rows: 1; empty: 8; HTTP error + empty: 1; snapshot error + empty: 2 —
Observed duration 53.48 s 45.38 s -8.10 s (-15.14%)
Estimated CPU 44.22 s 47.00 s +2.78 s (+6.30%)
Peak PSS 267.69 MiB 277.00 MiB +9.30 MiB (+3.48%)
Peak RSS 271.36 MiB 279.41 MiB +8.05 MiB (+2.97%)
Peak threads 26 27 +1 (+3.85%)
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 10 / 40 25 / 40 +15

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" [1.538, 2.54, 3.041, 4.544, 6.047, 7.549, 9.052, 9.553, 10.555, 12.056, 13.558, 15.059, 16.561, 18.063, 19.565, 21.067, 22.569, 24.07, 25.573, 27.074, 28.075, 29.577, 31.079, 32.581, 33.582, 34.082, 35.585, 37.087, 38.589, 40.091, 41.593, 43.094, 44.596, 46.098, 47.6, 49.103, 50.606, 52.108]
    y-axis "CPU percent" 0 --> 200
    line [31.99, 133.78, 141.73, 93.77, 137.69, 161.89, 93.85, 189.46, 137.79, 115.91, 173.72, 59.94, 33.97, 0, 5.99, 85.93, 19.97, 2, 3.99, 2, 0, 133.87, 105.92, 151.82, 99.9, 117.87, 139.68, 171.54, 65.91, 109.8, 165.78, 93.83, 2, 99.81, 13.97, 127.71, 71.89, 15.97]
Loading
xychart-beta
    title "Base memory: RSS then PSS"
    x-axis "Elapsed seconds" [0.038, 1.538, 2.54, 3.041, 4.544, 6.047, 7.549, 9.052, 9.553, 10.555, 12.056, 13.558, 15.059, 16.561, 18.063, 19.565, 21.067, 22.569, 24.07, 25.573, 27.074, 28.075, 29.577, 31.079, 32.581, 33.582, 34.082, 35.585, 37.087, 38.589, 40.091, 41.593, 43.094, 44.596, 46.098, 47.6, 49.103, 50.606, 52.108, 53.482]
    y-axis "Memory MiB" 0 --> 500
    line [12.54, 89.77, 127.66, 140.4, 122.61, 171.54, 182.54, 191.21, 187.54, 155.14, 180.14, 175.92, 163.05, 146.91, 148.37, 148.73, 174.85, 140.97, 142.89, 139.09, 139.14, 139.24, 156.15, 156.8, 159.6, 271.36, 259.6, 208.01, 226.57, 176.46, 176.33, 171.49, 156.69, 145.2, 145.48, 153.91, 193.88, 171.4, 148.65, 0]
    line [9.25, 86.07, 123.66, 136.46, 118.98, 167.85, 178.58, 187.57, 184.02, 149.85, 176.49, 172.27, 159.4, 143.26, 144.72, 145.08, 171.2, 137.32, 139.23, 135.49, 135.54, 135.59, 153.28, 152.7, 156.04, 267.69, 255.36, 204.74, 222.79, 172.74, 173.05, 167.93, 153, 141.51, 141.79, 150.28, 190.12, 167.55, 144.81, 0]
Loading

HEAD

xychart-beta
    title "HEAD CPU"
    x-axis "Elapsed seconds" [1.047, 1.548, 2.55, 4.055, 5.056, 6.559, 7.561, 9.063, 10.064, 11.566, 12.567, 14.07, 15.071, 16.573, 17.574, 19.075, 20.075, 21.577, 23.078, 24.079, 25.581, 26.082, 26.583, 28.085, 29.086, 30.588, 31.59, 33.091, 34.092, 35.595, 36.596, 38.099, 39.101, 40.603, 41.605, 42.106, 43.107, 44.109]
    y-axis "CPU percent" 0 --> 500
    line [5.99, 91.9, 3.99, 121.73, 107.79, 167.67, 137.79, 163.69, 90.04, 133.84, 139.83, 103.85, 129.8, 123.9, 117.92, 89.88, 55.97, 80.01, 72, 135.72, 103.82, 103.82, 105.84, 129.88, 155.83, 59.89, 151.8, 135.95, 102, 123.64, 5.99, 135.82, 125.93, 19.99, 67.89, 197.59, 75.89, 119.78]
Loading
xychart-beta
    title "HEAD memory: RSS then PSS"
    x-axis "Elapsed seconds" [0.048, 1.047, 1.548, 2.55, 4.055, 5.056, 6.559, 7.561, 9.063, 10.064, 11.566, 12.567, 14.07, 15.071, 16.573, 17.574, 19.075, 20.075, 21.577, 23.078, 24.079, 25.581, 26.082, 26.583, 28.085, 29.086, 30.588, 31.59, 33.091, 34.092, 35.595, 36.596, 38.099, 39.101, 40.603, 41.605, 42.106, 43.107, 44.109, 45.383]
    y-axis "Memory MiB" 0 --> 500
    line [12.66, 64.85, 95.7, 99.07, 132.3, 131.19, 148.14, 179.72, 185.73, 173.8, 168.11, 163.17, 173.75, 170.05, 170.26, 155.11, 161.56, 152.58, 157.69, 145.99, 162.61, 218.98, 279.41, 210.32, 208.27, 221.2, 166.14, 182.14, 182.82, 151.86, 163.62, 152.45, 203.48, 218.75, 176.74, 178.96, 161.05, 159.33, 182.15, 0]
    line [9.21, 61.1, 91.96, 95.28, 128.5, 127.46, 144.38, 175.95, 181.85, 170.48, 164.28, 159.25, 169.88, 166.87, 166.37, 151.21, 157.67, 149.06, 153.89, 142.13, 158.76, 215.14, 277, 205.92, 204.33, 217.25, 162.29, 178.21, 178.77, 147.96, 159.71, 148.61, 200.24, 212.76, 172.95, 175.13, 156.74, 155.54, 178.38, 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.90 s 19.86 s -0.04 s (-0.19%)
Estimated CPU 0.48 s 0.42 s -0.06 s (-12.06%)
Peak PSS 66.13 MiB 66.17 MiB +0.04 MiB (+0.06%)
Peak RSS 69.86 MiB 69.73 MiB -0.13 MiB (-0.18%)
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

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.000072%
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; 621 scenarios
WebMainBench ✅ 545/545 completed; 0 unexpected failures
Release regression — ✅ HEAD/base failures 0/0; raw binary +0.000072%

Package and image size

Metric Base HEAD Delta Delta %
Raw binary 148.81 MiB 148.81 MiB +112 B +0.000072%
Stripped binary 102.46 MiB 102.46 MiB 0 B 0.00%
gzip binary 51.05 MiB 51.05 MiB +21 B +0.000039%
Rootfs 155.71 MiB 155.71 MiB 0 B 0.00%
gzip rootfs 59.94 MiB 59.94 MiB +219 B +0.000348%

Startup latency and PSS

Case Base p50 HEAD p50 Delta Base PSS HEAD PSS Delta
Serve ready 30.48 ms 27.49 ms −2.99 ms 4.88 MiB 4.23 MiB −665.50 KiB
CDP first page 46.15 ms 52.19 ms +6.04 ms 9.51 MiB 4.25 MiB −5.26 MiB
CDP warm page 17.91 ms 12.87 ms −5.04 ms 49.48 MiB 50.23 MiB +768.50 KiB
CLI about:blank 22.79 ms 16.19 ms −6.60 ms 3.57 MiB 4.38 MiB +826.50 KiB
CLI local JS 20.19 ms 21.68 ms +1.49 ms 4.13 MiB 4.76 MiB +646.50 KiB

Concurrency matrix

Concurrency Base p50 HEAD p50 Delta Base PSS HEAD PSS Delta HEAD failures Unstable B/H
1 19.13 ms 21.16 ms +2.03 ms 1021.00 KiB 456.00 KiB −565.00 KiB 0 0/0
5 21.71 ms 23.78 ms +2.07 ms 13.64 MiB 13.63 MiB −16.00 KiB 0 0/0
10 22.36 ms 29.89 ms +7.54 ms 14.33 MiB 11.47 MiB −2.86 MiB 0 0/0
25 23.59 ms 30.04 ms +6.46 ms 14.37 MiB 7.88 MiB −6.48 MiB 0 0/0
100 22.43 ms 35.60 ms +13.17 ms 17.09 MiB 6.69 MiB −10.40 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.99s
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.35 ms 28.29 ms
Chromium 8 8 47/47 252.59 ms 91.29 ms
Operation p50 Chromium Moli Delta Delta %
navigate 42.61 ms 8.96 ms −33.64 ms −78.96%
observe 0.92 ms 0.87 ms −0.05 ms −5.78%
fill 4.12 ms 3.51 ms −0.60 ms −14.68%
click 5.82 ms 3.97 ms −1.85 ms −31.72%
Idle-resource episode Peak RSS Peak PSS Average CPU Peak CPU Peak processes Sampler
Moli 65.72 MiB 63.12 MiB 0.74% 10.00% 1 ✅
Chromium 1292.18 MiB 333.19 MiB 1.96% 91.71% 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 17.94 ms 19.01 ms 581.00 KiB
Long-lived CDP session 13 0 18.12 ms 18.79 ms —
CDP smoke — ✅ 52/52 groups passed; 621 scenarios

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

Slowest group Scenarios Duration Status
scrollbar-visibility 22 13.80 s ✅
target-lifecycle 24 10.11 s ✅
dom-input 27 8.54 s ✅
chromium-cdp 56 8.43 s ✅
multi-page 45 7.47 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.

@ldm0
ldm0 merged commit 02eee0e into main Oct 12, 2026
19 checks passed
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