Repository navigation
fix: filename quoting, nested globs, and small display bugs - #3
Conversation
- Decode git C-style quoting (backslash, quotes, octal) so quoted patch and status keys align with raw -z numstat keys - Parse quoted diff --git headers by splitting between quoted strings - Match dir-prefix ignore globs at any depth for monorepos - LC_ALL=C for deterministic English git errors; clean GitCommandError on non-UTF-8 output - config show prints 0.0 budget instead of none; ignore tool-dropped .agents/ dir
|
Verified both against the running code — R1 exactly as reported, R2 real but narrower. Thanks for the byte-level probes; details: R1 confirmed (content loss). R2 confirmed, narrower trigger. Rename with edits into One correction to the suggested snippet: if rest.endswith('"'):
idx = rest.rfind('" "b/')
if idx == -1:
return None, None
return _strip_git_prefix(rest[: idx + 1]), _strip_git_prefix(rest[idx + 2 :])(plus |
- Split diff --git headers across all four quoted/unquoted combinations - Stop stripping a//b/ from rename/copy from/to lines (never prefixed by git) - Regression tests: plain<->quoted renames with edits, pure rename into a/ dir
|
Both fixed in bf649ff, now on this branch: mixed quoted/unquoted headers split on the Y-side quote boundary (all 4 combinations probed correct), and rename/copy from/to lines decode quoting without prefix-stripping. Added 3 regression tests (plain<->quoted renames with edits, pure rename into a/ dir). Full gate green: 54 pytest, ruff check, format --check, mypy --strict. |
|
All reported issues and regressions (including mixed quoted/unquoted headers and directory prefix preservation) have been verified fixed. All 54 tests are passing cleanly. LGTM! |
…d orchestrator consolidation - #1 (Blocker): Fail loud with exit code 1 on git errors, budget cap breaches, and gh CLI errors across pr-summary and changelog CLI commands. - #2: Prevent duplicate printing when no changes/commits exist by early returning None. - #3: Route diagnostic warnings, budget alerts, and error messages to stderr console (err_console) to keep stdout clean for Unix piping. - #4: Correctly parse and surface breaking changes (exclamation mark and BREAKING CHANGE: footers) in conventional commits and templates. - #5: Bump changelog template to version 2, including from_ref..to_ref range and explicit release headers. - #6: Support --title (-t) flag in pr-summary and propagate gh pr create failures. - #7: Remove dead head argument from fallback PR summary. - #8: Consolidate duplicate budget checking, safe telemetry recording, and heuristic token counters into orchestrator.py. - #9: Enforce strict type hints with CommitLogEntry in fallback.py.
Follow-up hardening to the Phase 1 DiffExtractor, from the review findings plus one extra bug caught by end-to-end probing.
What was wrong
", backslash, and controlcharacters even with
quotepath=false, while-z --numstatis always raw.A file like
back\slash.pyproduced two FileDiff rows: the real pathwith counts but no patch, plus a quoted phantom row. Same class of bug
for
"in names.diff --githeaders dropped whole patches. A quoted header(
"a/X" "b/Y") matched neither the symmetric check nor the space split,so the chunk was skipped and
patch_textcame back empty.dist/*only matched root-leveldist/;packages/ui/dist/bundle.jssailed through the noise filter.budget_cap_usd: 0.0displayed asnoneinconfig show(falsy check).
path (unmatched message check; raw traceback on decode failure).
Fixes
_unescape_c_quotingdecodes\\,\",\n,\t, and octal runs (asUTF-8 bytes, matching git's per-byte escaping); applied everywhere quoted
paths are read (patch headers,
+++/---, rename from/to, name-status).diff --githeaders split between the quoted strings.LC_ALL=Con all git invocations for deterministic English errors;non-UTF-8 git output raises clean
GitCommandErrorinstead of a traceback.config showusesis not Nonefor the budget..agents/directory added to.gitignore(it was breakingruff check .on unrelated vendored code).Verification
pytestgreen (new: backslash/quote filenames, non-UTF-8 fake-gitoutput, nested monorepo dist,
---re-key break, zero-budget display).ruff check,ruff format --check,mypy --strictclean.dist,
mnemonicPrefix=true): each file exactly once with correct status,counts, and full patch text.
Deliberately not changed: the three-call git design (race/perf concern
declined — millisecond window, ~3 cheap subprocesses) and the parser
structure (targeted fixes instead of a rewrite).