Repository navigation
Materialize file names valid on the host; skip and name ones it can't write - #293
Merged
Merged
Conversation
agorischek
added a commit
that referenced
this pull request
Dec 3, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Materialization collisions are not revalidated before execution, allowing a skipped extractor path to resolve to and run the wrong executable on case-insensitive filesystems.
4 open issues
What changed in this PR
Addresses #276 by allowing host-valid filenames and reporting paths that cannot be materialized, rather than failing unrelated projections.
Changes:
- Adds platform-aware path handling to the runner and extractor SDK.
- Records skipped paths in provenance, comparison notices, and doctor diagnostics.
- Adds regression tests and documents compatibility changes.
| File | Description |
|---|---|
| packages/extractors/sdk/src/source.rs | Filters Windows-unwritable Git entries. |
| packages/extractors/sdk/src/paths.rs | Adds platform-aware path rules. |
| packages/extractors/sdk/src/lib.rs | Exports Windows filename validation. |
| packages/cli/tests/windows.rs | Tests skipped Windows filenames. |
| packages/cli/tests/native.rs | Tests valid names, traversal, and collisions. |
| packages/cli/src/runtime/revision.rs | Tracks unwritable paths and limitations. |
| packages/cli/src/runtime/placement.rs | Reports materialization collisions. |
| packages/cli/src/runtime/mod.rs | Exports path diagnostics. |
| packages/cli/src/runtime/entries/tests.rs | Tests path validation and writing. |
| packages/cli/src/runtime/entries.rs | Separates unsafe names from unwritable names. |
| packages/cli/src/runtime/document.rs | Includes skipped-path limitations. |
| packages/cli/src/runtime/compare.rs | Adds unwritable-path notices. |
| packages/cli/src/runtime/capture/read.rs | Rejects reads of skipped paths explicitly. |
| packages/cli/src/runtime/capture/mod.rs | Classifies paths and gathers doctor diagnostics. |
| packages/cli/src/runtime/capture/materialize.rs | Records skipped writes and improves errors. |
| packages/cli/src/runtime/capture/locate.rs | Filters unwritable revision entries. |
| packages/cli/src/doctor/paths.rs | Adds repository-path diagnostic items. |
| packages/cli/src/doctor.rs | Integrates path checks. |
| docs/runner/execution.md | Documents platform-specific materialization. |
| docs/runner/commands.md | Documents doctor’s path checks. |
| changelog.d/293.md | Summarizes filename-handling fixes. |
| changelog.d/293-behaviour-changes.md | Notes Unix backslash compatibility changes. |
Review effort: Balanced
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
3 open issues
4 resolved since last review
Review effort: Lite
Copilot stopped reviewing on behalf of
agorischek due to an error
December 3, 2026 16:26
A tracked file with `:` or `\` in its name made every projection of the revision fail with an unnamed "Unsafe repository path". On macOS and Linux those are ordinary file names, so they are now listed and written like any other. On Windows, names it can't create are skipped and named in provenance limitations, as are paths that collide on a case-insensitive file system; a definition that requires one fails naming it. Unsafe paths (traversal, absolute, `.git`) still fail the revision, and every error names the path. `projections doctor` warns about tracked paths this platform can't write. Refs #276 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ollisions - A declared source or extractor program that collided while materializing (case-insensitive file system) now fails, naming it, instead of running the file that took its name. - doctor detects collisions within HEAD and the index separately (a staged case-only rename isn't one) and also file-versus-directory collisions. - The SDK's scope paths keep `\` as a file-name character off Windows, as `project_path` and `relative_path` do. - Regenerate docs/reference/extractor-sdk.md for `windows_reason`. Refs #276 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
… path Refs #276 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
agorischek
force-pushed
the
fix/colon-paths-276
branch
from
December 3, 2026 16:34
f4b35c4 to
abc48f9
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.



Agent assessment
Self-reported assessment, not an independent review.
Assessed revision:
abc48f905404b41f20dfe26b867c72b8239e93bdweird:name.txt,package.json) now passesshow,compareand a fresh-workspace toolchain run on macOS, as a native CLI test.↑ The full
projections-cliandprojections-extractor-sdksuites pass locally, andcargo check --target x86_64-pc-windows-msvc --all-targetsis clean. CI was green on the pre-rebase head 51fe334, Windows included.↑ All seven Copilot review threads are addressed: six fixed, one declined with an explanation.
↓ Rebased onto #291; CI on this head is pending.
↓ The SDK's
\handling on Unix changes behaviour for definitions that used\as a separator (called out in the changelog).safe_pathrejected:and\on every platform and was called for every tree entry during capture, so one such file failed the whole revision with an unnamed error.Refs #276
What was wrong
safe_pathrefused any repository path containing:,\or NUL, with an error that didn't name the path. Capture calls it for every entry Git lists (ls-tree,ls-files), not just when materializing, so one trackedweird:name.txtmade every projection of the revision fail. That included extractors that never read the file.doctorandlistdon't capture revisions, so they still passed.What I chose for paths that can't be materialized
Paths now fall into three groups:
.or..segments, and.gitcomponents. On Windows the group also covers paths that leave the directory under its own parsing: a drive (C:x),\..\, and NTFS's other names for.git(.git.,.git,GIT~1), as Git'score.protectNTFSguards. Git itself refuses to check these out, so finding one means the tree was crafted. Skipping it would hide that, so the whole revision still fails, as before, but the error now names the path (Unsafe repository path "..": it has an empty, . or .. segment).:and\are ordinary file-name characters. They are listed, written and read like any other name. On Windows the group covers<>:"|?*\, control characters, a trailing dot or space, and reserved device names. Those names are left out of the revision's file list, both in the runner and in the extractor SDK's Git-objects reader, so every placement sees the same set. They are recorded inRevision.unwritablewith a reason, alongside the existing skipped-submodule mechanism. The reasoning:require_materializedfails and names it. A runner-sideread_filesof a skipped name fails with the reason instead of "does not exist". Projections that might have read it get a provenance limitation listing each skipped path within their scope, and a comparison notice.Aanda/child.txt. This used to fail with an unnamedFile exists. Now the first in byte order is written, the second is skipped, and a limitation names it with the reason. This group is only found at write time, so placement records the note. Placement also checks the definition's declared sources and the command's program and path arguments against the copy: a collidedrun.shfails, naming itself, instead of running theRUN.shthat took its name.projections doctorlists the pathsHEADand the index track. Unsafe paths get afail. Paths it can't write and case collisions get awarnthat names each one. Collisions are checked within each snapshot separately, so a staged case-only rename doesn't warn. It adds no item when every path is fine, and awarnwhen the check itself fails.The extractor SDK (
relative_path,project_path, scope paths) used to treat\as a separator, andx:as a drive, on every platform. As a result,back\slash.txtanda:b.txtwere silently dropped or failedrepository-map. Now both are separators only on Windows, matching the runner. Because this could change how a definition written with\separators behaves on Unix, there's a behaviour-changes fragment for it.Every error from these checks now names its path. That covers
write_entry's symlink checks,Working path traverses a symlink,Working file replaced, and I/O failures while writing.Known limit, not verified: on Windows, the worktree, clone and sparse workspace strategies check out through Git, which refuses such names.
--workspace freshgoes through the new skip path instead.Tests
packages/cli/src/runtime/entries/tests.rs: unsafe paths are refused and named.windows_reasonis checked on every platform.:and\names are written on Unix. Acfg(windows)case checks that names are skipped and that drive, traversal and NTFS.gitpaths are refused. A case collision is skipped, and the errors name their paths.tests/native.rs(Unix):back\slash.txt, throughshow(commit and working tree),compare, a--workspace freshtoolchain extractor that checks both files are on disk, anddoctor. A crafted..tree entry is refused and named.runtime/capture/tests.rs: file-file and file-directory case collisions. SDKpaths::separator_tests:\andx:are separators only on Windows, scope paths included.tests/windows.rs(cfg(windows)): a craftedweird:name.txtcommit shows with a limitation naming it, anddoctorwarns.Changelog:
changelog.d/293.md(credits @IgnacioN99) andchangelog.d/293-behaviour-changes.md. Docs:docs/runner/execution.md,docs/runner/commands.md.