fix: keep merged and resolved threads out of the draft queue (#33) (#34)
build / test (push) Successful in 3m9s
build / image (push) Successful in 17s

Co-authored-by: David Gwilliam <dhgwilliam@gmail.com>
Co-committed-by: David Gwilliam <dhgwilliam@gmail.com>
This commit was merged in pull request #34.
This commit is contained in:
2026-11-05 04:38:02 +00:00
committed by david
parent 45f966d44f
commit 87eb47ca3c
4 changed files with 38 additions and 9 deletions
+11
View File
@@ -1602,6 +1602,17 @@ type Thread struct {
LastActivity string // newest linked observation's signal time (created_at)
}
// IsDraft reports whether a thread still carries the heuristic auto-threader's
// editorial copy and is worth offering for polish. Merged clusters are resolved
// and left with no observations, so they are excluded: there is nothing to
// rewrite and the queue could never drain.
func (t Thread) IsDraft() bool {
if t.Status == "resolved" || t.EntryCount == 0 {
return false
}
return strings.Contains(t.Provenance, "auto_thread") || strings.HasPrefix(t.Motivation, "Auto-detected")
}
// stallAfterDays is how long a thread may go without activity before it is
// considered stalled (derived, reversible — not a stored state).
const stallAfterDays = 14