Skip to content

fix: preserve literal path identity during normalization - #48

Merged
flyingrobots merged 5 commits into
mainfrom
fix/literal-path-identity
Oct 2, 2026
Merged

flyingrobots merged 5 commits into
mainfrom
fix/literal-path-identity

Conversation

@flyingrobots

@flyingrobots flyingrobots commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

A quoted path such as report[1].md could reserve an existing report1.md because normalization expanded glob characters. Split path components into an array and iterate quoted elements so literal *, ?, and brackets retain their identity regardless of checkout contents.

Fixes #32.

Validation: the focused regressions failed against the original implementation (90 passed, 150 failed) and pass with the fix (240 passed), including a 64-case deterministic corpus at seed 320032. Cases cover contention on the literal filename, freedom of neighboring filenames, nested and prefix paths, batch input, and existing normalization boundaries. The normal pre-push gate passed all 452 base assertions and 240 focused assertions; commit lint and GitHub CI passed at 77b59079cc42f3f078c68d50e9c46755e78723ab.

Runtime remains Bash/Git only. Earlier validation interrupted by host disk exhaustion is excluded from the successful results above.

RED: bash test/literal-paths.sh reported 90 passed and 150 failed. The failures cover claim, batch, read, prefix, nested, one-match, multi-match, and seed 320032 across 64 deterministic stress cases.
Split path components with read -a before applying lexical normalization so Bash never expands *, ?, or bracket expressions against the working tree. Rebuild the executable and document the contract.\n\nGREEN: bash test/literal-paths.sh reported 240 passed and 0 failed, including seed 320032 across 64 deterministic cases. make lint passed.
@coderabbitai

coderabbitai Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 49 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: ad178c55-f647-498d-b900-58b2d608ecb6

📥 Commits

Reviewing files that changed from the base of the PR and between b9a8384 and 9191ea3.

📒 Files selected for processing (7)
  • CHANGELOG.md
  • Makefile
  • README.md
  • bin/git-locks
  • lib/030-time-refs-records.sh
  • test/literal-paths.sh
  • test/test.sh
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@flyingrobots
flyingrobots marked this pull request as ready for review September 22, 2026 16:14
On bash 4.0 to 4.3 an empty array expanded under set -u is unbound, so
normalize_path crashed with a raw bash error instead of the JSON usage
reason when the path was empty. Guard before the split.
@flyingrobots
flyingrobots merged commit 16993b9 into main Oct 2, 2026
4 checks passed
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.

Preserve literal glob characters during path normalization

1 participant