land: honest-walk-partials

AF
3h ago
+2108-187

Accepted agent delivery; branch-keyed search descriptor included.


Summary by cubic

Changes glob, grep, and outline on large directories outside the project (such as ~/.cargo/registry/src) so a slow walk returns the files found so far, marked as a partial walk, instead of failing with a read_blocked error. read_blocked is now reserved for one filesystem call that stops making progress; the reply names that path, and a walk that stalls keeps what it had already found.

  • Walks are bounded at the iterator level with their own deadline, so a walk that is slow but still moving is never reported as blocked.
  • Per-entry progress is now tracked inside each directory, not just per directory, so a large directory whose entry checks each return promptly counts as progress rather than a stall.
  • A walk that stalls after finding results keeps them: the reply sets complete: false and lists the stalled path in its gaps, with a trailing read_blocked line. A stall before any results is still the read_blocked error.
  • A walk past its deadline, or one the request stops waiting for, ends at its next entry instead of filtering the rest; entry filters previously hid entries while the ignore walker kept reading, holding the helper slot. The helper frees its slot before sending its reply, and the probe helper's slot is retained until it finishes.
  • Fallback walks snapshot each match's mtime and the resolved filter root during the walk, so partial results sort in memory without post-walk filesystem access.
  • The walk-expiry tests trigger expiry by entry count instead of wall clock, so they no longer flake on loaded CI runners.

RetriggerView in GreptileConfidence Score: 5/5

The latest changes appear safe to merge; no new actionable issue was found.

Summary

Directory walks now keep partial results when time runs out or a filesystem call stalls.

  • A slow filesystem walk now returns partial results instead of a blocked-read error.
  • Glob keeps matches found before a fallback walk stops.
  • Grep keeps files found before a fallback walk stops.
  • Outline keeps discovered files when a fallback walk stops early.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Bounded directory walk] --> B[Publish file and unknown modification time]
    B --> C[Read modification time inside helper]
    C --> D{Walk ends}
    D -->|Finished| E[Take snapshot]
    D -->|Stopped| E
    E --> F[Sort snapshot without filesystem calls]
    F --> G[Return files and completeness]

Reviews (6) · Last reviewed commit: "search-quality descriptor: one engine_un..." · Reviewed by Greptile