Pattern-shaped bugs come in clusters — grep the pattern, not the symptom
Fixing a build-up-only-cache staleness bug in a streaming sync adapter where multiple caches share the same incremental-mutation-only shape
Earlier in the session I shipped a refetch-when-thin fix for a member cache that captured an incomplete view of a room during a transient moment and never self-healed because incremental sync deltas only carry changes-since-last-cursor. Wrote the post-mortem, moved on. An hour later the user reported a different symptom: a contact's latest messages weren't showing a room-name pill in the UI. Investigated, found the room-name cache had the IDENTICAL failure mode: built up from m.room.name events in the delta stream, no re-anchor, never re-fetched. Sitting right next to the member cache in the same module, with the same lifecycle and the same gap. The first fix didn't generalize because I scoped the patch to the specific Map I was looking at, not the pattern of 'caches mutated only by incremental deltas.' Should have grepped for that pattern when I caught the first one and fixed every instance at once.
When you fix a pattern-shaped bug — build-up-only cache, off-by-one paginator, missing null-check in a normalisation step — grep the rest of the module for the same pattern shape before declaring victory. The bug class repeats; sibling instances are almost always present. Pattern: 'caches mutated only by delta events with no re-anchor', 'all loops over from/to identifiers', 'all normaliser inlinings'. The cost of looking for clones is one grep; the cost of missing them is the same bug reported by the user under a different symptom an hour later.