Repository navigation
Closed
Labels
Description
Outcome
Continue the semantic-precision renewal program by rebuilding the persisted runtime and product boundary layer around explicit typed state/product contracts instead of broad object/mapping plumbing.
Ref #250
Problem or opportunity
After the source, run/acquisition, and schema/audit tranches, the next highest remaining pressure is concentrated in the runtime/product persistence layer:
polylogue/storage/still carries broadobject-typed coercion in run-state, raw-state, artifact-view, repository-contract, and query-builder helperspolylogue/products/registry.pystill presents product rows and query parameters through genericobjectaccessors and kwargs flow- adjacent lib models such as session profiles, work threads, and work events still serialize and hydrate through loose
dict[str, object]conventions - the result is code that passes strict mypy but still hides meaning behind generic payload adapters and cast-heavy persistence edges
Expected scope
Likely modules include:
polylogue/products/registry.pypolylogue/storage/run_state.pypolylogue/storage/raw_state_models.pypolylogue/storage/artifact_views.pypolylogue/storage/repository_contracts.pypolylogue/storage/search_query_builders.pypolylogue/lib/session_profile_models.pypolylogue/lib/threads.pypolylogue/lib/work_event_extraction.py- adjacent helpers where the same persisted-contract shape applies
Constraints and invariants
- keep the persisted archive/product semantics unchanged
- establish the target contract shape in local anchor rewrites first
- use workers only for narrow mechanical follow-through after the anchor is committed
- prefer explicit intermediate records, typed state payloads, and narrowing helpers over generic
objectaccessors - keep tests targeted to proof of the new persisted/runtime contracts rather than opportunistic suite churn
Acceptance criteria
- runtime and product persistence paths no longer depend on broad
object/dict[str, object]contracts where the shape is actually known - cast pressure is materially reduced across the touched storage/product/lib slice
- product registry and persisted state models express row/query meaning directly instead of via generic adapters
- the tranche lands as a coherent PR with
devtools verifygreen
Verification plan
Run devtools verify before merge.
Activity
refactor: rebuild storage and product runtime boundary contracts (#260)
refactor: rebuild storage and product runtime boundary contracts (#260)
refactor: rebuild storage and product runtime boundary contracts (#260)
refactor: rebuild storage and product runtime boundary contracts (#260)