From 41ad0d48eccf22af4e7f41f43d45a7d54c8ee0e1 Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Tue, 15 Sep 2026 13:12:22 +1000 Subject: [PATCH] refactor(binding): delete dead Matcher.Overlaps method DELETE: no document in docs/architecture/ or docs/prds/ specifies a consumer for binding.Matcher.Overlaps, and it has no caller or test caller. The store enforces the overlap invariant with its own SQL (internal/store/bindings.go InsertBinding/UpdateBinding), which is out of this lane's ownership and left untouched. The doc comment's empty-Source rule is already covered by Binding.validateCommon's "matcher.source is required" check, so nothing needs moving. --- internal/domain/binding/binding.go | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/internal/domain/binding/binding.go b/internal/domain/binding/binding.go index fb9455a7d..92fa0a728 100644 --- a/internal/domain/binding/binding.go +++ b/internal/domain/binding/binding.go @@ -138,18 +138,6 @@ func (m Matcher) Matches(source string, authenticated bool) bool { return m.Source == source } -// Overlaps reports whether two matchers cover any plausible event -// together. With a single-string matcher this collapses to: both have -// a non-empty Source equal to each other. Two empty matchers would -// overlap trivially; Validate rejects empty Sources upstream so this -// case cannot arise in practice. -func (m Matcher) Overlaps(other Matcher) bool { - if m.Source == "" || other.Source == "" { - return false - } - return m.Source == other.Source -} - // Normalize clamps an arbitrary string into a recognised Status, falling // back to StatusDraft for any unknown value. The DB CHECK constraint // already rejects bad strings at write time; Normalize is the API-edge