Skip to content

refactor(web-search): move provider quirks into adapters and dataset rules into benchmark declarations - #346

Merged
lanyue-llk merged 6 commits into
mainfrom
refactor/search
Nov 24, 2026
Merged

lanyue-llk merged 6 commits into
mainfrom
refactor/search

Conversation

@lanyue-llk

Copy link
Copy Markdown
Contributor

Purpose

Web Search shared code named providers and datasets. This PR moves that knowledge into the Search method adapters and into a new Search benchmark registry, following docs/spec.md ("Extension points", rules 1 and 7).

flowchart LR
    subgraph Methods["harness.web_search.adapters"]
        AR["ADAPTERS: Registry"] --> AD["Adapter (MethodAdapter)<br/>envelope · item · method_rule ·<br/>provider_default_limit hooks"]
    end
    subgraph Benchmarks["harness.web_search.benchmarks"]
        BR["BENCHMARKS: Registry"] --> SB["SearchBenchmark (BenchmarkAdapter)<br/>member · label · metric_sets · level_values ·<br/>AnswerGrading · ReferenceDataset · text"]
    end
    AD --> core["core / runner / report"]
    SB --> cmp["comparison / report cohorts"]
    SB --> lv["output_levels"]
    SB --> ans["answers (L3 judge)"]
    SB --> rev["revisions"]
    card["cards/metadata.json<br/>definitions_check"] -. "module:function hook" .-> rev
    pub["benchmarks/publication.py"] --> card
Loading

What moved or was removed

  • ADAPTERS is a harness.adapters.Registry; Adapter conforms to MethodAdapter (capabilities, implementation_identity, validate(method)).

  • Provider quirks are per-adapter hooks with the previous behaviour as that adapter's implementation:

    • The Tencent Response envelope (account errors, missing envelope, version mismatch, billable envelope) is TencentEnvelope. It is no longer hardcoded in the generic Adapter.account_error and cost. account_error_codes and version_path are removed.
    • The Browserbase snippet fallback (core.normalize) is now the item hook.
    • The Yuanbao edition/version rule (core.validate_profile) is now the method_rule hook.
    • The Bright Data "Default" requested limit (report.fairness_table) is now provider_default_limit.
  • New web_search/benchmarks.py registers scenario and factual (SimpleQA Verified). Each declares:

    • case membership, label, presentation order and metric sets per level;
    • level scores and L3 answer grading (prompt, messages, parser, stored field, format correction and the pinned grader source);
    • its reference dataset (track, path, repository, rules module = lexbench_websearch/simpleqa.py, unchanged);
    • comparison guide text.

    comparison.py, the report.py cohorts, output_levels.py, answers.py and revisions.py now read these declarations. The six simpleqa imports and the simpleqa-verified and repository literals are gone from revisions.py.

  • judge --simpleqa-grader becomes --answer-grader. The README and test are updated, and the error text for a missing grader is unchanged.

  • benchmarks/publication.py no longer has a simpleqa-verified branch or a track import. The dataset card declares definitions_check: harness.web_search.revisions:validate_release_definitions, which is resolved like the existing derived_fields hooks. _derived_field is now _declared_callable.

  • web_search/publication.py writes the archive with reporting.publication.package_archive and also writes a package-attestation.json. The report check uses release_check.check_report_identity. This currently amounts to the same build-version check, because Search manifests carry no top-level profile_sha256. UPLOAD_NAME = "webfetch" stays as commented fixed data.

  • Contract tests iterate both registries (tests/web_search/test_adapter_contracts.py). The catalog test accepts keys supplied by benchmark declarations and checks their placeholders.

Allowlists

  • Layering: 9 → 8 entries (harness.benchmarks.publication -> harness.web_search.revisions removed).
  • Instance literals: 2 → 2 (unchanged; Search modules are track code, outside that scan's scope).

Baselines

tests/baselines are unchanged and pass. Archive bytes for an existing release are never regenerated, because prepare refuses an existing work directory and verify_plan and publish read the frozen report.zip. A new package may order zip members by string path instead of Path order, but its hash is bound by the new plan as before. Judge evidence keys and prompt hash keys still use scenario, factual and citations, so saved L3 evidence keeps verifying.

Verification

  • uv run --frozen --all-extras python -m pytest -n 8 tests/web_search tests/benchmarks tests/baselines tests/test_architecture_layering.py tests/test_architecture_instance_literals.py: 12912 passed. A later rerun of tests/web_search, tests/baselines, the architecture tests and tests/benchmarks/test_publication.py after the final changes also passed.
  • tests/test_ci_gate.py: 5 failures that also occur without this change (local node expression evaluator).
  • make lint-check: passes.

Remaining for #323

comparison.py still renders the factual-only charts (source_matching_chart, factual_outcome_chart), the factual population-size note and the scenario judgment key from the literal factual and scenario panels. report.py keeps the SimpleQA contamination-diagnostic paragraph and its scenario/site case-kind summaries. These are views that a benchmark should contribute through a views() hook, which is left for a follow-up.

Part of #323
Part of #318
Part of #338

@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 · 862071e

No findings in this review.

…ks into adapter hooks

ADAPTERS becomes a harness.adapters.Registry and Adapter conforms to
MethodAdapter. The Tencent envelope, the Browserbase snippet fallback, the
Yuanbao edition rule and the Bright Data default limit become per-adapter
hooks, so core and report code no longer name a provider.
…chmark adapters

A web search benchmark registry declares each population's membership,
label, metric sets, level scores, L3 answer grading and reference dataset
rules. Comparison, report, output-level, answer and revision code read
these declarations instead of naming a dataset, and the judge's grader
flag becomes --answer-grader.

The SimpleQA release check moves into the track and is named by the
dataset card's definitions_check hook, removing the benchmarks ->
web_search layering exception.
The Search publication archive is written by reporting.publication
.package_archive, and the report check binds identity through
release_check.check_report_identity. UPLOAD_NAME stays fixed data for
existing targets.

@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 · 00e3436

No findings in this review.

@lanyue-llk
lanyue-llk merged commit 720f14e into main Nov 24, 2026
8 checks passed
@lanyue-llk
lanyue-llk deleted the refactor/search branch November 24, 2026 09:37
@lanyue-llk

Copy link
Copy Markdown
Contributor Author

Rebased on main after #345, #349 and #351. Conflicts:

No golden or baseline refreshes, and the scorer hash is unchanged. OCR on 00e3436 found nothing.

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