Status
DEFERRED — see Revisit Conditions below. Tracked for visibility, not actively scheduled.
Problem (when revisited)
Module-level vi.mock(...) calls on fork-boundary modules (src/agents/*, src/middleware/*) make stub regressions invisible by replacing the real module entirely. A lint rule requiring each such mock to be in an allowlist would force reviewer attention on any new fork-boundary mock added during sync PRs.
Proposed solution (when revisited)
scripts/check-mock-allowlist.mjs parses *.test.ts for vi.mock(...) calls on fork-boundary modules. Each must be in .mock-allowlist.json with { file, module, reason }. Adding a new entry requires PR description text. Same baseline pattern as check-stub-debt.mjs.
Why deferred
- Standalone value too low — only flags NEW mocks; existing mocks (which include all the broken cases) are grandfathered into the initial allowlist
- Composes well with reflective mock factory (other deferred child issue) — would become its enforcement layer
- Without the factory, this is mostly hygiene theater
Revisit when
Effort (estimated when revisited)
1 day
Dependencies
Tracked under: #2433
Couples with: reflective mock factory (other deferred child issue of #2433)
References
Status
DEFERRED — see Revisit Conditions below. Tracked for visibility, not actively scheduled.
Problem (when revisited)
Module-level
vi.mock(...)calls on fork-boundary modules (src/agents/*,src/middleware/*) make stub regressions invisible by replacing the real module entirely. A lint rule requiring each such mock to be in an allowlist would force reviewer attention on any new fork-boundary mock added during sync PRs.Proposed solution (when revisited)
scripts/check-mock-allowlist.mjsparses*.test.tsforvi.mock(...)calls on fork-boundary modules. Each must be in.mock-allowlist.jsonwith{ file, module, reason }. Adding a new entry requires PR description text. Same baseline pattern ascheck-stub-debt.mjs.Why deferred
Revisit when
Effort (estimated when revisited)
1 day
Dependencies
Tracked under: #2433
Couples with: reflective mock factory (other deferred child issue of #2433)
References
/evaluateanalysis: full deep-dive in evaluation report (2026-04-19 conversation)