fix(agent): recover the answer behind a bare "above" pointer #28

Merged
steve merged 10 commits from fix/backref-above-closer into main 2026-08-22 04:53:04 +00:00
Showing only changes of commit 7dccb233ad - Show all commits
+4 -4
View File
3
@@ -304,10 +304,10 @@ func isCitationsOnly(s string) bool {
// ratio in isSubstantiveAnswer keeps a matching closer in place when nothing
// earlier clearly outweighs it.
//
// Only pointsAbove is used here, not the whole isBackRef class: backRefRe's
// fixed phrases can appear anywhere in the text, and a 300-byte closer has
// room for a real answer that merely mentions "as I said" mid-sentence.
// pointsAbove is offset-bounded, so it stays anchored to the opening.
// pointsAbove is used here; its sibling backRefRe is NOT. Those fixed phrases
// are matched anywhere in the text, and a 300-byte closer has room for a real
// answer that merely mentions "as I said" mid-sentence. pointsAbove is
// offset-bounded, so it stays anchored to the opening.
func isSummaryCloser(s string) bool {
t := strings.TrimSpace(s)
if t == "" || len(t) > summaryCloserMaxChars {