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:
Based on consolidated PR review, address the following in Content Hashing & Normalization:
Differ._normalize()atsrc/context_library/core/differ.py:38appliestext.strip()and[ \t]+regex, whilecompute_chunk_hash()atsrc/context_library/storage/models.py:226-233does 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 atpipeline.py:117-121with stale data in the database.contentField: Insrc/context_library/domains/notes.py:85-87, theChunk.contentfield storescontext_header + "\n\n" + content, merging the two. The architecture spec keepscontentandcontext_headerseparate, with the header only merged for embedding. TheChunkmodel has a dedicatedcontext_headerfield that becomes redundant when both are baked intocontent.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: