Repository navigation
feat(web-extract): support source-qualified URL benchmarks and independent reports - #260
Conversation
There was a problem hiding this comment.
This review found 9 issue(s), including 9 blocking issue(s).
There was a problem hiding this comment.
This review found 9 issue(s), including 9 blocking issue(s).
There was a problem hiding this comment.
This review found 9 issue(s), including 9 blocking issue(s).
There was a problem hiding this comment.
This review found 5 issue(s), including 5 blocking issue(s).
There was a problem hiding this comment.
This review found 6 issue(s), including 6 blocking issue(s).
There was a problem hiding this comment.
This review found 3 issue(s), including 3 blocking issue(s).
There was a problem hiding this comment.
This review found 3 issue(s), including 3 blocking issue(s).
There was a problem hiding this comment.
This review found 3 issue(s), including 3 blocking issue(s).
src/harness/web_extract/report_suite.py(token_budget_reached): stopped group "src/harness/web_extract/report_suite.py" mid-review: used 511079 tokens exceeds budget 500000
There was a problem hiding this comment.
This review found 2 issue(s), including 2 blocking issue(s).
src/harness/web_extract/report_suite.py(token_budget_reached): stopped group "src/harness/web_extract/report_suite.py" mid-review: used 558951 tokens exceeds budget 500000
There was a problem hiding this comment.
This review found 3 issue(s), including 3 blocking issue(s).
There was a problem hiding this comment.
This review found 6 issue(s), including 6 blocking issue(s).
There was a problem hiding this comment.
This review found 4 issue(s), including 4 blocking issue(s).
There was a problem hiding this comment.
This review found 3 issue(s), including 3 blocking issue(s).
There was a problem hiding this comment.
This review found 5 issue(s), including 5 blocking issue(s).
There was a problem hiding this comment.
This review found 1 issue(s), including 1 blocking issue(s).
src/harness/web_extract/snapshots.py(token_budget_reached): stopped group "src/harness/web_extract/snapshots.py" mid-review: used 572409 tokens exceeds budget 500000
There was a problem hiding this comment.
✅ Re-review complete · eed0365
No findings in this incremental review.
lanyue-llk
left a comment
There was a problem hiding this comment.
Review of head eed03658 against main (d4fb973d). tests/web_extract: 979 passed. test_report_ui.mjs passes.
The core contract is sound. Providers receive the schema, instructions and query only, never references. Live and archived inputs are separated at plan, run, probe, collection and preview. Missing reference coverage stays unavailable. Text and URL matching uses the same record_value_key in scoring, details and qualification. The Cloudflare deployment proof is keyed by immutable deployment ID plus inventory version, and I found no stale-proof or cache-poisoning path.
Should fix
- Medium: segments can mix execution configurations within one method (inline,
report.py:3032). Assembling a method from disjoint segments checks dataset, task, schema, HTML, resources, input mode, instructions and live-policy age. Across segments it compares only the method name. It never comparesnative_options/ input route, the plan's participant entry,pipeline_sha256or the scorer bindings. For example, Oxylabs segment A could run with URL input on pipeline X and segment B with HTML upload on pipeline Y. The report would show one "Oxylabs" result with one denominator, which is not a single declared treatment. Require these to be equal across segments, add a negative test, and disclose any difference that is allowed. - Medium: existing SWDE plans no longer run or resume (inline,
certification.py:179). The newplan.get("extraction_instructions") != record_instructions(home)check applies to every adapter benchmark, but plans created bymain'screate_plannever storedextraction_instructions. Any in-flight or resumed SWDE cohort now fails with "Frozen extraction instructions differ". Treat an absent field as the historical default instruction for plans that predate it. - Medium: report builds now depend on live hosting (inline,
report.py:3340).record_previewcallsverify_bound_manifest, which now makes a Cloudflare API call and, without a cached proof orCLOUDFLARE_*credentials, fetches every page and resource. Previously it fetched onlysnapshots.json. Rebuilding a report from frozen evidence becomes slow, network-bound and nondeterministic: it fails offline or after transient 5xx errors. Give the build an offline check (the hash-bound fixture receipts plus the manifest) and keep live byte audits in collection and publication. - Low-medium: URL answers with surrounding whitespace are scored as wrong (inline,
swde.py:240-246).value.replace(" ", "%20")runs before stripping. Reproduced:record_value_key({'url':'https://a.com/p/q','value_kinds':{'f':'url'}}, 'f', ' https://a.com/x.jpg', 'whitespace')returns'https://a.com/p/%20https:/a.com/x.jpg'. Without the space it returns'https://a.com/x.jpg'. Strip before encoding, and add a paired control toevaluation/scoring-regressions.json, since both error directions are plausible. - Low: the portable evaluator can drift from the scorer actually used (inline,
records.py:141).dataset/evaluate.pyis a copy ofswde.pymade at prepare time, but runtime scoring uses the liveswde.py. Nothing checks thatevaluate.py == exported_evaluator(), and review receipts recordscorer_sha256fromevaluate.py. Fixing #4 would make them diverge silently. Require the bytes to match invalidate_dataset, or score through the frozen file. - Low: the suite page bypasses the owner's layout and localization (inline,
report_suite.py:45). Composition goes throughreport.build/check, which is good. But the suite home, nav and table labels ("方法", "查看结果", "耗时与价格"…) are inline Chinese strings, outsidemessages.jsonandpage(). Non-zh languages are rejected, and child reports are forced tozheven though the owner supports English. AGENTS.md asks report CLIs to default to English where the renderer supports it. Usepage()and message keys, and pass the language through.
Design (simplicity)
- The Cloudflare reuse path adds a lot of machinery for a speed-up: an API identity check, a per-deployment proof cache, flock, a fallback to direct checks, an offline receipt validator and a legacy-manifest branch.
publication_metadata(snapshots.py:373-392) also runs two near-duplicate checks that every matching page was verified. Consider whether the direct byte check plus a cached receipt would be enough. captured_htmlswitches existing Zyte/SWDE HTML upload from strict UTF-8 decoding toerrors="replace", so non-UTF-8 pages are now altered silently instead of rejected.
Merge coordination: merge-tree shows 10 conflicting files with #258 (certification.py, pipeline.py, repair.py, report.py, configs/report-templates.json, the example README and four test files) and 2 with #259 (report.py, test_report_ui.mjs). The three open Web Extract PRs need an agreed order. #259 is the smallest; merging it first and then rebasing the others keeps conflict resolution in one place at a time.
|
The six inline findings are addressed in 56a3ba7, with per-thread explanations and regression coverage. Two points from the overall review also received follow-up in 6463b56:
The field-extraction cohort renderer itself currently supports Chinese authored content only. The suite now shares page layout/localization and passes its selected language through, while preserving an explicit rejection of unsupported English builds and the not-generated notice. Validation: 993 Web Extract scenarios passed for the first commit; follow-up checks passed 371 input/runtime scenarios and 191 snapshot/repair scenarios, plus the JavaScript interaction suite, UTF-8/source-language/document checks, and desktop/narrow, light/dark suite navigation. Recomputing the existing 1,797 result scores with the URL-whitespace fix produced no changes. No provider calls or historical evidence were rewritten. #260 is currently mergeable. #258 and #259 remain open; no merges or cross-PR branch rewrites were performed. |
lanyue-llk
left a comment
There was a problem hiding this comment.
Re-review at 6463b560, P0/P1 only.
Fixed since eed03658, verified in code:
- Old SWDE plans without
extraction_instructionsfall back to the frozen default, but only for an unchanged SWDE dataset. - Report builds no longer need live hosting.
record_previewchecks the retained manifest offline, and the hosted-bytes audit runs only at publication (audit_previews). - URL values are stripped before encoding, with paired controls (boundary whitespace matches; an inner space still separates paths).
validate_datasetrejects a records dataset whose pinnedevaluate.pydiffers from the runtime scorer.- The suite page now goes through
owner.pageand the message catalog instead of hard-coded Chinese.
No P0 found. One P1 remains:
- Segments run under different configurations are still pooled under one method label. They are now disclosed, but not rejected. See the inline comment.
Textual conflicts with #258 (13 files) and #259 (7 files) remain. Suggested merge order: #259, then #258, then this PR.
There was a problem hiding this comment.
This review found 1 issue(s), including 1 blocking issue(s).
There was a problem hiding this comment.
This review found 1 issue(s), including 1 blocking issue(s).
src/harness/web_extract/report_suite.py(token_budget_reached): stopped group "src/harness/web_extract/report_suite.py" mid-review: used 525320 tokens exceeds budget 500000
There was a problem hiding this comment.
This review found 1 issue(s), including 1 blocking issue(s).
There was a problem hiding this comment.
This review found 1 issue(s), including 1 blocking issue(s).
There was a problem hiding this comment.
This review found 2 issue(s), including 2 blocking issue(s).
lanyue-llk
left a comment
There was a problem hiding this comment.
Re-review at fda409a2, P0/P1 only.
Fixed since 6463b560: segments whose native options, participant settings, pipeline or scorer differ are now rejected ("register them as separate participants"). Each certified segment is also checked against its own certificate. That closes the remaining P1 on this PR alone. The suite registry is now bound to the profile through child content and profile hashes.
No P0 found. One P1 appears only when this PR merges after #258 and #259. Git will not flag it, and each branch's CI passes alone. Details are in the inline comment.
Not blocking: captured_html now trusts docinfo.encoding for every qualified page. For a page with no HTTP or meta charset, lxml reports ISO-8859-1, so undeclared UTF-8 becomes mojibake. Verified locally: '价格 ¥24'.encode() decodes to ä»·æ\xa0¼ Â¥24. This now matches reference_support, so qualification and input agree. Pages with non-ASCII reference values will simply fail qualification, but ASCII-only cases can pass while engines receive garbled text. Consider recording the effective encoding at qualification time instead of relying on libxml2's default.
There was a problem hiding this comment.
✅ Re-review complete · d4dd66a
No findings in this incremental review.
89c8981 to
9434920
Compare
There was a problem hiding this comment.
This review found 2 issue(s), including 2 blocking issue(s).
There was a problem hiding this comment.
✅ Re-review complete · 634b251
No findings in this incremental review.
Web Extract now supports source-qualified URL tasks with custom fields and list queries. Live tasks use the original website; archived tasks use a version-bound public HTML service. Providers receive field requirements, never reference answers.
Expanded SWDE (210 tasks), NewsXLM (189) and LiveWeb-IE (200) are public, independently pinned Hugging Face sources. Their cards retain official attribution and license terms and link to Browser Eval. The shared dataset registry, verified cache and records adapter support additional datasets, revisions, task counts and compatible APIs without new runners. Prepared profiles retain the HF commit and input hashes.
The existing pipeline handles source qualification, resumable collection, certified disjoint scopes, snapshot verification and independent benchmark reports. Reports preserve each benchmark's population, quality metrics, latency and normalized prices. Release checks validate each suite child's original evidence and freeze private content and snapshot receipts before hosted verification. Source data, measured responses and generated report assets stay outside Git; the large lock addition is the shared path/hash inventory, including NewsXLM's 13,884 files.
Validation:
Report and ImageGen evaluation-flow diagram (organization access). The report contains 1,797 logical results across three providers and 599 tasks. LiveWeb-IE's original and supplementary tasks retain separate cohorts because their pipeline revisions differ. Earlier physical attempts remain available for retry accounting.