# TASK-004 — Category taxonomy and filtering

**Status:** In progress  
**Branch:** feature/TASK-004-category-taxonomy  
**Started:** 2026-10-06  
**Last updated:** 2026-10-06

## Goal

Fix broken category browsing: align Flutter aisles with Ops data, two-level taxonomy, guarded classification, filters, and admin mapping tools.

## Acceptance criteria

- [x] Two-level category tree in Ops with migration
- [x] Classifier (mappings + keyword rules) and ingest lock
- [x] Catalogue API tree, filters, facets
- [x] Flutter API-driven aisles + category UX
- [x] Ops admin unmapped queue + recategorise
- [ ] Live DB audit + migrate on Docker (blocked when Docker off)

## Files touched

| File | Notes |
|------|-------|
| baskit_ops migrations, CatalogCategories, CategoryClassifier, CatalogueService | Core |
| baskit_app shop_categories, category_screen, api_client | Client |

## Session log

### 2026-10-06 — Cursor
- Did: Full taxonomy rework per plan; CATEGORY_AUDIT.md; legacy API frozen comment.
- Broke / deferred: Docker down — `php spark migrate` and live SQL audit not run.
- Commits: (pending user approval)

## Next steps

1. Start Docker; run migrations + `catalog:recategorise --dry-run` then `--apply`.
2. PHPUnit + Flutter tests; TestSprite smoke.
3. Commit `[TASK-004] ...` after user approves diff.
