Skip to content

fix: restore Python 3.11 TypedDict compatibility for Pydantic surfaces #241

Closed

Description

@Sinity

Summary

Restore Python 3.11 compatibility for runtime-loaded TypedDict payload surfaces by switching affected modules off typing.TypedDict and onto typing_extensions.TypedDict where Pydantic inspects them.

Problem

Recent refactor work introduced or preserved several runtime TypedDict definitions using typing.TypedDict. Under Python 3.11, Pydantic v2 rejects those definitions and requires typing_extensions.TypedDict instead. That currently breaks the test (3.11) CI leg for open PRs even though local verification on newer Python versions passes.

Scope

  • polylogue/surface_payloads.py
  • polylogue/cli/embed_stats.py
  • polylogue/pipeline/semantic_capture.py
  • polylogue/pipeline/run_finalization.py
  • polylogue/pipeline/run_stages.py
  • polylogue/pipeline/services/indexing.py
  • polylogue/pipeline/services/ingest_worker.py
  • polylogue/sources/assembly.py
  • polylogue/storage/query_models.py
  • polylogue/storage/session_product_runtime.py
  • polylogue/storage/state_views.py
  • polylogue/storage/backends/queries/stats.py
  • any adjacent runtime or devtool/test surfaces that should use the same import for consistency

Acceptance

  • runtime TypedDict surfaces that Pydantic inspects use typing_extensions.TypedDict
  • the repo passes the relevant tests on Python 3.11
  • follow-on PRs can merge without re-hitting the same compatibility failure

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:schematype:fix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions