You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Harden shared search parity and runtime lease lifecycle - #176
Extend the existing shared-daemon fixture with bounded, seeded three-worktree sequences: independent edits, staged/unstaged/untracked changes, deletion/rename, committed divergence, ignores, restoration to the pin, reset/checkout/rebase, sparse/CRLF materialization, and daemon restart. Compare against --no-index and a simple independent membership/line model at acknowledged refresh barriers; require RPC backend identity and CLI shared-use counters so fallback cannot make parity pass.
Cover Unicode -F -i through base/overlay/ignore/restart states, hidden/filename-only membership, legitimate no-results, line/count/match/file output, and JSON semantics including offsets, submatches and totals. Native-watch coverage additionally requires event-driven publication before explicit refresh.
Add a reusable test-only process/lease supervisor with persisted caller-owned journals, simultaneous/repeated/lost-response attaches at limits, crash/timeout abandonment, explicit journal recovery, daemon restart with fresh tokens, budget release, and detach-before-move/remove while sibling queries continue. Bounded waits and owned-PID kill/reap guards; no expiry/GC or public SDK.
Fix a defect found by the new parity checks: both shared and ordinary JSON server replies omitted later match/context byte offsets. Request positional metadata whenever JSON output is selected. A focused scan/local/ordinary-server regression independently asserts UTF-8 offsets and spans.
Backwards-compatible opt-in two-layer design is unchanged. No cache/GC/migration redesign, Copilot integration changes, README changes or workflow changes. Based on verified main e9d55dbbf232f0e228695f15a640cf207d4b3348 (including #174).
Validation
Windows and native-ext4 WSL Linux, no DrvFS watcher tests:
Suite
Windows
Linux
tgrep-cli --bin tgrep
271 passed, 1 existing ignored; 4.73s
293 passed, 1 existing ignored; 1.84s
tgrep-cli --test ripgrep_compat
236 passed; 61.91s
236 passed; 4.92s
tgrep-cli --test shared_daemon
27 passed, 1 subprocess entry ignored; 138.15s
32 passed, 1 subprocess entry ignored; 18.63s
tgrep-core --test shared_worktrees
30 passed; 0.96s
29 passed; 0.10s
tgrep-core --lib worktrees::tests
25 passed; 9.80s
32 passed; 1.08s
cargo fmt --all -- --check and cargo clippy --workspace --all-targets -- -D warnings pass on both. Alternate Linux seed 7, two rounds per watch mode plus runtime exerciser: 3 passed, 1 subprocess entry ignored, 18.89s. Platform counts differ because existing tests are platform-gated.
Selectors and replay
cargo test -p tgrep-cli --test shared_daemon -- stateful:: runtime::
cargo test -p tgrep-cli --test ripgrep_compat indexed_json_preserves_utf8_match_and_context_offsets
TGREP_SHARED_SEED=7 TGREP_SHARED_ROUNDS=2 cargo test -p tgrep-cli --test shared_daemon stateful::
Default seed is 1742026, rounds 1; accepted rounds 1..16. Failures print seed/rounds/ordered operation log. The ignored runtime::runtime_client_process is invoked by the supervisor, not a standalone test. Readiness is not latest-disk proof; abandoned leases require runtime cleanup. No automatic expiry, storage GC, or claim of exhaustive fuzz coverage.
The independently verified production fix is isolated in 2b2d497cc945c33ba4674b71c04f2ffd65221aff so benchmark qualification can pin the optimized candidate without depending on test additions.
Request per-row position detail for JSON output on both ordinary and shared server paths. Cover UTF-8 match/context byte offsets and submatches against scans and local indexes.
Co-authored-by: Copilot App <[email protected]>
Compose seeded three-worktree transitions against scan and independent membership/line oracles, require actual shared backend use, and combine real process recovery with persisted caller leases. Document bounded replay and runtime-owned cleanup contracts.
Co-authored-by: Copilot App <[email protected]>
Keep queries active until lifecycle teardown completes and require phase-tagged successful replies before and after each operation, with deadline and disconnect cancellation.
Co-authored-by: Copilot App <[email protected]>
Avoid panic when child exits between try_wait and kill
tgrep-cli/tests/shared_daemon/runtime.rs:36
There is a TOCTOU race between try_wait and kill: the child can exit after try_wait returns None, causing kill().unwrap() to panic even though cancellation is complete. This can replace the intended timeout diagnostics with an unrelated panic. Recheck the child status when kill fails, and only fail if it is still running.
Recheck exit status if killing a previously-running child fails, preserving timeout diagnostics when the child won the race. Exercise repeat cancellation after reaping.
Co-authored-by: Copilot App <[email protected]>
Addressed the final-head review summary cancellation concern in 275e0af: if kill fails after try_wait observed a running child, recheck exit status and only fail if it remains running. Repeat cancellation after reaping is exercised too. Targeted runtime tests pass on Windows (10.62s) and native-ext4 Linux (1.84s); fmt/clippy pass. Prior head 390413f passed every automatic check, including all three OS test jobs; the follow-up gets normal automatic CI (no manual rerun executed).
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
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.
Summary
--no-indexand a simple independent membership/line model at acknowledged refresh barriers; require RPC backend identity and CLI shared-use counters so fallback cannot make parity pass.-F -ithrough base/overlay/ignore/restart states, hidden/filename-only membership, legitimate no-results, line/count/match/file output, and JSON semantics including offsets, submatches and totals. Native-watch coverage additionally requires event-driven publication before explicit refresh.Backwards-compatible opt-in two-layer design is unchanged. No cache/GC/migration redesign, Copilot integration changes, README changes or workflow changes. Based on verified main
e9d55dbbf232f0e228695f15a640cf207d4b3348(including #174).Validation
Windows and native-ext4 WSL Linux, no DrvFS watcher tests:
tgrep-cli --bin tgreptgrep-cli --test ripgrep_compattgrep-cli --test shared_daemontgrep-core --test shared_worktreestgrep-core --lib worktrees::testscargo fmt --all -- --checkandcargo clippy --workspace --all-targets -- -D warningspass on both. Alternate Linux seed7, two rounds per watch mode plus runtime exerciser: 3 passed, 1 subprocess entry ignored, 18.89s. Platform counts differ because existing tests are platform-gated.Selectors and replay
Default seed is
1742026, rounds1; accepted rounds1..16. Failures print seed/rounds/ordered operation log. The ignoredruntime::runtime_client_processis invoked by the supervisor, not a standalone test. Readiness is not latest-disk proof; abandoned leases require runtime cleanup. No automatic expiry, storage GC, or claim of exhaustive fuzz coverage.The independently verified production fix is isolated in
2b2d497cc945c33ba4674b71c04f2ffd65221affso benchmark qualification can pin the optimized candidate without depending on test additions.