Repository navigation
Description
Problem
Lines cited at 05e9388 (release/v0.2.29).
#1952 deleted the release branch detection in commands/pr.py and the release commit step in commands/release.py, so this item does not change them now.
Several modules parse git's human-format listings, in which git C-quotes any path with non-ASCII or special bytes (core.quotePath), prints renames as old -> new, and translates messages. Reproduced with real git in scratch repositories:
- Drift paths lose their first character.
argo/gitops.py:267-276strips the wholegit status --porcelainoutput before splitting it. That removes the leading space of a firstMentry, and_parse_drift_event(:228-233) then takesline[3:], soM k8s/app.yamlis reported as8s/app.yaml. A rename yieldsk8s/app.yaml -> "k8s/app two.yaml", and a non-ASCII name yieldsk8s/caf\303\251.yaml. Each path is also resolved against the process's working directory, although porcelain paths are relative to the repository root. - Files drop out of review file lists.
core/repo.py:361-396readsgit ls-files --cached --others --exclude-standardwithout-z.café.pyis listed as"caf\303\251.py",is_file()is false, and the file is silently skipped by every caller oflist_repo_files. - Test selection and refinement context.
commands/test_cmd.py:50-67splitsgit diff --name-onlyandgit status --porcelainlines by hand (" -> ",strip('"')).roadmap/refine.py:257and:280readgit ls-tree -r --name-onlywithout-z, so the later read of a quoted ADR or source path fails. core/cleanup.py:80readsgit worktree list --porcelainwithout-z.
The codebase already reads git NUL-separated elsewhere: git/operations.py:380-414 (diff --name-status -z with _parse_name_status), :321 (ls-tree -z) and core/cleanup.py:148 (ls-files -z).
Proposed remedy
- Read every path listing NUL-separated and split on
"\0":ls-files -z,status --porcelain=v1 -z(a rename's original path is its own field),diff --name-only -zorlist_changed_files,ls-tree -zandworktree list --porcelain -z. Resolve status paths against the repository root.
Acceptance criteria
- Real-git tests in temporary repositories whose status has a first entry
M, a path with a space, a non-ASCII path and a rename. Drift events,list_repo_files, test selection and refinement context name exactly those paths. - Every new test runs in under 1 s and opens no socket;
uv run devops cipasses.
Found by the 2026-10-08 client-library audit.
Opened as a borrow (#1153, budget/borrowed): the agent filing quota is spent for this cycle, and this is a defect or security finding of the owner-requested 2026-10-08 client-library audit.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
dan-petty-bot commentedon Oct 8, 2026
Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.
Causes silent data loss (dropped files, mangled paths) and locale-dependent release failures across several workflows, but the system still runs and the bugs are edge-case-triggered rather than total outages.Drift detection, file listing, test selection, release-branch detection, and the release commit step all produce wrong or missing results for non-ASCII paths, renames, and non-English locales.The fix is well-scoped (add -z flags, split on NUL, use exit codes) and the codebase already has the pattern in git/operations.py, but it touches six modules and requires new real-git tests.[-]fix(git): git output the code parses is read NUL-separated, and git outcomes come from exit codes[/-][+]fix(git): git output the code parses is read null-separated, and git outcomes come from exit codes[/+][-]fix(git): git output the code parses is read null-separated, and git outcomes come from exit codes[/-][+]fix(git): git output the code parses is read NUL-separated, and git outcomes come from exit codes[/+]fix(git): git output the code parses is read NUL-separated, and git o…