fix(chunks): 恢复未编辑分块的按位置合并 - #2555
Merged
Merged
Conversation
- Feature contracts: trusted pairs trim overlaps, join adjacent chunks seamlessly, and stay separate across position gaps. - Safety contracts: never drop current content on coordinates alone.
Chunk editing made parser coordinates unreliable, so all merges were downgraded to pure text matching, including unedited documents. Restore position-aware merging for pairs whose coordinates are still trustworthy, and keep the text fallback for edited or stale content so it is never dropped on coordinates.
Contributor
Author
|
稍等,发现个问题…… |
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.
Description
背景:为了支持“编辑分块”,上游把检索结果的合并逻辑从“按位置”改成了“按文本匹配”,本意是防编辑后位置失效,代价是没编辑过的文档也一起降级。因此会存在三种问题:
\n\n连在一起改动:只对位置可信的分块恢复按位置合并,其余情况保持现有文本匹配。
types.SearchResult新增内部字段ContentRevisionruneLen(Content) == EndAt-StartAt),若满足则按位置合并Type of Change
Related Issue
Testing
新增
merge_position_path_test.goChecklist
git diff --check origin/main...HEADpassesgolangci-lint run --new-from-rev=origin/main ./...)docs/, Swagger annotations, etc.)Screenshots / Recordings