Skip to content

feat(web-search): add Yuanbao and Bocha AI output comparisons - #275

Merged
lanyue-llk merged 105 commits into
mainfrom
codex/yuanbao-web-search
Nov 17, 2026
Merged

lanyue-llk merged 105 commits into
mainfrom
codex/yuanbao-web-search

Conversation

@lanyue-llk

@lanyue-llk lanyue-llk commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Add Tencent Yuanbao Standard/Lite and Bocha AI Search through the existing adapter registry. Compare result lists (L1), additional original excerpts (L2) and generated answers (L3) separately, with independent participants, primary metrics and evidence. Collection retries default to zero; native result slots and physical call receipts are retained.

Reference matching now requires matching article titles, at least 80% overlap in both full article texts, and retention of the reference answer whenever it occurs in the original. Full captures and every candidate outcome are hash-bound and replayed by dataset and report checks. The correction removes 79 admitted case/URL bindings (1,908 to 1,829); all 831 questions, original answers and publisher URLs remain unchanged. Quality scoring retains the same 773 valid factual questions; the remaining 58 reference defects are tracked in #290. The coordinated pins select SimpleQA 3ab37226 and Web Search 28dd415f.

Generated-answer citations support the native IDs and Markdown links present in saved outputs. Release replay rejects unsupported raw HTML before judging. The browser-layout simulation and its two dependencies are removed. Explicit IDs preserve their own returned excerpts; repeated copies of one ID use the first-ranked record, and URL-only links use the first matching URL.

The report defaults to a compact set of quality, P50 latency, price and request-failure columns, with method filtering, numeric sorting, scrolling and an All metrics view. Request failures have their own column and expand into client timeouts, other network errors and API/response errors. Successful empty outputs have a separate column; answer-only L3 responses remain successful. Rejected mirror candidates stay in the dataset audit rather than appearing as unfinished scores. DeepSeek is labeled Search; its content option remains collection context. Historical evidence and software edition identities are preserved.

Validation: targeted scoring, report, shared regression, dataset-pinning and resume tests pass, together with repository lint and documentation checks. The correction reuses saved search outputs, timings, costs and byte-identical judge inputs; no new search or judge calls are required. CI checks cover both Python shards, installation, packaging and rendered references. Measured evidence and report instances remain outside Git.

Report: Web Search comparison (private; existing access retained).

@lexmount-ocr lexmount-ocr Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Review complete · 55e506e

This review found 2 issue(s), including 2 blocking issue(s).

⚠️ 1 warning(s) occurred during review.


⚠️ Warnings:

  • src/harness/web_search/adapters.py (token_budget_reached): skipped round 2 of group "src/harness/web_search/adapters.py,src/harness/web_search/comparison.py,src/harness/web_search/core.py,src/harness/web_search/messages.json,src/harness/web_search/profiles.py,src/harness/web_search/publication.py,src/harness/web_search/report.py,src/harness/web_search/runner.py": used 560851 tokens exceeds budget 500000

profile["protocol"].pop("comparison", None)
validate_profile(profile)
return profile, rows, {"certified": all(r["collection_receipt"].get("certified") for r in receipts),
"synthetic": all(r["collection_receipt"].get("synthetic") for r in receipts),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

bug · medium
P2 — Reject mixed synthetic/measured collections or preserve their synthetic classification. load_run() accepts both kinds, so composing one synthetic provider with one measured provider makes this all(...) false. _report_edition then labels the combined numbers “Measured API evaluation” (with only a diagnostic suffix), removing the synthetic warning despite fixture results contributing to the comparison. Certification still prevents publication, but the generated local report misrepresents its evidence. Reject mixed provenance before composition, or explicitly disclose it without treating the combined rows as wholly measured.

Comment thread src/harness/web_search/runner.py Outdated
)
except (ValueError, AttributeError, TypeError) as exc:
error = error or str(exc)
native_account_error = adapter_for(method["adapter"]).account_error(decoded, method)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

bug · medium
P2 — Do not apply the edition check to failed transports or HTTP error responses. With expected_response_version configured, a timeout with an empty body (or an HTML 502 response) leaves decoded = {}; account_error() then reports ResponseVersionMismatch, sets stopped, and breaks before the configured retry. A temporary network/provider failure consequently interrupts the entire collection as an account problem. Gate edition validation on a successfully received HTTP 200 response, while retaining native account-error detection and the stop behavior for genuine missing/mismatched editions.

@lexmount-ocr lexmount-ocr Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Re-review complete · 4361d1f

No findings in this incremental review.

@lexmount-ocr lexmount-ocr Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Re-review complete · a3dcd33

No findings in this incremental review.

ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ℹ️ Review skipped · 6181eb1

No reviewable content was selected for this run.

@lanyue-llk lanyue-llk closed this Nov 12, 2026
@lanyue-llk lanyue-llk reopened this Nov 12, 2026
@lanyue-llk
lanyue-llk force-pushed the codex/yuanbao-web-search branch from 6181eb1 to f9c3179 Compare November 12, 2026 05:04

ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Review complete · f9c3179

No findings in this review.

@lanyue-llk lanyue-llk changed the title feat(web-search): add Yuanbao Standard and Lite comparisons feat(web-search): add Yuanbao and complete comparison reports Nov 12, 2026

ghost left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Re-review complete · 24197d0

This review found 3 issue(s), including 3 blocking issue(s).

Comment thread src/harness/web_search/assets/report.js Outdated
const rows=[...table.tBodies[0].rows];
rows.sort((a,b)=>{
const x=value(a.cells[index]),y=value(b.cells[index]);
if(x.value===null||y.value===null)return x.value===y.value?original.get(a)-original.get(b):x.value===null?1:-1;

ghost Nov 12, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

maintainability · low
P2: The null-handling expression introduces a nested ternary, which the supplied JavaScript Code Quality Checks explicitly prohibit. Use separate branches for both-null, left-null, and right-null cases, preserving original-order ties and nulls-last behavior in both directions.

Comment on lines +590 to +591
prior_call = saved
request = dict(request, messages=reference_repair_messages(p, request['messages']))

ghost Nov 12, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

bug · medium
P2: Use the same invalid-answer predicate when authorizing and validating a format repair. A saved answer with an exact quoted string (or a field: "url" reference) passes parse_judgments but fails _validate_judge_field_references, so this branch spends a repair call. Final verify_provenance then invokes repaired_messages, which checks only parse_judgments on the prior response and rejects it with “A valid model judgment cannot be retried as a format repair”. Subsequent resumes reject the saved repaired call too. Align the repair-provenance check with both validators used here, and add a regression for a parseable answer that violates the required title/snippet-reference format.

Comment on lines +3672 to +3675
expected = {(cid, method['id']) for cid in ids for method in profile['methods']}
actual = [(r['case_id'], r['method']) for r in relevance_scores if r['case_id'] in ids]
if len(actual) != len(expected) or set(actual) != expected:
raise ValueError('Relevance comparison requires every method and query')

ghost Nov 12, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

bug · high
P1: This rejects the supported provider-scoped annotation scenario. With relevance_methods containing only the frozen providers, score_relevance() deliberately returns scores only for those methods. For an independent benchmark (or metric_kind='relevance'), this comparison instead requires every configured provider, so adding an unjudged Yuanbao configuration aborts report generation rather than rendering its relevance as unavailable. Preserve exact coverage checks within the declared annotation scope and retain unavailable values for other methods; enforce complete assessment separately when explicitly required. Add a build regression combining scoped frozen judgments with an unjudged provider.

ghost left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Review complete · 2be38d3

This review found 4 issue(s), including 4 blocking issue(s).

Comment thread src/harness/web_search/adapters.py Outdated
Comment on lines +29 to +30
expected = (method or {}).get("expected_response_version")
if expected is not None and not error:

ghost Nov 12, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

bug · medium
P2 — Edition verification silently disappears when a Yuanbao method omits expected_response_version (or sets it to null). validate_profile() accepts that configuration, and normalize_response() then accepts both a missing Response.Version and a different edition. For example, a method with output_options.edition='lite' but no expectation accepts a Standard response and can attribute its results and price to Lite. This violates the requirement to verify the returned edition on every call. Require a nonempty edition expectation for Yuanbao methods during preflight, while preserving the intentional no-version-check path for failed transports; add a regression for an omitted expectation.

const original=new Map([...table.tBodies[0].rows].map((row,index)=>[row,index]));
function value(cell){
if(cell.hasAttribute('data-sort'))return {value:Number(cell.dataset.sort),numeric:true};
if(cell.hasAttribute('data-value'))return {value:cell.dataset.value===''?null:Number(cell.dataset.value),numeric:true};

ghost Nov 12, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

bug · medium
P2: Text sorting is still broken on the standard overview and interpretation comparison. Their method-name cells are produced by numeric_cell(..., None, ...) (report.py lines 959 and 2928), so they carry data-value="" despite displaying provider names. This branch treats every provider as missing, and the new first-column sort button only restores original order in either direction. Render those text cells as plain <td> elements, as this PR already does in population_summary, while retaining empty numeric values as missing.

Comment thread src/harness/web_search/comparison.py Outdated
"score": query_score,
"primary": acceptance(case, row, primary_factual_metric if "reference_answer" in case else "primary", cutoff=cutoff, quality_excluded=quality_excluded, relevance_grades=[x["grade"] for x in items] if case["id"] in labels else None),
"quality": any(x["grade"] is not None and x["grade"] >= 2 for x in items) if case["id"] in labels and not quality_excluded else None,
"primary": acceptance(case, row, primary_factual_metric if "reference_answer" in case else "primary", cutoff=cutoff, quality_excluded=quality_excluded, relevance_grades=[x["grade"] for x in items] if has_labels else None),

ghost Nov 12, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

bug · medium
P2: Keep the primary verdict unavailable for methods outside the relevance scope. When a labeled scenario has anchors (or a site/vertical constraint), passing relevance_grades=None makes task_acceptance() fall back to source/site acceptance instead of returning None. Meanwhile, comparison.js chooses the primary verdict label from the case-wide has_relevance, so this unannotated method is displayed as “Relevant result found” or “No relevant result in top 5” and included in relevance outcome relations despite quality being unavailable. For a case with relevance labels but an out-of-scope method, set primary to None while retaining the separate source/site diagnostics. Extend the scoped-method regression to assert the primary verdict as well as score and quality.

Comment on lines +591 to +592
prior_call = saved
request = dict(request, messages=reference_repair_messages(p, request['messages']))

ghost Nov 12, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

bug · medium
P2 — Validate the original physical receipt before authorizing a format repair. This new branch decides that the saved answer is invalid using only saved["response"]; it never checks that this object matches the preserved response bytes. After repair, validate_model_evidence() validates only the replacement call's attempts, while repaired_messages() merely parses prior_call["response"]. Consequently, changing a previously valid saved response to an invalid judgment (without changing its raw receipt) allows --repair-format to repeat that valid call and produce evidence that passes validation. This defeats the promised audited, invalid-output-only repair boundary. Verify the prior request/attempt hashes and response-byte equality before spending, and apply the same verification to retained format_repair.prior_call during evidence validation, allowing only judgment-format validation to fail.

ghost left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Review complete · f724bcb

This review found 1 issue(s), including 1 blocking issue(s).

Comment thread src/harness/web_search/core.py Outdated
Comment on lines +180 to +182
edition = method.get('output_options', {}).get('edition')
if (not isinstance(expected, str) or not expected.strip()
or edition is not None and edition != expected):

ghost Nov 12, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

bug · medium
P2: Validate against the effective edition when output_options.edition is omitted. tencent_wsa_request defaults that option to standard, but this condition accepts expected_response_version='lite' (or any other nonempty string) when the option is absent. Such a profile passes the preflight in run() and sends Mode=0, Cnt=10; only after the network call can runtime version checking stop it. This defeats the new pre-call edition consistency check and can spend quota on an incorrectly configured request. Default edition to standard here as well (or require an explicit edition), and cover the omitted-option mismatch in the profile-validation test.

ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Re-review complete · e60e367

No findings in this incremental review.

ghost left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Review complete · 96a94a9

This review found 1 issue(s), including 1 blocking issue(s).

Comment on lines +2268 to +2270
for target, text in updates.items():
target.write_text(text, encoding='utf-8')
write_json(path, manifest)

ghost Nov 12, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

bug · medium
P2 — Make paragraph revisions recoverable across partial write failures. If one page is written successfully but a later page write or the manifest replacement fails (for example, a read-only second edition or a full disk), the report contains revised HTML with the old manifest. Retrying the same command then raises Existing authored paragraphs differ from their frozen content on the already-updated page, so the workflow cannot recover without manual restoration or rebuilding. Stage the update with retained originals and rollback/recovery state, and add a failure-injection test that verifies the report remains consistent or the same revision can resume after a mid-commit failure.

ghost left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Review complete · 573a806

This review found 1 issue(s), including 1 blocking issue(s).

Comment thread src/harness/web_search/report.py Outdated
'content_sha256': bytes_sha256(raw), 'provider_calls': 0,
'changed_sections': changed, 'producer': software_identity()}
manifest['authored'], manifest['content_sha256'] = revised, bytes_sha256(raw)
manifest['content_revisions'] = [*manifest.get('content_revisions', []), receipt]

ghost Nov 12, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

bug · medium
P2: Revision provenance is recorded but never validated. The repository search finds no consumer of content_revisions, before_manifest_sha256, or before_content_sha256 outside this writer and assertions about receipt presence. Consequently, changing a receipt's predecessor hashes, changed-section inventory, or provider-call count still passes check; a newly frozen publication plan merely binds those unchecked claims. This leaves the requested revision-provenance verification incomplete, although stale visual receipts and publication plans are correctly rejected by their manifest bindings. Validate the revision receipt schema and chain/current-content bindings in check, with negative tests for altered receipt fields; retain enough predecessor evidence to verify any historical claims the receipt makes.

ghost left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Re-review complete · e3dfbaf

This review found 1 issue(s), including 1 blocking issue(s).

⚠️ 1 warning(s) occurred during review.


⚠️ Warnings:

  • src/harness/web_search/report.py (token_budget_reached): stopped group "src/harness/web_search/report.py" mid-review: used 598136 tokens exceeds budget 500000

source = item.get('source', '')
bound_quote = item.get('source_kind') == 'owner-quote' and any(
asset.get('path') == source and asset.get('sha256') for asset in content.get('assets', []))
if (item.get("currency") != "USD" or item.get("unit") not in ("1000-successful-searches", "1000-requests")

ghost Nov 12, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

bug · medium
P2 — Accepting mixed billing units here loses their meaning in the rendered comparison. catalog_price_panel, benchmark_operations, and population_summary display both units as “USD / 1,000 calls” and compare the raw amounts for winner markers; none renders item['unit'], and purchase terms are optional. For example, the mixed-unit fixture in test_report.py supplies no terms, so readers cannot distinguish a rate charged for every request from one charged only for successful searches. Render the declared billing basis per method and either normalize to an explicitly defined common workload or avoid cross-basis price winner markers. This is a correctness issue in the newly supported mixed-unit comparison, not just a wording preference.

ghost left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Review complete · 39333cb

This review found 4 issue(s), including 4 blocking issue(s).

Comment on lines +49 to +50
urls = sorted(u for u in required if indexed.get(u, {}).get('status') != 200
and indexed.get(u, {}).get('fetch_attempts', int(u in indexed)) < 2)

ghost Nov 16, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

bug · medium
P2 — full=True still treats a successful lead-only observation as complete. Passing observations produced by the default full=False mode skips those URLs and preserves records without body_artifact, media_type, or source_title; the resulting inventory then fails extend_reference_urls(..., artifacts=...) in _full_capture with “Successful mirror observations require full capture artifacts.” Make reuse depend on the requested evidence contract: upgrade successful records from retained capture bytes where available, or reject incompatible previous observations before making any new calls. Add a regression covering a lead-only capture followed by full capture.

Comment on lines +138 to +139
observations = [indexed[url] for url in sorted(required)]
write_json(output / 'observations.json', observations)

ghost Nov 16, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

bug · medium
P2 — A retry in a new output directory carries successful observations from previous into this manifest without carrying their artifacts. Their body_artifact paths still point to bodies/... in the first capture directory, while native_evidence and capture retain names such as batch-0000-response.json that can now resolve to a different retry batch. Reusing the original directory is not an alternative because the changed previous_sha256/URL list fails the frozen-contract check. Thus a mixed success/failure full capture produces a retry inventory that cannot be replayed from its output root (missing bodies or mismatched receipt hashes). Accept a bound previous-artifact root and preserve/rebase inherited artifacts into a collision-free namespace, and test a successful full observation retained alongside a retried failure.

Comment thread src/lexbench_websearch/answers.py Outdated
Comment on lines +465 to +466
if tag in block_tags and not visibility:
boundary()

ghost Nov 16, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

bug · medium
P2 — Claim boundaries ignore the resolved CSS display. For example, <div><span style="display:block">Unrelated</span><span style="display:block">Supported claim [引用:1]</span></div> produces a context containing both blocks (without even a separator), rather than only Supported claim. Conversely, div elements styled display:inline still split a continuous claim. This changes the evidence sent to the citation judge and can change support scores despite the rendered-local-claim contract. Derive entry and exit boundaries consistently from the resolved layout behavior, and add paired claim_context tests for block-styled spans and inline-styled divs; the existing CSS tests check visibility rather than these boundaries.

Comment thread src/lexbench_websearch/simpleqa.py Outdated
if rebuilt[field] != dataset.get(field):
raise ValueError('Reference candidate audit differs from full capture replay')
for actual, expected in zip(dataset['cases'], rebuilt['cases'], strict=True):
for field in ('equivalent_reference_urls', 'equivalent_reference_provenance'):

ghost Nov 16, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

bug · medium
P2: Bind the case-level URL policy during capture replay as well. extend_reference_urls() reconstructs every case with url_equivalence='document-url/2', but this comparison checks only URLs and proofs. Changing a generated case to literal/1 (or deleting its policy) therefore still passes validate_reference_evidence() and the dataset-build gate, while factual_evidence() stops matching transport/host aliases and can produce different source-hit scores despite the unchanged audit declaring document-url/2. Include url_equivalence in the replayed case fields and add a mutation test for a missing or changed policy.

Suggestion:

Suggested change
for field in ('equivalent_reference_urls', 'equivalent_reference_provenance'):
for field in ('equivalent_reference_urls', 'equivalent_reference_provenance', 'url_equivalence'):

ghost left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Review complete · 08fdf33

This review found 2 issue(s), including 2 blocking issue(s).

observation.get('media_type') not in {'text/html', 'text/markdown'}
or observation['body_artifact'].get('sha256') != observation.get('body_sha256')):
raise ValueError('Previous full capture metadata is incomplete')
for field in ('body_artifact', 'native_evidence', 'capture'):

ghost Nov 16, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

bug · medium
P2 — Lead-only captures lose their retained bodies when carried into another output directory. A first capture with full=False writes bodies/<hash>.md but does not set body_artifact; a subsequent full=False capture with previous_root=first_root copies only the bindings in this loop. Upgrading that second capture with full=True and previous_root=second_root then raises Previous capture artifact is missing, even though the successful request originally retained a complete article. Preserve a hash-bound body reference during lead-only transfers (and use its relocated path during upgrade), or reconstruct and verify the body from retained native evidence. Add a lead capture → lead-only transfer → full upgrade regression; the existing tests upgrade during the first transfer and miss this path.

Comment thread src/lexbench_websearch/answers.py Outdated
box['display'] = 'block' if inner == 'flow' else inner
elif box['display'] == 'flow':
box['display'] = 'block'
if box['position'] in {'absolute', 'fixed'} or box['float'] != 'none':

ghost Nov 16, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

bug · medium
P2 — Flex/grid item blockification is missing from the computed-display check. For example, <div style="display:flex"><span style="content-visibility:hidden">Claim [引用:1]</span></div> makes the span a blockified flex item, so its contents are hidden in the browser. Here it retains display:inline, fails the content_hidden applicability check, and contributes both the invisible claim and citation to grading. Grid containers have the same issue. Account for the parent’s flex/grid formatting context before evaluating content visibility, and add paired controls retaining the existing visible ordinary-inline behavior. This affects citation-score correctness, not just rendering.

ghost left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Re-review complete · 309926a

This review found 1 issue(s), including 1 blocking issue(s).

⚠️ 1 warning(s) occurred during review.


⚠️ Warnings:

  • src/lexbench_websearch/answers.py (token_budget_reached): stopped group "src/lexbench_websearch/answers.py" mid-review: used 550967 tokens exceeds budget 500000

Comment thread src/lexbench_websearch/answers.py Outdated
Comment on lines +170 to +171
if declarations.get('visibility') in {'visible', 'hidden', 'collapse', 'initial'}:
visibility = declarations['visibility'] in {'hidden', 'collapse'}

ghost Nov 16, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

bug · medium
P2 — Collapsed table rows can contribute invisible citations. For <table><tr style="visibility:collapse"><td style="visibility:visible">Claim [引用:1]</td></tr></table>, this code reduces collapse to the same inherited boolean as hidden, then allows the cell's visible declaration to clear it. The traversal consequently inventories the claim and marker even though collapsing a table row removes the row from rendering. Handle collapse on computed table-row/row-group boxes as subtree suppression, distinct from ordinary overridable visibility:hidden, and add paired controls preserving visible descendants of ordinary hidden containers. This is a localized violation of the rendered-only grading contract.

ghost left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Re-review complete · 86f8986

This review found 1 issue(s), including 1 blocking issue(s).

Comment thread src/lexbench_websearch/answers.py Outdated
text(' ')
if not closed:
text(node.text)
children = [child for child in node if child.tag == 'summary'][:1] if closed else node

ghost Nov 16, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

bug · medium
P2: The unrestricted child traversal includes unselected options from a collapsed single-select in the rendered claim. For example, <select><option>False </option><option selected>True </option></select>claim[引用:1] produces False True claim, although only True is displayed by the control. Since answer_messages passes this context directly to the support judge, invisible option text can change the citation verdict. Resolve displayed option text for single-select controls instead of visiting every option, and add a regression with an unselected contradictory option (plus a control for listbox/multiple-select behavior).

ghost left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Review complete · ba1a1e3

This review found 1 issue(s), including 1 blocking issue(s).

Comment thread src/lexbench_websearch/answers.py Outdated
Comment on lines +551 to +552
elif tag == 'select':
text(' ' + _select_text(node, visibility, box) + ' ')

ghost Nov 16, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

bug · medium
P2 — Visible input-control labels are omitted from the rendered claim. For example, <a href="https://source.test/a"><input type="button" value="Supported claim"></a> displays a label, but this traversal appends no text for the input, so the link's exit event drops the citation entirely. Likewise, The claim is <input type="button" value="false"> [引用:1] loses false from the claim sent to the judge. This changes both citation counts and the assertion being graded. Project the visible initial labels of input controls (while excluding hidden inputs and respecting visibility), and add controls for both a label-only citation link and an input embedded in a cited sentence.

ghost left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Review complete · 44d6c90

This review found 1 issue(s), including 1 blocking issue(s).

Comment thread src/lexbench_websearch/answers.py Outdated
Comment on lines +581 to +582
if not closed and tag != 'select':
text(node.text)

ghost Nov 16, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

bug · medium
P2: Empty visible textareas lose their displayed placeholder in citation claims. For example, <a href="https://source.test/a"><textarea placeholder="Paris"></textarea></a> has visible label text, but this path only reads node.text, so the link is discarded as empty; in a longer assertion the placeholder is silently omitted from claim_context. This makes the new rendered-control projection incomplete and can change citation-support judgments. Project a textarea's initial value, falling back to its placeholder only when the value is empty, while retaining the existing visibility checks and treating the placeholder as literal text. Add controls for empty/nonempty textareas both inside links and before native markers.

ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Review complete · 98cd0c0

No findings in this review.

@lanyue-llk

ghost commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

Re-review of head 98cd0c08 and published report ver_34ce… (2026-11-17). Verdict: not ready. No P0; two P1s. CI is green.

Fixed since 95c699a6 (verified)

  • SimpleQA mirrors now come from full captures. I downloaded revision 570dde53 (archive sha256 matches the data lock) and replayed validate_reference_evidence with the PR code. The replay passes.
    • Every candidate is recorded: 7,317 in total, with 1,928 verified, 101 evidence_mismatch, 22 title_mismatch and 5,266 capture_failed.
    • All IPFS candidates fail capture and are excluded.
    • Coverage grew to 1,908 URLs in 682 cases. That was not required, but every added URL goes through the same rule.
  • The L1 factual table shows publisher-only MRR@5 and Hit@5, plus a count of mirrors awaiting verification (Yuanbao Standard 55/773).
  • Bright Data rows carry a delivery-limited label with failure counts.

P1-1: For short answers, the "answer present" branch does not prove the mirror supports the fact

My earlier requirement asked for "answer in the mirror when the reference has it". The PR implemented it as written. On the real data, though, that branch accepts copies on token presence alone.

  • Short answers. 360 accepted URLs rely on answers of at most 4 characters (3, 2, 1988). The token 3 occurs on almost any page.
  • Truncated or older copies. 51 accepted URLs in 34 cases contain less than 80% of the reference article (12-character blocks). Examples:
    • sqv-2799, answer 2: wiki2.org/en/Els_Aarne holds 14% of the reference.
    • sqv-1010, answer 3: wiki2.org/en/January_1982_lunar_eclipse holds 25% (1,886 vs 7,128 normalized characters).
  • No wrong admission found yet. The three worst cases I read do carry the fact ("two symphonies", "the first of three lunar eclipses in 1982"). But the rule did not establish that, and the owner requires 100% verification.

Fix (rule and data only, no provider calls):

  • Accept a mirror only when both hold:
    1. it contains at least 80% of the reference article (block_overlap(reference, mirror) >= 0.8), so it is not a truncated or older copy;
    2. it contains the answer whenever the reference does.
  • Drop the either/or branch.
  • Publish a new revision and rescore. Today's data loses about 51 URLs.
  • Add a paired control: a title-matching copy that contains the answer token but less than 80% of the reference is rejected.

P1-2: The HTML/CSS citation renderer (+548 lines, html5lib and tinycss2) has no real input, and the fix loop is not converging

  • What the 18 commits from d64743cb to 98cd0c08 handle:
    • CSS visibility, display:contents and flex/grid blockification;
    • <details>, <dialog> and collapsed table rows;
    • <select>/<input> labels and <textarea> placeholders.
  • Where they came from: each commit answers an OCR bot finding. About 25 such findings arrived in 6 hours, and each fix produced the next one.
  • What the data shows:
    • The only L3 method is Bocha AI Search, and it cites with native [引用:N] markers.
    • In 49 sampled answers from the published report, none contains an HTML tag or a Markdown link.
    • The PR body itself says "all 980 saved answer packets retain identical grading inputs".
    • So this code changes no score. It adds two dependencies and an unbounded surface.

Fix:

  • Revert the HTML rendering and visibility logic in answers.py. Keep native citation IDs ([引用:N], with the first-ranked record per ID) and Markdown links. Treat raw HTML in an answer as plain text that carries no citation.
  • Add one release check that fails if any saved answer contains HTML markup, so the scope is guarded by data.
  • Decline further bot findings that have no instance in the saved answers.

P2

  • The report was built from 1b523c12, nine commits before the head (webstone-version.json). Rebuild from the merge head before publication.

  • Bright Data's "delivery-limited" label hides the main cause: our own client timeout. Among 25 failed calls in a 60-case sample:

    • 19 are HTTP 0 at 60,041 ms, our 60 s timeout;
    • 5 are HTTP 200 with zero results;
    • 1 is a Bright Data 502 Proxy Error.

    Even successful calls take about 34 s. State the timeout in the table note and split the failure count by cause (client timeout, empty result, provider error). Otherwise readers will attribute every failure to Bright Data.

  • The label "DeepSeek Search + content" reads as if content were scored. content is Web Fetch scope and not scored; L2 uses summary. Name the method "DeepSeek Search", and keep need_content=true as a batch note explaining the latency.

ghost left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Review complete · aeabf2a

This review found 4 issue(s), including 4 blocking issue(s).

if (self.version_path and http_status == 200 and not error
and (not isinstance(response, dict)
or not isinstance(response.get('Pages'), list)
and not (isinstance(response.get('Version'), str) and response['Version']))):

ghost Nov 17, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

bug · medium
P2 — A matching Version alone bypasses the missing-envelope stop. For example, {"Response":{"Version":"standard"}} with expected version standard returns no account error, although tencent_wsa_response rejects it because it has neither Pages nor the supported Version/RequestId/Query empty-response envelope. The runner therefore retries (when enabled) and proceeds to other tasks instead of stopping collection; resume also treats this as an ordinary completed failure. Require either a Pages list or the complete supported empty-response envelope here, while retaining unknown billing for malformed envelopes. Add a matching-version-only control alongside the existing missing-envelope tests.

Comment on lines +61 to +62
if any(has_html_markup(row.get("answer") or "") for row in rows):
raise ValueError("Saved answers contain unsupported HTML markup")

ghost Nov 17, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

bug · high
P1 — The required HTML-answer path is rejected rather than scored. Bocha AI preserves native answer strings, so an answer such as <p>Claim <a href="https://example.test/doc">source</a></p> reaches this guard and aborts the entire L3 population, including evidence replay. Removing the guard alone is insufficient: citation_inventory also returns an empty inventory for HTML. Implement the required shared HTML5 citation processing (rendered visibility, parsed targets and original spans) and exercise it through judge/replay tests instead of asserting that HTML must fail.

Comment thread src/harness/web_search/diagnostics.py Outdated
Comment on lines +16 to +19
if row.get('http_status', 200) == 200 and not row.get('results'):
return 'empty_results'
if row.get('http_status', 200) != 200 or error:
return 'response_error'

ghost Nov 17, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

bug · medium
P2 — Check recorded response errors before classifying successful empty results. The runner records HTTP-200 invalid JSON, rejected native envelopes, and provider error envelopes with results=[] and a nonempty error; this ordering labels all of them empty_results. comparison.py exposes these categories in the failure breakdown at every output level, so readers see API/response failures reported as empty searches. Move the response-error branch before the empty-results branch and cover both an errored HTTP-200 row and a valid empty response.

Comment on lines +206 to +207
key = canonical_url(token.attrGet("href") or "", policy="document-url/2")
item = by_url.get(key)

ghost Nov 17, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

bug · medium
P2 — Link targets never consult by_id. For a delivered record with citation_id='https://source.test/#WebPages.0' and url='https://publisher.test/article', [source](https://source.test/#WebPages.0) is marked outside the results and loses all source fields despite identifying that record explicitly. This also prevents links from selecting distinct excerpts for two IDs sharing one document URL, contrary to the documented citation contract. Resolve the parsed target against explicit native IDs first, retaining their first-ranked records, and use canonical URL lookup only as the fallback. Add controls for ID links, repeated URLs with different IDs, and ordinary URL-only links.

ghost left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Re-review complete · 473ef22

This review found 1 issue(s), including 1 blocking issue(s).

Comment thread src/harness/web_search/diagnostics.py Outdated
Comment on lines +16 to +17
if row.get('http_status', 200) == 200 and not row.get('results'):
return 'empty_results'

ghost Nov 17, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

bug · medium
P2 — Check recorded response errors before classifying an empty success. The collector initializes results=[] and records normalization/JSON failures in error even when HTTP status is 200 (runner.py:703–717). For example, a Bocha AI error envelope or a Yuanbao Response.Error therefore reaches this branch and is counted as empty_results, not response_error. Since comparison.py uses this classification for the displayed failure breakdown, API failures are misreported as successful empty searches. Keep timeout/network precedence, but move the response-error check ahead of the empty-results check; cover both a valid empty response and an HTTP-200 error.

ghost left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Re-review complete · 6adaa26

This review found 2 issue(s), including 2 blocking issue(s).

Comment thread src/harness/web_search/comparison.py Outdated
Comment on lines +458 to +459
outcomes[mid] = Counter(request_outcome(r) for r in calls)
values['failed_calls'] = len(calls) - outcomes[mid]['results']

ghost Nov 17, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

bug · medium
P2 — Successful answer-only responses are counted as failed requests in the L3 summary. bocha_ai_response() accepts a successful envelope containing a text answer and no webpage messages, and L3 projection/grading accepts that answer independently of the result list. However, request_outcome() classifies every row with results=[] as empty_results, so this subtraction reports the call as failed even when its generated answer is graded correct. Make the successful-output classification level-aware (while preserving transport/API failures), or report empty result lists separately from L3 request failures. Add a regression with a nonempty answer, HTTP 200, no error and an empty result list.

Comment thread src/harness/web_search/diagnostics.py Outdated
def request_outcome(row):
"""Classify one physical call from its recorded transport and response."""
error = str(row.get('error') or '').lower()
if row.get('transport_exit') == 28 or 'timed out' in error or 'timeout' in error:

ghost Nov 17, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

bug · medium
P2: Server-side timeout responses are incorrectly counted as client timeouts. The collector populates error from the decoded response body on non-200 responses (runner.py), so an HTTP 504 response with {"error":"upstream timeout"} and transport_exit=0 reaches this branch instead of response_error. This makes the new failure breakdown attribute an API failure to the client despite a successfully completed transport. Use the transport receipt (exit code 28) as the authoritative client-timeout signal; restrict any text fallback to records without transport evidence.

ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Re-review complete · 9f03c94

No findings in this incremental review.

ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Re-review complete · 77fde17

No findings in this incremental review.

ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Review complete · 177feed

No findings in this review.

@lanyue-llk

ghost commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

Re-review of head 177feedb and published report ver_106c… (2026-11-17). Verdict: no P0 or P1 remain. Every item from my previous review is fixed, and CI is green.

Verified

  • SimpleQA mirror rule v2 (reference-question-evidence/2):
    • I downloaded revision 3ab37226; its archive sha256 matches the data lock. I replayed validate_reference_evidence with the PR code, and the replay passes.
    • The captures are byte-identical to 570dde53; only the rule changed.
    • Every accepted proof has a matching title and a full-article overlap of at least 0.800 in both directions. It also contains the answer whenever the reference does.
    • Exactly 79 case/URL bindings were removed and none were added, leaving 1,829 URLs in 671 cases.
    • Questions, answers and publisher URLs are unchanged in all 831 cases.
    • The new paired control (a title-matching copy that contains the answer token but too little of the article) is rejected.
  • Report scores follow the new revision. For example, Yuanbao Standard's L1 MRR@5 moves from 0.198 to 0.194, and its publisher-only figure stays at 0.114.
  • The HTML/CSS citation renderer is gone.
    • answers.py drops from 742 to 383 lines, and html5lib and tinycss2 are removed.
    • Answer grading now fails when a saved answer contains raw HTML, so the scope is guarded by data. This check passes on all saved answers.
  • Bright Data failures are split by cause and the timeout is stated: 282 client timeouts, 2 network errors and 127 API/response errors out of 831, with "客户端超时上限:60 秒" (60 s client timeout).
    • Empty outputs have their own column.
    • Answer-only L3 responses count as successful.
  • DeepSeek is labelled "DeepSeek Search", with need_content=true kept as collection context.

Non-blocking

  • The report was built from 77fde174, one commit before the head. The only source change in 177feedb reorders where the failure-reason labels are translated, and the rendered output is the same. Republish from the final merge head anyway, so that webstone-version.json names the merged commit.

@lanyue-llk
lanyue-llk merged commit 922912d into main Nov 17, 2026
@lanyue-llk
lanyue-llk deleted the codex/yuanbao-web-search branch November 17, 2026 06:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant