Repository navigation
fix(canary): preserve exact changed Git paths #8585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
huangruiteng
merged 4 commits into
loopx-project:main
from
gcl-coder:fix/canary-exact-git-paths
Nov 11, 2026
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
90ae349
fix(canary): preserve exact changed Git paths
gcl-coder 72e0bca
fix(canary): fail closed on undecodable Git paths
gcl-coder 5d89a24
fix(canary): preserve exact Git paths through premerge
gcl-coder 1c48814
Merge remote-tracking branch 'origin/main' into fix/canary-exact-git-…
gcl-coder File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P2] 保留传入 premerge 的合法 Git 路径身份
这里的精确去重在 CLI 层是正确的,但这份列表进入
build_premerge_validation_gate后会被_dedupe/_norm_path再次 strip 和替换反斜杠。真实 Git 对照中,同时存在fixtures/trailing.py和同名尾部多一个空格的文件时,selector 两个都列出,premerge --from-git-diff --no-execute仍退出 0 且下游只收到一个;字面反斜杠也被当作目录分隔符。请让实际 gate/catalog 消费原始身份,单独保留分类的规范化,并让回归测试断言 premerge 自己消费的列表。There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已在
5d89a2431c7769cecb611aa07c71cf0d89e27c7a修复。premerge._dedupe不再用_norm_path重写身份,原始 Git 路径直接进入 classification、catalog 选择、direct checks、risk profile 和 boundary 扫描;_path_matches仍只把规范化用于分类匹配。显式--changed-file的反斜杠归一化保留在 premerge 的 CLI 入口,Git 来源路径不经过该步骤。新增真实 Git 回归:同一夹具包含字面反斜杠、CR、前导空格、
fixtures/trailing.py与同名尾部多一个空格的文件,以及docs/下的 boundary 路径。断言 selector、premerge 顶层changed_files、classification、catalog_run.selection_inputs.changed_files、boundary_run.selection_inputs.changed_files与scan_paths均为 6 条原名。该回归在旧 head 上会看到docs/back/slash.txt和尾部空格被合并,修复后通过。本地验证:
tests/canary/test_git_path_framing.py7 passed,test_repository_root.py与test_premerge_public_boundary_run.py30 passed,Ruff 与git diff --check通过。远端 CI 当前仍在排队,结果以实际检查状态为准。