Skip to content

refactor: continue semantic-precision renewal program #250

Closed

Description

@Sinity

Outcome

Continue the repository renewal effort beyond the first strict-typing and surface-contract program by targeting the remaining weak semantic boundaries directly.

This follow-up program should focus on places that are already type-checked but still rely on broad Any/object plumbing, repeated casts, and dict-shaped runtime payloads.

Problem or opportunity

The previous renewal program successfully tightened schema/source ingestion, storage/runtime seams, surface contraction, and verification alignment. What remains is not untyped code. It is code that is technically accepted by strict mypy while still underspecifying meaning.

A quick density scan after the merged verification tranche shows the main remaining pressure concentrated in:

  • polylogue/schemas/
  • polylogue/lib/
  • selected polylogue/sources/, polylogue/storage/, and polylogue/pipeline/ follow-through seams

These areas now dominate the remaining Any, object, and cast(...) usage in non-test code.

Expected scope

Program-level tracking across follow-up PRs that may touch:

  • polylogue/schemas/
  • polylogue/lib/
  • selected polylogue/sources/
  • selected polylogue/storage/
  • selected polylogue/pipeline/
  • only the minimal tests//devtools/ fallout needed to prove each slice

Constraints and invariants

  • Keep the work in coherent PR slices, not one mega-branch.
  • Merge each completed PR before cutting the next branch.
  • Use workers only for narrow mechanical propagation after local anchor rewrites establish the target contract shape.
  • Prefer replacing broad payload containers with explicit intermediate records, aliases, and narrowing helpers.
  • Preserve archive semantics and externally visible behavior while simplifying implementation shape.

Acceptance criteria

  • Follow-up issues exist for the first semantic-precision slices.
  • Each slice lands as a coherent PR with devtools verify green.
  • The program materially reduces remaining Any/object/cast(...) pressure in non-test code.
  • The renewed code expresses runtime meaning more directly instead of hiding it behind loosely typed containers.

Verification plan

Each follow-up PR should run devtools verify before merge.

Context and evidence

Post-merge density snapshot in non-test code:

  • schemas: highest remaining Any and object density
  • lib: next-highest Any density with substantial object carry-over
  • sources and storage: still carry notable object/cast(...) pressure

Non-goals or explicitly deferred work

  • Rewriting already-clean surface areas again without a concrete architectural reason.
  • Treating strict-type compliance as the final goal.
  • One omnibus continuation branch.

Activity

  1. added
    type:refactor
    on Apr 20, 2026
  2. Sinity commented on Apr 20, 2026

    @Sinity
    OwnerAuthor

    Follow-up tranche issues are now in place under this program umbrella:

    The intended execution order remains: merge each completed tranche before cutting the next branch, with workers used only for narrow mechanical propagation after local anchor rewrites establish the target shape.

  3. Sinity commented on Apr 20, 2026

    @Sinity
    OwnerAuthor

    Progress update:

    Completed slices:

    Remaining queued slices:

    Continuing immediately into #263 from fresh master.

  4. Sinity commented on Apr 21, 2026

    @Sinity
    OwnerAuthor

    Closing this broad semantic-precision tracker as completed/superseded.

    The original strict-typing and broad weak-contract campaign has effectively landed: current scans show no mypy exclude list, no type: ignore, no cast(, no # noqa, no TODO/FIXME/XXX, and no real Any type usage in the checked source/test/devtools surfaces.

    The remaining work is now structural rather than mechanical typing cleanup, and is tracked in narrower issues:

    Future work should use those narrower issues rather than this now-stale campaign issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:refactor

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions