Skip to content

fix(focus): retain matching heading sections - #35

Open
robbyczgw-cla wants to merge 1 commit into
dondai1234:masterfrom
robbyczgw-cla:fix/focus-heading-section-v1241
Open

fix(focus): retain matching heading sections#35
robbyczgw-cla wants to merge 1 commit into
dondai1234:masterfrom
robbyczgw-cla:fix/focus-heading-section-v1241

Conversation

@robbyczgw-cla

Copy link
Copy Markdown
Contributor

Summary

Retain the full bounded section under a markdown heading that matches focus=, even when individual child blocks do not repeat the exact query terms.

Type of change

  • Bug fix (non-breaking)
  • Reliability / hardening

Checklist

  • The change is functional, not a cosmetic re-label of an existing capability.
  • pytest tests/ passes locally: 765 passed, 5 deselected.
  • New behavior has tests that fail without the production change.
  • No new heavy module-level import in server.py.
  • CHANGELOG.md updated under ## [Unreleased].
  • No public parameter or schema change is required.
  • Package version surfaces are unchanged because this is not a release commit.

Notes for review

The patch preserves the existing heading boundary: inherited relevance stops at the next heading of the same or higher level. Normal BM25 scoring, table/code preservation, fallback selection, and sibling-section behavior remain unchanged.

Focused tests cover retention of lexically unmatched section content and exclusion of the next sibling section.

Fixes #32

dondai44423 added a commit to dondai44423/master-fetch that referenced this pull request Jul 30, 2026
The heading-aware boost multiplied scores (0.0 * 1.5 = 0.0), so a
matching heading's body with no exact query tokens was still dropped.
Matching sections are now explicitly selected within the heading boundary.

Co-authored-by: community PR dondai1234#35
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.

Heading-aware focus can drop content under a matching heading

1 participant