Knowledge
Search knowledge... ⌘K
Knowledge · Guidelines · go
Wire Created Components
Prevent dead code where optimization components are created but never integrated into production code paths
Metadata
go go
Description
When creating wrapper types (caches, pools, adapters, decorators) that enhance
existing components, the wrapper MUST be wired into the actual production code
path — not just exist alongside the original component.
This guideline was created after Decision #0108 identified a pattern where
CachedResolver was implemented but the persistence resolver still created
plain Resolver instances inside the allocation loop, making the cache dead code.
The dead code pattern:
1. Component A exists and is used in production code path
2. Enhancement wrapper B is created wrapping A (cache, retry, circuit breaker)
3. B's tests pass (B works correctly in isolation)
4. Production code path STILL uses A directly — B is never instantiated
This pattern is especially common in AI-generated code because the wrapper
and the integration are often handled in different code blocks or files.
Procedures
- P1
- P2
- P3