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
DEFERRED — see Revisit Conditions below. Tracked for visibility, not actively scheduled.
Problem (when revisited)
Hand-written mocks in tests diverge silently from real module implementations. A factory that imports the real module, asserts each export's shape, then substitutes behavior would fail-fast at test setup when the real module's contract changes incompatibly.
Internally the factory imports the real module, asserts each export's shape (e.g., assertCallable(mod.resolveAgentRuntimeOrThrow, { returns: "string" })), then substitutes. When the real module's contract changes (e.g., resolveAgentRuntimeOrThrow becomes : never), the assertion fails at test setup time → all dependent tests fail → CI red.
Why deferred
Migration cost — 5+ test files for agent-scope alone, growing per fork-boundary module
Status
DEFERRED — see Revisit Conditions below. Tracked for visibility, not actively scheduled.
Problem (when revisited)
Hand-written mocks in tests diverge silently from real module implementations. A factory that imports the real module, asserts each export's shape, then substitutes behavior would fail-fast at test setup when the real module's contract changes incompatibly.
Proposed solution (when revisited)
Replace inline
vi.mock("../../agents/agent-scope.js", () => ({...}))with:Internally the factory imports the real module, asserts each export's shape (e.g.,
assertCallable(mod.resolveAgentRuntimeOrThrow, { returns: "string" })), then substitutes. When the real module's contract changes (e.g.,resolveAgentRuntimeOrThrowbecomes: never), the assertion fails at test setup time → all dependent tests fail → CI red.Why deferred
agent-scopealone, growing per fork-boundary moduleRevisit when
Effort (estimated when revisited)
3-5 days first module + factory; ongoing per-module (~1 day each).
Dependencies
Tracked under: #2433
Companion: mock-allowlist (other deferred child issue of #2433) — would be required to enforce factory usage
References
/evaluateanalysis: full deep-dive in evaluation report (2026-04-19 conversation)