You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove test-driven seams: Bounded* interfaces and package-global overrides (#4)
* Drop Bounded* analyzer interfaces and their dead fallback branches
BoundedImpactAnalyzer and BoundedFlowTracer were obtained via runtime
downcast from the base ImpactAnalyzer/FlowTracer, but the sole concrete
types (*impact.Analyzer, *flows.Tracer) and the test mock all implement
the bounded method, so the downcast's ok was always true and the else
fallback branches never executed. Fold the bounded method into the base
interface, call it directly, and delete the two Bounded* interfaces, the
downcasts, the dead else branches, and the now-unused mock method.
No behavior change: the removed branches were unreachable in production.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* Replace test-only package globals with per-instance injection
Three package-level mutable var seams existed only so tests could swap
behavior, and reassigning a package global in a long-running MCP server
is not goroutine-safe:
- testBuildBatchReleaseHook and resolveBuildEdges (service) become
GraphService fields (onBatchRelease, resolveEdges); edgeResolver()
defaults to edgeresolve.ResolveWithOptions when unset.
- refreshSearchDocuments (mcp) becomes a Deps field; the handler method
defaults to service.RefreshSearchDocuments when unset.
Tests now set the field on the instance instead of mutating a global.
The production var literally named testBuildBatchReleaseHook is gone.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
0 commit comments