MOTIR-146Done
2.7.6 Epic-6 filter integration — `type` becomes a filterable field in the 6.1.1 FilterAST
Estimate: 45m · Depends on: 2.7.3
Make type a first-class FILTER facet over the shipped 6.1.1 versioned FilterAST — so a user (and, later, the 7.5 planner read tool) can slice the backlog by the nature of the work ("all manual items still open", "the code vs design split"). This is what promoting type from prose to a column UNLOCKS — prose was unfilterable.
- Register
typeas a filterable field in the 6.1.1 FilterAST field registry: a closed-set enum facet over the tenWorkItemTypemembers (the fixed enum makes this a clean equality/inpredicate — no free-text matching). Supporttype = X,type in (X, Y), andtype is null(the unset/epic-story case), composing with the existing predicates (AND/OR) exactly like the other enum facets (status/kind/priority). - Repository translation. The FilterAST → Prisma
wheretranslation maps thetypepredicate to awork_item.typeclause (single-op repository method, 4-layer). Mirror howeverkind/statusare already translated —typeis the same shape (an enum column), so reuse that path, do not invent a new one. - Saved-view round-trip. Because the FilterAST is the saved-view serialization, a saved view with a
typepredicate must round-trip (persist + reload) unchanged — the versioned AST already guarantees this for the existing facets; confirmtyperides it.
Acceptance criteria
- The 6.1.1 FilterAST accepts
typeas a closed-set enum facet (= X/in (…)/is null), composing with AND/OR alongside the existing status/kind/priority predicates. - The FilterAST → Prisma translation produces the correct
work_item.typewhereclause (verified by 2.7.7 over a real Postgres); the translation lives in the repository layer (4-layer, mirroring the existing enum facets). - A saved view carrying a
typepredicate round-trips unchanged; an unknown type value in an incoming AST is rejected by the existing AST validation (the closed set is enforced).
Context refs
- The shipped 6.1.1 FilterAST — the versioned filter grammar + its field registry + the FilterAST → Prisma translator (the existing
kind/statusenum-facet pathtypemirrors). - 2.7.3 — the
WorkItemTypeenum (the closed set the facet validates against) + thework_item.typecolumn the predicate targets. motir-core/lib/services/workItemsService.ts/ the issues list read path — where the FilterAST is applied.motir-core/CLAUDE.md§ 4-layer.