feat(converter): implement deterministic JSON to Markdown article converter (spec 005)
This commit is contained in:
@@ -47,7 +47,7 @@
|
||||
"45": "ClassificationResult",
|
||||
"46": "InherenceClassifier",
|
||||
"47": "classifier.py",
|
||||
"48": "main",
|
||||
"48": "test_convert_article_to_markdown.py",
|
||||
"49": "content_northvolt_de.md",
|
||||
"50": "content_presal_pt.md",
|
||||
"51": "content_tangential_es.md",
|
||||
@@ -104,7 +104,7 @@
|
||||
"102": "Feature Specification: Multilingual NLP Entity Inherence Classifier (POC)",
|
||||
"103": "4. Requisitos Funcionais (FR)",
|
||||
"104": "Tasks: Article Content Multi-Engine Extractor",
|
||||
"105": "LocalEmbeddingsAdapter",
|
||||
"105": "Tasks: Convert Article JSON to Markdown",
|
||||
"106": "Implementation Plan: Article Content Multi-Engine Extractor",
|
||||
"107": "2. Cenários de Validação",
|
||||
"108": "1. Technical Decisions & Tradeoffs",
|
||||
@@ -116,10 +116,11 @@
|
||||
"114": "JSON Schema Contract: Article Content Multi-Engine Extractor",
|
||||
"115": "PRD — Seleção determinística da biblioteca de extração de conteúdo",
|
||||
"116": "select_article_extractor.py",
|
||||
"117": "1. Text Normalization Pipeline",
|
||||
"117": "Research & Architectural Decisions: Deterministic Content Selection",
|
||||
"118": "Tasks: Deterministic Article Content Selection",
|
||||
"119": "select_article_extractor",
|
||||
"120": "process_batch",
|
||||
"121": "detect_language",
|
||||
"122": "test_select_article_extractor.py",
|
||||
"123": "Feature Specification: Deterministic Content Selection",
|
||||
"124": "2. Entity Descriptions & Fields",
|
||||
@@ -129,5 +130,34 @@
|
||||
"128": "Specification Quality Checklist: Deterministic Content Selection",
|
||||
"129": "CLI Interface Contract: Deterministic Article Content Selection",
|
||||
"130": "004-deterministic-content-selection/spec.md",
|
||||
"131": "JSON Schema Contract: Deterministic Article Content Selection"
|
||||
"131": "convert_article_to_markdown.py",
|
||||
"132": "8. Regras funcionais",
|
||||
"133": "12. Critérios de aceite",
|
||||
"134": "PRD — Conversão de artigo JSON para Markdown",
|
||||
"135": "resolve_article_body",
|
||||
"136": "Implementation Plan: Convert Article JSON to Markdown",
|
||||
"137": "2. Technical Decisions & Research Findings",
|
||||
"138": "Feature Specification: Convert Article JSON to Markdown",
|
||||
"139": "Markdown Conversion Checklist: End-to-End Requirements Quality",
|
||||
"140": "convert_article",
|
||||
"141": "005-convert-json-markdown/plan.md",
|
||||
"142": "Quickstart: Convert Article JSON to Markdown",
|
||||
"143": "1. Domain Entities & Schemas",
|
||||
"144": "11. Requisitos não funcionais",
|
||||
"145": "parse_arguments",
|
||||
"146": "Specification Quality Checklist: Convert Article JSON to Markdown",
|
||||
"147": "CLI Contract: `convert_article_to_markdown.py`",
|
||||
"148": "9. Interface CLI",
|
||||
"149": "1. Text Normalization Pipeline",
|
||||
"150": "13. Estratégia de testes",
|
||||
"151": "6. Contrato de entrada",
|
||||
"152": "assemble_markdown_document",
|
||||
"153": "convert_html_to_markdown",
|
||||
"154": "remove_duplicate_initial_h1",
|
||||
"155": "5. Escopo",
|
||||
"156": "Los puntajes de River vs. Independiente Santa Fe, por la Copa Sudamericana - TyC Sports",
|
||||
"157": "valid_newspaper4k.md",
|
||||
"158": "valid_readability.md",
|
||||
"159": "test_normalize_list_strings_and_deduplication",
|
||||
"160": "test_validate_url_schemes"
|
||||
}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
# Graph Report - TextNLPClassifierApp (2026-08-20)
|
||||
# Graph Report - TextNLPClassifierApp (2026-08-21)
|
||||
|
||||
## Corpus Check
|
||||
- 174 files · ~91,961 words
|
||||
- 199 files · ~107,634 words
|
||||
- Verdict: corpus is large enough that graph structure adds value.
|
||||
|
||||
## Summary
|
||||
- 1235 nodes · 1548 edges · 131 communities (93 shown, 38 thin omitted)
|
||||
- 1504 nodes · 1860 edges · 161 communities (118 shown, 43 thin omitted)
|
||||
- Extraction: 97% EXTRACTED · 3% INFERRED · 0% AMBIGUOUS · INFERRED: 51 edges (avg confidence: 0.95)
|
||||
- Token cost: 0 input · 0 output
|
||||
|
||||
## Graph Freshness
|
||||
- Built from commit: `6a45368c`
|
||||
- Built from commit: `64dfd842`
|
||||
- Run `git rev-parse HEAD` and compare to check if the graph is stale.
|
||||
- Run `graphify update .` after code changes (no API cost).
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
- ClassificationResult
|
||||
- InherenceClassifier
|
||||
- classifier.py
|
||||
- main
|
||||
- test_convert_article_to_markdown.py
|
||||
- content_northvolt_de.md
|
||||
- content_presal_pt.md
|
||||
- content_tangential_es.md
|
||||
@@ -115,7 +115,7 @@
|
||||
- Feature Specification: Multilingual NLP Entity Inherence Classifier (POC)
|
||||
- 4. Requisitos Funcionais (FR)
|
||||
- Tasks: Article Content Multi-Engine Extractor
|
||||
- LocalEmbeddingsAdapter
|
||||
- Tasks: Convert Article JSON to Markdown
|
||||
- Implementation Plan: Article Content Multi-Engine Extractor
|
||||
- 2. Cenários de Validação
|
||||
- 1. Technical Decisions & Tradeoffs
|
||||
@@ -126,10 +126,11 @@
|
||||
- JSON Schema Contract: Article Content Multi-Engine Extractor
|
||||
- PRD — Seleção determinística da biblioteca de extração de conteúdo
|
||||
- select_article_extractor.py
|
||||
- 1. Text Normalization Pipeline
|
||||
- Research & Architectural Decisions: Deterministic Content Selection
|
||||
- Tasks: Deterministic Article Content Selection
|
||||
- select_article_extractor
|
||||
- process_batch
|
||||
- detect_language
|
||||
- test_select_article_extractor.py
|
||||
- Feature Specification: Deterministic Content Selection
|
||||
- 2. Entity Descriptions & Fields
|
||||
@@ -138,7 +139,37 @@
|
||||
- Quickstart: Deterministic Article Content Selection
|
||||
- Specification Quality Checklist: Deterministic Content Selection
|
||||
- CLI Interface Contract: Deterministic Article Content Selection
|
||||
- JSON Schema Contract: Deterministic Article Content Selection
|
||||
- 004-deterministic-content-selection/spec.md
|
||||
- convert_article_to_markdown.py
|
||||
- 8. Regras funcionais
|
||||
- 12. Critérios de aceite
|
||||
- PRD — Conversão de artigo JSON para Markdown
|
||||
- resolve_article_body
|
||||
- Implementation Plan: Convert Article JSON to Markdown
|
||||
- 2. Technical Decisions & Research Findings
|
||||
- Feature Specification: Convert Article JSON to Markdown
|
||||
- Markdown Conversion Checklist: End-to-End Requirements Quality
|
||||
- convert_article
|
||||
- 005-convert-json-markdown/plan.md
|
||||
- Quickstart: Convert Article JSON to Markdown
|
||||
- 1. Domain Entities & Schemas
|
||||
- 11. Requisitos não funcionais
|
||||
- parse_arguments
|
||||
- Specification Quality Checklist: Convert Article JSON to Markdown
|
||||
- CLI Contract: `convert_article_to_markdown.py`
|
||||
- 9. Interface CLI
|
||||
- 1. Text Normalization Pipeline
|
||||
- 13. Estratégia de testes
|
||||
- 6. Contrato de entrada
|
||||
- assemble_markdown_document
|
||||
- convert_html_to_markdown
|
||||
- remove_duplicate_initial_h1
|
||||
- 5. Escopo
|
||||
- Los puntajes de River vs. Independiente Santa Fe, por la Copa Sudamericana - TyC Sports
|
||||
- valid_newspaper4k.md
|
||||
- valid_readability.md
|
||||
- test_normalize_list_strings_and_deduplication
|
||||
- test_validate_url_schemes
|
||||
|
||||
## God Nodes (most connected - your core abstractions)
|
||||
1. `ECPSnapshot` - 31 edges
|
||||
@@ -147,27 +178,27 @@
|
||||
4. `ExtractorName` - 21 edges
|
||||
5. `DecisionCategory` - 17 edges
|
||||
6. `ClassificationResult` - 17 edges
|
||||
7. `process_batch()` - 15 edges
|
||||
8. `process_batch()` - 14 edges
|
||||
9. `LocalEmbeddingsAdapter` - 14 edges
|
||||
10. `LLMFallbackAdapter` - 14 edges
|
||||
7. `PRD — Conversão de artigo JSON para Markdown` - 16 edges
|
||||
8. `process_batch()` - 15 edges
|
||||
9. `8. Regras funcionais` - 15 edges
|
||||
10. `process_batch()` - 14 edges
|
||||
|
||||
## 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
|
||||
- `classifier()` --uses--> `InherenceClassifier` [INFERRED]
|
||||
tests/test_benchmark_24.py → src/classifier.py
|
||||
- `test_classification_result_serialization()` --uses--> `DecisionCategory` [INFERRED]
|
||||
tests/test_models.py → src/models.py
|
||||
- `petrobras_ecp()` --uses--> `ECPSnapshot` [INFERRED]
|
||||
tests/test_classifier.py → src/models.py
|
||||
|
||||
## Import Cycles
|
||||
- None detected.
|
||||
|
||||
## Communities (131 total, 38 thin omitted)
|
||||
## Communities (161 total, 43 thin omitted)
|
||||
|
||||
### Community 0 - "Task Planning"
|
||||
Cohesion: 0.07
|
||||
@@ -310,20 +341,20 @@ 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.14
|
||||
Nodes (12): 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., LLMFallbackAdapter (+4 more)
|
||||
Cohesion: 0.09
|
||||
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)
|
||||
|
||||
### Community 46 - "InherenceClassifier"
|
||||
Cohesion: 0.12
|
||||
Nodes (27): InherenceClassifier, Tier 1 Deterministic NLP Entity Inherence Classifier., DecisionCategory, 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. (+19 more)
|
||||
|
||||
### Community 47 - "classifier.py"
|
||||
Cohesion: 0.10
|
||||
Nodes (31): count_phrase_occurrences(), match_phrase_in_text(), Core deterministic classification engine (Tier 1 core)., 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() (+23 more)
|
||||
Cohesion: 0.16
|
||||
Nodes (16): count_phrase_occurrences(), match_phrase_in_text(), Core deterministic classification engine (Tier 1 core)., 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., extract_evidence_snippets(), extract_sentences() (+8 more)
|
||||
|
||||
### Community 48 - "main"
|
||||
Cohesion: 0.31
|
||||
Nodes (9): main(), parse_args(), Namespace, CLI execution tests covering flags, arguments, stdout, and error handling., test_cli_empty_content_file(), test_cli_missing_ecp_file(), test_cli_missing_required_ecp_field(), test_cli_output_file() (+1 more)
|
||||
### Community 48 - "test_convert_article_to_markdown.py"
|
||||
Cohesion: 0.08
|
||||
Nodes (23): Suíte de Testes Automatizados para Conversão de Artigo JSON para Markdown.…, Testa decodificação de entidades HTML, colapso de espaços e filtro de…, Testa a matriz determinística de prioridades dos metadados., Validação exata byte a byte da Golden Fixture de Trafilatura., Validação exata byte a byte da Golden Fixture de Newspaper4k., Validação exata byte a byte da Golden Fixture de Readability., Testa geração do arquivo de saída padrão <input_stem>.md., Testa rejeição com código 1 quando a entrada contém a chave articles. (+15 more)
|
||||
|
||||
### Community 80 - "test_extract_article_contents.py"
|
||||
Cohesion: 0.06
|
||||
@@ -386,8 +417,8 @@ Cohesion: 0.33
|
||||
Nodes (6): 1. Comando e Argumentos, 2. Códigos de Saída (Exit Codes), 3. Protocolo de Streams (Stdout / Stderr), Argumentos de Linha de Comando, CLI Contract: Google News Headlines Extractor, Sintaxe
|
||||
|
||||
### Community 97 - "🧠 TextNLPClassifierApp"
|
||||
Cohesion: 0.06
|
||||
Nodes (35): 1. 🧠 Classificador de Conteúdo e Inerência (NLP / LLM / ECP), 1. Clonar o Repositório e Criar Ambiente Virtual, 1. Execução Padrão Automática, 2. Execução com Modo Verboso, 2. 📰 Extrator de Manchetes do Google News, 2. Instalar Dependências, 3. Baixar Binários do Navegador Stealth (Camoufox), 3. 📄 Extrator e Parser Multimotor de Artigos (+27 more)
|
||||
Cohesion: 0.04
|
||||
Nodes (45): 1. 🧠 Classificador de Conteúdo e Inerência (NLP / LLM / ECP), 1. Clonar o Repositório e Criar Ambiente Virtual, 1. Conversão Padrão, 1. Execução Padrão Automática, 2. Conversão com Caminho de Destino Personalizado, 2. Execução com Modo Verboso, 2. 📰 Extrator de Manchetes do Google News, 2. Instalar Dependências (+37 more)
|
||||
|
||||
### Community 98 - "Extraction Pipeline Checklist: Article Content Multi-Engine Extractor"
|
||||
Cohesion: 0.05
|
||||
@@ -398,12 +429,12 @@ Cohesion: 0.67
|
||||
Nodes (3): fixture, Fixture que fornece o conteúdo do XML de exemplo para testes offline., sample_rss_xml()
|
||||
|
||||
### Community 100 - "models.py"
|
||||
Cohesion: 0.24
|
||||
Nodes (8): emit_error(), ClassificationError, ErrorCode, MatchedGraphEntity, Enum, str, Data models and validation schemas for Multilingual NLP Entity Inherence…, test_classification_error_serialization()
|
||||
Cohesion: 0.15
|
||||
Nodes (17): emit_error(), main(), parse_args(), Namespace, ClassificationError, ErrorCode, MatchedGraphEntity, Enum (+9 more)
|
||||
|
||||
### Community 101 - "ECPSnapshot"
|
||||
Cohesion: 0.19
|
||||
Nodes (11): parametrize, ECPSnapshot, Any, classifier(), fixture, Controlled 24-case benchmark suite for Multilingual NLP Entity Inherence…, test_benchmark_case(), Unit tests for ECP models, schema validation, and structured error handling. (+3 more)
|
||||
Cohesion: 0.22
|
||||
Nodes (10): parametrize, ECPSnapshot, Any, classifier(), fixture, Controlled 24-case benchmark suite for Multilingual NLP Entity Inherence…, test_benchmark_case(), test_ecp_snapshot_defaults() (+2 more)
|
||||
|
||||
### Community 102 - "Feature Specification: Multilingual NLP Entity Inherence Classifier (POC)"
|
||||
Cohesion: 0.14
|
||||
@@ -417,9 +448,9 @@ Nodes (20): 1.1 Objetivo do Produto, 1. Visão Geral e Contexto, 2. Personas e C
|
||||
Cohesion: 0.11
|
||||
Nodes (18): Dependencies & Execution Order, Entrega Incremental, Implementation Strategy, Implementação da User Story 1, Implementação da User Story 2, Implementação da User Story 3, MVP First (User Story 1 Only), Oportunidades de Execução Paralela (+10 more)
|
||||
|
||||
### Community 105 - "LocalEmbeddingsAdapter"
|
||||
Cohesion: 0.18
|
||||
Nodes (7): LocalEmbeddingsAdapter, Optional local vector embeddings adapter (Tier 2). Disabled by default.…, Optional adapter for local multilingual semantic vector embeddings., Unit tests for optional adapter interfaces (Tier 2 / Tier 3)., test_classifier_with_adapter_flags(), test_embeddings_adapter_interface(), test_llm_adapter_interface()
|
||||
### Community 105 - "Tasks: Convert Article JSON to Markdown"
|
||||
Cohesion: 0.11
|
||||
Nodes (19): Dependencies & Execution Order, Implementation for User Story 1, Implementation for User Story 2, Implementation for User Story 3, Implementation Strategy, Incremental Delivery, MVP First (User Story 1 Only), Parallel Opportunities (+11 more)
|
||||
|
||||
### Community 106 - "Implementation Plan: Article Content Multi-Engine Extractor"
|
||||
Cohesion: 0.17
|
||||
@@ -458,12 +489,12 @@ Cohesion: 0.07
|
||||
Nodes (29): 10. Requisitos não funcionais, 11. Critérios de aceite, 12. Casos obrigatórios de teste, 13. Definition of Done, 1. Contexto, 2. Objetivo, 3.1 Incluído, 3.2 Fora do escopo (+21 more)
|
||||
|
||||
### Community 116 - "select_article_extractor.py"
|
||||
Cohesion: 0.16
|
||||
Nodes (17): BatchProcessingResult, break_priority_tie(), calculate_consensus_metrics(), ExtractorCandidate, form_active_set(), main(), parse_args(), Namespace (+9 more)
|
||||
Cohesion: 0.14
|
||||
Nodes (19): ArticleSelectionResult, BatchProcessingResult, break_priority_tie(), calculate_consensus_metrics(), ExtractorCandidate, form_active_set(), main(), parse_args() (+11 more)
|
||||
|
||||
### Community 117 - "1. Text Normalization Pipeline"
|
||||
Cohesion: 0.11
|
||||
Nodes (18): 1. Text Normalization Pipeline, 2. 5-Token Shingles & Consensus Metrics, 3. Regras de Decisão, Empate Técnico e Desempate Hierárquico, 4. Estratégia de I/O Não Destrutiva e Escrita Atômica, Alternatives Considered, Context, Context, Context (+10 more)
|
||||
### Community 117 - "Research & Architectural Decisions: Deterministic Content Selection"
|
||||
Cohesion: 0.15
|
||||
Nodes (13): 2. 5-Token Shingles & Consensus Metrics, 3. Regras de Decisão, Empate Técnico e Desempate Hierárquico, 4. Estratégia de I/O Não Destrutiva e Escrita Atômica, Context, Context, Context, Decisions, Decisions (+5 more)
|
||||
|
||||
### Community 118 - "Tasks: Deterministic Article Content Selection"
|
||||
Cohesion: 0.11
|
||||
@@ -471,15 +502,19 @@ Nodes (18): Dependencies & Execution Order, Implementation for User Story 1, Imp
|
||||
|
||||
### Community 119 - "select_article_extractor"
|
||||
Cohesion: 0.08
|
||||
Nodes (37): ArticleSelectionResult, CandidateStatus, extract_candidate_data(), ExtractorName, Any, Enum, str, Extrai campo de texto, erro e calcula tokens/shingles para um motor. (+29 more)
|
||||
Nodes (35): CandidateStatus, extract_candidate_data(), ExtractorName, Any, Enum, str, Extrai campo de texto, erro e calcula tokens/shingles para um motor., Nomes canônicos e catálogo fechado dos motores de extração. (+27 more)
|
||||
|
||||
### Community 120 - "process_batch"
|
||||
Cohesion: 0.10
|
||||
Nodes (26): 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. (+18 more)
|
||||
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 - "detect_language"
|
||||
Cohesion: 0.19
|
||||
Nodes (16): detect_language(), extract_words(), normalize_text(), Lightweight multilingual language detection and text normalization., Normalize text by converting to lowercase and stripping combining diacritical…, 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. (+8 more)
|
||||
|
||||
### Community 122 - "test_select_article_extractor.py"
|
||||
Cohesion: 0.21
|
||||
Nodes (14): generate_shingles(), normalize_text(), Executa a normalização determinística para comparação: 1. Decodificar entidades…, Gera conjunto de shingles ordenados de tamanho window_size (padrão 5). - Se…, Suíte de Testes Automatizados para o Seletor Determinístico de Extrator. Cobre…, Garante que marcação de imagem Markdown  seja descartada e link…, test_generate_shingles_empty(), test_generate_shingles_short_text() (+6 more)
|
||||
Cohesion: 0.18
|
||||
Nodes (16): generate_shingles(), normalize_text(), Executa a normalização determinística para comparação: 1. Decodificar entidades…, Gera conjunto de shingles ordenados de tamanho window_size (padrão 5). - Se…, Suíte de Testes Automatizados para o Seletor Determinístico de Extrator. Cobre…, Garante que marcação de imagem Markdown  seja descartada e link…, E2E: Executa scripts/select_article_extractor.py como subprocesso real na linha…, test_e2e_cli_subprocess_real_execution() (+8 more)
|
||||
|
||||
### Community 123 - "Feature Specification: Deterministic Content Selection"
|
||||
Cohesion: 0.17
|
||||
@@ -509,23 +544,123 @@ Nodes (5): Content Quality, Feature Readiness, Notes, Requirement Completeness,
|
||||
Cohesion: 0.33
|
||||
Nodes (5): 1. Command Syntax, 2. Arguments and Flags, 3. Standard Streams (I/O), 4. Exit Codes, CLI Interface Contract: Deterministic Article Content Selection
|
||||
|
||||
### Community 131 - "JSON Schema Contract: Deterministic Article Content Selection"
|
||||
Cohesion: 0.50
|
||||
### Community 130 - "004-deterministic-content-selection/spec.md"
|
||||
Cohesion: 0.29
|
||||
Nodes (3): 1. Input JSON Schema, 2. Output JSON Schema, JSON Schema Contract: Deterministic Article Content Selection
|
||||
|
||||
### Community 131 - "convert_article_to_markdown.py"
|
||||
Cohesion: 0.23
|
||||
Nodes (15): _get_dict(), normalize_date(), normalize_list(), normalize_scalar(), Any, Interpreta datas ISO 8601 e RFC 2822 preservando fuso horário ou YYYY-MM-DD…, Valida se a URL é absoluta com protocolo http ou https e hostname não vazio., Retorna o dicionário associado à chave ou um dicionário vazio caso não seja… (+7 more)
|
||||
|
||||
### Community 132 - "8. Regras funcionais"
|
||||
Cohesion: 0.13
|
||||
Nodes (15): 8. Regras funcionais, RF-001 — Receber um único artigo, RF-002 — Respeitar o extrator selecionado, RF-003 — Resolver o corpo dentro do extrator selecionado, RF-004 — Selecionar metadados deterministicamente, RF-005 — Priorizar metadados por campo, RF-006 — Normalizar valores escalares, RF-007 — Normalizar listas (+7 more)
|
||||
|
||||
### Community 133 - "12. Critérios de aceite"
|
||||
Cohesion: 0.14
|
||||
Nodes (14): 12. Critérios de aceite, CA-001 — Trafilatura selecionada, CA-002 — Newspaper4k selecionado, CA-003 — Readability selecionado, CA-004 — Fallback dentro do extrator, CA-005 — Proibição de fallback de corpo entre extratores, CA-006 — Metadado vindo de outro extrator, CA-007 — Obrigatórios presentes (+6 more)
|
||||
|
||||
### Community 134 - "PRD — Conversão de artigo JSON para Markdown"
|
||||
Cohesion: 0.17
|
||||
Nodes (11): 10. Tratamento de erros, 14. Definition of Done, 15. Dependência técnica escolhida, 1. Visão geral, 2. Problema, 3. Objetivo, 4. História do usuário, 7.1 Arquivo (+3 more)
|
||||
|
||||
### Community 135 - "resolve_article_body"
|
||||
Cohesion: 0.17
|
||||
Nodes (12): Obtém o corpo do artigo exclusivamente do selected_extractor com fallback…, resolve_article_body(), Garante que falhe se o corpo do extrator selecionado for vazio, sem usar outro…, Garante que Trafilatura use diretamente o campo markdown., Garante que Trafilatura faça fallback para text se markdown estiver vazio., Garante conversão de HTML para Markdown para Newspaper4k., Garante conversão de HTML para Markdown para Readability., test_resolve_article_body_newspaper4k_html_conversion() (+4 more)
|
||||
|
||||
### Community 136 - "Implementation Plan: Convert Article JSON to Markdown"
|
||||
Cohesion: 0.17
|
||||
Nodes (12): Complexity Tracking, Constitution Check, Documentation (this feature), Implementation Phases, Implementation Plan: Convert Article JSON to Markdown, Phase 0: Outline & Research *(Completed)*, Phase 1: Design & Contracts *(Completed)*, Phase 2: Tasks & Implementation Breakdown *(Next: `/speckit-tasks`)* (+4 more)
|
||||
|
||||
### Community 137 - "2. Technical Decisions & Research Findings"
|
||||
Cohesion: 0.17
|
||||
Nodes (11): 1. Executive Summary & Goals, 2. Technical Decisions & Research Findings, 3. Technology Stack & Dependencies, Decision 1: HTML-to-Markdown Engine Selection, Decision 2: Direct Markdown Handling for Trafilatura, Decision 3: Metadata Normalization & Priority Resolution Pipeline, Decision 4: Date Parsing Strategy (ISO 8601 & RFC 2822), Decision 5: URL Validation & Media Filtering (+3 more)
|
||||
|
||||
### Community 138 - "Feature Specification: Convert Article JSON to Markdown"
|
||||
Cohesion: 0.17
|
||||
Nodes (12): Assumptions, Edge Cases, Feature Specification: Convert Article JSON to Markdown, Functional Requirements, Key Entities, Measurable Outcomes, Requirements *(mandatory)*, Success Criteria *(mandatory)* (+4 more)
|
||||
|
||||
### Community 139 - "Markdown Conversion Checklist: End-to-End Requirements Quality"
|
||||
Cohesion: 0.18
|
||||
Nodes (11): 1. Validação de Entrada, Tipagem & Isolamento de Lotes, 2. Isolamento Estrito de Extrator & Conversão de Conteúdo (HTML/MD), 3. Resolução Determinística de Metadados & Mapeamento de SELECIONADO, 4. Normalização de Escalares, Placeholders & Sanitização de Listas, 5. Normalização de Datas, Fusos & Validação Estrita de URLs, 6. Sanitização Editorial, Tratamento de Imagens & Título Duplicado, 7. Estrutura, Sintaxe do Markdown de Saída & Restrições, 8. Interface CLI, Tratamento de Erros & Atomicidade (+3 more)
|
||||
|
||||
### Community 140 - "convert_article"
|
||||
Cohesion: 0.22
|
||||
Nodes (9): clean_body_images(), convert_article(), Path, Preserva imagens com URL absoluta http/https, remove relativas/data:/vazias e…, Executa a leitura do JSON, validação, conversão e escrita atômica do arquivo…, Garante remoção de imagens relativas/data: e deduplicação de imagens idênticas., Testa diretamente a função convert_article em Python., test_clean_body_images_and_deduplicate() (+1 more)
|
||||
|
||||
### Community 141 - "005-convert-json-markdown/plan.md"
|
||||
Cohesion: 0.33
|
||||
Nodes (3): 1. Output Document Specification, 2. Formatting & Syntax Constraints, Markdown Schema Contract: Output Article Markdown
|
||||
|
||||
### Community 142 - "Quickstart: Convert Article JSON to Markdown"
|
||||
Cohesion: 0.22
|
||||
Nodes (8): 1. Prerequisites & Setup, 2. Running the CLI Tool, 3. Verification & Testing, Basic Conversion (Default Output Path), Custom Destination Path, Quickstart: Convert Article JSON to Markdown, Run All Unit & Integration Tests, Run Linter & Type Checker
|
||||
|
||||
### Community 143 - "1. Domain Entities & Schemas"
|
||||
Cohesion: 0.25
|
||||
Nodes (8): 1. Domain Entities & Schemas, 2. Priority Resolution Matrix, Data Model: Convert Article JSON to Markdown, Entity 1: `ArticleInput` (Source JSON), Entity 2: `ExtractorBlock` (Per-Extractor Data), Entity 3: `ResolvedArticleMetadata`, Entity 4: `MarkdownDocument`, Validation Rules:
|
||||
|
||||
### Community 144 - "11. Requisitos não funcionais"
|
||||
Cohesion: 0.29
|
||||
Nodes (7): 11. Requisitos não funcionais, RNF-001 — Determinismo, RNF-002 — Compatibilidade, RNF-003 — Execução local, RNF-004 — Integridade, RNF-005 — Manutenibilidade, RNF-006 — Qualidade
|
||||
|
||||
### Community 145 - "parse_arguments"
|
||||
Cohesion: 0.29
|
||||
Nodes (7): main(), parse_arguments(), Namespace, Configura o parser de argumentos do CLI., Ponto de entrada do CLI., Testa diretamente o parsing de argumentos., test_parse_arguments_direct()
|
||||
|
||||
### Community 146 - "Specification Quality Checklist: Convert Article JSON to Markdown"
|
||||
Cohesion: 0.33
|
||||
Nodes (5): Content Quality, Feature Readiness, Notes, Requirement Completeness, Specification Quality Checklist: Convert Article JSON to Markdown
|
||||
|
||||
### Community 147 - "CLI Contract: `convert_article_to_markdown.py`"
|
||||
Cohesion: 0.33
|
||||
Nodes (5): 1. Script Signature, 2. Command-Line Arguments, 3. Exit Codes, 4. Standard Stream Behavior, CLI Contract: `convert_article_to_markdown.py`
|
||||
|
||||
### Community 148 - "9. Interface CLI"
|
||||
Cohesion: 0.40
|
||||
Nodes (5): 9.1 Script, 9.2 Argumentos, 9.3 Exemplos, 9.4 Saída do processo, 9. Interface CLI
|
||||
|
||||
### Community 149 - "1. Text Normalization Pipeline"
|
||||
Cohesion: 0.40
|
||||
Nodes (5): 1. Text Normalization Pipeline, Alternatives Considered, Context, Decisions, Rationale
|
||||
|
||||
### Community 150 - "13. Estratégia de testes"
|
||||
Cohesion: 0.50
|
||||
Nodes (4): 13.1 Testes unitários, 13.2 Testes de integração do CLI, 13.3 Casos de resultado esperado, 13. Estratégia de testes
|
||||
|
||||
### Community 151 - "6. Contrato de entrada"
|
||||
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 - "assemble_markdown_document"
|
||||
Cohesion: 0.50
|
||||
Nodes (4): assemble_markdown_document(), Monta a estrutura final do documento Markdown respeitando a ordem estrita do…, Testa a montagem completa da estrutura de seções do documento Markdown., test_assemble_markdown_document()
|
||||
|
||||
### Community 153 - "convert_html_to_markdown"
|
||||
Cohesion: 0.50
|
||||
Nodes (4): convert_html_to_markdown(), Converte HTML para Markdown usando títulos ATX., Testa diretamente a função convert_html_to_markdown., test_convert_html_to_markdown_basic()
|
||||
|
||||
### Community 154 - "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(), Garante remoção apenas do H1 inicial que for idêntico ao título., test_remove_duplicate_initial_h1()
|
||||
|
||||
### Community 155 - "5. Escopo"
|
||||
Cohesion: 0.67
|
||||
Nodes (3): 5.1 Incluído, 5.2 Fora do escopo, 5. Escopo
|
||||
|
||||
## Knowledge Gaps
|
||||
- **562 isolated node(s):** `text-nlp-classifier`, `MatchedGraphEntity`, `graphify`, `Usage`, `What graphify is for` (+557 more)
|
||||
- **696 isolated node(s):** `text-nlp-classifier`, `MatchedGraphEntity`, `graphify`, `Usage`, `What graphify is for` (+691 more)
|
||||
These have ≤1 connection - possible missing edges or undocumented components.
|
||||
- **38 thin communities (<3 nodes) omitted from report** — run `graphify query` to explore isolated nodes.
|
||||
- **43 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 `models.py`, `LocalEmbeddingsAdapter`, `ClassificationResult`, `InherenceClassifier`, `classifier.py`, `main`?**
|
||||
_High betweenness centrality (0.003) - this node is a cross-community bridge._
|
||||
- **Why does `LLMFallbackAdapter` connect `ClassificationResult` to `LocalEmbeddingsAdapter`, `ECPSnapshot`, `InherenceClassifier`, `classifier.py`?**
|
||||
_High betweenness centrality (0.003) - this node is a cross-community bridge._
|
||||
- **Why does `Research & Architectural Decisions: Deterministic Content Selection` connect `1. Text Normalization Pipeline` to `004-deterministic-content-selection/spec.md`?**
|
||||
- **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.007) - this node is a cross-community bridge._
|
||||
- **Why does `Tasks: Convert Article JSON to Markdown` connect `Tasks: Convert Article JSON to Markdown` to `005-convert-json-markdown/plan.md`?**
|
||||
_High betweenness centrality (0.004) - this node is a cross-community bridge._
|
||||
- **Why does `Research & Architectural Decisions: Deterministic Content Selection` connect `Research & Architectural Decisions: Deterministic Content Selection` to `004-deterministic-content-selection/spec.md`, `1. Text Normalization Pipeline`?**
|
||||
_High betweenness centrality (0.003) - this node is a cross-community bridge._
|
||||
- **Are the 10 inferred relationships involving `ECPSnapshot` (e.g. with `main()` and `BaseNLPAdapter`) actually correct?**
|
||||
_`ECPSnapshot` has 10 INFERRED edges - model-reasoned connections that need verification._
|
||||
|
||||
+8102
-1439
File diff suppressed because it is too large
Load Diff
@@ -420,9 +420,9 @@
|
||||
"semantic_hash": ""
|
||||
},
|
||||
"requirements.txt": {
|
||||
"mtime": 1787240110.13472,
|
||||
"seen": 1787240516.5993943,
|
||||
"ast_hash": "f5d99630fa9c93c5fbaa44814f107e70",
|
||||
"mtime": 1787317345.9253972,
|
||||
"seen": 1787317712.8213654,
|
||||
"ast_hash": "f3f8ea2b8cc995de218d81679ec35231",
|
||||
"semantic_hash": ""
|
||||
},
|
||||
"tests/fixtures/benchmark_24/de/contextual.md": {
|
||||
@@ -654,9 +654,9 @@
|
||||
"semantic_hash": ""
|
||||
},
|
||||
"README.md": {
|
||||
"mtime": 1787274445.4631622,
|
||||
"seen": 1787274455.3244681,
|
||||
"ast_hash": "5270e11cfba31a235ba379effb2db0d5",
|
||||
"mtime": 1787317667.2516665,
|
||||
"seen": 1787317712.8207479,
|
||||
"ast_hash": "73b6e2e7ff33db1b991b8470f29ee40f",
|
||||
"semantic_hash": ""
|
||||
},
|
||||
"scripts/extract_article_contents.py": {
|
||||
@@ -738,15 +738,15 @@
|
||||
"semantic_hash": ""
|
||||
},
|
||||
"scripts/select_article_extractor.py": {
|
||||
"mtime": 1787273522.903319,
|
||||
"seen": 1787273548.728257,
|
||||
"ast_hash": "3e6938964c7e4549051cb1637207698d",
|
||||
"mtime": 1787274502.4801269,
|
||||
"seen": 1787310813.8455508,
|
||||
"ast_hash": "4037eda779d5fc81527d0698a8fc07d6",
|
||||
"semantic_hash": ""
|
||||
},
|
||||
"tests/test_select_article_extractor.py": {
|
||||
"mtime": 1787274189.7777488,
|
||||
"seen": 1787274207.7989414,
|
||||
"ast_hash": "9f91e09d47f06140b243b6f516d14c60",
|
||||
"mtime": 1787274502.4801269,
|
||||
"seen": 1787310813.8470025,
|
||||
"ast_hash": "2cd19eb0c5204a8c22b7727e259db885",
|
||||
"semantic_hash": ""
|
||||
},
|
||||
"docs/prd_deterministic_content_selection.md": {
|
||||
@@ -792,9 +792,9 @@
|
||||
"semantic_hash": ""
|
||||
},
|
||||
"specs/004-deterministic-content-selection/quickstart.md": {
|
||||
"mtime": 1787274324.1467915,
|
||||
"seen": 1787274402.0946271,
|
||||
"ast_hash": "a7886ca618af43f33971213e2255b3c6",
|
||||
"mtime": 1787274502.478128,
|
||||
"seen": 1787310813.854652,
|
||||
"ast_hash": "60453533ee75a4f0a894dca634e0c96c",
|
||||
"semantic_hash": ""
|
||||
},
|
||||
"specs/004-deterministic-content-selection/research.md": {
|
||||
@@ -814,5 +814,101 @@
|
||||
"seen": 1787272611.6714194,
|
||||
"ast_hash": "3a2617478f44c6400ed57088d2039f93",
|
||||
"semantic_hash": ""
|
||||
},
|
||||
"scripts/convert_article_to_markdown.py": {
|
||||
"mtime": 1787317631.1342402,
|
||||
"seen": 1787317712.814934,
|
||||
"ast_hash": "f2550126b7ff9de09bbbe0ae03acbbca",
|
||||
"semantic_hash": ""
|
||||
},
|
||||
"tests/test_convert_article_to_markdown.py": {
|
||||
"mtime": 1787317613.930905,
|
||||
"seen": 1787317712.8166668,
|
||||
"ast_hash": "fc7d1b6d08037a85cf014fa4e8c70a70",
|
||||
"semantic_hash": ""
|
||||
},
|
||||
"docs/prd_convert_json_markdown.md": {
|
||||
"mtime": 1787315400.452784,
|
||||
"seen": 1787317712.8208659,
|
||||
"ast_hash": "1fc73d15d4f4d5c1e74f299040b040f2",
|
||||
"semantic_hash": ""
|
||||
},
|
||||
"specs/005-convert-json-markdown/checklists/markdown-conversion.md": {
|
||||
"mtime": 1787315812.9198053,
|
||||
"seen": 1787317712.8255877,
|
||||
"ast_hash": "4cc2161c66aa34dc8540c48322b6eaaa",
|
||||
"semantic_hash": ""
|
||||
},
|
||||
"specs/005-convert-json-markdown/checklists/requirements.md": {
|
||||
"mtime": 1787315513.450848,
|
||||
"seen": 1787317712.8255897,
|
||||
"ast_hash": "a14c648defdfb7c2ad77601249d44a66",
|
||||
"semantic_hash": ""
|
||||
},
|
||||
"specs/005-convert-json-markdown/contracts/cli-contract.md": {
|
||||
"mtime": 1787315656.382816,
|
||||
"seen": 1787317712.8255913,
|
||||
"ast_hash": "bba24a6fcd59b265d11242b4b09d2537",
|
||||
"semantic_hash": ""
|
||||
},
|
||||
"specs/005-convert-json-markdown/contracts/markdown-schema.md": {
|
||||
"mtime": 1787315662.3060155,
|
||||
"seen": 1787317712.8255925,
|
||||
"ast_hash": "4dd6023205dcc49447bf3c78f0419c52",
|
||||
"semantic_hash": ""
|
||||
},
|
||||
"specs/005-convert-json-markdown/data-model.md": {
|
||||
"mtime": 1787315648.195198,
|
||||
"seen": 1787317712.8255942,
|
||||
"ast_hash": "31de71b9fa43fb1b257f76ae2de33044",
|
||||
"semantic_hash": ""
|
||||
},
|
||||
"specs/005-convert-json-markdown/plan.md": {
|
||||
"mtime": 1787315676.826685,
|
||||
"seen": 1787317712.8255954,
|
||||
"ast_hash": "44e3074130dadf889bf3830e6139b91a",
|
||||
"semantic_hash": ""
|
||||
},
|
||||
"specs/005-convert-json-markdown/quickstart.md": {
|
||||
"mtime": 1787315668.269243,
|
||||
"seen": 1787317712.8255966,
|
||||
"ast_hash": "6086387edc574ed31202ff05eaa3fb54",
|
||||
"semantic_hash": ""
|
||||
},
|
||||
"specs/005-convert-json-markdown/research.md": {
|
||||
"mtime": 1787315639.7204154,
|
||||
"seen": 1787317712.825598,
|
||||
"ast_hash": "3ffedbbf7e61245b86119f41a5f8af2d",
|
||||
"semantic_hash": ""
|
||||
},
|
||||
"specs/005-convert-json-markdown/spec.md": {
|
||||
"mtime": 1787315504.210701,
|
||||
"seen": 1787317712.825599,
|
||||
"ast_hash": "9f78ac1c71853dcf4e364c66973dfcbc",
|
||||
"semantic_hash": ""
|
||||
},
|
||||
"specs/005-convert-json-markdown/tasks.md": {
|
||||
"mtime": 1787317701.507181,
|
||||
"seen": 1787317712.8256,
|
||||
"ast_hash": "1287da802887af5e0dd3a6a2685f5fc0",
|
||||
"semantic_hash": ""
|
||||
},
|
||||
"tests/fixtures/markdown_conversion/valid_newspaper4k.md": {
|
||||
"mtime": 1787317400.9745035,
|
||||
"seen": 1787317712.8280056,
|
||||
"ast_hash": "3bfb28bbde97c16635de39bbbe6fbd8b",
|
||||
"semantic_hash": ""
|
||||
},
|
||||
"tests/fixtures/markdown_conversion/valid_readability.md": {
|
||||
"mtime": 1787317419.4019263,
|
||||
"seen": 1787317712.8280075,
|
||||
"ast_hash": "49fdc6bedd7585eda33e2c502337e01a",
|
||||
"semantic_hash": ""
|
||||
},
|
||||
"tests/fixtures/markdown_conversion/valid_trafilatura.md": {
|
||||
"mtime": 1787317383.5058665,
|
||||
"seen": 1787317712.8280091,
|
||||
"ast_hash": "c63c1c39e34e08a239aa8bea3c264756",
|
||||
"semantic_hash": ""
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user