Repository navigation
refactor(core): move path security helper out of lib - #662
Conversation
|
Warning Rate limit exceeded
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 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 configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (8)
✨ 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. Review rate limit: 0/1 reviews remaining, refill in 14 minutes and 27 seconds.Comment |
Polylogue Proof PackRefs: Affected Domains
Required Gates
Known Gaps
Oracle / Cost
|
There was a problem hiding this comment.
Pull request overview
Moves the sanitize_path security primitive out of polylogue.lib and into polylogue.core, updating imports and topology/security documentation to reflect the new core boundary placement.
Changes:
- Introduce
polylogue/core/security.pycontainingsanitize_pathand update parser/storage/test imports. - Update topology projection inputs/outputs to reflect the new module location and ownership.
- Refresh security/privacy coverage docs to point at the new implementation path.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/security/test_path_sanitization.py | Updates test import to polylogue.core.security.sanitize_path. |
| polylogue/storage/runtime/archive/records.py | Updates attachment path validator helper import to core security module. |
| polylogue/sources/parsers/base_models.py | Updates parser model path validator helper import to core security module. |
| polylogue/core/security.py | New core location for sanitize_path. |
| docs/topology-status.md | Updates rendered topology counts after moving security primitive. |
| docs/plans/topology-target.yaml | Reassigns security.py from lib-root to core-primitive. |
| docs/plans/security-privacy-coverage.yaml | Updates coverage reference from lib to core security module. |
| devtools/build_topology_projection.py | Removes security.py from lib-root primitive keep-set. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
## Summary Move `sanitize_path` from `polylogue.lib.security` to `polylogue.core.security`. ## Problem The path sanitizer is a low-level safety primitive used by parser and storage models. Keeping it under the catch-all `lib` root made security policy look like miscellaneous library code rather than core boundary logic. ## Solution Rename `polylogue/lib/security.py` to `polylogue/core/security.py`, update parser/storage/test references and security coverage docs, refresh topology, and keep no old-path shim. ## Verification - `devtools build-topology-projection && devtools verify-topology` — realized=697 declared=697 blocking=False - `ruff check polylogue/ tests/ devtools/` — all checks passed - `mypy polylogue/` — no issues found in 697 source files - `pytest -q tests/unit/security/test_path_sanitization.py tests/unit/sources/test_parsers_base.py` — 108 passed - `devtools render-all --check` — sync OK - pre-push `devtools verify --quick` — all checks passed Note: an earlier broader test batch including `tests/unit/storage/test_backend.py` was terminated after hanging in `test_async_read_connection_closes_cleanly_after_pool_teardown`; that test is unrelated to this import relocation and the directly affected security/parser suite passed. Ref #635
Summary
Move
sanitize_pathfrompolylogue.lib.securitytopolylogue.core.security.Problem
The path sanitizer is a low-level safety primitive used by parser and storage models. Keeping it under the catch-all
libroot made security policy look like miscellaneous library code rather than core boundary logic.Solution
Rename
polylogue/lib/security.pytopolylogue/core/security.py, update parser/storage/test references and security coverage docs, refresh topology, and keep no old-path shim.Verification
devtools build-topology-projection && devtools verify-topology— realized=697 declared=697 blocking=Falseruff check polylogue/ tests/ devtools/— all checks passedmypy polylogue/— no issues found in 697 source filespytest -q tests/unit/security/test_path_sanitization.py tests/unit/sources/test_parsers_base.py— 108 passeddevtools render-all --check— sync OKdevtools verify --quick— all checks passedNote: an earlier broader test batch including
tests/unit/storage/test_backend.pywas terminated after hanging intest_async_read_connection_closes_cleanly_after_pool_teardown; that test is unrelated to this import relocation and the directly affected security/parser suite passed.Ref #635