Repository navigation
refactor(web-search): move provider quirks into adapters and dataset rules into benchmark declarations - #346
Merged
Merged
Conversation
This was referenced Nov 24, 2026
…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.
…larations; add contract tests
lanyue-llk
force-pushed
the
refactor/search
branch
from
November 24, 2026 09:10
862071e to
00e3436
Compare
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. |
This was referenced Nov 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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"] --> cardWhat moved or was removed
ADAPTERSis aharness.adapters.Registry;Adapterconforms toMethodAdapter(capabilities,implementation_identity,validate(method)).Provider quirks are per-adapter hooks with the previous behaviour as that adapter's implementation:
Responseenvelope (account errors, missing envelope, version mismatch, billable envelope) isTencentEnvelope. It is no longer hardcoded in the genericAdapter.account_errorandcost.account_error_codesandversion_pathare removed.core.normalize) is now theitemhook.core.validate_profile) is now themethod_rulehook.report.fairness_table) is nowprovider_default_limit.New
web_search/benchmarks.pyregistersscenarioandfactual(SimpleQA Verified). Each declares:lexbench_websearch/simpleqa.py, unchanged);comparison.py, thereport.pycohorts,output_levels.py,answers.pyandrevisions.pynow read these declarations. The sixsimpleqaimports and thesimpleqa-verifiedand repository literals are gone fromrevisions.py.judge --simpleqa-graderbecomes--answer-grader. The README and test are updated, and the error text for a missing grader is unchanged.benchmarks/publication.pyno longer has asimpleqa-verifiedbranch or a track import. The dataset card declaresdefinitions_check: harness.web_search.revisions:validate_release_definitions, which is resolved like the existingderived_fieldshooks._derived_fieldis now_declared_callable.web_search/publication.pywrites the archive withreporting.publication.package_archiveand also writes apackage-attestation.json. The report check usesrelease_check.check_report_identity. This currently amounts to the same build-version check, because Search manifests carry no top-levelprofile_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
harness.benchmarks.publication -> harness.web_search.revisionsremoved).Baselines
tests/baselinesare unchanged and pass. Archive bytes for an existing release are never regenerated, becausepreparerefuses an existing work directory andverify_planandpublishread the frozenreport.zip. A new package may order zip members by string path instead ofPathorder, but its hash is bound by the new plan as before. Judge evidence keys and prompt hash keys still usescenario,factualandcitations, 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 oftests/web_search,tests/baselines, the architecture tests andtests/benchmarks/test_publication.pyafter the final changes also passed.tests/test_ci_gate.py: 5 failures that also occur without this change (localnodeexpression evaluator).make lint-check: passes.Remaining for #323
comparison.pystill renders the factual-only charts (source_matching_chart,factual_outcome_chart), the factual population-size note and the scenario judgment key from the literalfactualandscenariopanels.report.pykeeps the SimpleQA contamination-diagnostic paragraph and itsscenario/sitecase-kind summaries. These are views that a benchmark should contribute through aviews()hook, which is left for a follow-up.Part of #323
Part of #318
Part of #338