Repository navigation
Remove remaining Web Fetch and Web Extract instance knowledge and the native-policy context variable - #390
Merged
Conversation
…rk declarations Shared analysis no longer imports the swde task adapter: record value equivalence resolves through benchmark_adapter.record_value_key from the registered task adapter that declares it. Report and analysis read declared, scored and reported field names from product_fields, and the historical F1 headers come from per-field catalog keys instead of positional navigation labels. An architecture scan keeps shared Web Extract report and analysis modules off registered task-adapter modules. Part of #389
…ion-7 policy digests verifying from a stored module copy native_projection.py is part of the version-7 answer-selection policy identity, so editing it changed every policy digest. Earlier digests now resolve through a stored copy of the module bytes they were frozen with (data/native-answer-policies/), verified against its hash; the policy version is unchanged. The approved historical registry is parsed by approved_policy_versions and passed explicitly through the saved-matrix build and check instead of a context variable. The native route fixture changes only in its policy digests: computing it with the stored module copy reproduces the previous fixture exactly. Part of #389
…shed-report data - The published 150-task ranking basis is declared beside its frozen text (legacy-report-text.json ranking_basis) instead of a size check in report.py. - The browser-time duration example of a price entry is declared on its method (report-methods.json pricing_duration_example); browser_monthly takes the plan's numbers instead of defaulting to one provider's. - Benchmark-specific example sentences, example task links and the popular-site snapshot scope live in report-track-context.json instead of the shared message catalog and renderer. - The WebMainBench sample check takes its method set from the bound score summary, the latency-diagnostic run ids from the diagnostic module that owns them, and checks that the bound interpretation's own evidence links open generated pages instead of naming three fixed ones. Rendered output is unchanged. Part of #389
This was referenced Nov 25, 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
Part of #389: remove the remaining instance knowledge from shared Web Fetch and Web Extract code, and remove the native-projection context variable (spec rules 1, 4 and 8). The render-scope context variable in
web_fetch/report_model.pycomes in a separate PR, so that wide mechanical change can be reviewed on its own.New structure
flowchart LR subgraph Policy["Native answer policy identity"] L["native_projection.py (live)"] -->|current digest, v7| P["native_projection_policy_version(policy, type, approved)"] S["data/native-answer-policies/<sha>.py.txt<br/>stored earlier v7 module bytes"] -->|digest recomputed from the copy| P R["bound registry in the saved-matrix spec"] -->|approved_policy_versions()| A["approved"] A -->|explicit argument| B["_load_saved_matrix → verify_record_artifacts<br/>→ verify_saved_native_answer"] A --> P end subgraph Data["Instance content as data"] LR["legacy-report-text.json<br/>ranking_basis"] --> RP["report.py ranking intro"] RM["report-methods.json<br/>pricing_duration_example"] --> PR["report_pricing.py"] TC["report-track-context.json<br/>examples, reference_status"] --> RC["report_components.py"] SS["bound score-summaries.json"] --> WC["webmainbench_report_check"] BA["benchmark_adapter.record_value_key<br/>product_fields.DECLARED/SCORED"] --> EX["web_extract analysis/report"] endWhat moved or was removed
Native projection context variable (Web Fetch).
native_projection_source()hashes the livenative_projection.py, which is part of the version-7 policy identity, so any edit changed every policy digest. I applied the #385 pattern:data/native-answer-policies/85cf5852….py.txtis a stored copy of the module bytes the current v7 evidence was frozen with (main at ed00452).index.jsonbinds the copy to its hash and its version.native_projection_policy_versionaccepts a v7 digest when it equals the digest recomputed from a stored copy (native_projection_source(type, policy_module=copy)). The policy version does not change, and no version bump was needed._HISTORICAL_POLICIES(a ContextVar) and theapproved_native_policiescontext manager are removed.approved_policy_versions(registry)parses the bound registry. The result is passed explicitly:build_saved_matrix/check_saved_matrix→_load_saved_matrix(spec, approved)(stored oninputs, and used for nested matrices) →verify_record_artifacts(..., approved_policies=)→verify_saved_native_answerand_native_retry_scoring_record.tests/fixtures/native-route-baseline.jsonchanges only in its policy digests. Computing the fixture with the stored module copy reproduces the previous fixture exactly (38/38 entries). With the live module only the digest differs.Web Fetch instance content.
report.py: the checkcase_count==150 and track_count==6is gone. The published report declaresranking_basisbeside its frozen text, andpublished_ranking_basis()replaceslegacy_t.report_pricing.py: thecloudflare-markdownbranch is gone. Its numbers and text now live inpricing_duration_exampleon that method's registry entry.browser_monthlytakes the plan's figures as arguments instead of one provider's defaults.report_components.py: the Books to Scrape, GraphQL, Attention, JustWatch and Zhihu/Dianping example text, the example task links and the reference example case ids now live inreport-track-context.json. Six entries were removed frommessages.json.webmainbench_report_check.py:SAMPLE_PROVIDERSis removed. The method set comes from the boundscore-summaries.json, whose bytes the repository content binding pins. The latency-diagnostic run ids come fromwebmainbench_latency_diagnostic.RUNS. The fixed attempt and dataset hrefs are replaced by a generic rule: the bound interpretation must link at least one task and one result, and every such link must open a generated page.Web Extract.
analysis.pyno longer importsswde. It usesbenchmark_adapter.record_value_key, which resolves the record value equivalence from the registered task adapter modules.analysis.pyandreport.pytake field names fromproduct_fields(DECLARED,SCORED,REPORTED). The historical F1 headers come from per-fieldhistory_labels_<field>catalog keys instead of positional slices.report_ui.pybuilds its field label keys fromREPORTED.Check.
tests/architecture/scan.py::benchmark_module_imports(), with a test intest_architecture_layering.py, fails when Web Extractanalysis,report,report_ui,report_suiteormodel_comparisonimport a registered benchmark module.Allowlists
Instance-literal 0 → 0; layering 0 → 0; the new benchmark-module import check has 0 findings and no allowlist.
Baselines
tests/baselines/is unchanged and passes without a refresh. Rendered pricing output is byte-identical before and after (checked directly). Scorer hash unchanged:0fe8931734e1ba7282e1e9c8303eea958d20fdcee83d84e87cdc7e08cd08169e.Verification
uv run --frozen --all-extras python -m pytest -q -n 8 --dist worksteal tests: 21653 passed, 78 skipped, 2 xfailedmake lint-check: passeduv run --frozen lexbench-webfetch version: same scoring-source hashNot done here
report_model.py: separate PR.assets/report.jsstill lists the product field names. Changing it changes report route digests and would need a baseline refresh.webmainbench_report.pystill links one fixed attempt (obscura__949e…) in its TEDS section, and the sample check still asserts the 200-case cohort size and the dataset id. Both describe that one published report.report.py. It appears to have been removed already.Breaking changes
None to commands. Python API:
native_projection.approved_native_policies(registry)(context manager) is replaced byapproved_policy_versions(registry) -> dict.native_projection_policy_version(policy, type, approved=None)takes it explicitly.verify_saved_native_answerandverify_record_artifactsgainapproved_policies=.report_i18n.legacy_tis replaced bypublished_ranking_basis(case_count, track_count).report_pricing.browser_monthly(pages, seconds, *, base_usd, included_hours, usd_per_hour)has no provider defaults.webmainbench_report_check.SAMPLE_PROVIDERSis removed.Part of #389