MotirBuilding in public
MOTIR · moooon
onMotir
You’re viewing a public project. Anyone can view it — no account needed. Sign in to submit, upvote, or comment on requests.View-only — you can’t edit work items
MOTIR-135

2.6.1 Epic-2 coverage audit + `tests/EPIC2_COVERAGE.md` matrix

Done
Description

Estimate: 30m · Depends on: 2.1, 2.2, 2.3, 2.4, 2.5

Audit the test coverage Stories 2.1–2.5 shipped and record it as an epic-level coverage matrix at tests/EPIC2_COVERAGE.md, mirroring the 1.4.7 convention (tests/integration/work-items/TEST_COVERAGE.md). This subtask is the audit deliverable: its output is the matrix + an explicit gap list that 2.6.2 / 2.6.3 / 2.6.4 / 2.6.5 consume, so the fill subtasks add net-new coverage instead of duplicating inherited assertions.

For every invariant in the 2.6 card scope — issue CRUD (create / update / assign / archive / move), type-parent rules (the kind-parent matrix + depth + cycle), workflow transitions (legal / illegal / unknown / no-op / open-mode / atomicity), key uniqueness (per-project sequence + concurrent allocation), issue list & tree reads (filter / sort / pagination / lazy-load), assignees (membership gates), and RLS / tenancy — name the covering test as file → describe, and tag it inherited (shipped by a feature story, kept as-is) / filled (was partial, 2.6 adds the missing case) / added (net-new in 2.6). Run pnpm test:coverage to capture the CURRENT baseline numbers for the work-item modules and (newly) the workflow modules, and record them in the doc’s numbers table. The doc MUST end with a short "Gaps 2.6 fills" section enumerating exactly the five gaps the Story description lists, each pointing at the subtask that closes it.

This subtask writes NO test code — it is documentation + a coverage run. Depends on the whole Epic-2 feature surface being done (Stories 2.1–2.5), since it audits their tests.

Acceptance criteria

  • tests/EPIC2_COVERAGE.md exists, structured like TEST_COVERAGE.md: a header explaining audit-not-duplicate, a files-referenced legend, the invariant→test matrix with inherited/filled/added tags, and a coverage-numbers table.
  • Every scope bullet above appears as at least one matrix row citing a REAL existing test file + describe (verified to exist — no invented paths).
  • A closing "Gaps 2.6 fills" section enumerates the five gaps, each mapped to its closing subtask (2.6.2 graph conformance, 2.6.3 lifecycle, 2.6.4 gating, 2.6.5 E2E; this doc itself closes the "no epic matrix" gap).
  • pnpm test:coverage runs clean and its reported numbers for workItemsService + the three repos AND workflowsService / workflowsRepository are transcribed into the table.
  • No app code or test code changes in this subtask (doc-only + the coverage run).

Context refs

  • tests/integration/work-items/TEST_COVERAGE.md — the 1.4.7 matrix this mirrors
  • tests/integration/work-items/*.test.ts, tests/workflows/*.test.ts, tests/issues/*.test.ts, tests/work-item-rls.test.ts, tests/project-counter.test.ts, tests/e2e/{issue-create-edit-flow,issue-detail-flow,workflow-flow,workflow-settings,workflow-delete-reassign}.spec.ts — the surface being audited
  • vitest.config.ts (coverage block) — the existing gate 2.6.4 extends
  • motir-core/CLAUDE.md — real-Postgres test rule (no mocks beyond getSession)