feat(utils): add source-span resolver for claim-packet provenance#117
Conversation
Pure utility that verifies a claim's quote against its source text and resolves the exact character span it occupies. This is the provenance invariant for future source-backed claim packets: a quote must be present in the source (anchored to chunks.content, not raw_content, since the chunker normalizes/trims before computing offsets) before any claim is stored. - resolveSourceSpan / isQuoteSupported / requireSourceSpan - exact case-sensitive matching by default; opt-in whitespace-normalized matching that still maps offsets back to the original source - requireSourceSpan throws ValidationError on unsupported quotes - 24 unit tests covering exact/normalized/unicode/rejection paths No schema, DB, tool, API, dashboard, search, or LLM changes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018uJvN394ihHqDRUkWjPh7H
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughA new 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Pure utility that verifies a claim's quote against its source text and
resolves the exact character span it occupies. This is the provenance
invariant for future source-backed claim packets: a quote must be present
in the source (anchored to chunks.content, not raw_content, since the
chunker normalizes/trims before computing offsets) before any claim is
stored.
matching that still maps offsets back to the original source
No schema, DB, tool, API, dashboard, search, or LLM changes.
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_018uJvN394ihHqDRUkWjPh7H