Skip to content

Preserve evidence offsets across CJK line wraps - #87

Merged
EonHao merged 2 commits into
Juneo-Lab:mainfrom
Golden007-prog:fix/78-cjk-quote-matching
Nov 22, 2026
Merged

EonHao merged 2 commits into
Juneo-Lab:mainfrom
Golden007-prog:fix/78-cjk-quote-matching

Conversation

@Golden007-prog

Copy link
Copy Markdown
Contributor

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

  • The original implementation failed both reported CJK cases and the normalized ambiguity check. The final six targeted regressions pass.
  • pytest --cov=decision_forge --cov-fail-under=80: 354 passed, 4 optional-adapter/OCR tests skipped, 87.87% coverage.
  • Ruff lint and format, mypy, and strict MkDocs build passed.

AI assistance was used to implement and validate the change. Test evidence is fictional and all checks ran locally.

@github-actions github-actions Bot added area/compiler Ingestion, extraction, evidence binding, review gates area/docs Site, README, and reference material labels Nov 16, 2026
# Conflicts:
#	CHANGELOG.md

@EonHao EonHao left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 main and pass here. The full suite, Ruff, mypy, and mkdocs build --strict pass 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.

@EonHao
EonHao merged commit 9aef703 into Juneo-Lab:main Nov 22, 2026
16 checks passed
EonHao added a commit that referenced this pull request Nov 22, 2026
@EonHao EonHao mentioned this pull request Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/compiler Ingestion, extraction, evidence binding, review gates area/docs Site, README, and reference material

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Match Chinese evidence quotes across line breaks from text extraction

2 participants