You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor: split source acquisition into explicit components #324
The low-churn audit in #315 found that polylogue/sources/source_acquisition.py mixes source walking, ZIP entry handling, split-payload buffering, cursor recovery, provider hints, and observation reporting in a long orchestration flow.
This is a good candidate for whole-file renewal: the concern boundaries are visible, but the implementation still combines them procedurally.
Scope
Split source acquisition into explicit components while preserving provider detection and ingestion behavior.
Candidate boundaries:
archive/file walker
ZIP entry reader
split payload buffer/reassembler
provider hint and detection adapter
acquisition failure/observation recorder
Acceptance criteria
Acquisition components have typed boundaries and focused responsibilities.
ZIP, split JSON/JSONL, and normal file acquisition behavior remains compatible.
Cursor/failure diagnostics stay at least as actionable as today.
Starting #324 on feature/refactor/source-acquisition-components.
Initial boundary:
Keep polylogue.sources.source_acquisition.iter_source_raw_data() as the compatibility entrypoint.
Split local-file, ZIP-entry, split-payload, observation/status, and raw-record construction concerns behind typed helpers.
Preserve current source walking, provider detection, cursor diagnostics, blob-store semantics, and acquisition behavior for plain files, grouped ZIP entries, split JSON/JSONL entries, and zero-byte/read-failure cases.
First implementation pass will focus on polylogue/sources/source_acquisition.py and representative tests in tests/unit/sources/test_source_laws.py.
Added polylogue/sources/source_acquisition_components.py as the typed component layer for local acquisition.
Moved status heartbeats, observation payload creation, blob streaming, raw metadata construction, plain-file reads, ZIP preserved-entry reads, streamed JSON provider detection, and ZIP split-payload buffering/materialization out of the root iterator.
Kept polylogue.sources.source_acquisition.iter_source_raw_data() as the compatibility entrypoint; it now focuses on source walking, zero-byte cursor failures, top-level read exception handling, and summary logging.
Updated source-law monkeypatch targets from the old monolithic private helpers to the new component module.
Activity
Sinity commentedon Apr 22, 2026
Starting #324 on
feature/refactor/source-acquisition-components.Initial boundary:
polylogue.sources.source_acquisition.iter_source_raw_data()as the compatibility entrypoint.First implementation pass will focus on
polylogue/sources/source_acquisition.pyand representative tests intests/unit/sources/test_source_laws.py.Sinity commentedon Apr 22, 2026
Progress update for #324:
polylogue/sources/source_acquisition_components.pyas the typed component layer for local acquisition.polylogue.sources.source_acquisition.iter_source_raw_data()as the compatibility entrypoint; it now focuses on source walking, zero-byte cursor failures, top-level read exception handling, and summary logging.Focused verification so far:
ruff check polylogue/sources/source_acquisition.py polylogue/sources/source_acquisition_components.py tests/unit/sources/test_source_laws.pymypy polylogue/sources/source_acquisition.py polylogue/sources/source_acquisition_components.pypytest -q tests/unit/sources/test_source_laws.py->111 passed in 8.87spytest -q tests/unit/pipeline/test_run_sources.py tests/unit/sources/test_source_laws.py->159 passed in 9.55sNext: review/stage the diff, commit this slice, then run the full local gate before opening the PR.
refactor(sources): split acquisition components (#371)