Skip to content

refactor: rebuild source dispatch and drive ingestion boundary contracts #255

Closed

Description

@Sinity

Summary

Renew the remaining source-boundary core around provider dispatch, Drive source ingestion, and parser support helpers so those seams stop depending on loosely shaped object/dict[str, object] plumbing.

Problem

The run/acquisition tranche tightened emitted telemetry and source sidecars, but the older source substrate still carries the heaviest remaining path dependence. polylogue/sources/dispatch.py, drive_source_client.py, drive_source_support.py, parsers/drive.py, and the Drive parser support helpers still exchange payloads through open dict/list/object contracts, with repeated coercion and cast logic spread across the flow.

That leaves the source layer formally type-checked but not semantically modeled: payload shape is rediscovered repeatedly, parser helpers remain coupled to raw export structure, and downstream renewal work has to compensate for ambiguity introduced here.

Scope

  • rebuild provider-dispatch payload contracts in polylogue/sources/dispatch.py
  • renew Drive source client/support boundaries so payload fetch/download surfaces return explicit typed shapes
  • tighten parsers/drive.py and the drive_support_* helper modules around stable typed intermediate records
  • align adjacent parser/base support models where the new contracts require it
  • carry the contract changes into the smallest necessary test fallout only

Acceptance Criteria

  • source dispatch no longer uses generic payload record/list aliases where a more explicit contract is possible
  • Drive source ingestion and parser support modules consume and return typed intermediate values instead of repeated ad hoc coercion
  • cast pressure and dict[str, object] plumbing are meaningfully reduced across the touched source files
  • targeted source/parser tests pass, and the tranche finishes with devtools verify

Notes

This is the next stacked slice after #252, not a grab-bag cleanup. Keep it centered on source/Drive dispatch and ingestion boundaries rather than mixing in unrelated CLI or product-surface changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:parsertype:refactor

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions