Skip to content

Split configured cycle dependency composition#648

Merged
ktalpay merged 1 commit into
developfrom
codex/extract-dependency-composition-module
Jun 2, 2026
Merged

Split configured cycle dependency composition#648
ktalpay merged 1 commit into
developfrom
codex/extract-dependency-composition-module

Conversation

@ktalpay

@ktalpay ktalpay commented Jun 2, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Reduce responsibility of configured_cycle_runner.py by extracting dependency composition into a focused module so the runner can remain focused on loop/summary/history wiring.
  • Make dependency wiring (source adapters, parser boundaries, validation, repository) easier to test and reuse.
  • Preserve public import compatibility so existing callers/tests that reference the validation boundary continue to work.

Description

  • Added src/carbonfactor_parser/pipeline/configured_cycle_dependencies.py which defines ConfiguredCycleValidationBoundary, helper _ghg/_defra/_ipcc source-year mappers, and build_configured_cycle_dependencies(config, runtime) returning ProductionE2EYearOrchestratorDependencies.
  • Updated src/carbonfactor_parser/pipeline/configured_cycle_runner.py to call build_configured_cycle_dependencies and import ConfiguredCycleValidationBoundary from the new module for compatibility.
  • Kept runner responsibilities unchanged: loop, startup summary, cycle summary output, history persistence, and public API exports remain as before.
  • Added/updated focused tests in tests/test_configured_cycle_runner.py to assert backward-compatible imports and that build_configured_cycle_dependencies wires source adapters, parser boundaries, validation boundary, and PostgreSQLSourceFamilyRuntimeRepository with the runtime connection correctly.

Testing

  • Ran targeted tests with python -m pytest tests/test_configured_cycle_runner.py tests/test_run_ingestion_summary_cli.py and both passed.
  • Ran run-history tests with python -m pytest tests/test_ingestion_run_history_mapping.py tests/test_ingestion_run_history_repository.py tests/test_ingestion_run_history_reader.py and all passed.
  • Ran the full test-suite with python -m pytest which completed successfully (2147 passed, 8 skipped).
  • Ran python -m ruff check src/carbonfactor_parser/pipeline/configured_cycle_runner.py src/carbonfactor_parser/pipeline/configured_cycle_dependencies.py tests/test_configured_cycle_runner.py and git diff --check with no issues.

Codex Task

@ktalpay
ktalpay merged commit 92fbe70 into develop Jun 2, 2026
2 checks passed
@ktalpay
ktalpay deleted the codex/extract-dependency-composition-module branch June 2, 2026 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant