Skip to content

moonlight-lupin/agent-skills / research/deep-research

deep-research

Verified

Use when the user asks for "deep research", a "research report on", a "comprehensive analysis of", to "look into X in depth", to "write a report on X", or any question needing multi-source synthesis beyond a single search — an autonomous multi-step deep research engine implementing an iterative Think → Search → Extract → Synthesize → Stop loop. The LLM drives every decision: what to search, what's relevant, what's missing, and when to stop. Produces a cited, magazine-quality report with inline citations, category-specific formatting, and research stats. For entity vetting/dossiers use entity-research; for news digests use news-monitoring; for source-grounded Q&A use notebooklm-mode.

tests/test_research_validation.py

View on GitHub
#!/usr/bin/env python3
"""Unit tests for research_validation.py — gates, evidence store, support scoring.

Run:  python -m pytest research/deep-research/tests/test_research_validation.py -q

No network required. Stdlib-only module under test.
"""

import sys
from pathlib import Path

SCRIPTS_DIR = Path(__file__).resolve().parent.parent / "scripts"
sys.path.insert(0, str(SCRIPTS_DIR))

import research_validation as rv  # noqa: E402


class TestSupportScoring:
    def test_identical_text_supported(self):
        assert rv.support_score("Acme revenue grew 40 percent in 2024",
                                 ["Acme revenue grew 40 percent in 2024"]) >= rv.SUPPORTED_THRESHOLD

    def test_comma_normalization(self):
        assert rv.support_score("Sales were 1,200 units", ["Sales were 1200 units"]) >= rv.SUPPORTED_THRESHOLD

    def test_contradicting_figure_capped(self):
        assert rv.support_score("Revenue was 40 billion USD",
                                ["Revenue was 45 billion USD"]) < rv.SUPPORTED_THRESHOLD

    def test_contradicting_year_capped(self):
        assert rv.support_score("Acme opened 2000 stores in 2024",
                                ["Acme opened 1950 stores in 2024"]) < rv.SUPPORTED_THRESHOLD

    def test_embedded_yearlike_model_numbers_contradict(self):
        # 'v2000' vs 'v2001' — digit runs inside tokens are figures, not years,
        # and the year-boundary check is occurrence-level, not whole-text.
        assert rv.support_score("Acme v2000 sales grew steadily worldwide in 2024",
                                ["Acme v2001 sales grew steadily worldwide in 2024"]) < rv.SUPPORTED_THRESHOLD
        assert rv.support_score("Acme v2000 sales grew steadily worldwide in 2024",
                                ["Acme v2000 sales grew steadily worldwide in 2024"]) >= rv.SUPPORTED_THRESHOLD
        # A bare ' in 2000' in the same text must not excuse the embedded '2000'
        # inside 'v2000' (review round 4).
        assert rv.support_score("Acme v2000 sales grew steadily worldwide in 2000",
                                ["Acme v2001 sales grew steadily worldwide in 2000"]) < rv.SUPPORTED_THRESHOLD

    def test_product_name_digits_are_figures(self):
        assert rv.support_score("Apple iPhone15 sales grew steadily worldwide",
                                ["Apple iPhone16 sales grew steadily worldwide"]) < rv.SUPPORTED_THRESHOLD

    def test_bare_year_is_year_not_figure(self):
        assert rv._figures("Acme opened 2000 stores in 2024") == set()
        assert rv._figures("2,000 units") == set()
        assert rv._figures("Report (2000) says") == set()
        assert rv._figures("Acme v2000 sales grew steadily worldwide in 2000") == {"2000"}
deprecation-and-migrationaddyosmani/agent-skillsManages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset existing code.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
performance-optimizationaddyosmani/agent-skillsOptimizes application performance across frontend, backend, queries, and databases. Use when performance requirements exist, when you suspect performance regressions, when Core Web Vitals or load times need improvement, when N+1 query patterns need fixing, or when profiling reveals bottlenecks.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json.Stars: 118kUpdated Claude CodeCodexVerifiedInstall
agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json.Stars: 118kUpdated Claude CodeCodexVerifiedInstall