Repository navigation
fix(repos): leave FIFOs out of a plain directory's file listing - #1321
vchamarthi wants to merge 2 commits into
Conversation
In a plain directory, FileTree.files() listed a FIFO named like guidance, so repo reach planned it, and a lone FIFO AGENTS.md was refused as a link to nothing. The listing now keeps only regular files and links, and resolve() says "is not a regular file" for an existing non-file target. Fixes intel#1273 Signed-off-by: vchamarthi <123653452+vchamarthi@users.noreply.github.com>
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 5 selected item(s). CI at Review details
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1321 +/- ##
=======================================
Coverage 96.14% 96.14%
=======================================
Files 498 499 +1
Lines 66028 66081 +53
Branches 11461 11475 +14
=======================================
+ Hits 63482 63533 +51
+ Misses 1574 1573 -1
- Partials 972 975 +3
🚀 New features to boost your workflow:
|
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
What changed in this PR
Updates plain-directory repository scanning so non-regular filesystem entries (e.g., FIFOs) are excluded from guidance discovery and are reported with clearer errors when they are the only “guidance-like” matches.
Changes:
- Filter
WorkTree.files()plain-directory results to only regular files and symlinks, tracking excluded paths innot_regular. - Improve
WorkTree.resolve()andcheck_files()error messages for non-regular targets (FIFO/socket/device) vs missing link targets. - Add FIFO-focused tests and a changelog entry documenting the behavior change.
| File | Description |
|---|---|
| dokimi/tests/test_repo_reach_links.py | Adds regression tests for FIFO handling in dry-run planning, listing, and resolve behavior. |
| dokimi/dokimi/repos/source.py | Excludes non-regular entries from plain-directory listings and improves resolve-time errors for non-regular targets. |
| dokimi/dokimi/repos/reach.py | Enhances check_files() to optionally report “not a regular file” guidance-like paths when nothing matches. |
| dokimi/dokimi/commands/repo_reach.py | Passes tree through to check_files() to enable enhanced reporting in CLI dry-run planning. |
| dokimi/changelog.d/20261126_120000_reach-fifo-guidance.md | Documents the FIFO/non-regular handling fix in repo reach. |
Review effort: Lite
…files tree An unreadable regular file (EACCES) was recorded in WorkTree.not_regular as well as in skipped, so check_files could call it a FIFO. Only entries that could be looked at and are not files or links go there now, and the walk no longer rescans the growing list for each path. check_files documents its tree argument; tests pin both it and the unreadable case. Signed-off-by: vchamarthi <123653452+vchamarthi@users.noreply.github.com>
|
This is ready for another look: I've pushed 1 commit on Changes:
Threads and comments:
What I checked on the new commit:
What each test shows
|
|
Checked on Linux with plain directories holding a FIFO, a socket, a nested FIFO and links to FIFOs inside and outside the tree: a FIFO or socket |



Summary
In a plain directory,
repo reach --dry-runplanned a FIFOsub/AGENTS.mdas guidance and refused a lone FIFOAGENTS.mdas a link to nothing. Fixes #1273. Related: #1271 (the same listing feedsrepo inspect, so it no longer counts FIFOs), #1272 and #1300 (same file, link handling unchanged).Changes
WorkTree.files()indokimi/repos/source.pykeeps only regular files and links, using the_is_entrycheck the git path uses, and records the others innot_regular.WorkTree.resolve()saysis not a regular filewhen the target exists but is neither a file nor a directory;links to nothingstays for a missing target.check_filesindokimi/repos/reach.pytakes an optionaltree; with no guidance file left, it names FIFOs and the like that carry a guidance name. Both callers pass the tree.tests/test_repo_reach_links.pyand a changelog fragment.Risk
Small. A FIFO, socket or device in a plain directory is no longer listed, so
repo inspectstops counting it too.GitTreeis unchanged. The existing prefixeach is a link that cannot be followedis kept for real links.Testing
python -m pytest -q -p no:cacheproviderontests/test_growth_ratchet.py,tests/test_repo_reach_links.py,tests/test_repo_reach.py,tests/test_repo_reach_edges.py,tests/test_repo_reach_shadow.pyandtests/test_reach_fixtures_unlistable.pypasses (235 tests), andpython -m ruff checkpasses on the changed files. The FIFO tests are skipped whereos.mkfifodoes not exist.Open questions
None beyond the choice listed in the decisions.
check_fileswhen nothing else matches over Keeping them listed and refusing them infollowable: The dry-run plan'sfilescomes from the listing, so only dropping them keepssub/AGENTS.mdout of it, as the git working tree listing does. Is that the behaviour you want?Revert
A plain revert of the commit; nothing is stored.
Checklist
pytestpassesruff,mypy, and schema checks passAGENTS.mdraise/exit and test names the doc, contract or issue it traces to.github/.licenserc.yaml)Checklist evidence
pytestpasses: 1 test file(s) changed; suite: 29837 passed; 1 failing test(s) fail on the base branch too: tests/test_repo_compare_interval.py::test_the_row_p_places_zero_where_large_deltas_round_p_at_zero_apart; 4 of 4 proof(s) fail before the changeruff,mypy, and schema checks pass: passed: ci.yml:static / ruff check, ci.yml:typecheck / mypy, ci.yml:static / schema-check, ci.yml:static / schema_compat vs the PR baseAGENTS.md: nothing left open; mutation of changed lines ranraise/exit and test names the doc, contract or issue it traces to: every new error path and test names a doc, contract or issue.github/.licenserc.yaml): no new source fileFixes #1273.