[codex] Model template links as secondary artifacts#95
Open
brendan-m-murphy wants to merge 2 commits into
Open
[codex] Model template links as secondary artifacts#95brendan-m-murphy wants to merge 2 commits into
brendan-m-murphy wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR moves template-link replica creation into the add-operation runner as ordered secondary artifact operations, keeping Catalog focused on facade responsibilities while centralizing add lifecycle orchestration.
Changes:
- Adds a secondary artifact operation interface and template-link implementation.
- Updates
AddOperationRunnerandCatalogApplicationto schedule and run secondary artifacts. - Removes older Catalog-owned template replica/post-processing paths and updates tests/docs.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/ogcat/secondary_artifacts.py |
Adds secondary artifact result/protocol and template-link operation. |
src/ogcat/operation_runner.py |
Runs secondary artifact operations after record staging and applies metadata/audit updates. |
src/ogcat/catalog_application.py |
Schedules template-link secondary operations for UUID-primary managed files. |
src/ogcat/catalog.py |
Removes older Catalog-local template replica and add wrapper helpers. |
tests/test_replicas.py |
Adds direct coverage for template-link secondary artifact materialization/rollback. |
tests/test_add_operation_lifecycle.py |
Verifies secondary operation scheduling for UUID vs template primaries. |
docs/architecture.md |
Documents secondary artifact operations in the runner lifecycle. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+48
to
+51
| @property | ||
| def required(self) -> bool: | ||
| """Whether operation failure should fail the add operation.""" | ||
| ... |
Comment on lines
+97
to
+103
| naming_metadata_updates={ | ||
| "template_replica_path": str(materialized.target_path), | ||
| "template_replica_relative_path": materialized.catalog_relative_path, | ||
| "template_replica_storage_relative_path": materialized.storage_relative_path, | ||
| "template_resolved_directory": materialized.resolved_directory, | ||
| "template_resolved_filename": materialized.resolved_filename, | ||
| }, |
Comment on lines
+446
to
+450
| persisted = self._run_secondary_artifacts( | ||
| add_plan=add_plan, | ||
| record=persisted, | ||
| set_phase=set_phase, | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
record_post_processorcallback with ordered secondary artifact operations coordinated byAddOperationRunner.Catalog._create_template_link_replicaand the unused private_run_add_operationwrapper.Architecture Checkpoint
Catalogno longer materializes template links directly.CatalogApplicationdecides which required secondary operations are needed for UUID-primary managed files.AddOperationRunnerowns the order: primary record staging, secondary artifact operations,after_record_write, then commit.template_replica_*andtemplate_resolved_*fields.Tests
uv run ruff check src/ogcat/secondary_artifacts.py src/ogcat/operation_runner.py src/ogcat/catalog_application.py src/ogcat/catalog.py tests/test_add_operation_lifecycle.py tests/test_replicas.pyuv run ruff format --check src/ogcat/secondary_artifacts.py src/ogcat/operation_runner.py src/ogcat/catalog_application.py src/ogcat/catalog.py tests/test_add_operation_lifecycle.py tests/test_replicas.pyuv run pyright src/ogcat/secondary_artifacts.py src/ogcat/operation_runner.py src/ogcat/catalog_application.py src/ogcat/catalog.pyuv run pytest tests/test_add_operation_lifecycle.py tests/test_replicas.py tests/test_add.py tests/test_hooks.py -quv run pytestReview agent also inspected rollback/order risks and found no issues.