feat: collapse redundant orchestration layers and retire pdf_table_extractor shim (RFC #19)#25
Closed
feat: collapse redundant orchestration layers and retire pdf_table_extractor shim (RFC #19)#25
Conversation
- extraction_orchestrator.py: import extract_tables_from_pdf from extraction_facade (not shim) - pdf_extractor.py: redirect all 5 inline shim imports to validation_facade / extraction_facade - pdf_table_extractor.py: annotate with DeprecationWarning at module import time - pyproject.toml: suppress DeprecationWarning in filterwarnings for legitimate shim test files
- tests/test_architecture.py: new CI guard scanning src/ for shim imports; fails with descriptive violation message if any found - facades/processing_facade.py: get_columns_config redirected to config.column_config - services/content_density.py: classify_row_type redirected to row_classification_facade - services/page_validation.py: classify_row_type redirected to row_classification_facade - services/row_merger.py: classify_row_type redirected to row_classification_facade - Full test suite: 1302 passed, 92.36% coverage
…cessor - Remove _write_csv_with_totals and _append_totals_to_csv (zero callers) - Remove _filter_rows, _has_row_data, _filter_empty_rows (owned by TransactionFilterService) - Remove _is_header_row, _filter_header_rows (owned by TransactionFilterService) - Remove _has_valid_transaction_date, _filter_invalid_date_rows (owned by TransactionFilterService) - Remove _group_rows_by_iban (owned by TransactionProcessingOrchestrator) - Drop unused Callable import - Delete test_iban_grouping.py, test_empty_row_filtering.py, test_header_row_filtering.py - Remove test_append_totals_uses_repository and appended_csv tracking from test_repository_integration.py
- Replace `result = self._process_single_pdf(pdf); rows, page_count, iban = result` with direct call `rows, page_count, iban = self.extraction_orchestrator.extract_from_pdf(pdf)` - Delete the 3-line passthrough _process_single_pdf method (no logic, pure indirection)
- Summary: shim retired from all 9 production call sites; DeprecationWarning added; architecture guard CI test locks contract - Coverage: 92.36% (1302 passed, 9 skipped) - Deviations: 4 additional shim imports auto-fixed (Rule 2)
- 10 dead private methods removed from BankStatementProcessor - _process_single_pdf inlined in PDFProcessingOrchestrator - 3 test files deleted, 1 test + mock tracking removed - 92.35% coverage maintained (threshold 91%)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
BankStatementProcessor(logic already owned by injected services) and inlinedPDFProcessingOrchestrator._process_single_pdf(3-line passthrough with no logic)pdf_table_extractor.pyto real facades (extraction_facade,validation_facade,row_classification_facade,column_config)DeprecationWarningat module import time (stacklevel=2)tests/test_architecture.pyCI guard — fails if any production code insrc/imports from the shimtest_repository_integration.pyCoverage: 92.36% (up from 91.1% baseline, threshold 91%)
Tests: 1302 passed, 9 skipped
Closes #19
Test plan
test_architecture.py::test_no_production_shim_importspasses (0 shim imports insrc/)pdf_table_extractoremitsDeprecationWarningBankStatementProcessor→ output produces expected transactions