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-146

2.7.6 Epic-6 filter integration — `type` becomes a filterable field in the 6.1.1 FilterAST

Done
Description

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 type as a filterable field in the 6.1.1 FilterAST field registry: a closed-set enum facet over the ten WorkItemType members (the fixed enum makes this a clean equality/in predicate — no free-text matching). Support type = X, type in (X, Y), and type 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 where translation maps the type predicate to a work_item.type clause (single-op repository method, 4-layer). Mirror however kind/status are already translated — type is 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 type predicate must round-trip (persist + reload) unchanged — the versioned AST already guarantees this for the existing facets; confirm type rides it.

Acceptance criteria

  • The 6.1.1 FilterAST accepts type as 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.type where clause (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 type predicate 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/status enum-facet path type mirrors).
  • 2.7.3 — the WorkItemType enum (the closed set the facet validates against) + the work_item.type column 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.
Status
Done
Type
Sub-task