from pathlib import Path import unittest ROOT = Path(__file__).resolve().parent.parent GENOME_PATH = ROOT / "compounding-intelligence-GENOME.md" class TestCompoundingIntelligenceGenome(unittest.TestCase): def test_genome_file_exists_with_required_sections(self): self.assertTrue(GENOME_PATH.exists(), "missing compounding-intelligence-GENOME.md") text = GENOME_PATH.read_text(encoding="utf-8") required_sections = [ "# GENOME.md — compounding-intelligence", "## Project Overview", "## Architecture", "## Entry Points", "## Data Flow", "## Key Abstractions", "## API Surface", "## Test Coverage Gaps", "## Security Considerations", "## Dependencies", "## Deployment", "## Technical Debt", ] for section in required_sections: self.assertIn(section, text) def test_genome_names_current_repo_specific_findings(self): text = GENOME_PATH.read_text(encoding="utf-8") required_snippets = [ "```mermaid", "scripts/harvester.py", "scripts/bootstrapper.py", "scripts/priority_rebalancer.py", "scripts/perf_bottleneck_finder.py", "scripts/dependency_graph.py", "scripts/refactoring_opportunity_finder.py", "knowledge/SCHEMA.md", "templates/harvest-prompt.md", ".gitea/workflows/test.yml", "70 passed", "86 tests collected, 2 errors", "33 Python files", "8,394", "compounding-intelligence/issues/210", "compounding-intelligence/issues/211", "compounding-intelligence/issues/212", ] for snippet in required_snippets: self.assertIn(snippet, text) def test_genome_is_substantial(self): text = GENOME_PATH.read_text(encoding="utf-8") self.assertGreaterEqual(len(text.splitlines()), 140) self.assertGreaterEqual(len(text), 9000) if __name__ == "__main__": unittest.main()