Fix complementary kp-wholepage panels: recover video organics, classify as knowledge#144
Merged
gitronald merged 2 commits intoJun 1, 2026
Merged
Conversation
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.
Problem
On a complementary
kp-wholepagepanel (a music/entity panel that sits beside an intact organic column, not collapsing it), the0.9.0a1sub-column model misfired and the panel itself was mislabeled. Surfaced onthis is my life billy joel youtube:div.g, organic-position siblings of the panel) were dropped —0.9.0a0emitted them as 10general/video results,0.9.0a1emitted 0.searches_related/or_give_general_feedbackinstead ofknowledge/panel.Root causes & fixes
extractors/extractor_main.py—_kp_organics_outside(the gate regression). The complementary-panel guard only recognized organics containingdiv.tF2Cxc, so it missed video-stylediv.gorganics (a YouTubediv.ghash3+a[href]but notF2Cxc). The collapse gate misfired and the sub-column path discarded the video organics. Broadened the organic test to "titled link" (h3+a[href]), restoring the invariant "nodiv.gorganics in#rsooutside the panel."classifiers/main.py—ClassifyMainHeader.classify. Header-text classification runs before the structuralknowledge_panelcheck, so the panel's inner "People also search for" sub-carousel heading made the whole panel classify assearches_related. The header classifier now defers for whole-page (kp-wholepage-osrp) panels, letting the structural classifiers (available_on,knowledge_panel) type them correctly. Scoped so it does not affectavailable_onpanels (e.g. "watch the office", "where to watch breaking bad").component_parsers/knowledge.py—_subtype_dynamic_section. For a whole-page entity panel the genericpanelsub_type is correct; an internal subcard (a PASF carousel, or a feedback affordance whose heading precedes it) shouldn't define the panel's sub_type. Defers forkp-wholepage-osrppanels so the component staysknowledge/panel.Result on
3917a73cbceb("this is my life billy joel youtube")12 results, 0 unknown — matches the
0.9.0a0organic recovery with corrected panel typing.Tests
3917a73cbcebtotests/fixtures/serps.json.bz2(86 -> 87) with a note documenting all three guards, plus its snapshot.