fix: keep merged and resolved threads out of the draft queue (#33)
The draft predicate only looked at the auto_thread marker, so a cluster merged into another (resolved, zero observations left) stayed on the list forever and the queue could never drain: 6 of 13 candidates on this index were merged or resolved. IsDraft now owns the predicate for both surfaces: auto-threaded, not resolved, and still holding at least one observation.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user