Repository navigation
refactor(archive): move action events out of lib - #638
Conversation
📝 WalkthroughWalkthroughThis PR relocates the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related issues
Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Review rate limit: 0/1 reviews remaining, refill in 60 minutes.Comment |
Polylogue Proof PackRefs: Affected Domains
Required Gates
Known Gaps
Oracle / Cost
|
There was a problem hiding this comment.
Pull request overview
Moves archive-domain action-event semantics out of the generic polylogue/lib area into the archive domain boundary (polylogue/archive), aligning package placement with the architecture cleanup tracked in #635.
Changes:
- Relocated action-event semantics to
polylogue/archive/action_event/and updated all Python imports accordingly. - Updated tests that embed path-bearing tool-call commands to reference the new module path.
- Updated topology ownership/projection inputs to reflect the new package location.
Reviewed changes
Copilot reviewed 22 out of 24 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/storage/test_fts5.py | Updates embedded command string to new archive action-event path. |
| tests/unit/sources/test_tool_aliases.py | Updates import for canonical_tool_name to archive action-event package. |
| tests/unit/core/test_repo_identity.py | Updates ActionEvent import to archive action-event package. |
| tests/unit/cli/test_query_support_runtime.py | Updates ActionEvent import to archive action-event package. |
| tests/unit/cli/test_query_exec.py | Updates embedded command string to new archive action-event path. |
| tests/unit/archive/test_query_runtime_matching.py | Updates ActionEvent import to archive action-event package. |
| polylogue/storage/repository/action/reads.py | Updates ActionEvent import used by storage repository reads. |
| polylogue/storage/action_events/rows.py | Updates imports for action-event hydration/building to archive package. |
| polylogue/protocols.py | Updates TYPE_CHECKING ActionEvent import for protocol typing. |
| polylogue/products/resume.py | Updates import for tool-call normalization helper to archive package. |
| polylogue/pipeline/services/ingest_worker.py | Updates TYPE_CHECKING and runtime imports for action-event building during ingest. |
| polylogue/lib/semantic/support.py | Updates tool-call extraction import to archive package. |
| polylogue/lib/semantic/models.py | Updates ActionEvent import to archive package. |
| polylogue/lib/semantic/facts.py | Updates ActionEvent/builder imports to archive package. |
| polylogue/lib/conversation/attribution.py | Updates ActionEvent import to archive package. |
| polylogue/cli/query_stats.py | Updates TYPE_CHECKING ActionEvent import to archive package. |
| polylogue/cli/query_semantic.py | Updates TYPE_CHECKING ActionEvent import to archive package. |
| polylogue/archive/query/runtime_matching.py | Updates TYPE_CHECKING ActionEvent import to archive package. |
| polylogue/archive/action_event/parsing.py | Adds parsing/normalization helpers under the new archive action-event package. |
| polylogue/archive/action_event/fields.py | Updates helper import to reference new archive-local parsing module. |
| polylogue/archive/action_event/action_events.py | Updates imports to archive-local fields/parsing modules and re-exports tool-call builder. |
| polylogue/archive/action_event/init.py | Introduces the new archive action-event package marker. |
| docs/plans/topology-target.yaml | Reassigns topology ownership entries from lib action-event to archive action-event. |
| devtools/build_topology_projection.py | Updates topology projection rules to map action-event modules to archive ownership. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@devtools/build_topology_projection.py`:
- Line 210: The new mapping ("polylogue/archive/action_event/",
"archive-action-event") is never matched because classify() has a generic branch
that routes all "polylogue/archive/*" to owner "stable" before the specific
entry is considered; update classify() so the specific prefix for
"polylogue/archive/action_event/" is checked before the generic
"polylogue/archive/" rule (or move the tuple into the earlier/more-specific
mapping list used by classify()). Ensure you reference the tuple
("polylogue/archive/action_event/", "archive-action-event") and the classify()
function when making the change so the specific owner takes precedence over the
generic archive branch.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 5f0feaac-03c7-414c-967a-3dc7a6532227
📒 Files selected for processing (24)
devtools/build_topology_projection.pydocs/plans/topology-target.yamlpolylogue/archive/action_event/__init__.pypolylogue/archive/action_event/action_events.pypolylogue/archive/action_event/fields.pypolylogue/archive/action_event/parsing.pypolylogue/archive/query/runtime_matching.pypolylogue/cli/query_semantic.pypolylogue/cli/query_stats.pypolylogue/lib/conversation/attribution.pypolylogue/lib/semantic/facts.pypolylogue/lib/semantic/models.pypolylogue/lib/semantic/support.pypolylogue/pipeline/services/ingest_worker.pypolylogue/products/resume.pypolylogue/protocols.pypolylogue/storage/action_events/rows.pypolylogue/storage/repository/action/reads.pytests/unit/archive/test_query_runtime_matching.pytests/unit/cli/test_query_exec.pytests/unit/cli/test_query_support_runtime.pytests/unit/core/test_repo_identity.pytests/unit/sources/test_tool_aliases.pytests/unit/storage/test_fts5.py
| ("polylogue/lib/raw_payload/", "lib-raw-payload"), | ||
| ("polylogue/lib/artifact_taxonomy/", "lib-artifact-taxonomy"), | ||
| ("polylogue/lib/action_event/", "lib-action-event"), | ||
| ("polylogue/archive/action_event/", "archive-action-event"), |
There was a problem hiding this comment.
archive-action-event owner mapping is currently unreachable.
You added ("polylogue/archive/action_event/", "archive-action-event"), but classify() still routes all polylogue/archive/* files to owner: "stable" in the generic archive branch, so this new owner never takes effect.
Proposed fix
@@
- elif rel.startswith("polylogue/archive/"):
+ elif rel.startswith("polylogue/archive/action_event/"):
+ target = rel
+ owner = "archive-action-event"
+ reason = "archive-domain action-event semantics"
+ elif rel.startswith("polylogue/archive/"):
target = rel
owner = "stable"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@devtools/build_topology_projection.py` at line 210, The new mapping
("polylogue/archive/action_event/", "archive-action-event") is never matched
because classify() has a generic branch that routes all "polylogue/archive/*" to
owner "stable" before the specific entry is considered; update classify() so the
specific prefix for "polylogue/archive/action_event/" is checked before the
generic "polylogue/archive/" rule (or move the tuple into the
earlier/more-specific mapping list used by classify()). Ensure you reference the
tuple ("polylogue/archive/action_event/", "archive-action-event") and the
classify() function when making the change so the specific owner takes
precedence over the generic archive branch.
## Summary Move archive-domain action-event semantics from `polylogue/lib/action_event/` to `polylogue/archive/action_event/`. ## Problem Action-event extraction and tool-call normalization describe archive meaning, but the old `lib` path kept that domain semantics in the generic utility bucket. This is part of the cleanup tracked in #635 to make names and placement match the product architecture. ## Solution Renamed the action-event semantic package into `polylogue/archive/action_event/`, updated all imports and path-bearing tests, and adjusted topology ownership from `lib-action-event` to `archive-action-event`. Storage action-event persistence remains in `polylogue/storage/action_events/`. ## Verification - `pytest -q tests/unit/sources/test_tool_aliases.py tests/unit/archive/test_query_runtime_matching.py tests/unit/core/test_repo_identity.py tests/unit/cli/test_query_support_runtime.py tests/unit/storage/test_fts5.py tests/unit/storage/test_store_ops.py` -> 142 passed - `devtools verify-topology` -> `realized=697 declared=697 blocking=False` - `devtools render-all --check` -> generated surfaces in sync - `ruff check polylogue/archive/action_event polylogue/archive/query/runtime_matching.py polylogue/cli/query_semantic.py polylogue/cli/query_stats.py polylogue/pipeline/services/ingest_worker.py polylogue/storage/action_events/rows.py polylogue/storage/repository/action/reads.py tests/unit/archive/test_query_runtime_matching.py tests/unit/cli/test_query_support_runtime.py tests/unit/core/test_repo_identity.py tests/unit/sources/test_tool_aliases.py tests/unit/storage/test_fts5.py` -> all checks passed - push hook `devtools verify --quick` -> all checks passed Ref #635 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Refactor** * Reorganized internal module structure by relocating action-event components to a new location. Updated all associated import paths throughout the codebase and corresponding test files to reference the new structure. All functionality remains unchanged. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Summary
Move archive-domain action-event semantics from
polylogue/lib/action_event/topolylogue/archive/action_event/.Problem
Action-event extraction and tool-call normalization describe archive meaning, but the old
libpath kept that domain semantics in the generic utility bucket. This is part of the cleanup tracked in #635 to make names and placement match the product architecture.Solution
Renamed the action-event semantic package into
polylogue/archive/action_event/, updated all imports and path-bearing tests, and adjusted topology ownership fromlib-action-eventtoarchive-action-event. Storage action-event persistence remains inpolylogue/storage/action_events/.Verification
pytest -q tests/unit/sources/test_tool_aliases.py tests/unit/archive/test_query_runtime_matching.py tests/unit/core/test_repo_identity.py tests/unit/cli/test_query_support_runtime.py tests/unit/storage/test_fts5.py tests/unit/storage/test_store_ops.py-> 142 passeddevtools verify-topology->realized=697 declared=697 blocking=Falsedevtools render-all --check-> generated surfaces in syncruff check polylogue/archive/action_event polylogue/archive/query/runtime_matching.py polylogue/cli/query_semantic.py polylogue/cli/query_stats.py polylogue/pipeline/services/ingest_worker.py polylogue/storage/action_events/rows.py polylogue/storage/repository/action/reads.py tests/unit/archive/test_query_runtime_matching.py tests/unit/cli/test_query_support_runtime.py tests/unit/core/test_repo_identity.py tests/unit/sources/test_tool_aliases.py tests/unit/storage/test_fts5.py-> all checks passeddevtools verify --quick-> all checks passedRef #635
Summary by CodeRabbit