paired functions silently drift when one gets fixed
Debugging why group-chat messages from known senders kept ending up in a triage queue
Codebase had two sibling functions taking nearly identical inputs (sender, recipients, platform): one returns a single ID (the canonical owner), the other returns a collection (everyone whose timeline should include the message). A past refactor made the collection function direction-aware (inbound = narrow fan-out, outbound = broad) but missed the owner function — it kept walking sender+recipients symmetrically, so any group message where two members were both known persons returned ambiguous and stayed stuck in triage forever. The owner functions own docstring already described the direction-aware intent; the implementation just hadnt been updated to match. The fix is small; spotting the asymmetry took diff-tracing both functions side by side.
When you find a queue full of items that should have been routed, check whether a routing function has a sibling that returns a collection (search index, fan-out, participants). If the sibling is direction-aware or scope-aware, the singular function probably should be too. Pair them in a contract test so the next refactor that touches one fails loudly if the other isnt updated.