Commit 6262574
Refactor/drop test seams bounded (#5)
* 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>
* Collapse dead parser rung and drop write-only Deps.Parser field
Two parser-plumbing test seams flagged by the interface audit:
- The commentParserWithLanguage rung in parseForBuild only matched a
test parser that implemented ParseWithComments but not the richer
ParseWithCommentsAndMetadata; production parsers (*treesitter.Walker)
always match the metadata rung. Upgrade that test parser to the full
metadata contract and delete the middle rung and its interface.
- Deps.Parser had no production reader (graphService builds from
Deps.Walkers); only a test built an incremental syncer from it. Point
that test at Deps.Walkers[".go"] and remove the field and its wiring.
No production behavior change: Walker already took the metadata path and
Deps.Parser was never read outside tests.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>1 parent b2df729 commit 6262574
6 files changed
Lines changed: 6 additions & 20 deletions
File tree
- internal
- mcpruntime
- mcp
- service
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | | - | |
154 | 153 | | |
155 | 154 | | |
156 | 155 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
58 | 57 | | |
59 | 58 | | |
60 | 59 | | |
| |||
243 | 242 | | |
244 | 243 | | |
245 | 244 | | |
246 | | - | |
| 245 | + | |
247 | 246 | | |
248 | 247 | | |
249 | 248 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
129 | 134 | | |
130 | 135 | | |
131 | 136 | | |
| |||
159 | 164 | | |
160 | 165 | | |
161 | 166 | | |
162 | | - | |
163 | 167 | | |
164 | 168 | | |
165 | 169 | | |
| |||
203 | 207 | | |
204 | 208 | | |
205 | 209 | | |
206 | | - | |
207 | 210 | | |
208 | 211 | | |
209 | 212 | | |
| |||
239 | 242 | | |
240 | 243 | | |
241 | 244 | | |
242 | | - | |
243 | 245 | | |
244 | 246 | | |
245 | 247 | | |
| |||
373 | 375 | | |
374 | 376 | | |
375 | 377 | | |
376 | | - | |
377 | 378 | | |
378 | 379 | | |
379 | 380 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
91 | 90 | | |
92 | 91 | | |
93 | 92 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | 59 | | |
64 | 60 | | |
65 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | 47 | | |
56 | 48 | | |
57 | 49 | | |
| |||
0 commit comments