docs(tests): create tests/README.md with full suite inventory, coverage matrix, and execution guide

This commit is contained in:
2026-08-21 11:23:36 -03:00
parent 040edb61db
commit e1e0be1353
13 changed files with 1688 additions and 1433 deletions
+60 -40
View File
@@ -1,16 +1,16 @@
# Graph Report - TextNLPClassifierApp (2026-08-21)
## Corpus Check
- 203 files · ~114,931 words
- 204 files · ~115,644 words
- Verdict: corpus is large enough that graph structure adds value.
## Summary
- 1651 nodes · 2220 edges · 170 communities (122 shown, 48 thin omitted)
- 1658 nodes · 2226 edges · 174 communities (126 shown, 48 thin omitted)
- Extraction: 94% EXTRACTED · 6% INFERRED · 0% AMBIGUOUS · INFERRED: 127 edges (avg confidence: 0.95)
- Token cost: 0 input · 0 output
## Graph Freshness
- Built from commit: `2cdd3547`
- Built from commit: `040edb61`
- Run `git rev-parse HEAD` and compare to check if the graph is stale.
- Run `graphify update .` after code changes (no API cost).
@@ -58,7 +58,7 @@
- 2. Standard Streams & Exit Codes
- ClassificationResult
- test_adversarial.py
- LLMFallbackAdapter
- InherenceClassifier
- test_convert_article_to_markdown.py
- content_northvolt_de.md
- content_presal_pt.md
@@ -110,8 +110,8 @@
- 🧠 TextNLPClassifierApp
- Extraction Pipeline Checklist: Article Content Multi-Engine Extractor
- parametrize
- Path
- main
- classifier.py
- Feature Specification: Multilingual NLP Entity Inherence Classifier (POC)
- 4. Requisitos Funcionais (FR)
- Tasks: Article Content Multi-Engine Extractor
@@ -130,7 +130,7 @@
- Tasks: Deterministic Article Content Selection
- select_article_extractor
- process_batch
- test_models.py
- detect_language
- test_select_article_extractor.py
- Feature Specification: Deterministic Content Selection
- 2. Entity Descriptions & Fields
@@ -173,11 +173,15 @@
- test_normalize_date_iso_8601_variants
- test_metadata_priority_original_url_all_fallbacks
- test_normalize_scalar_non_string_types
- InherenceClassifier
- test_e2e_text_analysis_pipeline.py
- remove_duplicate_initial_h1
- test_normalize_scalar_whitespace_collapsing
- .disambiguate
- LLMFallbackAdapter
- test_funnel_cli_subprocess_end_to_end
- test_models.py
- extract_evidence_snippets
- .classify
- 🧪 Documentação da Suíte de Testes Automatizados
## God Nodes (most connected - your core abstractions)
1. `ECPSnapshot` - 78 edges
@@ -194,19 +198,19 @@
## Surprising Connections (you probably didn't know these)
- `main()` --uses--> `ECPSnapshot` [INFERRED]
classify.py → src/models.py
- `main()` --uses--> `ErrorCode` [INFERRED]
classify.py → src/models.py
- `test_extract_google_news_orchestration_mocked()` --uses--> `ExtractionResult` [INFERRED]
tests/test_extract_google_news.py → scripts/extract_google_news.py
- `test_llm_adapter_interface()` --calls--> `LLMFallbackAdapter` [EXTRACTED]
tests/test_adapters.py → src/adapters/llm.py
- `test_embeddings_adapter_interface()` --calls--> `LocalEmbeddingsAdapter` [EXTRACTED]
tests/test_adapters.py → src/adapters/embeddings.py
- `classifier()` --uses--> `InherenceClassifier` [INFERRED]
tests/test_benchmark_24.py → src/classifier.py
- `test_funnel_multilingual_language_detection()` --uses--> `InherenceClassifier` [INFERRED]
tests/test_e2e_text_analysis_pipeline.py → src/classifier.py
## Import Cycles
- None detected.
## Communities (170 total, 48 thin omitted)
## Communities (174 total, 48 thin omitted)
### Community 0 - "Task Planning"
Cohesion: 0.07
@@ -349,16 +353,16 @@ Cohesion: 0.29
Nodes (6): 1.1 Arguments & Options, 1. Command Line Interface, 2.1 Exit Codes, 2.2 Standard Output (`stdout`) / Standard Error (`stderr`), 2. Standard Streams & Exit Codes, CLI Contract & Interface Specification (POC)
### Community 45 - "ClassificationResult"
Cohesion: 0.10
Nodes (19): ABC, BaseNLPAdapter, Base abstract adapter interface for optional Tier 2 / Tier 3 NLP enhancers., Abstract interface for pluggable NLP classification adapters., Return True if the underlying provider or model is installed and configured., Compute semantic similarity score between text and a set of candidate terms., Optionally refine an ambiguous classification result., LocalEmbeddingsAdapter (+11 more)
Cohesion: 0.09
Nodes (22): ABC, BaseNLPAdapter, Base abstract adapter interface for optional Tier 2 / Tier 3 NLP enhancers., Abstract interface for pluggable NLP classification adapters., Return True if the underlying provider or model is installed and configured., Compute semantic similarity score between text and a set of candidate terms., Optionally refine an ambiguous classification result., LocalEmbeddingsAdapter (+14 more)
### Community 46 - "test_adversarial.py"
Cohesion: 0.10
Nodes (21): RelatedEntity, Adversarial and robustness test suite for Multilingual NLP Entity Inherence…, Run CLI via subprocess without --output and verify stdout is pure parseable…, Run CLI via subprocess with empty content and verify error code and exit code., Content about city/state governance of São Paulo against ECP for São Paulo FC., Run CLI via subprocess with missing target_name and verify error payload., Run CLI via subprocess with corrupted JSON and verify error payload., High-weight related entity mentioned in passing without required domain anchors. (+13 more)
Cohesion: 0.12
Nodes (16): RelatedEntity, Adversarial and robustness test suite for Multilingual NLP Entity Inherence…, Run CLI via subprocess without --output and verify stdout is pure parseable…, Run CLI via subprocess with empty content and verify error code and exit code., Run CLI via subprocess with missing target_name and verify error payload., Run CLI via subprocess with corrupted JSON and verify error payload., Content about apple fruit/culinary recipe against Apple Inc. tech entity., High-weight related entity mentioned in passing without required domain anchors. (+8 more)
### Community 47 - "LLMFallbackAdapter"
### Community 47 - "InherenceClassifier"
Cohesion: 0.06
Nodes (43): LLMFallbackAdapter, Optional adapter for LLM fallback boundary disambiguation., Any, parametrize, Suíte de Testes Exaustiva para o Classificador de Inerência (classify.py e…, Cenário 4.1: Caso ambíguo elevado para DIRECT_INHERENT pelo LLM., Cenário 4.2: Caso ambíguo elevado para CONTEXTUAL_INHERENT pelo LLM., Cenário 4.3: LLM confirma categoricamente que a menção é periférica /… (+35 more)
Nodes (63): InherenceClassifier, Tier 1 Deterministic NLP Entity Inherence Classifier with optional Tier 2 /…, DecisionCategory, Content about city/state governance of São Paulo against ECP for São Paulo FC., test_adversarial_sao_paulo_city_vs_fc(), Unit tests for deterministic classification decision logic., test_contextual_inherent(), test_direct_inherent() (+55 more)
### Community 48 - "test_convert_article_to_markdown.py"
Cohesion: 0.08
@@ -436,13 +440,13 @@ Nodes (34): 1. Requirement Completeness, 2. Requirement Clarity & Non-Ambiguity,
Cohesion: 0.22
Nodes (9): parametrize, Garante aceitação de URLs absolutas com esquema HTTP e HTTPS válidos., Garante rejeição de esquemas não permitidos, URLs relativas e strings vazias., Garante que a ausência de corpo no extrator selecionado NUNCA faça fallback…, Garante que todos os placeholders documentados no PRD sejam descartados…, test_normalize_scalar_placeholders_discarded(), test_resolve_article_body_strict_isolation_all_extractors(), test_validate_url_invalid_schemes() (+1 more)
### Community 100 - "main"
Cohesion: 0.14
Nodes (20): main(), Path, Cenário 6.1: Caminho de ECP inexistente -> Exit Code 1, error_code:…, Cenário 6.2: Arquivo ECP com sintaxe JSON corrompida., Cenário 6.3: Valida erro para falta de cada um dos campos obrigatórios do ECP., Cenário 6.4: Caminho de arquivo Markdown inexistente., Cenário 6.5: Arquivo Markdown vazio ou contendo apenas espaços em branco., Cenário 6.6: A flag -o / --output cria diretórios aninhados automaticamente. (+12 more)
### Community 100 - "Path"
Cohesion: 0.15
Nodes (13): Path, Cenário 6.1: Caminho de ECP inexistente -> Exit Code 1, error_code:…, Cenário 6.2: Arquivo ECP com sintaxe JSON corrompida., Cenário 6.3: Valida erro para falta de cada um dos campos obrigatórios do ECP., Cenário 6.4: Caminho de arquivo Markdown inexistente., Cenário 6.5: Arquivo Markdown vazio ou contendo apenas espaços em branco., Cenário 6.6: A flag -o / --output cria diretórios aninhados automaticamente., test_cli_error_content_file_does_not_exist() (+5 more)
### Community 101 - "classifier.py"
Cohesion: 0.17
Nodes (12): emit_error(), parse_args(), Namespace, Core deterministic classification engine (Tier 1 core)., ErrorCode, MatchedGraphEntity, Enum, str (+4 more)
### Community 101 - "main"
Cohesion: 0.25
Nodes (12): emit_error(), main(), parse_args(), Namespace, ErrorCode, str, CLI execution tests covering flags, arguments, stdout, and error handling., test_cli_empty_content_file() (+4 more)
### Community 102 - "Feature Specification: Multilingual NLP Entity Inherence Classifier (POC)"
Cohesion: 0.14
@@ -516,9 +520,9 @@ Nodes (35): CandidateStatus, extract_candidate_data(), ExtractorName, Any, Enum,
Cohesion: 0.11
Nodes (24): atomic_save_json(), process_batch(), Path, Salva dados em JSON de forma atômica utilizando arquivo temporário e rename., Lê o JSON de entrada, valida a estrutura, processa todos os artigos e grava o…, Path, CT-012: A entrada já contém selected_extractor -> Recalcular e substituir…, CT-013: articles está vazio -> Gerar saída válida com articles vazio. (+16 more)
### Community 121 - "test_models.py"
Cohesion: 0.07
Nodes (37): count_phrase_occurrences(), match_phrase_in_text(), Check if a normalized phrase appears in normalized text with word boundary…, Count occurrences of a phrase in text., Classify inherence of content against an ECP snapshot., detect_language(), extract_words(), normalize_text() (+29 more)
### Community 121 - "detect_language"
Cohesion: 0.22
Nodes (13): detect_language(), extract_words(), Lightweight multilingual language detection and text normalization., Tokenize text into lowercase alphanumeric words., Detect the ISO-639-1 language code of text among supported languages (pt, en,…, Unit tests for language detection and text normalization., test_detect_english(), test_detect_french() (+5 more)
### Community 122 - "test_select_article_extractor.py"
Cohesion: 0.18
@@ -637,8 +641,8 @@ Cohesion: 0.50
Nodes (4): 6.1 Formato, 6.2 Valores aceitos para `selected_extractor`, 6.3 Campos obrigatórios após a resolução, 6. Contrato de entrada
### Community 152 - "ECPSnapshot"
Cohesion: 0.13
Nodes (20): ECPSnapshot, parametrize, test_benchmark_case(), Suíte de Testes para o Adaptador de Fallback para LLM (Tier 3) do Classificador…, Valida extração de JSON quando a resposta do LLM vem formatada em bloco…, Valida que respostas corrompidas ou JSONs sem campos obrigatórios retornem None…, Garante que o classificador dispare o Tier 3 LLM para casos ambíguos…, Garante que casos claros (alta confiança e alta densidade de âncoras) NÃO… (+12 more)
Cohesion: 0.12
Nodes (21): ECPSnapshot, test_classifier_with_adapter_flags(), ecp_tech_corp(), fixture, Suíte de Testes para o Adaptador de Fallback para LLM (Tier 3) do Classificador…, Valida extração de JSON quando a resposta do LLM vem formatada em bloco…, Valida que respostas corrompidas ou JSONs sem campos obrigatórios retornem None…, Garante que o classificador dispare o Tier 3 LLM para casos ambíguos… (+13 more)
### Community 153 - "convert_html_to_markdown"
Cohesion: 0.33
@@ -652,35 +656,51 @@ Nodes (3): 1. Input JSON Schema, 2. Output JSON Schema, JSON Schema Contract: De
Cohesion: 0.67
Nodes (3): 5.1 Incluído, 5.2 Fora do escopo, 5. Escopo
### Community 165 - "InherenceClassifier"
Cohesion: 0.07
Nodes (45): InherenceClassifier, Tier 1 Deterministic NLP Entity Inherence Classifier with optional Tier 2 /…, DecisionCategory, Content about apple fruit/culinary recipe against Apple Inc. tech entity., test_adversarial_apple_fruit_recipe(), Unit tests for deterministic classification decision logic., test_contextual_inherent(), test_direct_inherent() (+37 more)
### Community 165 - "test_e2e_text_analysis_pipeline.py"
Cohesion: 0.10
Nodes (19): ecp_river_plate(), fixture, parametrize, Suíte de Testes E2E e de Integração Completa para Análise de Texto e…, Cenário 1: Artigo com alta densidade de âncoras do River Plate. Oráculo:…, Cenário 2: Artigo sobre a Bacia do Rio da Prata ou clube homônimo do Uruguai.…, Cenário 3: Menção isolada do clube ('River') em contexto com poucas âncoras…, Cenário 4: Menção metafórica ou turística a um local próximo. Tier 1… (+11 more)
### Community 166 - "remove_duplicate_initial_h1"
Cohesion: 0.50
Nodes (4): Remove o primeiro título H1 do corpo somente quando ele for igual ao título…, remove_duplicate_initial_h1(), Testa remoção de H1 inicial coincidente com título com variações de espaços e…, test_remove_duplicate_initial_h1_exact_and_variations()
### Community 168 - ".disambiguate"
Cohesion: 0.25
Nodes (4): Executes LLM fallback for ambiguous boundary cases. Returns a refined…, Parses and validates structured JSON response from LLM., Returns True if an API key or custom provider function is configured., Constructs an expert-engineered prompt for multilingual entity inherence…
### Community 168 - "LLMFallbackAdapter"
Cohesion: 0.10
Nodes (16): LLMFallbackAdapter, Executes LLM fallback for ambiguous boundary cases. Returns a refined…, Parses and validates structured JSON response from LLM., Optional adapter for LLM fallback boundary disambiguation., Returns True if an API key or custom provider function is configured., Constructs an expert-engineered prompt for multilingual entity inherence…, Any, Unit tests for optional adapter interfaces (Tier 2 / Tier 3). (+8 more)
### Community 169 - "test_funnel_cli_subprocess_end_to_end"
Cohesion: 0.67
Nodes (3): Path, Valida o contrato CLI completo classify.py com saída em arquivo JSON e flags…, test_funnel_cli_subprocess_end_to_end()
### Community 170 - "test_models.py"
Cohesion: 0.16
Nodes (9): ClassificationError, Any, parametrize, test_benchmark_case(), Unit tests for ECP models, schema validation, and structured error handling., test_classification_error_serialization(), test_ecp_snapshot_defaults(), test_ecp_snapshot_missing_required() (+1 more)
### Community 171 - "extract_evidence_snippets"
Cohesion: 0.24
Nodes (9): extract_evidence_snippets(), extract_sentences(), Markdown content parser and excerpt extraction utilities., Split text into individual sentences., Extract relevant sentence excerpts from Markdown text that contain any of the…, Remove markdown syntax markers (headers, bold, italics, links, code blocks) to…, strip_markdown(), test_extract_evidence_snippets() (+1 more)
### Community 172 - ".classify"
Cohesion: 0.28
Nodes (8): count_phrase_occurrences(), match_phrase_in_text(), Check if a normalized phrase appears in normalized text with word boundary…, Count occurrences of a phrase in text., Classify inherence of content against an ECP snapshot., normalize_text(), Normalize text by converting to lowercase and stripping combining diacritical…, test_normalize_text()
### Community 173 - "🧪 Documentação da Suíte de Testes Automatizados"
Cohesion: 0.29
Nodes (6): 1. Executar Toda a Suíte do Projeto (247 testes), 2. Executar por Módulo Específico, 🚀 Como Executar os Testes, 🔑 Configuração para Testes com LLM ao Vivo, 🧪 Documentação da Suíte de Testes Automatizados, 📊 Inventário e Mapa de Cobertura das Suítes
## Knowledge Gaps
- **696 isolated node(s):** `text-nlp-classifier`, `MatchedGraphEntity`, `graphify`, `Usage`, `What graphify is for` (+691 more)
- **700 isolated node(s):** `text-nlp-classifier`, `MatchedGraphEntity`, `graphify`, `Usage`, `What graphify is for` (+695 more)
These have ≤1 connection - possible missing edges or undocumented components.
- **48 thin communities (<3 nodes) omitted from report** — run `graphify query` to explore isolated nodes.
## Suggested Questions
_Questions this graph is uniquely positioned to answer:_
- **Why does `ECPSnapshot` connect `ECPSnapshot` to `main`, `classifier.py`, `InherenceClassifier`, `.disambiguate`, `ClassificationResult`, `test_adversarial.py`, `LLMFallbackAdapter`, `test_models.py`?**
_High betweenness centrality (0.009) - this node is a cross-community bridge._
- **Why does `ECPSnapshot` connect `ECPSnapshot` to `main`, `test_e2e_text_analysis_pipeline.py`, `LLMFallbackAdapter`, `test_models.py`, `.classify`, `ClassificationResult`, `test_adversarial.py`, `InherenceClassifier`?**
_High betweenness centrality (0.008) - this node is a cross-community bridge._
- **Why does `PRD — Conversão de artigo JSON para Markdown` connect `PRD — Conversão de artigo JSON para Markdown` to `8. Regras funcionais`, `12. Critérios de aceite`, `11. Requisitos não funcionais`, `9. Interface CLI`, `13. Estratégia de testes`, `6. Contrato de entrada`, `5. Escopo`?**
_High betweenness centrality (0.004) - this node is a cross-community bridge._
- **Why does `InherenceClassifier` connect `InherenceClassifier` to `main`, `classifier.py`, `ClassificationResult`, `test_adversarial.py`, `LLMFallbackAdapter`, `ECPSnapshot`, `test_models.py`?**
- **Why does `InherenceClassifier` connect `InherenceClassifier` to `main`, `test_e2e_text_analysis_pipeline.py`, `LLMFallbackAdapter`, `.classify`, `ClassificationResult`, `test_adversarial.py`, `ECPSnapshot`?**
_High betweenness centrality (0.004) - this node is a cross-community bridge._
- **Are the 42 inferred relationships involving `ECPSnapshot` (e.g. with `main()` and `BaseNLPAdapter`) actually correct?**
_`ECPSnapshot` has 42 INFERRED edges - model-reasoned connections that need verification._