Skip to content

feat: backend selector (--backend fd / rg-files) + fix platform-neutral path comparison#60

Open
lyra-explorer wants to merge 4 commits into
na-navi:mainfrom
lyra-explorer:main
Open

feat: backend selector (--backend fd / rg-files) + fix platform-neutral path comparison#60
lyra-explorer wants to merge 4 commits into
na-navi:mainfrom
lyra-explorer:main

Conversation

@lyra-explorer
Copy link
Copy Markdown

Summary

  • feat: backend selector (feat/backend-selector branch, 3 commits)

    • --backend fd / --backend rg-files for non-Windows platforms
    • resolve_backend(): Windows defaults to everything, others require explicit --backend
    • backend_search() dispatches to the selected backend with timeout/budget support
    • --check --json and search stats/logs now include backend field
    • tests/test_backend.py: 16 tests covering resolve, dispatch, timeout, observation
  • fix: platform-neutral _is_under_root() (1 commit)

    • _is_under_root() now selects ntpath or posixpath semantics from the input path shape, not the host OS
    • Fixes a pre-existing issue where Linux test runs could not correctly compare Windows-style paths because os.path.commonpath() follows the host OS path semantics
    • enforce_allowed / filter_results now work correctly with Windows paths on any OS

Test results

36 passed in 0.26s

All previously failing test_cli.py tests (5 failures) now pass alongside all test_backend.py tests.

Verified cases

case expected result
C:\Users\test\file.txt under C:\Users\test True
c:\USERS\test\file.txt under C:\users\test (case-insensitive) True
C:\root\file.txt under C:\root True
C:\root2\file.txt under C:\root (sibling prefix) False
D:\root\file.txt under C:\root (different drive) False
/home/claw/doc.txt under /home/claw (POSIX) True
/home/claw2/doc.txt under /home/claw (POSIX sibling) False

Notes

  • Windows se query behavior is unchanged — Everything / es.exe remains the default backend
  • --backend-selected paths are explicit opt-in per CONTRIBUTING.md guidelines

AnoKno and others added 4 commits May 22, 2026 00:55
Refs na-navi#55

Adds --backend choices for everything, fd, and rg-files, resolves the default backend with Windows-first behavior, and routes search execution through a backend dispatch layer.

Windows default remains Everything/es.exe. Non-Windows requires explicit --backend fd or --backend rg-files. Stats, JSON output, and search logs now include the selected backend name.
Refs na-navi#55

Adds focused backend tests for default resolution, missing backend errors, dispatch to existing Everything functions, fd/rg-files command construction, timeout handling, and backend fields in stats/JSON/log output.
Refs na-navi#55

Documents explicit backend selection, clarifies search JSON output and backend stats, and adds Compatibility Notes guidance for backend-related PRs.
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.

2 participants