{
  "permissions": {
    "allow": [
      "Bash(/root/projects/ai_usecases_explorer/venv/bin/python --version)",
      "Bash(/root/projects/ai_usecases_explorer/venv/bin/pip list)",
      "Bash(source venv/bin/activate && pip install -e \".[dev]\" -q && echo \"Install OK\")",
      "Bash(source venv/bin/activate && pytest tests/test_models.py -v 2>&1 | tail -20)",
      "Bash(source venv/bin/activate && pytest tests/test_models.py -v 2>&1 | tail -25)",
      "Bash(source venv/bin/activate && pytest tests/test_storage.py -v 2>&1 | tail -10)",
      "Bash(source venv/bin/activate && pytest tests/test_storage.py -v 2>&1 | tail -25)",
      "Bash(source venv/bin/activate && pytest tests/test_collectors.py -v 2>&1 | tail -10)",
      "Bash(source venv/bin/activate && pytest tests/test_collectors.py -v 2>&1 | tail -30)",
      "Bash(source venv/bin/activate && pytest tests/test_processors.py -v 2>&1 | tail -10)",
      "Bash(source venv/bin/activate && pytest tests/test_processors.py -v 2>&1 | tail -30)",
      "Bash(source venv/bin/activate && pytest tests/test_processors.py -v 2>&1 | tail -20)",
      "Bash(source venv/bin/activate && pytest tests/test_reporters.py -v 2>&1 | tail -10)",
      "Bash(source venv/bin/activate && pytest tests/test_reporters.py -v 2>&1 | tail -30)",
      "Bash(source venv/bin/activate && pytest tests/test_main.py -v 2>&1 | tail -10)",
      "Bash(source venv/bin/activate && pytest tests/test_main.py -v 2>&1 | tail -30)",
      "Bash(source venv/bin/activate && pytest tests/ -v 2>&1 | tail -20)",
      "Bash(source venv/bin/activate && ruff check src/ tests/ 2>&1)",
      "Bash(source venv/bin/activate && ruff check src/ tests/ --fix 2>&1 | head -20)",
      "Bash(source venv/bin/activate && ruff check src/ tests/ --fix 2>&1)",
      "Bash(source venv/bin/activate && pytest tests/ -v 2>&1)",
      "Bash(echo \"ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY\" | head -c 60)",
      "Bash(source venv/bin/activate && pytest tests/ -q 2>&1 | tail -5)",
      "Bash(source venv/bin/activate && python -m ai_usecases_explorer.main --dry-run 2>&1)",
      "Bash(source venv/bin/activate && python -c \"\nimport httpx\n\n# Test HN - try simpler query first\nr = httpx.get\\('https://hn.algolia.com/api/v1/search', params={\n    'query': 'claude',\n    'tags': 'story',\n    'numericFilters': 'points>=10',\n    'hitsPerPage': 5\n}, timeout=15\\)\nprint\\('HN status:', r.status_code\\)\ndata = r.json\\(\\)\nprint\\('HN hits:', data.get\\('nbHits', 0\\)\\)\nif data.get\\('hits'\\):\n    print\\('First hit:', data['hits'][0].get\\('title'\\)\\)\n\")",
      "Bash(source venv/bin/activate && python -c \"\nimport httpx\n\n# Test Reddit with browser-like User-Agent\nheaders = {'User-Agent': 'Mozilla/5.0 \\(X11; Linux x86_64\\) AppleWebKit/537.36 \\(KHTML, like Gecko\\) Chrome/121.0.0.0 Safari/537.36'}\nr = httpx.get\\('https://www.reddit.com/r/ClaudeAI/new.json?limit=5', headers=headers, timeout=15, follow_redirects=True\\)\nprint\\('Reddit status:', r.status_code\\)\nif r.status_code == 200:\n    data = r.json\\(\\)\n    kids = data.get\\('data', {}\\).get\\('children', []\\)\n    print\\('Posts:', len\\(kids\\)\\)\n    if kids:\n        print\\('First:', kids[0]['data']['title'][:60]\\)\n\")",
      "Bash(source venv/bin/activate && python -c \"\nimport httpx\n# Try old.reddit.com JSON endpoint\nr = httpx.get\\('https://old.reddit.com/r/ClaudeAI/new.json?limit=5', \n    headers={'User-Agent': 'ai-scout:v0.1 \\(by /u/researcher\\)'},\n    timeout=15, follow_redirects=True\\)\nprint\\('old.reddit status:', r.status_code\\)\nprint\\('Response preview:', r.text[:200]\\)\n\")",
      "Bash(source venv/bin/activate && python -c \"\nimport httpx\n\n# Test original HN query - the issue might be the quoted OR syntax\nr = httpx.get\\('https://hn.algolia.com/api/v1/search', params={\n    'query': '\\\\\"claude\\\\\" OR \\\\\"claude code\\\\\" OR \\\\\"mcp server\\\\\" OR \\\\\"llm workflow\\\\\" OR \\\\\"ai agent local\\\\\"',\n    'tags': '\\(story,ask_hn,show_hn\\)',\n    'numericFilters': 'points>=10',\n    'hitsPerPage': 5\n}, timeout=15\\)\nprint\\('HN quoted-OR status:', r.status_code, '— hits:', r.json\\(\\).get\\('nbHits', 0\\)\\)\n\n# Test with search_by_date for recency\nr2 = httpx.get\\('https://hn.algolia.com/api/v1/search_by_date', params={\n    'query': 'claude OR mcp OR llm',\n    'tags': '\\(story,ask_hn,show_hn\\)',\n    'numericFilters': 'points>=10',\n    'hitsPerPage': 5\n}, timeout=15\\)\nprint\\('HN search_by_date:', r2.status_code, '— hits:', r2.json\\(\\).get\\('nbHits', 0\\)\\)\nif r2.json\\(\\).get\\('hits'\\):\n    print\\('First:', r2.json\\(\\)['hits'][0]['title'][:70]\\)\n\")",
      "Bash(source venv/bin/activate && python -c \"\nimport anthropic, os\nfrom dotenv import load_dotenv\nload_dotenv\\(\\)\n\nclient = anthropic.Anthropic\\(\n    api_key=os.environ['ANTHROPIC_API_KEY'],\n    base_url=os.environ.get\\('ANTHROPIC_BASE_URL'\\)\n\\)\nmsg = client.messages.create\\(\n    model='claude-haiku-4-5-20251001',\n    max_tokens=256,\n    system='Respond with only valid JSON: {\\\\\"ok\\\\\": true}',\n    messages=[{'role': 'user', 'content': 'test'}]\n\\)\nprint\\('Stop reason:', msg.stop_reason\\)\nprint\\('Content blocks:', len\\(msg.content\\)\\)\nprint\\('First block type:', msg.content[0].type if msg.content else 'NONE'\\)\nprint\\('Text:', repr\\(msg.content[0].text\\) if msg.content else 'EMPTY'\\)\n\")",
      "Bash(source venv/bin/activate && pytest tests/test_collectors.py::TestHackerNewsCollector -v 2>&1 | tail -20)",
      "Bash(source venv/bin/activate && pytest tests/test_collectors.py::TestRedditCollector tests/test_collectors.py::TestGitHubCollector -v 2>&1 | tail -15)",
      "Bash(source venv/bin/activate && python -c \"\nimport httpx\n\n# Test both HN queries\nqueries = [\n    'claude mcp copilot cursor aider ollama gemini openai localllm',\n    'llm workflow agentic vibecoding automation rag langchain n8n crewai dspy autogen',\n]\nfor q in queries:\n    r = httpx.get\\('https://hn.algolia.com/api/v1/search_by_date', params={\n        'query': q, 'tags': '\\(story,ask_hn,show_hn\\)',\n        'numericFilters': 'points>=10', 'hitsPerPage': 5\n    }, timeout=15\\)\n    data = r.json\\(\\)\n    print\\(f'Query \\\\\"{q[:30]}...\\\\\" → {data.get\\(\\\\\"nbHits\\\\\",0\\)} hits'\\)\n    for h in data.get\\('hits', []\\)[:2]:\n        print\\(f'  [{h.get\\(\\\\\"points\\\\\",0\\)}pts] {h.get\\(\\\\\"title\\\\\",\\\\\"\\\\\"\\)[:60]}'\\)\n\")",
      "Bash(source venv/bin/activate && python -c \"\nimport httpx\n\n# Test without numericFilters — see if there are any results at all\nr = httpx.get\\('https://hn.algolia.com/api/v1/search_by_date', params={\n    'query': 'claude', 'tags': 'story', 'hitsPerPage': 5\n}, timeout=15\\)\nd = r.json\\(\\)\nprint\\('Without points filter, hits:', d.get\\('nbHits', 0\\)\\)\n\n# Test the search \\(not search_by_date\\) endpoint\nr2 = httpx.get\\('https://hn.algolia.com/api/v1/search', params={\n    'query': 'claude', 'tags': 'story',\n    'numericFilters': 'points>=10', 'hitsPerPage': 5\n}, timeout=15\\)\nd2 = r2.json\\(\\)\nprint\\('search endpoint, hits:', d2.get\\('nbHits', 0\\)\\)\nfor h in d2.get\\('hits', []\\)[:2]:\n    print\\(f'  [{h.get\\(\\\\\"points\\\\\",0\\)}pts] {h.get\\(\\\\\"title\\\\\",\\\\\"\\\\\"\\)[:60]}'\\)\n\")",
      "Bash(source venv/bin/activate && python -c \"\nimport httpx\nfrom datetime import date, timedelta\n\n# Test GitHub search\nsince = \\(date.today\\(\\) - timedelta\\(days=2\\)\\).isoformat\\(\\)\nquery = f'topic:llm OR topic:claude pushed:>{since} stars:>=10'\nprint\\('Query:', query\\)\nr = httpx.get\\('https://api.github.com/search/repositories', params={\n    'q': query, 'sort': 'stars', 'order': 'desc', 'per_page': 5\n}, headers={'Accept': 'application/vnd.github+json'}, timeout=15\\)\nprint\\('GitHub status:', r.status_code\\)\nd = r.json\\(\\)\nprint\\('Total:', d.get\\('total_count', 0\\)\\)\nfor item in d.get\\('items', []\\)[:3]:\n    print\\(f'  [{item[\\\\\"stargazers_count\\\\\"]}★] {item[\\\\\"full_name\\\\\"]} — {item[\\\\\"description\\\\\"][:50] if item[\\\\\"description\\\\\"] else \\\\\"-\\\\\"}'\\)\n\")",
      "Bash(source venv/bin/activate && python -c \"\nimport httpx\n\n# Is search_by_date broken with numericFilters today specifically?\nr = httpx.get\\('https://hn.algolia.com/api/v1/search_by_date', params={\n    'query': 'claude', 'tags': 'story',\n    'numericFilters': 'points>=10', 'hitsPerPage': 5\n}, timeout=15\\)\nprint\\('search_by_date + points>=10:', r.json\\(\\).get\\('nbHits', 0\\)\\)\n\nr2 = httpx.get\\('https://hn.algolia.com/api/v1/search_by_date', params={\n    'query': 'claude', 'tags': 'story',\n    'numericFilters': 'points>=1', 'hitsPerPage': 5\n}, timeout=15\\)\nd2 = r2.json\\(\\)\nprint\\('search_by_date + points>=1:', d2.get\\('nbHits', 0\\)\\)\nfor h in d2.get\\('hits', []\\)[:3]:\n    print\\(f'  [{h.get\\(\\\\\"points\\\\\",0\\)}pts] {h.get\\(\\\\\"title\\\\\",\\\\\"\\\\\"\\)[:60]} \\({h.get\\(\\\\\"created_at\\\\\",\\\\\"\\\\\"\\)[:10]}\\)'\\)\n\")",
      "Bash(source venv/bin/activate && python -c \"\nimport httpx\n\n# Narrow down: is it the tags OR the multi-word query?\ntests = [\n    {'query': 'claude', 'tags': 'story', 'numericFilters': 'points>=10'},\n    {'query': 'claude', 'tags': '\\(story,ask_hn,show_hn\\)', 'numericFilters': 'points>=10'},\n    {'query': 'claude mcp', 'tags': '\\(story,ask_hn,show_hn\\)', 'numericFilters': 'points>=10'},\n    {'query': 'claude mcp copilot cursor', 'tags': '\\(story,ask_hn,show_hn\\)', 'numericFilters': 'points>=10'},\n]\nfor p in tests:\n    r = httpx.get\\('https://hn.algolia.com/api/v1/search_by_date', params={**p, 'hitsPerPage': 3}, timeout=15\\)\n    print\\(f'tags={p[\\\\\"tags\\\\\"]!r}, query={p[\\\\\"query\\\\\"]!r} → {r.json\\(\\).get\\(\\\\\"nbHits\\\\\",0\\)} hits'\\)\n\")",
      "Bash(source venv/bin/activate && python -c \"\nimport anthropic, os\nfrom dotenv import load_dotenv\nload_dotenv\\(\\)\nclient = anthropic.Anthropic\\(api_key=os.environ['ANTHROPIC_API_KEY'], base_url=os.environ.get\\('ANTHROPIC_BASE_URL'\\)\\)\n# Test with very long/noisy input to see what happens\nmsg = client.messages.create\\(\n    model='claude-haiku-4-5-20251001',\n    max_tokens=256,\n    system='Respond ONLY with valid JSON: {\\\\\"is_real_value\\\\\": bool}',\n    messages=[{'role': 'user', 'content': 'x' * 100}]\n\\)\nprint\\('text:', repr\\(msg.content[0].text[:200]\\)\\)\nprint\\('stop_reason:', msg.stop_reason\\)\n\")",
      "Bash(source venv/bin/activate && pytest tests/ -q 2>&1 | tail -5 && ruff check src/ tests/ 2>&1)",
      "Bash(source venv/bin/activate && MAX_ITEMS_PER_RUN=20 python -m ai_usecases_explorer.main --dry-run 2>&1)",
      "Bash(source venv/bin/activate && pip install exa-py -q 2>&1 | tail -5)",
      "Bash(source venv/bin/activate && pip show exa-py 2>&1 | head -4)",
      "Bash(source venv/bin/activate && ruff check . 2>&1)",
      "Bash(source venv/bin/activate && pytest tests/test_main.py -v 2>&1)",
      "Bash(source venv/bin/activate && python -c \"\nfrom ai_usecases_explorer.settings import Settings\nfrom ai_usecases_explorer.collectors.reddit import RedditCollector\n\ns = Settings\\(\\)\nr = RedditCollector\\(queries=s.reddit_queries, api_key=s.exa_api_key\\)\nitems = r.fetch\\(\\)\nfor i in items[:5]:\n    print\\('---'\\)\n    print\\('title:', i.title[:80]\\)\n    print\\('url:', i.source_url[:80]\\)\n    print\\('content preview:', i.raw_content[:200]\\)\n    print\\(\\)\n\")",
      "Bash(source venv/bin/activate && python -c \"\nimport inspect\nfrom exa_py import Exa\nprint\\(inspect.signature\\(Exa.search_and_contents\\)\\)\n\")",
      "Bash(source venv/bin/activate && python -c \"\nfrom ai_usecases_explorer.settings import Settings\nfrom exa_py import Exa\nfrom datetime import UTC, datetime, timedelta\n\ns = Settings\\(\\)\nexa = Exa\\(api_key=s.exa_api_key\\)\nstart = \\(datetime.now\\(tz=UTC\\) - timedelta\\(hours=24\\)\\).strftime\\('%Y-%m-%dT%H:%M:%SZ'\\)\n\n# Test with search\\(\\) instead of search_and_contents\\(\\)\nresults = exa.search\\(\n    'Claude AI use case workflow automation',\n    include_domains=['reddit.com'],\n    start_published_date=start,\n    num_results=5,\n    contents={'text': True},\n\\)\nfor r in results.results:\n    print\\('url:', r.url\\)\n    print\\('title:', r.title[:60] if r.title else 'N/A'\\)\n    print\\(\\)\n\")",
      "Bash(source venv/bin/activate && pytest tests/test_collectors.py::TestRedditCollector -v 2>&1)",
      "Bash(source venv/bin/activate && python -c \"\nfrom ai_usecases_explorer.settings import Settings\nfrom ai_usecases_explorer.collectors.reddit import RedditCollector\n\ns = Settings\\(\\)\nr = RedditCollector\\(queries=s.reddit_queries, api_key=s.exa_api_key\\)\nitems = r.fetch\\(\\)\nprint\\(f'Total reddit.com items: {len\\(items\\)}'\\)\nfor i in items[:5]:\n    print\\('  -', i.url if hasattr\\(i, 'url'\\) else i.source_url[:80]\\)\n\")",
      "Bash(source venv/bin/activate && pytest tests/ -q 2>&1 | tail -3)",
      "WebFetch(domain:openclaw.ai)",
      "WebFetch(domain:github.com)",
      "Bash(source venv/bin/activate && python -c \"\nfrom ai_usecases_explorer.settings import Settings\nfrom ai_usecases_explorer.collectors.hackernews import HackerNewsCollector\n\ns = Settings\\(\\)\nitems = HackerNewsCollector\\(min_points=s.hn_min_points\\).fetch\\(\\)\nitems.sort\\(key=lambda x: x.score, reverse=True\\)\nprint\\('HN Top 10 by points:'\\)\nfor i in items[:10]:\n    print\\(f'  {i.score:4d}pt  {i.title[:60]}'\\)\n\" 2>&1)",
      "Bash(crontab -l 2>&1)",
      "Bash(crontab -l)",
      "Bash(crontab - << 'EOF'\n*/5 * * * * flock -xn /tmp/stargate.lock -c '/usr/local/qcloud/stargate/admin/start.sh > /dev/null 2>&1 &'\n0 7 * * * /root/projects/ai_usecases_explorer/venv/bin/python -m ai_usecases_explorer.main >> /var/log/ai_usecases_scout.log 2>&1\nEOF)",
      "Bash({ crontab -l | grep -v \"ai_usecases_explorer.main\"; echo \"0 7 * * * /root/projects/ai_usecases_explorer/venv/bin/python -m ai_usecases_explorer.main >> /var/log/ai_usecases_scout.log 2>&1\"; } | crontab -)",
      "Bash(crontab /tmp/crontab_new.txt && crontab -l)",
      "Bash(/root/projects/ai_usecases_explorer/venv/bin/python -m ai_usecases_explorer.main --dry-run 2>&1 | head -5)",
      "Bash(find /root/.claude -name \"*simplify*\" -o -name \"*command*\" -o -name \"*skill*\" 2>/dev/null | head -20)",
      "Bash(find /root/.claude/plugins -name \"*.md\" 2>/dev/null | grep -E \"\\(command|skill|SKILL\\)\" | head -20)",
      "Bash(source venv/bin/activate && pytest tests/test_deep_dive.py -x -q 2>&1 | head -30)",
      "Bash(source venv/bin/activate && pytest tests/test_deep_dive.py -v 2>&1)",
      "Bash(source venv/bin/activate && ruff check src/ai_usecases_explorer/deep_dive/ tests/test_deep_dive.py 2>&1)",
      "Bash(source venv/bin/activate && ruff check src/ai_usecases_explorer/deep_dive/ tests/test_deep_dive.py --fix 2>&1)",
      "Bash(source venv/bin/activate && pytest tests/ -q 2>&1 | tail -10)",
      "Bash(source venv/bin/activate && python -m ai_usecases_explorer.deep_dive.cli --url https://www.jpost.com/business-and-innovation/tech-and-start-ups/article-887881 --dry-run 2>&1)",
      "Bash(chmod +x /usr/local/bin/ai-deep-dive && ai-deep-dive --help)",
      "Bash(ai-deep-dive --url https://www.jpost.com/business-and-innovation/tech-and-start-ups/article-887881 2>&1)",
      "Bash(source venv/bin/activate && pytest tests/ -q 2>&1 | tail -8 && ruff check src/ai_usecases_explorer/deep_dive/ 2>&1)",
      "Bash(source venv/bin/activate && pytest tests/ -q 2>&1 | tail -4 && ruff check src/ai_usecases_explorer/deep_dive/ 2>&1)",
      "Bash(source venv/bin/activate && pytest tests/test_deep_dive.py -q 2>&1 | tail -20)",
      "Bash(source venv/bin/activate && pytest tests/test_deep_dive.py -q 2>&1 | tail -30)",
      "Bash(source venv/bin/activate && pytest tests/test_deep_dive.py::TestStructuralAnalyzerLogicalQuality -v 2>&1 | tail -15)",
      "Bash(source venv/bin/activate && pytest tests/test_deep_dive.py::TestMultiPerspectiveEvaluatorEnriched -v 2>&1 | tail -20)",
      "Bash(source venv/bin/activate && grep -A 20 '\\\\[tool.ruff\\\\]' pyproject.toml)",
      "Bash(source venv/bin/activate && ruff check . && echo \"CLEAN\")",
      "Skill(deep-dive)",
      "Bash(source venv/bin/activate && python -c \"\nfrom ai_usecases_explorer.settings import Settings\ns = Settings\\(\\)\nprint\\('EXA_API_KEY set:', bool\\(s.exa_api_key\\)\\)\nprint\\('GITHUB_TOKEN set:', bool\\(s.github_token\\)\\)\nprint\\('HN min_points:', s.hn_min_points\\)\nprint\\('GitHub min_stars:', s.github_min_stars\\)\nprint\\('Reddit subreddits:', s.reddit_subreddits\\)\n\")",
      "Bash(source venv/bin/activate && python -c \"\nimport httpx\n# Test GitHub API directly for one topic\ntopic = 'ai-agent'\nurl = 'https://api.github.com/search/repositories'\nfrom datetime import date, timedelta\nsince = \\(date.today\\(\\) - timedelta\\(days=2\\)\\).isoformat\\(\\)\nquery = f'topic:{topic} pushed:>{since} stars:>=10'\nprint\\(f'Query: {query}'\\)\nresp = httpx.get\\(url, params={'q': query, 'sort': 'stars', 'order': 'desc', 'per_page': 5}, headers={'Accept': 'application/vnd.github+json'}, timeout=15\\)\nprint\\(f'Status: {resp.status_code}'\\)\ndata = resp.json\\(\\)\nprint\\(f'Total count: {data.get\\(\\\\\"total_count\\\\\", 0\\)}'\\)\nprint\\(f'Items returned: {len\\(data.get\\(\\\\\"items\\\\\", []\\)\\)}'\\)\nif data.get\\(\\\\\"items\\\\\"\\):\n    for item in data[\\\\\"items\\\\\"][:3]:\n        print\\(f'  - {item[\\\\\"full_name\\\\\"]} \\(stars={item[\\\\\"stargazers_count\\\\\"]}, pushed={item[\\\\\"pushed_at\\\\\"][:10]}\\)'\\)\nelif data.get\\(\\\\\"message\\\\\"\\):\n    print\\(f'Error: {data[\\\\\"message\\\\\"]}'\\)\n\" 2>&1)",
      "Bash(source venv/bin/activate && python -c \"\nfrom ai_usecases_explorer.settings import Settings\nfrom exa_py import Exa\nfrom datetime import UTC, datetime, timedelta\n\ns = Settings\\(\\)\nexa = Exa\\(api_key=s.exa_api_key\\)\nstart_date = \\(datetime.now\\(tz=UTC\\) - timedelta\\(hours=48\\)\\).strftime\\('%Y-%m-%dT%H:%M:%SZ'\\)\n\n# Test 1: include_domains with path \\(current approach\\)\nprint\\('=== Test 1: include_domains=[reddit.com/r/ClaudeCode] ==='\\)\ntry:\n    resp = exa.search_and_contents\\(\n        'AI workflow automation use case tool productivity',\n        include_domains=['reddit.com/r/ClaudeCode'],\n        start_published_date=start_date,\n        text=True,\n        num_results=5,\n    \\)\n    print\\(f'Results: {len\\(resp.results\\)}'\\)\n    for r in resp.results[:3]:\n        print\\(f'  URL: {r.url}'\\)\nexcept Exception as e:\n    print\\(f'ERROR: {e}'\\)\n\" 2>&1)",
      "Bash(source venv/bin/activate && python -c \"\nfrom ai_usecases_explorer.settings import Settings\nfrom exa_py import Exa\nfrom datetime import UTC, datetime, timedelta\n\ns = Settings\\(\\)\nexa = Exa\\(api_key=s.exa_api_key\\)\nstart_date = \\(datetime.now\\(tz=UTC\\) - timedelta\\(hours=48\\)\\).strftime\\('%Y-%m-%dT%H:%M:%SZ'\\)\n\n# Test 2: just include_domains=['reddit.com'] with query mentioning subreddit\nprint\\('=== Test 2: include_domains=[reddit.com], subreddit in query ==='\\)\ntry:\n    resp = exa.search_and_contents\\(\n        'site:reddit.com/r/ClaudeCode AI agent workflow tool',\n        include_domains=['reddit.com'],\n        start_published_date=start_date,\n        text=True,\n        num_results=10,\n    \\)\n    print\\(f'Results: {len\\(resp.results\\)}'\\)\n    for r in resp.results[:5]:\n        print\\(f'  URL: {r.url}'\\)\nexcept Exception as e:\n    print\\(f'ERROR: {e}'\\)\n\n# Test 3: Exa Neural search with direct query\nprint\\(\\)\nprint\\('=== Test 3: include_domains=[reddit.com] broad AI query, last 48h ==='\\)\ntry:\n    resp = exa.search_and_contents\\(\n        'AI tool automation workflow use case',\n        include_domains=['reddit.com'],\n        start_published_date=start_date,\n        text=True,\n        num_results=10,\n    \\)\n    print\\(f'Results: {len\\(resp.results\\)}'\\)\n    for r in resp.results[:5]:\n        print\\(f'  URL: {r.url[:80]}'\\)\nexcept Exception as e:\n    print\\(f'ERROR: {e}'\\)\n\" 2>&1)",
      "Bash(source venv/bin/activate && python -c \"\nfrom ai_usecases_explorer.collectors.github import GitHubCollector\nfrom ai_usecases_explorer.settings import Settings\n\ns = Settings\\(\\)\ncollector = GitHubCollector\\(min_stars=s.github_min_stars, token=s.github_token, lookback_days=2\\)\nitems = collector.fetch\\(\\)\nprint\\(f'GitHub raw items collected: {len\\(items\\)}'\\)\nfor item in items[:5]:\n    print\\(f'  - {item.title} \\(score={item.score}, platform={item.source_platform}\\)'\\)\n\" 2>&1)",
      "Bash(source venv/bin/activate && python -c \"\nfrom ai_usecases_explorer.collectors.github import GitHubCollector\nfrom ai_usecases_explorer.settings import Settings\nfrom ai_usecases_explorer.storage.database import Database\nfrom ai_usecases_explorer.models.usecase import make_id\n\ns = Settings\\(\\)\ncollector = GitHubCollector\\(min_stars=s.github_min_stars, token=s.github_token, lookback_days=2\\)\nitems = collector.fetch\\(\\)\ndb = Database\\(db_path=s.db_path\\)\n\nalready_in_db = 0\nnew_items = 0\nfor item in items:\n    item_id = make_id\\(item.source_url\\)\n    if db.exists\\(item_id\\):\n        already_in_db += 1\n    else:\n        new_items += 1\n\nprint\\(f'Total collected: {len\\(items\\)}'\\)\nprint\\(f'Already in DB: {already_in_db}'\\)\nprint\\(f'New \\(not in DB\\): {new_items}'\\)\n\" 2>&1)",
      "Bash(source venv/bin/activate && python -c \"\n# Check what actually happened: test value filter on a sample of GitHub items\nfrom ai_usecases_explorer.collectors.github import GitHubCollector\nfrom ai_usecases_explorer.settings import Settings\nfrom ai_usecases_explorer.storage.database import Database\nfrom ai_usecases_explorer.models.usecase import make_id\nimport anthropic\n\ns = Settings\\(\\)\ncollector = GitHubCollector\\(min_stars=s.github_min_stars, token=s.github_token, lookback_days=2\\)\nitems = collector.fetch\\(\\)\ndb = Database\\(db_path=s.db_path\\)\n\n# Get new items only\nnew_items = [item for item in items if not db.exists\\(make_id\\(item.source_url\\)\\)]\nprint\\(f'New GitHub items: {len\\(new_items\\)}'\\)\nprint\\('Sample of new items:'\\)\nfor item in new_items[:10]:\n    print\\(f'  - {item.title} \\(stars={item.score}\\)'\\)\n    print\\(f'    raw: {item.raw_content[:120]}'\\)\n    print\\(\\)\n\" 2>&1)",
      "Bash(source venv/bin/activate && python -c \"\n# Check HN collector actual count\nfrom ai_usecases_explorer.collectors.hackernews import HackerNewsCollector\nfrom ai_usecases_explorer.settings import Settings\nfrom ai_usecases_explorer.storage.database import Database\nfrom ai_usecases_explorer.models.usecase import make_id\n\ns = Settings\\(\\)\nhn = HackerNewsCollector\\(min_points=s.hn_min_points\\)\nitems = hn.fetch\\(\\)\ndb = Database\\(db_path=s.db_path\\)\n\nnew = [item for item in items if not db.exists\\(make_id\\(item.source_url\\)\\)]\nprint\\(f'HN raw collected: {len\\(items\\)}'\\)\nprint\\(f'HN new \\(not in DB\\): {len\\(new\\)}'\\)\nprint\\('Sample new HN items:'\\)\nfor item in new[:5]:\n    print\\(f'  - {item.title[:80]} \\(pts={item.score}\\)'\\)\n\" 2>&1)",
      "Bash(source venv/bin/activate && python -c \"\n# Test ValueFilter on GitHub items\nfrom ai_usecases_explorer.collectors.github import GitHubCollector\nfrom ai_usecases_explorer.processors.filter import ValueFilter\nfrom ai_usecases_explorer.settings import Settings\nimport anthropic\n\ns = Settings\\(\\)\ncollector = GitHubCollector\\(min_stars=s.github_min_stars, token=s.github_token, lookback_days=2\\)\nitems = collector.fetch\\(\\)[:5]\n\nclient_kwargs = {'api_key': s.anthropic_api_key}\nif s.anthropic_base_url:\n    client_kwargs['base_url'] = s.anthropic_base_url\nclient = anthropic.Anthropic\\(**client_kwargs\\)\nvf = ValueFilter\\(client=client, model=s.claude_model\\)\n\nfor item in items[:3]:\n    print\\(f'=== {item.title} ==='\\)\n    print\\(f'raw: {item.raw_content[:200]}'\\)\n    result = vf.run\\(item\\)\n    print\\(f'Filter result: {result}'\\)\n    print\\(\\)\n\" 2>&1)",
      "Bash(source venv/bin/activate && python -c \"\n# Test: HN with date filter - how many items from last 24h?\nimport httpx, time\nfrom ai_usecases_explorer.collectors.hackernews import _KEYWORDS\n\ncreated_since = int\\(time.time\\(\\)\\) - 86400  # last 24h\nseen_ids = set\\(\\)\ntotal = 0\n\nfor keyword in _KEYWORDS:\n    params = {\n        'query': keyword,\n        'tags': '\\(story,ask_hn,show_hn\\)',\n        'numericFilters': f'points>=10,created_at_i>{created_since}',\n        'hitsPerPage': 50,\n    }\n    resp = httpx.get\\('https://hn.algolia.com/api/v1/search_by_date', params=params, timeout=15\\)\n    hits = resp.json\\(\\).get\\('hits', []\\)\n    new_hits = [h for h in hits if h.get\\('objectID'\\) not in seen_ids]\n    for h in new_hits:\n        seen_ids.add\\(h.get\\('objectID'\\)\\)\n    total += len\\(new_hits\\)\n    if new_hits:\n        print\\(f'  [{keyword}]: {len\\(new_hits\\)} new items'\\)\n\nprint\\(f'Total HN items \\(last 24h, 10+ pts\\): {total}'\\)\n\" 2>&1)",
      "Bash(source venv/bin/activate && python -c \"\n# Test Reddit with broader approach - various queries for our communities\nfrom ai_usecases_explorer.settings import Settings\nfrom exa_py import Exa\nfrom datetime import UTC, datetime, timedelta\n\ns = Settings\\(\\)\nexa = Exa\\(api_key=s.exa_api_key\\)\nstart_date = \\(datetime.now\\(tz=UTC\\) - timedelta\\(hours=48\\)\\).strftime\\('%Y-%m-%dT%H:%M:%SZ'\\)\n\n# Test multiple queries without subreddit-specific domain filter\nqueries = [\n    'AI tool workflow automation use case productivity agent',\n    'Claude Code vibe coding LLM productivity developer',\n    'AI singularity future technology automation impact',\n]\n\nseen = set\\(\\)\nfor q in queries:\n    resp = exa.search_and_contents\\(\n        q,\n        include_domains=['reddit.com'],\n        start_published_date=start_date,\n        text=True,\n        num_results=10,\n    \\)\n    print\\(f'Query [{q[:50]}...]: {len\\(resp.results\\)} results'\\)\n    for r in resp.results:\n        if r.url not in seen:\n            seen.add\\(r.url\\)\n            print\\(f'  - {r.url[:70]}'\\)\nprint\\(f'Total unique Reddit results: {len\\(seen\\)}'\\)\n\" 2>&1)",
      "Bash(source venv/bin/activate && python -c \"\n# Test with even wider time window for Exa\nfrom ai_usecases_explorer.settings import Settings\nfrom exa_py import Exa\nfrom datetime import UTC, datetime, timedelta\n\ns = Settings\\(\\)\nexa = Exa\\(api_key=s.exa_api_key\\)\n# Try 7 days instead of 24h\nstart_date = \\(datetime.now\\(tz=UTC\\) - timedelta\\(days=7\\)\\).strftime\\('%Y-%m-%dT%H:%M:%SZ'\\)\n\nresp = exa.search_and_contents\\(\n    'AI agent workflow automation tool use case productivity',\n    include_domains=['reddit.com'],\n    start_published_date=start_date,\n    text=True,\n    num_results=15,\n\\)\nprint\\(f'Reddit results \\(7 days\\): {len\\(resp.results\\)}'\\)\nfor r in resp.results:\n    print\\(f'  - {r.url[:80]}'\\)\n    print\\(f'    published: {getattr\\(r, \\\\\"published_date\\\\\", \\\\\"unknown\\\\\"\\)}'\\)\n\" 2>&1)",
      "Bash(source venv/bin/activate && python -c \"\n# Test WITHOUT date filter - Exa might not know Reddit published dates\nfrom ai_usecases_explorer.settings import Settings\nfrom exa_py import Exa\n\ns = Settings\\(\\)\nexa = Exa\\(api_key=s.exa_api_key\\)\n\nresp = exa.search_and_contents\\(\n    'AI agent workflow automation tool use case productivity',\n    include_domains=['reddit.com'],\n    text=True,\n    num_results=15,\n\\)\nprint\\(f'Reddit results \\(NO date filter\\): {len\\(resp.results\\)}'\\)\nfor r in resp.results:\n    print\\(f'  r/{r.url.split\\(\\\\\"/r/\\\\\"\\)[1].split\\(\\\\\"/\\\\\"\\)[0] if \\\\\"/r/\\\\\" in r.url else \\\\\"?\\\\\"}: {r.url[:70]}'\\)\n    print\\(f'    published: {getattr\\(r, \\\\\"published_date\\\\\", None\\)}, title: {\\(r.title or \\\\\"\\\\\"\\)[:60]}'\\)\n\" 2>&1)",
      "Bash(source venv/bin/activate && python -c \"\nfrom ai_usecases_explorer.storage.database import Database\nfrom ai_usecases_explorer.settings import Settings\n\ns = Settings\\(\\)\ndb = Database\\(db_path=s.db_path\\)\n# Get recent items to see what was stored on March 4\nitems = db.get_recent\\(days=2\\)\nprint\\(f'Items in DB from last 2 days: {len\\(items\\)}'\\)\nfor item in items[:10]:\n    print\\(f'  [{item.source_platform}] {item.title[:60]} \\(collected: {item.collected_at.date\\(\\)}\\)'\\)\n\" 2>&1)",
      "Bash(source venv/bin/activate && python -c \"\nfrom ai_usecases_explorer.storage.database import Database\nfrom ai_usecases_explorer.settings import Settings\n\ns = Settings\\(\\)\ndb = Database\\(db_path=s.db_path\\)\nitems = db.get_recent\\(limit=20\\)\nprint\\(f'Most recent DB items: {len\\(items\\)}'\\)\nfor item in items[:10]:\n    print\\(f'  [{item.source_platform}] {item.title[:60]} \\(collected: {item.collected_at.date\\(\\)}\\)'\\)\n\" 2>&1)",
      "Bash(source venv/bin/activate && python -m pytest tests/test_collectors.py -v)",
      "Bash(source venv/bin/activate && python -m pytest tests/ -v)",
      "Bash(source venv/bin/activate && python -c \"\nfrom ai_usecases_explorer.settings import Settings\nfrom ai_usecases_explorer.collectors.github import GitHubCollector\nfrom ai_usecases_explorer.processors.filter import ValueFilter\nimport anthropic\n\ns = Settings\\(\\)\n\ncollector = GitHubCollector\\(min_stars=s.github_min_stars, token=s.github_token\\)\nitems = collector.fetch\\(\\)[:5]\n\nclient_kwargs = {'api_key': s.anthropic_api_key}\nif s.anthropic_base_url:\n    client_kwargs['base_url'] = s.anthropic_base_url\nclient = anthropic.Anthropic\\(**client_kwargs\\)\nvf = ValueFilter\\(client=client, model=s.claude_model\\)\n\nprint\\('=== ValueFilter test on GitHub items ==='\\)\nfor item in items[:3]:\n    print\\(f'\\\\\\\\n[bold]{item.title}[/bold]'\\)\n    print\\(f'Source: {item.source_url}'\\)\n    result = vf.run\\(item\\)\n    print\\(f'is_real_value: {result[\\\\\"is_real_value\\\\\"]}'\\)\n    print\\(f'Reason: {result[\\\\\"reason\\\\\"]}'\\)\n\")",
      "Bash(source venv/bin/activate && python -c \"\nfrom ai_usecases_explorer.settings import Settings\nfrom ai_usecases_explorer.collectors.hackernews import HackerNewsCollector\nfrom ai_usecases_explorer.collectors.reddit import RedditCollector\nfrom ai_usecases_explorer.collectors.github import GitHubCollector\nfrom rich.console import Console\n\nconsole = Console\\(\\)\ns = Settings\\(\\)\n\nconsole.print\\('[cyan]Testing collector performance \\(without LLM calls\\)...[/cyan]'\\)\n\nhn = HackerNewsCollector\\(min_points=s.hn_min_points\\)\nhn_items = hn.fetch\\(\\)\nconsole.print\\(f'  HN: {len\\(hn_items\\)} items'\\)\nif hn_items:\n    console.print\\(f'  Sample: {hn_items[0].title[:60]}'\\)\n\nreddit = RedditCollector\\(subreddits=s.reddit_subreddits, api_key=s.exa_api_key\\)\nreddit_items = reddit.fetch\\(\\)\nconsole.print\\(f'  Reddit: {len\\(reddit_items\\)} items'\\)\nif reddit_items:\n    console.print\\(f'  Sample: {reddit_items[0].title[:60]}'\\)\n\ngithub = GitHubCollector\\(min_stars=s.github_min_stars, token=s.github_token\\)\ngithub_items = github.fetch\\(\\)\nconsole.print\\(f'  GitHub: {len\\(github_items\\)} items'\\)\nif github_items:\n    console.print\\(f'  Sample: {github_items[0].title[:60]}'\\)\n\nconsole.print\\('[green]All collectors operational![/green]'\\)\n\")",
      "Bash(source venv/bin/activate && ai-scout --dry-run)",
      "Bash(source venv/bin/activate && ai-scout)",
      "Bash(source venv/bin/activate && python -c \"\nimport httpx\nfrom ai_usecases_explorer.settings import Settings\n\ns = Settings\\(\\)\n\nprint\\('=== Testing current API Key against anyrouter.top ==='\\)\nprint\\(f'Base URL: {s.anthropic_base_url}'\\)\nprint\\(f'API Key: {s.anthropic_api_key}'\\)\nprint\\(\\)\n\nheaders = {\n    'x-api-key': s.anthropic_api_key,\n    'anthropic-version': '2023-06-01',\n    'content-type': 'application/json',\n}\npayload = {\n    'model': 'claude-haiku-4-5-20251001',\n    'max_tokens': 10,\n    'messages': [{'role': 'user', 'content': 'hi'}],\n}\n\ntry:\n    client = httpx.Client\\(base_url=s.anthropic_base_url, timeout=30\\)\n    r = client.post\\('/v1/messages', headers=headers, json=payload\\)\n    print\\(f'Status: {r.status_code}'\\)\n    print\\(r.text\\)\nexcept Exception as e:\n    print\\(f'ERROR: {e}'\\)\n\")",
      "Bash(echo $ANTHROPIC_BASE_URL)"
    ]
  }
}
