fix(knight): strip show-prefix from rename dst side in gitStatusSnapshot (#2755) - #2756
Merged
Merged
Conversation
…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>
Owner
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.
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-prefixonly from the start of each line: for staged renames (R old -> new) the dst side kept the prefix, so a pure.ggcoderename in a monorepo subdir read asR .ggcode/a.md -> mobile/.ggcode/b.mdand failed the BOTH-sidesinGG()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--relativeto avoid the git 2.43+ version dependency.Verification
zz_issue2755_test.go(real git repo: subdir commit +git mvstaged rename, snapshot must readR .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