Skip to content

Fix complementary kp-wholepage panels: recover video organics, classify as knowledge#144

Merged
gitronald merged 2 commits into
feature/v0.9.0from
feature/kp-wholepage-complementary-panels
Jun 1, 2026
Merged

Fix complementary kp-wholepage panels: recover video organics, classify as knowledge#144
gitronald merged 2 commits into
feature/v0.9.0from
feature/kp-wholepage-complementary-panels

Conversation

@gitronald
Copy link
Copy Markdown
Owner

Problem

On a complementary kp-wholepage panel (a music/entity panel that sits beside an intact organic column, not collapsing it), the 0.9.0a1 sub-column model misfired and the panel itself was mislabeled. Surfaced on this is my life billy joel youtube:

  • The 10 YouTube video organics (div.g, organic-position siblings of the panel) were dropped0.9.0a0 emitted them as 10 general/video results, 0.9.0a1 emitted 0.
  • The music panel was labeled searches_related / or_give_general_feedback instead of knowledge / panel.

Root causes & fixes

  1. extractors/extractor_main.py_kp_organics_outside (the gate regression). The complementary-panel guard only recognized organics containing div.tF2Cxc, so it missed video-style div.g organics (a YouTube div.g has h3 + a[href] but no tF2Cxc). 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 "no div.g organics in #rso outside the panel."

  2. classifiers/main.pyClassifyMainHeader.classify. Header-text classification runs before the structural knowledge_panel check, so the panel's inner "People also search for" sub-carousel heading made the whole panel classify as searches_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 affect available_on panels (e.g. "watch the office", "where to watch breaking bad").

  3. component_parsers/knowledge.py_subtype_dynamic_section. For a whole-page entity panel the generic panel sub_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 for kp-wholepage-osrp panels so the component stays knowledge / panel.

Result on 3917a73cbceb ("this is my life billy joel youtube")

10x general / video                     (recovered)
 1x knowledge / panel                   (was searches_related / or_give_general_feedback)
 1x searches_related / related_searches (footer)

12 results, 0 unknown — matches the 0.9.0a0 organic recovery with corrected panel typing.

Tests

  • Added fixture 3917a73cbceb to tests/fixtures/serps.json.bz2 (86 -> 87) with a note documenting all three guards, plus its snapshot.
  • Full suite: 336 passed, 4 skipped, 87 snapshots. No existing fixture changed; the true collapsed kp-wholepage case ("30 year mortgage rates") is unaffected.

@gitronald gitronald merged commit d542995 into feature/v0.9.0 Jun 1, 2026
6 checks passed
@gitronald gitronald deleted the feature/kp-wholepage-complementary-panels branch June 1, 2026 04:20
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