Skip to content

refactor: reduce weak payload plumbing across lib and storage runtime #263

Closed

Description

@Sinity

Ref #250

Outcome

Continue the semantic-precision renewal into polylogue/lib/ and polylogue/storage/ so runtime products, retrieval, and repository helpers express their result shapes directly instead of preserving broad payload plumbing.

Problem

The storage/runtime tranche already tightened a large part of the substrate, but polylogue/lib/ and selected storage/product helpers still carry concentrated Any/object/cast pressure. Much of this code is no longer untyped; it is under-modeled.

That makes behavior harder to audit and encourages repeated coercion at runtime/product boundaries.

Expected scope

Likely modules include:

  • selected polylogue/lib/query_* and runtime helper modules
  • selected polylogue/lib/*payload* and viewport/runtime helpers
  • selected polylogue/storage/repository_* and session_product_* / repository_product_* follow-through surfaces
  • minimal test fallout needed to prove the tranche

Constraints and invariants

  • Preserve archive and query semantics.
  • Prefer explicit result records, aliases, and narrowing helpers over ad hoc dict payloads.
  • Remove duplicated conversion logic when one semantic model can own it.
  • Keep surface/UI changes out of scope unless forced by the renewed contracts.

Acceptance criteria

  • The tranche materially reduces remaining weak payload plumbing in non-test code.
  • Runtime and repository/product helpers express result shapes more directly.
  • Cast-heavy or repeated conversion paths are simplified where a stable contract exists.
  • The tranche lands as a coherent PR with devtools verify green.

Verification plan

Run devtools verify before merge.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:storagetype:refactor

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions