Repository navigation
refactor(storage): group storage by ownership domain (#425) - #538
Conversation
|
Important Review skippedToo many files! This PR contains 242 files, which is 92 over the limit of 150. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (242)
You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 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. Comment |
Problem: polylogue/storage/ was a flat catch-all of 90+ modules with ownership conveyed only by filename prefix (action_event_*, repository_*, store_*, search_*, etc). #425 declares a domain-grouped target shape; verify-topology lint had been carrying the manifest in soft mode. Solution: 63 moves per docs/plans/topology-target.yaml. action_event_*.py -> storage/action_events/ artifact_*.py -> storage/artifacts/ derived_status*.py -> storage/derived/ embedding_stats*.py -> storage/embeddings/ fts_lifecycle*.py -> storage/fts/ raw_ingest_*.py, raw_state_*.py -> storage/raw/ search.py, search_*.py -> storage/search/ store.py, store_runtime_*, store_constants -> storage/runtime/ store_product_*, session_product_* -> storage/products/{aggregate,session,timeline}/ product_read_support.py -> storage/products/ repository.py, repository_* -> storage/repository/{archive,product,action,raw,vectors}/ Notes: - Fixed build_topology_projection bug where exact-filename keys with full-path values (e.g. `repository.py: storage/repository/__init__.py`) produced concatenated nonsense like `__init__.pyrepository.py`. Refactored shared `_apply_rule` helper for both lib and storage. - Relative imports in moved files were re-anchored to the OLD parent package (polylogue.storage), then mapped through the move table — files like search/runtime.py now use absolute imports for cross- cluster references. - polylogue/storage/index.py stayed at storage/ root but its `from .X` imports referenced moved siblings; rewritten to absolute. - Two #425 xfail-strict invariants flip to normal asserts: test_storage_has_products_session_subpackage, test_no_session_product_at_storage_root. Verification: devtools build-topology-projection # 663 rows; #425 cells absorbed into 'stable' devtools verify-topology # realized=663 declared=663 blocking=False devtools verify-cross-cuts # cross-cut tags: clean devtools verify-cluster-cohesion # 42 cycles (= master baseline 43; no new cycles) devtools render-all --check # sync OK mypy polylogue # Success: no issues found in 663 source files pytest -q --ignore=tests/integration # 5615 passed, 7 xfailed # 1 flake on test_tui::test_search_empty_db # (passes on rerun; unrelated) Closes #425 Co-Authored-By: Claude <[email protected]>
2ff0710 to
1f5dd72
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
## Summary - Regroup `polylogue/storage/` modules by ownership domain (archive/products/sessions/repository) per topology projection (#425). ## Problem `polylogue/storage/` had grown to ~80 flat-laid modules — repository/products/backends/sessions intermingled. Topology projection (`docs/plans/topology-target.yaml`) declares ownership-domain clusters; the realized tree didn't match. ## Solution 63 file moves grouping by domain. Imports rewritten via topology-driven AST renamer. Verified via `verify-topology`, `verify-cluster-cohesion`, `verify-test-ownership`. ## Verification - `devtools verify --quick` — green (format, lint, mypy, render-all, all 5 topology lints). - Local `pytest -q --ignore=tests/integration` — all green prior to push. Stacked on #535 (merged). Replaces closed #536 after `--delete-branch` cascade closed it. Closes #425 Co-authored-by: Claude <[email protected]>
Summary
polylogue/storage/modules by ownership domain (archive/products/sessions/repository) per topology projection (refactor(storage): group storage by ownership domain #425).Problem
polylogue/storage/had grown to ~80 flat-laid modules — repository/products/backends/sessions intermingled. Topology projection (docs/plans/topology-target.yaml) declares ownership-domain clusters; the realized tree didn't match.Solution
63 file moves grouping by domain. Imports rewritten via topology-driven AST renamer. Verified via
verify-topology,verify-cluster-cohesion,verify-test-ownership.Verification
devtools verify --quick— green (format, lint, mypy, render-all, all 5 topology lints).pytest -q --ignore=tests/integration— all green prior to push.Stacked on #535 (merged). Replaces closed #536 after
--delete-branchcascade closed it.Closes #425