Skip to content

Clarify replica module boundaries#104

Merged
brendan-m-murphy merged 1 commit into
mainfrom
codex/89-replica-interface-cleanup
May 17, 2026
Merged

Clarify replica module boundaries#104
brendan-m-murphy merged 1 commit into
mainfrom
codex/89-replica-interface-cleanup

Conversation

@brendan-m-murphy
Copy link
Copy Markdown
Contributor

Summary

  • Split generated replica view planning from default template-link materialization.
  • Added internal replica context/type/link modules and moved template-link symlink materialization into ogcat.template_replicas.
  • Moved tests toward owning interfaces: plan_replica_view, TemplateLinkSecondaryArtifact, and materialize_template_link_replica.
  • Updated internal API docs to show the secondary-artifact/template-replica boundary.

Architecture checkpoint

ogcat.replicas now focuses on generated replica view planning and application. Required template-link secondary artifacts depend on ogcat.template_replicas directly, so secondary materialization no longer hangs off the generated-view module. Catalog.plan_view() remains as the public facade smoke path.

Closes #89.

Checks

  • uv run ruff check src/ogcat/replicas.py src/ogcat/secondary_artifacts.py src/ogcat/replica_context.py src/ogcat/replica_links.py src/ogcat/replica_types.py src/ogcat/template_replicas.py tests/test_add.py tests/test_replicas.py tests/test_secondary_artifacts.py tests/test_template_replicas.py
  • uv run ruff format --check src/ogcat/replicas.py src/ogcat/secondary_artifacts.py src/ogcat/replica_context.py src/ogcat/replica_links.py src/ogcat/replica_types.py src/ogcat/template_replicas.py tests/test_add.py tests/test_replicas.py tests/test_secondary_artifacts.py tests/test_template_replicas.py
  • uv run pyright
  • uv run pytest
  • uv run sphinx-build -b html docs docs/_build/html

@brendan-m-murphy brendan-m-murphy marked this pull request as ready for review May 17, 2026 19:32
Copilot AI review requested due to automatic review settings May 17, 2026 19:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR cleans up the boundary between generated replica view planning and required template-link secondary-artifact materialization in ogcat. It splits ogcat.replicas into smaller modules — replica_types, replica_links, replica_context, and template_replicas — and re-homes the corresponding tests at the interfaces that now own each behavior.

Changes:

  • Extract ReplicaMode/ReplicaRole, symlink helpers, replica template context, and template-link materialization into dedicated internal modules.
  • Update secondary_artifacts and test_add monkeypatch paths to point at ogcat.template_replicas; keep ogcat.replicas focused on generated view planning.
  • Move template-link tests into tests/test_template_replicas.py and tests/test_secondary_artifacts.py, and rewrite tests/test_replicas.py against the lower-level plan_replica_view interface.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/ogcat/replicas.py Slim down to view planning; delegate context/symlink/types to new modules.
src/ogcat/replica_types.py New module hosting ReplicaMode/ReplicaRole literals.
src/ogcat/replica_links.py New module with relative_symlink_target and symlink_points_to.
src/ogcat/replica_context.py New module with replica_template_context and original-name helper.
src/ogcat/template_replicas.py New module owning materialize_template_link_replica and its dataclass.
src/ogcat/secondary_artifacts.py Re-route imports to replica_types and template_replicas.
tests/test_template_replicas.py New direct tests for materialize_template_link_replica.
tests/test_secondary_artifacts.py New tests for TemplateLinkSecondaryArtifact via the catalog transaction.
tests/test_replicas.py Switch from catalog.plan_view to plan_replica_view; drop template-link test.
tests/test_add.py Update monkeypatch targets to ogcat.template_replicas.render_storage_location.
docs/api/replicas.rst Remove the now-internal replica_template_context autofunction entry.
docs/api/internals.rst Document the new internal modules.

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

@brendan-m-murphy brendan-m-murphy merged commit 063cc25 into main May 17, 2026
4 checks passed
@brendan-m-murphy brendan-m-murphy deleted the codex/89-replica-interface-cleanup branch May 17, 2026 21:30
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.

Clarify replica modules and interface-focused tests

2 participants