Skip to content

refactor(archive): remove lib model facade - #675

Merged
Sinity merged 1 commit into
masterfrom
feature/refactor/remove-lib-model-facade
May 1, 2026
Merged

Sinity merged 1 commit into
masterfrom
feature/refactor/remove-lib-model-facade

Conversation

@Sinity

@Sinity Sinity commented May 1, 2026

Copy link
Copy Markdown
Owner

Summary

Remove the remaining polylogue.lib package and move its domain-model facade to polylogue.archive.models.

Problem

The integrated naming policy rejects compatibility shims and old import aliases. After the archive/core cleanup series, polylogue.lib only re-exported domain models. Keeping it would preserve a misleading generic library namespace after all real owners had moved.

Solution

  • Rename polylogue/lib/models.py to polylogue/archive/models.py.
  • Delete polylogue/lib/__init__.py, removing the polylogue.lib package.
  • Update production, test, benchmark, and generated quality references to import polylogue.archive.models or precise archive modules.
  • Remove lib-root from topology projection/rendering/verification vocabulary.
  • Remove the obsolete layering rule for polylogue/lib.
  • Refresh generated topology/status/quality docs.

Ref #635

Verification

  • devtools build-topology-projection && devtools verify-topology — realized=694 declared=694 blocking=False
  • ruff check polylogue/ tests/ devtools/ — all checks passed
  • mypy polylogue/ — no issues found in 694 source files
  • pytest -q tests/unit/core/test_version.py tests/unit/core/test_models.py tests/unit/core/test_message_laws.py tests/unit/core/test_conversation_semantics.py tests/unit/cli/test_query_fmt.py tests/unit/mcp/test_tool_contracts.py tests/unit/devtools/test_topology_projection_witness.py tests/unit/test_mutmut_campaign.py — 313 passed
  • devtools verify-layering && devtools verify-topology — no layering violations; realized=694 declared=694 blocking=False
  • devtools render-all --check — sync OK
  • pre-push devtools verify --quick — all checks passed

Copilot AI review requested due to automatic review settings May 1, 2026 21:56
@Sinity
Sinity enabled auto-merge (squash) May 1, 2026 21:56
@Sinity
Sinity merged commit 01cbb36 into master May 1, 2026
@Sinity
Sinity deleted the feature/refactor/remove-lib-model-facade branch May 1, 2026 21:56
@coderabbitai

coderabbitai Bot commented May 1, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@Sinity has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 39 minutes and 7 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: af4c7ff9-e8d7-4749-8b0b-a0256e00e1dd

📥 Commits

Reviewing files that changed from the base of the PR and between 5736b3b and a0fd20c.

📒 Files selected for processing (83)
  • devtools/build_topology_projection.py
  • devtools/mutation_scenario_catalog.py
  • devtools/render_topology_status.py
  • devtools/verify_test_ownership.py
  • devtools/verify_topology.py
  • docs/architecture.md
  • docs/library-api.md
  • docs/plans/layering.yaml
  • docs/plans/topology-target.yaml
  • docs/test-quality-workflows.md
  • docs/topology-status.md
  • polylogue/__init__.py
  • polylogue/archive/conversation/attribution.py
  • polylogue/archive/conversation/extraction.py
  • polylogue/archive/filter/builder.py
  • polylogue/archive/models.py
  • polylogue/archive/phase/extraction.py
  • polylogue/archive/query/plan.py
  • polylogue/archive/query/plan_execution.py
  • polylogue/archive/query/retrieval_candidates.py
  • polylogue/archive/query/retrieval_search.py
  • polylogue/archive/query/runtime_filters.py
  • polylogue/archive/query/runtime_matching.py
  • polylogue/archive/query/sorting.py
  • polylogue/archive/query/spec.py
  • polylogue/archive/query/support.py
  • polylogue/archive/semantic/pricing.py
  • polylogue/archive/session/runtime.py
  • polylogue/cli/filter_picker.py
  • polylogue/cli/query.py
  • polylogue/cli/query_actions.py
  • polylogue/cli/query_contracts.py
  • polylogue/cli/query_output.py
  • polylogue/cli/query_output_contracts.py
  • polylogue/cli/query_semantic.py
  • polylogue/cli/query_stats.py
  • polylogue/lib/__init__.py
  • polylogue/mcp/payloads.py
  • polylogue/rendering/core_markdown.py
  • polylogue/rendering/formatting.py
  • polylogue/rendering/renderers/html.py
  • polylogue/rendering/renderers/html_messages.py
  • polylogue/storage/embeddings/materialization.py
  • polylogue/surfaces/payloads.py
  • tests/benchmarks/conftest.py
  • tests/benchmarks/test_pipeline.py
  • tests/conftest.py
  • tests/infra/builders.py
  • tests/infra/mcp.py
  • tests/infra/semantic_facts.py
  • tests/infra/strategies/messages.py
  • tests/infra/strategies/summaries.py
  • tests/integration/test_site.py
  • tests/integration/test_site_laws.py
  • tests/property/test_rendering_preservation.py
  • tests/unit/archive/test_query_runtime_filters.py
  • tests/unit/archive/test_query_search_runtime.py
  • tests/unit/archive/test_repo_identity.py
  • tests/unit/cli/test_bulk_export.py
  • tests/unit/cli/test_command_aux_runtime.py
  • tests/unit/cli/test_neighbors_command.py
  • tests/unit/cli/test_query_exec.py
  • tests/unit/cli/test_query_exec_laws.py
  • tests/unit/cli/test_query_fmt.py
  • tests/unit/cli/test_query_support_runtime.py
  • tests/unit/core/test_conversation_semantics.py
  • tests/unit/core/test_filters_props.py
  • tests/unit/core/test_message_laws.py
  • tests/unit/core/test_models.py
  • tests/unit/core/test_semantic_facts.py
  • tests/unit/core/test_version.py
  • tests/unit/devtools/test_topology_projection_witness.py
  • tests/unit/mcp/test_server_surfaces.py
  • tests/unit/mcp/test_tool_contracts.py
  • tests/unit/pipeline/test_branching.py
  • tests/unit/pipeline/test_concurrency_guards.py
  • tests/unit/rendering/test_output_snapshots.py
  • tests/unit/rendering/test_rendering.py
  • tests/unit/sources/test_null_guard_properties.py
  • tests/unit/sources/test_parsers_base.py
  • tests/unit/storage/test_session_product_profiles.py
  • tests/unit/storage/test_session_product_timeline_rows.py
  • tests/unit/test_mutmut_campaign.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/refactor/remove-lib-model-facade

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 39 minutes and 7 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented May 1, 2026

Copy link
Copy Markdown
Contributor

Polylogue Proof Pack

Refs: origin/master..HEAD
Changed paths: 0

Affected Domains

  • none

Required Gates

  • devtools verify --quick — full PR gate remains explicit
  • devtools verify — full PR gate remains explicit
  • devtools build-package — deployment readiness gate; run when packaging or release confidence matters
  • nix flake check — deployment readiness gate; run when packaging or release confidence matters

Known Gaps

  • none for affected domains

Oracle / Cost

  • oracle mix: {}
  • cost tier: {}
  • stale evidence: 0
  • manual review cells: 0

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes the remaining polylogue.lib namespace and consolidates the domain-model facade under polylogue.archive.models, aligning module vocabulary with the archive/core cleanup and the integrated naming policy.

Changes:

  • Added polylogue.archive.models as the canonical domain-model facade and deleted polylogue.lib.
  • Updated production code, tests, benchmarks, and docs to import domain models from polylogue.archive.models (or more precise archive modules).
  • Removed lib-root from topology/layering vocabulary and refreshed generated topology/status/quality docs accordingly.

Reviewed changes

Copilot reviewed 82 out of 83 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/unit/test_mutmut_campaign.py Updates mutation key namespace away from polylogue.lib.models.
tests/unit/storage/test_session_product_timeline_rows.py Switches Conversation import to polylogue.archive.models.
tests/unit/storage/test_session_product_profiles.py Switches Conversation import to polylogue.archive.models.
tests/unit/sources/test_parsers_base.py Switches DialoguePair/Message import to polylogue.archive.models.
tests/unit/sources/test_null_guard_properties.py Switches Conversation/ConversationSummary/Message import to polylogue.archive.models.
tests/unit/rendering/test_rendering.py Switches model imports to polylogue.archive.models.
tests/unit/rendering/test_output_snapshots.py Switches model imports to polylogue.archive.models.
tests/unit/pipeline/test_concurrency_guards.py Switches Conversation import to polylogue.archive.models.
tests/unit/pipeline/test_branching.py Switches Conversation import to polylogue.archive.models.
tests/unit/mcp/test_tool_contracts.py Switches model imports to polylogue.archive.models.
tests/unit/mcp/test_server_surfaces.py Switches model imports to polylogue.archive.models.
tests/unit/devtools/test_topology_projection_witness.py Removes lib-root from allowed owner vocabulary assertions.
tests/unit/core/test_version.py Removes polylogue.lib export/lazy-import tests now that lib is deleted.
tests/unit/core/test_semantic_facts.py Switches Conversation model imports to polylogue.archive.models.
tests/unit/core/test_models.py Switches Message import to polylogue.archive.models.
tests/unit/core/test_message_laws.py Switches model imports to polylogue.archive.models.
tests/unit/core/test_filters_props.py Switches ConversationSummary import to polylogue.archive.models.
tests/unit/core/test_conversation_semantics.py Switches model imports to polylogue.archive.models.
tests/unit/cli/test_query_support_runtime.py Switches ConversationSummary import to polylogue.archive.models.
tests/unit/cli/test_query_fmt.py Switches model imports to polylogue.archive.models.
tests/unit/cli/test_query_exec_laws.py Switches Conversation import and updates embedded file-path string to archive/models.py.
tests/unit/cli/test_query_exec.py Switches model imports to polylogue.archive.models.
tests/unit/cli/test_neighbors_command.py Switches ConversationSummary import to polylogue.archive.models.
tests/unit/cli/test_command_aux_runtime.py Switches ConversationSummary import to polylogue.archive.models.
tests/unit/cli/test_bulk_export.py Switches Conversation import to polylogue.archive.models.
tests/unit/archive/test_repo_identity.py Switches model imports to polylogue.archive.models.
tests/unit/archive/test_query_search_runtime.py Switches Conversation import to polylogue.archive.models.
tests/unit/archive/test_query_runtime_filters.py Switches model imports to polylogue.archive.models.
tests/property/test_rendering_preservation.py Switches model imports to polylogue.archive.models.
tests/integration/test_site_laws.py Switches ConversationSummary import to polylogue.archive.models.
tests/integration/test_site.py Switches ConversationSummary import to polylogue.archive.models.
tests/infra/strategies/summaries.py Switches ConversationSummary import to polylogue.archive.models.
tests/infra/strategies/messages.py Switches TYPE_CHECKING and runtime model imports to polylogue.archive.models.
tests/infra/semantic_facts.py Switches Conversation import to polylogue.archive.models.
tests/infra/mcp.py Switches Conversation import to polylogue.archive.models.
tests/infra/builders.py Updates docstring and switches model imports to polylogue.archive.models.
tests/conftest.py Switches Conversation import to polylogue.archive.models.
tests/benchmarks/test_pipeline.py Updates embedded file-path string to archive/models.py.
tests/benchmarks/conftest.py Updates embedded file-path string list to archive/models.py.
polylogue/surfaces/payloads.py Updates TYPE_CHECKING model imports to polylogue.archive.models.
polylogue/storage/embeddings/materialization.py Updates TYPE_CHECKING Conversation import to polylogue.archive.models.
polylogue/rendering/renderers/html_messages.py Updates TYPE_CHECKING Conversation import to polylogue.archive.models.
polylogue/rendering/renderers/html.py Updates TYPE_CHECKING Conversation import to polylogue.archive.models.
polylogue/rendering/formatting.py Updates TYPE_CHECKING Conversation import to polylogue.archive.models.
polylogue/rendering/core_markdown.py Updates TYPE_CHECKING Conversation import to polylogue.archive.models.
polylogue/mcp/payloads.py Updates TYPE_CHECKING Conversation import to polylogue.archive.models.
polylogue/lib/init.py Deletes the polylogue.lib package entrypoint and its lazy-export surface.
polylogue/cli/query_stats.py Updates TYPE_CHECKING model imports to polylogue.archive.models.
polylogue/cli/query_semantic.py Updates TYPE_CHECKING model imports to polylogue.archive.models.
polylogue/cli/query_output_contracts.py Updates TYPE_CHECKING Conversation import to polylogue.archive.models.
polylogue/cli/query_output.py Updates TYPE_CHECKING model imports to polylogue.archive.models.
polylogue/cli/query_contracts.py Updates TYPE_CHECKING model imports to polylogue.archive.models.
polylogue/cli/query_actions.py Updates TYPE_CHECKING model imports to polylogue.archive.models.
polylogue/cli/query.py Updates TYPE_CHECKING model imports to polylogue.archive.models.
polylogue/cli/filter_picker.py Updates TYPE_CHECKING Conversation import to polylogue.archive.models.
polylogue/archive/session/runtime.py Updates TYPE_CHECKING Conversation import to polylogue.archive.models.
polylogue/archive/semantic/pricing.py Updates TYPE_CHECKING model imports to polylogue.archive.models.
polylogue/archive/query/support.py Updates TYPE_CHECKING and runtime import to polylogue.archive.models.
polylogue/archive/query/spec.py Updates TYPE_CHECKING model imports to polylogue.archive.models.
polylogue/archive/query/sorting.py Updates TYPE_CHECKING model imports to polylogue.archive.models.
polylogue/archive/query/runtime_matching.py Updates TYPE_CHECKING Conversation import to polylogue.archive.models.
polylogue/archive/query/runtime_filters.py Updates TYPE_CHECKING Conversation import to polylogue.archive.models.
polylogue/archive/query/retrieval_search.py Updates TYPE_CHECKING Conversation import to polylogue.archive.models.
polylogue/archive/query/retrieval_candidates.py Updates TYPE_CHECKING model imports to polylogue.archive.models.
polylogue/archive/query/plan_execution.py Updates TYPE_CHECKING model imports to polylogue.archive.models.
polylogue/archive/query/plan.py Updates TYPE_CHECKING model imports to polylogue.archive.models.
polylogue/archive/phase/extraction.py Updates TYPE_CHECKING Conversation import to polylogue.archive.models.
polylogue/archive/models.py Adds the new canonical domain-model facade module under archive.
polylogue/archive/filter/builder.py Updates TYPE_CHECKING Conversation import to polylogue.archive.models.
polylogue/archive/conversation/extraction.py Updates TYPE_CHECKING Conversation import to polylogue.archive.models.
polylogue/archive/conversation/attribution.py Updates TYPE_CHECKING Conversation import to polylogue.archive.models.
polylogue/init.py Updates root docstring wording to reference polylogue.archive instead of polylogue.lib.
docs/topology-status.md Refreshes generated counts/vocabulary removing lib-root.
docs/test-quality-workflows.md Updates mutation campaign catalog path for models to polylogue/archive/models.py.
docs/plans/topology-target.yaml Adds polylogue/archive/models.py and removes polylogue/lib/* targets.
docs/plans/layering.yaml Removes the obsolete polylogue/lib layering rule block.
docs/library-api.md Updates public-surface bullet from polylogue.lib to polylogue.archive.
docs/architecture.md Updates primary module list to reference polylogue/archive/ instead of polylogue/lib/.
devtools/verify_topology.py Removes lib-root from recognized kernel owners.
devtools/verify_test_ownership.py Updates comment example from polylogue.lib to polylogue.archive.
devtools/render_topology_status.py Removes lib-root from primitives aggregation and output text.
devtools/mutation_scenario_catalog.py Updates the models campaign paths_to_mutate to polylogue/archive/models.py.
devtools/build_topology_projection.py Removes lib-targeting rules and classification logic now that polylogue/lib is gone.
Comments suppressed due to low confidence (1)

docs/plans/layering.yaml:26

  • Removing the polylogue/lib layering rule drops the only guard that prevented the archive-domain substrate from importing surface adapters (CLI/MCP/site/UI/rendering). Since the semantic substrate is now under polylogue/archive, consider adding an equivalent rule for polylogue/archive to keep devtools verify-layering enforcing the same architecture constraint going forward.
  - target: polylogue/api
    description: "API surface — adapter boundary over substrate and products."

  - target: polylogue/storage
    description: "Storage substrate must not import surface adapters."
    disallow:
      from: [polylogue/cli, polylogue/mcp, polylogue/site, polylogue/ui, polylogue/rendering]

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

name="models",
description="Message/Conversation semantic helpers and pairing logic",
paths_to_mutate=("polylogue/lib/models.py",),
paths_to_mutate=("polylogue/archive/models.py",),
| `hybrid` | `polylogue/storage/search_providers/hybrid.py` | `tests/unit/storage/test_hybrid.py`<br>`tests/unit/storage/test_hybrid_laws.py` | Hybrid search fusion and ranked-conversation resolution |
| `json` | `polylogue/core/json.py` | `tests/unit/core/test_json.py` | JSON serialization and parser laws |
| `models` | `polylogue/lib/models.py` | `tests/unit/core/test_models.py`<br>`tests/unit/core/test_message_laws.py`<br>`tests/unit/core/test_conversation_semantics.py` | Message/Conversation semantic helpers and pairing logic |
| `models` | `polylogue/archive/models.py` | `tests/unit/core/test_models.py`<br>`tests/unit/core/test_message_laws.py`<br>`tests/unit/core/test_conversation_semantics.py` | Message/Conversation semantic helpers and pairing logic |
Sinity added a commit that referenced this pull request May 7, 2026
## Summary
Remove the remaining `polylogue.lib` package and move its domain-model
facade to `polylogue.archive.models`.

## Problem
The integrated naming policy rejects compatibility shims and old import
aliases. After the archive/core cleanup series, `polylogue.lib` only
re-exported domain models. Keeping it would preserve a misleading
generic library namespace after all real owners had moved.

## Solution
- Rename `polylogue/lib/models.py` to `polylogue/archive/models.py`.
- Delete `polylogue/lib/__init__.py`, removing the `polylogue.lib`
package.
- Update production, test, benchmark, and generated quality references
to import `polylogue.archive.models` or precise archive modules.
- Remove `lib-root` from topology projection/rendering/verification
vocabulary.
- Remove the obsolete layering rule for `polylogue/lib`.
- Refresh generated topology/status/quality docs.

Ref #635

## Verification
- `devtools build-topology-projection && devtools verify-topology` —
realized=694 declared=694 blocking=False
- `ruff check polylogue/ tests/ devtools/` — all checks passed
- `mypy polylogue/` — no issues found in 694 source files
- `pytest -q tests/unit/core/test_version.py
tests/unit/core/test_models.py tests/unit/core/test_message_laws.py
tests/unit/core/test_conversation_semantics.py
tests/unit/cli/test_query_fmt.py tests/unit/mcp/test_tool_contracts.py
tests/unit/devtools/test_topology_projection_witness.py
tests/unit/test_mutmut_campaign.py` — 313 passed
- `devtools verify-layering && devtools verify-topology` — no layering
violations; realized=694 declared=694 blocking=False
- `devtools render-all --check` — sync OK
- pre-push `devtools verify --quick` — all checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants