Generated: $(date) Status: READY FOR RELEASE (with critical fixes needed)
The batch-file-processor project has been reviewed for API contract consistency across 5 critical areas. 3 major issues and 3 minor issues were identified that could cause runtime errors. These must be addressed before release.
All pipeline steps in dispatch/pipeline/ properly implement their respective protocols and have required methods.
-
EDIValidationStep (
validator.py): ✅ ImplementsValidatorStepInterface- Methods:
validate(),should_block_processing(),execute(),get_error_log(),clear_error_log()
- Methods:
-
EDIConverterStep (
converter.py): ✅ ImplementsConverterInterface- Methods:
convert(),get_supported_formats(),execute()
- Methods:
-
EDISplitterStep (
splitter.py): ✅ ImplementsSplitterInterface- Methods:
split(),execute()
- Methods:
-
EDITweakerStep (
tweaker.py): ✅ ImplementsTweakerInterface- Methods:
tweak(),execute()
- Methods:
✅ PASS - All pipeline steps are consistent and fully implemented. No runtime errors expected from this area.
All plugins in interface/plugins/ properly inherit from ConfigurationPlugin and implement all required methods.
Verified plugins:
CSVConfigurationPlugin✅FintechConfigurationPlugin✅JolleyCustomConfigurationPlugin✅StewartCustomConfigurationPlugin✅SimplifiedCSVConfigurationPlugin✅ScannerwareConfigurationPlugin✅ScansheetTypeAConfigurationPlugin✅EStoreEInvoiceConfigurationPlugin✅EStoreEInvoiceGenericConfigurationPlugin✅YellowdogCSVConfigurationPlugin✅
- Class methods:
get_name(),get_identifier(),get_description(),get_version() - Configuration methods:
get_format_name(),get_format_enum(),get_config_fields() - Lifecycle methods:
initialize(),activate(),deactivate() - Implementation methods:
validate_config(),create_config(),serialize_config(),deserialize_config(),create_widget()
✅ PASS - All plugins properly inherit and implement the ConfigurationPlugin interface. No inconsistencies found.
Severity: HIGH Type: Schema Inconsistency
The schema.py defines columns that don't exist in the actual database, and vice versa.
Missing from database (defined in schema.py but not in DB):
- backend_copy_destination
- convert_format
- edi_output_folder
- error_message
- filename
- original_path
- process_edi_output
- processed_path
- sent_to
- split_edi_filter_categories
- split_edi_filter_mode
- status
- upc_padding_pattern
- upc_target_length
Extra in database (exist in DB but not in schema.py):
- edi_converter_scratch_folder
- email_origin_address
- email_origin_password
- email_origin_smtp_server
- email_origin_username
- email_smtp_port
- report_email_address
- report_email_password
- report_email_smtp_server
- report_email_username
- reporting_smtp_port
Risk: Code referencing missing columns will fail at runtime when trying to access split_edi_filter_categories, split_edi_filter_mode, upc_target_length, or upc_padding_pattern.
Files Affected:
schema.py- Lines 133-207 (folders table definition)migrations/add_plugin_config_column.py- Attempts to addsplit_edi_filter_categoriesandsplit_edi_filter_mode
Severity: MEDIUM Type: Column Naming Inconsistency
schema.pydefines:plugin_config TEXT(lines 113, 196)schema.pymigration attempts to add:plugin_configurations TEXT(line 408)- Actual database has:
plugin_config(column 65) - Code references:
plugin_configurationsininterface/models/folder_configuration.py
Risk: Code using plugin_configurations field will not find the plugin_config column in the database, causing mapping errors.
Files Affected:
schema.py- Lines 408-418migrations/add_plugin_config_column.py- Lines 6-30interface/models/folder_configuration.py- Usesplugin_configurationsfield
Severity: MEDIUM Type: Missing Schema Definition
migrations/add_plugin_config_column.py adds columns via ALTER TABLE that are never defined in ensure_schema():
split_edi_filter_categories(migration line 35-40)split_edi_filter_mode(migration line 43-49)
Risk: If ensure_schema() is called after the migration (e.g., on a new database), these columns won't be created, causing inconsistency.
-
Update schema.py to match actual database schema
- Add missing columns:
edi_converter_scratch_folder,email_origin_*,report_email_*, etc. - Remove or mark as deprecated columns that only exist in schema but not in DB
- Add missing columns:
-
Standardize plugin column naming
- Choose ONE name: either
plugin_configorplugin_configurations - Update migration to match schema.py
- Update
folder_configuration.pyto use the correct name
- Choose ONE name: either
-
Update ensure_schema() to include migration columns
- Add
split_edi_filter_categoriesandsplit_edi_filter_modeto the folders table creation - Ensure these are also added to administrative table for consistency
- Add
The batch_file_processor/__init__.py shim exports modules that no longer exist or cannot be imported.
Severity: MEDIUM Type: Import Error
File: batch_file_processor/__init__.py line 42
- Exports:
"dispatch_process" - Status: ❌ Module does not exist at repository root
Risk: Callers using import batch_file_processor.dispatch_process will get ModuleNotFoundError.
- ✅
dispatch- Works - ✅
core- Works - ✅
backend- Works - ✅
interface- Works - ✅
utils- Works - ✅
create_database- Works - ❌
dispatch_process- FAILS (module not found)
-
Option A: Remove from
__all__if no longer needed- Line 42: Remove
"dispatch_process",
- Line 42: Remove
-
Option B: Create stub or proper module
- If functionality moved, create appropriate re-export
- Update documentation for migration path
dispatch_process. Easily fixed by removing or providing the module.
Not all DispatchConfig fields defined in the dataclass are used in orchestrator.py, and vice versa.
Severity: LOW Type: Dead Code / Potential API Inconsistency
Unused fields in DispatchConfig:
- database: Optional[DatabaseInterface] = None
- file_processor: Optional[Any] = None
- version: str = "1.0.0"
These fields are defined but never referenced in orchestrator.py:
database- Not used anywhere in orchestratorfile_processor- Not used anywhere in orchestratorversion- Not used anywhere in orchestrator
Used fields (verified):
✅ validator, error_handler, settings, backends
✅ file_system, upc_service, upc_dict
✅ progress_reporter
✅ validator_step, splitter_step, converter_step, tweaker_step
- ❌ No immediate runtime error - unused fields don't cause failures
⚠️ API confusing - Developers may provide these fields expecting them to work⚠️ Maintenance burden - Unclear if these should be removed or if they're reserved for future use
-
Remove unused fields OR add usage
- If truly unused: Remove
database,file_processor, andversionfrom DispatchConfig - If reserved for future: Add clear documentation explaining their purpose
- If moved elsewhere: Update docstring to indicate that
- If truly unused: Remove
-
Document purpose of each field
- Add comments explaining what each field is used for
- Clarify if some fields are reserved for extensibility
🟡 MINOR - Inconsistency creates API confusion but doesn't cause runtime errors. Should be cleaned up for clarity.
| Area | Status | Issues | Severity |
|---|---|---|---|
| Pipeline Interface | ✅ PASS | 0 | - |
| Plugin System | ✅ PASS | 0 | - |
| Database Schema | ❌ FAIL | 3 | CRITICAL |
| Import Consistency | 1 | MEDIUM | |
| DispatchConfig Fields | 1 | LOW | |
| OVERALL | 5 | 1 CRITICAL |
-
Reconcile database schema with schema.py
- Decide which columns are authoritative
- Add missing columns to schema.py or remove from database
- Ensure
split_edi_filter_*columns exist in both
-
Fix plugin configuration column naming
- Standardize on one name (recommend
plugin_configurations) - Update schema.py, migrations, and FolderConfiguration model
- Test database queries with correct column name
- Standardize on one name (recommend
-
Remove or implement
dispatch_processexport- Delete from
batch_file_processor/__init__.pyif unused - Or create proper module/re-export if needed
- Delete from
-
Clean up DispatchConfig
- Document or remove unused fields (
database,file_processor,version) - Add docstring comments for each field explaining usage
- Document or remove unused fields (
- Test new database creation with
ensure_schema() - Test migration from old schema to new schema
- Test plugin configuration persistence and retrieval
- Test module imports from
batch_file_processorpackage - Test orchestrator initialization with full config
- Verify no AttributeError when accessing configuration columns
CRITICAL:
/workspaces/batch-file-processor/schema.py(lines 113, 196, 408-427)/workspaces/batch-file-processor/migrations/add_plugin_config_column.py(lines 1-78)/workspaces/batch-file-processor/interface/models/folder_configuration.py(if usingplugin_configurations)
IMPORTANT:
/workspaces/batch-file-processor/batch_file_processor/__init__.py(line 42)/workspaces/batch-file-processor/dispatch/orchestrator.py(DispatchConfig docstring)
The API contracts are generally well-designed, with excellent consistency in the pipeline and plugin systems. However, critical database schema inconsistencies must be resolved before release to ensure reliable field access and migration safety.
Recommendation: Fix the schema issues, update imports, and clean up DispatchConfig documentation. Once these are resolved, the system is ready for release.