Summary
QueryStore in pkg/query/engine.go:11 is an 8-method interface that has exactly one implementation (*store.Store) and is not mocked anywhere — not in production code, not in engine_test.go. The indirection earns nothing: Engine already imports pkg/store for *store.Node, *store.RankedNode, *store.DiffRecord in the interface signatures themselves.
Location
pkg/query/engine.go:11-27 — interface definition
pkg/query/engine.go:30,34 — only usage sites
Category
refactor (over-abstraction)
Impact
Low–Medium — small line count, but every new store method Engine consumes forces a triple-edit (store method, interface method, callsite). And the "make Engine testable" rationale is unrealized (engine_test.go uses the real store, not a mock).
Rationale
Verified: grep -rn QueryStore --include='*.go' returns three lines, all in engine.go. Karpathy lens: the interface adds indirection without enabling a single concrete use case. The simpler, more obvious code is the direct dependency.
Suggested direction
Change store QueryStore → store *store.Store in the Engine struct, update the NewEngine signature accordingly, delete the QueryStore interface block. If a test mock ever appears, reintroduce the interface then. ~20 line net deletion.
Filed by the nightly enhancement-scanner routine.
Summary
QueryStoreinpkg/query/engine.go:11is an 8-method interface that has exactly one implementation (*store.Store) and is not mocked anywhere — not in production code, not inengine_test.go. The indirection earns nothing:Enginealready importspkg/storefor*store.Node,*store.RankedNode,*store.DiffRecordin the interface signatures themselves.Location
pkg/query/engine.go:11-27— interface definitionpkg/query/engine.go:30,34— only usage sitesCategory
refactor (over-abstraction)
Impact
Low–Medium — small line count, but every new store method
Engineconsumes forces a triple-edit (store method, interface method, callsite). And the "make Engine testable" rationale is unrealized (engine_test.gouses the real store, not a mock).Rationale
Verified:
grep -rn QueryStore --include='*.go'returns three lines, all inengine.go. Karpathy lens: the interface adds indirection without enabling a single concrete use case. The simpler, more obvious code is the direct dependency.Suggested direction
Change
store QueryStore→store *store.Storein theEnginestruct, update theNewEnginesignature accordingly, delete theQueryStoreinterface block. If a test mock ever appears, reintroduce the interface then. ~20 line net deletion.Filed by the nightly enhancement-scanner routine.