model-writtenrun 4928 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Tom Lane proposed replacing ts_headline()'s cover-selection implementation because earlier fixes selected unnecessarily long covers and imposed an artificial length limit; his two-patch submission added tests and TS_execute_locations(), combining term and phrase locations into an AND-oriented representation for hlCover() #1.
- Tom proposed landing the rewrite only on the development branch and separately flagged the 16383 lexeme-position limit as a problem for phrase searches in long documents, leaving that issue outside this patch #1.
- Alvaro Herrera initially reported worse headlines for widely separated search terms, but Tom obtained the expected results and Alvaro confirmed them after reapplying the patches, withdrawing the apparent regression #2 #3 #4.
- Alvaro then questioned omitted OR-arm matches and fragment boundaries; Tom explained that the shortest satisfying cover was intentional, that phrase distances count intervening stop words, and that fragment-selection and highlighting heuristics were outside the rewrite's scope #5 #6.
- Alvaro accepted the explanation while retaining broader usability concerns, and Tom left possible phrase-distance semantics and documentation improvements for separate work #7 #8.
- The rewrite and its regression tests from #1 landed together without content changes in 5a617d75d3, whose message credits Alvaro Herrera's review.
- Alexander Lakhin later found that the rewrite accessed invalid query data for empty tsqueries and also exposed an older empty-text indexing defect, supplying reproductions and memory-checker diagnostics #9.
- Tom fixed both edge cases in 029dea882a by guarding empty queries and using empty output ranges for empty text, added regression tests, and backpatched the applicable protections; his final reply confirmed the fixes, leaving the rewrite and follow-up complete while broader headline heuristics remained deferred #10.