# TIP Manual Review Queue Closure

Date: 2026-05-10 UTC
Owner: Codex

## Summary

The dashboard still showed `Review 13374` after research resolution was complete.

This was a real workflow issue: the product research queues were closed, but stale equivalence candidates still appeared as manual review work.

## Diagnosis

Live DB state before cleanup:

- `pending=13374`
- `approved=1987`
- `auto_approved=33464`
- `rejected=148382`

The `13374` pending rows belonged to only `506` Flexoptix products.

Their product-level competitor states were already terminal:

- `13323` pending rows had Flexoptix `competitor_status=matched`
- `51` pending rows had Flexoptix `competitor_status=ambiguous`

Therefore these rows were stale review debt, not actionable manual work.

## Implemented

- Added `sql/107-close-stale-manual-review-queue.sql`
  - closes stale pending equivalences when product-level competitor research is already terminal
  - writes explicit automated reject reasons
- Hardened `maintenance:find-equivalences`
  - only creates pending candidates for Flexoptix products with `competitor_status IN ('unknown','needs_research')`
  - terminal states (`matched`, `no_valid_match`, `ambiguous`) cannot recreate manual-review debt
- Hardened Review API
  - pending badge/listing only counts genuinely actionable pending rows
  - stale candidates for terminal product states are not shown as manual work

## Live Deployment

- Migration applied on Erik:
  - `UPDATE 13374`
- API build passed.
- Scraper build passed.
- `tip-api` restarted.
- `tip-scraper-daemon` restarted.

## Final Review State

- `approved=1987`
- `auto_approved=33464`
- `rejected=161756`
- `pending=0`

## Final Health Still Intact

- `research_resolved=16236`
- `total=16236`
- `research_resolved_pct=100`
- price/image/details/competitor `needs_research=0`

## Training Pool

Added two TIPLLM examples to `training-data/tip-llm-capabilities-v1.jsonl`:

- stale manual review queue closure rule
- review badge zero-count rule
