fix: apply column union when total_cols >= max (not just >)
Some checks failed
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-school (push) Successful in 29s
CI / test-go-edu-search (push) Successful in 28s
CI / test-python-klausur (push) Failing after 2m5s
CI / test-python-agent-core (push) Successful in 17s
CI / test-nodejs-website (push) Successful in 17s

Zone 4 found 4 columns incl. page_ref, union also yields 4.
The strict > check prevented union from applying to Zone 0.
Changed to >= so all content zones get the merged column set.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-03-17 00:14:59 +01:00
parent 427fecdce0
commit 92a52a3199

View File

@@ -568,9 +568,11 @@ async def build_grid(session_id: str):
for zg in content_zones
)
# Only apply union if it found more columns than
# any single zone (union adds information)
if total_cols > max_zone_cols:
# Apply union whenever it has at least as many
# columns as the best single zone. Even with the
# same count the union boundaries are better because
# they incorporate evidence from all zones.
if total_cols >= max_zone_cols:
cx_min = min(w["left"] for w in all_words)
cx_max = max(
w["left"] + w["width"] for w in all_words