Repository navigation
fix: status judges symlinks sync key, reject TOML-breaking chars, keep exec bits for non-ASCII paths - #54
Merged
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
…p exec bits for non-ASCII paths Three fixes from a full-project review: - status omitted the symlinks policy from its sync-key comparison, so it reported ok while apply/lock --check refused with "out of sync" (spec §4.5 lists symlinks). checkSync's field list is now extracted into syncFields, the single source of truth shared with status, so the two can never disagree again. - Nothing rejected a double quote, backslash, or control character in repo/version/subdir/dir values, yet the surgical graft.toml editor emits them verbatim inside a TOML basic string — `graft add repo@'v1"x'` (a tag name git allows) wrote a manifest that no longer parses, wedging every subsequent command. A new validateTomlSafe check rejects these with exit 2 at load and before graft add writes anything. - ExecBits ran ls-tree with git's default core.quotePath, which octal-escapes non-ASCII paths, so such a file's exec bit was recorded under a name that never matches and silently dropped from the hash. Now runs with core.quotePath=off. Note: this changes the content hash of trees containing non-ASCII executable files (pre-1.0 breaking change; affected deps need a re-lock). Spec §7 gains a "write-back (TOML) safety" paragraph in both languages; requirements.md gains REQ-STATUS-SYMLINKS-SYNC, REQ-TOML-SAFE, and REQ-EXECBIT-QUOTEPATH with covering tests. Also refreshes CLAUDE.md's release status (beta.6) and command list. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
min0625
force-pushed
the
fix/review-sync-keys-toml-safety
branch
from
July 11, 2026 07:52
81c57d4 to
be0bd70
Compare
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.
Three fixes from a full-project review (all reproduced end-to-end before fixing, re-verified after):
1.
statusomitted thesymlinkssync key (spec §4.5)checkSync(apply /lock --check) compares five sync keys;depStatuscompared only four. Changing a dep'ssymlinkspolicy without re-locking madestatusreportok(exit 0) whileapplyrefused with "out of sync" (exit 2) — a CI gate built onstatuswould miss the drift.Fix:
checkSync's field list is extracted intosyncFields, the single source of truth now shared bystatus, so the two can never disagree on what "in sync" means.2. TOML-breaking characters were never rejected
git allows
"in tag names, and the surgical graft.toml editor emits values verbatim inside a TOML basic string. Sograft add repo@'v1"x'happily wrote:…after which every graft command fails with a parse error.
versionhad no character validation at all;repoonly rejected whitespace;ValidatePathmissed".Fix: a shared
validateTomlSaferejects",\, and control characters inrepo,version,subdir, anddirwith exit 2 — at load and beforegraft addwrites anything. Spec §7 gains a "write-back (TOML) safety" paragraph (both languages).3. Exec bits silently dropped for non-ASCII paths
ExecBitsparsedls-treeoutput with git's defaultcore.quotePath, which octal-escapes non-ASCII paths (腳本.sh→"\350\205\263..."), so the exec bit was recorded under a name that never matches the real file and fell out of the hash. Now runs with-c core.quotePath=off.Ratchet
docs/requirements.mdgains REQ-STATUS-SYMLINKS-SYNC, REQ-TOML-SAFE, and REQ-EXECBIT-QUOTEPATH, each with covering tests (status_test.go,manifest_test.govia TOML literal-string smuggling,add_test.gowith a real quoted tag,repocache_test.go). Also refreshes CLAUDE.md's release status (beta.6) and command list.🤖 Generated with Claude Code