2.6.4 Extend coverage gating to the Epic-2 workflow modules + re-verify thresholds
Estimate: 30m · Depends on: 2.6.2, 2.6.3
Close the coverage-gating gap (gap #4). The coverage.include in vitest.config.ts currently lists ONLY the four Story-1.4 work-item-model files (added by 1.4.7); Epic-2’s workflow layer is ungated, and workItemsService grew across Stories 2.3–2.5 (detail / tree / list / pagination) after the 1.4.7 numbers were measured. This subtask brings the Epic-2 modules under the same per-file ≥90% gate and re-verifies the existing ones still hold.
Steps:
- Add
lib/services/workflowsService.tsandlib/repositories/workflowsRepository.tstocoverage.include, and add per-filethresholdsentries for each at{ branches: 90, functions: 90, lines: 90 }— matching the existing gate shape (each file gates independently so a regression in one fails the run, not a blended average). - Run
pnpm test:coverageand FILL any shortfall the new conformance/lifecycle suites leave on those two modules with targeted, non-duplicative tests (prefer extending the existingtests/workflows/*files; mark genuinely-unreachable defensive branches with an inline/* istanbul ignore … -- <reason> */, the same way 1.4.7 handled the SQLSTATE parser fallbacks — do not lower the threshold). - Re-verify the four work-item modules still pass ≥90% after Epic-2 growth; if 2.3–2.5 added an under-covered branch to
workItemsService, add the missing case (in the appropriate existing test file). - Update the coverage-numbers table in
tests/EPIC2_COVERAGE.md(2.6.1) with the final figures for all six gated modules.
CI already runs pnpm test:coverage in the test job (1.4.7), so the new thresholds gate every future PR automatically — no workflow-file change needed. Depends on 2.6.2 + 2.6.3 so their new tests count toward coverage before the gate tightens.
Acceptance criteria
vitest.config.tscoverage.includeincludes the two workflow modules;coverage.thresholdshas per-file ≥90% (branches/functions/lines) entries for both.pnpm test:coveragepasses with all SIX modules (4 work-item + 2 workflow) at ≥90% on every metric.- Any unreachable defensive branch excluded via an inline
istanbul ignorewith a stated reason — the threshold is NOT lowered. - The four pre-existing work-item modules still meet the gate after Epic-2 growth (any newly-uncovered branch from 2.3–2.5 is filled).
tests/EPIC2_COVERAGE.mdnumbers table updated to the final run.
Context refs
vitest.config.ts— thecoverageblock (provider v8, include, per-file thresholds) to extendlib/services/workflowsService.ts,lib/repositories/workflowsRepository.ts— the newly-gated modulestests/workflows/*.test.ts— where to add fill casestests/integration/work-items/TEST_COVERAGE.md— the 1.4.7 precedent (istanbul-ignore convention + numbers table).github/workflows/ci.yml— thetestjob already runstest:coverage(gates automatically)