diff --git a/db.go b/db.go index 3f75e3b..65fe7bd 100644 --- a/db.go +++ b/db.go @@ -53,11 +53,19 @@ type Comment struct { // Query is the read-side query derived from a search session's state. // -// ADDING A FIELD? Scoped invalidation (inval.go) re-implements this struct's -// filter semantics: update queryMatches AND the invalBattery test battery, or -// writes will under-invalidate the new facet's cache keys — a silent -// stale-list bug. (The drift-proof alternative, probing membership with -// buildWhere itself, is sketched in slop-essays/scoped-invalidation.md.) +// ADDING A FIELD? Three places re-express this struct's filter semantics and +// silently break if the new facet misses one: +// +// - ftsQuery AND statusLabelClauses (db.go): selectivity routing +// (walkBeatsFTS) can serve a filter from EITHER, so a facet added to one +// but not the other returns WRONG ROWS on the other path. Add the facet to +// both (or guard it out in walkBeatsFTS) and extend +// TestDenseLabelRoutingEquivalent's shapes. +// - queryMatches (inval.go): scoped invalidation; a missing facet means +// under-invalidation — silently stale cached lists. Extend invalBattery. +// +// (The drift-proof alternative, probing membership with buildWhere itself, is +// sketched in slop-essays/scoped-invalidation.md.) type Query struct { Text string Status string // "open" | "closed" | "all"