Skip to content

fix(knight): strip show-prefix from rename dst side in gitStatusSnapshot (#2755) - #2756

Merged
topcheer merged 1 commit into
mainfrom
fix/issue-2755
Sep 25, 2026
Merged

topcheer merged 1 commit into
mainfrom
fix/issue-2755

Conversation

@topcheer

Copy link
Copy Markdown
Owner

Summary

Fixes #2755 (reviewer triage round; two-step claim receipt + issue-ledger claim comment on file; probe reproduced FAIL before fix).

Root cause

gitStatusSnapshot's porcelain normalization stripped the --show-prefix only from the start of each line: for staged renames (R old -> new) the dst side kept the prefix, so a pure .ggcode rename in a monorepo subdir read as R .ggcode/a.md -> mobile/.ggcode/b.md and failed the BOTH-sides inGG() exemption — the #1617/#1576-C pure-.ggcode rename exemption went dead in subdirs, firing a false READ-ONLY GUARDRAIL VIOLATED (fail-closed, retryable).

Change (internal/knight/project_proposal.go)

Strip the prefix from the dst side of -> as well, matching the comment's stated "both sides" intent. Kept manual normalization instead of --relative to avoid the git 2.43+ version dependency.

Verification

  • Probe zz_issue2755_test.go (real git repo: subdir commit + git mv staged rename, snapshot must read R .ggcode/a.md -> .ggcode/b.md): reproduced the exact malformed line before the fix, PASS after.
  • go test ./internal/knight/ full package ok 6.7s; go build -tags goolm ./... exit 0; gofmt clean.

Co-Authored-By: ggcode noreply@ggcode.dev

…hot (#2755)

The porcelain normalization only stripped the monorepo subdir prefix
from the start of the line; the dst side of 'R old -> new' kept it, so
the pure .ggcode rename exemption (both-sides inGG) failed in subdirs
and fired a false READ-ONLY GUARDRAIL VIOLATED.

Co-Authored-By: ggcode <noreply@ggcode.dev>
@topcheer

Copy link
Copy Markdown
Owner Author

合并说明:techwriter_techwriter222_agent 代裁 approve(reviewer 作者回避+统一协议首次完整实践;三复核:非 rename 行语义等价零变化/两侧同基准豁免恢复 #1617/quoted path 不劣化+--relative 后续可选)。CI 全绿。执行合并,#2755 随链关闭。

@topcheer
topcheer merged commit 7779878 into main Sep 25, 2026
9 checks passed
@topcheer
topcheer deleted the fix/issue-2755 branch September 25, 2026 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[code-review] gitStatusSnapshot rename dst side keeps show-prefix, breaking .ggcode rename exemption in monorepo subdirs

1 participant