Skip to content

refactor(core): move hashing utilities out of lib - #660

Merged
Sinity merged 1 commit into
masterfrom
feature/refactor/core-hashing-clean
May 1, 2026
Merged

Sinity merged 1 commit into
masterfrom
feature/refactor/core-hashing-clean

Conversation

@Sinity

@Sinity Sinity commented May 1, 2026

Copy link
Copy Markdown
Owner

Summary

Move shared hashing helpers from polylogue.lib.hashing to polylogue.core.hashing.

Problem

The hashing helpers are low-level primitives used by archive IDs, storage row IDs, browser capture artifact names, parser attachment IDs, and benchmarks. They are not generic catch-all lib code and should live with the new core primitive package introduced by #659.

Solution

Rename polylogue/lib/hashing.py to polylogue/core/hashing.py, update all imports and generated docs/topology references, 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/core/test_hashing.py tests/unit/pipeline/test_pipeline_ids.py tests/unit/storage/test_archive_search_contracts.py tests/benchmarks/test_pipeline.py — 84 passed
  • devtools render-all --check — sync OK
  • pre-push devtools verify --quick — all checks passed

Ref #635

Copilot AI review requested due to automatic review settings May 1, 2026 18:56
@coderabbitai

coderabbitai Bot commented May 1, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@Sinity has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 26 minutes and 58 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 222d837e-1f0e-4fcc-865b-aa3cb75574e9

📥 Commits

Reviewing files that changed from the base of the PR and between 2a4a824 and 9cfbb03.

📒 Files selected for processing (16)
  • devtools/build_topology_projection.py
  • docs/internals.md
  • docs/plans/campaign-coverage.yaml
  • docs/plans/topology-target.yaml
  • docs/topology-status.md
  • polylogue/archive/action_event/fields.py
  • polylogue/browser_capture/receiver.py
  • polylogue/core/hashing.py
  • polylogue/pipeline/ids.py
  • polylogue/sources/parsers/base_support.py
  • polylogue/sources/parsers/drive_support_attachments.py
  • polylogue/storage/products/session/timeline_rows.py
  • polylogue/storage/repository/archive/writes/conversations.py
  • polylogue/storage/runtime/archive/records.py
  • tests/benchmarks/test_pipeline.py
  • tests/unit/core/test_hashing.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/refactor/core-hashing-clean

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.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 26 minutes and 58 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@Sinity
Sinity merged commit a244f18 into master May 1, 2026
14 checks passed
@Sinity
Sinity deleted the feature/refactor/core-hashing-clean branch May 1, 2026 18:56
@github-actions

github-actions Bot commented May 1, 2026

Copy link
Copy Markdown
Contributor

Polylogue Proof Pack

Refs: origin/master..HEAD
Changed paths: 0

Affected Domains

  • none

Required Gates

  • devtools verify --quick — full PR gate remains explicit
  • devtools verify — full PR gate remains explicit
  • devtools build-package — deployment readiness gate; run when packaging or release confidence matters
  • nix flake check — deployment readiness gate; run when packaging or release confidence matters

Known Gaps

  • none for affected domains

Oracle / Cost

  • oracle mix: {}
  • cost tier: {}
  • stale evidence: 0
  • manual review cells: 0

Copilot AI left a comment

Copy link
Copy Markdown

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 continues the ongoing “core primitive” extraction by relocating shared hashing helpers from polylogue.lib into polylogue.core, updating runtime/tests/docs/tooling so hashing primitives are treated as low-level core utilities.

Changes:

  • Introduces polylogue.core.hashing (SHA-256 helpers) and removes usage of polylogue.lib.hashing (no shim).
  • Updates all Python imports across pipeline, storage, parsers, browser capture, action-event extraction, and tests to the new core path.
  • Refreshes topology/coverage docs and devtools topology projection rules to classify hashing as a core-primitive.

Reviewed changes

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

Show a summary per file
File Description
tests/unit/core/test_hashing.py Switches hashing imports to polylogue.core.hashing.
tests/benchmarks/test_pipeline.py Benchmarks now import hashing helpers from polylogue.core.hashing.
polylogue/storage/runtime/archive/records.py Updates hashing import for archive runtime record logic.
polylogue/storage/repository/archive/writes/conversations.py Updates hashing import used in content-hash computation for writes.
polylogue/storage/products/session/timeline_rows.py Updates hashing import for session timeline row IDs.
polylogue/sources/parsers/drive_support_attachments.py Updates hashing imports used for deterministic attachment IDs.
polylogue/sources/parsers/base_support.py Updates hashing import used in parser support helpers.
polylogue/pipeline/ids.py Updates hashing imports used for core pipeline ID/content-hash generation.
polylogue/core/hashing.py New core primitive module implementing hashing helpers.
polylogue/browser_capture/receiver.py Updates hashing import used for browser capture artifact naming.
polylogue/archive/action_event/fields.py Updates hashing import used for action event ID generation.
docs/topology-status.md Updates rendered topology counts for core-primitive and primitives summary.
docs/plans/topology-target.yaml Moves hashing file ownership from lib-root to core-primitive.
docs/plans/campaign-coverage.yaml Updates mutation campaign coverage target from old hashing path to new.
docs/internals.md Updates internal reference to hashing implementation location.
devtools/build_topology_projection.py Removes hashing.py from LIB_ROOT_PRIMITIVES to reflect the move.

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

Sinity added a commit that referenced this pull request May 7, 2026
## Summary

Move shared hashing helpers from `polylogue.lib.hashing` to
`polylogue.core.hashing`.

## Problem

The hashing helpers are low-level primitives used by archive IDs,
storage row IDs, browser capture artifact names, parser attachment IDs,
and benchmarks. They are not generic catch-all `lib` code and should
live with the new core primitive package introduced by #659.

## Solution

Rename `polylogue/lib/hashing.py` to `polylogue/core/hashing.py`, update
all imports and generated docs/topology references, 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/core/test_hashing.py
tests/unit/pipeline/test_pipeline_ids.py
tests/unit/storage/test_archive_search_contracts.py
tests/benchmarks/test_pipeline.py` — 84 passed
- `devtools render-all --check` — sync OK
- pre-push `devtools verify --quick` — all checks passed

Ref #635
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.

2 participants