Skip to content

Route Extract scoring through benchmark hooks, validate call reads, derive Lexbench resource engine - #386

Merged
lanyue-llk merged 2 commits into
mainfrom
refactor/frozen-copies-hooks
Nov 25, 2026
Merged

lanyue-llk merged 2 commits into
mainfrom
refactor/frozen-copies-hooks

Conversation

@lanyue-llk

Copy link
Copy Markdown
Contributor

Purpose

Step 2 of #379: with frozen evidence bound to stored copies (#385), finish the refactors that were blocked by live-module hash bindings.

flowchart LR
    SR["pipeline.score_run"] -->|truth()| H["benchmark_adapter.adapter(home)<br/>ExtractBenchmarkAdapter"]
    RR["pipeline.score_rows<br/>(original and repaired views)"] -->|score(truth, predictions)| H
    H -->|record benchmark| A["registered record adapter.score"]
    H -->|product benchmark| U["pinned upstream scorer<br/>(official_scorer + evaluate_predictions)"]
    LR["pipeline.load_run"] --> V["call_records.validate_calls<br/>webextract.call_record/1"]
    RA["repair.artifact"] --> V
    P["frozen resource protocol<br/>engine: registered browser"] --> M["lexbench resource_matrix / resource_profiles"]
Loading

What changed

  • Extract runner calls the benchmark hooks (Define the benchmark adapter interface and the pipeline skeleton each track follows #338). score_run reads references through adapter(home).truth(); score_rows scores every method through adapter(home).score(...). The hook selects the record adapter's scorer or the pinned upstream scorer (with the same non-decimal price fallback, loaded once per adapter). The product/record branch in score_rows is gone; benchmark_adapter.py no longer routes scoring back into the pipeline.
  • Extract reads validated by the Conformance examples for every track, versioned native record schemas and Extract benchmark hooks #378 schema (Versioned schemas for the artifacts stages exchange #327). pipeline.load_run validates every call record, so score_run, repair, certification, report and export all read validated calls; repair.artifact validates each repair and physical call. call_records.load_run (a wrapper that existed only because pipeline.py was hash-bound) is removed; callers use pipeline.load_run.
  • Lexbench resource modules derive the engine (One browser adapter and participant registry for the browser tracks #321). resource_matrix.py and resource_profiles.py read the measured engine from the frozen protocol's engine field, which must be a registered browser (BROWSERS); runner engine key, layout flag, binary path and active-set name derive from it. Historical evidence verifies against the orchestrator.py stored with it, so existing receipts are unaffected; receipt schema identifiers are unchanged.
  • Test fixtures that wrote call records without state now write it, as real collections do.

Not done here

  • Web Extract: benchmark-declared fields and one renderer #324 (one evidence model for product and record-cohort report data): the two ~850-line assembly bodies still differ; merging them is its own change. No longer blocked by hash bindings.
  • analysis.check_record_audit recomputes record audits with the current adapter (adapter_sha256 against live records.py). It reruns adapter checks by design, so it stays live.

Allowlists

Instance literals: 0 → 0. Layering: unchanged.

Baselines

Unchanged (no refresh). Scorer hash unchanged: 0fe8931734e1ba7282e1e9c8303eea958d20fdcee83d84e87cdc7e08cd08169e.

Verification

  • uv run --frozen --all-extras python -m pytest -n 8 --dist worksteal tests: 21644 passed, 78 skipped, 2 xfailed.
  • make lint-check: passed.

Breaking changes

  • Lexbench resource-matrix and resource-profiles protocols require an engine field naming a registered browser (for example "engine": "moli"). Protocols frozen without it must run with the orchestrator copy they bind.
  • harness.web_extract.call_records.load_run removed; use harness.web_extract.pipeline.load_run (now validates call records).

Closes #379. Part of #338, #327, #321, #324.

…call read

score_run reads references and score_rows scores every method through the
benchmark adapter's hooks, which select the pinned upstream scorer or the
record adapter. pipeline.load_run and repair call reads validate the versioned
call record.
The resource matrix and Linux profile orchestrators take the measured engine
from the frozen protocol's registered engine name instead of naming one.

@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 · a9eefc0

No findings in this review.

@lanyue-llk
lanyue-llk merged commit 6a33af5 into main Nov 25, 2026
10 checks passed
@lanyue-llk
lanyue-llk deleted the refactor/frozen-copies-hooks branch November 25, 2026 06:50
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.

Frozen evidence binds live source files, which blocks further refactoring

1 participant