Fix standalone constraints in multi_grep - #753
dmtrKovalenko merged 3 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR adds direct standalone constraint parsing, applies constraints through the multi-pattern prefilter, removes MCP fallback searching, updates C and Python integrations, and adds parser and path-filter regression tests. ChangesConstraint Parsing and Multi-Grep Integration
Estimated code review effort: 3 (Moderate) | ~20 minutes Mergeability Score: ⚪ Minimal · up to The PR updates multi-pattern constraint handling and removes an unsupported fallback; no actionable merge-blocking risk remains. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Sync of dmtrKovalenko/fff (b71b7cf..be2dd8d). Notable upstream work: LMDB env lifecycle overhaul — one shared env per canonical path per process (dmtrKovalenko#775) plus a new env_pool with raised max_readers to avoid MDB_READERS_FULL (dmtrKovalenko#783); standalone constraints in multi_grep (dmtrKovalenko#753); a parent-liveness watcher so the MCP no longer exits while its parent is alive (dmtrKovalenko#770); file-picker rebuild after FFFClearCache (dmtrKovalenko#772); readOnlyHint on all tools (dmtrKovalenko#771); and pi-fff global config (dmtrKovalenko#790). Why these resolutions: - Version: our workspace is 0.18.0; upstream bumped 0.10.3 -> 0.10.5. Kept 0.18.0 in every Cargo.toml/Cargo.lock version conflict while preserving upstream's non-version additions (zlob =1.6.3, fff-core crate-type = ["rlib"], fff-mcp windows-sys target dep for the new Windows parent watcher). - dbs/ module: the dbs/ reorg already lives in our shared merge base, so this sync only adds upstream's new env_pool.rs (additive, no rename conflict). Our eviction feature already targets dbs/. - dmtrKovalenko#775 shared-env x our idle/stale root eviction (f40b086): verified compatible. Eviction drops EngineState (hence FrecencyTracker's SharedEnv) via Drop only — it never calls SharedEnv::destroy and never deletes on-disk data.mdb (the only file removal in env_pool is the size-cap guard). Dropping the last holder closes the env; a re-register reopens the same canonical path from the process pool, so per-slug frecency persists across an evict -> re-register cycle. Eviction machinery unchanged: last_access_ms stamping, drop_root's Arc::strong_count>1 live-connection guard, the reaper phases, idle_root_ttl_secs config, RootHealth.last_access_age_sec (kept the appended-LAST field for bincode order), and the ctl IDLE column. - fff-mcp/Cargo.toml: unioned our fff-ipc/dirs/libc deps, clap_complete, and [package.metadata.deb] with upstream's new windows-sys target block; dev tempfile pinned to upstream's 3.8. - fff-mcp/src/main.rs: kept our set-log-level/completions args and added upstream's `mod parent;`, taking upstream's reworded idle-timeout doc comment. - multi_pattern.rs: three-way merge kept both our `recheck` field and upstream's prefilter_files standalone-constraint path. - Makefile: unioned upstream's build-e2e target with our daemon targets. - release.yaml: kept our publishing guards (PyPI gated to upstream's owner; crates.io and npm disabled via `if: false`). - install-mcp.sh: kept the pinned-tag + SHA256 block removed (we ship via Homebrew/apt); upstream's re-add discarded. Build: cargo build -p fff-mcp -p fff-engine -p fff-ctl green. Tests: 480 passed / 0 failed across fff-search, fff-engine, fff-ipc, fff-ctl, including lmdb_env_pool (4), lmdb_readers_full_repro (2), and lmdb_stale_lock_deadlock (4).
Second stable release. Captures the idle/stale on-demand-root eviction feature and two upstream syncs since 0.18.0 (4-commit + 17-commit rounds), including LMDB shared-env-per-path (dmtrKovalenko#775), raised max_readers (dmtrKovalenko#783), multi_grep standalone constraints (dmtrKovalenko#753), and MCP parent-liveness (dmtrKovalenko#770).
Fixes #738.
Supersedes #739 with a configuration-level fix.
multi_grepreceives patterns and constraints separately, but its adapters parsed the constraint field as an ordinary grep query. A lone path could become search text and disappear before the search. Exact-file misses could then discard the file constraint during prefiltering and search the wider index.Parse the dedicated constraint field directly and keep multi-pattern prefiltering strict. Ordinary grep retains its existing query parsing and filename retry. The unsupported plain-grep fallback is removed.
Verified with the Rust workspace tests, Clippy, rustfmt, a release build, and MCP stdio cases covering directory, glob, exact and missing files, exclusions, and OR matching.
Summary by CodeRabbit
Bug Fixes
Tests