Skip to content

fix(web-fetch): rescore saved evidence that carries retired forbidden-text metrics - #251

Merged
lanyue-llk merged 1 commit into
mainfrom
fix/rescoring-legacy-metrics
Nov 5, 2026
Merged

lanyue-llk merged 1 commit into
mainfrom
fix/rescoring-legacy-metrics

Conversation

@lanyue-llk

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

Copy link
Copy Markdown
Contributor

What, why and how of this PR

Question

Can content-rescore, scoring-revision and reference-revision run on saved Web Fetch evidence? All 2,580 rows in the stored 430-task evidence carry forbidden_hits.

Cause

_rescore_one reads the old verdict through task_passed before it rescores. task_passed refuses retired fields (forbidden_hits, acceptance_policy_version, blocked_page without current fields), so the tool that is meant to migrate those rows crashes on them. Reproduced on a clone of the stored evidence: metrics.py:734 via rescoring.py:46.

Fix

_stored_verdict in rescoring.py applies the rule from before the fields were retired (5400a0c): a hit fails only under policy 1, otherwise it is diagnostic. All other fields go through the current predicate, as they already do for current rows. metrics.py is unchanged, so the scorer source hash is unchanged.

Evidence

Reproduced on an APFS clone of the stored evidence (2,580 rows, all with forbidden_hits). The originals were not modified; the results.jsonl hash is still c99eddea.

  • Crash: before the fix, rescore raised on the first row. The new tests fail on main code (3 failed) and pass with the fix.
  • Stored verdicts: _stored_verdict matched the recorded machine_verdict on 2,580 of 2,580 rows of final-six-current-430-v4 (1,630 pass, 950 fail), using that directory's own result-review.json. No row has acceptance_policy_version, so the policy-1 branch is covered only by a test fixture.
  • Full rescore: not completed. content-rescore ran serially for 2h41m on the clone, printed no error and wrote no output, then was stopped. It therefore proves no end-to-end result on real evidence.
  • Bounded sample: a seeded shuffle with a 150 s budget and a 20 s limit per row called _rescore_one directly, which is a private helper rather than the CLI. Of 144 rows reached, 139 completed with no crash and no retired fields left, and 5 hit the 20 s limit. The median row took 0.05 s.
  • Verdict changes: an independent review compared 1,809 stored rows with per-row copies: 68 flip from pass to fail and 3 from fail to pass under the current scorer. About 56 of the 68 are correct answers wrongly failed by scorer or task-contract bugs that predate this PR, such as {"links"} image answers and catalog preface lines (see fix(web-fetch): score declared image links and heading-price catalog cards #250). page_identity_status is not a cause. Do not apply a rescore to real evidence until these are fixed.
  • Tests: the full suite on this branch gave 14 failed, 20,037 passed, 61 skipped. The same 14 fail on main code when rerun by name. The complete suite was not run on main.

Audit hash (no change)

The stamp omits messages.json and report assets, but this does not let a wrong input pass. messages.json only supplies failure_category and diagnosis text, which verdicts do not read, and rescoring.py, failure_diagnosis.py and report.py do not reference report-assets. Scoring inputs are bound elsewhere: dataset and results by their own hashes, outputs and artifacts by per-record checks. A search found no code that compares scoring.source_sha256. One limit remains: changing messages.json can change the stored label text under the same stamp.

What this does not do

  • A selected reference-revision or rule-changing scoring-revision on rows still carrying retired metrics still fails closed, with no evidence changed. summarize reads the unselected rows. Run a scorer-only scoring-revision first. A test covers this order.
  • It did not run scoring-revision or reference-revision on real evidence. Those paths are covered by fixtures only.
  • It did not fix or diagnose the slow rows.
  • It did not change the audit stamp or the scorer.

@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 · 19df4f3

No findings in this review.

@lanyue-llk
lanyue-llk force-pushed the fix/rescoring-legacy-metrics branch from 19df4f3 to 016a5ce Compare November 5, 2026 06:53

@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 · 016a5ce

No findings in this review.

@lanyue-llk
lanyue-llk merged commit 506b274 into main Nov 5, 2026
7 checks passed
@lanyue-llk
lanyue-llk deleted the fix/rescoring-legacy-metrics branch November 5, 2026 07:03
lanyue-llk added a commit that referenced this pull request Nov 5, 2026
lanyue-llk added a commit that referenced this pull request Nov 5, 2026
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