Repository navigation
fix(core): match nested directory ignore rules by ancestry - #1929
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8694d3ef9d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
8694d3e to
813e940
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 813e940765
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
813e940 to
e9b26b8
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e9b26b84fa
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6d3acb3c84
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
94745ce to
157a9f2
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
157a9f2 to
0ab764e
Compare
|
@codex review |
c75ddfc to
456dd50
Compare
0ab764e to
145a5ec
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 145a5ecdd5
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 76c7149ee3
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a37883d170
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bb92ca2042
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d5b36f57bb
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
## Why Project creation and project moves duplicated resolved-root checks, and note moves maintained separate portable-path syntax checks. The user requested shared path helpers across these security boundaries. ## What Changed Reuse resolve_path_within_root for project creation and project moves, requiring strict descendants of a configured root. Reuse valid_project_path_value for note-move syntax. Uploads already use that portable validator in #1928; storage/import/materialization guards already share resolved containment in #1931. ## Implementation Details The shared helpers live in the preceding PRs. This PR removes the remaining project and note-move copies and adds controls for root permissions, sibling-prefix and symlink escapes, filename spelling, and literal tildes. Filename normalization remains an explicit operation policy; reference validation keeps its existing default restrictions. Object-storage keys do not resolve against the host filesystem. Stacked on #1931. The ignore-rule PR (#1929) is held separately and is not a dependency. ## Testing - `uv run pytest tests/utils/test_path_containment.py tests/utils/test_validate_project_path.py tests/utils/test_remote_project_paths.py tests/runtime/test_note_move_destination.py tests/services/test_destination_containment.py tests/services/test_project_move_root.py tests/services/test_project_root_containment.py tests/cli/cloud/test_upload_destination.py -q --no-cov`: 118 passed on the final stack. - `just fast-check`: passed, including repository type checking. - `just doctor`: passed sandboxed write/index/search self-test. ## Risks / Follow-ups Note moves apply the shared portable restrictions, including control characters and Windows-normalized traversal segments. File storage explicitly permits literal tildes because it never expands home markers. Native POSIX storage preserves literal-colon names; remote keys and reference validation retain their drive restrictions. Archive syntax remains a separately stricter format contract. --------- Signed-off-by: phernandez <[email protected]>
Signed-off-by: phernandez <[email protected]>
Signed-off-by: phernandez <[email protected]>
Signed-off-by: phernandez <[email protected]>
Signed-off-by: phernandez <[email protected]>
Signed-off-by: phernandez <[email protected]>
Signed-off-by: phernandez <[email protected]>
Signed-off-by: phernandez <[email protected]>
Signed-off-by: phernandez <[email protected]>
d5b36f5 to
9ecdca9
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9ecdca92b9
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Signed-off-by: phernandez <[email protected]>
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Why
Nested directory ignore rules were compared to individual components, so explicitly excluded paths remained selected for indexing and export. Review also reproduced fnmatch differences for separators, globstars, and caret-negated classes. Fixes #1913.
What Changed
Use pathspec for trailing-slash directory rules in the shared should_ignore_path helper. All consumers, including indexing, uploads, and ZIP planning, use the same matching behavior. Keep existing non-directory matching and unordered exclusion-set behavior.
Implementation Details
Declare pathspec >=1.1.1,<2 as a runtime dependency and lock it at 1.1.1. Compile complete directory-rule collections with the pure-Python backend and a bounded cache of 32 ignore sets. A large rule set compiles once across files rather than churning a per-rule cache. Preserve raw directory-rule escapes when loading ignore files. Distinguish directories from files with a trailing slash when matching. Remote and ZIP callers pass their known file kind explicitly so a conflicting local directory cannot silently hide a virtual file.
Two narrow normalizations retain Git behavior that differs from this pathspec release: whole components containing two or more stars use globstar semantics, and terminal directory globstars must consume a directory. Literal leading !/# names retain their existing exclusion-set meaning. The custom component-matching algorithm is removed. Compile patterns independently inside each cached collection so invalid lines cannot disable valid directory or file exclusions; invalid pathspec patterns and invalid regex ranges are skipped consistently with Git tolerance.
Based on main after #1928; this PR is independent of the project/storage/YAML stack.
Testing
uv run pytest tests/cli/test_nested_ignore_rules.py tests/cli/test_ignore_utils.py tests/importers/test_project_zip_import.py tests/cli/cloud/test_upload_destination.py tests/cli/cloud/test_webdav_transfer.py -q --no-cov: 165 passed.keyswas omitted when the local side held a directory atkeysand the rules includedkeys/; the real transfer-plan regression failed before the fix and passes afterward, whilekeys/secret.mdremains excluded.just fast-check: passed, including repository type checking.just package-check: passed all consolidated package checks.just doctor: passed sandboxed write/index/search self-test.Risks / Follow-ups
This adds a runtime dependency. It uses pathspec's supported pattern syntax with the explicit globstar compatibility cases above; it does not promise every Git extension. Ordered ignore-file negation is unchanged and remains outside this fix because the existing loaders return unordered exclusion sets. Non-directory matching is unchanged.