Repository navigation
Preserve evidence offsets across CJK line wraps - #87
Merged
Merged
Conversation
This was referenced Nov 22, 2026
# Conflicts: # CHANGELOG.md
EonHao
approved these changes
Nov 22, 2026
EonHao
left a comment
Contributor
There was a problem hiding this comment.
Thanks, @Golden007-prog. Approving.
What I checked:
- Whitespace next to a Chinese or Japanese character drops out during matching, while the returned span still covers the original text, so offsets and source hashes are unchanged.
- A quote cannot invent whitespace: a quote with a space inside an unbroken CJK run still fails, and English quotes still need their spaces.
- A quote that becomes ambiguous after eliding wraps is still rejected.
- Validation, compilation, and corpus claims now share one rule through
evidence_quote_matches. - The new compiler tests fail on
mainand pass here. The full suite, Ruff, mypy, andmkdocs build --strictpass locally with this branch merged together with #86 and #88.
I merged main into this branch to resolve a CHANGELOG.md conflict with #86; both entries are kept and no code changed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Match evidence quotes across whitespace runs adjacent to Chinese or Japanese characters. The source-offset map still points to the original span, and the source hash is unchanged. The same matching rule applies to provided spans in validation, compilation, and corpus claims. Existing English and Korean word spacing and ambiguous-match rejection are preserved. A quote with whitespace missing at that location in the source still fails.
Closes #78.
Validation
pytest --cov=decision_forge --cov-fail-under=80: 354 passed, 4 optional-adapter/OCR tests skipped, 87.87% coverage.AI assistance was used to implement and validate the change. Test evidence is fictional and all checks ran locally.