Skip to content

[PR Feedback] Content Hashing & Normalization #63

Description

@tinkermonkey

Based on consolidated PR review, address the following in Content Hashing & Normalization:

  • Inconsistent Whitespace Normalization Between Differ and compute_chunk_hash: Differ._normalize() at src/context_library/core/differ.py:38 applies text.strip() and [ \t]+ regex, while compute_chunk_hash() at src/context_library/storage/models.py:226-233 does not strip leading/trailing whitespace and uses \s+ regex. This divergence means Differ can consider documents "unchanged" while chunk hashes differ, causing the pipeline to skip re-indexing at pipeline.py:117-121 with stale data in the database.
  • Context Header Prepended to Chunk content Field: In src/context_library/domains/notes.py:85-87, the Chunk.content field stores context_header + "\n\n" + content, merging the two. The architecture spec keeps content and context_header separate, with the header only merged for embedding. The Chunk model has a dedicated context_header field that becomes redundant when both are baked into content.

Created by PR Review Stage - Consolidation Phase


Concurrent Fix Issues (Same Review Cycle)

The following issues are being fixed simultaneously in this review cycle. Check these issues for any files they modify before making your own changes to avoid introducing conflicts:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions