const { createClient } = require('@supabase/supabase-js');
require('dotenv').config();
const supabase = createClient(process.env.SUPABASE_URL, process.env.SUPABASE_SERVICE_KEY);

async function check() {
  const allCats = ['ai_training', 'labeling', 'writing', 'survey', 'research', 'verification', 'translation', 'transcription', 'micro', 'local', 'mystery', 'moderation', 'other'];
  
  const { data: tasks } = await supabase.from('tasks').select('category, title, status').eq('status', 'open');
  
  console.log('\n=== ACTIVE TASKS BY CATEGORY ===');
  const byCat = {};
  for (const t of tasks || []) {
    if (!byCat[t.category]) byCat[t.category] = [];
    byCat[t.category].push(t.title);
  }
  
  for (const cat of allCats) {
    const count = byCat[cat] ? byCat[cat].length : 0;
    const status = count > 0 ? '✅' : '❌';
    console.log(status + ' ' + cat + ': ' + count);
  }
  
  const missing = allCats.filter(c => !byCat[c] || byCat[c].length === 0);
  console.log('\n=== MISSING CATEGORIES ===');
  console.log(missing.length ? missing.join(', ') : 'None!');
}
check();
