Repository navigation
fix(webfetch): ignore malformed and metadata fields in Lexmount answers - #261
Merged
Merged
Conversation
There was a problem hiding this comment.
✅ Re-review complete · 628af46
No findings in this incremental review.
Contributor
Author
|
Independent review at
|
lanyue-llk
force-pushed
the
fix/lexmount-malformed-fields
branch
from
November 10, 2026 12:55
628af46 to
c73cbee
Compare
Contributor
Author
|
Rebased onto main ( |
This was referenced Nov 10, 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.
Follow-up to #252.
Problem
#252 introduced two P1 regressions in Lexmount
/v1/extractscoring:result.author,result.publish_timeandresult.extra.*intopage_information,page_structureandrecordswithout type checks. The shared scorer validates those fields strictly and raisesValueError;runner.pycallsscore_attemptunguarded, so one successful response such aspublish_time: 1730000000,author: [{"name": "A"}],extra.subtitle: {...},extra.dom_summary.headings: [{"level": 1, "text": "H"}](title contract) orextra.reviews: {}(quote schema) stopped the run. These scored normally at 914ed1e.result.descriptionandextra.site_namewere projected aspage_information, so a navigation-only body (Home | Products | About us | Contact | Sign in | Cookie settings) passed stable anchors, required facts and page patterns found only in the meta description. This contradicts fix(webfetch): score returned structured page fields #252's own rule that the title and generic document metadata stay separate.Fix
native_projection.py(policy 7, fixed in place because no evidence uses it yet): scalar page fields usetext_or_none; list fields keeptext_items.page_structurekeeps onlyheadingsas a text list and is dropped unlessdom_summaryis an object;recordsis dropped unless the selected rows are a list. Malformed fields are now absent, not exceptions.descriptionandsite_nameare no longer projected, andresult.descriptionleaves the Lexmount route. Policies 4-6 keep their original behavior.response_input.py:page_information_textsignoresdescriptionandsite_name, as it already ignoressection_headings, so no adapter can reintroduce the false pass. The report's anchor evidence uses the same field set.Evidence
tests/test_lexmount_native.py: every repro runs through the real adapter, native projection verification,score_attemptand the task predicate. Malformed fields score as absent (positive and negative cases);description/site_namefail anchors and page patterns while the same value inextra.subtitlepasses. Before the fix the malformed cases raisedValueError.scoring-regressions.json: paired controlsdescription-field-not-page-text(false positive; fails against the previousresponse_input.py) andextracted-subtitle-field-page-text(false negative).code-migration.json: refreshedresponse_input.pyhash and a correction record binding the root cause and both controls.tests/fixtures/native-route-baseline.jsonregenerated for the new projection source hash.make lint-checkpasses; targeted pytest (Lexmount native, native projection, route contract, extracted page information, current scoring controls, saved report/matrix tests): 363 passed.